瀏覽代碼

Signed-off-by: 1004749546@qq.com <1004749546@qq.com>
订单详情

1004749546@qq.com 4 年之前
父節點
當前提交
1ebc144546
共有 2 個文件被更改,包括 192 次插入120 次删除
  1. 51 54
      pages/order/order.vue
  2. 141 66
      pages/order/orderDetail.vue

+ 51 - 54
pages/order/order.vue

@@ -44,11 +44,11 @@
 									<u-button class="btn-cont" shape="circle" size="medium">提醒发货</u-button>
 								</view>
 								<view v-if="item.orderFlag=='已发货'" class="text-right">
-									<u-button class="btn-cont" style="margin-right: 20upx;" shape="circle" size="medium">查看物流</u-button>
+									<u-button @click="showLog(item)" class="btn-cont" style="margin-right: 20upx;" shape="circle" size="medium">查看物流</u-button>
 									<u-button class="btn-cont" shape="circle" type="primary" size="medium">确认收货</u-button>
 								</view>
 								<view v-if="item.orderFlag=='已完成'" class="text-right">
-									<u-button class="btn-cont" shape="circle" size="medium">查看物流</u-button>
+									<u-button @click="showLog(item)" class="btn-cont" shape="circle" size="medium">查看物流</u-button>
 								</view>
 							</view>
 						</view>
@@ -61,6 +61,21 @@
 				</swiper-item>
 			</swiper>
 		</view>
+		 <!-- 查看物流弹窗 -->
+		<view>
+			<u-modal v-model="isShow" :show-title="false" confirm-text="好的">
+				<view class="slot-content">
+					<view>
+						快递公司:{{logData.logName}}
+					</view>
+					<view>
+						运单编号:{{logData.logNum}}
+						<u-button @click="copyLogNum" style="margin-left: 20upx;" shape="square" size="mini">复制</u-button>
+					</view>
+				</view>
+			</u-modal>
+		</view>
+		
 		<!-- 待办单查询弹框 -->
 		<!-- <search-modal :visible="showSearch" @refresh="refresh" @close="showSearch=false"></search-modal> -->
 	</view>
