deming/pageE/setting/version.vue

127 lines
2.6 KiB
Vue

<template>
<view class="version">
<view class="header">
<image src="../../pageD/images/file.png" class="tit-img" mode=""></image>
<view class="title">德铭阳光</view>
<view class="tit-info">版本: {{ $app_version }} for {{ phone_type }}</view>
</view>
<view class="main">
<view @click="viewAboutUs">
<text class="title">产品介绍</text>
<u-icon name="arrow-right" color="#999"></u-icon>
</view>
<view class="version-view">
<text class="title">版本更新</text>
<text class="tips" v-if="version" @click="updateVersion">发现新版本: {{ version }}</text>
<text class="tips" v-else>已是最新版本</text>
</view>
<view>
<text class="title">联系我们</text>
<text class="tips">{{ phoneNumber }}</text>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
version: '',
phone_type: "",
status: '',
phoneNumber: '',
}
},
onLoad() {
this.getVersion();
this.getPhone();
this.phone_type = this.$u.os();
},
methods: {
// 检查版本号
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.version = res.data.app_version;
this.status = res.data.is_focus_upgrade; // 0 不强制 1 强制
}
})
},
getPhone() {
this.$u.api.getConfigInfo({
code: 'site_tel400'
}).then(res => {
this.phoneNumber = res.data.config.value;
})
},
viewAboutUs() {
this.$u.route('/pageE/mine/ArticleDetails', {
type: 2
});
},
updateVersion() {
this.$u.route('/pageE/setting/updateVersion', {
status: this.status,
});
}
}
};
</script>
<style lang="scss" scoped>
.header {
width: 500rpx;
margin: 0 auto;
padding: 30rpx;
text-align: center;
.tit-img {
width: 200rpx;
height: 200rpx;
}
.title {
margin: 18rpx 0;
font-weight: bold;
font-size: 26rpx;
letter-spacing: 2rpx;
}
.tit-info {
font-size: 22rpx;
color: #666;
}
}
.main {
margin: 20rpx 0;
& > view {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
height: 100rpx;
padding: 0 20rpx;
line-height: 100rpx;
color: #333;
font-size: 30rpx;
background-color: #fff;
border-bottom: 1px solid #f2f2f2;
.title {
width: 200rpx;
}
}
.tips {
color: #999;
font-size: 28rpx;
}
.version-view {
.tips {
flex: 1;
text-align: right;
}
}
}
.u-content {
padding: 20rpx;
font-size: 30rpx;
text-indent: 1rem;
line-height: 1.2;
}
</style>