微信扫码优化

This commit is contained in:
caoqianming 2021-05-28 10:28:49 +08:00
parent 012da46336
commit f756d7bf64
5 changed files with 34 additions and 27 deletions

16
app.js
View File

@ -53,18 +53,24 @@ App({
}
});
wx.hideLoading()
// var pages = getCurrentPages()
// var currentPage = pages[pages.length-1] //获取当前页面的对象
// var url = currentPage.route
var pages = getCurrentPages()
var currentPage = pages[pages.length-1] //获取当前页面的对象
var url = currentPage.route
if(that.globalData.hopeUrl){
wx.reLaunch({
wx.redirectTo({
url: that.globalData.hopeUrl,
})
}else{
wx.redirectTo({
url:'/'+url,
fail: function(){
wx.reLaunch({
url: '/pages/main/main',
url:'/'+url
})
}
})
}
} else {
wx.hideLoading()

View File

@ -1,7 +1,7 @@
{
"pages": [
"pages/bind/binduser",
"pages/main/main",
"pages/bind/binduser",
"pages/index/index",
"pages/logs/logs",
"pages/trouble/trouble",

View File

@ -178,21 +178,20 @@ Page({
}
}
}
if(getApp().globalData.sessionId){
if(url){
wx.reLaunch({
url: url,
if(getApp().globalData.hopeUrl){
wx.redirectTo({
url: getApp().globalData.hopeUrl,
})
}else{
wx.reLaunch({
getApp().globalData.hopeUrl = null
}
else{
wx.switchTab({
url: '/pages/main/main',
})
}
return
}
},
/**

View File

@ -96,8 +96,9 @@ Page({
*/
onShow: function () {
var that = this
if(getApp().globalData.sessionId){
that.getNew()
}
if (getApp().globalData.userInfo.companyid == 2681) {
this.setData({
isGjjt: true,

View File

@ -3,7 +3,7 @@
"setting": {
"urlCheck": false,
"es6": true,
"enhance": true,
"enhance": false,
"postcss": true,
"preloadBackgroundData": false,
"minified": true,
@ -19,14 +19,15 @@
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"useMultiFrameRuntime": false,
"useApiHook": true,
"useApiHook": false,
"useApiHostProcess": false,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"bundle": false,
"useIsolateContext": true,
"enableEngineNative": false,
"useIsolateContext": false,
"useCompilerModule": false,
"userConfirmedUseCompilerModuleSwitch": false,
"userConfirmedBundleSwitch": false,