| | |
| | | |
| | | Page({ |
| | | data: { |
| | | loading: true, |
| | | hidden: true, |
| | | swipeOpened: false, |
| | | onDisabled: false, |
| | | imgUrl: [], |
| | |
| | | totalSize: res.totalSize |
| | | }) |
| | | res.datas.forEach(item => { |
| | | console.log(res); |
| | | |
| | | this.setData({ |
| | | bookId: res.id, |
| | | bookName: res.name |
| | |
| | | this.setData({ |
| | | shoppingCartData: res.datas |
| | | }); |
| | | console.log(this.data.shoppingCartData, 'shoppingCartData'); |
| | | if (this.data.shoppingCartData.length === 0) { |
| | | this.setData({ |
| | | onDisabled: true |
| | | }) |
| | | } else { |
| | | console.log(2222); |
| | | this.setData({ |
| | | onDisabled: false |
| | | }) |
| | | } |
| | | this.setData({ |
| | | loading: false, |
| | | hidden: false, |
| | | }) |
| | | }); |
| | | wx.stopPullDownRefresh() |
| | | |
| | |
| | | }, |
| | | // 下拉函数 |
| | | onPullDownRefresh() { |
| | | |
| | | this.setData({ |
| | | start: 1, |
| | | checkAll: false, |
| | |
| | | console.log(978); |
| | | this.shoppingCartGet() |
| | | }, |
| | | onBook(e) { |
| | | async onBook(e) { |
| | | const item = e.currentTarget.dataset.item |
| | | console.log(item); |
| | | console.log(item.productMonWithLinkDto.product.id); |
| | | console.log(item.productMonWithLinkDto.product.name); |
| | | let parentData = null; |
| | | parentData = await app.MG.store.getProductBySaleMethod({ |
| | | 'saleMethodId': item.saleMethod.id |
| | | }) |
| | | console.log(parentData) |
| | | let bookId = item.productMonWithLinkDto.product.id; |
| | | if (parentData.parentProduct.length > 0) { |
| | | bookId = parentData.parentProduct[parentData.parentProduct.length - 1].id; |
| | | } |
| | | wx.navigateTo({ |
| | | url: '/packageBookService/pages/bookServices/detail/index?id=' + item.productMonWithLinkDto.product.id + '&name=' + item.productMonWithLinkDto.product.name |
| | | url: '/packageBookService/pages/bookServices/detail/index?id=' + bookId + '&name=' + item.productMonWithLinkDto.product.name |
| | | }) |
| | | } |
| | | }); |