xjc 3 年之前
父節點
當前提交
4735dbd0a2
共有 4 個文件被更改,包括 33 次插入2 次删除
  1. 8 0
      src/api.js
  2. 8 0
      src/views/comments/recordComments.vue
  3. 9 1
      src/views/comments/stockComments.vue
  4. 8 1
      src/views/user/index.vue

+ 8 - 0
src/api.js

@@ -308,4 +308,12 @@ export default {
     savePlayerTypePhone: params => {
         return axios.put(`${baseURL}/api/admin/player/type`, params)
     },
+    // 置顶
+    commentsTop: params => {
+        return axios.put(`${baseURL}/api/admin/comments/top`, params)
+    },
+    // 评论拉黑
+    commentsBlack: params => {
+        return axios.put(`${baseURL}/api/admin/comments/black`, params)
+    },
 }

+ 8 - 0
src/views/comments/recordComments.vue

@@ -49,6 +49,8 @@
                 <el-table-column prop="ctime" label="评论时间" width="160"/>
                 <el-table-column prop="date" label="操作" fixed="right" width="220">
                     <template slot-scope="scope">
+                        <el-button v-if="scope.row.istop==0" @click="top(scope.row)" size="mini" type="primary">置顶</el-button>
+                        <el-button v-else @click="top(scope.row)" size="mini" type="warning">取消置顶</el-button>
                         <el-button @click="edit(scope.row.id)" size="mini" type="warning">编辑</el-button>
                         <el-button @click="del(scope.row.id)" size="mini" type="danger">删除</el-button>
                     </template>
@@ -283,6 +285,12 @@ export default {
                 this.open = true
             })
         },
+        top(row){
+            this.$api.commentsTop({id:row.id}).then(res=>{
+                row.istop = 1-row.istop
+                this.getData()
+            })
+        },
         editComment(id){
             this.title = "顽主点评"
             this.$api.getRecordInfo({id:id}).then(res=>{

+ 9 - 1
src/views/comments/stockComments.vue

@@ -41,8 +41,10 @@
                 <el-table-column prop="content" label="评论内容"/>
                 <el-table-column prop="stock_name" label="股票名称"/>
                 <el-table-column prop="ctime" label="评论时间" width="160"/>
-                <el-table-column prop="date" label="操作" fixed="right" width="220">
+                <el-table-column prop="date" label="操作" fixed="right" width="240">
                     <template slot-scope="scope">
+                        <el-button v-if="scope.row.istop==0" @click="top(scope.row)" size="mini" type="primary">置顶</el-button>
+                        <el-button v-else @click="top(scope.row)" size="mini" type="primary">取消置顶</el-button>
                         <el-button @click="edit(scope.row.id)" size="mini" type="warning">编辑</el-button>
                         <el-button @click="del(scope.row.id)" size="mini" type="danger">删除</el-button>
                     </template>
@@ -277,6 +279,12 @@ export default {
                 this.open = true
             })
         },
+        top(row){
+            this.$api.commentsTop({id:row.id}).then(res=>{
+                row.istop = 1-row.istop
+                this.getData()
+            })
+        },
         editComment(id){
             this.title = "顽主点评"
             this.$api.getRecordInfo({id:id}).then(res=>{

+ 8 - 1
src/views/user/index.vue

@@ -73,8 +73,10 @@
         </template>
       </el-table-column>
       <!-- <el-table-column align="center"  prop="date" label="资产"/> -->
-      <el-table-column align="center" prop="date" label="操作">
+      <el-table-column align="center" prop="date" label="操作" width="240">
         <template slot-scope="scope">
+          <el-button v-if="scope.row.comment_status==1" @click="black(scope.row)" size="mini" type="primary">拉黑</el-button>
+          <el-button v-else @click="black(scope.row)" size="mini" type="primary">取消拉黑</el-button>
           <el-button @click="edit(scope.row.id)" size="mini" type="warning"
             >编辑</el-button
           >
@@ -356,6 +358,11 @@ export default {
         this.open = true;
       });
     },
+    black(row){
+        this.$api.commentsBlack({id:row.id}).then(res=>{
+            this.getData()
+        })
+    },
     /** 提交按钮 */
     submitForm() {
       this.$refs["form"].validate((valid) => {