|
@ -18,7 +18,7 @@ export function appUpdate(isShowHint) { |
|
|
console.log("获取更新数据", json) |
|
|
console.log("获取更新数据", json) |
|
|
if (res.data) { |
|
|
if (res.data) { |
|
|
if (res.data.installPackageVersion > Number(curversion)) { |
|
|
if (res.data.installPackageVersion > Number(curversion)) { |
|
|
var downUrl = res.data.downUrl; |
|
|
var downUrl = res.data.installPackageUrl; |
|
|
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 |
|
@ -77,7 +77,7 @@ export function showDialog(versionName, content, isForcedUpdate, downUrl) { |
|
|
console.log( |
|
|
console.log( |
|
|
'cancel') //点击取消之后执行的代码
|
|
|
'cancel') //点击取消之后执行的代码
|
|
|
if (isForcedUpdate == "TRUE") { |
|
|
if (isForcedUpdate == "TRUE") { |
|
|
showDialog(version, content, isForcedUpdate, downUrl) |
|
|
showDialog(versionName, content, isForcedUpdate, downUrl) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -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(); |
|
|