Browse Source

评论bug修改

xiaoming_global 5 years ago
parent
commit
935876417f
3 changed files with 60 additions and 10 deletions
  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 View File

1
 module.exports = {
1
 module.exports = {
2
   NODE_ENV: '"production"',
2
   NODE_ENV: '"production"',
3
   ENV_CONFIG: '"prod"',
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
   SSO_HOST: '"http://sso.kuyicloud.com"',
7
   SSO_HOST: '"http://sso.kuyicloud.com"',
7
   SRCM_HOST: '"http://jk.kuyicloud.com"',
8
   SRCM_HOST: '"http://jk.kuyicloud.com"',

+ 16 - 0
src/api/act/submitinfo.js View File

279
        method:"Get",
279
        method:"Get",
280
        params:params,
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 View File

20
                 <div class="reply">
20
                 <div class="reply">
21
                     |&nbsp;&nbsp;<span  @click="replyComments(item.id)">回复</span>&nbsp;&nbsp;
21
                     |&nbsp;&nbsp;<span  @click="replyComments(item.id)">回复</span>&nbsp;&nbsp;
22
                     |&nbsp;&nbsp;<span @click="spread(item.id)" id="copy">展开</span>&nbsp;&nbsp;|
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
                 </div>
24
                 </div>
25
                 <div class="content">
25
                 <div class="content">
26
                     {{item.content}}
26
                     {{item.content}}
33
                             <el-button type="primary" @click="send(item)">发送</el-button>
33
                             <el-button type="primary" @click="send(item)">发送</el-button>
34
                        </div>
34
                        </div>
35
                 </div>
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
                      你&nbsp;回复了&nbsp;{{item.comment_user_name}}:{{child.content}}
38
                      你&nbsp;回复了&nbsp;{{item.comment_user_name}}:{{child.content}}
39
                      <div  id="tub" class="el-icon-error" @click="clear(item.id,index)"></div>
39
                      <div  id="tub" class="el-icon-error" @click="clear(item.id,index)"></div>
40
                      </div>
40
                      </div>
41
                 </div>
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
                      你&nbsp;回复了&nbsp;{{items.comment_user_name}}:{{items.content}}
45
                      你&nbsp;回复了&nbsp;{{items.comment_user_name}}:{{items.content}}
45
                      <div  id="tub" class="el-icon-error" @click="clear(items.id,index)"></div>
46
                      <div  id="tub" class="el-icon-error" @click="clear(items.id,index)"></div>
46
                      </div>
47
                      </div>
47
-                </div>           
48
+                 </div> 
49
+                </div>  
50
+                        
48
             <div class="border"></div>  
51
             <div class="border"></div>  
49
            </div>
52
            </div>
50
              <el-pagination
53
              <el-pagination
63
 
66
 
64
 <script>
67
 <script>
65
    import BreadCrumb from '../components/bread-crumb'
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
    import {getFileExtension,uParseTime} from '@/utils/tools'
70
    import {getFileExtension,uParseTime} from '@/utils/tools'
68
    import { constants } from 'crypto';
71
    import { constants } from 'crypto';
69
    import { truncateSync } from 'fs';
72
    import { truncateSync } from 'fs';
88
                 total:0,
91
                 total:0,
89
                 comments:[],
92
                 comments:[],
90
                 show:true,
93
                 show:true,
91
-                shows:false,
92
                 showindex:-1,
94
                 showindex:-1,
93
                 form:{
95
                 form:{
94
                   replycontent:'',  
96
                   replycontent:'',  
182
                 })
184
                 })
183
                }
185
                }
184
           },
186
           },
185
-          clear(id){
187
+          clear(id,index){
186
              console.log("id是什么?",id);
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
           created(){
221
           created(){
258
          width: 1585px;
290
          width: 1585px;
259
          height:50px;
291
          height:50px;
260
          margin-left: 92px;
292
          margin-left: 92px;
293
+         padding-top: 14px;
261
      }
294
      }
262
     #tub{
295
     #tub{
263
       float: right;
296
       float: right;