...
|
...
|
@@ -12,7 +12,7 @@ |
|
|
<WidgetFollow :share="share" class="widget-follow" :author-uid="currentAuthor.authorUid" :follow="currentAuthor.hasAttention === 'Y'" @on-follow="follow => onFollow(currentAuthor, follow)"></WidgetFollow>
|
|
|
</template>
|
|
|
</LayoutHeader>
|
|
|
<LayoutRecycleList :size="10" :thumbs="thumbs" ref="scroll" @scroll="onScroll" :offset="2000" :on-fetch="onFetch">
|
|
|
<LayoutRecycleList :size="10" :thumbs="thumbs" :remove="deleteArticle" ref="scroll" @scroll="onScroll" :offset="2000" :on-fetch="onFetch">
|
|
|
<template class="article-item" #item="{ data: {data, index} }">
|
|
|
<ArticleItem
|
|
|
:id="`item${index}`"
|
...
|
...
|
@@ -24,7 +24,8 @@ |
|
|
@on-follow="follow => onFollow(data, follow)"
|
|
|
@on-resize="onResize"
|
|
|
@on-show-guang="onShowGuang"
|
|
|
@on-show-comment="onShowComment"></ArticleItem>
|
|
|
@on-show-comment="onShowComment"
|
|
|
@on-show-more="onShowMore"></ArticleItem>
|
|
|
<div :id="`ph${index}`"></div>
|
|
|
</template>
|
|
|
</LayoutRecycleList>
|
...
|
...
|
@@ -38,6 +39,7 @@ |
|
|
@on-comment="onActionComment"
|
|
|
@on-page-ready="onPageReady"></Comment>
|
|
|
</YohoActionSheet>
|
|
|
<MoreActionSheet transfer ref="moreAction" @on-follow="onFollow" @on-delete="onDelete"></MoreActionSheet>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
...
|
...
|
@@ -45,7 +47,8 @@ |
|
|
import {throttle} from 'lodash';
|
|
|
import ArticleItem from './article-item';
|
|
|
import ArticleActionSheet from '../detail/article-action-sheet';
|
|
|
import {createNamespacedHelpers} from 'vuex';
|
|
|
import MoreActionSheet from '../detail/more-action-sheet';
|
|
|
import {mapState, createNamespacedHelpers} from 'vuex';
|
|
|
const {mapMutations} = createNamespacedHelpers('article');
|
|
|
|
|
|
export default {
|
...
|
...
|
@@ -75,6 +78,7 @@ export default { |
|
|
showCommentAction: false,
|
|
|
showCommentActioning: false,
|
|
|
showArticleDetailAction: false,
|
|
|
showMoreAction: true,
|
|
|
inx: 0,
|
|
|
scrollTop: 0,
|
|
|
showHeader: false,
|
...
|
...
|
@@ -86,7 +90,8 @@ export default { |
|
|
hasAttention: 'N',
|
|
|
isShare: false,
|
|
|
authorType: 1
|
|
|
}
|
|
|
},
|
|
|
deleteArticle: {}
|
|
|
};
|
|
|
},
|
|
|
activated() {
|
...
|
...
|
@@ -94,6 +99,9 @@ export default { |
|
|
this.$refs.scroll.$el.scrollTop = this.scrollTop;
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['yoho'])
|
|
|
},
|
|
|
methods: {
|
|
|
...mapMutations(['ASYNC_ARTICLE_COMMENT', 'CHANGE_AUTHOR_FOLLOW']),
|
|
|
toUserPage() {
|
...
|
...
|
@@ -120,6 +128,18 @@ export default { |
|
|
this.$refs.comment.init();
|
|
|
});
|
|
|
},
|
|
|
async onShowMore(article) {
|
|
|
if (this.yoho && this.yoho.context.isLogin && !this._uid) {
|
|
|
let user = await this.$sdk.getUser();
|
|
|
|
|
|
this._uid = user.uid;
|
|
|
}
|
|
|
|
|
|
this.$refs.moreAction.show(article, this._uid);
|
|
|
},
|
|
|
onDelete(articleId) {
|
|
|
this.deleteArticle = {articleId};
|
|
|
},
|
|
|
onPageReady({success}) {
|
|
|
if (success && this.showCommentAction) {
|
|
|
this.$refs.commentAction.show();
|
...
|
...
|
@@ -182,7 +202,8 @@ export default { |
|
|
},
|
|
|
components: {
|
|
|
ArticleItem,
|
|
|
ArticleActionSheet
|
|
|
ArticleActionSheet,
|
|
|
MoreActionSheet
|
|
|
}
|
|
|
};
|
|
|
</script>
|
...
|
...
|
|