升级更新
This commit is contained in:
66
App.vue
66
App.vue
@@ -373,7 +373,9 @@
|
||||
//请求后台接口 解析数据 对比版本
|
||||
that.$Request.getT('/app/user/selectNewApp').then(res => {
|
||||
res = res.data[0];
|
||||
if (res.wgtUrl && widgetInfo.version < res.version) {
|
||||
console.log("widgetInfo==",widgetInfo)
|
||||
console.log("selectNewApp==",res)
|
||||
if (widgetInfo.version < res.version) {
|
||||
let downloadLink = '';
|
||||
let androidLink = res.androidWgtUrl;
|
||||
let iosLink = res.iosWgtUrl;
|
||||
@@ -457,11 +459,12 @@
|
||||
}
|
||||
} else {
|
||||
//不是热更新是在线更新 校验是否强制升级
|
||||
if (res.method == 'true') {
|
||||
|
||||
if (res.method == "true") {
|
||||
uni.showModal({
|
||||
showCancel: false,
|
||||
confirmText: '立即更新',
|
||||
title: '发现新版本',
|
||||
confirmText: '立即更新',
|
||||
content: res.des,
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
@@ -471,15 +474,10 @@
|
||||
uni.downloadFile({
|
||||
url: androidLink,
|
||||
success: downloadResult => {
|
||||
if (downloadResult
|
||||
.statusCode ===
|
||||
200) {
|
||||
console.log(downloadResult)
|
||||
if (downloadResult.statusCode === 200) {
|
||||
plus.runtime
|
||||
.install(
|
||||
downloadResult
|
||||
.tempFilePath, {
|
||||
force: false
|
||||
},
|
||||
.install(downloadResult.tempFilePath, { force: false },
|
||||
d => {
|
||||
console
|
||||
.log(
|
||||
@@ -489,12 +487,22 @@
|
||||
.restart();
|
||||
},
|
||||
e => {
|
||||
console.log(e)
|
||||
console
|
||||
.error(
|
||||
'install fail...'
|
||||
);
|
||||
}
|
||||
);
|
||||
// plus.io.resolveLocalFileSystemURL(downloadResult.tempFilePath, entry => {
|
||||
// entry.getParent(_oldFile=>{
|
||||
// entry.moveTo(_oldFile,'.apk',newFilePath=>{
|
||||
// console.log('newFilePath',newFilePath.fullPath)
|
||||
|
||||
// })
|
||||
// })
|
||||
// })
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -523,15 +531,9 @@
|
||||
uni.downloadFile({
|
||||
url: androidLink,
|
||||
success: downloadResult => {
|
||||
if (downloadResult
|
||||
.statusCode ===
|
||||
200) {
|
||||
if (downloadResult.statusCode === 200) {
|
||||
plus.runtime
|
||||
.install(
|
||||
downloadResult
|
||||
.tempFilePath, {
|
||||
force: false
|
||||
},
|
||||
.install(downloadResult.tempFilePath, { force: false },
|
||||
d => {
|
||||
console
|
||||
.log(
|
||||
@@ -541,12 +543,38 @@
|
||||
.restart();
|
||||
},
|
||||
e => {
|
||||
console.log(e)
|
||||
console
|
||||
.error(
|
||||
'install fail...'
|
||||
);
|
||||
}
|
||||
);
|
||||
// plus.io.resolveLocalFileSystemURL(downloadResult.tempFilePath, entry => {
|
||||
// entry.getParent(_oldFile=>{
|
||||
// entry.moveTo(_oldFile,'.apk',newFilePath=>{
|
||||
// console.log('newFilePath',newFilePath.fullPath)
|
||||
// plus.runtime
|
||||
// .install(newFilePath.fullPath, { force: false },
|
||||
// d => {
|
||||
// console
|
||||
// .log(
|
||||
// 'install success...'
|
||||
// );
|
||||
// plus.runtime
|
||||
// .restart();
|
||||
// },
|
||||
// e => {
|
||||
// console.log(e)
|
||||
// console
|
||||
// .error(
|
||||
// 'install fail...'
|
||||
// );
|
||||
// }
|
||||
// );
|
||||
// })
|
||||
// })
|
||||
// })
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -102,8 +102,9 @@
|
||||
|
||||
.centre {
|
||||
text-align: center;
|
||||
margin: 200rpx auto;
|
||||
padding: 200rpx 0;
|
||||
font-size: 32rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
image {
|
||||
width: 360rpx;
|
||||
|
||||
@@ -96,8 +96,9 @@
|
||||
|
||||
.centre {
|
||||
text-align: center;
|
||||
margin: 200rpx auto;
|
||||
padding: 200rpx 0;
|
||||
font-size: 32rpx;
|
||||
box-sizing: border-box;
|
||||
image {
|
||||
width: 360rpx;
|
||||
height: 360rpx;
|
||||
|
||||
@@ -338,7 +338,6 @@
|
||||
"path": "invite/cashList",
|
||||
"style": {
|
||||
"navigationBarTitleText": "提现记录",
|
||||
"enablePullDownRefresh": true,
|
||||
"h5": {
|
||||
"titleNView": {
|
||||
"backgroundColor": "#FFFFFF"
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
<view class="subhead u-font-24">{{ item.detail }}</view>
|
||||
</view>
|
||||
<view class="cell_right flex">
|
||||
<view v-if=" item.disabled " class="btn u-font-24 text-bold" :style="{backgroundColor: item.buttonBgColor,color: item.buttonFontColor }" @click="goNav(item)">{{ item.buttonTitle }}</view>
|
||||
<view v-else class="btn u-font-24 text-bold disabled">{{ item.buttonTitle }}</view>
|
||||
<view v-if=" item.disabled " class="btn u-font-24 text-bold" :style="{backgroundColor: item.buttonBgColor,color: item.buttonFontColor }" @click="goNav(item)">{{ item.type == 1 ? item.buttonTitle : ( item.number <= 0 ? '立即领取' : `剩余${item.number}次`) }}</view>
|
||||
<view v-else class="btn u-font-24 text-bold disabled">{{ item.type == 1 ? item.buttonTitle : ( item.number <= 0 ? '立即领取' : `剩余${item.number}次`) }}</view>
|
||||
<!-- <view v-else class="btn u-font-24 text-bold" @click="goNav(item)">{{ item.buttonTitle }}</view> -->
|
||||
<!-- <view v-if=" item.type ==4 " class="u-font-20 tip" @click="goNav('/me/gift/gift', item.type)">查看奖品列表</view> -->
|
||||
</view>
|
||||
|
||||
Reference in New Issue
Block a user