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