From f179a4242fd191d5b047bda2339778f499b53f67 Mon Sep 17 00:00:00 2001 From: ruibaby Date: Fri, 3 May 2019 14:59:49 +0800 Subject: [PATCH] Refactor HeaderComment.vue. --- src/api/comment.js | 12 +++++++++++- src/components/Tools/HeaderComment.vue | 12 +++++++++--- src/views/comment/CommentList.vue | 23 ++++++++++++++++++++++- 3 files changed, 42 insertions(+), 5 deletions(-) diff --git a/src/api/comment.js b/src/api/comment.js index 568c3017..4d91a0e2 100644 --- a/src/api/comment.js +++ b/src/api/comment.js @@ -11,6 +11,16 @@ commentApi.listLatest = () => { }) } +commentApi.listLatestByStatus = (top) => { + return service({ + url: `${baseUrl}/latest/AUDITING`, + params: { + top: top + }, + method: 'get' + }) +} + commentApi.query = params => { return service({ url: baseUrl, @@ -59,4 +69,4 @@ commentApi.commentStatus = { } } -export default commentApi +export default commentApi \ No newline at end of file diff --git a/src/components/Tools/HeaderComment.vue b/src/components/Tools/HeaderComment.vue index ab69ddd0..b513bf27 100644 --- a/src/components/Tools/HeaderComment.vue +++ b/src/components/Tools/HeaderComment.vue @@ -21,7 +21,7 @@ size="large" /> - + + + + @@ -50,6 +53,9 @@ export default { comments: [] } }, + created() { + this.getComment() + }, methods: { fetchComment() { if (!this.visible) { @@ -61,7 +67,7 @@ export default { this.visible = !this.visible }, getComment() { - commentApi.listLatest().then(response => { + commentApi.listLatestByStatus(5).then(response => { this.comments = response.data.data this.loadding = false }) diff --git a/src/views/comment/CommentList.vue b/src/views/comment/CommentList.vue index 0e48a25f..f65b17c1 100644 --- a/src/views/comment/CommentList.vue +++ b/src/views/comment/CommentList.vue @@ -53,7 +53,13 @@ - 回收站 + 通过 + + + 移到回收站 + + + 永久删除 @@ -65,6 +71,10 @@