|
|
<template>
|
|
|
<div class="article-detail-notes">
|
|
|
<ArticleDetailHeader ref="header" :step="100" :title-step="100">
|
|
|
<ArticleDetailHeader ref="header" :data="data" :step="100" :title-step="100">
|
|
|
<div class="title-main">
|
|
|
<div class="title-info" :style="`transform: translate3d(0, ${titleTranslateY}, 0)`">
|
|
|
<ArticleItemHeader class="title-info-author" :share="share" :data="authorData" :lazy="lazy" :more="false" @on-follow="onFollow"></ArticleItemHeader>
|
|
|
<ArticleItemHeader class="title-info-author" :share="share" :data="authorData" :lazy="lazy" :more="false"></ArticleItemHeader>
|
|
|
<div class="title-info-rec">{{listTitle}}</div>
|
|
|
</div>
|
|
|
</div>
|
...
|
...
|
@@ -28,7 +28,7 @@ |
|
|
<LayoutTitle>{{listTitle}}</LayoutTitle>
|
|
|
</div>
|
|
|
</div>
|
|
|
<ArticleDetailFooter class="detail-fixed-footer" v-bind="footerData" @on-comment-click="toCommentList">
|
|
|
<ArticleDetailFooter ref="footer" class="detail-fixed-footer" v-bind="footerData" @on-comment-click="toCommentList">
|
|
|
<template v-slot:before>
|
|
|
<div class="footer-comment">
|
|
|
<CommentPlaceholder
|
...
|
...
|
@@ -63,6 +63,8 @@ import ArticleItemTopics from '../article/article-item-topics'; |
|
|
import ArticleDetailFooter from './article-footer';
|
|
|
import ArticleDetailIntro from './article-intro';
|
|
|
import dayjs from 'utils/day';
|
|
|
import {createNamespacedHelpers} from 'vuex';
|
|
|
const {mapState} = createNamespacedHelpers('article');
|
|
|
|
|
|
export default {
|
|
|
name: 'ArticleDetailNote',
|
...
|
...
|
@@ -89,6 +91,10 @@ export default { |
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['articleStates']),
|
|
|
articleState() {
|
|
|
return this.articleStates[this.data.articleId] || this.data;
|
|
|
},
|
|
|
titleTranslateY() {
|
|
|
let scrollTop = this.scrollTop;
|
|
|
|
...
|
...
|
@@ -137,23 +143,21 @@ export default { |
|
|
favoriteCount: this.data.favoriteCount,
|
|
|
praiseCount: this.data.praiseCount,
|
|
|
commentCount: this.data.commentCount,
|
|
|
hasFavor: this.data.hasFavor,
|
|
|
hasPraise: this.data.hasPraise,
|
|
|
hasFavor: this.articleState.hasFavor,
|
|
|
hasPraise: this.articleState.hasPraise,
|
|
|
articleId: this.data.articleId
|
|
|
};
|
|
|
},
|
|
|
publishTime() {
|
|
|
return dayjs(this.data.publishTime).fromNow();
|
|
|
return this.data.publishTime ? dayjs(this.data.publishTime).fromNow() : '';
|
|
|
},
|
|
|
lazy() {
|
|
|
return this.data.lazy;
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
onFollow() {
|
|
|
},
|
|
|
onPraise() {
|
|
|
|
|
|
this.$refs.footer.onPraise();
|
|
|
},
|
|
|
onChangeSlide({index}) {
|
|
|
this.slideIndex = index;
|
...
|
...
|
|