|
|
@ -18,11 +18,11 @@ export function appUpdate(isShowHint) { |
|
|
|
console.log("获取更新数据", json) |
|
|
|
if (res.data) { |
|
|
|
if (res.data.installPackageVersion > Number(curversion)) { |
|
|
|
var downUrl = res.data.downUrl; |
|
|
|
var downUrl = res.data.installPackageUrl; |
|
|
|
var content = res.data.updateContent; |
|
|
|
var version = res.data.installPackageVersion; |
|
|
|
var isForcedUpdate = res.data.isForcedUpdate |
|
|
|
var versionName =res.data.installPackageName |
|
|
|
var versionName = res.data.installPackageName |
|
|
|
console.log("新版本提示") |
|
|
|
showDialog(versionName, content, isForcedUpdate, downUrl) |
|
|
|
|
|
|
@ -45,12 +45,12 @@ export function appUpdate(isShowHint) { |
|
|
|
// }
|
|
|
|
// })
|
|
|
|
} else { |
|
|
|
if(isShowHint){ |
|
|
|
if (isShowHint) { |
|
|
|
uni.showToast({ |
|
|
|
title: "当前是最新版本" |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
console.log("没有新版本") |
|
|
|
} |
|
|
|
} |
|
|
@ -77,7 +77,7 @@ export function showDialog(versionName, content, isForcedUpdate, downUrl) { |
|
|
|
console.log( |
|
|
|
'cancel') //点击取消之后执行的代码
|
|
|
|
if (isForcedUpdate == "TRUE") { |
|
|
|
showDialog(version, content, isForcedUpdate, downUrl) |
|
|
|
showDialog(versionName, content, isForcedUpdate, downUrl) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -124,12 +124,16 @@ export function confirm(downUrl) { |
|
|
|
showLoading.setTitle("已连接到服务器"); |
|
|
|
break; |
|
|
|
case 3: |
|
|
|
prg = parseInt( |
|
|
|
(parseFloat(task.downloadedSize) / |
|
|
|
parseFloat(task.totalSize)) * |
|
|
|
100 |
|
|
|
); |
|
|
|
showLoading.setTitle(" 正在下载" + prg + "% "); |
|
|
|
if (task.totalSize && > task.totalSize0) { |
|
|
|
prg = parseInt( |
|
|
|
(parseFloat(task.downloadedSize) / |
|
|
|
parseFloat(task.totalSize)) * |
|
|
|
100 |
|
|
|
); |
|
|
|
showLoading.setTitle("正在下载" + prg + "% "); |
|
|
|
}else { |
|
|
|
showLoading.setTitle("正在下载"); |
|
|
|
} |
|
|
|
break; |
|
|
|
case 4: |
|
|
|
plus.nativeUI.closeWaiting(); |
|
|
|