|
|
<template>
|
|
|
<div>
|
|
|
<LayoutApp :show-back="true">
|
|
|
<div class="filter">
|
|
|
<div class="filter-tab">
|
|
|
<div class="tab-item" :class="selectedType === 2 && 'selected-tab'" @click="pressType(2)">人气</div>
|
|
|
<div class="tab-item middle" :class="selectedType === 1 && 'selected-tab'" @click="pressType(1)">
|
|
|
<span>价格</span>
|
|
|
<div :class="arrowImage"></div>
|
|
|
<LayoutApp :show-back="true">
|
|
|
<div class="filter">
|
|
|
<div class="filter-tab">
|
|
|
<div class="tab-item" :class="selectedType === 2 && 'selected-tab'" @click="pressType(2)">人气</div>
|
|
|
<div class="tab-item middle" :class="selectedType === 1 && 'selected-tab'" @click="pressType(1)">
|
|
|
<span>价格</span>
|
|
|
<div :class="arrowImage"></div>
|
|
|
</div>
|
|
|
<div class="tab-item" :class="selectedType === 3 && 'selected-tab'" @click="pressType(3)">新品</div>
|
|
|
</div>
|
|
|
<div class="middle">
|
|
|
<div class="screen middle" @click="goFilter()">
|
|
|
<div class="screen-img"></div>
|
|
|
筛选
|
|
|
</div>
|
|
|
<div class="search-img" @click="goSearch()"></div>
|
|
|
</div>
|
|
|
<div class="tab-item" :class="selectedType === 3 && 'selected-tab'" @click="pressType(3)">新品</div>
|
|
|
</div>
|
|
|
<div class="screen middle" @click="goFilter()">
|
|
|
<div class="screen-img"></div>
|
|
|
筛选
|
|
|
</div>
|
|
|
</div>
|
|
|
<Scroll :options="scrollOptions"
|
|
|
:data="productList.list"
|
|
|
@pulling-up="onPullingUp">
|
|
|
<ProductList :list="productList.list"></ProductList>
|
|
|
</Scroll>
|
|
|
</LayoutApp>
|
|
|
<Filtrate ref="filtrate"></Filtrate>
|
|
|
<Scroll class="product-list"
|
|
|
:options="scrollOptions"
|
|
|
:data="productList.list"
|
|
|
@pulling-up="onPullingUp">
|
|
|
<ProductList :list="productList.list"></ProductList>
|
|
|
</Scroll>
|
|
|
</LayoutApp>
|
|
|
<Filtrate ref="filtrate"></Filtrate>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
...
|
...
|
@@ -56,15 +60,16 @@ export default { |
|
|
listType: 1
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
|
|
|
activated() {
|
|
|
this.changeArrow();
|
|
|
let params = this.$route.params;
|
|
|
let params = this.$route.query;
|
|
|
|
|
|
if (Object.keys(params).length && params.listType) {
|
|
|
this.listType = params.listType;
|
|
|
}
|
|
|
this.fetchProductList({listType: this.listType, isReset: true});
|
|
|
this.fetchFilterData();
|
|
|
this.fetchProductList({...params, isReset: true});
|
|
|
this.fetchFilterData(params);
|
|
|
|
|
|
},
|
|
|
methods: {
|
...
|
...
|
@@ -109,6 +114,11 @@ export default { |
|
|
this.fetchProductList(params);
|
|
|
this.changeArrow();
|
|
|
},
|
|
|
goSearch() {
|
|
|
this.$router.push({
|
|
|
name: 'Search',
|
|
|
});
|
|
|
},
|
|
|
changeArrow() {
|
|
|
this.arrowImage = (this.selectedType === 3 || this.selectedType === 2) ? 'price-arrow' :
|
|
|
this.priceDesc ? 'desc-arrow' : 'asc-arrow';
|
...
|
...
|
@@ -144,7 +154,6 @@ export default { |
|
|
}
|
|
|
|
|
|
.selected-tab {
|
|
|
font-size: 40px;
|
|
|
color: #000;
|
|
|
font-weight: bold;
|
|
|
}
|
...
|
...
|
@@ -157,6 +166,7 @@ export default { |
|
|
font-size: 32px;
|
|
|
color: #000;
|
|
|
letter-spacing: 0;
|
|
|
margin-right: 24px;
|
|
|
}
|
|
|
|
|
|
.middle {
|
...
|
...
|
@@ -191,4 +201,16 @@ export default { |
|
|
background: url(~statics/image/list/filter@3x.png) no-repeat;
|
|
|
background-size: cover;
|
|
|
}
|
|
|
|
|
|
.product-list {
|
|
|
background: #f5f5f5;
|
|
|
}
|
|
|
|
|
|
.search-img {
|
|
|
width: 40px;
|
|
|
height: 40px;
|
|
|
margin-left: 20px;
|
|
|
background: url(~statics/image/list/search_icon@3x.png) no-repeat;
|
|
|
background-size: cover;
|
|
|
}
|
|
|
</style> |
...
|
...
|
|