use the variable news to save the news data obtained from the interface
:api.xxx.com/api/news/?pageNumer=1&pageSize=50
js:
this.setData({
news:data.data
})
wxml:
<block wx:for="{{news}}" wx:for-item="new">
<view>{{new.xx}}</view>
</block>
:
api.xxx.com/api/news/?pageNumer=2&pageSize=50
if(this.data.totalPage > this.data.pageNumber) {
var newData = this.data.news.concat(data.data);
this.setData({
news: newData
});
}
when you pull up 6 times, the newsData data is 50 * 6 = 300 pieces of data, which will be stuck in 2 seconds when directly bound to the web page.
about loading the more stuck.
is there any good solution to this situation?