|
@@ -12,21 +12,27 @@ Page({
|
|
|
},
|
|
|
all_checked: false,
|
|
|
allPrice: 0,
|
|
|
- allGoodsPrice: 0
|
|
|
+ allGoodsPrice: 0,
|
|
|
+ hasmore: false,
|
|
|
+ curpage:0
|
|
|
},
|
|
|
onLoad: function () {
|
|
|
|
|
|
},
|
|
|
onShow: function () {
|
|
|
let self = this;
|
|
|
+ const curpage = this.data.curpage;
|
|
|
getReq({
|
|
|
act: 'cart',
|
|
|
- op: 'list'
|
|
|
+ op: 'list',
|
|
|
+ minest_cartid: curpage
|
|
|
}, function (res) {
|
|
|
if (res.code == 200) {
|
|
|
+ let hasmore = res.datas.mobile_page.hasmore;
|
|
|
let free_info = res.datas.free_info;
|
|
|
let summary_datas = res.datas.summary;
|
|
|
let cart_list = res.datas.cart_list;
|
|
|
+ let lashCartListId = cart_list[cart_list.length - 1].cart_id;
|
|
|
let summary = [];
|
|
|
for (let item of cart_list) {
|
|
|
item.checked = false;
|
|
@@ -38,6 +44,12 @@ Page({
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ if (hasmore) {
|
|
|
+ self.setData({
|
|
|
+ hasmore: true,
|
|
|
+ curpage: lashCartListId
|
|
|
+ })
|
|
|
+ }
|
|
|
self.setData({
|
|
|
free_info,
|
|
|
summary,
|
|
@@ -201,5 +213,34 @@ Page({
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
+ },
|
|
|
+ onReachBottom(){
|
|
|
+ let self = this;
|
|
|
+ let hasmore = this.data.hasmore;
|
|
|
+ if(hasmore) {
|
|
|
+ let req_curpage = this.data.curpage;
|
|
|
+ getReq({
|
|
|
+ act: 'cart',
|
|
|
+ op: 'list',
|
|
|
+ minest_cartid: req_curpage
|
|
|
+ }, function (res) {
|
|
|
+ self.setData({
|
|
|
+ curpage: req_curpage
|
|
|
+ })
|
|
|
+ console.log(res);
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ settlement(){
|
|
|
+ const cart_id_list = [];
|
|
|
+ for (cart_item of this.data.cart_list) {
|
|
|
+ if (cart_item.checked) {
|
|
|
+ cart_id_list.push(cart_item);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ cart_list = cart_id_list.join(',');
|
|
|
+ wx.navigateTo({
|
|
|
+ url: `/pages/confirmOrder/confirmOrder?iscart=1&cart_id=${cart_list}`
|
|
|
+ })
|
|
|
}
|
|
|
})
|