Authored by TaoHuang

add avatar link

@@ -3,8 +3,10 @@ @@ -3,8 +3,10 @@
3 <Layout class="article"> 3 <Layout class="article">
4 <LayoutHeader theme="white" slot='header' :title="title" :share="shareData" :opacity="currentAuthor.opacity"> 4 <LayoutHeader theme="white" slot='header' :title="title" :share="shareData" :opacity="currentAuthor.opacity">
5 <template v-if="showHeader"> 5 <template v-if="showHeader">
  6 + <router-link class="avatar-wrapper" :to="`/grass/author/${currentAuthor.authorType}/${currentAuthor.authorUid}`">
6 <WidgetAvatar class="widget-avatar" :src="currentAuthor.authorHeadIco" :width="70" :height="70"></WidgetAvatar> 7 <WidgetAvatar class="widget-avatar" :src="currentAuthor.authorHeadIco" :width="70" :height="70"></WidgetAvatar>
7 <span class="user-name">{{currentAuthor.authorName}}</span> 8 <span class="user-name">{{currentAuthor.authorName}}</span>
  9 + </router-link>
8 </template> 10 </template>
9 <template v-if="showHeader" v-slot:opts> 11 <template v-if="showHeader" v-slot:opts>
10 <WidgetFollow class="widget-follow" :author-uid="currentAuthor.authorUid" :follow="currentAuthor.hasAttention === 'Y'" @on-follow="follow => onFollow(currentAuthor, follow)"></WidgetFollow> 12 <WidgetFollow class="widget-follow" :author-uid="currentAuthor.authorUid" :follow="currentAuthor.hasAttention === 'Y'" @on-follow="follow => onFollow(currentAuthor, follow)"></WidgetFollow>
@@ -67,7 +69,8 @@ export default { @@ -67,7 +69,8 @@ export default {
67 authorHeadIco: '', 69 authorHeadIco: '',
68 hasAttention: 'N', 70 hasAttention: 'N',
69 opacity: 1, 71 opacity: 1,
70 - isShare: false 72 + isShare: false,
  73 + authorType: 1
71 } 74 }
72 }; 75 };
73 }, 76 },
@@ -98,10 +101,13 @@ export default { @@ -98,10 +101,13 @@ export default {
98 this.currentId = item.data.articleId; 101 this.currentId = item.data.articleId;
99 this.$emit('on-scroll-change', {articleId: item.data.articleId}); 102 this.$emit('on-scroll-change', {articleId: item.data.articleId});
100 } 103 }
  104 +
101 this.currentAuthor.authorUid = item.data.authorUid; 105 this.currentAuthor.authorUid = item.data.authorUid;
102 this.currentAuthor.authorName = item.data.authorName; 106 this.currentAuthor.authorName = item.data.authorName;
103 this.currentAuthor.authorHeadIco = item.data.authorHeadIco; 107 this.currentAuthor.authorHeadIco = item.data.authorHeadIco;
104 this.currentAuthor.hasAttention = item.data.hasAttention; 108 this.currentAuthor.hasAttention = item.data.hasAttention;
  109 + this.currentAuthor.authorType = item.data.authorType;
  110 +
105 this.showHeader = true; 111 this.showHeader = true;
106 const offsetTop = scrollTop - item.top; 112 const offsetTop = scrollTop - item.top;
107 113
@@ -169,6 +175,12 @@ export default { @@ -169,6 +175,12 @@ export default {
169 background-color: #f0f0f0; 175 background-color: #f0f0f0;
170 } 176 }
171 177
  178 +.avatar-wrapper {
  179 + display: flex;
  180 + justify-content: center;
  181 + align-items: center;
  182 +}
  183 +
172 .widget-avatar { 184 .widget-avatar {
173 width: 52px; 185 width: 52px;
174 height: 52px; 186 height: 52px;