|
|
@@ -49,6 +49,7 @@
|
|
|
<view class="action-btn change-pwd-btn" @click="onChangePassword">修改密码</view>
|
|
|
<view class="logout-btn" @click="onLogout">退出登录</view>
|
|
|
</view>
|
|
|
+ <text v-if="appVersionLabel" class="version-footer">当前版本 {{ appVersionLabel }}</text>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
@@ -68,6 +69,7 @@
|
|
|
return {
|
|
|
isAndroid: false,
|
|
|
loading: false,
|
|
|
+ appVersionLabel: '',
|
|
|
user: {
|
|
|
name: '',
|
|
|
id: '',
|
|
|
@@ -85,13 +87,33 @@
|
|
|
onLoad() {
|
|
|
this.applyFromStorage()
|
|
|
this.refreshAndroidFlag()
|
|
|
+ this.refreshAppVersion()
|
|
|
},
|
|
|
onShow() {
|
|
|
this.applyFromStorage()
|
|
|
this.refreshAndroidFlag()
|
|
|
+ this.refreshAppVersion()
|
|
|
this.refreshFromServer()
|
|
|
},
|
|
|
methods: {
|
|
|
+ refreshAppVersion() {
|
|
|
+ let v = ''
|
|
|
+ // #ifdef APP-PLUS
|
|
|
+ try {
|
|
|
+ if (typeof plus !== 'undefined' && plus.runtime) {
|
|
|
+ const name = plus.runtime.version
|
|
|
+ if (name) v = String(name)
|
|
|
+ }
|
|
|
+ } catch (e) {}
|
|
|
+ // #endif
|
|
|
+ if (!v) {
|
|
|
+ try {
|
|
|
+ const si = uni.getSystemInfoSync()
|
|
|
+ v = String(si.appVersion || si.appWgtVersion || '').trim()
|
|
|
+ } catch (e) {}
|
|
|
+ }
|
|
|
+ this.appVersionLabel = v
|
|
|
+ },
|
|
|
refreshAndroidFlag() {
|
|
|
// #ifdef APP-PLUS
|
|
|
try {
|
|
|
@@ -280,4 +302,13 @@
|
|
|
font-size: 32rpx;
|
|
|
color: #e54d42;
|
|
|
}
|
|
|
+ .version-footer {
|
|
|
+ display: block;
|
|
|
+ text-align: center;
|
|
|
+ margin-top: 40rpx;
|
|
|
+ font-size: 24rpx;
|
|
|
+ color: #999;
|
|
|
+ line-height: 1.5;
|
|
|
+ padding: 0 16rpx;
|
|
|
+ }
|
|
|
</style>
|