From 32a879583236e4b0d162d951c0df1338b4e2ef3e Mon Sep 17 00:00:00 2001 From: daihh Date: Wed, 9 Nov 2022 17:24:44 +0800 Subject: [PATCH] =?UTF-8?q?=E7=95=99=E8=A8=80=E5=AE=9E=E7=8E=B0=E4=BA=A4?= =?UTF-8?q?=E5=8F=89=E5=9B=9E=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/homepage/leavingMessage.vue | 29 +++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/src/views/homepage/leavingMessage.vue b/src/views/homepage/leavingMessage.vue index 13b65ce1..62d27714 100644 --- a/src/views/homepage/leavingMessage.vue +++ b/src/views/homepage/leavingMessage.vue @@ -40,10 +40,15 @@

{{rep.content}}

+
回复
删除
+
+ + 回复 +
@@ -137,7 +142,25 @@ }); }, showReplyInput(item,idx) { - item.isReplys = true; + //关闭其它的 + this.leavingList.forEach(top=>{ + if(top.id!=item.id){ + top.isReplys=false; + } + + top.replyList.forEach(reply=>{ + if(reply.id!=item.id){ + reply.isReplys=false; + } + + }) + }) + if(item.isReplys){ + item.isReplys =false; + }else{ + item.isReplys =true; + } + this.replysData.id = item.id; //this.replysData.reply = item.replyList; }, @@ -159,7 +182,7 @@ this.$message.success('回复留言成功'); p.isReplys = false; res.result.authorInfo=$this.userInfo; - p.replyList.push(res.result); + top.replyList.push(res.result); //直接追加到列表后面 // this.leavingList.forEach(item=>{ // item.isReplys = false; @@ -271,6 +294,7 @@ position: relative; .lea-btn { float: right; + cursor: pointer; margin-top: 26px; width: 80px; height: 30px; @@ -326,6 +350,7 @@ margin-top: 40px; .replys-icon{ width: 50px; + cursor: pointer; color: #6E7B84; font-size: 12px; margin-right: 22px;