mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-10 11:26:43 +08:00
留言实现交叉回复
This commit is contained in:
@@ -40,10 +40,15 @@
|
||||
<p>{{rep.content}}</p>
|
||||
</div>
|
||||
<div class="li-right">
|
||||
<div class="replys-icon" @click="showReplyInput(rep, idx)"><svg-icon style="margin-right: 4px;font-size: 14px;" icon-class="comment"></svg-icon>回复</div>
|
||||
<!-- <interactBar :type="7" :data="rep" :comments="false" :shares="false" :views="false" :favorites="false"></interactBar> -->
|
||||
<div class="replys-icon" style="margin-right:0px;margin-left:10px" v-if="userInfo.aid == item.sysCreateAid" @click="delReplySon(item,index)"><svg-icon icon-class="notedel" style="margin-right: 4px;font-size: 14px;"></svg-icon>删除</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="replys-input" style="padding-left: 60px;margin:10px 0" v-if="rep.isReplys">
|
||||
<el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="replysContent" maxlength="200" show-word-limit></el-input>
|
||||
<el-button class="lea-btn" type="primary" @click="addReplys(item,rep)">回复</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user