...
|
...
|
@@ -4,17 +4,19 @@ |
|
|
<li class="type-item" @click="toggleRec">{{activeSort.text}}<i class="icon" :class="recClass"></i></li>
|
|
|
<li class="type-item" @click="toggleFilter">筛选<i class="icon" :class="filterClass"></i></li>
|
|
|
</ul>
|
|
|
<div class="recommend-detail" v-show="!recDown">
|
|
|
<ul class="rec-items">
|
|
|
<li v-for="item in recItems" class="item"
|
|
|
<div class="rec-detail" v-show="!recDown">
|
|
|
<ul class="re-items">
|
|
|
<li v-for="item in recItems" class="re-item"
|
|
|
:class="{active: activeSort.text === item.text}" @click="sortChange(item)">{{item.text}}</li>
|
|
|
</ul>
|
|
|
</div>
|
|
|
<div class="recommend-detail" v-show="!filterDown">
|
|
|
<ul class="rec-items">
|
|
|
<li class="item">价格从高到低</li>
|
|
|
<li class="item">价格从低到高</li>
|
|
|
</ul>
|
|
|
<div class="filter-detail" v-show="!filterDown">
|
|
|
<filter-item v-for="item in filterItems" :name="item.name" :choices="item.choices"></filter-item>
|
|
|
<div class="action">
|
|
|
<p class="tip">您可以选择一个或多个筛选项进行筛选</p>
|
|
|
<a class="action-btn filter-btn">筛选</a>
|
|
|
<a class="action-btn clear-btn">清空</a>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
...
|
...
|
@@ -23,7 +25,8 @@ const bus = require('common/vue-bus'); |
|
|
|
|
|
module.exports = {
|
|
|
props: {
|
|
|
val: String
|
|
|
val: String,
|
|
|
filter: Object
|
|
|
},
|
|
|
data(){
|
|
|
return {
|
...
|
...
|
@@ -44,12 +47,41 @@ module.exports = { |
|
|
val: 's_p_asc'
|
|
|
}
|
|
|
],
|
|
|
filterItems: [
|
|
|
{
|
|
|
name: '品牌',
|
|
|
val: '',
|
|
|
choices: this.filter.brand
|
|
|
}, {
|
|
|
name: '品类',
|
|
|
val: '',
|
|
|
choices: this.filter.group_sort // 多级
|
|
|
}, {
|
|
|
name: '颜色',
|
|
|
val: '',
|
|
|
choices: this.filter.color
|
|
|
}, {
|
|
|
name: '尺寸',
|
|
|
val: '',
|
|
|
choices: this.filter.size
|
|
|
}, {
|
|
|
name: '价格',
|
|
|
val: '',
|
|
|
choices: this.filter.priceRange
|
|
|
}, {
|
|
|
name: '折扣',
|
|
|
val: '',
|
|
|
choices: this.filter.discount
|
|
|
}
|
|
|
],
|
|
|
activeSort: {
|
|
|
text: '推荐',
|
|
|
order: ''
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
},
|
|
|
computed: {
|
|
|
recClass(){
|
|
|
return {
|
...
|
...
|
@@ -92,13 +124,13 @@ module.exports = { |
|
|
this.recDown = true;
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
},
|
|
|
components: {}
|
|
|
components: {
|
|
|
filterItem: require('./filter-item.vue')
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
<style>
|
|
|
@import "../../../scss/common/_color.css";
|
|
|
@import "../../../../scss/common/_color.css";
|
|
|
|
|
|
.top-filter {
|
|
|
position: relative;
|
...
|
...
|
@@ -136,27 +168,138 @@ module.exports = { |
|
|
}
|
|
|
}
|
|
|
|
|
|
.recommend-detail {
|
|
|
.rec-detail {
|
|
|
position: absolute;
|
|
|
top: 81px;
|
|
|
left: 0;
|
|
|
right: 0;
|
|
|
}
|
|
|
|
|
|
.rec-items {
|
|
|
.item {
|
|
|
.re-item {
|
|
|
height: 90px;
|
|
|
color: $black;
|
|
|
font-size: 32px;
|
|
|
text-align: center;
|
|
|
line-height: 89px;
|
|
|
border-bottom: 1px solid #eee;
|
|
|
background-color: #fff;
|
|
|
border-bottom: 1px solid #eee;
|
|
|
|
|
|
&.active {
|
|
|
background: $grey;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
.filter-detail {
|
|
|
position: absolute;
|
|
|
top: 81px;
|
|
|
left: 0;
|
|
|
right: 0;
|
|
|
height: 950px;
|
|
|
background-color: #fff;
|
|
|
|
|
|
.ft-item {
|
|
|
color: $black;
|
|
|
border-bottom: 1px solid #eee;
|
|
|
|
|
|
.title {
|
|
|
height: 89px;
|
|
|
padding: 0 30px;
|
|
|
font-size: 32px;
|
|
|
line-height: 89px;
|
|
|
}
|
|
|
|
|
|
.t-val {
|
|
|
float: right;
|
|
|
max-width: 280px;
|
|
|
font-size: 24px;
|
|
|
margin-right: 10px;
|
|
|
}
|
|
|
|
|
|
.t-text {
|
|
|
float: left;
|
|
|
}
|
|
|
|
|
|
.t-icon {
|
|
|
float: right;
|
|
|
margin-top: 28px;
|
|
|
font-size: 24px;
|
|
|
font-weight: bold;
|
|
|
}
|
|
|
|
|
|
.choices {
|
|
|
padding: 0 30px;
|
|
|
overflow: hidden;
|
|
|
}
|
|
|
|
|
|
.choice {
|
|
|
position: relative;
|
|
|
float: left;
|
|
|
height: 50px;
|
|
|
width: 150px;
|
|
|
padding: 0 5px;
|
|
|
margin-left: 30px;
|
|
|
margin-bottom: 30px;
|
|
|
font-size: 24px;
|
|
|
line-height: 48px;
|
|
|
text-align: center;
|
|
|
border: 1px solid #000;
|
|
|
|
|
|
&:nth-child(4n+1) {
|
|
|
margin-left: 0;
|
|
|
}
|
|
|
|
|
|
&.active {
|
|
|
color: #fff;
|
|
|
background-color: #000;
|
|
|
|
|
|
&:after {
|
|
|
content: '';
|
|
|
width: 22px;
|
|
|
height: 22px;
|
|
|
top: 24px;
|
|
|
right: 0;
|
|
|
position: absolute;
|
|
|
display: inline-block;
|
|
|
background: resolve("product/active-mark.png");
|
|
|
background-size: cover;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
.action {
|
|
|
padding: 0 30px;
|
|
|
|
|
|
.tip {
|
|
|
padding-top: 65px;
|
|
|
color: #000;
|
|
|
font-size: 24px;
|
|
|
text-align: center;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
.action-btn {
|
|
|
display: block;
|
|
|
font-size: 28px;
|
|
|
text-align: center;
|
|
|
|
|
|
&.filter-btn {
|
|
|
margin-top: 30px;
|
|
|
color: #fff;
|
|
|
line-height: 100px;
|
|
|
background-color: #000;
|
|
|
}
|
|
|
|
|
|
&.clear-btn {
|
|
|
margin: 50px auto 100px;
|
|
|
width: 140px;
|
|
|
color: #000;
|
|
|
line-height: 48px;
|
|
|
background-color: #fff;
|
|
|
border: 1px solid #000;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</style> |
...
|
...
|
|