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); },