Authored by runner

newsale filter-age

... ... @@ -586,6 +586,13 @@ exports.handleSaleFilterData = (origin, params) => {
handleCheckedData(params, dest.size, 'size'));
}
// 年龄处理

dest.ageLevel = origin.ageLevel;
_.forEach(dest.ageLevel, item => {
item.href = handleFilterUrl(params, {age_level: item.id});
item.checked = params.age_level === item.id;
})
// 清除所有选中数据
let remainParams = {};
... ... @@ -608,6 +615,10 @@ exports.handleSaleFilterData = (origin, params) => {
dest.checkedConditions.conditions = _.union(dest.checkedConditions.conditions,
handleCheckedData(params, dest.price, 'price'));
// 处理价格筛选数据
dest.checkedConditions.conditions = _.union(dest.checkedConditions.conditions,
handleCheckedData(params, dest.ageLevel, 'age_level'));
return dest;
};
... ...
... ... @@ -49,6 +49,20 @@
</div>
{{/if}}
{{#if ageLevel}}
<div class="channel section">
<span class="title">性别:</span>
<div class="attr-content clearfix">
{{#each ageLevel}}
<a class="attr {{#if checked}}checked{{/if}}" href="{{href}}">
{{name}}
</a>
{{/each}}
</div>
</div>
{{/if}}
{{#if sort}}
<div class="sort section">
<span class="title">分类:</span>
... ...