123456789101112131415161718192021222324252627282930313233 |
- export function checkUpdateVersion() {
-
- const updateManager = uni.getUpdateManager();
-
- updateManager.onCheckForUpdate(function(res) {
-
- if (res.hasUpdate) {
-
- updateManager.onUpdateReady(function() {
- uni.showModal({
- title: '更新提示',
- content: '新版本已经准备好,是否重启应用?',
- success(res) {
- if (res.confirm) {
-
- updateManager.applyUpdate();
- }
- }
- })
- })
- updateManager.onUpdateFailed(function() {
-
- uni.showModal({
- title: '已经有新版本咯~',
- content: '请您删除当前小程序,到微信 “发现-小程序” 页,重新搜索打开呦~',
- })
- })
- }
- })
- }
|