|
|
|
@ -2,7 +2,7 @@ |
|
|
|
|
<view class="content" v-if="bannerShow"> |
|
|
|
|
<!-- 弹出层 --> |
|
|
|
|
<view class="uni-banner"> |
|
|
|
|
<!-- <image src="../static/logo.png" class="startUpHeaderLogo" /> --> |
|
|
|
|
<image src="../static/logo.png" class="startUpHeaderLogo" /> |
|
|
|
|
<view class="banner_box"> |
|
|
|
|
<view class="startUpHeaderBox h6">发现新版本</view> |
|
|
|
|
<view class="conter">{{ msg }}</view> |
|
|
|
@ -41,10 +41,11 @@ |
|
|
|
|
let localAppVersonName = uni.getStorageSync('version'); |
|
|
|
|
// #ifdef APP-PLUS |
|
|
|
|
let datas = { |
|
|
|
|
termType: "app" |
|
|
|
|
termType: "APP" |
|
|
|
|
} |
|
|
|
|
queryVersion(datas).then(res => { |
|
|
|
|
if (res.return_code == '000000') { |
|
|
|
|
that.msg = res.return_data.content; |
|
|
|
|
if (res.return_data.versionType == 1 && that.comparisonVersionHandler(localAppVersonName, |
|
|
|
|
res.return_data.version)) { |
|
|
|
|
that.downloadWgt(res.return_data.fileUrl); |
|
|
|
@ -67,19 +68,17 @@ |
|
|
|
|
const that = this; |
|
|
|
|
// 更新文件 wgt 文件地址 |
|
|
|
|
plus.nativeUI.showWaiting('正在更新...'); |
|
|
|
|
plus.downloader |
|
|
|
|
.createDownload( |
|
|
|
|
updateWgtUrl, { |
|
|
|
|
filename: '_doc/update/' |
|
|
|
|
}, |
|
|
|
|
function(d, status) { |
|
|
|
|
if (status == 200) { |
|
|
|
|
that.installWgt(d.filename); // 安装wgt方法 |
|
|
|
|
} |
|
|
|
|
plus.nativeUI.closeWaiting(); |
|
|
|
|
plus.downloader.createDownload( |
|
|
|
|
updateWgtUrl, { |
|
|
|
|
filename: '_doc/update/' |
|
|
|
|
}, |
|
|
|
|
function(d, status) { |
|
|
|
|
if (status == 200) { |
|
|
|
|
that.installWgt(d.filename); // 安装wgt方法 |
|
|
|
|
} |
|
|
|
|
) |
|
|
|
|
.start(); |
|
|
|
|
plus.nativeUI.closeWaiting(); |
|
|
|
|
} |
|
|
|
|
).start(); |
|
|
|
|
}, |
|
|
|
|
installWgt(path) { |
|
|
|
|
// 安装wgt方法 |
|
|
|
@ -100,7 +99,7 @@ |
|
|
|
|
); |
|
|
|
|
}, |
|
|
|
|
goUpdate() { |
|
|
|
|
if (this.type == 2) { |
|
|
|
|
// if (this.type == 2) { |
|
|
|
|
// 弹出系统等待对话框 |
|
|
|
|
var dtask = plus.downloader.createDownload( |
|
|
|
|
this.updateApkObj.fileUrl, {}, |
|
|
|
@ -156,9 +155,9 @@ |
|
|
|
|
duration: 1500 |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} else if (this.type == 1) { // ios跳转到app store |
|
|
|
|
plus.runtime.openURL(updateApkObj.downloadUrl); |
|
|
|
|
} |
|
|
|
|
// } else if (this.type == 1) { // ios跳转到app store |
|
|
|
|
// plus.runtime.openURL(updateApkObj.downloadUrl); |
|
|
|
|
// } |
|
|
|
|
}, |
|
|
|
|
//判断是否升级 |
|
|
|
|
comparisonVersionHandler(reqV, curV) { |
|
|
|
@ -257,8 +256,8 @@ |
|
|
|
|
width: 80%; |
|
|
|
|
|
|
|
|
|
.startUpHeaderLogo { |
|
|
|
|
width: 256rpx; |
|
|
|
|
height: 194rpx; |
|
|
|
|
width: 200rpx; |
|
|
|
|
height: 200rpx; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.banner_box { |
|
|
|
|