添加了 分类的搜索
This commit is contained in:
parent
839b1728f0
commit
97c9774cc4
@ -86,11 +86,12 @@ export default {
|
||||
return vm.$u.post('Goods/getGoodsClassRecommend');
|
||||
},
|
||||
// goodsListByClassId
|
||||
goodsListByClassId({ gc_id, page, order }) {
|
||||
goodsListByClassId({ gc_id, page, order, keyword }) {
|
||||
return vm.$u.post('goods/goodsListByClassId', {
|
||||
gc_id: gc_id,
|
||||
page: page,
|
||||
order: order,
|
||||
keyword:keyword
|
||||
});
|
||||
},
|
||||
// 商品推荐
|
||||
|
@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<view class="classify-goods">
|
||||
<u-search style="padding: 0 30rpx" placeholder="日照香炉生紫烟" v-model="keyword" @search="select" @custom="select"></u-search>
|
||||
<view class="tab-container">
|
||||
<view class="salenum" :class="{ 'current' : current == 0 }" @click="switchCurrent(0)">销量</view>
|
||||
<view class="price" :class="{ 'current' : current == 1 }" @click="switchCurrent(1)">
|
||||
@ -42,6 +43,8 @@ export default {
|
||||
scrollHeight: '',
|
||||
loadStatus: 'loadmore',
|
||||
timer: true, // 防止上拉加载短时间内多次调用
|
||||
keyword:"",
|
||||
sel:""
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -80,6 +83,7 @@ export default {
|
||||
gc_id: this.cid,
|
||||
page: this.page,
|
||||
order: sort,
|
||||
keyword:this.sel
|
||||
})
|
||||
this.timer = true;
|
||||
if(res.errCode == 0) {
|
||||
@ -123,6 +127,11 @@ export default {
|
||||
id: id,
|
||||
type: 1 // 商品详情 商品类型 1普通 2拼团 3秒杀 4优惠券
|
||||
});
|
||||
},
|
||||
select(){
|
||||
this.sel = this.keyword;
|
||||
this.page = 1;
|
||||
this.goodsListByClassId({ laod: 'reload' });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user