|
@@ -3,12 +3,12 @@
|
|
|
<!-- 头部 -->
|
|
|
<view class="user-head" @click="toUserPage">
|
|
|
<view class="user-photo">
|
|
|
- <text v-if="hasLogin"><open-data type="userAvatarUrl"></open-data></text>
|
|
|
- <u-image v-else src="/static/logo.png" width="100" height="100"></u-image>
|
|
|
+ <open-data type="userAvatarUrl"></open-data>
|
|
|
+ <u-image v-show="!hasLogin" src="/static/logo.png" width="100" height="100"></u-image>
|
|
|
</view>
|
|
|
<view class="user-info">
|
|
|
- <text v-if="hasLogin"><open-data type="userNickName"></open-data></text>
|
|
|
- <u-button v-else plain size="mini" shape="circle" @click="toLoginPage">登录</u-button>
|
|
|
+ <text v-show="hasLogin">{{userData.mobile||'--'}}</text>
|
|
|
+ <u-button v-show="!hasLogin" plain size="mini" shape="circle" @click="toLoginPage">登录</u-button>
|
|
|
</view>
|
|
|
<view v-if="hasLogin">
|
|
|
<u-icon name="arrow-right" color="#fff"></u-icon>
|
|
@@ -42,12 +42,13 @@
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- hasLogin: false
|
|
|
+ hasLogin: false,
|
|
|
+ userData: {}
|
|
|
};
|
|
|
},
|
|
|
onShow() {
|
|
|
checkLogin().then(res => {
|
|
|
- console.log(res)
|
|
|
+ console.log(res,'checkLogin')
|
|
|
this.hasLogin = res.status == 200
|
|
|
if(this.hasLogin){
|
|
|
this.getUserInfo()
|
|
@@ -63,6 +64,7 @@
|
|
|
console.log(res,'getUserInfo')
|
|
|
if(res.status == 200){
|
|
|
this.$u.vuex("vuex_userData",res.data)
|
|
|
+ this.userData = res.data
|
|
|
}
|
|
|
})
|
|
|
},
|