Browse Source

修改更新

hella_vue3
lijuncheng 7 months ago
parent
commit
77d44406e0
  1. 10
      src/common/appUpdate.js
  2. 2
      src/manifest.json

10
src/common/appUpdate.js

@ -22,7 +22,7 @@ export function appUpdate(isShowHint) {
var content = res.data.updateContent; var content = res.data.updateContent;
var version = res.data.installPackageVersion; var version = res.data.installPackageVersion;
var isForcedUpdate = res.data.isForcedUpdate var isForcedUpdate = res.data.isForcedUpdate
var versionName =res.data.installPackageName var versionName = res.data.installPackageName
console.log("新版本提示") console.log("新版本提示")
showDialog(versionName, content, isForcedUpdate, downUrl) showDialog(versionName, content, isForcedUpdate, downUrl)
@ -45,7 +45,7 @@ export function appUpdate(isShowHint) {
// } // }
// }) // })
} else { } else {
if(isShowHint){ if (isShowHint) {
uni.showToast({ uni.showToast({
title: "当前是最新版本" title: "当前是最新版本"
}) })
@ -124,12 +124,16 @@ export function confirm(downUrl) {
showLoading.setTitle("已连接到服务器"); showLoading.setTitle("已连接到服务器");
break; break;
case 3: case 3:
if (task.totalSize && > task.totalSize0) {
prg = parseInt( prg = parseInt(
(parseFloat(task.downloadedSize) / (parseFloat(task.downloadedSize) /
parseFloat(task.totalSize)) * parseFloat(task.totalSize)) *
100 100
); );
showLoading.setTitle(" 正在下载" + prg + "% "); showLoading.setTitle("正在下载" + prg + "% ");
}else {
showLoading.setTitle("正在下载");
}
break; break;
case 4: case 4:
plus.nativeUI.closeWaiting(); plus.nativeUI.closeWaiting();

2
src/manifest.json

@ -44,7 +44,7 @@
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>", "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>", "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>", "<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>" "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.INSTALL_PACKAGES\"/>", "<uses-permission android:name=\"android.permission.INSTALL_PACKAGES\"/>",
"<uses-permission android:name=\"android.permission.REQUEST_INSTALL_PACKAGES\"/>" "<uses-permission android:name=\"android.permission.REQUEST_INSTALL_PACKAGES\"/>"
], ],

Loading…
Cancel
Save