From 29b50be16ca9b8b2092b43bbfb91afbe73008bc1 Mon Sep 17 00:00:00 2001 From: litian <C21AF165> Date: 星期四, 11 七月 2024 14:12:21 +0800 Subject: [PATCH] url --- pages/home/home.js | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-) diff --git a/pages/home/home.js b/pages/home/home.js index 9bd1189..7df68cf 100644 --- a/pages/home/home.js +++ b/pages/home/home.js @@ -46,11 +46,10 @@ }); console.log(this.data.searchVal) this.loadHomePage(); - this.getBannerList() - }, onLoad() { + this.getBannerList() const systInfo = wx.getSystemInfoSync(); const menu = wx.getMenuButtonBoundingClientRect(); // 鑳跺泭淇℃伅 const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 瀵艰埅鏍忛珮搴� @@ -597,10 +596,10 @@ wx.scanCode({ success(res) { console.log(res); - if (res.errMsg == "scanCode:ok" && res.path) { - console.log(res.path, 2) + if (res.errMsg == "scanCode:ok" && res.path || res.result) { + let path = res.path || res.result wx.redirectTo({ - url: '/' + res.path, + url: '/' + path, }) } } -- Gitblit v1.9.1