隐藏立即更新

This commit is contained in:
duan
2024-12-31 13:39:17 +08:00
parent 48f83a14cb
commit 2aa9070b0e
2 changed files with 160 additions and 161 deletions

292
App.vue
View File

@@ -461,134 +461,38 @@
} else { } else {
//不是热更新是在线更新 校验是否强制升级 //不是热更新是在线更新 校验是否强制升级
if (res.method == "true") { // if (res.method == "true") {
uni.showModal({ // uni.showModal({
showCancel: false, // showCancel: false,
title: '发现新版本', // title: '发现新版本',
confirmText: '立即更新', // confirmText: '立即更新',
content: res.des, // content: res.des,
success: res => { // success: res => {
if (res.confirm) { // if (res.confirm) {
plus.runtime.openURL(config.APIHOST2 + // plus.runtime.openURL(config.APIHOST2 +
'/pages/login/appEq') // '/pages/login/appEq')
return // return
uni.showLoading({ // uni.showLoading({
title: '下载中...', // title: '下载中...',
mask: true // mask: true
}); // });
if (uni.getSystemInfoSync().platform == // if (uni.getSystemInfoSync().platform ==
'android') { // 'android') {
uni.downloadFile({ // uni.downloadFile({
url: androidLink, // url: androidLink,
success: downloadResult => { // success: downloadResult => {
console.log( // console.log(
downloadResult // downloadResult
) // )
if (downloadResult // if (downloadResult
.statusCode === // .statusCode ===
200) { // 200) {
plus.runtime
.install(
downloadResult
.tempFilePath, {
force: false
},
d => {
console
.log(
'install success...'
);
plus.runtime
.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)
// })
// })
// })
}
}
});
}
if (uni.getSystemInfoSync().platform ==
'ios') {
plus.runtime.openURL(iosLink, function(
res) {});
}
} else if (res.cancel) {
console.log('取消');
}
}
});
} else {
uni.showModal({
title: '发现新版本',
confirmText: '立即更新',
cancelText: '下次更新',
content: res.des,
success: res => {
if (res.confirm) {
plus.runtime.openURL(config.APIHOST2 +
'/pages/login/appEq')
return
uni.showLoading({
title: '下载中...',
mask: true
});
if (uni.getSystemInfoSync().platform ==
'android') {
uni.downloadFile({
url: androidLink,
success: downloadResult => {
if (downloadResult
.statusCode ===
200) {
plus.runtime
.install(
downloadResult
.tempFilePath, {
force: false
},
d => {
console
.log(
'install success...'
);
plus.runtime
.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 // plus.runtime
// .install(newFilePath.fullPath, { force: false }, // .install(
// downloadResult
// .tempFilePath, {
// force: false
// },
// d => { // d => {
// console // console
// .log( // .log(
@@ -598,31 +502,127 @@
// .restart(); // .restart();
// }, // },
// e => { // e => {
// console.log(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)
}
}); // // })
} // // })
if (uni.getSystemInfoSync().platform == // // })
'ios') {
plus.runtime.openURL(iosLink, function( // }
res) {}); // }
} // });
} else if (res.cancel) { // }
console.log('取消'); // if (uni.getSystemInfoSync().platform ==
} // 'ios') {
} // plus.runtime.openURL(iosLink, function(
}); // res) {});
} // }
// } else if (res.cancel) {
// console.log('取消');
// }
// }
// });
// } else {
// uni.showModal({
// title: '发现新版本',
// confirmText: '立即更新',
// cancelText: '下次更新',
// content: res.des,
// success: res => {
// if (res.confirm) {
// plus.runtime.openURL(config.APIHOST2 +
// '/pages/login/appEq')
// return
// uni.showLoading({
// title: '下载中...',
// mask: true
// });
// if (uni.getSystemInfoSync().platform ==
// 'android') {
// uni.downloadFile({
// url: androidLink,
// success: downloadResult => {
// if (downloadResult
// .statusCode ===
// 200) {
// plus.runtime
// .install(
// downloadResult
// .tempFilePath, {
// force: false
// },
// d => {
// console
// .log(
// 'install success...'
// );
// plus.runtime
// .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...'
// // );
// // }
// // );
// // })
// // })
// // })
// }
// }
// });
// }
// if (uni.getSystemInfoSync().platform ==
// 'ios') {
// plus.runtime.openURL(iosLink, function(
// res) {});
// }
// } else if (res.cancel) {
// console.log('取消');
// }
// }
// });
// }
} }
} }
}); });

View File

@@ -649,7 +649,6 @@
}, },
//查看视频 //查看视频
seVideo(item) { seVideo(item) {
console.log(item,'dubyg2')
const time = 100; const time = 100;
// #ifdef H5 // #ifdef H5
if (returnIsSafari()) { if (returnIsSafari()) {