我下面的代码是没有问题的,确实每次都能加载到,但是都会重回顶部
注:下面的代码不能直接用,有一些变量没有贴上来
//上拉加载下一页商品
onReachBottom: function() {
console.log('--------上拉加载--------');
this.getGoods(page);
},
//刷新列表
getGoods: function(page) {
var that = this;
if (isfinish) return;
wx.showLoading({
title: '正在加载',
})
wx.request({
url: '',
data: {
endtime: util.formatTime(new Date),
currentpage: page,
process: 1,
// condition:that.data.condition
},
header: getApp().globalData.header,
method: 'POST',
dataType: 'json',
success: function(res) {
console.log(res.data);
if (res.data.pojo.currentpage <= res.data.pojo.totalpage) {
//声明一个goods对象指向页面中的goods
var goods = that.data.goods;
for (var i = 0; i < res.data.pojo.pojo.length;