feat: 将版本更新入口移到我的页面
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
<u-cell-group :border="false">
|
||||
<u-cell-item title="通用" @click="navTo('/pages/sys/user/currency')" :arrow="true"></u-cell-item>
|
||||
<u-gap height="20" bg-color="#f5f5f5"></u-gap>
|
||||
<u-cell-item title="版本更新" @click="upgrade()" :arrow="true"></u-cell-item>
|
||||
<u-cell-item title="隐私政策" @click="navTo('')" :arrow="true"></u-cell-item>
|
||||
<u-cell-item title="用户协议" @click="navTo('')" :arrow="true"></u-cell-item>
|
||||
</u-cell-group>
|
||||
@@ -18,10 +17,6 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://aidex.vip All rights reserved.
|
||||
*/
|
||||
import app_upgrade from '@/uni_modules/app-upgrade/js_sdk/index.js'
|
||||
import util from '@/common/util.js';
|
||||
import config from '../../../common/config';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -34,36 +29,6 @@ export default {
|
||||
url: url
|
||||
});
|
||||
},
|
||||
upgrade(){
|
||||
// #ifdef APP-PLUS
|
||||
app_upgrade(async ()=>{
|
||||
// 获取应用信息
|
||||
const appInfo = await new Promise((resolve) => {
|
||||
plus.runtime.getProperty(plus.runtime.appid, (inf) => {
|
||||
resolve(inf);
|
||||
});
|
||||
});
|
||||
const res = await this.$u.api.upgradeCheck({
|
||||
app_name: config.upgradeName,
|
||||
current_version: appInfo.version
|
||||
})
|
||||
console.log('res',res)
|
||||
if(!res.download_url){
|
||||
this.$u.toast('当前版本已是最新版');
|
||||
return
|
||||
}
|
||||
return {
|
||||
changelog: res.message + ',最新版本:' + res.latest_version,
|
||||
|
||||
status: res.need_update ? 1 : 0, // 0 无新版本 | 1 有新版本
|
||||
path: res.download_url // 新apk地址
|
||||
}
|
||||
}, 1)
|
||||
// #endif
|
||||
// #ifndef APP-PLUS
|
||||
this.$u.toast('小程序端或H5端已是最新版,无需检查更新!');
|
||||
// #endif
|
||||
},
|
||||
openSettings() {
|
||||
// #ifdef APP-PLUS
|
||||
uni.getSystemInfo({
|
||||
|
||||
Reference in New Issue
Block a user