This commit is contained in:
lmj
2022-10-15 11:29:12 +08:00
parent 0b97668f5c
commit 89dd6f7a6e
3 changed files with 45 additions and 7 deletions

View File

@@ -30,6 +30,18 @@
</div> </div>
</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>
<div v-if="showEmpty"> <div v-if="showEmpty">
<img class="img" style="width:186px;height:160px" src="/images/homeWu/no-follow.png" alt="" srcset=""> <img class="img" style="width:186px;height:160px" src="/images/homeWu/no-follow.png" alt="" srcset="">
@@ -60,6 +72,18 @@
</div> </div>
</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>
</div> </div>
@@ -102,7 +126,8 @@ import apiUser from "@/api/system/user.js";
page:{ page:{
pageIndex:1, pageIndex:1,
pageSize:10, pageSize:10,
aid:'' aid:'',
count:0
} }
} }
}, },
@@ -110,10 +135,22 @@ import apiUser from "@/api/system/user.js";
this.pageId = this.$xpage.getHomeId(this.$route); this.pageId = this.$xpage.getHomeId(this.$route);
}, },
methods:{ 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) { cancel(item) {
apiFollow.remove(item.followId).then(res=>{ apiFollow.remove(item.followId).then(res=>{
if(res.status == 200) { if(res.status == 200) {
this.getPage() this.getPage()
} }
}) })
}, },
@@ -135,12 +172,12 @@ import apiUser from "@/api/system/user.js";
this.page.aid = this.pageId; this.page.aid = this.pageId;
apiFollow.mypage(this.page).then(res=>{ apiFollow.mypage(this.page).then(res=>{
if(res.status== 200) { if(res.status== 200) {
this.count = res.result.count; this.page.count = res.result.count;
res.result.list.forEach(item=>{ res.result.list.forEach(item=>{
item.userFollow.authorInfo = { aid: "",name: "",orgInfo: "",avatar: "",sex: null ,sign:''} item.userFollow.authorInfo = { aid: "",name: "",orgInfo: "",avatar: "",sex: null ,sign:''}
}) })
this.mypageList = res.result.list; this.mypageList = res.result.list;
//console.log(this.mypageList,'this.mypageList'); console.log(this.mypageList,'this.mypageList');
this.getUserData(res.result.list); this.getUserData(res.result.list);
} }
}) })
@@ -149,7 +186,7 @@ import apiUser from "@/api/system/user.js";
this.page.aid = this.pageId; this.page.aid = this.pageId;
apiFollow.page(this.page).then(res=>{ apiFollow.page(this.page).then(res=>{
if(res.status== 200) { if(res.status== 200) {
this.count = res.result.count; this.page.count = res.result.count;
res.result.list.forEach(item=>{ res.result.list.forEach(item=>{
item.authorInfo = { aid: "",name: "",orgInfo: "",avatar: "",sex: null ,sign:''} item.authorInfo = { aid: "",name: "",orgInfo: "",avatar: "",sex: null ,sign:''}
}) })

View File

@@ -306,7 +306,7 @@
<span slot="title">消息中心</span> <span slot="title">消息中心</span>
</el-menu-item> </el-menu-item>
<!-- <el-submenu index="myArticle" v-show="curIdentity == 1"> <!-- <el-submenu index="myArwticle" v-show="curIdentity == 1">
<template slot="title"> <template slot="title">
<i class="el-icon-s-grid"></i> <i class="el-icon-s-grid"></i>
<span>我的文章</span> <span>我的文章</span>

View File

@@ -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> <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> <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"> <div style="text-align: center; margin-top:57px;" v-show="page.count > 0">
<el-pagination <el-pagination
background background
@@ -470,7 +470,8 @@
handleClick() { handleClick() {
if(this.activeName == '7') { if(this.activeName == '7') {
this.$refs.followList.getPage(); this.$refs.followList.getPage();
this.page.count = 0; console.log(this.$refs.followList,'llllmj')
this.page.count = this.$refs.followList.count;
return return
} }
if(this.activeName == '8') { if(this.activeName == '8') {