From 63a2299a139617b068c1af9d165300f196c20882 Mon Sep 17 00:00:00 2001 From: lwh <2679599887@qq.com> Date: Sat, 15 Jul 2023 11:58:31 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E5=AF=B9=E6=8E=A5=E5=95=86=E5=93=81?= =?UTF-8?q?=E5=88=86=E7=B1=BB=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/goods/category/index.js | 5 +++-- pages/goods/list/index.js | 13 +++++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/pages/goods/category/index.js b/pages/goods/category/index.js index 43944d7..3fddf3e 100644 --- a/pages/goods/category/index.js +++ b/pages/goods/category/index.js @@ -17,9 +17,10 @@ Page({ onShow() { this.getTabBar().init(); }, - onChange() { + onChange(e) { + console.log(e.detail.item.groupId,'asdasd'); wx.navigateTo({ - url: '/pages/goods/list/index', + url: '/pages/goods/list/index?goodsCategoryGuid=' + e.detail.item.groupId, }); }, onLoad() { diff --git a/pages/goods/list/index.js b/pages/goods/list/index.js index 4788abd..24959ce 100644 --- a/pages/goods/list/index.js +++ b/pages/goods/list/index.js @@ -20,6 +20,7 @@ Page({ hasLoaded: false, loadMoreStatus: 0, loading: true, + goodsCategoryGuid: 0 }, pageNum: 1, @@ -39,13 +40,14 @@ Page({ }, generalQueryData(reset = false) { - const { filter, keywords, minVal, maxVal } = this.data; + const { filter, keywords, minVal, maxVal , goodsCategoryGuid} = this.data; const { pageNum, pageSize } = this; const { sorts, overall } = filter; const params = { // sort: 0, // 0 综合,1 价格 pageNum: 1, pageSize: 6, + goodsCategoryGuid: goodsCategoryGuid // keyword: keywords, }; @@ -124,7 +126,14 @@ Page({ }); }, - onLoad() { + onLoad(query) { + const { + goodsCategoryGuid + } = query; + this.setData({ + goodsCategoryGuid: goodsCategoryGuid, + }); + this.init(true); },