支持多包裹快递展示物流信息

master
15386982806 2024-01-10 18:56:18 +08:00
parent 7148b32c43
commit 2d0b78af52
3 changed files with 41 additions and 3 deletions

View File

@ -319,3 +319,12 @@ export function reBuy(sn) {
params,
});
}
// 查看包裹列表
export function getPackage(orderSn) {
return http.request({
url: `/order/order/getPackage/${orderSn}`,
method: Method.GET,
needToken: true,
});
}

View File

@ -718,6 +718,12 @@
"navigationBarTitleText": "订单详情"
}
},
{
"path": "deliverDetail",
"style": {
"navigationBarTitleText": "物流详情"
}
},
{
"path": "evaluate/evaluateDetail",
"style": {

View File

@ -10,7 +10,7 @@
</div>
<!-- 物流信息 -->
<view class="info-view logistics-view">
<view class="logistics-List" v-if="logisticsList && logisticsList.traces.length != 0 ">
<view class="logistics-List" v-if="logisticsList && logisticsList.traces && logisticsList.traces.length != 0 ">
<view class="logistics-List-title">
{{ logisticsList.traces[logisticsList.traces.length - 1].AcceptStation }}
</view>
@ -23,6 +23,14 @@
<view class="verificationCode" v-if="order.verificationCode">
券码 {{ order.orderStatus == 'CANCELLED' ? '已失效' : order.verificationCode }}
</view>
<view @click="handleClickDeliver()" class="info-view logi-view" v-if="orderPackage && orderPackage.length">
<view class="verificationCode">
当前订单有 {{ orderPackage.length }} 个包裹快递
</view>
<div>
点击此处查看
</div>
</view>
<view v-else class="logistics-List-title">
{{ '暂无物流信息' }}
</view>
@ -250,7 +258,7 @@
</template>
<script>
import { getExpress } from "@/api/trade.js";
import { getExpress, getPackage } from "@/api/trade.js";
import { cancelOrder, confirmReceipt, getOrderDetail } from "@/api/order.js";
import shares from "@/components/m-share/index"; //
@ -308,6 +316,7 @@ export default {
cancelList: "",
rogShow: false,
reason: "",
orderPackage:"",
};
},
onLoad(options) {
@ -315,6 +324,19 @@ export default {
this.sn = options.sn;
},
methods: {
//
async getOrderPackage() {
getPackage(this.order.sn).then(res => {
if (res.data.success) {
this.orderPackage = res.data.result
}
})
},
handleClickDeliver(){
uni.navigateTo({
url: `/pages/order/deliverDetail?order_sn=${this.order.sn}`,
});
},
// 退
refundPriceList(status) {
switch (status) {
@ -375,7 +397,8 @@ export default {
this.orderGoodsList = order.orderItems;
this.orderDetail = res.data.result;
if (this.order.deliveryMethod === 'LOGISTICS') {
this.loadLogistics(sn)
this.loadLogistics(sn);
this.getOrderPackage();
}
if (this.$store.state.isShowToast){ uni.hideLoading() };
});