From c2e071dbb9b882e96e5fa082713ed047cd64138c Mon Sep 17 00:00:00 2001 From: xpz2018 <107107461@qq.com> Date: Sat, 7 Aug 2021 14:05:18 +0800 Subject: [PATCH] no message --- api/request.js | 2 +- app.js | 33 ++++++++++++++++++++++++--------- pages/index/index.js | 3 +++ pages/login/index.js | 5 +++-- 4 files changed, 31 insertions(+), 12 deletions(-) diff --git a/api/request.js b/api/request.js index ee1919e..18f00df 100644 --- a/api/request.js +++ b/api/request.js @@ -120,7 +120,7 @@ function handleResult(result) { return Promise.reject(message) } else if (result.code === 200101) { return Promise.reject(result) - } else if (result.code === 200100) { + } else if (result.code === 200107) { let pages = getCurrentPages() //当前页面栈 let prevPage = pages[pages.length - 1] //当前页面 if(prevPage.onAttention){ diff --git a/app.js b/app.js index 1721d29..ce060a2 100644 --- a/app.js +++ b/app.js @@ -13,15 +13,30 @@ App({ isIos: false }, onShow: function() { - const updateManager = wx.getUpdateManager() - updateManager.onCheckForUpdate(function (res) { - // 请求完新版本信息的回调 - // console.log('updateManager>>>' + res.hasUpdate) - }) - updateManager.onUpdateReady(function () { - // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 - updateManager.applyUpdate() - }) + if (wx.canIUse('getUpdateManager')) { + const updateManager = wx.getUpdateManager() + updateManager.onCheckForUpdate(function (res) { + // 请求完新版本信息的回调 + if (res.hasUpdate) { + updateManager.onUpdateReady(function () { + // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 + updateManager.applyUpdate() + }) + updateManager.onUpdateFailed(function () { + // 新版本下载失败 + wx.showModal({ + title: '已有新版本', + content: '请您删除小程序,重新搜索进入', + }) + }) + } + }) + } else { + wx.showModal({ + title: '溫馨提示', + content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。' + }) + } if(this.globalData.Custom){ return } diff --git a/pages/index/index.js b/pages/index/index.js index 9e64387..ed800c4 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -36,10 +36,13 @@ Scene({ /************************************** 初始化流程 ********************************************/ onLoad: function (options) { if (options.url) { + console.log(options.url) var path = options.url + console.log(path) if (options.key && options.value) { path += '?' + options.key + '=' + options.value } + console.log(path) wx.navigateTo({ url: path }) } this.data.items = [] diff --git a/pages/login/index.js b/pages/login/index.js index dbe21f3..0a11f9e 100644 --- a/pages/login/index.js +++ b/pages/login/index.js @@ -39,10 +39,11 @@ Page({ } else if(options.qrcode){ //分享进入 this.data.code = '?mark=ztb_saas&QrCodeRecordId=' + options.qrcode - } else if (options.url) { + } + if (options.url) { this.data.path = options.url if (options.key && options.value) { - this.data.path += '?' + options.key + '=' + options.value + this.data.path += '&key=' + options.key + '=value=' + options.value } } app.globalData.token = app.globalData.token || storage.get('Authorization')