Authored by yyq

fix detail load time

... ... @@ -152,11 +152,8 @@ export default {
}).then((res) => {
if (this.$refs.scroll) {
this.listTitle = '';
setTimeout(() => {
this.fetching = false;
this.$refs.scroll.init();
}, 200);
this.fetching = false;
this.$refs.scroll.init();
}
const article = get(res, 'data.detailList[0]', this.articleInfo);
... ...
... ... @@ -28,7 +28,7 @@
<i class="iconfont icon-more1" @click="onMore"></i>
</div>
</div>
<ArticleDetailCommentList ref="commentList" v-if="data.articleId && !thumb" :article-id="data.articleId" :share="share" :comment-count="articleState.commentCount"></ArticleDetailCommentList>
<ArticleDetailCommentList ref="commentList" v-if="data.articleId" :article-id="data.articleId" :share="share" :comment-count="articleState.commentCount" :has-comment="data.hasComment"></ArticleDetailCommentList>
</div>
<div v-if="listTitle" class="rec-article-title">
... ...
... ... @@ -45,7 +45,8 @@ export default {
type: Number,
default: 1001
},
share: Boolean
share: Boolean,
hasComment: Boolean
},
data() {
return {
... ... @@ -68,7 +69,7 @@ export default {
this.init();
},
computed: {
...mapYohoState(['yoho']),
...mapYohoState(['yoho'])
},
methods: {
...mapYohoActions(['fetchUserProfile']),
... ... @@ -78,7 +79,7 @@ export default {
this.page = 1;
this.showMore = false;
if (this.commentCount) {
if (this.hasComment || this.commentCount) {
this.onFetch();
}
},
... ...
... ... @@ -298,6 +298,7 @@ export default {
article.hasAttention = '';
article.hasFavor = '';
article.hasPraise = '';
article.hasComment = (+article.commentCount > 0);
article.commentCount = 0;
article.favoriteCount = 0;
article.praiseCount = 0;
... ...