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