zhaoyun 13 hours ago
parent
commit
d0228876d5

+ 180 - 37
mer_uniapp/pages/rider_index/order/detail.vue

@@ -11,13 +11,18 @@
 		</view>
 		<view class="order-detail pos-order-details">
 			<view class="header">
-				<view class="state">{{ info.refundStatus != 3?orderStatus[info.status]:'已退款' }}</view>
-				<view v-if="[1,2].includes(info.status)&&info.refundStatus != 3" class="data">您已接单,请及时到店取货哦~</view>
+				<view class="state">{{ info.refundStatus != 3?orderStatus[orderInfo.status]:'已退款' }}</view>
+				<view v-if="[0].includes(orderInfo.status)&&info.refundStatus != 3" class="data">等待骑手接单~</view>
+				<view v-if="[1].includes(orderInfo.status)&&info.refundStatus != 3" class="data">您已接单,请及时到店取货哦~</view>
+				<view v-if="[2].includes(orderInfo.status)&&info.refundStatus != 3" class="data">订单配送中,正在努力赶往用户所在地!</view>
+				<view v-if="[3].includes(orderInfo.status)&&info.refundStatus != 3" class="data">订单已送达,等待用户收货确认!</view>
+				<view v-if="[4,5,6].includes(orderInfo.status)&&info.refundStatus != 3" class="data">订单已经完成,您可以提现啦~</view>
+				<!-- <view v-if="[1,2].includes(info.status)&&info.refundStatus != 3" class="data">您已接单,请及时到店取货哦~</view> -->
 <!-- 				<view v-if="info.refundStatus != 3&&info.status == 3" class="data">用户已下单,您可以联系用户到店自提!</view>
- -->				<view v-if="info.refundStatus != 3&&info.status == 4" class="data">订单配送中,正在努力赶往用户所在地!</view>
+ -->			<!-- <view v-if="info.refundStatus != 3&&info.status == 4" class="data">订单配送中,正在努力赶往用户所在地!</view>
 				<view v-if="info.refundStatus != 3&&info.status == 5" class="data">订单已送达,等待用户收货确认!</view>
 				<view v-if="info.refundStatus != 3&&info.status == 6" class="data">订单已经完成,您可以提现啦~</view>
-				<view v-if="info.refundStatus == 3" class="data">此订单退款已原路返回!</view>
+				<view v-if="info.refundStatus == 3" class="data">此订单退款已原路返回!</view> -->
 			</view>
 			<!--view class="remarks acea-row row-middle">
 				<text class="iconfont icon-ic_notes"></text>
@@ -25,22 +30,26 @@
 					{{info.merchantRemark ? info.merchantRemark : '订单未备注'}}
 				</view>
 			</view-->
-			<view class="address" v-if="info.shippingType==1&&info.secondType!=2">
-				<view class="name">
-					<text class="iconfont icon-ic_location4"></text>
+			<view class="address">
+				<view class="name"  @click="goMap(orderInfo.userLatitude,orderInfo.userLongitude,orderInfo.userName,orderInfo.userAddress)">
+					<text class="iconfont icon-chakanditu"></text>
 					{{ info.realName}}
 					<text class="phone">{{ info.userPhone }}</text>
 				</view>
-				<view v-if="info.shippingType == 1">地址:{{ info.userAddress }}</view>
+				<view>地址:{{ info.userAddress }}</view>
+				<!-- <view class="map" @click="goMap(item)">
+					<text class="iconfont icon-chakanditu"></text>
+					<view class="map_text">查看地图</view>
+				</view> -->
 			</view>
 			<view class="acea-row row-middle user-box">
 				<!--image :src="info.avatar" class="image"></image-->
-				<view class="text">
-					<view class="iconfont icon-ic_location4 acea-row row-middle name">
+				<view class="text" >
+					<view class="iconfont icon-chakanditu acea-row row-middle name"  @click="goMap(orderInfo.merLatitude,orderInfo.merLongitude,orderInfo.merName,orderInfo.merAddress)">
 						{{orderInfo.merName}}
 					</view>
