diff --git a/pages/my/follow.vue b/pages/my/follow.vue index fa11a88..9a98e36 100644 --- a/pages/my/follow.vue +++ b/pages/my/follow.vue @@ -110,18 +110,18 @@ onReachBottom() { if(this.tab == 1 && this.followMe.list.length { this.userInfo = rs; - this.getMyPage(); - this.getPage(); + this.getMyPage(true); + this.getPage(true); }); }, @@ -147,7 +147,9 @@ this.show = false; if(this.cancelIdx == 1) { $this.followMe.list[this.cancelIndex].has = false; + this.getPage(true); } else { + this.getMyPage(true) $this.follow.list.splice(this.cancelIndex,1); } uni.showToast({ @@ -158,24 +160,24 @@ }) }, toFollow(item,index) { - console.log(item,'item') let $this=this; apiFollow.save(item.userFollow.aid).then(res=>{ if(res.status == 200) { $this.followMe.list[index].has = true; // 手动把关注成功的数据push进我关注的列表 - let data = { - has:true, - userFollow:{ - aid:res.result.aid, - followId:res.result.followId, - followTime:res.result.followTime, - id:res.result.id, - authorInfo:item.userFollow.authorInfo, - } + this.getPage(true); + // let data = { + // has:true, + // userFollow:{ + // aid:res.result.aid, + // followId:res.result.followId, + // followTime:res.result.followTime, + // id:res.result.id, + // authorInfo:item.userFollow.authorInfo, + // } - } - $this.follow.list.push(data); + // } + // // $this.follow.list.push(data); } else { // this.$message.error(res.message); } @@ -184,7 +186,11 @@ ubtab(num){ this.tab = num; }, - getMyPage() {//关注我的,关注他的 + getMyPage(flag) {//关注我的,关注他的 + if(flag) { + this.followMe.pageIndex =1; + this.followMe.list = []; + } this.followMe.aid = this.userInfo.aid; let $this=this; uni.showLoading({title:'加载中...'}); @@ -202,7 +208,11 @@ } }) }, - getPage() { //我关注的,他关注的 + getPage(falg) { //我关注的,他关注的 + if(falg) { + this.follow.pageIndex = 1; + this.follow.list = []; + } this.follow.aid = this.userInfo.aid; let $this=this; uni.showLoading({title:'加载中...'}); diff --git a/pages/my/myShares.vue b/pages/my/myShares.vue index fab182d..54f611a 100644 --- a/pages/my/myShares.vue +++ b/pages/my/myShares.vue @@ -1,6 +1,6 @@