隐藏立即更新

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

320
App.vue
View File

@@ -461,168 +461,168 @@
} else {
//不是热更新是在线更新 校验是否强制升级
if (res.method == "true") {
uni.showModal({
showCancel: false,
title: '发现新版本',
confirmText: '立即更新',
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 => {
console.log(
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)
// if (res.method == "true") {
// uni.showModal({
// showCancel: false,
// title: '发现新版本',
// confirmText: '立即更新',
// 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 => {
// console.log(
// 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)
// })
// })
// })
// // })
// // })
// // })
}
}
});
}
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('取消');
}
}
});
}
// }
// }
// });
// }
// 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) {
console.log(item,'dubyg2')
const time = 100;
// #ifdef H5
if (returnIsSafari()) {