From d5753ba702b500bc83dbeb4ee8eb22ecd289f162 Mon Sep 17 00:00:00 2001 From: weinan2087 Date: Wed, 2 Nov 2022 14:43:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E8=AF=BE=E7=A8=8B=E7=AC=94?= =?UTF-8?q?=E8=AE=B0=E7=9A=84=E8=AF=84=E8=AE=BA=E5=9B=9E=E5=A4=8D=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Portal/noteComment.vue | 53 +++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 3 deletions(-) diff --git a/src/components/Portal/noteComment.vue b/src/components/Portal/noteComment.vue index 54c68f05..0f379c14 100644 --- a/src/components/Portal/noteComment.vue +++ b/src/components/Portal/noteComment.vue @@ -75,13 +75,13 @@
- 发布回复 + 发布回复
-
加载更多>>
+
加载更多22>>
@@ -503,10 +503,12 @@ if(this.replyInfo.content==''){ return; } - // this.replyInfo.commentId=comment.id; + // this.replyInfo.commentId='1037320008252829696'; // if(comment.replyList==''){ // comment.replyList=[]; // } + this.replyInfo.parentId='-1'; + apiComment.add(this.replyInfo).then(res=>{ this.replyLoading = false; if(res.status==200){ @@ -522,6 +524,51 @@ } }); }, + + // 课程笔记评论的回复 + submitReplyAdd(comment){ + if(this.replyLoading) { + return + } + this.replyLoading = true; + this.replyInfo.content = this.replyInfo.content.trim(); + if(this.replyInfo.content==''){ + return; + } + this.replyInfo.content=this.replyInfo.content.replace(/^\s*|\s*$/g,""); + if(this.replyInfo.content==''){ + return; + } + // this.replyInfo.commentId='1037320008252829696'; + // if(comment.replyList==''){ + // comment.replyList=[]; + // } + + + if(comment.replyList=='' || comment.replyList==null){ + this.replyInfo.commentId=''; + }else{ + this.replyInfo.commentId=comment.replyList[0].id; + this.replyInfo.clevel = 2; + } + + + apiComment.reply(this.replyInfo).then(res=>{ + this.replyLoading = false; + if(res.status==200){ + res.result.sex = null; + res.result.isAll=false; + this.loadAuthorInfo([res.result],[res.result.sysCreateAid]); + comment.replyList.push(res.result); + this.replyInfo.parentId=''; + this.replyInfo.content=''; + this.$message.success("发布成功"); + }else{ + this.$message.error(res.message); + } + }); + }, + delCommnet(com,idx){ if(com.replyList!='' && com.replyList.length>0){ this.$message.error('有回复的评论不能删除');