-					<view v-if="orderInfo.merPhone" class="">{{orderInfo.merPhone}}</view>
-					<view v-if="info.shippingType == 1">地址:{{ orderInfo.merAddress }}</view>
+					<view v-if="orderInfo.merPhone" class="phone">{{orderInfo.merPhone}}</view>
+					<view>地址:{{ orderInfo.merAddress }}</view>
 				</view>
 			</view>
 			<!-- 未拆单时,正常单 -->
@@ -57,7 +66,7 @@
 						</view>
 					</view>
 					<view class="money">
-						<BaseMoney :money="item.price" symbolSize="20" integerSize="32" decimalSize="20"></BaseMoney>
+						<!--BaseMoney :money="item.price" symbolSize="20" integerSize="32" decimalSize="20"></BaseMoney-->
 						<view class="num">共{{ item.payNum }}件</view>
 						<view class="acea-row row-right">
 							<view class="writeOff" v-if="item.refundNum">
@@ -89,6 +98,10 @@
 					<view>下单时间:</view>
 					<view class="conter">{{ info.payTime }}</view>
 				</view>
+				<view class="item acea-row row-between" v-show="info.acceptDate">
+					<view>接单时间:</view>
+					<view class="conter">{{ info.acceptDate }}</view>
+				</view>
 				<!--view class="item acea-row row-between">
 					<view>支付方式:</view>
 					<view class="conter">
@@ -114,7 +127,7 @@
 					<view v-if="Number(info.secondType) > 4" class='conter'>自动发货</view>
 					<view v-else-if="Number(info.secondType) == 2" class='conter'>虚拟发货</view>
 					<view class="conter" v-else>
-						{{info.shippingType==1?'骑手配送':info.shippingType==2?'到店自提':'虚拟发货'}}
+						{{info.shippingType==4?'骑手配送':(info.shippingType==1?'商家配送':(info.shippingType==2?'到店自提':'虚拟发货'))}}
 					</view>
 				</view>
 			</view>
@@ -123,8 +136,8 @@
 			</view>
 			<view class="wrapper">
 				<view class='item acea-row row-between'>
-					<view>商品总价(共{{info.totalNum}}件)</view>
-					<view class='conter'>¥{{info.proTotalPrice}}</view>
+					<view>商品总</view>
+					<view class='conter'>{{info.totalNum}}件</view>
 				</view>
 				<view class="item acea-row row-between">
 					<view>配送费</view>
@@ -153,8 +166,8 @@
 				</view-->
 			</view>
 			<view class="height-add"></view>
-			<!--view class="footer acea-row row-right row-middle">
-				<view class="tomore" v-if="info.status==2&&!info.userRefundSign">
+			<view class="footer acea-row row-right row-middle">
+				<!-- <view class="tomore" v-if="info.status==2&&!info.userRefundSign">
 					<span @click="toMore">更多</span>
 					<view class="more-operate" v-if="moreShow">
 						<view class="sjx"></view>
@@ -165,23 +178,20 @@
 							订单备注
 						</view>
 					</view>
+				</view> -->
+				
+				<view class="bnt delivery" @click="complete()" v-if="orderInfo.status==2">
+					配送完成</view>
+				<view class="bnt delivery" v-if="orderInfo.status==0"
+					@click="receiving()">立即接单</view>
+				<view class="bnt delivery" v-if="orderInfo.status==1"
+					@click="pickUp()">取货配送
 				</view>
