diff --git a/pages/order/Logistics/index.vue b/pages/order/Logistics/index.vue index 2be23ea..453fe09 100644 --- a/pages/order/Logistics/index.vue +++ b/pages/order/Logistics/index.vue @@ -112,6 +112,7 @@ export default { return { webUrl:this.$VUE_APP_RESOURCES_URL, id: "", + index: null, cartInfo: [], orderInfo: {}, expressList: [], @@ -124,6 +125,9 @@ export default { ] }; }, + onLoad(opts) { + this.index = opts.index || 0; + }, watch: { $yroute(n) { if (n.name === NAME && this.$yroute.query.id !== this.id) { @@ -151,16 +155,18 @@ export default { .catch(err => { uni.showToast({ title: - err.msg || err.response.data.msg || err.response.data.message, + err.msg , icon: "none", duration: 2000 }); }); }, getExpress() { + console.log(this.id, "this.id"); + if (!this.id) { uni.showToast({ - title: err.msg || err.response.data.msg || err.response.data.message, + title: '订单信息错误', icon: "none", duration: 2000 }); @@ -169,11 +175,11 @@ export default { this.loaded = false; orderDetail(this.id) .then(res => { - this.orderInfo = { - deliveryId: res.data.deliveryId, - deliveryName: res.data.deliveryName, - deliverySn: res.data.deliverySn - }; + console.log(this.index, "this.orderInfo"); + const { data } = res; + const current = data.deliveryInfo[+this.index ]; + console.log(current, "current"); + this.orderInfo = current; this.getExpressInfo(); // const result = res.data.express.result || {}; // this.cartInfo = res.data.order.cartInfo; @@ -182,8 +188,7 @@ export default { }) .catch(err => { uni.showToast({ - title: - err.msg || err.response.data.msg || err.response.data.message, + title: err.msg , icon: "none", duration: 2000 }); diff --git a/pages/order/OrderDetails/index.vue b/pages/order/OrderDetails/index.vue index 462c6f8..e9a532d 100644 --- a/pages/order/OrderDetails/index.vue +++ b/pages/order/OrderDetails/index.vue @@ -28,28 +28,32 @@ - - - - {{ orderInfo.deliveryName }}:{{ orderInfo.deliveryId }} - - 复制 - - - - - - - - {{ logistics.Traces && logistics.Traces.length > 0 ? logistics.Traces[logistics.Traces.length - 1].acceptStation : '暂无轨迹信息'}} - + + - + {{ delivery.deliveryName }}:{{ delivery.deliveryId }} + + 复制 + + + + + + + + {{ logistics.Traces && logistics.Traces.length > 0 ? logistics.Traces[logistics.Traces.length - 1].acceptStation : '暂无轨迹信息'}} + + + + + + + {{ logistics.Traces && logistics.Traces.length > 0 ? logistics.Traces[logistics.Traces.length - 1].acceptTime : '' }} - - {{ logistics.Traces && logistics.Traces.length > 0 ? logistics.Traces[logistics.Traces.length - 1].acceptTime : '' }} + +