...
|
...
|
@@ -6,11 +6,11 @@ |
|
|
|
|
|
<div class="item-price-input" v-if="filter.filterId === 'price'">
|
|
|
<div class="input-wrapper">
|
|
|
<Input class="price-input" v-model="lowPrice" placeholder="输入最低价格"></Input>
|
|
|
<Input class="price-input" v-model="lowPrice" placeholder="输入最低价格" @input="onLowerPirceChange"></Input>
|
|
|
</div>
|
|
|
<div class="horizontal-line"></div>
|
|
|
<div class="input-wrapper">
|
|
|
<Input class="price-input" v-model="highPrice" placeholder="输入最高价格"></Input>
|
|
|
<Input class="price-input" v-model="highPrice" placeholder="输入最高价格" @input="onHighPirceChange"></Input>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
...
|
...
|
@@ -115,6 +115,34 @@ export default { |
|
|
|
|
|
methods: {
|
|
|
...mapActions(['']),
|
|
|
onLowerPirceChange() {
|
|
|
|
|
|
let currentPrice = this.lowPrice;
|
|
|
|
|
|
if (this.filterParams.price.length > 0) {
|
|
|
|
|
|
let priceSplit = this.filterParams.price[0].split(',');
|
|
|
let firstPrice = priceSplit[0] ? priceSplit[0] : '';
|
|
|
|
|
|
if (currentPrice !== firstPrice) {
|
|
|
this.filterParams.price = [];
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
onHighPirceChange() {
|
|
|
let currentPrice = this.highPrice;
|
|
|
|
|
|
if (this.filterParams.price.length > 0) {
|
|
|
|
|
|
let priceSplit = this.filterParams.price[0].split(',');
|
|
|
let lastPrice = priceSplit[1] ? priceSplit[1] : '';
|
|
|
|
|
|
if (currentPrice !== lastPrice) {
|
|
|
this.filterParams.price = [];
|
|
|
}
|
|
|
}
|
|
|
|
|
|
},
|
|
|
clear() {
|
|
|
let filterParams = {
|
|
|
maxSort: [],
|
...
|
...
|
@@ -125,6 +153,9 @@ export default { |
|
|
size: [],
|
|
|
};
|
|
|
|
|
|
this.lowPrice = '';
|
|
|
this.highPrice = '';
|
|
|
|
|
|
this.setFilterParam(filterParams);
|
|
|
this.setTempParam(filterParams);
|
|
|
},
|
...
|
...
|
@@ -145,6 +176,11 @@ export default { |
|
|
},
|
|
|
|
|
|
submit() {
|
|
|
// 自定义价格塞进params里
|
|
|
if (this.filterParams.price.length === 0) {
|
|
|
this.filterParams.price = [this.lowPrice, this.highPrice];
|
|
|
}
|
|
|
|
|
|
let params = {
|
|
|
maxSort: this.filterParams.maxSort.join(','),
|
|
|
brand: this.filterParams.brand.join(','),
|
...
|
...
|
|