...
|
...
|
@@ -334,7 +334,7 @@ class FilterTools { |
|
|
let {baseUrl, origin, params} = this;
|
|
|
const filter = _.get(origin, 'filter', {});
|
|
|
|
|
|
if (!filter.brand.length) {
|
|
|
if (!filter.brand || !filter.brand.length) {
|
|
|
return false;
|
|
|
}
|
|
|
const brands = [];
|
...
|
...
|
@@ -586,26 +586,28 @@ const handleOptSortData = (params, filter, baseUrl) => { |
|
|
}];
|
|
|
const checks = [];
|
|
|
|
|
|
if (filter.new || params.new === 'Y') {
|
|
|
checks.push({
|
|
|
name: '新品',
|
|
|
checked: params.new === 'Y',
|
|
|
href: handleFilterUrl(baseUrl, params, {new: 'Y'}, params.new === 'Y' ? {new: true} : {})
|
|
|
});
|
|
|
}
|
|
|
if (filter.specialoffer || params.specialoffer === 'Y') {
|
|
|
checks.push({
|
|
|
name: '打折',
|
|
|
checked: params.specialoffer === 'Y',
|
|
|
href: handleFilterUrl(baseUrl, params, {specialoffer: 'Y'}, params.specialoffer === 'Y' ? {specialoffer: true} : {}) // eslint-disable-line
|
|
|
});
|
|
|
}
|
|
|
if (filter.limited || params.limited === 'Y') {
|
|
|
checks.push({
|
|
|
name: '限量',
|
|
|
checked: params.limited === 'Y',
|
|
|
href: handleFilterUrl(baseUrl, params, {limited: 'Y'}, params.limited === 'Y' ? {limited: true} : {})
|
|
|
});
|
|
|
if (filter) {
|
|
|
if (filter.new || params.new === 'Y') {
|
|
|
checks.push({
|
|
|
name: '新品',
|
|
|
checked: params.new === 'Y',
|
|
|
href: handleFilterUrl(baseUrl, params, {new: 'Y'}, params.new === 'Y' ? {new: true} : {})
|
|
|
});
|
|
|
}
|
|
|
if (filter.specialoffer || params.specialoffer === 'Y') {
|
|
|
checks.push({
|
|
|
name: '打折',
|
|
|
checked: params.specialoffer === 'Y',
|
|
|
href: handleFilterUrl(baseUrl, params, {specialoffer: 'Y'}, params.specialoffer === 'Y' ? {specialoffer: true} : {}) // eslint-disable-line
|
|
|
});
|
|
|
}
|
|
|
if (filter.limited || params.limited === 'Y') {
|
|
|
checks.push({
|
|
|
name: '限量',
|
|
|
checked: params.limited === 'Y',
|
|
|
href: handleFilterUrl(baseUrl, params, {limited: 'Y'}, params.limited === 'Y' ? {limited: true} : {})
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
return {sortType, checks};
|
|
|
};
|
...
|
...
|
|