|
|
<template>
|
|
|
<div class="article">
|
|
|
<ArticleBar class="header"></ArticleBar>
|
|
|
<ArticleBar class="header" @on-close="onClose"></ArticleBar>
|
|
|
|
|
|
<ArticleBody class="body"></ArticleBody>
|
|
|
<ArticleBody ref="body" class="body"></ArticleBody>
|
|
|
|
|
|
<ArticleFooter class="footer"
|
|
|
v-if="articleDetail"
|
|
|
v-bind="articleDetail.footer"
|
|
|
@on-comment-click="onCommentClick">
|
|
|
@on-comment-click="onCommentClick"
|
|
|
@on-close="onClose">
|
|
|
</ArticleFooter>
|
|
|
|
|
|
<CommentActionSheet ref="actionSheet"></CommentActionSheet>
|
...
|
...
|
@@ -16,10 +17,10 @@ |
|
|
|
|
|
<script>
|
|
|
|
|
|
import ArticleBar from './components2/article-bar';
|
|
|
import ArticleFooter from './components2/article-footer';
|
|
|
import ArticleBody from './components2/article-body';
|
|
|
import CommentActionSheet from './components/comment-action-sheet';
|
|
|
import ArticleBar from './article-bar';
|
|
|
import ArticleFooter from './article-footer';
|
|
|
import ArticleBody from './article-body';
|
|
|
import CommentActionSheet from './comment-action-sheet';
|
|
|
import { createNamespacedHelpers } from 'vuex';
|
|
|
|
|
|
const { mapActions, mapState } = createNamespacedHelpers('article');
|
...
|
...
|
@@ -52,16 +53,21 @@ export default { |
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
this.getDetail({
|
|
|
article_id: this.articleId,
|
|
|
grass_id: this.grassId
|
|
|
});
|
|
|
},
|
|
|
methods: {
|
|
|
onCommentClick() {
|
|
|
this.$refs.actionSheet.click();
|
|
|
},
|
|
|
...mapActions(['getDetail'])
|
|
|
...mapActions(['getDetail']),
|
|
|
fetch(params) {
|
|
|
return this.getDetail({
|
|
|
article_id: params.articleId,
|
|
|
grass_id: params.grassId
|
|
|
});
|
|
|
},
|
|
|
onClose() {
|
|
|
this.$emit('on-close');
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['articleDetail'])
|
...
|
...
|
@@ -83,6 +89,8 @@ export default { |
|
|
|
|
|
.body {
|
|
|
flex: 1;
|
|
|
overflow: auto;
|
|
|
-webkit-overflow-scrolling: touch;
|
|
|
}
|
|
|
|
|
|
.footer {
|
...
|
...
|
|