apiclound 分页实现

api.setRefreshHeaderInfo({
loadingImg : 'widget://image/refresh.png',
bgColor : '#ccc',
textColor : '#fff',
textDown : '下拉刷新...',
textUp : '松开刷新...'
}, function(ret, err) {
currentPageNum = 1;
shuaxinxinxi(currentPageNum);
// 恢复下拉
api.refreshHeaderLoadDone()
});
// 上拉加载
api.addEventListener({
name : 'scrolltobottom',
extra : {
threshold : 50 //设置距离底部多少距离时触发,默认值为0,数字类型
}
}, function(ret, err) {
currentPageNum += 1;
shuaxinxinxi(currentPageNum);
api.toast({
msg : '已经到底了'
});
});

猜你喜欢

转载自blog.csdn.net/qq_39256837/article/details/80885693