-				<view class="bnt cancel" @click="print" v-if="info.status!=2||(info.status==2&&info.userRefundSign)">
-					小票打印</view>
-				<view class="bnt cancel" @click="modify('1')"
-					v-if="info.status!=2||(info.status==2&&info.userRefundSign)">订单备注</view>
-				<view class="bnt cancel" v-if="!info.userRefundSign&&info.totalNum!=refundSum" @click="modify('2',1)">
-					直接退款</view>
-				<view class="bnt delivery" v-if="[1,2].includes(info.status)&&info.refundStatus != 3"
-					@click="goDelivery(info)">立即发货</view>
-				<view class="bnt delivery" v-if="[2,4,5,6].includes(info.status)&&info.shippingType=='1'"
-					@click="goLogistics(info)">发货记录
-				</view>
-				<view class="bnt delivery" v-if="info.status==3&&info.refundStatus!=3" @click="verify">立即核销</view>
+				<!-- <view class="bnt delivery" v-if="info.status==3&&info.refundStatus!=3" @click="verify">立即核销</view> -->
 			</view>
-			<PriceChange :change="change" :orderInfo="info" :isRefund="isRefund"
+			<!-- <PriceChange :change="change" :orderInfo="info" :isRefund="isRefund"
 				v-on:statusChange="statusChange($event)" v-on:closechange="changeclose($event)"
-				v-on:savePrice="savePrice" :status="status"></PriceChange-->
+				v-on:savePrice="savePrice" :status="status"></PriceChange -->
 		</view>
 		<uni-popup ref="hs_popup" background-color="#fff" borderRadius="10px">
 			<view class="sh_popup-content"
@@ -219,7 +229,7 @@
 		printReceipt
 	} from '@/api/work.js';
 	import {
-		riderOrderInfo
+		riderOrderInfo,riderOrderReceiving,orderPickUp,orderComplete
 	} from '@/api/rider.js';
 	import {
 		isMoney
@@ -250,8 +260,8 @@
 					'wechatAndroid': '微信Android支付',
 					'alipay': '支付宝支付',
 					'alipayApp': '支付宝App支付'
-				},
-				orderStatus: ['待支付', '待取餐', '部分发货', '待核销', '配送中', '已送达', '已完成', '已取消'],
+				}, 
+				orderStatus: ['待接单', '待取货', '配送中', '已完成'],
 				openErp: false,
 				giveData: {
 					give_integral: 0,
@@ -297,14 +307,14 @@
 				});
 			});
 			// #endif
