展开收起

This commit is contained in:
zhaofang
2022-06-07 17:34:30 +08:00
parent 0cf9d297e8
commit 1b3ca4ce1e

View File

@@ -96,16 +96,23 @@
<div style="height:35px">
<author :avatar="item.authorInfo.avatar" :name="item.authorInfo.name" :info="item.authorInfo.orgInfo" :sex="item.authorInfo.sex"></author>
</div>
<!-- <router-link :to="'/case/detail?id='+item.id"> -->
<!-- class="case-info-summary" -->
<div>
<router-link :to="'/case/detail?id='+item.id">
<div class="case-info-summary" >
{{item.summary}}
</div>
<!-- {{item.summary}} -->
{{displayAll(item)}}
</router-link>
<div class="button-wrap" v-if="needShowExpande">
<span style="color:#588afc" v-if="item.summary.length>90" @click="changeIsAll(item)">
{{item.isAll?'收起':'全文'}}
</span>
</div>
<!-- </router-link> -->
<!-- <div class="button-wrap" v-if="needShowExpande">
<div class="exp-but" @click="expandeClick" v-if="!expande">展开
</div>
<div class="exp-but" @click="expandeClick" v-else>收起</div>
</div>
</div> -->
<div style="display: flex;justify-content: space-between;">
@@ -331,17 +338,20 @@ export default {
window.removeEventListener("scroll",this.handleScroll);
},
methods: {
tagsClose(tag, index){
//展示全部
displayAll(item) {
if(!item.isAll && item.summary && item.summary.length > 90) {
return item.summary.slice(0, 90) + "...";
}
return item.summary;
},
changeIsAll(item) {
item.isAll=!item.isAll;
},
closeSearch() {
this.showAll = !this.showAll;
var searchBoxHeght = document.getElementById("searchBox");
var searchBoxWidth = document.getElementById("searchBox");
// console.log(searchBoxWidth.clientWidth);
if(searchBoxWidth.clientWidth > 950){
this.searchwd = false;
}
@@ -467,6 +477,7 @@ export default {
if(res.status==200){
if(res.result.list.length>0){
res.result.list.forEach(item=>{
item.isAll=false;
item.authorInfo={aid:'',name:'',orgInfo:'',avatar:'',sex:null};
if(item.isTop) {
isTopList.push(item);