...
|
...
|
@@ -16,9 +16,9 @@ |
|
|
</div>
|
|
|
|
|
|
<div class="note-container">
|
|
|
<div class="note-content" v-html="content"></div>
|
|
|
<div v-if="content" class="note-content" v-html="content"></div>
|
|
|
<div class="note-date">{{detailInfo.publishTimeStr.split(' ')[0]}}</div>
|
|
|
<div class="praise-wrapper">
|
|
|
<div class="praise-wrapper" @click="onPraise(detailInfo)">
|
|
|
<div class="praise-border"></div>
|
|
|
<div class="praise-div">
|
|
|
<div :class="detailInfo.hasPraise === 'Y' ? 'praise-icon praised-icon' : 'praise-icon'"></div>
|
...
|
...
|
@@ -44,7 +44,7 @@ import ArticleVideo from './components/article-video'; |
|
|
import ArticleImage from './components/article-image';
|
|
|
import AssociatedItem from './components/associated-item';
|
|
|
|
|
|
const { mapState } = createNamespacedHelpers('article/articleDetail');
|
|
|
const { mapState, mapActions } = createNamespacedHelpers('article/articleDetail');
|
|
|
|
|
|
export default {
|
|
|
name: 'articleDetail',
|
...
|
...
|
@@ -69,6 +69,11 @@ export default { |
|
|
},
|
|
|
content({detailInfo: {blockList = [], atUserInfo = {}}}) {
|
|
|
const contentBlock = blockList.find(block => block.templateKey === 'text');
|
|
|
|
|
|
if (!contentBlock) {
|
|
|
return '';
|
|
|
}
|
|
|
|
|
|
const content = contentBlock.contentData || '';
|
|
|
|
|
|
return content.replace(/@(\d*)#|(\r\n|\n)/gm, (match, p1, p2)=> {
|
...
|
...
|
@@ -86,6 +91,21 @@ export default { |
|
|
return store.dispatch('article/articleDetail/fetchDetailInfo', {articleId});
|
|
|
},
|
|
|
activated() {
|
|
|
},
|
|
|
methods: {
|
|
|
...mapActions(['updatePraiseStatus']),
|
|
|
async onPraise({articleId, hasPraise}) {
|
|
|
const user = await this.$sdk.getUser(true);
|
|
|
|
|
|
if (user && user.uid) {
|
|
|
this.updatePraiseStatus({
|
|
|
articleId,
|
|
|
status: hasPraise === 'Y' ? 1 : 0
|
|
|
});
|
|
|
} else {
|
|
|
this.$yoho.auth();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
</script>
|
...
|
...
|
|