微信小程序-翻页(优化)

if (res.data.result == "01") {
var length = res.data.list.length;
that.setData({
length: length
})
if (currentPage == "1") {
for (var i = 0; i < length; i++) {
res.data.list[i].face = appImg + res.data.list[i].face;
}
that.setData({
list: res.data.list
})
} else {
if (length == "0") {
return
}
var Member = res.data.list;
var arr = that.data.list;
for (var i = 0; i < length; i++) {
Member[i].face = appImg + Member[i].face;
arr.push(Member[i]);
}
that.setData({
list: arr,
})
}
} else {
getApp().msgShow(that, res.data.msg);
}

posted on 2018-01-03 11:17  再胖十斤就好  阅读(2748)  评论(0编辑  收藏  举报

导航