Browse Source

no message

feature/v2.2
xpz2018 4 years ago
parent
commit
c2e071dbb9
4 changed files with 31 additions and 12 deletions
  1. 2
      api/request.js
  2. 33
      app.js
  3. 3
      pages/index/index.js
  4. 5
      pages/login/index.js

2
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){

33
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
}

3
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 = []

5
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')

Loading…
Cancel
Save