浏览代码

评论bug修改

xiaoming_global 4 年前
父节点
当前提交
935876417f
共有 3 个文件被更改,包括 60 次插入10 次删除
  1. 2 1
      config/prod.env.js
  2. 16 0
      src/api/act/submitinfo.js
  3. 42 9
      src/scrm_pages/article/articleCommentDetail.vue

+ 2 - 1
config/prod.env.js 查看文件

@@ -1,7 +1,8 @@
1 1
 module.exports = {
2 2
   NODE_ENV: '"production"',
3 3
   ENV_CONFIG: '"prod"',
4
-  BASE_API: '"http://api.scrm.kuyicloud.com"',
4
+  // BASE_API: '"http://api.scrm.kuyicloud.com"',
5
+  BASE_API: '"http://api.test1.sgjyun.com"',
5 6
 
6 7
   SSO_HOST: '"http://sso.kuyicloud.com"',
7 8
   SRCM_HOST: '"http://jk.kuyicloud.com"',

+ 16 - 0
src/api/act/submitinfo.js 查看文件

@@ -279,4 +279,20 @@ export function spread(parentid,acticlid){
279 279
        method:"Get",
280 280
        params:params,
281 281
    })
282
+}
283
+
284
+export function clear(id,data){
285
+    return request({
286
+        url:"/api/article/clear?id="+id,
287
+        method:"delete",
288
+        data:data,
289
+    })
290
+}
291
+
292
+export function deleteComments(id,data){
293
+   return request({
294
+      url:"/api/article/deleteComments?id="+id,
295
+      method:"delete",
296
+      data:data, 
297
+   })
282 298
 }

+ 42 - 9
src/scrm_pages/article/articleCommentDetail.vue 查看文件

@@ -20,7 +20,7 @@
20 20
                 <div class="reply">
21 21
                     |&nbsp;&nbsp;<span  @click="replyComments(item.id)">回复</span>&nbsp;&nbsp;
22 22
                     |&nbsp;&nbsp;<span @click="spread(item.id)" id="copy">展开</span>&nbsp;&nbsp;|
23
-                    &nbsp;&nbsp;删除&nbsp;&nbsp;
23
+                    &nbsp;&nbsp;<span @click="deleteComments(item.id,index)">删除</span>&nbsp;&nbsp;
24 24
                 </div>
25 25
                 <div class="content">
26 26
                     {{item.content}}
@@ -33,18 +33,21 @@
33 33
                             <el-button type="primary" @click="send(item)">发送</el-button>
34 34
                        </div>
35 35
                 </div>
36
-                 <div class="reviewed" v-show="showReply==item.id">
37
-                     <div v-for="(child) in item.childs" :key="child.id">
36
+                 <div class="reviewed" v-show="showReply==item.id" v-for="(child) in item.childs" :key="child.id">
37
+                     <div>
38 38
                      你&nbsp;回复了&nbsp;{{item.comment_user_name}}:{{child.content}}
39 39
                      <div  id="tub" class="el-icon-error" @click="clear(item.id,index)"></div>
40 40
                      </div>
41 41
                 </div>
42
-                 <div class="reviewed2" v-show="shows==item.id">
43
-                     <div v-for="(items,index) in commentsReplyInfo" :key="items.id">
42
+                 <div>
43
+                  <div class="reviewed2" v-show="shows==item.id" v-for="(items,index) in commentsReplyInfo" :key="items.id">
44
+                     <div>
44 45
                      你&nbsp;回复了&nbsp;{{items.comment_user_name}}:{{items.content}}
45 46
                      <div  id="tub" class="el-icon-error" @click="clear(items.id,index)"></div>
46 47
                      </div>
47
-                </div>           
48
+                 </div> 
49
+                </div>  
50
+                        
48 51
             <div class="border"></div>  
49 52
            </div>
50 53
              <el-pagination
@@ -63,7 +66,7 @@
63 66
 
64 67
 <script>
65 68
    import BreadCrumb from '../components/bread-crumb'
66
-   import { getArticleCommentDetail,send,spread} from '@/api/act/submitinfo'
69
+   import { getArticleCommentDetail,send,spread,clear,deleteComments} from '@/api/act/submitinfo'
67 70
    import {getFileExtension,uParseTime} from '@/utils/tools'
68 71
    import { constants } from 'crypto';
69 72
    import { truncateSync } from 'fs';
@@ -88,7 +91,6 @@
88 91
                 total:0,
89 92
                 comments:[],
90 93
                 show:true,
91
-                shows:false,
92 94
                 showindex:-1,
93 95
                 form:{
94 96
                   replycontent:'',  
@@ -182,8 +184,38 @@
182 184
                 })
183 185
                }
184 186
           },
185
-          clear(id){
187
+          clear(id,index){
186 188
              console.log("id是什么?",id);
189
+             this.$confirm("确定删除此评论?",'删除提示',{
190
+             dangerouslyUseHTMLString:true,
191
+             confirmButtonText: '确定',
192
+             cancelButtonText: '取消',
193
+             type: 'warning'
194
+             }).then(()=>{
195
+                 clear(id,index).then(response=>{
196
+                    if(response.data.state ==1){
197
+                       this.commentsReplyInfo.splice(index,1);
198
+                       this.$message.success("删除成功")  
199
+                    }
200
+                 }).catch(e=>{}); 
201
+             }).catch(() => {
202
+               return false
203
+            });
204
+          },
205
+          deleteComments(id,index){
206
+            this.$confirm("确定删除此评论?",'删除提示',{
207
+             dangerouslyUseHTMLString:true,
208
+             confirmButtonText: '确定',
209
+             cancelButtonText: '取消',
210
+             type: 'warning' 
211
+            }).then(()=>{
212
+                deleteComments(id,index).then(response=>{
213
+                    if(response.data.state==1){
214
+                       this.comments.splice(index,1);
215
+                       this.$message.success("删除成功");  
216
+                    }
217
+                })
218
+            })
187 219
           }
188 220
          },
189 221
           created(){
@@ -258,6 +290,7 @@
258 290
          width: 1585px;
259 291
          height:50px;
260 292
          margin-left: 92px;
293
+         padding-top: 14px;
261 294
      }
262 295
     #tub{
263 296
       float: right;