|
|
@@ -114,11 +114,27 @@ Page({ |
|
|
|
lists: [], |
|
|
|
}) |
|
|
|
} |
|
|
|
var tmpArr = that.data.lists; |
|
|
|
tmpArr.push.apply(tmpArr, res.data.list); |
|
|
|
that.setData({ |
|
|
|
lists: tmpArr |
|
|
|
}) |
|
|
|
if (flag == 'bargaingoods'){ |
|
|
|
var tmpArr = that.data.lists; |
|
|
|
tmpArr.push.apply(tmpArr, res.data.list); |
|
|
|
that.setData({ |
|
|
|
lists: tmpArr |
|
|
|
}) |
|
|
|
} else if (flag == 'mybargain'){ |
|
|
|
console.log(res.data.list) |
|
|
|
var tmpArr = that.data.lists; |
|
|
|
tmpArr.push.apply(tmpArr, res.data.list); |
|
|
|
console.log(tmpArr) |
|
|
|
let lists = []; |
|
|
|
tmpArr.map(file => { |
|
|
|
if (file.orderStatus != 0) { |
|
|
|
lists.push(file); |
|
|
|
} |
|
|
|
}) |
|
|
|
that.setData({ |
|
|
|
lists: lists |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
wx.showToast({ |
|
|
@@ -241,4 +257,30 @@ Page({ |
|
|
|
}); |
|
|
|
that.getList(that.data.page, that.data.flag); |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 刷新 |
|
|
|
*/ |
|
|
|
onPullDownRefresh: function (e) { |
|
|
|
let that = this; |
|
|
|
if (that.data.flag == 'bargaingoods'){ |
|
|
|
that.getBannerlist(); |
|
|
|
var todayDate = new Date().getTime(); |
|
|
|
that.setData({ |
|
|
|
todayDate: todayDate |
|
|
|
}) |
|
|
|
that.getList(1, "bargaingoods"); |
|
|
|
that.setData({ |
|
|
|
flag: "bargaingoods", |
|
|
|
bargaingoods: true, |
|
|
|
mybargain: false |
|
|
|
}) |
|
|
|
} else if (that.data.flag == 'mybargain'){ |
|
|
|
that.getList(1, "mybargain"); |
|
|
|
that.setData({ |
|
|
|
flag: "mybargain", |
|
|
|
bargaingoods: false, |
|
|
|
mybargain: true |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
}) |