...
|
...
|
@@ -43,13 +43,17 @@ const helpers = { |
|
|
},
|
|
|
|
|
|
colorConvert(colors) {
|
|
|
return colors.map((c) => {
|
|
|
return {
|
|
|
id: c.colorId,
|
|
|
title: c.colorName,
|
|
|
rgb: c.colorValue ? `url(${c.colorValue})` : '#' + c.colorCode
|
|
|
};
|
|
|
});
|
|
|
if (colors) {
|
|
|
return colors.map((c) => {
|
|
|
return {
|
|
|
id: c.colorId,
|
|
|
title: c.colorName,
|
|
|
rgb: c.colorValue ? `url(${c.colorValue})` : '#' + c.colorCode
|
|
|
};
|
|
|
});
|
|
|
} else {
|
|
|
return [];
|
|
|
}
|
|
|
},
|
|
|
|
|
|
getChannelNav() {
|
...
|
...
|
@@ -119,32 +123,43 @@ const helpers = { |
|
|
|
|
|
let matchPrice = false;
|
|
|
|
|
|
priceRange = Object.keys(priceRange).map((k) => {
|
|
|
let prices = k.split(',');
|
|
|
let p = {
|
|
|
lower: prices[0],
|
|
|
higher: prices[1]
|
|
|
};
|
|
|
if (priceRange) {
|
|
|
priceRange = Object.keys(priceRange).map((k) => {
|
|
|
let prices = k.split(',');
|
|
|
let p = {
|
|
|
lower: prices[0],
|
|
|
higher: prices[1]
|
|
|
};
|
|
|
|
|
|
if (k === q.price) {
|
|
|
p.checked = true;
|
|
|
matchPrice = true;
|
|
|
filters.push(this.newFilter('price', q.price, `¥${prices[0]}-¥${prices[1]}`));
|
|
|
}
|
|
|
return p;
|
|
|
}).sort((a, b) => {
|
|
|
return a.lower - b.lower;
|
|
|
});
|
|
|
|
|
|
if (k === q.price) {
|
|
|
p.checked = true;
|
|
|
matchPrice = true;
|
|
|
}
|
|
|
return p;
|
|
|
}).sort((a, b) => {
|
|
|
return a.lower - b.lower;
|
|
|
});
|
|
|
if (!matchPrice && q.price) {
|
|
|
let prices = q.price.split(',');
|
|
|
let priceTxt = `¥${prices[0]}-¥${prices[1]}`;
|
|
|
|
|
|
customPriceLow = prices[0];
|
|
|
customPriceHigh = prices[1];
|
|
|
|
|
|
if (!matchPrice && q.price) {
|
|
|
let prices = q.price.split(',');
|
|
|
if (prices[1] === Number.MAX_SAFE_INTEGER.toString()) {
|
|
|
priceTxt = `大于¥${prices[0]}`;
|
|
|
customPriceHigh = '';
|
|
|
}
|
|
|
|
|
|
filters.push(this.newFilter('price', q.price, `¥${prices[0]}-¥${prices[1]}`));
|
|
|
customPriceLow = prices[0];
|
|
|
customPriceHigh = prices[1];
|
|
|
filters.push(this.newFilter('price', q.price, priceTxt));
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
if (!_.isArray(sizeInfo)) {
|
|
|
if (!_.isArray(sizeInfo) && sizeInfo) {
|
|
|
sizeInfo.checked = true;
|
|
|
sizeInfo = [sizeInfo];
|
|
|
}
|
...
|
...
|
@@ -197,6 +212,7 @@ const helpers = { |
|
|
customPriceLow: customPriceLow,
|
|
|
customPriceHigh: customPriceHigh,
|
|
|
showSize: !!q.sort,
|
|
|
showPrice: true,
|
|
|
nav: this.getSortNav(q.sort, sorts)
|
|
|
};
|
|
|
},
|
...
|
...
|
|