升级更新
This commit is contained in:
78
App.vue
78
App.vue
@@ -367,13 +367,15 @@
|
|||||||
plus.runtime.restart();
|
plus.runtime.restart();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
//获取当前系统版本信息
|
//获取当前系统版本信息
|
||||||
plus.runtime.getProperty(plus.runtime.appid, widgetInfo => {
|
plus.runtime.getProperty(plus.runtime.appid, widgetInfo => {
|
||||||
//请求后台接口 解析数据 对比版本
|
//请求后台接口 解析数据 对比版本
|
||||||
that.$Request.getT('/app/user/selectNewApp').then(res => {
|
that.$Request.getT('/app/user/selectNewApp').then(res => {
|
||||||
res = res.data[0];
|
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 downloadLink = '';
|
||||||
let androidLink = res.androidWgtUrl;
|
let androidLink = res.androidWgtUrl;
|
||||||
let iosLink = res.iosWgtUrl;
|
let iosLink = res.iosWgtUrl;
|
||||||
@@ -388,7 +390,7 @@
|
|||||||
console.log('发现下载地址');
|
console.log('发现下载地址');
|
||||||
// 安卓:创建下载任务
|
// 安卓:创建下载任务
|
||||||
if (androidLink.match(RegExp(/.wgt/))) {
|
if (androidLink.match(RegExp(/.wgt/))) {
|
||||||
console.log('确认wgt热更新包');
|
console.log('确认wgt热更新包');
|
||||||
downloadLink = androidLink;
|
downloadLink = androidLink;
|
||||||
ready = true;
|
ready = true;
|
||||||
} else {
|
} else {
|
||||||
@@ -398,8 +400,8 @@
|
|||||||
console.log('下载地址是空的,无法继续');
|
console.log('下载地址是空的,无法继续');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log('苹果系统');
|
console.log('苹果系统');
|
||||||
if (iosLink && iosLink !== '#') {
|
if (iosLink && iosLink !== '#') {
|
||||||
// 我这里默认#也是没有地址,请根据业务自行修改
|
// 我这里默认#也是没有地址,请根据业务自行修改
|
||||||
console.log('发现下载地址');
|
console.log('发现下载地址');
|
||||||
// 苹果(A):进行热更新(如果iosLink是wgt更新包的下载地址)判断文件名中是否含有.wgt
|
// 苹果(A):进行热更新(如果iosLink是wgt更新包的下载地址)判断文件名中是否含有.wgt
|
||||||
@@ -457,11 +459,12 @@
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//不是热更新是在线更新 校验是否强制升级
|
//不是热更新是在线更新 校验是否强制升级
|
||||||
if (res.method == 'true') {
|
|
||||||
|
if (res.method == "true") {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
showCancel: false,
|
showCancel: false,
|
||||||
confirmText: '立即更新',
|
|
||||||
title: '发现新版本',
|
title: '发现新版本',
|
||||||
|
confirmText: '立即更新',
|
||||||
content: res.des,
|
content: res.des,
|
||||||
success: res => {
|
success: res => {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
@@ -471,15 +474,10 @@
|
|||||||
uni.downloadFile({
|
uni.downloadFile({
|
||||||
url: androidLink,
|
url: androidLink,
|
||||||
success: downloadResult => {
|
success: downloadResult => {
|
||||||
if (downloadResult
|
console.log(downloadResult)
|
||||||
.statusCode ===
|
if (downloadResult.statusCode === 200) {
|
||||||
200) {
|
|
||||||
plus.runtime
|
plus.runtime
|
||||||
.install(
|
.install(downloadResult.tempFilePath, { force: false },
|
||||||
downloadResult
|
|
||||||
.tempFilePath, {
|
|
||||||
force: false
|
|
||||||
},
|
|
||||||
d => {
|
d => {
|
||||||
console
|
console
|
||||||
.log(
|
.log(
|
||||||
@@ -489,12 +487,22 @@
|
|||||||
.restart();
|
.restart();
|
||||||
},
|
},
|
||||||
e => {
|
e => {
|
||||||
|
console.log(e)
|
||||||
console
|
console
|
||||||
.error(
|
.error(
|
||||||
'install fail...'
|
'install fail...'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
// plus.io.resolveLocalFileSystemURL(downloadResult.tempFilePath, entry => {
|
||||||
|
// entry.getParent(_oldFile=>{
|
||||||
|
// entry.moveTo(_oldFile,'.apk',newFilePath=>{
|
||||||
|
// console.log('newFilePath',newFilePath.fullPath)
|
||||||
|
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -509,7 +517,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '发现新版本',
|
title: '发现新版本',
|
||||||
confirmText: '立即更新',
|
confirmText: '立即更新',
|
||||||
@@ -523,15 +531,9 @@
|
|||||||
uni.downloadFile({
|
uni.downloadFile({
|
||||||
url: androidLink,
|
url: androidLink,
|
||||||
success: downloadResult => {
|
success: downloadResult => {
|
||||||
if (downloadResult
|
if (downloadResult.statusCode === 200) {
|
||||||
.statusCode ===
|
|
||||||
200) {
|
|
||||||
plus.runtime
|
plus.runtime
|
||||||
.install(
|
.install(downloadResult.tempFilePath, { force: false },
|
||||||
downloadResult
|
|
||||||
.tempFilePath, {
|
|
||||||
force: false
|
|
||||||
},
|
|
||||||
d => {
|
d => {
|
||||||
console
|
console
|
||||||
.log(
|
.log(
|
||||||
@@ -541,12 +543,38 @@
|
|||||||
.restart();
|
.restart();
|
||||||
},
|
},
|
||||||
e => {
|
e => {
|
||||||
|
console.log(e)
|
||||||
console
|
console
|
||||||
.error(
|
.error(
|
||||||
'install fail...'
|
'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...'
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
// );
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ const ROOTPATH2 = "https://dj-h5.hnsiyao.cn"; //后台服务域名
|
|||||||
|
|
||||||
// const ROOTPATH1 = "https://video.hnsiyao.cn/sqx_fast/"; //
|
// const ROOTPATH1 = "https://video.hnsiyao.cn/sqx_fast/"; //
|
||||||
// const ROOTPATH = "https://video.hnsiyao.cn/sqx_fast/"; //后台服务域名
|
// const ROOTPATH = "https://video.hnsiyao.cn/sqx_fast/"; //后台服务域名
|
||||||
// const ROOTPATH2 = "https://video-h5.hnsiyao.cn"; //后台服务域名
|
// const ROOTPATH2 = "https://video-h5.hnsiyao.cn"; //后台服务域名
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
APIHOST: ROOTPATH,
|
APIHOST: ROOTPATH,
|
||||||
|
|||||||
@@ -102,8 +102,9 @@
|
|||||||
|
|
||||||
.centre {
|
.centre {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin: 200rpx auto;
|
padding: 200rpx 0;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
image {
|
image {
|
||||||
width: 360rpx;
|
width: 360rpx;
|
||||||
|
|||||||
@@ -96,8 +96,9 @@
|
|||||||
|
|
||||||
.centre {
|
.centre {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin: 200rpx auto;
|
padding: 200rpx 0;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
|
box-sizing: border-box;
|
||||||
image {
|
image {
|
||||||
width: 360rpx;
|
width: 360rpx;
|
||||||
height: 360rpx;
|
height: 360rpx;
|
||||||
|
|||||||
@@ -338,7 +338,6 @@
|
|||||||
"path": "invite/cashList",
|
"path": "invite/cashList",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "提现记录",
|
"navigationBarTitleText": "提现记录",
|
||||||
"enablePullDownRefresh": true,
|
|
||||||
"h5": {
|
"h5": {
|
||||||
"titleNView": {
|
"titleNView": {
|
||||||
"backgroundColor": "#FFFFFF"
|
"backgroundColor": "#FFFFFF"
|
||||||
|
|||||||
@@ -22,8 +22,8 @@
|
|||||||
<view class="subhead u-font-24">{{ item.detail }}</view>
|
<view class="subhead u-font-24">{{ item.detail }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="cell_right flex">
|
<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-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.buttonTitle }}</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-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 v-if=" item.type ==4 " class="u-font-20 tip" @click="goNav('/me/gift/gift', item.type)">查看奖品列表</view> -->
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
Reference in New Issue
Block a user