| | |
| | | }); |
| | | this.shoppingCartGet(); |
| | | }, |
| | | onShow() { |
| | | this.shoppingCartGet(); |
| | | this.setData({ totalPrice: 0.00, selectedCount: 0, checkAll: false, }) |
| | | |
| | | }, |
| | | onDelete(e) { |
| | | const item = e.currentTarget.dataset.item; |
| | | app.MG.store.delShoppingCart({ |
| | |
| | | searchList: [] |
| | | }; |
| | | app.MG.store.getShoppingCartProductList(query).then(res => { |
| | | console.log(res, 'res'); |
| | | res.datas.forEach(item => { |
| | | item.imgUrl = getPublicImage(item.productMonWithLinkDto.product.icon, '', '160'); |
| | | console.log(item); |
| | |
| | | if (eitem.id == item.id) { |
| | | eitem.checked = e.detail.checked |
| | | } |
| | | |
| | | |
| | | }) |
| | | const data = items.filter(item => item.checked) |
| | | const checkAll = data.length == this.data.shoppingCartData.length |
| | | |
| | | this.setData({ |
| | | shoppingCartData: items, |
| | | checkAll |
| | |
| | | }); |
| | | }) |
| | | } else { |
| | | |
| | | Toast({ |
| | | context: this, |
| | | selector: '#t-toast', |
| | |
| | | direction: 'column', |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
| | | }, |
| | | onLogin() { |
| | | wx.navigateTo({ |
| | | url: '/pages/testLogin/index' |
| | | }); |
| | | } |
| | | }); |