feat 对接商品分类筛选

This commit is contained in:
lwh 2023-07-15 11:58:31 +08:00
parent 2583b21c3f
commit 63a2299a13
2 changed files with 14 additions and 4 deletions

View File

@ -17,9 +17,10 @@ Page({
onShow() { onShow() {
this.getTabBar().init(); this.getTabBar().init();
}, },
onChange() { onChange(e) {
console.log(e.detail.item.groupId,'asdasd');
wx.navigateTo({ wx.navigateTo({
url: '/pages/goods/list/index', url: '/pages/goods/list/index?goodsCategoryGuid=' + e.detail.item.groupId,
}); });
}, },
onLoad() { onLoad() {

View File

@ -20,6 +20,7 @@ Page({
hasLoaded: false, hasLoaded: false,
loadMoreStatus: 0, loadMoreStatus: 0,
loading: true, loading: true,
goodsCategoryGuid: 0
}, },
pageNum: 1, pageNum: 1,
@ -39,13 +40,14 @@ Page({
}, },
generalQueryData(reset = false) { generalQueryData(reset = false) {
const { filter, keywords, minVal, maxVal } = this.data; const { filter, keywords, minVal, maxVal , goodsCategoryGuid} = this.data;
const { pageNum, pageSize } = this; const { pageNum, pageSize } = this;
const { sorts, overall } = filter; const { sorts, overall } = filter;
const params = { const params = {
// sort: 0, // 0 综合1 价格 // sort: 0, // 0 综合1 价格
pageNum: 1, pageNum: 1,
pageSize: 6, pageSize: 6,
goodsCategoryGuid: goodsCategoryGuid
// keyword: keywords, // keyword: keywords,
}; };
@ -124,7 +126,14 @@ Page({
}); });
}, },
onLoad() { onLoad(query) {
const {
goodsCategoryGuid
} = query;
this.setData({
goodsCategoryGuid: goodsCategoryGuid,
});
this.init(true); this.init(true);
}, },