@@ -81,14 +96,9 @@
 		},
 		data() {
 			return {
-				showSearch: false, // 是否显示搜索弹框
-				searchParams: {}, // 全部查询数据参数
+				isShow: false, // 是否显示物流弹框
 				status: 'loadmore',
 				noDataText: '暂无数据',
-				background: {
-					// 渐变色
-					backgroundImage: 'linear-gradient(45deg, rgb(85, 170, 255), rgb(21, 102, 223))'
-				},
 				tabList: [
 					{
 						dispName: '全部',
@@ -122,26 +132,15 @@
 				pageNo: 1,
 				pageSize: 10,
 				list: [],
+				logData: { // 物流信息
+					logName: '韵达快递',
+					logNum: 12356544544
+				},
 				total: 0,
 				action: 'swiperChange', // 操作类型,上划分页,或左右滑动
 			}
 		},
 		onLoad() {
-			if (this.$hasPermissions("B_todoList_new_mobile")) {
-				// #ifdef APP-PLUS
-				// 设置标题栏按钮
-				let currentWebview = this.$scope.$getAppWebview();
-				currentWebview.setTitleNViewButtonStyle(0, {
-					text: '\ue610 新增',
-					fontSize: 16,
-					color: '#eee',
-					width: '80px',
-					fontSrc: '/static/iconfont/iconfont.ttf'
-				});
-				// #endif
-			}
-			// 监听新增后刷新
-			uni.$on('refreshBL', this.refresh)
 			// 监听待办处理后刷新
 			uni.$on('refreshBl-handle', this.handleRefresh)
 			this.pageInit()
@@ -153,7 +152,6 @@
 		methods: {
 			pageInit() {
 				this.sortIndex = 1
-				this.searchParams = {}
 				this.pageNo = 1
 				this.getRow()
 			},
@@ -286,14 +284,6 @@
 					pageSize: this.pageSize,
 					queryLabel: this.tabList[this.current].queryLabel, // tab分类
 				}
-				if (params.queryLabel == 'ALL') {
-					params.statusList = this.searchParams.status ? this.searchParams.status : [] // 状态(pending 待整改 check_pending待审核 finished 整改完成 expired 已过期)
-					params.sourceTypeList = this.searchParams.sourceType ? this.searchParams.sourceType : [] // 问题来源(远程巡店 VIDEO_INSPECTION /现场巡店 SPOT_INSPECTION/点检 POINT_INSPECTION /手动创建  MANUAL)
-					params.putUserName = this.searchParams.putUserName ? this.searchParams.putUserName : '' // 巡店人
-					params.storeName = this.searchParams.storeName ? this.searchParams.storeName : '' // 门店名称
-					params.beginDate = this.searchParams.beginDate ? this.searchParams.beginDate : '' // 发起开始时间
-					params.endDate = this.searchParams.endDate ? this.searchParams.endDate : '' // 发起结束时间
-				}
 				this.status = "loading"
 				getBackLogList(params).then(res => {
 					if (res.status == 200) {
@@ -329,37 +319,36 @@
 				this.searchParams = params
 				this.getRow(1)
 			},
-			// 新增页
-			onNavigationBarButtonTap(e) {
-				uni.navigateTo({
-					url: "/pages/toDoList/addBacklog"
+			// 查看物流
+			showLog (item) {
+				this.isShow = true
+			},
+			// 复制运单编号 
+			copyLogNum () {
+				// H5 不支持
+				uni.setClipboardData({
+					data: this.logData.logNum,
+					success: function(res) {
+						uni.getClipboardData({
+							success: function(res) {
+								uni.showToast({
+									title: '已复制到剪贴板'
+								});
+							}
+						});
+					}
 				})
 			},
 			// 详细页
 			viewRow(item) {
-				if (!this.$hasPermissions('M_backlog_detail_mobile')) {
-					return
-				}
+				// if (!this.$hasPermissions('M_backlog_detail_mobile')) {
+				// 	return
+				// }
 				// 已完成的
 				uni.navigateTo({
 					url: "/pages/toDoList/backlogDetail?id=" + item.id
 				})
 			},
-			// 状态颜色处理
-			clsStatus(status) {
-				if (status == '待审核') {
-					return 'dsh'
-				}
-				if (status == '待整改') {
-					return 'dzg'
-				}
-				if (status == '整改完成') {
-					return 'ywc'
-				}
-				if (status == '已过期') {
-					return 'ygq'
-				}
-			}
 		}
 	}
 </script>
@@ -493,5 +482,13 @@
 				}
 			}
 		}
+		// 物流弹窗
+		.slot-content {
+			padding: 40upx 60upx;
+			font-size: 28upx;
+			>view{
+				line-height: 60upx;
+			}
+		}
 	}
 </style>

+ 141 - 66
pages/order/orderDetail.vue

@@ -1,57 +1,67 @@
 <template>
 	<view class="order-pages">
 		<view class="order-info">
-			<u-cell-group>
-				<u-cell-item title="订单状态" :arrow="false">
-					<view slot="right-icon">
-						<text :class="orderInfo.orderStatus">{{getOptionName(orderStatusList,orderInfo?orderInfo.orderStatus:'')}}</text>
+			<!-- 订单状态 -->
+			<view class="order-status">
+				<view class="status-title">{{orderInfo.orderFlag}}</view>
+				<view v-if="orderInfo.orderFlag=='待支付'" class="status-care">
+					请在 <text>2020-10-30</text>前付款,过期系统将自动取消订单
+				</view>
+				<view v-if="orderInfo.orderFlag=='已取消'" class="status-care">
+					超时未支付,系统已自动取消订单
+				</view>
+			</view>
+			<u-gap height="10" bg-color="#f8f8f8"></u-gap>
+			<!-- 地址 -->
+			<view class="order-address">
+				<view>
+					<text class="address-title">{{orderInfo.address}}</text>
+				</view>
+				<view>
+					<text style="margin-right: 30upx;">{{orderInfo.userName}}</text>
+					<text>{{orderInfo.phone}}</text>
+				</view>
+			</view>
+			<u-gap height="10" bg-color="#f8f8f8"></u-gap>
+			<!-- 商品列表 -->
+			<view class="bundle-list" v-for="item in orderInfo.itemList" :key="item.id">
+				<view class="img-cont">
+					<image :src="item.icon?item.icon:'../../static/tabbar/user.png'"></image>
+				</view>
+				<view >
+					<view class="ellipsis-two">{{item.name}}</view>
+					<view class="bundle-num">
+						<view ><b class="price-num">{{item.price}}</b> <text class="price-text">乐豆</text></view>
+						<view >X {{item.number}}</view>
 					</view>
-				</u-cell-item>
-				<u-cell-item title="订单编号" :arrow="false" >
+				</view>
+			</view>
+			<u-gap height="10" bg-color="#f8f8f8"></u-gap>
+			<!-- 订单信息 -->
+			<u-cell-group>
+				<u-cell-item title="订单编号" :value-style="{color: '#000',fontSize: '28upx'}" :arrow="false" >
 					{{orderInfo.orderNo}}
 				</u-cell-item>
-				<u-cell-item title="创建时间" :arrow="false" >
+				<u-cell-item title="下单时间" :value-style="{color: '#000',fontSize: '28upx'}" :arrow="false" >
 					{{orderInfo.orderTime}}
 				</u-cell-item>
-				<u-cell-item title="服务网点" :arrow="false">
-					{{orderInfo.storeName}}
-				</u-cell-item>
-				<u-cell-item title="服务项目" :arrow="false">
-					{{orderInfo.itemName}}
-				</u-cell-item>
-				<u-cell-item title="手机号" :arrow="false">
-					{{orderInfo.customerMobile}}
-				</u-cell-item>
-				<u-cell-item v-if="orderInfo.payType" title="支付方式" :arrow="false">
-					{{orderInfo.payType}}
+				<u-cell-item v-if="orderInfo.payTime" title="支付时间" :value-style="{color: '#000',fontSize: '28upx'}" :arrow="false">
+					{{orderInfo.payTime}}
 				</u-cell-item>
-				<u-cell-item title="应付金额" :arrow="false">
-					¥{{orderInfo.payableAmount}}
+				<u-gap height="10" bg-color="#f8f8f8"></u-gap>
+				<u-cell-item title="商品合计" :value-style="{color: '#000',fontSize: '28upx'}" :arrow="false">
+					<text class="price-num">{{orderInfo.amount}}</text> <text class="price-text">乐豆</text>
 				</u-cell-item>
-				<!-- 已取消订单优惠金额显示0 -->
-				<u-cell-item title="优惠金额" :arrow="false">
-					{{(orderInfo.couponAmount && orderInfo.orderStatus!='CANCELED')?orderInfo.couponAmount:0}}
+				<u-cell-item title="运费" :value-style="{color: '#000',fontSize: '28upx'}" :arrow="false">
+					免运费
 				</u-cell-item>
-				<u-cell-item v-if="orderInfo.orderCoupons && orderInfo.orderCoupons.length" title="优惠券" :arrow="false">
-					{{orderInfo.orderCoupons[0].couponTitle}}
-				</u-cell-item>
-				<u-cell-item title="实付金额" :arrow="false">
-					<text class="order-price">¥{{orderInfo.payStatus=='PAID' ? orderInfo.paymentAmount : 0}}</text>
+				<u-cell-item :title="(orderInfo.orderFlag=='待支付'||orderInfo.orderFlag=='已取消') ? '待支付':'实际支付'" :value-style="{color: '#000',fontSize: '28upx'}" :arrow="false">
+					<b class="price-num">{{orderInfo.amount}}</b> <text class="price-text">乐豆</text>
 				</u-cell-item>
 			</u-cell-group>
-			<view class="order-photo">
-				<view v-if="orderInfo.beginImage">
-					<view>洗车前</view>
-					<u-image @click="showImage(orderInfo.beginImage)" width="100%" height="400rpx" mode="aspectFit" :src="orderInfo.beginImage"></u-image>
-				</view>
-				<view v-if="orderInfo.endImage">
-					<view>洗车后</view>
-					<u-image @click="showImage(orderInfo.endImage)" width="100%" height="400rpx" mode="aspectFit" :src="orderInfo.endImage"></u-image>
-				</view>
-			</view>
 		</view>
-		<view v-if="orderInfo.orderStatus=='UN_PAY'" class="footer">
-			<u-button @click="cancleOrder" type="error" plain>取消订单</u-button>
+		<view v-if="orderInfo.orderFlag=='待支付'" class="footer">
+			<u-button @click="cancleOrder" type="warning" >去支付</u-button>
 		</view>
 	</view>
 </template>
@@ -62,7 +72,34 @@
 	export default{
 		data() {
 			return {
-				orderInfo: null,
+				orderInfo: {
+					address: '陕西省西安市未央区常青二路大明宫小区',
+					userName: '王明',
+					phone: '18792701023',
+					orderTime: "2020-10-28 11:15:59",
+					orderFlag: "待支付",
+					orderNo: 121245465748,
+					payedAmount: 0,
+					id: 11,
+					amount: 450,
+					totalNum: 3,
+					itemList: [
+						{
+							name: "八九箭冠",
+							id: 76435,
+							number: 1,
+							price: 150,
+							icon: ''
+						},
+						{
+							name: "数据库的合法身份觉得很附近发生纠纷解决",
+							id: 76436,
+							number: 2,
+							price: 150,
+							icon: ''
+						}
+					]
+				},
 				src: '',
 				orderStatusList: []
 			}
@@ -128,47 +165,85 @@
 <style lang="scss">
 	page {
 		height: 100%;
+		background-color: #fff;
 	}
 	.order-pages{
 		width: 100%;
 		height: 100%;
+		padding: 0 24upx;
 		display: flex;
 		flex-direction: column;
 		.order-info{
 			width: 100%;
 			flex: 1;
 			overflow-y: scroll;
-			.u-cell{
-				padding:10rpx 32rpx;
-			}
-			.order-photo{
-				padding:0 30rpx;
-				>view{
-					text-align: center;
-					padding: 20rpx;
+			// 状态
+			.order-status{
+				padding: 30upx 0;
+				text-align: center;
+				.status-title{
+					font-size: 36upx;
+					color: #000;
+				}
+				.status-care{
+					font-size: 24upx;
+					margin-top: 10upx;
+					color: #a9aaac;
+					>text {
+						color: red;
+					}
 				}
 			}
-			.FINISHED{
-				color: #00aa00;
-			}
-			.UN_PAY{
-				color: #ff0000;
-			}
-			.CANCELED{
-				color: #7e7b88;
+			// 地址
+			.order-address {
+				font-size: 32upx;
+				padding: 20upx 0;
+				>view {
+					line-height: 60upx;
+				}
+				.address-title {
+					color: #000;
+				}
 			}
-			.PAID{
-				color: #00aaff;
+			// 订单中商品列表
+			.bundle-list {
+				display: flex;
+				padding: 20upx 10upx;
+				font-size: 28upx;
+				border-bottom: 1px solid #F8F8F8;
+				.img-cont {
+					width: 160upx;
+					height: 160upx;
+					>image {
+						width: 100%;
+						height: 100%;
+					}
+				}
+				
+				>view {
+					&:last-child {
+						padding: 10upx 0;
+						flex: 1;
+						margin-left: 20upx;
+						display: flex;
+						flex-direction: column;
+						justify-content: space-between;
+					}
+				}
+				.bundle-num {
+					display: flex;
+					justify-content: space-between;
+				}
 			}
-			.REFUNDING{
-				color: #00557f;
+			.price-text{
+				font-size: 20upx;
+				margin-left: 10upx;
 			}
-			.REFUNDED{
-				color: #005500;
+			.price-num{
+				font-size: 32upx;
 			}
-			.order-price{
-				font-size: 36rpx;
-				color: red;
+			.u-cell{
+				padding:10rpx 32rpx;
 			}
 		}
 		.footer{