From e13367edf304cb78f978e321f1679299a66b3a23 Mon Sep 17 00:00:00 2001 From: quanyawei <401863037@qq.com> Date: Wed, 10 Jan 2024 16:08:18 +0800 Subject: [PATCH] fix:地图 --- App.vue | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 50 insertions(+), 1 deletions(-) diff --git a/App.vue b/App.vue index 80f737c..d4a820d 100644 --- a/App.vue +++ b/App.vue @@ -8,7 +8,8 @@ httpGet } from '@/utils/http.js' export default { - onShow: function(options) { + onShow(options) { + this.checkUpdate() console.log('optionsonShow', options) if (options.scene === 1007 || options.scene === 1014 || options.scene === 1008) { // ������������������������������������ @@ -72,6 +73,54 @@ } }, methods: { + checkUpdate() { + // ������������������������������������������������������,������������������������������v1.9.90���������������getUpdateManager������������������������������������������ + if (uni.canIUse('getUpdateManager')) { + const updateManager = uni.getUpdateManager() + // ��������������������������������� + updateManager.onCheckForUpdate(function(res) { + // ��������������������������������������������������� + console.log('res.hasUpdate', res.hasUpdate) + console.log('������������', res) + if (res.hasUpdate) { + // ��������������������� + updateManager.onUpdateReady(function() { + uni.showModal({ + title: '������������', + content: '���������������', + showCancel: false, + success(res) { + if (res.confirm) { + // ������������������������������������ applyUpdate ������������������������ + updateManager.applyUpdate() + } + } + }) + }) + // ��������������������� + updateManager.onUpdateFailed(function() { + uni.showModal({ + title: '������������', + content: '������������������������~������������������������������������������������������~', + showCancel: false + }) + }) + } + }) + } else { + // ��������������������������������������������������������������������������������������������� + uni.showModal({ + title: '������', + content: '���������������������������������������������������������������������������������������������������������', + success(res) { + if (res.confirm) { + // ������������������������������������������������������������������ + uni.updateWeChatApp() + } + } + }) + } + }, /** * ������������ * ��������������������������������������������������������������������� -- Gitblit v1.8.0