mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-09 10:56:44 +08:00
解决 动态 切换闪的问题
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<i style="color: #333333" class="el-icon-search"></i>
|
||||
</div> -->
|
||||
<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>
|
||||
<template v-for="item in allPageList">
|
||||
<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="">
|
||||
<p class="text">还没有动态</p>
|
||||
</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 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>
|
||||
@@ -28,6 +40,18 @@
|
||||
<img class="img" :src="`${webBaseUrl}/images/homeWu/no-course.png`" alt="" srcset="">
|
||||
<p class="text">还没有课程</p>
|
||||
</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 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>
|
||||
@@ -36,6 +60,18 @@
|
||||
<img class="img" :src="`${webBaseUrl}/images/homeWu/no-case.png`" alt="" srcset="">
|
||||
<p class="text">还没有案例</p>
|
||||
</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 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>
|
||||
@@ -44,6 +80,18 @@
|
||||
<img class="img" :src="`${webBaseUrl}/images/homeWu/no-note.png`" alt="" srcset="">
|
||||
<p class="text">还没有笔记</p>
|
||||
</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 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>
|
||||
@@ -52,6 +100,18 @@
|
||||
<img class="img" style="width:204px;height:160px" :src="`${webBaseUrl}/images/homeWu/no-put.png`" alt="" srcset="">
|
||||
<p class="text">还没有提问</p>
|
||||
</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 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>
|
||||
@@ -60,6 +120,18 @@
|
||||
<img class="img" :src="`${webBaseUrl}/images/homeWu/no-answer.png`" alt="" srcset="">
|
||||
<p class="text">还没有回答</p>
|
||||
</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 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>
|
||||
@@ -68,6 +140,18 @@
|
||||
<img class="img" style="width:150px;height:160px" :src="`${webBaseUrl}/images/homeWu/no-article.png`" alt="" srcset="">
|
||||
<p class="text">还没有文章</p>
|
||||
</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 name="7">
|
||||
<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>
|
||||
</el-tab-pane> -->
|
||||
</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>
|
||||
</template>
|
||||
@@ -125,6 +197,7 @@
|
||||
},
|
||||
data(){
|
||||
return{
|
||||
pageId:'',
|
||||
loading:false,
|
||||
loading1:false,
|
||||
loading2:false,
|
||||
@@ -133,22 +206,30 @@
|
||||
loading5:false,
|
||||
loading6:false,
|
||||
intTabIndex:-1,//初始化显示哪个tab,71我关注的人,72关注我的人
|
||||
page:{
|
||||
pageIndex:1,
|
||||
pageSize:10,
|
||||
count:0
|
||||
},
|
||||
input:'',
|
||||
activeName:'',
|
||||
pageId:'',
|
||||
activeName:'0',
|
||||
// pageList:[],
|
||||
casePageList:[],
|
||||
casePage:{count:0,pageSize:10, pageIndex:1},
|
||||
|
||||
notePageList:[],
|
||||
notePage:{count:0,pageSize:10,pageIndex:1},
|
||||
|
||||
articlePageList:[],
|
||||
articlePage:{count:0,pageSize:10,pageIndex:1},
|
||||
|
||||
qaPageList:[],
|
||||
qaPage:{count:0,pageSize:10,pageIndex:1},
|
||||
|
||||
answerPageList:[],
|
||||
answerPage:{count:0,pageSize:10,pageIndex:1},
|
||||
|
||||
cousrePageList:[],
|
||||
cousrePage:{count:0,pageSize:10,pageIndex:1},
|
||||
|
||||
allPageList:[],
|
||||
allPage:{count:0,pageSize:10,pageIndex:1},
|
||||
|
||||
personal:false,
|
||||
orgData:[],
|
||||
Profess:[]
|
||||
@@ -211,19 +292,40 @@
|
||||
loadMajorType:'majorType/loadMajorTypes',
|
||||
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) {
|
||||
this.page.pageSize = val;
|
||||
this.page.pageIndex = 1;
|
||||
let curPageData=this.getPagerData();
|
||||
curPageData.pageIndex=1;
|
||||
curPageData.pageSize=val;
|
||||
this.getList();
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.page.pageIndex = val;
|
||||
let curPageData=this.getPagerData();
|
||||
curPageData.pageIndex=val;
|
||||
this.getList();
|
||||
},
|
||||
getList() {
|
||||
let curPageData=this.getPagerData();
|
||||
let data = {
|
||||
pageIndex:this.page.pageIndex,
|
||||
pageSize:this.page.pageSize,
|
||||
pageIndex:curPageData.pageIndex,
|
||||
pageSize:curPageData.pageSize,
|
||||
contentType:this.activeName == 0? '':this.activeName,//内容类型
|
||||
aid:this.pageId, //指定用户的动态,
|
||||
hidden:this.pageId == this.userInfo.aid?'':false,//是否隐藏,不指定,查询全部
|
||||
@@ -253,7 +355,7 @@
|
||||
this.loading5 = false;
|
||||
this.loading6 = false;
|
||||
if(res.status == 200) {
|
||||
this.page.count = res.result.count;
|
||||
curPageData.count = res.result.count;
|
||||
let ids = res.result.list.map(item=>item.contentId);
|
||||
const noReapetIds = [...new Set(ids)];
|
||||
res.result.list.forEach(item=>{
|
||||
@@ -542,17 +644,43 @@
|
||||
})
|
||||
},
|
||||
handleClick() {
|
||||
if(this.activeName == '7') {
|
||||
//单独的分页,所以这里不与当前页面的分页共用
|
||||
this.$refs.followList.resetActive();
|
||||
this.$refs.followList.getPage();
|
||||
return
|
||||
|
||||
if(this.activeName == '0') {
|
||||
if(this.allPageList.length>0){
|
||||
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') {
|
||||
this.page.count = 0;
|
||||
// console.log(this.$refs.followList,'this.$refs.followList');
|
||||
// this.$refs.followList.getPage();
|
||||
// 书箱没有了
|
||||
return
|
||||
}
|
||||
this.getList();
|
||||
@@ -562,6 +690,10 @@
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.div-pagination{
|
||||
text-align: center;
|
||||
margin-top:50px;
|
||||
}
|
||||
.home-page{
|
||||
::v-deep .el-tabs__active-bar{
|
||||
height: 4px;
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
</div>
|
||||
-->
|
||||
<el-tabs v-model="activeName" @tab-click="handleClick">
|
||||
<el-tab-pane name="" label="全部" v-loading="loading">
|
||||
<template v-for="item in allPageList">
|
||||
<el-tab-pane name="0" label="全部" v-loading="loading">
|
||||
<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>
|
||||
<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>
|
||||
@@ -26,34 +26,94 @@
|
||||
<img class="img" :src="`${webBaseUrl}/images/homeWu/no-course.png`" alt="" srcset="">
|
||||
<p class="text">暂时没有动态</p>
|
||||
</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 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">
|
||||
<img class="img" :src="`${webBaseUrl}/images/homeWu/no-course.png`" alt="" srcset="">
|
||||
<p class="text">暂时没有动态</p>
|
||||
</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 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">
|
||||
<img class="img" :src="`${webBaseUrl}/images/homeWu/no-note.png`" alt="" srcset="">
|
||||
<p class="text">暂时没有动态</p>
|
||||
</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 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">
|
||||
<img class="img" :src="`${webBaseUrl}/images/homeWu/no-case.png`" alt="" srcset="">
|
||||
<p class="text">暂时没有动态</p>
|
||||
</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 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">
|
||||
<img class="img" style="width:150px;height:160px" :src="`${webBaseUrl}/images/homeWu/no-article.png`" alt="" srcset="">
|
||||
<p class="text">暂时没有动态</p>
|
||||
</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 name="4" label="提问" v-loading="loading4">
|
||||
<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="">
|
||||
<p class="text">暂时没有动态</p>
|
||||
</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 name="5" label="回答" v-loading="loading5">
|
||||
<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="">
|
||||
<p class="text">暂时没有动态</p>
|
||||
</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 name="7" label="关注">
|
||||
@@ -80,18 +164,7 @@
|
||||
</el-tab-pane>
|
||||
-->
|
||||
</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>
|
||||
</div>
|
||||
@@ -125,6 +198,7 @@
|
||||
components:{portalHeader,UcHeader,CaseList,CourseList,NoteList,PutList,AnswerList,ArticleList,FollowList,BookList},
|
||||
data(){
|
||||
return{
|
||||
pageId:'',
|
||||
loading:false,
|
||||
loading1:false,
|
||||
loading2:false,
|
||||
@@ -132,25 +206,31 @@
|
||||
loading4:false,
|
||||
loading5:false,
|
||||
loading6:false,
|
||||
pageSize:10,
|
||||
input:'',
|
||||
// loading:0,//加载中
|
||||
activeName:'first',
|
||||
page:{
|
||||
pageIndex:1,
|
||||
pageSize:10,
|
||||
count:0
|
||||
},
|
||||
input:'',
|
||||
activeName:'',
|
||||
pageId:'',
|
||||
activeName:'0',
|
||||
// pageList:[],
|
||||
casePageList:[],
|
||||
casePage:{count:0,pageSize:10, pageIndex:1},
|
||||
|
||||
notePageList:[],
|
||||
notePage:{count:0,pageSize:10,pageIndex:1},
|
||||
|
||||
articlePageList:[],
|
||||
articlePage:{count:0,pageSize:10,pageIndex:1},
|
||||
|
||||
qaPageList:[],
|
||||
qaPage:{count:0,pageSize:10,pageIndex:1},
|
||||
|
||||
answerPageList:[],
|
||||
answerPage:{count:0,pageSize:10,pageIndex:1},
|
||||
|
||||
cousrePageList:[],
|
||||
cousrePage:{count:0,pageSize:10,pageIndex:1},
|
||||
|
||||
allPageList:[],
|
||||
allPage:{count:0,pageSize:10,pageIndex:1},
|
||||
|
||||
personal:true,
|
||||
orgData:[],
|
||||
Profess:[],
|
||||
@@ -189,23 +269,48 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.page.pageSize = val;
|
||||
this.page.pageIndex = 1;
|
||||
this.getList();
|
||||
handleSizeChange(val) {
|
||||
let curPageData=this.getPagerData();
|
||||
curPageData.pageIndex=1;
|
||||
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) {
|
||||
this.page.pageIndex = val;
|
||||
this.getList();
|
||||
let curPageData=this.getPagerData();
|
||||
curPageData.pageIndex=val;
|
||||
this.getList();
|
||||
},
|
||||
getList() {
|
||||
let data = {
|
||||
pageIndex:this.page.pageIndex,
|
||||
pageSize:this.page.pageSize,
|
||||
let curPageData=this.getPagerData();
|
||||
let qdata = {
|
||||
pageIndex:curPageData.pageIndex,
|
||||
pageSize:curPageData.pageSize,
|
||||
contentType:this.activeName == 0? '':this.activeName,//内容类型
|
||||
aids:this.followIds // 数组
|
||||
}
|
||||
if(this.activeName == '1') {
|
||||
|
||||
if(this.activeName == '0') {
|
||||
this.loading = true;
|
||||
} else if(this.activeName == '1') {
|
||||
this.loading1 = true;
|
||||
} else if(this.activeName == '2') {
|
||||
this.loading2 = true;
|
||||
@@ -218,9 +323,9 @@
|
||||
} else if(this.activeName == '6') {
|
||||
this.loading6 = true;
|
||||
} else {
|
||||
this.loading = true;
|
||||
this.loading = true;
|
||||
}
|
||||
apiStat.userDynamicfollows(data).then(res=>{
|
||||
apiStat.userDynamicfollows(qdata).then(res=>{
|
||||
this.loading = false;
|
||||
this.loading1 = false;
|
||||
this.loading2 = false;
|
||||
@@ -229,7 +334,7 @@
|
||||
this.loading5 = false;
|
||||
this.loading6 = false;
|
||||
if(res.status == 200) {
|
||||
this.page.count = res.result.count;
|
||||
curPageData.count = res.result.count;
|
||||
if(res.result.count==0){
|
||||
return;
|
||||
}
|
||||
@@ -520,14 +625,46 @@
|
||||
})
|
||||
},
|
||||
handleClick() {
|
||||
this.page.count = 0;
|
||||
this.getList();
|
||||
if(this.activeName == '0') {
|
||||
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>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.div-pagination{
|
||||
text-align: center;
|
||||
margin-top:50px;
|
||||
}
|
||||
.follow-banner{
|
||||
background-color: #0078FC;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user