Commit ea8ce604 by liimin

fix(订单详情): 修复物流信息显示问题并优化逻辑

- 新增logisticsInfo字段存储物流数据
- 区分自营商品和其他商品的物流信息展示
- 优化物流信息获取和显示条件判断
1 parent a352e683
......@@ -10,6 +10,7 @@ Page({
// OrderStatus,
expressInfo: null, //物流信息
isShowExpressPop: false,
logisticsInfo:null,
},
/**
* 生命周期函数--监听页面加载
......@@ -34,9 +35,11 @@ Page({
},
queryLogistics(subOrderCode) {
wx.p.api.shopmallApi.queryLogistics({ subOrderCode }).then((data) => {
this.setData({
expressInfo: data,
});
if(data.shipmentTrack&&data.shipmentTrack.length){
this.setData({
logisticsInfo: data,
})
}
}).catch((err) => {
wx.p.sentry.reportError(`查询物流异常:${err.message}`, {subOrderCode,err});
});
......@@ -62,7 +65,7 @@ Page({
receviveInfo: receiveName + receiveMobile,
},
});
if (data.expressName) {
if (data.expressName && this.data.orderInfo.goodsSource==GoodsSource.SELF) {
this.setData({
expressInfo: {
expressName: data.expressName,
......
......@@ -4,17 +4,17 @@
<Status title="{{Status.text}}" image="{{Status.image}}" tips="{{Status.tips}}"></Status>
</BlockBox>
<!-- 云中鹤的有物流信息 -->
<BlockBox wx:if="{{(orderInfo.goodsSource==1||!orderInfo.goodsSource) && expressInfo &&expressInfo.shipmentTrack&&expressInfo.shipmentTrack.length}}">
<BlockBox wx:if="{{logisticsInfo}}">
<view class="express-box" bindtap="showExpressPop">
<view class="express-detail">
物流详情
<mp-icon icon="arrow" color="var(--btnColor)" size="{{11}}"></mp-icon>
</view>
<Express expressInfo="{{expressInfo}}" showAll="{{false}}" />
<Express expressInfo="{{logisticsInfo}}" showAll="{{false}}"/>
</view>
</BlockBox>
<!-- 自营商品展示快递信息 -->
<BlockBox wx:if="{{orderInfo.goodsSource==2 && expressInfo}}">
<BlockBox wx:if="{{expressInfo}}">
<Expressage expressInfo="{{expressInfo}}"></Expressage>
</BlockBox>
<BlockBox>
......@@ -26,7 +26,7 @@
<!-- <BlockBox>
<content item="{{orderInfo}}" />
</BlockBox> -->
<Expresspop showExpress="{{isShowExpressPop}}" expressInfo="{{expressInfo}}" />
<Expresspop showExpress="{{isShowExpressPop}}" expressInfo="{{logisticsInfo}}" wx:if="{{logisticsInfo}}" />
</view>
</block>
<glsx-privacy appletName="积分商城"></glsx-privacy>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!