Authored by TaoHuang

add avatar link

... ... @@ -3,8 +3,10 @@
<Layout class="article">
<LayoutHeader theme="white" slot='header' :title="title" :share="shareData" :opacity="currentAuthor.opacity">
<template v-if="showHeader">
<router-link class="avatar-wrapper" :to="`/grass/author/${currentAuthor.authorType}/${currentAuthor.authorUid}`">
<WidgetAvatar class="widget-avatar" :src="currentAuthor.authorHeadIco" :width="70" :height="70"></WidgetAvatar>
<span class="user-name">{{currentAuthor.authorName}}</span>
</router-link>
</template>
<template v-if="showHeader" v-slot:opts>
<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 {
authorHeadIco: '',
hasAttention: 'N',
opacity: 1,
isShare: false
isShare: false,
authorType: 1
}
};
},
... ... @@ -98,10 +101,13 @@ export default {
this.currentId = item.data.articleId;
this.$emit('on-scroll-change', {articleId: item.data.articleId});
}
this.currentAuthor.authorUid = item.data.authorUid;
this.currentAuthor.authorName = item.data.authorName;
this.currentAuthor.authorHeadIco = item.data.authorHeadIco;
this.currentAuthor.hasAttention = item.data.hasAttention;
this.currentAuthor.authorType = item.data.authorType;
this.showHeader = true;
const offsetTop = scrollTop - item.top;
... ... @@ -169,6 +175,12 @@ export default {
background-color: #f0f0f0;
}
.avatar-wrapper {
display: flex;
justify-content: center;
align-items: center;
}
.widget-avatar {
width: 52px;
height: 52px;
... ...