From 852847b1badc0d3b5938e0079dfab5b0a7b88ad8 Mon Sep 17 00:00:00 2001 From: qiaocl <3189782663@qq.com> Date: Wed, 14 Aug 2024 17:39:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BC=B0=E5=88=86=E5=9C=B0?= =?UTF-8?q?=E5=8C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 68 +++++++++--------- manifest.json | 4 +- pages.json | 1 + pages/me/about.vue | 64 ++++++++--------- pages/score/report.vue | 6 +- pages/score/score.vue | 6 +- .../build/app-plus/__uniappchooselocation.js | 2 +- .../dist/build/app-plus/__uniappquill.js | 2 +- .../app-plus/__uniappquillimageresize.js | 2 +- .../dist/build/app-plus/app-config-service.js | 2 +- unpackage/dist/build/app-plus/app-service.js | 18 ++--- unpackage/dist/build/app-plus/app-view.js | 2 +- .../uniicons.2579c7da.ttf} | Bin unpackage/dist/build/app-plus/manifest.json | 2 +- unpackage/dist/build/app-plus/view.css | 2 +- unpackage/dist/build/app-plus/view.umd.min.js | 4 +- .../dist/dev/app-plus/app-config-service.js | 2 +- unpackage/dist/dev/app-plus/app-service.js | 35 ++++----- unpackage/dist/dev/app-plus/app-view.js | 28 ++++---- unpackage/dist/dev/app-plus/manifest.json | 2 +- 20 files changed, 127 insertions(+), 125 deletions(-) rename unpackage/dist/build/app-plus/{uni_modules/uni-icons/components/uni-icons/uniicons.ttf => assets/uniicons.2579c7da.ttf} (100%) diff --git a/App.vue b/App.vue index b8edfc62..4f23dc89 100644 --- a/App.vue +++ b/App.vue @@ -39,8 +39,8 @@ that.$model.getloginversion({}).then(res => { let downloadUrl = res.data.url let latestVersion = res.data.version - console.log("版本信息", info) - console.log("res", res) + console.log("当前应用版本号", info) + console.log("服务器版本号", res) that.$store.commit('changePhoneInfo', { versionUrl: res.data }) @@ -52,11 +52,38 @@ success: (modalRes) => { if (modalRes.confirm) { if (platform === 'android') { - uni.showLoading({ - title: '正在升级,请耐心等待' - }) uni.setStorageSync('VERSION', res.data.version) - that.downloadNewVersion(downloadUrl, res.code); + let showLoading = plus.nativeUI.showWaiting('正在下载') + const dtask = uni.downloadFile({ + url: downloadUrl, + success: (downloadRes) => { + if (downloadRes.statusCode ===200) { + plus.nativeUI.closeWaiting() + plus.runtime.install( + downloadRes + .tempFilePath, { + force: false + }, + function() { + console.log('install success...'); + plus.runtime.restart(); + }, + function(e) { + console.error('install fail...'); + }); + } + }, + fail: () => { + uni.showToast({ + title: '升级失败', + icon: 'none' + }); + } + }); + dtask.onProgressUpdate((res) => { + showLoading.setTitle(" 正在下载" + res.progress + "% "); + console.log('下载进度' + res.progress +'%'); + }); } else { uni.showModal({ title: '发现新版本 ' + res.data.version, @@ -96,34 +123,7 @@ // 下载新版本 downloadNewVersion(downloadUrl, code) { - const dtask = uni.downloadFile({ - url: downloadUrl, - success: (downloadRes) => { - if (downloadRes.statusCode === 200) { - uni.hideLoading(); - plus.runtime.install( - downloadRes.tempFilePath, { - force: true - }, - function() { - console.log('install success...'); - plus.runtime.restart(); - }, - function(e) { - console.error('install fail...'); - }); - } - }, - fail: () => { - uni.showToast({ - title: '升级失败', - icon: 'none' - }); - } - }); - dtask.onProgressUpdate((res) => { - console.log('下载进度' + res.progress + '%'); - }); + }, diff --git a/manifest.json b/manifest.json index 72ae6797..216ea6a4 100644 --- a/manifest.json +++ b/manifest.json @@ -2,8 +2,8 @@ "name" : "青测", "appid" : "__UNI__E0E1A21", "description" : "", - "versionName" : "1.1.5", - "versionCode" : 115, + "versionName" : "1.1.7", + "versionCode" : 117, "transformPx" : false, /* 5+App特有相关 */ "app-plus" : { diff --git a/pages.json b/pages.json index 9bf75e26..1ef0ac88 100644 --- a/pages.json +++ b/pages.json @@ -377,6 +377,7 @@ // 切换导航 "tabBar": { "color": "#333", + "fontSize": "13px", "selectedColor": "#477EFF", "backgroundColor": "#fff", "list": [{ diff --git a/pages/me/about.vue b/pages/me/about.vue index 1f7190e1..5e80acaa 100644 --- a/pages/me/about.vue +++ b/pages/me/about.vue @@ -60,11 +60,38 @@ that.$tools.msg("已经是最新版本了!") } else { if (that.phoneInfo.platform === 'android') { - uni.showLoading({ - title: '正在升级,请耐心等待' - }) uni.setStorageSync('VERSION', that.phoneInfo.versionUrl.version) - that.downloadNewVersion(that.phoneInfo.versionUrl.url); + let showLoading = plus.nativeUI.showWaiting('正在下载') + dtask = uni.downloadFile({ + url: that.phoneInfo.versionUrl.url, + success: (downloadRes) => { + if (downloadRes.statusCode === 200) { + plus.nativeUI.closeWaiting() + plus.runtime.install( + downloadRes.tempFilePath, { + force: false + }, + function() { + console.log('install success...'); + plus.runtime.restart(); + }, + function(e) { + console.error('install fail...'); + }); + } + }, + fail: () => { + uni.showToast({ + title: '升级失败', + icon: 'none' + }); + } + }); + dtask.onProgressUpdate((res) => { + showLoading.setTitle(" 正在下载" + res.progress + "% "); + console.log('下载进度' + res.progress + '%'); + }); + // that.downloadNewVersion(that.phoneInfo.versionUrl.url); } else { uni.showModal({ title: '发现新版本 ' + that.phoneInfo.versionUrl.version, @@ -76,34 +103,7 @@ }, downloadNewVersion(downloadUrl) { let that = this - dtask = uni.downloadFile({ - url: downloadUrl, - success: (downloadRes) => { - if (downloadRes.statusCode === 200) { - uni.hideLoading(); - plus.runtime.install( - downloadRes.tempFilePath, { - force: true - }, - function() { - console.log('install success...'); - plus.runtime.restart(); - }, - function(e) { - console.error('install fail...'); - }); - } - }, - fail: () => { - uni.showToast({ - title: '升级失败', - icon: 'none' - }); - } - }); - dtask.onProgressUpdate((res) => { - console.log('下载进度' + res.progress + '%'); - }); + }, } } diff --git a/pages/score/report.vue b/pages/score/report.vue index 67bb19c9..77bbc486 100644 --- a/pages/score/report.vue +++ b/pages/score/report.vue @@ -1,14 +1,14 @@