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

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

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

Loading…
Cancel
Save