|
|
@ -138,7 +138,7 @@ Page({ |
|
|
showYolkTypePicker: false, |
|
|
showYolkTypePicker: false, |
|
|
showSpecificationPicker: false, |
|
|
showSpecificationPicker: false, |
|
|
showProductNamePicker: false, |
|
|
showProductNamePicker: false, |
|
|
showRegionPicker: false, |
|
|
showAdvancedRegionPicker: false, |
|
|
// 蛋壳颜色选项
|
|
|
// 蛋壳颜色选项
|
|
|
shellColorOptions: [ |
|
|
shellColorOptions: [ |
|
|
{ label: '全部颜色', value: 'all' }, |
|
|
{ label: '全部颜色', value: 'all' }, |
|
|
@ -1670,6 +1670,30 @@ Page({ |
|
|
filtered = filtered.filter(item => item.isAd || (item.region && item.region.includes(selectedRegion))) |
|
|
filtered = filtered.filter(item => item.isAd || (item.region && item.region.includes(selectedRegion))) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 应用高级筛选中的蛋壳颜色筛选
|
|
|
|
|
|
if (this.data.advancedFilters.shellColor !== 'all') { |
|
|
|
|
|
const selectedShellColor = this.data.advancedFilters.shellColor |
|
|
|
|
|
filtered = filtered.filter(item => item.isAd || (item.shellColor && item.shellColor.includes(selectedShellColor))) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 应用高级筛选中的蛋黄类型筛选
|
|
|
|
|
|
if (this.data.advancedFilters.yolkType !== 'all') { |
|
|
|
|
|
const selectedYolkType = this.data.advancedFilters.yolkType |
|
|
|
|
|
filtered = filtered.filter(item => item.isAd || (item.yolk && item.yolk.includes(selectedYolkType))) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 应用高级筛选中的规格筛选
|
|
|
|
|
|
if (this.data.advancedFilters.specification !== 'all') { |
|
|
|
|
|
const selectedSpecification = this.data.advancedFilters.specification |
|
|
|
|
|
filtered = filtered.filter(item => item.isAd || ((item.specification || item.spec) && (item.specification || item.spec).includes(selectedSpecification))) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 应用高级筛选中的商品名称筛选
|
|
|
|
|
|
if (this.data.advancedFilters.productName !== 'all') { |
|
|
|
|
|
const selectedProductName = this.data.advancedFilters.productName |
|
|
|
|
|
filtered = filtered.filter(item => item.isAd || (item.productName && item.productName.includes(selectedProductName))) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 去重处理 - 确保返回的商品列表中没有重复的商品
|
|
|
// 去重处理 - 确保返回的商品列表中没有重复的商品
|
|
|
const uniqueGoodsMap = new Map(); |
|
|
const uniqueGoodsMap = new Map(); |
|
|
filtered.forEach(item => { |
|
|
filtered.forEach(item => { |
|
|
@ -2031,7 +2055,7 @@ Page({ |
|
|
const region = e.currentTarget.dataset.region; |
|
|
const region = e.currentTarget.dataset.region; |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
'advancedFilters.region': region, |
|
|
'advancedFilters.region': region, |
|
|
showRegionPicker: false |
|
|
showAdvancedRegionPicker: false |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
@ -2058,7 +2082,7 @@ Page({ |
|
|
showYolkTypePicker: false, |
|
|
showYolkTypePicker: false, |
|
|
showSpecificationPicker: false, |
|
|
showSpecificationPicker: false, |
|
|
showProductNamePicker: false, |
|
|
showProductNamePicker: false, |
|
|
showRegionPicker: false |
|
|
showAdvancedRegionPicker: false |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
@ -2069,7 +2093,7 @@ Page({ |
|
|
showShellColorPicker: false, |
|
|
showShellColorPicker: false, |
|
|
showSpecificationPicker: false, |
|
|
showSpecificationPicker: false, |
|
|
showProductNamePicker: false, |
|
|
showProductNamePicker: false, |
|
|
showRegionPicker: false |
|
|
showAdvancedRegionPicker: false |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
@ -2080,7 +2104,7 @@ Page({ |
|
|
showShellColorPicker: false, |
|
|
showShellColorPicker: false, |
|
|
showYolkTypePicker: false, |
|
|
showYolkTypePicker: false, |
|
|
showProductNamePicker: false, |
|
|
showProductNamePicker: false, |
|
|
showRegionPicker: false |
|
|
showAdvancedRegionPicker: false |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
@ -2091,14 +2115,14 @@ Page({ |
|
|
showShellColorPicker: false, |
|
|
showShellColorPicker: false, |
|
|
showYolkTypePicker: false, |
|
|
showYolkTypePicker: false, |
|
|
showSpecificationPicker: false, |
|
|
showSpecificationPicker: false, |
|
|
showRegionPicker: false |
|
|
showAdvancedRegionPicker: false |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 切换地区下拉菜单
|
|
|
// 切换地区下拉菜单
|
|
|
toggleRegionPicker: function () { |
|
|
toggleRegionPicker: function () { |
|
|
this.setData({ |
|
|
this.setData({ |
|
|
showRegionPicker: !this.data.showRegionPicker, |
|
|
showAdvancedRegionPicker: !this.data.showAdvancedRegionPicker, |
|
|
showShellColorPicker: false, |
|
|
showShellColorPicker: false, |
|
|
showYolkTypePicker: false, |
|
|
showYolkTypePicker: false, |
|
|
showSpecificationPicker: false, |
|
|
showSpecificationPicker: false, |
|
|
|