mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-10 03:16:42 +08:00
分页
This commit is contained in:
@@ -30,6 +30,18 @@
|
||||
</div>
|
||||
</div>
|
||||
<!--分页没有加-->
|
||||
<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>
|
||||
<div v-if="showEmpty">
|
||||
<img class="img" style="width:186px;height:160px" src="/images/homeWu/no-follow.png" alt="" srcset="">
|
||||
@@ -60,6 +72,18 @@
|
||||
</div>
|
||||
</div>
|
||||
<!--分页没有加-->
|
||||
<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>
|
||||
|
||||
</div>
|
||||
@@ -102,7 +126,8 @@ import apiUser from "@/api/system/user.js";
|
||||
page:{
|
||||
pageIndex:1,
|
||||
pageSize:10,
|
||||
aid:''
|
||||
aid:'',
|
||||
count:0
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -110,10 +135,22 @@ import apiUser from "@/api/system/user.js";
|
||||
this.pageId = this.$xpage.getHomeId(this.$route);
|
||||
},
|
||||
methods:{
|
||||
handleSizeChange(val) {
|
||||
this.page.pageSize = val;
|
||||
this.page.pageIndex = 1;
|
||||
this.getPage()
|
||||
this.getMyPage()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.page.pageIndex = val;
|
||||
this.getPage()
|
||||
this.getMyPage()
|
||||
},
|
||||
cancel(item) {
|
||||
apiFollow.remove(item.followId).then(res=>{
|
||||
if(res.status == 200) {
|
||||
this.getPage()
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -135,12 +172,12 @@ import apiUser from "@/api/system/user.js";
|
||||
this.page.aid = this.pageId;
|
||||
apiFollow.mypage(this.page).then(res=>{
|
||||
if(res.status== 200) {
|
||||
this.count = res.result.count;
|
||||
this.page.count = res.result.count;
|
||||
res.result.list.forEach(item=>{
|
||||
item.userFollow.authorInfo = { aid: "",name: "",orgInfo: "",avatar: "",sex: null ,sign:''}
|
||||
})
|
||||
this.mypageList = res.result.list;
|
||||
//console.log(this.mypageList,'this.mypageList');
|
||||
console.log(this.mypageList,'this.mypageList');
|
||||
this.getUserData(res.result.list);
|
||||
}
|
||||
})
|
||||
@@ -149,7 +186,7 @@ import apiUser from "@/api/system/user.js";
|
||||
this.page.aid = this.pageId;
|
||||
apiFollow.page(this.page).then(res=>{
|
||||
if(res.status== 200) {
|
||||
this.count = res.result.count;
|
||||
this.page.count = res.result.count;
|
||||
res.result.list.forEach(item=>{
|
||||
item.authorInfo = { aid: "",name: "",orgInfo: "",avatar: "",sex: null ,sign:''}
|
||||
})
|
||||
|
||||
@@ -306,7 +306,7 @@
|
||||
<span slot="title">消息中心</span>
|
||||
</el-menu-item>
|
||||
|
||||
<!-- <el-submenu index="myArticle" v-show="curIdentity == 1">
|
||||
<!-- <el-submenu index="myArwticle" v-show="curIdentity == 1">
|
||||
<template slot="title">
|
||||
<i class="el-icon-s-grid"></i>
|
||||
<span>我的文章</span>
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
<span slot="label"><svg-icon icon-class="home-book" style="font-size: 30px;"></svg-icon><span class="tabs-info">书籍</span></span>
|
||||
<book-list></book-list>
|
||||
</el-tab-pane> -->
|
||||
</el-tabs>
|
||||
</el-tabs>
|
||||
<div style="text-align: center; margin-top:57px;" v-show="page.count > 0">
|
||||
<el-pagination
|
||||
background
|
||||
@@ -470,7 +470,8 @@
|
||||
handleClick() {
|
||||
if(this.activeName == '7') {
|
||||
this.$refs.followList.getPage();
|
||||
this.page.count = 0;
|
||||
console.log(this.$refs.followList,'llllmj')
|
||||
this.page.count = this.$refs.followList.count;
|
||||
return
|
||||
}
|
||||
if(this.activeName == '8') {
|
||||
|
||||
Reference in New Issue
Block a user