修改评论的回复和笔记的回复 “更多”的处理

This commit is contained in:
daihh
2022-10-31 16:30:55 +08:00
parent 29adce40d3
commit 9d3fd71061
2 changed files with 57 additions and 45 deletions

View File

@@ -113,7 +113,8 @@
</div> </div>
<!--回复内容--> <!--回复内容-->
<div v-if="com.replyList && com.replyList.length>0"> <div v-if="com.replyList && com.replyList.length>0">
<div class="comment" v-for="(reply,replyIdx) in com.replyList" :key="reply.id" :class="replyIdx===com.replyList.length-1 ? 'comment-last' : ''"> <div v-for="(reply,replyIdx) in com.replyList" :key="reply.id" v-if="com.showAll || replyIdx<3">
<div class="comment" :class="replyIdx===com.replyList.length-1 ? 'comment-last' : ''">
<div class="comment-top"> <div class="comment-top">
<div class="comment-author"> <div class="comment-author">
<authorInfo :aid="reply.sysCreateAid" :avatar="reply.avatar" :name="reply.sysCreateBy" :sex="reply.sex" :info="reply.orgInfo" :sign="reply.sign"></authorInfo> <authorInfo :aid="reply.sysCreateAid" :avatar="reply.avatar" :name="reply.sysCreateBy" :sex="reply.sex" :info="reply.orgInfo" :sign="reply.sign"></authorInfo>
@@ -158,6 +159,8 @@
</div> </div>
</div> </div>
</div> </div>
<div v-if="!com.showAll" style="padding-left: 45px;padding-bottom: 10px;" @click="loadReplyMore(com)"><span style="color: #9e9e9e;cursor: pointer; border-radius: 5px;border:1px solid #cccccc;padding: 5px 10px;font-size: 14px;">加载更多&gt;&gt;</span></div>
</div>
</div> </div>
</div> </div>
</div> </div>
@@ -380,6 +383,9 @@
// }) // })
}, },
methods: { methods: {
loadReplyMore(item){
item.showAll=true;
},
loadMore() { loadMore() {
this.pageIndex +=1; this.pageIndex +=1;
this.loadData(true); this.loadData(true);
@@ -449,6 +455,7 @@
let ids=[]; let ids=[];
let allList=[]; let allList=[];
res.result.list.forEach(item=>{ res.result.list.forEach(item=>{
item.showAll=false;
item.avatar=''; item.avatar='';
item.orgInfo=''; item.orgInfo='';
item.sign=''; item.sign='';

View File

@@ -44,7 +44,7 @@
</div> </div>
<!--回复内容--> <!--回复内容-->
<div v-if="com.replyList && com.replyList.length>0"> <div v-if="com.replyList && com.replyList.length>0">
<div class="comment" v-for="(reply,replyIdx) in com.replyList" :key="reply.id" :class="replyIdx===com.replyList.length-1 ? 'comment-last' : ''"> <div class="comment" v-for="(reply,replyIdx) in com.replyList" :key="reply.id" v-if="com.showAll || replyIdx<3" :class="replyIdx===com.replyList.length-1 ? 'comment-last' : ''">
<div class="comment-top"> <div class="comment-top">
<div class="comment-author"> <div class="comment-author">
<authorInfo :avatar="reply.avatar" :name="reply.sysCreateBy" :sex="reply.sex" :info="reply.orgInfo" :sign="reply.sign"></authorInfo> <authorInfo :avatar="reply.avatar" :name="reply.sysCreateBy" :sex="reply.sex" :info="reply.orgInfo" :sign="reply.sign"></authorInfo>
@@ -81,6 +81,7 @@
</div> </div>
</div> </div>
</div> </div>
<div v-if="!com.showAll" style="padding-left: 45px;padding-bottom: 10px;" @click="loadReplyMore(com)"><span style="color: #9e9e9e;cursor: pointer; border-radius: 5px;border:1px solid #cccccc;padding: 5px 10px;font-size: 14px;">加载更多&gt;&gt;</span></div>
</div> </div>
</div> </div>
</div> </div>
@@ -279,6 +280,9 @@
}) })
}, },
methods: { methods: {
loadReplyMore(item){
item.showAll=true;
},
loadMore() { loadMore() {
this.pageIndex +=1; this.pageIndex +=1;
this.loadData(true); this.loadData(true);
@@ -337,6 +341,7 @@
let ids=[]; let ids=[];
let allList=[]; let allList=[];
res.result.list.forEach(item=>{ res.result.list.forEach(item=>{
item.showAll=false;
item.title = this.name; item.title = this.name;
item.replyList = []; item.replyList = [];
item.avatar=''; item.avatar='';