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 {