From d00d7f8ba2dfed17984aa5d41c7694c24d9d198a Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期三, 22 一月 2025 17:23:34 +0800 Subject: [PATCH] 春节公告 --- pages/home/home.js | 28 +++++++++++++++++++++++----- 1 files changed, 23 insertions(+), 5 deletions(-) diff --git a/pages/home/home.js b/pages/home/home.js index 75fef81..8f02d9f 100644 --- a/pages/home/home.js +++ b/pages/home/home.js @@ -39,6 +39,7 @@ value: false }, loading: true, + showStateMenu: false, }, onShow() { this.setData({ @@ -50,8 +51,19 @@ this.getShoppingCartList() } this.init(); + const stateMenu = wx.getStorageSync('stateMenu') + if (stateMenu == 'true') { + this.setData({ + showStateMenu: true + }) + wx.setStorageSync('stateMenu', 'false') + } }, - + closeStateMenu() { + this.setData({ + showStateMenu: false + }) + }, onLoad() { this.getBannerList() const systInfo = wx.getSystemInfoSync(); @@ -648,10 +660,16 @@ success(res) { console.log(res); if (res.errMsg == "scanCode:ok" && res.path || res.result) { - let path = res.path || res.result - wx.redirectTo({ - url: '/' + path, - }) + if (res.path) { + let path = res.path || res.result + wx.redirectTo({ + url: '/' + path, + }) + } else { + wx.redirectTo({ + url: '/pages/scanResult/index?result=' + res.result, + }) + } } } }) -- Gitblit v1.9.1