|
@@ -2,7 +2,7 @@
|
|
|
<div>
|
|
|
<el-row class="track-detail">
|
|
|
<!-- 订单追踪、订单详情 -->
|
|
|
- <el-col :span="7" v-loading="!orderDetailStutus && !showTrack" element-loading-text="拼命加载中">
|
|
|
+ <el-col :span="7" v-loading="!orderDetailStutus && !showTrack" element-loading-text="拼命加载中">
|
|
|
<div class="order_detail">
|
|
|
<div class="detail_title">
|
|
|
<div v-show="buttonStatus !== 0 && buttonStatus !== 10" class="detail_txt" @click="orderDetailStutus = 0" :class="{ detail_txt_ac: !orderDetailStutus }">
|
|
@@ -12,7 +12,7 @@
|
|
|
订单详情
|
|
|
</div>
|
|
|
</div>
|
|
|
- <order-track v-show="showTrack" :hasLocation="hasLocation" :buttonStatus="buttonStatus" :trackOrder="trackOrder" v-if="!orderDetailStutus && needTrack"></order-track>
|
|
|
+ <order-track v-show="showTrack" :riderArriveTime="riderArriveTime" :buttonStatus="buttonStatus" :trackOrder="trackOrder" v-if="!orderDetailStutus && needTrack"></order-track>
|
|
|
<order-detail v-show="showDetail" :buttonStatus="buttonStatus" :orderDetail="orderDetail" v-else></order-detail>
|
|
|
<!-- 订单跟踪、订单详情底部按钮 -->
|
|
|
<div class="bottom-btns" v-show="showDetail || showTrack">
|
|
@@ -289,6 +289,7 @@ import {
|
|
|
trackOrder,
|
|
|
detailOrder,
|
|
|
tips,
|
|
|
+ getRiderArriveTime,
|
|
|
getPayResult,
|
|
|
getMapData,
|
|
|
} from "../../api/order.js";
|
|
@@ -354,8 +355,8 @@ export default {
|
|
|
link: "",
|
|
|
buttonStatus: 0,
|
|
|
exceptTime: "",
|
|
|
- hasLocation: false, // 是否有骑手位置
|
|
|
delayTime: "", // 预约延迟时间
|
|
|
+ riderArriveTime: {}, //骑手预计取货送达时间
|
|
|
};
|
|
|
},
|
|
|
props: {
|
|
@@ -376,7 +377,6 @@ export default {
|
|
|
list: {
|
|
|
handler(newVal, oldVal) {
|
|
|
this.buttonStatus = newVal.length ? newVal[0].buttonStatus : 0;
|
|
|
- this.hasLocation = newVal.length ? !!newVal[0].orderDistance : false;
|
|
|
if (this.buttonStatus === 0 || this.buttonStatus === 10) {
|
|
|
this.needTrack = false;
|
|
|
this.orderDetailStutus = 1;
|
|
@@ -386,6 +386,7 @@ export default {
|
|
|
}
|
|
|
this.getDetailOrder();
|
|
|
this.getTrackOrder();
|
|
|
+ this.getRiderArriveTime();
|
|
|
},
|
|
|
immediate: true,
|
|
|
},
|
|
@@ -574,7 +575,6 @@ export default {
|
|
|
},
|
|
|
chooseOrder(v, index) {
|
|
|
this.buttonStatus = this.list[index].buttonStatus;
|
|
|
- this.hasLocation = !!this.list[index].orderDistance;
|
|
|
if (this.buttonStatus === 0 || this.buttonStatus === 10) {
|
|
|
this.needTrack = false;
|
|
|
this.orderDetailStutus = 1;
|
|
@@ -585,6 +585,7 @@ export default {
|
|
|
this.curIdx = index;
|
|
|
this.getDetailOrder();
|
|
|
this.getTrackOrder();
|
|
|
+ this.getRiderArriveTime();
|
|
|
},
|
|
|
// 忽略订单
|
|
|
iGnoreOrder(orderId) {
|
|
@@ -788,13 +789,13 @@ export default {
|
|
|
},
|
|
|
// 订单跟踪
|
|
|
getTrackOrder() {
|
|
|
+ if (this.buttonStatus === 0 || this.buttonStatus === 10) return;
|
|
|
this.showTrack = false;
|
|
|
if (this.list.length) {
|
|
|
this.orderId = this.list[this.curIdx].id;
|
|
|
} else {
|
|
|
return;
|
|
|
}
|
|
|
- if (this.buttonStatus === 0 || this.buttonStatus === 10) return;
|
|
|
trackOrder({ orderId: this.orderId }).then((res) => {
|
|
|
if (res.code === 200) {
|
|
|
this.trackOrder = res.data;
|
|
@@ -807,6 +808,21 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ // 获取骑手预计到达时间
|
|
|
+ getRiderArriveTime() {
|
|
|
+ // 只有取货中和配送中调用该接口
|
|
|
+ if (![2, 3].includes(this.buttonStatus)) return;
|
|
|
+ if (this.list.length) {
|
|
|
+ this.orderId = this.list[this.curIdx].id;
|
|
|
+ } else {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ getRiderArriveTime({ orderId: this.orderId }).then((res) => {
|
|
|
+ if(res.code === 200){
|
|
|
+ this.riderArriveTime = res.data
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
showCancelType(type) {
|
|
|
let name = "";
|
|
|
switch (type) {
|
|
@@ -1179,7 +1195,7 @@ export default {
|
|
|
font-size: 14px;
|
|
|
font-weight: 400;
|
|
|
color: #b1b1b1;
|
|
|
- word-wrap:break-word;
|
|
|
+ word-wrap: break-word;
|
|
|
}
|
|
|
.order_detail {
|
|
|
position: relative;
|