|
|
|
@ -28,7 +28,6 @@
|
|
|
|
|
<view class="menu-list">
|
|
|
|
|
<view class="list-cell list-cell-arrow" @click="handleToEditInfo">
|
|
|
|
|
<view class="menu-item-box">
|
|
|
|
|
|
|
|
|
|
<view class="iconfont icon-password menu-icon"></view>
|
|
|
|
|
<view>修改密码</view>
|
|
|
|
|
</view>
|
|
|
|
@ -39,6 +38,13 @@
|
|
|
|
|
<view>个人信息</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="list-cell list-cell-arrow" @click="updateVersion">
|
|
|
|
|
<view class="menu-item-box">
|
|
|
|
|
<view class="iconfont icon-version menu-icon"></view>
|
|
|
|
|
<view>版本更新</view>
|
|
|
|
|
<view class="version-box">发现新版本</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="outLogin">
|
|
|
|
|
<u-button type="primary" @click="handleLogout">退出登录</u-button>
|
|
|
|
@ -51,18 +57,25 @@
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import storage from '@/utils/storage'
|
|
|
|
|
|
|
|
|
|
import {
|
|
|
|
|
getVersions
|
|
|
|
|
} from '@/utils/handlerColor.js'
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
version: '',
|
|
|
|
|
showVersion: false,
|
|
|
|
|
localityVersion: '',
|
|
|
|
|
boxTop: 0,
|
|
|
|
|
name: this.$store.state.user.name,
|
|
|
|
|
version: getApp().globalData.config.appInfo.version
|
|
|
|
|
// version: getApp().globalData.config.appInfo.version
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onLoad() {
|
|
|
|
|
const systemData = this.$u.sys()
|
|
|
|
|
this.localityVersion = systemData.appVersion
|
|
|
|
|
this.boxTop = systemData.statusBarHeight
|
|
|
|
|
this.getVersion()
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
avatar() {
|
|
|
|
@ -73,6 +86,35 @@
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
updateVersion() {
|
|
|
|
|
if (this.showVersion) {
|
|
|
|
|
uni.showModal({
|
|
|
|
|
title: '发现新版本',
|
|
|
|
|
content: '版本:V ' + this.version,
|
|
|
|
|
cancelText: '暂不更新',
|
|
|
|
|
confirmText: '立即更新',
|
|
|
|
|
success: (res) => {
|
|
|
|
|
if (res.confirm) {
|
|
|
|
|
const urlAndorid = 'https://www.pgyer.com/9B4d'
|
|
|
|
|
if (window.plus) window.plus.runtime.openURL(urlAndorid)
|
|
|
|
|
// 更新版本
|
|
|
|
|
else window.open(urlAndorid)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
async getVersion() {
|
|
|
|
|
this.version = await getVersions()
|
|
|
|
|
if (this.localityVersion != this.version) {
|
|
|
|
|
this.showVersion = true
|
|
|
|
|
console.log(version, '版本', this.localityVersion)
|
|
|
|
|
} else {
|
|
|
|
|
this.showVersion = false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
handleLogout() {
|
|
|
|
|
this.$modal.confirm('确定注销并退出系统吗?').then(() => {
|
|
|
|
|
this.$store.dispatch('LogOut').then(() => {
|
|
|
|
@ -193,4 +235,20 @@
|
|
|
|
|
|
|
|
|
|
margin-top: 30rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.menu-item-box {
|
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
|
|
.version-box {
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 50%;
|
|
|
|
|
transform: translateY(-50%);
|
|
|
|
|
right: 30rpx;
|
|
|
|
|
background-color: red;
|
|
|
|
|
color: #fff;
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
padding: 0 10rpx;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|