// #ifdef APP-PLUS
// 版本更新
plus.runtime.getProperty(plus.runtime.appid,(wgtinfo)=>{
console.log(wgtinfo.version)//获取当前版本号
HttpService.getVersion({
version: wgtinfo.version // 传给后端版本号
}).then(res => {
if (res.success && res.data.isUpdate) {//判断是否需要更新
let openUrl = plus.os.name === 'iOS' ? res.data.url : res.data.url;
// 提醒用户更新
uni.showModal({
title: '更新提示',
content: '是否选择更新',
success: (showResult) => {
if (showResult.confirm) {
plus.runtime.openURL(openUrl);//打开外链下载
}
}
})
}
});
})
// #endif
uni-app开发 应用版本更新
最新推荐文章于 2023-11-10 15:07:25 发布