<template>
|
<uni-base-page :footer="false">
|
<view slot="page">
|
<uni-list v-if="loginInfo.hasLogin">
|
<uni-list-item style="background-color: #f8f8f8;" :show-extra-icon="true" :show-arrow="false"
|
:title="loginInfo.chineseName">
|
<template slot="header">
|
<image class="slot-image" src="../../static/img/touxiang.jpg" mode="widthFix"></image>
|
</template>
|
</uni-list-item>
|
<uni-list-item style="background-color: #f8f8f8;" :show-extra-icon="true" :show-arrow="false"
|
:title="'修改密码'"
|
:to="'newPwd'"></uni-list-item>
|
</uni-list>
|
<view class="btn-row" style="margin-top: 10px;">
|
<button v-if="!loginInfo.hasLogin" type="primary" class="primary" @tap="bindLogin">登录</button>
|
<button v-if="loginInfo.hasLogin" type="default" @tap="bindLogout">退出登录</button>
|
</view>
|
</view>
|
</uni-base-page>
|
</template>
|
|
<script>
|
export default {
|
data() {
|
return {
|
loginInfo: this.$loginInfo
|
}
|
},
|
created() {
|
|
},
|
methods: {
|
bindLogin() {
|
uni.navigateTo({
|
url: 'login',
|
});
|
},
|
bindLogout() {
|
this.$logout();
|
|
uni.setStorage({
|
key: 'gs_mes_pad_userkey',
|
data: null,
|
success: function() {
|
|
}
|
});
|
/**
|
* 如果需要强制登录跳转回登录页面
|
*/
|
if (this.loginInfo.forcedLogin) {
|
uni.reLaunch({
|
url: 'login',
|
});
|
}
|
}
|
}
|
}
|
</script>
|
|
<style>
|
.slot-image {
|
display: block;
|
margin-right: 10px;
|
width: 50px;
|
height: 50px;
|
border-radius: 50%;
|
}
|
</style>
|