|
|
|
@ -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,8 +68,7 @@ |
|
|
|
|
const that = this; |
|
|
|
|
// 更新文件 wgt 文件地址 |
|
|
|
|
plus.nativeUI.showWaiting('正在更新...'); |
|
|
|
|
plus.downloader |
|
|
|
|
.createDownload( |
|
|
|
|
plus.downloader.createDownload( |
|
|
|
|
updateWgtUrl, { |
|
|
|
|
filename: '_doc/update/' |
|
|
|
|
}, |
|
|
|
@ -78,8 +78,7 @@ |
|
|
|
|
} |
|
|
|
|
plus.nativeUI.closeWaiting(); |
|
|
|
|
} |
|
|
|
|
) |
|
|
|
|
.start(); |
|
|
|
|
).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 { |
|
|
|
|