From 11558910567e9051fd91f16db345ceabb9c495ac Mon Sep 17 00:00:00 2001
From: qijq <624811160@qq.com>
Date: Mon, 18 Aug 2025 10:26:55 +0800
Subject: [PATCH] =?UTF-8?q?update=20=E6=9B=B4=E6=96=B0=E6=89=93=E5=8C=85?=
=?UTF-8?q?=E8=B4=B9=EF=BC=8C=E5=92=8C=E6=B5=8B=E8=AF=95=E6=89=AB=E7=A0=81?=
=?UTF-8?q?=E8=BF=9B=E5=85=A5=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
App.vue | 26 +++++++++++++++++++++-----
pages/checkout/checkout.vue | 11 +++++++++--
pagesub/index/store.vue | 7 ++++++-
3 files changed, 36 insertions(+), 8 deletions(-)
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);
},