xcx 4 years ago
parent
commit
c81cb9466e
1 changed files with 11 additions and 8 deletions
  1. 11
    8
      src/pages/WoDe/index.vue

+ 11
- 8
src/pages/WoDe/index.vue View File

7
       <view class="centerLabel">
7
       <view class="centerLabel">
8
         <view class="flex-h">
8
         <view class="flex-h">
9
           <view class="Icon">
9
           <view class="Icon">
10
-            <image mode="widthFix" :src="IconUrl"></image>
10
+            <image mode="widthFix" :src="UserInfo.Icon || 'https://cjgw.oss-cn-hangzhou.aliyuncs.com/ygcxxfb/image/morentouxiang.png'"></image>
11
           </view>
11
           </view>
12
           <view class="flex-item">
12
           <view class="flex-item">
13
             <navigator url="../SignIn/index" hover-class="other-navigator-hover" class="SiginIn" v-if="UserInfo === null || UserInfo.Phone === undefined || UserInfo.Phone === null">立即登录</navigator>
13
             <navigator url="../SignIn/index" hover-class="other-navigator-hover" class="SiginIn" v-if="UserInfo === null || UserInfo.Phone === undefined || UserInfo.Phone === null">立即登录</navigator>
57
   name: 'WoDe',
57
   name: 'WoDe',
58
   data () {
58
   data () {
59
     return {
59
     return {
60
-      IconUrl: 'https://cjgw.oss-cn-hangzhou.aliyuncs.com/ygcxxfb/image/morentouxiang.png',
60
+      // IconUrl: 'https://cjgw.oss-cn-hangzhou.aliyuncs.com/ygcxxfb/image/morentouxiang.png',
61
     }
61
     }
62
   },
62
   },
63
   computed: {
63
   computed: {
64
     ...mapUserState({
64
     ...mapUserState({
65
       UserInfo: x => x.UserInfo // 用户信息
65
       UserInfo: x => x.UserInfo // 用户信息
66
-    })
66
+    }),
67
+    IconUrl () {
68
+      return (this.UserInfo || {}).Icon || 'https://cjgw.oss-cn-hangzhou.aliyuncs.com/ygcxxfb/image/morentouxiang.png'
69
+    }
67
   },
70
   },
68
   components: {
71
   components: {
69
     GetUserIcon
72
     GetUserIcon
81
       'EditUserInfo' // 编辑用户信息
84
       'EditUserInfo' // 编辑用户信息
82
     ]),
85
     ]),
83
     Init () { // 初始化
86
     Init () { // 初始化
84
-      if (this.UserInfo === null && this.UserInfo.Phone === undefined && this.UserInfo.Phone === null) {
85
-        this.IconUrl = this.UserInfo.Icon
86
-      }
87
+      // if (this.UserInfo === null && this.UserInfo.Phone === undefined && this.UserInfo.Phone === null) {
88
+      //   this.IconUrl = this.UserInfo.Icon
89
+      // }
87
     },
90
     },
88
     UserInfoChange () {
91
     UserInfoChange () {
89
-      this.IconUrl = this.UserInfo.Icon
90
-      console.log(this.IconUrl, '1`````')
92
+      // this.IconUrl = this.UserInfo.Icon
93
+      // console.log(this.IconUrl, '1`````')
91
     }
94
     }
92
   }
95
   }
93
 }
96
 }