判断小程序是否有发货信息管理功能

pull/8/head
kele 2023-10-16 15:49:32 +08:00
parent 53507d995d
commit a2a7bb2121
2 changed files with 11 additions and 10 deletions

View File

@ -317,6 +317,8 @@
const statusBarHeight = sheep.$platform.device.statusBarHeight * 2; const statusBarHeight = sheep.$platform.device.statusBarHeight * 2;
const headerBg = sheep.$url.css('/static/img/shop/order/order_bg.png'); 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({ const state = reactive({
orderInfo: {}, orderInfo: {},
merchantTradeNo: '', // merchantTradeNo: '', //
@ -399,16 +401,13 @@
// todo: // todo:
// 1.return // 1.return
// 2.mpConfirm,App.vueshow // 2.mpConfirm,App.vueshow
let isOpenBusinessView = true; if (sheep.$platform.name === 'WechatMiniProgram' && !ignore) {
if ( if (!isEmpty(state.orderInfo.wechat_extra_data) && tradeManaged.value === 1) {
sheep.$platform.name === 'WechatMiniProgram' &&
!isEmpty(state.orderInfo.wechat_extra_data) &&
isOpenBusinessView &&
!ignore
) {
mpConfirm(orderId); mpConfirm(orderId);
return; return;
} }
return;
}
// //
const { error, data } = await sheep.$api.order.confirm(orderId); const { error, data } = await sheep.$api.order.confirm(orderId);
@ -427,8 +426,8 @@
wx.openBusinessView({ wx.openBusinessView({
businessType: 'weappOrderConfirm', businessType: 'weappOrderConfirm',
extraData: { extraData: {
merchant_id: '1481069012', // merchant_id: '1481069012',
merchant_trade_no: state.orderInfo.wechat_extra_data.merchant_trade_no, // merchant_trade_no: state.orderInfo.wechat_extra_data.merchant_trade_no,
transaction_id: state.orderInfo.wechat_extra_data.transaction_id, transaction_id: state.orderInfo.wechat_extra_data.transaction_id,
}, },
success(response) { success(response) {

View File

@ -49,6 +49,7 @@ const app = defineStore({
}, },
}, },
shareInfo: {}, // 全局分享信息 shareInfo: {}, // 全局分享信息
has_wechat_trade_managed: 0 // 小程序发货信息管理 0 没有 || 1 有
}), }),
actions: { actions: {
// 获取Shopro应用配置和模板 // 获取Shopro应用配置和模板
@ -64,6 +65,7 @@ const app = defineStore({
this.info = res.data.app; this.info = res.data.app;
this.platform = res.data.platform; this.platform = res.data.platform;
this.template = res.data.template; this.template = res.data.template;
this.has_wechat_trade_managed = res.data.has_wechat_trade_managed;
if (!res.data.template) { if (!res.data.template) {
$router.error('TemplateError'); $router.error('TemplateError');
} }