...
|
...
|
@@ -18,8 +18,13 @@ |
|
|
</div>
|
|
|
<div class="filter-detail" v-show="!filterDown">
|
|
|
<div class="filter-items">
|
|
|
<filter-item v-for="item in filterItems" :key="item.name" :name="item.name" :choices="item.choices"
|
|
|
v-if="item.choices.length"></filter-item>
|
|
|
<filter-item
|
|
|
v-for="item in filterItems"
|
|
|
:key="item.name"
|
|
|
:name="item.name"
|
|
|
:single="item.single"
|
|
|
:choices="item.choices"
|
|
|
v-if="item.choices.length"></filter-item>
|
|
|
</div>
|
|
|
<div class="action">
|
|
|
<p class="tip">您可以选择一个或多个筛选项进行筛选</p>
|
...
|
...
|
@@ -43,6 +48,7 @@ import FilterSub from './filter-sub.vue'; |
|
|
let locationQuery = qs(decodeURIComponent(location.search.replace(/^\?/, '')));
|
|
|
|
|
|
const convertMap = {
|
|
|
gender: 'gender',
|
|
|
brand: 'brand',
|
|
|
group_sort: 'sort',
|
|
|
color: 'color',
|
...
|
...
|
@@ -90,6 +96,10 @@ export default { |
|
|
],
|
|
|
filterItems: [
|
|
|
{
|
|
|
name: '性别',
|
|
|
single: true,
|
|
|
choices: []
|
|
|
}, {
|
|
|
name: '品牌',
|
|
|
choices: []
|
|
|
}, {
|
...
|
...
|
@@ -326,12 +336,13 @@ export default { |
|
|
_.each(this.filter.group_sort, item => {
|
|
|
temp = temp.concat(item.sub);
|
|
|
});
|
|
|
this.filterItems[1].choices = temp;
|
|
|
this.filterItems[0].choices = this.filter.brand || [];
|
|
|
this.filterItems[2].choices = this.filter.color || [];
|
|
|
this.filterItems[3].choices = this.filter.size || [];
|
|
|
this.filterItems[4].choices = this.filter.priceRange || [];
|
|
|
this.filterItems[5].choices = this.filter.discount || [];
|
|
|
this.filterItems[0].choices = [{id: 1, name: '男'}, {id: 2, name: '女'}];
|
|
|
this.filterItems[1].choices = this.filter.brand || [];
|
|
|
this.filterItems[2].choices = temp;
|
|
|
this.filterItems[3].choices = this.filter.color || [];
|
|
|
this.filterItems[4].choices = this.filter.size || [];
|
|
|
this.filterItems[5].choices = this.filter.priceRange || [];
|
|
|
this.filterItems[6].choices = this.filter.discount || [];
|
|
|
|
|
|
bus.$on('subChosen.change', this.subChosenChange);
|
|
|
bus.$on('expand.choice.only', name => {
|
...
|
...
|
|