diff --git a/App.vue b/App.vue index 2dbdc4a..dd5eaba 100644 --- a/App.vue +++ b/App.vue @@ -34,14 +34,30 @@ export default { if (options.query.uid) { uni.setStorageSync("activity_id", options.query.activity_id); } + + // 处理扫码进入小程序的场景 + if (options.url === 'pagesub/index/store') { // 修复拼写错误:options.url + let sceneParams = ''; - // 处理扫码进入小程序的场景值 - if (options.ulr = 'pagesub/index/store') { - const scene = decodeURIComponent(options.query.scene || `store_id=${options.query.store_id}`); + // 情况1:优先解析 scene 参数(扫码带参数场景) + if (options.query.scene) { + sceneParams = decodeURIComponent(options.query.scene); + } + // 情况2:如果无 scene,但直接传了 store_id + else if (options.query.store_id || options.store_id) { + sceneParams = `store_id=${options.query.store_id}`; + } - wx.navigateTo({ - url: `/${options.path}?${scene}` + // 只有拿到有效参数时才跳转 + if (sceneParams) { + wx.navigateTo({ + url: `/${options.path}?${sceneParams}` // 例如:/pages/store?id=123 }); + } else { + // 处理无参数情况(例如跳转默认页或报错) + console.error('错误:未找到 store_id 参数'); + wx.switchTab({ url: '/pages/index/index' }); // 示例:强制跳转到首页 + } } let that = this; diff --git a/pages/checkout/checkout.vue b/pages/checkout/checkout.vue index 9483d59..20f2442 100644 --- a/pages/checkout/checkout.vue +++ b/pages/checkout/checkout.vue @@ -619,7 +619,14 @@ +{{__('¥')}}{{number_format(store_items.freight,2) || 0}} - + + + 打包费 + + + +{{__('¥')}}{{number_format(store_items.packing_fee,2) || 0}} + + @@ -667,7 +674,7 @@ {{__('总金额:')}} {{sprintf(__('¥%.2f'), store_items.store_amount != null ? store_items.store_amount : store_items.order_money_select_items+store_items.freight)}} + class="m-total-price">{{sprintf(__('¥%.2f'), store_items.store_amount != null ? store_items.store_amount : store_items.order_money_select_items+store_items.freight+store_items.packing_fee)}} diff --git a/pagesub/index/store.vue b/pagesub/index/store.vue index 9a83d41..a5d7fc6 100644 --- a/pagesub/index/store.vue +++ b/pagesub/index/store.vue @@ -732,13 +732,18 @@ export default { onBackPress({ from }) { console.log("=======", from); - debugger; + if (from == "backbutton") { uni.switchTab({ url: "/pages/index/index" }); } }, onLoad: function (options) { + let that = this; + that.$.showModal({ + title: "提示", + content: options, + }); this.initStorePageData(options); },