Browse Source

修改更新

hella_vue3
lijuncheng 8 months ago
parent
commit
77d44406e0
  1. 22
      src/common/appUpdate.js
  2. 6
      src/manifest.json

22
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,12 +45,12 @@ export function appUpdate(isShowHint) {
// } // }
// }) // })
} else { } else {
if(isShowHint){ if (isShowHint) {
uni.showToast({ uni.showToast({
title: "当前是最新版本" title: "当前是最新版本"
}) })
} }
console.log("没有新版本") console.log("没有新版本")
} }
} }
@ -124,12 +124,16 @@ export function confirm(downUrl) {
showLoading.setTitle("已连接到服务器"); showLoading.setTitle("已连接到服务器");
break; break;
case 3: case 3:
prg = parseInt( if (task.totalSize && > task.totalSize0) {
(parseFloat(task.downloadedSize) / prg = parseInt(
parseFloat(task.totalSize)) * (parseFloat(task.downloadedSize) /
100 parseFloat(task.totalSize)) *
); 100
showLoading.setTitle(" 正在下载" + prg + "% "); );
showLoading.setTitle("正在下载" + prg + "% ");
}else {
showLoading.setTitle("正在下载");
}
break; break;
case 4: case 4:
plus.nativeUI.closeWaiting(); plus.nativeUI.closeWaiting();

6
src/manifest.json

@ -44,9 +44,9 @@
"<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\"/>"
], ],
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ], "abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ],
"minSdkVersion" : 23 "minSdkVersion" : 23

Loading…
Cancel
Save