...
|
...
|
@@ -6,12 +6,17 @@ |
|
|
<span class="user-name">{{currentAuthor.authorName}}</span>
|
|
|
</template>
|
|
|
<template v-if="showHeader" v-slot:opts>
|
|
|
<WidgetFollow :article-id="currentAuthor.authorUid" :followed="currentAuthor.hasAttention === 'Y'"></WidgetFollow>
|
|
|
<WidgetFollow class="widget-follow" :author-uid="currentAuthor.authorUid" :follow="currentAuthor.hasAttention === 'Y'" @on-follow="follow => onFollow(currentAuthor, follow)"></WidgetFollow>
|
|
|
</template>
|
|
|
</LayoutHeader>
|
|
|
<LayoutScroll v-if="isMounted" ref="scroll" @scroll="onScroll" :offset="1000" :on-fetch="onFetch">
|
|
|
<template class="article-item" v-slot:item="{ data }">
|
|
|
<ArticleItem :id="`item${data.index}`" :data="data" :data-id="data.index" @on-resize="onResize(data)" @on-resizeing="onResizeing(data)"></ArticleItem>
|
|
|
<ArticleItem
|
|
|
:id="`item${data.index}`"
|
|
|
:data="data" :data-id="data.index"
|
|
|
@on-resize="onResize(data)"
|
|
|
@on-resizeing="onResizeing(data)"
|
|
|
@on-follow="follow => onFollow(data, follow)"></ArticleItem>
|
|
|
<div :id="`ph${data.index}`"></div>
|
|
|
</template>
|
|
|
</LayoutScroll>
|
...
|
...
|
@@ -21,6 +26,8 @@ |
|
|
|
|
|
<script>
|
|
|
import ArticleItem from './article-item';
|
|
|
import {createNamespacedHelpers} from 'vuex';
|
|
|
const {mapMutations} = createNamespacedHelpers('article');
|
|
|
|
|
|
export default {
|
|
|
name: 'Article',
|
...
|
...
|
@@ -59,6 +66,7 @@ export default { |
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
...mapMutations(['CHANGE_AUTHOR_FOLLOW']),
|
|
|
onScroll({item, scrollTop}) {
|
|
|
this.scrollTop = scrollTop;
|
|
|
if (scrollTop === 0) {
|
...
|
...
|
@@ -108,6 +116,12 @@ export default { |
|
|
$phItem.style.zIndex = 999;
|
|
|
$phItem.status = 1;
|
|
|
},
|
|
|
onFollow(data, follow) {
|
|
|
this.CHANGE_AUTHOR_FOLLOW({authorUid: data.authorUid, follow});
|
|
|
if (data.authorUid === this.currentAuthor.authorUid) {
|
|
|
this.currentAuthor.hasAttention = follow ? 'Y' : 'N';
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
|
ArticleItem
|
...
|
...
|
@@ -125,24 +139,8 @@ export default { |
|
|
height: 52px;
|
|
|
}
|
|
|
|
|
|
.btn-follow {
|
|
|
width: 120px;
|
|
|
height: 50px;
|
|
|
padding: 0;
|
|
|
font-size: 26px;
|
|
|
border-radius: 3PX;
|
|
|
background-color: #222;
|
|
|
color: #fff;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
.widget-follow {
|
|
|
margin-right: 30px;
|
|
|
|
|
|
&.followed {
|
|
|
border: solid 1px #4a4a4a;
|
|
|
background-color: #fff;
|
|
|
color: #222;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
.user-name {
|
...
|
...
|
|