-			this.initOrderInfo(this.orderNo)
+			this.initOrderInfo(this.orderInfo.orderNo)
 		},
 		onLoad(options) {
 
 			this.orderInfo=JSON.parse(options.orderInfo);
 			//this.orderNo = options.orderNo
 			//this.deliveCharge=options.deliveCharge
-			this.initOrderInfo(this.orderInfo.orderNo)
+			//this.initOrderInfo(options.orderInfo.orderNo)
 		},
 		onPageScroll(e) {
 			// #ifdef MP || APP-PLUS
@@ -318,6 +328,96 @@
 			// #endif
 		},
 		methods: {
+			//查看内置地图
+			goMap(latitude,longitude,merName,address) {
+				let that = this;
+				// let latitude=item.status==1 || item.status==0?item.merLatitude:item.userLatitude;
+				// let longitude=item.status==1 || item.status==0?item.merLongitude:item.userLongitude;
+				// let merName=item.status==1 || item.status==0?item.merName:item.userName;
+				// let address=item.status==1 || item.status==0?item.merAddress:item.userAddress;
+				//#ifdef H5
+				if (that.$wechat.isWeixin() === true) {
+					that.$wechat.seeLocation({
+						latitude: parseFloat(latitude),
+						longitude: parseFloat(longitude),
+						name: merName,
+						address: address,
+					}).then(res => {
+						console.log('success');
+					})
+				} else {
+					//#endif
+					uni.openLocation({
+						latitude: parseFloat(latitude),
+						longitude: parseFloat(longitude),
+						scale: 8,
+						name: merName,
+						address: address,
+						success: function(res) {
+							that.go_map = true
+						},
+					});
+					// #ifdef H5
+				}
+				//#endif
+			},
+			//接单
+			receiving() {
+				riderOrderReceiving(this.orderInfo).then(res => {
+					 if (res.code == 200) {
+						 setTimeout(() => {
+						 	uni.navigateTo({
+						 		url: '/pages/rider_index/order/index?type=pickUp&orderType=0'
+						 	});
+						 }, 50)
+						 return this.$util.Tips({
+						 	title: '接单成功'
+						 })
+					 } else {
+					 	self.$util.Tips({
+					 		title: res.message
+					 	});
+					 }
+				})
+			},
+			//取货
+			pickUp() {
+				orderPickUp(this.orderInfo.orderNo).then(res => {
+					 if (res.code == 200) {
+						 setTimeout(() => {
+						 	uni.navigateTo({
+						 		url: '/pages/rider_index/order/index?type=delivery&orderType=0'
+						 	});
+						 }, 50)
+						 return this.$util.Tips({
+						 	title: '取件完成,请尽快安排配送'
+						 })
+					 } else {
+					 	self.$util.Tips({
+					 		title: res.message
+					 	});
+					 }
+				})
+			},
+			//收货完成
+			complete() {
+				orderComplete(this.orderInfo.orderNo).then(res => {
+					 if (res.code == 200) {
+						 setTimeout(() => {
+						 uni.navigateTo({
+								url: '/pages/rider_index/order/index?type=complete&orderType=0'
+							 });
+						 }, 50)
+						 return this.$util.Tips({
+						 	title: '配送完成'
+						 })
+					 } else {
+					 	self.$util.Tips({
+					 		title: res.message
+					 	});
+					 }
+				})
+			},
 			hsPopupClose() {
 				this.$refs.hs_popup.close()
 			},
@@ -449,6 +549,24 @@
 					self.webCopy(items, indexs)
 				}
 			},
+			//发送货
+			goDelivery(item) {
+				if (item.refundStatus == 1) return this.$util.Tips({
+					title: '请处理售后,再操作',
+				});
+				uni.navigateTo({
+					url: `/pages/admin/order/send?orderNo=${item.orderNo}`
+				})
+			},
+			// 商品操作
+			modify: function(item, status, type) {
+				this.change = true;
+				this.status = status.toString();
+				this.orderInfo = item;
+				if (status == 2) {
+					this.isRefund = type
+				}
+			},
 			// #endif
 		}
 	};
@@ -1271,4 +1389,29 @@
 	.order-details .wrapper {
 		padding: 0;
 	}
+	.map {
+		text-align: center;
+		padding-right: 1rpx;
+		position: relative;
+		@include main_color(theme);
+	
+		// &::before {
+		// 	content: '';
+		// 	display: inline-block;
+		// 	width: 2rpx;
+		// 	height: 42rpx;
+		// 	background-color: #DDDDDD;
+		// 	position: absolute;
+		// 	left: 0;
+		// 	top: 18rpx;
+		// }
+	
+		.iconfont {
+			color: var(--view-theme);
+		}
+	
+		.map_text {
+			color: var(--view-theme);
+		}
+	}
 </style>

+ 25 - 0
mer_uniapp/pages/rider_index/order/index.vue

@@ -770,4 +770,29 @@
 		height: 100%;
 		border-left: 1rpx dashed $bg-color-primary;
 	}
+	.map {
+		text-align: center;
+		padding-left: 36rpx;
+		position: relative;
+		@include main_color(theme);
+	
+		&::before {
+			content: '';
+			display: inline-block;
+			width: 2rpx;
+			height: 42rpx;
+			background-color: #DDDDDD;
+			position: absolute;
+			left: 0;
+			top: 18rpx;
+		}
+	
+		.iconfont {
+			color: var(--view-theme);
+		}
+	
+		.map_text {
+			color: var(--view-theme);
+		}
+	}
 </style>