...
|
...
|
@@ -96,27 +96,28 @@ const helpers = { |
|
|
* @param sorts
|
|
|
* @returns {Array}
|
|
|
*/
|
|
|
getSortNav(sort, sorts) {
|
|
|
getSortNav(msort, misort, sorts) {
|
|
|
let nav = [];
|
|
|
let sortQuery = '?';
|
|
|
|
|
|
if (sort && sorts) {
|
|
|
if (msort && sorts) {
|
|
|
sorts.forEach(s => {
|
|
|
if (s.relationParameter.sort === sort) {
|
|
|
if (s.categoryId === msort) {
|
|
|
sortQuery += 'msort=' + msort;
|
|
|
s.checked = true;
|
|
|
nav.push({
|
|
|
link: '#',
|
|
|
link: sortQuery,
|
|
|
pathTitle: '',
|
|
|
name: s.categoryName
|
|
|
});
|
|
|
} else if (s.sub) {
|
|
|
}
|
|
|
if (s.sub && misort) {
|
|
|
s.sub.forEach(m => {
|
|
|
if (m.relationParameter.sort === sort) {
|
|
|
nav.push({
|
|
|
link: '#',
|
|
|
pathTitle: '',
|
|
|
name: s.categoryName
|
|
|
});
|
|
|
if (m.categoryId === misort) {
|
|
|
sortQuery += '&misort=' + misort;
|
|
|
m.checked = true;
|
|
|
nav.push({
|
|
|
link: '#',
|
|
|
link: sortQuery,
|
|
|
pathTitle: '',
|
|
|
name: m.categoryName
|
|
|
});
|
...
|
...
|
@@ -143,6 +144,16 @@ const helpers = { |
|
|
};
|
|
|
},
|
|
|
|
|
|
sortConvert(sorts) {
|
|
|
return _.map(sorts, s => {
|
|
|
return {
|
|
|
categoryId: s.sortId,
|
|
|
categoryName: s.sortName,
|
|
|
sub: helpers.sortConvert(s.sub)
|
|
|
};
|
|
|
});
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 筛选器数据处理
|
|
|
* @param filter
|
...
|
...
|
@@ -160,6 +171,7 @@ const helpers = { |
|
|
let filters = [];
|
|
|
let customPriceLow = '';
|
|
|
let customPriceHigh = '';
|
|
|
let showSize = (!!q.sort || !!q.misort);
|
|
|
|
|
|
genders.forEach(g => {
|
|
|
if (g.value === q.gender) {
|
...
|
...
|
@@ -222,6 +234,7 @@ const helpers = { |
|
|
}
|
|
|
|
|
|
if (q.size) {
|
|
|
showSize = false;
|
|
|
sizeInfo.forEach(s => {
|
|
|
if (s.sizeId === parseInt(q.size, 10)) {
|
|
|
s.checked = true;
|
...
|
...
|
@@ -270,9 +283,9 @@ const helpers = { |
|
|
letters: this.brandLetters(),
|
|
|
customPriceLow: customPriceLow,
|
|
|
customPriceHigh: customPriceHigh,
|
|
|
showSize: !!q.sort,
|
|
|
showSize: showSize,
|
|
|
showPrice: true,
|
|
|
nav: this.getSortNav(q.sort, sorts)
|
|
|
nav: this.getSortNav(q.msort, q.misort, sorts)
|
|
|
};
|
|
|
},
|
|
|
|
...
|
...
|
|