Authored by yyq

fix

... ... @@ -32,7 +32,8 @@
:share="share"
:pos-id="posId"
@on-show-more="onShowMore"
@on-follow="onFollowAuthor">
@on-follow="onFollowAuthor"
@on-praise="onPraise">
</ArticleDeatilNote>
</template>
<template class="article-item" #item="{ data }">
... ... @@ -51,7 +52,7 @@
</template>
</RecycleScrollReveal>
<ArticleDetailFooter v-show="!articleInfo.thumb" class="detail-fixed-footer" :style="`transform: translate3d(0, ${viewMoreArticles ? '100%' : '0'}, 0)`" v-bind="footerData" @on-comment-click="onComment">
<ArticleDetailFooter ref="footer" v-show="!articleInfo.thumb" class="detail-fixed-footer" :style="`transform: translate3d(0, ${viewMoreArticles ? '100%' : '0'}, 0)`" v-bind="footerData" @on-comment-click="onComment">
<template v-if="articleInfo.sort != 2" v-slot:before>
<div class="footer-comment">
<CommentPlaceholder
... ... @@ -344,11 +345,16 @@ export default {
onEdit() {
this.articleOnEdit = true;
},
onPraise() {
this.$refs.footer.onPraise();
},
onComment() {
if (this.articleInfo.sort === 2) {
this.$refs.detailLong.onComment();
} else {
} else if (this.articleState.commentCount) {
this.$refs.detailNote.toCommentList();
} else {
this.$refs.commentInput.$el.click();
}
},
onCommentInput(comment) {
... ...
<template>
<div class="article-detail-notes">
<ArticleItemHeader v-if="share" :share="share" :data="authorData" :lazy="lazy" :more="false" @on-follow="onFollowAuthor"></ArticleItemHeader>
<LayoutHeader v-else style="visibility: hidden;"></LayoutHeader>
<LayoutHeader v-else ref="header" style="visibility: hidden;"></LayoutHeader>
<div v-if="data.empty" class="article-empty">
{{data.emptyTip || '文章不存在或文章被删除'}}
... ... @@ -120,7 +120,7 @@ export default {
this.$emit('on-follow', this.data, follow);
},
onPraise() {
this.$refs.footer.onPraise();
this.$emit('on-praise');
},
onChangeSlide({index}) {
this.slideIndex = index;
... ... @@ -129,12 +129,8 @@ export default {
this.$refs.commentList && this.$refs.commentList.addComment(comment);
},
toCommentList() {
if (this.articleState.commentCount) {
if (this.$refs.commentList && this.scrollTo) {
this.scrollTo({scrollTop: this.$refs.commentList.$el.offsetTop - this.$refs.header.$el.offsetHeight});
}
} else {
this.$refs.commentInput.$el.click();
if (this.$refs.commentList && this.scrollTo) {
this.scrollTo({scrollTop: this.$refs.commentList.$el.offsetTop - get(this.$refs, 'header.$el.offsetHeight', 0)});
}
},
onMore() {
... ...
... ... @@ -24,6 +24,7 @@ function processArticleListData(listData) {
templateKey: 'text',
}
],
hasComment: true,
commentCount: 0,
comments: [],
dataType: listData.dataType,
... ...