版本更新

This commit is contained in:
2020-08-25 10:13:49 +08:00
parent 0d96af99e1
commit 27bdf1f2b0
6 changed files with 43 additions and 11 deletions

View File

@@ -3,7 +3,7 @@
<view class="header">
<image src="../../pageD/images/file.png" class="tit-img" mode=""></image>
<view class="title">德铭阳光</view>
<view class="tit-info">版本:{{ version }} for {{ phone_type }}</view>
<view class="tit-info">版本: {{ $app_version }} for {{ phone_type }}</view>
</view>
<view class="main">
<view @click="viewAboutUs">
@@ -12,8 +12,8 @@
</view>
<view class="version-view">
<text class="title">版本更新</text>
<text class="tips" v-if="1">已是最新版本</text>
<text class="tips" v-else @click="updateVersion">发现新版本</text>
<text class="tips" v-if="version" @click="updateVersion">发现新版本: {{ version }}</text>
<text class="tips" v-else>已是最新版本</text>
</view>
</view>
</view>
@@ -22,8 +22,9 @@
export default {
data() {
return {
version: "",
version: '',
phone_type: "",
status: '',
}
},
onLoad() {
@@ -33,9 +34,12 @@ export default {
methods: {
// 检查版本号
getVersion() {
this.$u.post("Specialci/checkVersion",{ app_version: 1 }).then(res => {
this.$u.post("Specialci/checkVersion",{ app_version: this.$app_version }).then(res => {
// console.log(res);
this.version = res.data.app_version;
if(res.data.app_version != this.$app_version) {
this.version = res.data.app_version;
this.status = res.data.is_focus_upgrade; // 0 不强制 1 强制
}
})
},
viewAboutUs() {
@@ -44,7 +48,9 @@ export default {
});
},
updateVersion() {
this.$u.route('/pageE/setting/updateVersion');
this.$u.route('/pageE/setting/updateVersion', {
status: this.status
});
}
}
};