mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-13 12:56:43 +08:00
案例分页修改
This commit is contained in:
@@ -103,8 +103,8 @@
|
||||
<!-- {{item.summary}} -->
|
||||
{{displayAll(item)}}
|
||||
</router-link>
|
||||
<span style="color:#588afc" v-if="item.summary.length>90" @click="changeIsAll(item)">
|
||||
{{item.isAll?'收起':'全文'}}
|
||||
<span style="color:#588afc" v-if="item.summary.length>190" @click="changeIsAll(item)">
|
||||
{{item.isAll?'收起':'展开'}}
|
||||
</span>
|
||||
</div>
|
||||
<!-- </router-link> -->
|
||||
@@ -293,6 +293,7 @@ export default {
|
||||
queryCondition:{
|
||||
pageIndex:1,
|
||||
pageSize:10,
|
||||
isTop:true,
|
||||
orderField:'comments',
|
||||
// breCommend:null,
|
||||
keyWord:'',
|
||||
@@ -351,8 +352,8 @@ export default {
|
||||
methods: {
|
||||
//展示全部
|
||||
displayAll(item) {
|
||||
if(!item.isAll && item.summary && item.summary.length > 90) {
|
||||
return item.summary.slice(0, 90) + "...";
|
||||
if(!item.isAll && item.summary && item.summary.length > 190) {
|
||||
return item.summary.slice(0, 190) + "...";
|
||||
}
|
||||
return item.summary;
|
||||
},
|
||||
@@ -423,6 +424,7 @@ export default {
|
||||
this.search()
|
||||
},
|
||||
searchData(num) {
|
||||
this.queryCondition.pageIndex = 1;
|
||||
this.queryCondition.orderField = num;
|
||||
this.getCaseData();
|
||||
},
|
||||
@@ -431,7 +433,7 @@ export default {
|
||||
let outerHeight = document.documentElement.clientHeight
|
||||
let scrollTop = document.documentElement.scrollTop
|
||||
if ((outerHeight + scrollTop + 350) >= innerHeight) {
|
||||
if(this.moreState == 1 && this.course.pageIndex < 4) {
|
||||
if(this.moreState == 1 && this.queryCondition.pageIndex < 4) {
|
||||
this.loadMore();
|
||||
}
|
||||
}
|
||||
@@ -482,8 +484,6 @@ export default {
|
||||
},
|
||||
async getCaseData(){
|
||||
this.getTags();
|
||||
let isTopList = [];
|
||||
let caseList = [];
|
||||
if(this.queryCondition.pageIndex == 1) {
|
||||
this.caseList.list =[];
|
||||
}
|
||||
@@ -495,14 +495,8 @@ export default {
|
||||
res.result.list.forEach(item=>{
|
||||
item.isAll=false;
|
||||
item.authorInfo={aid:'',name:'',orgInfo:'',avatar:'',sex:null};
|
||||
if(item.isTop) {
|
||||
isTopList.push(item);
|
||||
} else {
|
||||
caseList.push(item)
|
||||
}
|
||||
})
|
||||
|
||||
this.caseList.list.push(...isTopList,...caseList);
|
||||
this.caseList.list.push(...res.result.list);
|
||||
this.caseList.count=res.result.count;
|
||||
this.getCaseUserData(res.result.list)
|
||||
this.moreState = 1;
|
||||
@@ -510,7 +504,7 @@ export default {
|
||||
this.moreState = 3;
|
||||
}
|
||||
} else {
|
||||
this.moreState = 3;
|
||||
this.moreState = 3;
|
||||
|
||||
}
|
||||
}else{
|
||||
@@ -530,6 +524,7 @@ export default {
|
||||
i !== "pageSize" &&
|
||||
i !== "orderField" &&
|
||||
i !== "orderAsc" &&
|
||||
i !== "isTop" &&
|
||||
caseData[i] !== null &&
|
||||
caseData[i] !== undefined
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user