三单列表页添加搜索排序字段

master
santaner 11 months ago
parent c2e4bc78ed
commit 666b1f696a
  1. 97
      pages/columnGoods/goods_area_list/index.vue

@ -15,13 +15,11 @@
</view>
<view class="nav-wrapper">
<view class='nav acea-row row-middle'>
<view class='item' @click="downStatus = !downStatus" :class="{'t-color':downKey>0 && firstKey == 0}">
{{downMenu[downKey].title}}
<text v-if="!downStatus" class="iconfont icon-xiala1 spin"></text>
<text v-else class="iconfont icon-xiala1"></text>
</view>
<view class='item' :class="{'t-color':firstKey == 3}" @click='set_where(3)'>
销量
上架
<image v-if="time==1" :src="domain+'/static/diy/up'+keyColor+'.png'"></image>
<image v-else-if="time==2" :src="domain+'/static/diy/down'+keyColor+'.png'"></image>
<image v-else src='/static/images/horn.png'></image>
</view>
<view class='item' :class="{'t-color':firstKey == 2}" @click='set_where(2)'>
价格
@ -29,11 +27,6 @@
<image v-else-if="price==2" :src="domain+'/static/diy/down'+keyColor+'.png'"></image>
<image v-else src='/static/images/horn.png'></image>
</view>
<!-- down -->
<view class='item' :class="{'t-color':firstKey == 4}" @click='bindRight'>
筛选
<text class="iconfont icon-shaixuan"></text>
</view>
</view>
</view>
<!-- 商品 -->
@ -173,10 +166,13 @@
// price_off: '',
// brand_id: '',
// keyword:'',
priceSort:'',
timeSort:'',
page:1,
limit:10
},
price: 0,
time: 0,
stock: 0,
nows: false,
loadend: false,
@ -289,38 +285,38 @@
this.storeMerchantList()
},
//
bindRight(){
this.price = 0;
this.firstKey = 4
this.getBrandlist()
// bindRight(){
// this.price = 0;
// this.firstKey = 4
// this.getBrandlist()
},
// },
//
getBrandlist(){
let temp = []
getBrandlist({
// cate_pid:this.where.cate_pid,
keyword:this.where.keyword
}).then(res=>{
temp = res.data.list.map(item=>{
return {
...item,
check:false
}
})
if(this.where.brand_id.length>0){
this.where.brand_id.forEach((ids,index)=>{
temp.forEach(el=>{
if(ids == el.brand_id){
el.check = true
}
})
})
}
this.brandList = temp
this.rightBox = true
})
},
// getBrandlist(){
// let temp = []
// getBrandlist({
// // cate_pid:this.where.cate_pid,
// keyword:this.where.keyword
// }).then(res=>{
// temp = res.data.list.map(item=>{
// return {
// ...item,
// check:false
// }
// })
// if(this.where.brand_id.length>0){
// this.where.brand_id.forEach((ids,index)=>{
// temp.forEach(el=>{
// if(ids == el.brand_id){
// el.check = true
// }
// })
// })
// }
// this.brandList = temp
// this.rightBox = true
// })
// },
//
godDetail(item) {
goShopDetail(item, this.uid).then(res => {
@ -429,13 +425,13 @@
this.firstKey = e
if (this.price == 0){
this.price = 1;
this.where.order = 'price_asc'
this.where.priceSort = 1;
}else if (this.price == 1){
this.price = 2;
this.where.order = 'price_desc'
this.where.priceSort = 2;
}else if (this.price == 2){
this.price = 0;
this.where.order = ''
this.where.priceSort = ''
}
this.$set(this.where, 'page', 1)
this.get_product_list(true);
@ -443,10 +439,19 @@
case 3:
this.price = 0;
this.loadend = false;
this.$set(this.where, 'order', 'sales')
if (this.time == 0){
this.time = 1;
this.where.timeSort = 1;
}else if (this.time == 1){
this.time = 2;
this.where.timeSort = 2;
}else if (this.time == 2){
this.time = 0;
this.where.timeSort = ''
}
this.$set(this.where, 'page', 1)
this.get_product_list(true);
this.firstKey = e
break;
}
this.loadend = false;

Loading…
Cancel
Save