解决 动态 切换闪的问题

This commit is contained in:
daihh
2022-11-10 15:02:04 +08:00
parent c3999a247f
commit 329a793fb6
2 changed files with 347 additions and 78 deletions

View File

@@ -6,7 +6,7 @@
<i style="color: #333333" class="el-icon-search"></i> <i style="color: #333333" class="el-icon-search"></i>
</div> --> </div> -->
<el-tabs v-model="activeName" @tab-click="handleClick"> <el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane name="" v-loading="loading"> <el-tab-pane name="0" v-loading="loading">
<span slot="label"><svg-icon icon-class="home-dynamic" style="font-size: 30px;"></svg-icon> <span class="tabs-info">动态</span></span> <span slot="label"><svg-icon icon-class="home-dynamic" style="font-size: 30px;"></svg-icon> <span class="tabs-info">动态</span></span>
<template v-for="item in allPageList"> <template v-for="item in allPageList">
<course-list v-if="item.contentType == 1" :list="[item]" :isDynamic="true" :personal="personal" @hideIndex="dynamicHide"></course-list> <course-list v-if="item.contentType == 1" :list="[item]" :isDynamic="true" :personal="personal" @hideIndex="dynamicHide"></course-list>
@@ -20,6 +20,18 @@
<img class="img" :src="`${webBaseUrl}/images/homeWu/no-course.png`" alt="" srcset=""> <img class="img" :src="`${webBaseUrl}/images/homeWu/no-course.png`" alt="" srcset="">
<p class="text">还没有动态</p> <p class="text">还没有动态</p>
</div> </div>
<div class="div-pagination" v-show="allPage.count > 0">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="allPage.pageIndex"
:page-sizes="[10, 20, 30, 40]"
:page-size="allPage.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="allPage.count">
</el-pagination>
</div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane name="1" v-loading="loading1"> <el-tab-pane name="1" v-loading="loading1">
<span slot="label"><svg-icon icon-class="home-course" style="font-size: 30px;"></svg-icon><span class="tabs-info">课程</span></span> <span slot="label"><svg-icon icon-class="home-course" style="font-size: 30px;"></svg-icon><span class="tabs-info">课程</span></span>
@@ -28,6 +40,18 @@
<img class="img" :src="`${webBaseUrl}/images/homeWu/no-course.png`" alt="" srcset=""> <img class="img" :src="`${webBaseUrl}/images/homeWu/no-course.png`" alt="" srcset="">
<p class="text">还没有课程</p> <p class="text">还没有课程</p>
</div> </div>
<div class="div-pagination" v-show="cousrePage.count > 0">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="cousrePage.pageIndex"
:page-sizes="[10, 20, 30, 40]"
:page-size="cousrePage.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="cousrePage.count">
</el-pagination>
</div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane name="3" v-loading="loading3"> <el-tab-pane name="3" v-loading="loading3">
<span slot="label"><svg-icon icon-class="home-case" style="font-size: 30px;"></svg-icon><span class="tabs-info">案例</span></span> <span slot="label"><svg-icon icon-class="home-case" style="font-size: 30px;"></svg-icon><span class="tabs-info">案例</span></span>
@@ -36,6 +60,18 @@
<img class="img" :src="`${webBaseUrl}/images/homeWu/no-case.png`" alt="" srcset=""> <img class="img" :src="`${webBaseUrl}/images/homeWu/no-case.png`" alt="" srcset="">
<p class="text">还没有案例</p> <p class="text">还没有案例</p>
</div> </div>
<div class="div-pagination" v-show="casePage.count > 0">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="casePage.pageIndex"
:page-sizes="[10, 20, 30, 40]"
:page-size="casePage.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="casePage.count">
</el-pagination>
</div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane name="6" v-loading="loading6"> <el-tab-pane name="6" v-loading="loading6">
<span slot="label"><svg-icon icon-class="home-note" style="font-size: 30px;"></svg-icon><span class="tabs-info">笔记</span></span> <span slot="label"><svg-icon icon-class="home-note" style="font-size: 30px;"></svg-icon><span class="tabs-info">笔记</span></span>
@@ -44,6 +80,18 @@
<img class="img" :src="`${webBaseUrl}/images/homeWu/no-note.png`" alt="" srcset=""> <img class="img" :src="`${webBaseUrl}/images/homeWu/no-note.png`" alt="" srcset="">
<p class="text">还没有笔记</p> <p class="text">还没有笔记</p>
</div> </div>
<div class="div-pagination" v-show="notePage.count > 0">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="notePage.pageIndex"
:page-sizes="[10, 20, 30, 40]"
:page-size="notePage.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="notePage.count">
</el-pagination>
</div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane name="4" v-loading="loading4"> <el-tab-pane name="4" v-loading="loading4">
<span slot="label"><svg-icon icon-class="home-qa" style="font-size: 30px;"></svg-icon><span class="tabs-info">提问</span></span> <span slot="label"><svg-icon icon-class="home-qa" style="font-size: 30px;"></svg-icon><span class="tabs-info">提问</span></span>
@@ -52,6 +100,18 @@
<img class="img" style="width:204px;height:160px" :src="`${webBaseUrl}/images/homeWu/no-put.png`" alt="" srcset=""> <img class="img" style="width:204px;height:160px" :src="`${webBaseUrl}/images/homeWu/no-put.png`" alt="" srcset="">
<p class="text">还没有提问</p> <p class="text">还没有提问</p>
</div> </div>
<div class="div-pagination" v-show="qaPage.count > 0">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="qaPage.pageIndex"
:page-sizes="[10, 20, 30, 40]"
:page-size="qaPage.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="qaPage.count">
</el-pagination>
</div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane name="5" v-loading="loading5"> <el-tab-pane name="5" v-loading="loading5">
<span slot="label"><svg-icon icon-class="home-answer" style="font-size: 30px;"></svg-icon><span class="tabs-info">回答</span></span> <span slot="label"><svg-icon icon-class="home-answer" style="font-size: 30px;"></svg-icon><span class="tabs-info">回答</span></span>
@@ -60,6 +120,18 @@
<img class="img" :src="`${webBaseUrl}/images/homeWu/no-answer.png`" alt="" srcset=""> <img class="img" :src="`${webBaseUrl}/images/homeWu/no-answer.png`" alt="" srcset="">
<p class="text">还没有回答</p> <p class="text">还没有回答</p>
</div> </div>
<div class="div-pagination" v-show="answerPage.count > 0">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="answerPage.pageIndex"
:page-sizes="[10, 20, 30, 40]"
:page-size="answerPage.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="answerPage.count">
</el-pagination>
</div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane name="2" v-loading="loading2"> <el-tab-pane name="2" v-loading="loading2">
<span slot="label"><svg-icon icon-class="home-article" style="font-size: 30px;"></svg-icon><span class="tabs-info">文章</span></span> <span slot="label"><svg-icon icon-class="home-article" style="font-size: 30px;"></svg-icon><span class="tabs-info">文章</span></span>
@@ -68,6 +140,18 @@
<img class="img" style="width:150px;height:160px" :src="`${webBaseUrl}/images/homeWu/no-article.png`" alt="" srcset=""> <img class="img" style="width:150px;height:160px" :src="`${webBaseUrl}/images/homeWu/no-article.png`" alt="" srcset="">
<p class="text">还没有文章</p> <p class="text">还没有文章</p>
</div> </div>
<div class="div-pagination" v-show="articlePage.count > 0">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="articlePage.pageIndex"
:page-sizes="[10, 20, 30, 40]"
:page-size="articlePage.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="articlePage.count">
</el-pagination>
</div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane name="7"> <el-tab-pane name="7">
<span slot="label"><svg-icon icon-class="home-follow" style="font-size: 30px;"></svg-icon><span class="tabs-info">关注</span></span> <span slot="label"><svg-icon icon-class="home-follow" style="font-size: 30px;"></svg-icon><span class="tabs-info">关注</span></span>
@@ -78,18 +162,6 @@
<book-list></book-list> <book-list></book-list>
</el-tab-pane> --> </el-tab-pane> -->
</el-tabs> </el-tabs>
<div style="text-align: center; margin-top:57px;" v-show="page.count > 0 && activeName!='7'">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="page.pageIndex"
:page-sizes="[10, 20, 30, 40]"
:page-size="page.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="page.count">
</el-pagination>
</div>
<div style="height:200px"></div> <div style="height:200px"></div>
</div> </div>
</template> </template>
@@ -125,6 +197,7 @@
}, },
data(){ data(){
return{ return{
pageId:'',
loading:false, loading:false,
loading1:false, loading1:false,
loading2:false, loading2:false,
@@ -133,22 +206,30 @@
loading5:false, loading5:false,
loading6:false, loading6:false,
intTabIndex:-1,//初始化显示哪个tab,71我关注的人72关注我的人 intTabIndex:-1,//初始化显示哪个tab,71我关注的人72关注我的人
page:{
pageIndex:1,
pageSize:10,
count:0
},
input:'', input:'',
activeName:'', activeName:'0',
pageId:'',
// pageList:[], // pageList:[],
casePageList:[], casePageList:[],
casePage:{count:0,pageSize:10, pageIndex:1},
notePageList:[], notePageList:[],
notePage:{count:0,pageSize:10,pageIndex:1},
articlePageList:[], articlePageList:[],
articlePage:{count:0,pageSize:10,pageIndex:1},
qaPageList:[], qaPageList:[],
qaPage:{count:0,pageSize:10,pageIndex:1},
answerPageList:[], answerPageList:[],
answerPage:{count:0,pageSize:10,pageIndex:1},
cousrePageList:[], cousrePageList:[],
cousrePage:{count:0,pageSize:10,pageIndex:1},
allPageList:[], allPageList:[],
allPage:{count:0,pageSize:10,pageIndex:1},
personal:false, personal:false,
orgData:[], orgData:[],
Profess:[] Profess:[]
@@ -211,19 +292,40 @@
loadMajorType:'majorType/loadMajorTypes', loadMajorType:'majorType/loadMajorTypes',
loadOrgDomain:'orgDomain/loadOrgDomains' loadOrgDomain:'orgDomain/loadOrgDomains'
}), }),
getPagerData(){
if(this.activeName == '0') {
return this.allPage;
} else if(this.activeName == '1') {
return this.cousrePage;
} else if(this.activeName == '2') {
return this.articlePage;
} else if(this.activeName == '3') {
return this.casePage;
} else if(this.activeName == '4') {
return this.qaPage;
} else if(this.activeName == '5') {
return this.answerPage;
} else if(this.activeName == '6') {
return this.notePage;
}
return null;
},
handleSizeChange(val) { handleSizeChange(val) {
this.page.pageSize = val; let curPageData=this.getPagerData();
this.page.pageIndex = 1; curPageData.pageIndex=1;
curPageData.pageSize=val;
this.getList(); this.getList();
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.page.pageIndex = val; let curPageData=this.getPagerData();
curPageData.pageIndex=val;
this.getList(); this.getList();
}, },
getList() { getList() {
let curPageData=this.getPagerData();
let data = { let data = {
pageIndex:this.page.pageIndex, pageIndex:curPageData.pageIndex,
pageSize:this.page.pageSize, pageSize:curPageData.pageSize,
contentType:this.activeName == 0? '':this.activeName,//内容类型 contentType:this.activeName == 0? '':this.activeName,//内容类型
aid:this.pageId, //指定用户的动态, aid:this.pageId, //指定用户的动态,
hidden:this.pageId == this.userInfo.aid?'':false,//是否隐藏,不指定,查询全部 hidden:this.pageId == this.userInfo.aid?'':false,//是否隐藏,不指定,查询全部
@@ -253,7 +355,7 @@
this.loading5 = false; this.loading5 = false;
this.loading6 = false; this.loading6 = false;
if(res.status == 200) { if(res.status == 200) {
this.page.count = res.result.count; curPageData.count = res.result.count;
let ids = res.result.list.map(item=>item.contentId); let ids = res.result.list.map(item=>item.contentId);
const noReapetIds = [...new Set(ids)]; const noReapetIds = [...new Set(ids)];
res.result.list.forEach(item=>{ res.result.list.forEach(item=>{
@@ -542,17 +644,43 @@
}) })
}, },
handleClick() { handleClick() {
if(this.activeName == '7') {
//单独的分页,所以这里不与当前页面的分页共用 if(this.activeName == '0') {
this.$refs.followList.resetActive(); if(this.allPageList.length>0){
this.$refs.followList.getPage(); return;
return
} }
this.page.count = 0 } else if(this.activeName == '1') {
if(this.cousrePageList.length>0){
return;
}
} else if(this.activeName == '2') {
if(this.articlePageList.length>0){
return;
}
} else if(this.activeName == '3') {
if(this.casePageList.length>0){
return;
}
} else if(this.activeName == '4') {
if(this.qaPageList.length>0){
return;
}
} else if(this.activeName == '5') {
if(this.answerPageList.length>0){
return;
}
} else if(this.activeName == '6') {
if(this.notePageList.length>0){
return;
}
}else if(this.activeName == '7'){
//单独的分页,所以这里不与当前页面的分页共用
this.$refs.followList.resetActive();
this.$refs.followList.getPage();
return
}
if(this.activeName == '8') { if(this.activeName == '8') {
this.page.count = 0; // 书箱没有了
// console.log(this.$refs.followList,'this.$refs.followList');
// this.$refs.followList.getPage();
return return
} }
this.getList(); this.getList();
@@ -562,6 +690,10 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.div-pagination{
text-align: center;
margin-top:50px;
}
.home-page{ .home-page{
::v-deep .el-tabs__active-bar{ ::v-deep .el-tabs__active-bar{
height: 4px; height: 4px;

View File

@@ -13,8 +13,8 @@
</div> </div>
--> -->
<el-tabs v-model="activeName" @tab-click="handleClick"> <el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane name="" label="全部" v-loading="loading"> <el-tab-pane name="0" label="全部" v-loading="loading">
<template v-for="item in allPageList"> <template v-show="activeName==0" v-for="item in allPageList">
<course-list v-if="item.contentType == 1" :list="[item]" :isDynamic="true" :personal="true" :isFollow="true" @hideIndex="dynamicHide"></course-list> <course-list v-if="item.contentType == 1" :list="[item]" :isDynamic="true" :personal="true" :isFollow="true" @hideIndex="dynamicHide"></course-list>
<case-list v-if="item.contentType == 3" :list="[item]" :isDynamic="true" :personal="true" :isFollow="true" @hideIndex="dynamicHide"></case-list> <case-list v-if="item.contentType == 3" :list="[item]" :isDynamic="true" :personal="true" :isFollow="true" @hideIndex="dynamicHide"></case-list>
<note-list v-if="item.contentType == 6" :list="[item]" :isDynamic="true" :personal="true" :isFollow="true" @hideIndex="dynamicHide"></note-list> <note-list v-if="item.contentType == 6" :list="[item]" :isDynamic="true" :personal="true" :isFollow="true" @hideIndex="dynamicHide"></note-list>
@@ -26,34 +26,94 @@
<img class="img" :src="`${webBaseUrl}/images/homeWu/no-course.png`" alt="" srcset=""> <img class="img" :src="`${webBaseUrl}/images/homeWu/no-course.png`" alt="" srcset="">
<p class="text">暂时没有动态</p> <p class="text">暂时没有动态</p>
</div> </div>
<div class="div-pagination" v-show="allPage.count > 0">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="allPage.pageIndex"
:page-sizes="[10, 20, 30, 40]"
:page-size="allPage.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="allPage.count">
</el-pagination>
</div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane name="1" label="课程" v-loading="loading1"> <el-tab-pane name="1" label="课程" v-loading="loading1">
<course-list :list="cousrePageList" :isDynamic="true" :personal="true" :isFollow="true" @hideIndex="dynamicHide"></course-list> <course-list v-show="activeName==1" :list="cousrePageList" :isDynamic="true" :personal="true" :isFollow="true" @hideIndex="dynamicHide"></course-list>
<div v-if="!loading1 && cousrePageList.length==0" class="home-no-list"> <div v-if="!loading1 && cousrePageList.length==0" class="home-no-list">
<img class="img" :src="`${webBaseUrl}/images/homeWu/no-course.png`" alt="" srcset=""> <img class="img" :src="`${webBaseUrl}/images/homeWu/no-course.png`" alt="" srcset="">
<p class="text">暂时没有动态</p> <p class="text">暂时没有动态</p>
</div> </div>
<div class="div-pagination" v-show="cousrePage.count > 0">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="cousrePage.pageIndex"
:page-sizes="[10, 20, 30, 40]"
:page-size="cousrePage.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="cousrePage.count">
</el-pagination>
</div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane name="6" label="笔记" v-loading="loading6"> <el-tab-pane name="6" label="笔记" v-loading="loading6">
<note-list :list="notePageList" :isDynamic="true" :personal="true" :isFollow="true" @hideIndex="dynamicHide"></note-list> <note-list v-show="activeName==6" :list="notePageList" :isDynamic="true" :personal="true" :isFollow="true" @hideIndex="dynamicHide"></note-list>
<div v-if="!loading6 && notePageList.length==0" class="home-no-list"> <div v-if="!loading6 && notePageList.length==0" class="home-no-list">
<img class="img" :src="`${webBaseUrl}/images/homeWu/no-note.png`" alt="" srcset=""> <img class="img" :src="`${webBaseUrl}/images/homeWu/no-note.png`" alt="" srcset="">
<p class="text">暂时没有动态</p> <p class="text">暂时没有动态</p>
</div> </div>
<div class="div-pagination" v-show="notePage.count > 0">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="notePage.pageIndex"
:page-sizes="[10, 20, 30, 40]"
:page-size="notePage.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="notePage.count">
</el-pagination>
</div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane name="3" label="案例" v-loading="loading3"> <el-tab-pane name="3" label="案例" v-loading="loading3">
<case-list :list="casePageList" :isDynamic="true" :personal="true" :isFollow="true" @hideIndex="dynamicHide"></case-list> <case-list v-show="activeName==3" :list="casePageList" :isDynamic="true" :personal="true" :isFollow="true" @hideIndex="dynamicHide"></case-list>
<div v-if="!loading3 && casePageList.length==0" class="home-no-list"> <div v-if="!loading3 && casePageList.length==0" class="home-no-list">
<img class="img" :src="`${webBaseUrl}/images/homeWu/no-case.png`" alt="" srcset=""> <img class="img" :src="`${webBaseUrl}/images/homeWu/no-case.png`" alt="" srcset="">
<p class="text">暂时没有动态</p> <p class="text">暂时没有动态</p>
</div> </div>
<div class="div-pagination" v-show="casePage.count > 0">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="casePage.pageIndex"
:page-sizes="[10, 20, 30, 40]"
:page-size="casePage.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="casePage.count">
</el-pagination>
</div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane name="2" label="文章" v-loading="loading2"> <el-tab-pane name="2" label="文章" v-loading="loading2">
<article-list :list="articlePageList" :isDynamic="true" :personal="true" :isFollow="true" @hideIndex="dynamicHide"></article-list> <article-list v-show="activeName==2" :list="articlePageList" :isDynamic="true" :personal="true" :isFollow="true" @hideIndex="dynamicHide"></article-list>
<div v-if="!loading2 && articlePageList.length==0" class="home-no-list"> <div v-if="!loading2 && articlePageList.length==0" class="home-no-list">
<img class="img" style="width:150px;height:160px" :src="`${webBaseUrl}/images/homeWu/no-article.png`" alt="" srcset=""> <img class="img" style="width:150px;height:160px" :src="`${webBaseUrl}/images/homeWu/no-article.png`" alt="" srcset="">
<p class="text">暂时没有动态</p> <p class="text">暂时没有动态</p>
</div> </div>
<div class="div-pagination" v-show="articlePage.count > 0">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="articlePage.pageIndex"
:page-sizes="[10, 20, 30, 40]"
:page-size="articlePage.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="articlePage.count">
</el-pagination>
</div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane name="4" label="提问" v-loading="loading4"> <el-tab-pane name="4" label="提问" v-loading="loading4">
<put-list :list="qaPageList" :isDynamic="true" :personal="true" :isFollow="true" @hideIndex="dynamicHide"></put-list> <put-list :list="qaPageList" :isDynamic="true" :personal="true" :isFollow="true" @hideIndex="dynamicHide"></put-list>
@@ -61,6 +121,18 @@
<img class="img" style="width:204px;height:160px" :src="`${webBaseUrl}/images/homeWu/no-put.png`" alt="" srcset=""> <img class="img" style="width:204px;height:160px" :src="`${webBaseUrl}/images/homeWu/no-put.png`" alt="" srcset="">
<p class="text">暂时没有动态</p> <p class="text">暂时没有动态</p>
</div> </div>
<div class="div-pagination" v-show="qaPage.count > 0">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="qaPage.pageIndex"
:page-sizes="[10, 20, 30, 40]"
:page-size="qaPage.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="qaPage.count">
</el-pagination>
</div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane name="5" label="回答" v-loading="loading5"> <el-tab-pane name="5" label="回答" v-loading="loading5">
<answer-list :list="answerPageList" :isDynamic="true" :personal="true" :isFollow="true" @hideIndex="dynamicHide"></answer-list> <answer-list :list="answerPageList" :isDynamic="true" :personal="true" :isFollow="true" @hideIndex="dynamicHide"></answer-list>
@@ -68,6 +140,18 @@
<img class="img" :src="`${webBaseUrl}/images/homeWu/no-answer.png`" alt="" srcset=""> <img class="img" :src="`${webBaseUrl}/images/homeWu/no-answer.png`" alt="" srcset="">
<p class="text">暂时没有动态</p> <p class="text">暂时没有动态</p>
</div> </div>
<div class="div-pagination" v-show="answerPage.count > 0">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="answerPage.pageIndex"
:page-sizes="[10, 20, 30, 40]"
:page-size="answerPage.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="answerPage.count">
</el-pagination>
</div>
</el-tab-pane> </el-tab-pane>
<!-- <el-tab-pane name="7" label="关注"> <!-- <el-tab-pane name="7" label="关注">
@@ -80,18 +164,7 @@
</el-tab-pane> </el-tab-pane>
--> -->
</el-tabs> </el-tabs>
<div style="text-align: center; margin-top:57px;" v-show="page.count > 0">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="page.pageIndex"
:page-sizes="[10, 20, 30, 40]"
:page-size="page.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="page.count">
</el-pagination>
</div>
<div style="height:200px"></div> <div style="height:200px"></div>
</div> </div>
</div> </div>
@@ -125,6 +198,7 @@
components:{portalHeader,UcHeader,CaseList,CourseList,NoteList,PutList,AnswerList,ArticleList,FollowList,BookList}, components:{portalHeader,UcHeader,CaseList,CourseList,NoteList,PutList,AnswerList,ArticleList,FollowList,BookList},
data(){ data(){
return{ return{
pageId:'',
loading:false, loading:false,
loading1:false, loading1:false,
loading2:false, loading2:false,
@@ -132,25 +206,31 @@
loading4:false, loading4:false,
loading5:false, loading5:false,
loading6:false, loading6:false,
pageSize:10,
input:'', input:'',
// loading:0,//加载中 activeName:'0',
activeName:'first',
page:{
pageIndex:1,
pageSize:10,
count:0
},
input:'',
activeName:'',
pageId:'',
// pageList:[], // pageList:[],
casePageList:[], casePageList:[],
casePage:{count:0,pageSize:10, pageIndex:1},
notePageList:[], notePageList:[],
notePage:{count:0,pageSize:10,pageIndex:1},
articlePageList:[], articlePageList:[],
articlePage:{count:0,pageSize:10,pageIndex:1},
qaPageList:[], qaPageList:[],
qaPage:{count:0,pageSize:10,pageIndex:1},
answerPageList:[], answerPageList:[],
answerPage:{count:0,pageSize:10,pageIndex:1},
cousrePageList:[], cousrePageList:[],
cousrePage:{count:0,pageSize:10,pageIndex:1},
allPageList:[], allPageList:[],
allPage:{count:0,pageSize:10,pageIndex:1},
personal:true, personal:true,
orgData:[], orgData:[],
Profess:[], Profess:[],
@@ -189,23 +269,48 @@
} }
}) })
}, },
handleSizeChange(val) { handleSizeChange(val) {
this.page.pageSize = val; let curPageData=this.getPagerData();
this.page.pageIndex = 1; curPageData.pageIndex=1;
this.getList(); curPageData.pageSize=val;
this.getList();
},
getPagerData(){
if(this.activeName == '0') {
return this.allPage;
} else if(this.activeName == '1') {
return this.cousrePage;
} else if(this.activeName == '2') {
return this.articlePage;
} else if(this.activeName == '3') {
return this.casePage;
} else if(this.activeName == '4') {
return this.qaPage;
} else if(this.activeName == '5') {
return this.answerPage;
} else if(this.activeName == '6') {
return this.notePage;
}
return null;
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.page.pageIndex = val; let curPageData=this.getPagerData();
this.getList(); curPageData.pageIndex=val;
this.getList();
}, },
getList() { getList() {
let data = { let curPageData=this.getPagerData();
pageIndex:this.page.pageIndex, let qdata = {
pageSize:this.page.pageSize, pageIndex:curPageData.pageIndex,
pageSize:curPageData.pageSize,
contentType:this.activeName == 0? '':this.activeName,//内容类型 contentType:this.activeName == 0? '':this.activeName,//内容类型
aids:this.followIds // 数组 aids:this.followIds // 数组
} }
if(this.activeName == '1') {
if(this.activeName == '0') {
this.loading = true;
} else if(this.activeName == '1') {
this.loading1 = true; this.loading1 = true;
} else if(this.activeName == '2') { } else if(this.activeName == '2') {
this.loading2 = true; this.loading2 = true;
@@ -218,9 +323,9 @@
} else if(this.activeName == '6') { } else if(this.activeName == '6') {
this.loading6 = true; this.loading6 = true;
} else { } else {
this.loading = true; this.loading = true;
} }
apiStat.userDynamicfollows(data).then(res=>{ apiStat.userDynamicfollows(qdata).then(res=>{
this.loading = false; this.loading = false;
this.loading1 = false; this.loading1 = false;
this.loading2 = false; this.loading2 = false;
@@ -229,7 +334,7 @@
this.loading5 = false; this.loading5 = false;
this.loading6 = false; this.loading6 = false;
if(res.status == 200) { if(res.status == 200) {
this.page.count = res.result.count; curPageData.count = res.result.count;
if(res.result.count==0){ if(res.result.count==0){
return; return;
} }
@@ -520,14 +625,46 @@
}) })
}, },
handleClick() { handleClick() {
this.page.count = 0; if(this.activeName == '0') {
this.getList(); if(this.allPageList.length>0){
return;
}
} else if(this.activeName == '1') {
if(this.cousrePageList.length>0){
return;
}
} else if(this.activeName == '2') {
if(this.articlePageList.length>0){
return;
}
} else if(this.activeName == '3') {
if(this.casePageList.length>0){
return;
}
} else if(this.activeName == '4') {
if(this.qaPageList.length>0){
return;
}
} else if(this.activeName == '5') {
if(this.answerPageList.length>0){
return;
}
} else if(this.activeName == '6') {
if(this.notePageList.length>0){
return;
}
}
this.getList();
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.div-pagination{
text-align: center;
margin-top:50px;
}
.follow-banner{ .follow-banner{
background-color: #0078FC; background-color: #0078FC;
} }