this.data.totalCount = 20; 这个应该是20吧
来源:22-7 新版本更新后的补充章节

海翔50
2017-01-22
// 下拉刷新页面 onPullDownRefresh: function(event) { var refreshUrl = this.data.dataUrl + '?start=0&count=20'; wx.showNavigationBarLoading(); this.data.movies = []; this.data.isEmpty = true; this.data.totalCount = 20; util.http(refreshUrl,this.processDoubarData); }, data: { totalCount: 20, dataUrl: '', movies:[], isEmpty: true }, onReachBottom: function(event) { wx.showNavigationBarLoading(); var nextUrl = this.data.dataUrl + '?start='+this.data.totalCount + '&count=8'; console.log(nextUrl); util.http(nextUrl,this.processDoubarData); this.data.totalCount += 8; }
this.data.totalCount = 20; 这个应该是20吧,不应该为0,
this.data.totalCount += 8; 这句话应该放在加载更多的时候执行
写回答
2回答
-
7七月
2017-01-22
是这样设计的。刷新后只保存最新的20条,你可以根据你自己的业务自行调整。
00 -
7七月
2017-01-22
刷新后重置totalcount,应该是0
012017-01-22
相似问题