From 78068d49c20a8b90db902d955f558af507eb8b96 Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期四, 11 四月 2024 16:06:12 +0800 Subject: [PATCH] 各页面添加骨架屏 --- pages/cart/index.js | 19 +++++++++++-------- 1 files changed, 11 insertions(+), 8 deletions(-) diff --git a/pages/cart/index.js b/pages/cart/index.js index 7e503ce..c31356e 100644 --- a/pages/cart/index.js +++ b/pages/cart/index.js @@ -86,8 +86,6 @@ totalSize: res.totalSize }) res.datas.forEach(item => { - console.log(res); - this.setData({ bookId: res.id, bookName: res.name @@ -105,13 +103,11 @@ 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 }) @@ -281,13 +277,20 @@ 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 }) } }); \ No newline at end of file -- Gitblit v1.9.1