重复扣款修复
This commit is contained in:
31
app.js
31
app.js
@@ -3,8 +3,37 @@ import api from './utils/api.js';
|
||||
import pay from './utils/pay.js';
|
||||
App({
|
||||
onLaunch: function () {
|
||||
|
||||
this.checkUpdate();
|
||||
},
|
||||
|
||||
// 检查并强制更新小程序版本
|
||||
checkUpdate: function () {
|
||||
if (!wx.canIUse('getUpdateManager')) return;
|
||||
const updateManager = wx.getUpdateManager();
|
||||
updateManager.onCheckForUpdate(function (res) {
|
||||
if (!res.hasUpdate) return;
|
||||
updateManager.onUpdateReady(function () {
|
||||
wx.showModal({
|
||||
title: '发现新版本',
|
||||
content: '新版本已准备好,重启后生效,是否立即重启?',
|
||||
showCancel: false,
|
||||
confirmText: '立即重启',
|
||||
success: function () {
|
||||
updateManager.applyUpdate();
|
||||
}
|
||||
});
|
||||
});
|
||||
updateManager.onUpdateFailed(function () {
|
||||
wx.showModal({
|
||||
title: '发现新版本',
|
||||
content: '新版本下载失败,请删除小程序后重新搜索进入以获取最新版本。',
|
||||
showCancel: false,
|
||||
confirmText: '我知道了'
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
globalData: {
|
||||
userInfo: null
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user