|
@@ -334,7 +334,7 @@ class FilterTools { |
|
@@ -334,7 +334,7 @@ class FilterTools { |
334
|
let {baseUrl, origin, params} = this;
|
334
|
let {baseUrl, origin, params} = this;
|
335
|
const filter = _.get(origin, 'filter', {});
|
335
|
const filter = _.get(origin, 'filter', {});
|
336
|
|
336
|
|
337
|
- if (!filter.brand.length) {
|
337
|
+ if (!filter.brand || !filter.brand.length) {
|
338
|
return false;
|
338
|
return false;
|
339
|
}
|
339
|
}
|
340
|
const brands = [];
|
340
|
const brands = [];
|
|
@@ -586,26 +586,28 @@ const handleOptSortData = (params, filter, baseUrl) => { |
|
@@ -586,26 +586,28 @@ const handleOptSortData = (params, filter, baseUrl) => { |
586
|
}];
|
586
|
}];
|
587
|
const checks = [];
|
587
|
const checks = [];
|
588
|
|
588
|
|
589
|
- if (filter.new || params.new === 'Y') {
|
|
|
590
|
- checks.push({
|
|
|
591
|
- name: '新品',
|
|
|
592
|
- checked: params.new === 'Y',
|
|
|
593
|
- href: handleFilterUrl(baseUrl, params, {new: 'Y'}, params.new === 'Y' ? {new: true} : {})
|
|
|
594
|
- });
|
|
|
595
|
- }
|
|
|
596
|
- if (filter.specialoffer || params.specialoffer === 'Y') {
|
|
|
597
|
- checks.push({
|
|
|
598
|
- name: '打折',
|
|
|
599
|
- checked: params.specialoffer === 'Y',
|
|
|
600
|
- href: handleFilterUrl(baseUrl, params, {specialoffer: 'Y'}, params.specialoffer === 'Y' ? {specialoffer: true} : {}) // eslint-disable-line
|
|
|
601
|
- });
|
|
|
602
|
- }
|
|
|
603
|
- if (filter.limited || params.limited === 'Y') {
|
|
|
604
|
- checks.push({
|
|
|
605
|
- name: '限量',
|
|
|
606
|
- checked: params.limited === 'Y',
|
|
|
607
|
- href: handleFilterUrl(baseUrl, params, {limited: 'Y'}, params.limited === 'Y' ? {limited: true} : {})
|
|
|
608
|
- });
|
589
|
+ if (filter) {
|
|
|
590
|
+ if (filter.new || params.new === 'Y') {
|
|
|
591
|
+ checks.push({
|
|
|
592
|
+ name: '新品',
|
|
|
593
|
+ checked: params.new === 'Y',
|
|
|
594
|
+ href: handleFilterUrl(baseUrl, params, {new: 'Y'}, params.new === 'Y' ? {new: true} : {})
|
|
|
595
|
+ });
|
|
|
596
|
+ }
|
|
|
597
|
+ if (filter.specialoffer || params.specialoffer === 'Y') {
|
|
|
598
|
+ checks.push({
|
|
|
599
|
+ name: '打折',
|
|
|
600
|
+ checked: params.specialoffer === 'Y',
|
|
|
601
|
+ href: handleFilterUrl(baseUrl, params, {specialoffer: 'Y'}, params.specialoffer === 'Y' ? {specialoffer: true} : {}) // eslint-disable-line
|
|
|
602
|
+ });
|
|
|
603
|
+ }
|
|
|
604
|
+ if (filter.limited || params.limited === 'Y') {
|
|
|
605
|
+ checks.push({
|
|
|
606
|
+ name: '限量',
|
|
|
607
|
+ checked: params.limited === 'Y',
|
|
|
608
|
+ href: handleFilterUrl(baseUrl, params, {limited: 'Y'}, params.limited === 'Y' ? {limited: true} : {})
|
|
|
609
|
+ });
|
|
|
610
|
+ }
|
609
|
}
|
611
|
}
|
610
|
return {sortType, checks};
|
612
|
return {sortType, checks};
|
611
|
};
|
613
|
};
|