mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-11 11:56:44 +08:00
修改评论的回复和笔记的回复 “更多”的处理
This commit is contained in:
@@ -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;">加载更多>></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='';
|
||||||
|
|||||||
@@ -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;">加载更多>></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='';
|
||||||
|
|||||||
Reference in New Issue
Block a user