| | |
| | | |
| | | Page({ |
| | | data: { |
| | | onDisabled: false, |
| | | imgUrl: [], |
| | | shoppingCartData: [], |
| | | checkAll: false, |
| | |
| | | title: '购物车' |
| | | }); |
| | | this.shoppingCartGet(); |
| | | console.log(this.data.shoppingCartData.length, 'this.data.shoppingCartData.length'); |
| | | |
| | | }, |
| | | onShow() { |
| | | if (typeof this.getTabBar === 'function' && this.getTabBar()) { |
| | |
| | | } |
| | | this.shoppingCartGet(); |
| | | this.setData({ totalPrice: 0.00, selectedCount: 0, checkAll: false, }) |
| | | |
| | | |
| | | }, |
| | | onDelete(e) { |
| | | const item = e.currentTarget.dataset.item; |
| | |
| | | ids: [item.id] |
| | | }).then(res => { |
| | | this.shoppingCartGet(); |
| | | wx.showToast({ title: '你点击了删除', icon: 'none' }); |
| | | wx.showToast({ title: '删除图书成功', icon: 'none' }); |
| | | }); |
| | | }, |
| | | |
| | |
| | | }) |
| | | |
| | | res.datas.forEach(item => { |
| | | console.log(item, 'item456'); |
| | | // console.log(item, 'item456'); |
| | | item.imgUrl = getPublicImage(item.productMonWithLinkDto.product.icon, '', '160'); |
| | | |
| | | this.setData({ |
| | |
| | | this.setData({ |
| | | shoppingCartData: res.datas |
| | | }); |
| | | |
| | | |
| | | if (this.data.shoppingCartData.length === 0) { |
| | | console.log(11111); |
| | | this.setData({ |
| | | onDisabled: true |
| | | }) |
| | | } else { |
| | | console.log(2222); |
| | | this.setData({ |
| | | onDisabled: false |
| | | }) |
| | | } |
| | | }); |
| | | wx.stopPullDownRefresh() |
| | | |
| | | }, |
| | | |
| | | bottomChange(e) { |
| | |
| | | linkIds: selectedIds |
| | | } |
| | | app.MG.store.shoppingCartCreateOrder(data).then(res => { |
| | | console.log(res, 456); |
| | | // console.log(res, 456); |
| | | |
| | | |
| | | const url = '/pages/cart/paymentPage/index?orderNumber=' + res.orderNumber |