From 33e89421807e1b7ae4da2dd0a07b11fe843f13ea Mon Sep 17 00:00:00 2001 From: luyuan <1162963624@qq.com> Date: Sat, 15 Aug 2020 19:04:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=97=E9=93=BA=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/api/shop.js | 4 ++-- pageB/search/index.vue | 11 ++++++++++- pageB/search/searchGoods.vue | 7 ++++++- pageC/merchant/index.vue | 3 ++- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/common/api/shop.js b/common/api/shop.js index 2034005..658f7e0 100644 --- a/common/api/shop.js +++ b/common/api/shop.js @@ -192,9 +192,9 @@ export default { }); }, // 商品搜索 - ShopSearch({keyword, page = 1, order = 'goods_salenum'}){ + ShopSearch({keyword, page = 1, order = 'goods_salenum',sid=''}){ return vm.$u.post('ShopSearch/search',{ - keyword,page,order + keyword,page,order,store_id:sid }) }, // 秒杀推荐 diff --git a/pageB/search/index.vue b/pageB/search/index.vue index 7707000..63e3e90 100644 --- a/pageB/search/index.vue +++ b/pageB/search/index.vue @@ -15,11 +15,16 @@ export default { return{ type: '', // 1 商家达人社区 2 商品 keyword: "", - searchwordlist: [], + searchwordlist: [], + sid:0 } }, // type: 1 商品 2: 其他 onLoad(option) { + console.log(option.id) + if(option.id != undefined || option.id){ + this.sid = option.id + } this.type = option.type; this.curent = option.curent || 0 this.getWordList(); @@ -75,6 +80,10 @@ export default { params: params, }) }else{ + if(this.sid !=0 ){ + params.sid = this.sid + console.log(this.sid) + } this.$u.route({ url: "/pageB/search/searchGoods", params: params, diff --git a/pageB/search/searchGoods.vue b/pageB/search/searchGoods.vue index b4c3efc..9d53394 100644 --- a/pageB/search/searchGoods.vue +++ b/pageB/search/searchGoods.vue @@ -42,7 +42,8 @@ export default { scrollTop: 0, old: { scrollTop: 0 - } + }, + sid:'' } }, watch: { @@ -57,6 +58,7 @@ export default { }, onLoad(option) { this.value = option.value + this.sid = option.sid this.setViewHeight(); this.ShopSearch() this.setNavSearchInput(this.value); @@ -106,11 +108,14 @@ export default { // 排序方式 goods_salenum:销量 evaluation_count:评价 goods_price_asc:价格从低到高 goods_price_desc:价格从高到低 async ShopSearch({ load = 'reload' } = {}) { console.log(this.value); + console.log(this.sid) + const sort = this.setOrderSort(); const res = await this.$u.api.ShopSearch({ keyword: this.value, page: this.page, order: sort, + sid:this.sid }) this.timer = true; if(res.errCode == 0) { diff --git a/pageC/merchant/index.vue b/pageC/merchant/index.vue index 0c1b0b7..5565df3 100644 --- a/pageC/merchant/index.vue +++ b/pageC/merchant/index.vue @@ -114,7 +114,8 @@ export default { }, onNavigationBarSearchInputClicked() { this.$u.route('pageB/search/index', { - type: 2 + type: 1, + id:this.sid }); }, methods: {