From a2a7bb2121172ef4643a52f035142e0d8cee5cf8 Mon Sep 17 00:00:00 2001 From: kele <1184860403@qq.com> Date: Mon, 16 Oct 2023 15:49:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A4=E6=96=AD=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E6=9C=89=E5=8F=91=E8=B4=A7=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/order/detail.vue | 19 +++++++++---------- sheep/store/app.js | 2 ++ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/pages/order/detail.vue b/pages/order/detail.vue index e9172772..70abbd3e 100644 --- a/pages/order/detail.vue +++ b/pages/order/detail.vue @@ -317,6 +317,8 @@ const statusBarHeight = sheep.$platform.device.statusBarHeight * 2; const headerBg = sheep.$url.css('/static/img/shop/order/order_bg.png'); + const tradeManaged = computed(() => sheep.$store('app').has_wechat_trade_managed); + const state = reactive({ orderInfo: {}, merchantTradeNo: '', // 商户订单号 @@ -399,14 +401,11 @@ // todo: // 1.怎么检测是否开启了发货组件功能?如果没有开启的话就不能在这里return出去 // 2.如果开启了走mpConfirm方法,需要在App.vue的show方法中拿到确认收货结果 - let isOpenBusinessView = true; - if ( - sheep.$platform.name === 'WechatMiniProgram' && - !isEmpty(state.orderInfo.wechat_extra_data) && - isOpenBusinessView && - !ignore - ) { - mpConfirm(orderId); + if (sheep.$platform.name === 'WechatMiniProgram' && !ignore) { + if (!isEmpty(state.orderInfo.wechat_extra_data) && tradeManaged.value === 1) { + mpConfirm(orderId); + return; + } return; } @@ -427,8 +426,8 @@ wx.openBusinessView({ businessType: 'weappOrderConfirm', extraData: { - merchant_id: '1481069012', - merchant_trade_no: state.orderInfo.wechat_extra_data.merchant_trade_no, + // merchant_id: '1481069012', + // merchant_trade_no: state.orderInfo.wechat_extra_data.merchant_trade_no, transaction_id: state.orderInfo.wechat_extra_data.transaction_id, }, success(response) { diff --git a/sheep/store/app.js b/sheep/store/app.js index 4a338cef..4aac0879 100644 --- a/sheep/store/app.js +++ b/sheep/store/app.js @@ -49,6 +49,7 @@ const app = defineStore({ }, }, shareInfo: {}, // 全局分享信息 + has_wechat_trade_managed: 0 // 小程序发货信息管理 0 没有 || 1 有 }), actions: { // 获取Shopro应用配置和模板 @@ -64,6 +65,7 @@ const app = defineStore({ this.info = res.data.app; this.platform = res.data.platform; this.template = res.data.template; + this.has_wechat_trade_managed = res.data.has_wechat_trade_managed; if (!res.data.template) { $router.error('TemplateError'); }