From 26aedb9bd33b726a3e69b35fa188e524f5a12fc7 Mon Sep 17 00:00:00 2001
From: zhaofang <752743406@qq.com>
Date: Fri, 4 Nov 2022 15:21:26 +0800
Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages.json | 2 +-
pages/my/follow.vue | 25 +++++++++++++++++++++++--
2 files changed, 24 insertions(+), 3 deletions(-)
diff --git a/pages.json b/pages.json
index 9a3a1ac..a125ccf 100644
--- a/pages.json
+++ b/pages.json
@@ -45,7 +45,7 @@
{"path" : "pages/my/headimg","style" : {"navigationBarTitleText": "修改头像","enablePullDownRefresh": false}},
{"path" : "pages/my/uCurrencyRules","style" : {"navigationBarTitleText": "U币规则","enablePullDownRefresh": false}},
{"path" : "pages/my/rankingList","style" : {"navigationBarTitleText": "排行榜","enablePullDownRefresh": false}},
- {"path" : "pages/my/follow","style" : {"navigationBarTitleText": "关注列表","enablePullDownRefresh": false}},
+ {"path" : "pages/my/follow","style" : {"navigationBarTitleText": "关注列表"}},
{"path" : "pages/login/login","style" : { "navigationBarTitleText": "","enablePullDownRefresh": false}},
{"path" : "pages/login/loading","style" : { "navigationBarTitleText": "正在加载","enablePullDownRefresh": false}},
{"path" : "pages/plus/index","style" : {"navigationBarTitleText": "发布内容"}},
diff --git a/pages/my/follow.vue b/pages/my/follow.vue
index 879a69b..dec8ef4 100644
--- a/pages/my/follow.vue
+++ b/pages/my/follow.vue
@@ -39,6 +39,9 @@
+
+
+
@@ -65,6 +68,7 @@
}
}
},
+ loadStatus: 'more',
cancelIndex:0,
cancelIdx:0,
show:false,
@@ -85,6 +89,15 @@
}
},
+ onPullDownRefresh() {
+ if(this.tab == 1) {//关注我的
+ this.followMe.pageIndex ++;
+ this.getMyPage();
+ } else {//我关注的
+ this.follow.pageIndex ++;
+ this.getPage();
+ }
+ },
onLoad(options) {
this.$store.dispatch('GetUserInfo').then(rs => {
this.userInfo = rs;
@@ -138,9 +151,13 @@
getMyPage() {//关注我的,关注他的
this.followMe.aid = this.userInfo.aid;
let $this=this;
+ uni.showLoading({title:'加载中...'});
apiFollow.mypage(this.followMe).then(res=>{
+ setTimeout(function(){ uni.hideLoading() },100);
if(res.status== 200) {
- $this.followMe.count = res.result.count;
+ if($this.followMe.pageIndex>=res.result.totalPages){
+ $this.loadStatus='noMore';
+ }
res.result.list.forEach(item=>{
item.userFollow.authorInfo = { aid: "",name: "",orgInfo: "",avatar: "",sex: null ,sign:''}
})
@@ -157,9 +174,13 @@
// this.page.pageIndex=this.follow.pageIndex;
// this.page.pageSize=this.follow.pageSize;
let $this=this;
+ uni.showLoading({title:'加载中...'});
apiFollow.page(this.follow).then(res=>{
+ setTimeout(function(){ uni.hideLoading() },100);
if(res.status== 200) {
- $this.follow.count = res.result.count;
+ if($this.follow.pageIndex>=res.result.totalPages){
+ $this.loadStatus='noMore';
+ }
res.result.list.forEach(item=>{
item.userFollow.authorInfo = { aid: "",name: "",orgInfo: "",avatar: "",sex: null ,sign:''}
})