优化搜索操作

master
hequan_waynaqua 4 years ago
parent c6c3709bd7
commit e9ba6c48bc

@ -49,6 +49,7 @@ export default {
isNew: false,
isHot: false,
isPrice: false,
isSales: false,
loading: false,
finished: false,
isSkeletonShow: true
@ -78,7 +79,8 @@ export default {
keyword: this.keyword,
isNew: this.isNew,
isHot: this.isHot,
isPrice: this.isPrice
isPrice: this.isPrice,
isSales: this.isSales
}).then((res) => {
const data = res.map.goods
this.list = [...this.list, ...data]
@ -107,6 +109,8 @@ export default {
} else if (val['search'] === 'price') {
this.isPrice = true
this.orderBy = val['orderBy']
} else if (val['search'] === 'isSales') {
this.isSales = true
} else if (val['search'] === 'cancelPrice') {
this.isPrice = false
this.orderBy = ''
@ -119,6 +123,7 @@ export default {
isNew: this.isNew,
isHot: this.isHot,
isPrice: this.isPrice,
isSales: this.isSales,
orderBy: this.orderBy
}).then((res) => {
const data = res.map.goods
@ -135,6 +140,8 @@ export default {
this.pageNum = 1
this.isNew = false
this.isHot = false
this.isPrice = false
this.isSales = false
this.finished = false
}
}

@ -5,7 +5,7 @@
<!-- <van-dropdown-item v-model="value2" :options="option2" />
<van-dropdown-item v-model="value3" :options="option3" /> -->
</van-dropdown-menu>
<div class="filter">
<div class="filter" @click="chageSales">
<span style="font-size:15px;margin-right:2px">销量</span>
</div>
<div class="filter" @click="changeFaIcon">
@ -55,6 +55,9 @@ export default {
this.faDefault = this.faSortDown
this.$emit('changeGoods', { search: 'price', orderBy: 'desc' })
}
},
chageSales() {
this.$emit('changeGoods', { search: 'isSales' })
}
}

Loading…
Cancel
Save