新手不会用组件,只能自己再弄一个简单一点的解决,直接上代码。
app.js
// arr 数组,len 长度, list 名称
getmore(arr,len,list='list'){
let newList = {};
for (let i = 0; i < arr.length; i++) {
let item = arr[i];
newList[list+'['+(len+i)+']'] = item;
};
return newList;
},
list.js
// 上拉加载更多
onReachBottom: function () {
var len = that.data.list.length; // 页面原有数据长度
var arr2 = data.list; //此次请求返回的数据
var newList = getApp().getmore(arr2,len,'mynane');
newList['other'] = '其他需要传递的参数';
console.log('setData',newList);
that.setData(newList);
},