xcx 4 年前
父节点
当前提交
c81cb9466e
共有 1 个文件被更改,包括 11 次插入8 次删除
  1. 11
    8
      src/pages/WoDe/index.vue

+ 11
- 8
src/pages/WoDe/index.vue 查看文件

@@ -7,7 +7,7 @@
7 7
       <view class="centerLabel">
8 8
         <view class="flex-h">
9 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 11
           </view>
12 12
           <view class="flex-item">
13 13
             <navigator url="../SignIn/index" hover-class="other-navigator-hover" class="SiginIn" v-if="UserInfo === null || UserInfo.Phone === undefined || UserInfo.Phone === null">立即登录</navigator>
@@ -57,13 +57,16 @@ export default {
57 57
   name: 'WoDe',
58 58
   data () {
59 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 63
   computed: {
64 64
     ...mapUserState({
65 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 71
   components: {
69 72
     GetUserIcon
@@ -81,13 +84,13 @@ export default {
81 84
       'EditUserInfo' // 编辑用户信息
82 85
     ]),
83 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 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
 }