|
|
@@ -8,7 +8,7 @@
|
|
|
<ion-title>{{ $t('user.profile') }}</ion-title>
|
|
|
</ion-toolbar>
|
|
|
</ion-header>
|
|
|
- <ion-content :fullscreen="true">
|
|
|
+ <ion-content>
|
|
|
<div class="setting">
|
|
|
<van-cell-group :border="false">
|
|
|
<van-cell title="头像" is-link>
|
|
|
@@ -17,7 +17,7 @@
|
|
|
radius="4"
|
|
|
width="36"
|
|
|
height="36"
|
|
|
- :src="user.avatar || defaultLogo"
|
|
|
+ :src="(user || {}).avatar || defaultLogo"
|
|
|
fit="cover"
|
|
|
/>
|
|
|
|
|
|
@@ -31,7 +31,7 @@
|
|
|
title="昵称"
|
|
|
@click="$router.push({ name: 'changeText', query: { type: 'nickname' } })"
|
|
|
is-link
|
|
|
- :value="user.nickname"
|
|
|
+ :value="(user || {}).nickname"
|
|
|
>
|
|
|
<template #right-icon>
|
|
|
<img src="../assets/icon_inter.png" alt="" class="right-icon" />
|
|
|
@@ -40,9 +40,9 @@
|
|
|
|
|
|
<van-cell
|
|
|
title="性别"
|
|
|
- :class="{ not: !user.sex }"
|
|
|
+ :class="{ not: !(user || {}).sex }"
|
|
|
is-link
|
|
|
- :value="user.sex || '未设置'"
|
|
|
+ :value="(user || {}).sex || '未设置'"
|
|
|
@click="show = true"
|
|
|
>
|
|
|
<template #right-icon>
|
|
|
@@ -64,9 +64,9 @@
|
|
|
</van-cell>
|
|
|
</van-cell-group> -->
|
|
|
<van-cell-group :border="false">
|
|
|
- <van-cell title="绑定手机号" class="not" :value="user.phone"> </van-cell>
|
|
|
+ <van-cell title="绑定手机号" class="not" :value="(user || {}).phone"> </van-cell>
|
|
|
<!-- <van-cell title="修改密码" is-link></van-cell> -->
|
|
|
- <van-cell class="not" title="用户ID" :value="user.id" @click="showConsoleEve" />
|
|
|
+ <van-cell class="not" title="用户ID" :value="(user || {}).id" @click="showConsoleEve" />
|
|
|
<van-cell class="not" v-if="showConsole" title="审核版本" is-link @click="goReview" />
|
|
|
<van-cell class="not" v-if="showConsole" title="测试app" is-link @click="goTest" />
|
|
|
</van-cell-group>
|
|
|
@@ -74,6 +74,7 @@
|
|
|
<van-action-sheet v-model:show="show" :actions="actions" cancel-text="取消" @select="chooseSex" />
|
|
|
|
|
|
<!-- <van-area title="选择地址" :area-list="areaList" :columns-num="2" /> -->
|
|
|
+ <van-button style="margin-top: 20px" type="primary" block @click="onLogout">退出登录</van-button>
|
|
|
</div>
|
|
|
</ion-content>
|
|
|
</ion-page>
|
|
|
@@ -92,7 +93,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
- ...mapState(useUserStore, ['user'])
|
|
|
+ ...mapState(useUserStore, ['user', 'logout'])
|
|
|
},
|
|
|
setup() {
|
|
|
//性别
|
|
|
@@ -102,7 +103,7 @@ export default {
|
|
|
const userStore = useUserStore()
|
|
|
|
|
|
const cityName = computed(() => {
|
|
|
- return userStore.user.country + ' ' + userStore.user.city
|
|
|
+ return (userStore.user || {}).country + ' ' + (userStore.user || {}).city
|
|
|
})
|
|
|
|
|
|
return {
|
|
|
@@ -211,6 +212,10 @@ export default {
|
|
|
},
|
|
|
goTest() {
|
|
|
window.location.href = 'https://test.raex.vip/saas/home'
|
|
|
+ },
|
|
|
+ onLogout() {
|
|
|
+ this.logout()
|
|
|
+ this.$router.back()
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -231,7 +236,7 @@ export default {
|
|
|
.tabs {
|
|
|
font-size: 20px;
|
|
|
font-weight: bold;
|
|
|
- color: #000;
|
|
|
+ color: var(--ion-color-light-contrast);
|
|
|
line-height: 30px;
|
|
|
padding: 0 16px;
|
|
|
}
|
|
|
@@ -261,7 +266,7 @@ export default {
|
|
|
.van-cell__value {
|
|
|
span {
|
|
|
font-size: 16px;
|
|
|
- color: #000;
|
|
|
+ color: var(--ion-color-light-contrast);
|
|
|
line-height: 24px;
|
|
|
}
|
|
|
}
|
|
|
@@ -281,7 +286,7 @@ export default {
|
|
|
.van-cell__value {
|
|
|
span {
|
|
|
font-size: 13px;
|
|
|
- color: #000;
|
|
|
+ color: var(--ion-color-light-contrast);
|
|
|
line-height: 24px;
|
|
|
display: -webkit-box;
|
|
|
overflow: hidden;
|