From 6ddc103f0cfc3a60558c5dba002b73499b784382 Mon Sep 17 00:00:00 2001 From: "AERWEN\\26795" <123456789a> Date: Sun, 15 Oct 2023 13:18:16 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20=E4=BF=AE=E6=94=B9=E7=AB=8B=E5=88=BB?= =?UTF-8?q?=E8=B4=AD=E4=B9=B0=E7=9A=84=E5=8F=82=E6=95=B0=E4=BC=A0=E9=80=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/goods/details/index.js | 4 +++- pages/home/home.js | 11 +++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/pages/goods/details/index.js b/pages/goods/details/index.js index 9c142b9..76331a5 100644 --- a/pages/goods/details/index.js +++ b/pages/goods/details/index.js @@ -323,6 +323,7 @@ Page({ const { isAllSelectedSku, buyNum, + selectedSkuId } = this.data; const { specList @@ -346,7 +347,7 @@ Page({ storeId: '1', spuId: this.data.spuId, goodsName: this.data.details.title, - skuId: type === 1 ? null : this.data.selectItem.skuId, + skuId: type === 1 ? 0 : selectedSkuId, available: this.data.details.available, price: this.data.details.minSalePrice, specInfo: this.data.details.specList?.map((item) => ({ @@ -358,6 +359,7 @@ Page({ thumb: this.data.details.primaryImage, title: this.data.details.title, }; + console.log(query,'从立刻购买来的'); let urlQueryStr = obj2Params({ goodsRequestList: JSON.stringify([query]), }); diff --git a/pages/home/home.js b/pages/home/home.js index adcf5a2..dfe5aac 100644 --- a/pages/home/home.js +++ b/pages/home/home.js @@ -29,6 +29,7 @@ Page({ swiperImageProps: { mode: 'scaleToFill', }, + categoryGuid: 0 }, goodListPagination: { @@ -98,15 +99,17 @@ Page({ tabChangeHandle(e) { this.privateData.tabIndex = e.detail; - console.log(e.detail.value, 'tab的看看'); - this.loadGoodsList(true, e.detail.value); + this.setData({ + categoryGuid: e.detail.value, + }); + this.loadGoodsList(true); }, onReTry() { this.loadGoodsList(); }, - async loadGoodsList(fresh = false, categoryGuid = 0) { + async loadGoodsList(fresh = false) { if (fresh) { wx.pageScrollTo({ scrollTop: 0, @@ -126,7 +129,7 @@ Page({ let params = { pageNum: pageIndex, pageSize: pageSize, - goodsCategoryGuid: categoryGuid + goodsCategoryGuid: this.data.categoryGuid } console.log(params, '看看参数'); try {