panhui há 5 anos atrás
pai
commit
e6d34c6c1c

+ 1 - 1
src/components/ChatInfo.vue

@@ -56,7 +56,7 @@ export default {
                 if (this.sendUser.store && !this.isMine) {
                     return {
                         name: this.sendUser.store.storeName,
-                        avatar: this.sendUser.store.logo
+                        avatar: this.getLogo(this.sendUser.store.logo)
                     };
                 } else {
                     return {

+ 6 - 4
src/components/NewsInfo.vue

@@ -48,15 +48,17 @@ export default {
             if (this.info.storeUserId !== this.userInfo.id) {
                 return {
                     userId: this.info.storeUserId,
-                    img: this.info.storeUser.store.logo,
-                    name: this.info.storeUser.store.storeName
+                    img: this.info.storeUser.store
+                        ? this.getLogo(this.info.storeUser.store.logo)
+                        : this.info.storeUser.store.avatar,
+                    name: this.info.storeUser.store ? this.info.storeUser.store.storeName : this.info.storeUser.nickname
                 };
             }
             if (this.info.userId !== this.userInfo.id) {
                 return {
                     userId: this.info.userId,
-                    img: this.info.user.avatar,
-                    name: this.info.user.nickname
+                    img: this.info.user.store ? this.getLogo(this.info.user.store.logo) : this.info.user.avatar,
+                    name: this.info.user.store ? this.info.user.store.storeName : this.info.user.nickname
                 };
             }
 

+ 3 - 0
src/mixins/common.js

@@ -120,6 +120,9 @@ export default {
         },
         wait() {
             this.toast('敬请期待');
+        },
+        getLogo(img) {
+            return img ? img + '?x-oss-process=image/circle,r_300/format,png' : '/native/imgs/defaultLogo.png';
         }
     }
 };

+ 0 - 1
src/pages/chat.vue

@@ -103,7 +103,6 @@ export default {
     },
     methods: {
         loginMethods() {
-            console.log(this.$mp.options.toUserId);
             let eventChannel = this.$mp.page.getOpenerEventChannel();
 
             this.$http

+ 1 - 1
src/pages/mine.vue

@@ -13,7 +13,7 @@
     <div class="page-scroll">
         <div class="top">
             <van-image
-                :src="userInfo ? userInfo.avatar : '/native/svgs/img_defaultphoto.svg'"
+                :src="getLogo(userInfo ? userInfo.avatar : '')"
                 width="90"
                 height="90"
                 round