Merge pull request '版本更新' (#292) from zhy into master

Reviewed-on: http://git.luyuan.tk/luyuan/deming/pulls/292
This commit is contained in:
hansu 2020-08-25 10:14:36 +08:00
commit 4436bbd282
6 changed files with 43 additions and 11 deletions

12
App.vue
View File

@ -28,7 +28,7 @@
// #endif
},
onShow(){
this.getVersion();
},
onHide(){
@ -45,6 +45,16 @@
}
})
},
getVersion() {
this.$u.post("Specialci/checkVersion",{ app_version: this.$app_version }).then(res => {
// console.log(res);
if(res.data.app_version != this.$app_version) {
this.$u.route('/pageE/setting/updateVersion', {
status: res.data.is_focus_upgrade
});
}
})
},
}
}
</script>

View File

@ -49,4 +49,12 @@ unescapeHTML(temp){}
* @return { object } promise 对象 resolve 返回文件服务器地址 reject 返回错误信息
*/
uploadFile({ url, name, filePath }) {}
/**
* 广告位跳转
* @param { String } type 跳转类型 1 商品 2 店铺 3 领取优惠券
* @param { String | Number } id 跳转id 商品id/商家id...
* @return { undefined } undefined
*/
jumpPage({ type, id }) ()
```

View File

@ -5,6 +5,10 @@ import uView from "uview-ui";
Vue.config.productionTip = false
Vue.use(uView);
App.mpType = 'app'
// 当前 app 版本号
Vue.prototype.$app_version = '1.0.0';
Vue.prototype.imService = new IMService();
Vue.prototype.a = 1;
import store from '@/common/store/index.js'

View File

@ -1,7 +1,7 @@
<template>
<u-modal v-model="show" :show-cancel-button="true" confirm-text="升级" title="发现新版本" @cancel="cancel" @confirm="confirm">
<u-modal v-model="show" :show-cancel-button="is_focus_upgrade" confirm-text="升级" title="发现新版本" @cancel="cancel" @confirm="confirm">
<view class="u-update-content">
<rich-text :nodes="content"></rich-text>
<!-- <rich-text :nodes="content"></rich-text> -->
</view>
</u-modal>
</template>
@ -10,6 +10,7 @@
export default {
data() {
return {
is_focus_upgrade: Boolean, //
show: true,
// uni-app"rich-text"使"<br>"
content: `
@ -19,6 +20,9 @@
`,
}
},
onLoad(option) {
this.is_focus_upgrade = option.status == 1 ? false : true;
},
onReady() {
this.show = true;
},

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
});
}
}
};

View File

@ -179,8 +179,8 @@ export default {
})
} else {
this.getOrderNumber();
this.getUserInfo();
}
this.getUserInfo();
},
onNavigationBarButtonTap(e) {
// console.log(e);