update 更新打包费,和测试扫码进入问题
This commit is contained in:
parent
038c9ecda5
commit
1155891056
26
App.vue
26
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;
|
||||
|
||||
@ -619,7 +619,14 @@
|
||||
+{{__('¥')}}{{number_format(store_items.freight,2) || 0}}</view>
|
||||
<view class="arrow"></view>
|
||||
</view>
|
||||
|
||||
<view class="m-cell">
|
||||
<view class="m-cell-bd">
|
||||
<text>打包费</text>
|
||||
</view>
|
||||
<view class="m-cell-ft m-order-typetxt">
|
||||
+{{__('¥')}}{{number_format(store_items.packing_fee,2) || 0}}</view>
|
||||
<view class="arrow"></view>
|
||||
</view>
|
||||
<!-- 返利 -->
|
||||
<view class="m-cell" v-if="(store_items.store_rebate>0)">
|
||||
<view class="m-cell-bd">
|
||||
@ -667,7 +674,7 @@
|
||||
<view class="m-cell-ft m-total-info">
|
||||
{{__('总金额:')}}
|
||||
<text
|
||||
class="m-total-price">{{sprintf(__('¥%.2f'), store_items.store_amount != null ? store_items.store_amount : store_items.order_money_select_items+store_items.freight)}}</text>
|
||||
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)}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="(delivery_item_none_row.length > 0)">
|
||||
|
||||
@ -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);
|
||||
},
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user