diff --git a/common/api/shop.js b/common/api/shop.js index 34f4a3a..e6af33f 100644 --- a/common/api/shop.js +++ b/common/api/shop.js @@ -172,6 +172,12 @@ export default { goods_id: id }); }, + // 商品搜索 + ShopSearch({keyword,page = 1,order = 'goods_salenum'}){ + return vm.$u.post('ShopSearch/search',{ + keyword,page,order + }) + }, // 秒杀推荐 recommendedSpike() { return vm.$u.post('Spike/recommendedSpike'); diff --git a/pageB/components/search/shop.vue b/pageB/components/search/shop.vue index bbd42b0..9b4427e 100644 --- a/pageB/components/search/shop.vue +++ b/pageB/components/search/shop.vue @@ -1,9 +1,9 @@ @@ -14,6 +14,12 @@ export default { return { } + }, + props:['name','advword','id','image'], + methods:{ + tap(){ + this.$emit("tap",{id:this.id}) + } } } diff --git a/pageB/search/out.vue b/pageB/search/out.vue index f50b8ca..46f05a7 100644 --- a/pageB/search/out.vue +++ b/pageB/search/out.vue @@ -10,10 +10,6 @@ - - - - @@ -25,17 +21,42 @@ - - 销量 - - 价格 - - - + + + 销量 + + 价格 + + + + + 好评 - 好评 + + + + + + + + + + + + + + + + + + + D + + + + @@ -137,9 +158,11 @@ export default { current: 0, swiperCurrent: 0, keyword:"", - type:"" + type:"", + shoplist:[] } - }, methods: { + }, + methods: { tabsChange(index) { this.swiperCurrent = index; }, @@ -155,11 +178,21 @@ export default { }, sx(type){ console.log(type) + + }, + huadong(e){ + console.log(e.detail.current) + }, + search(){ + this.$u.api.ShopSearch({keyword:this.keyword}).then((res)=>{ + this.shoplist[0] = res.data.data + }) } }, onLoad(o){ this.type = o.type this.keyword = o.value + this.search() } } \ No newline at end of file