From 656d6eeaffa5366214fc3e6dc605e0aaa6d1ac19 Mon Sep 17 00:00:00 2001 From: jevononlie <728254585@qq.com> Date: Wed, 29 May 2024 14:25:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=89=E5=8D=93=E8=87=AA=E5=8A=A8=E4=B8=8B?= =?UTF-8?q?=E8=BD=BDfix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mes-ui/uni-app/src/App.vue | 33 ++++-------------------- mes-ui/uni-app/src/services/constants.ts | 2 +- 2 files changed, 6 insertions(+), 29 deletions(-) diff --git a/mes-ui/uni-app/src/App.vue b/mes-ui/uni-app/src/App.vue index e027644b..25de7579 100644 --- a/mes-ui/uni-app/src/App.vue +++ b/mes-ui/uni-app/src/App.vue @@ -16,7 +16,7 @@ onLaunch(async () => { appId: 'com.chanko.yunxi.mes.android' } const res = await appUpdateApi(params) - console.log('1-0', res.versionId) + console.log('1-0', res,res.versionId) plus.runtime.getProperty(plus.runtime.appid, function (wgtinfo) { const version = wgtinfo.version || plus.runtime.version console.log('1-1', res.versionId,version) @@ -26,9 +26,10 @@ onLaunch(async () => { showCancel: false, confirmText: '立即更新', content: res.remark || 'APP有新版本发布,点击 立即更新 进行最新版本下载。', - success: (res) => { - if (res.confirm) { - onSureClick(res.url) + success: (res2) => { + if (res2.confirm) { + console.log(999,res.url) + plus.runtime.openURL(res.url) } } }) @@ -44,30 +45,6 @@ onShow(async () => { onHide(() => { console.log('App Hide') }) -const onSureClick = (upDataUrl) => { - var downloadTask = uni.downloadFile({ - url: upDataUrl, - success: (downloadResult) => { - if (downloadResult.statusCode === 200) { - plus.runtime.install(downloadResult.tempFilePath, { - force: false - }, function () { - plus.runtime.restart(); - }, (e) => { - console.log(e) - uni.showToast({ - title: '安装升级包失败', - icon: 'none' - }) - }); - } - } - }); - // 下载进度变化事件的监听函数 - downloadTask.onProgressUpdate((e) => { - // - }) -}