店铺搜索
This commit is contained in:
parent
94dc78555a
commit
33e8942180
@ -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',{
|
return vm.$u.post('ShopSearch/search',{
|
||||||
keyword,page,order
|
keyword,page,order,store_id:sid
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 秒杀推荐
|
// 秒杀推荐
|
||||||
|
@ -15,11 +15,16 @@ export default {
|
|||||||
return{
|
return{
|
||||||
type: '', // 1 商家达人社区 2 商品
|
type: '', // 1 商家达人社区 2 商品
|
||||||
keyword: "",
|
keyword: "",
|
||||||
searchwordlist: [],
|
searchwordlist: [],
|
||||||
|
sid:0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// type: 1 商品 2: 其他
|
// type: 1 商品 2: 其他
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
|
console.log(option.id)
|
||||||
|
if(option.id != undefined || option.id){
|
||||||
|
this.sid = option.id
|
||||||
|
}
|
||||||
this.type = option.type;
|
this.type = option.type;
|
||||||
this.curent = option.curent || 0
|
this.curent = option.curent || 0
|
||||||
this.getWordList();
|
this.getWordList();
|
||||||
@ -75,6 +80,10 @@ export default {
|
|||||||
params: params,
|
params: params,
|
||||||
})
|
})
|
||||||
}else{
|
}else{
|
||||||
|
if(this.sid !=0 ){
|
||||||
|
params.sid = this.sid
|
||||||
|
console.log(this.sid)
|
||||||
|
}
|
||||||
this.$u.route({
|
this.$u.route({
|
||||||
url: "/pageB/search/searchGoods",
|
url: "/pageB/search/searchGoods",
|
||||||
params: params,
|
params: params,
|
||||||
|
@ -42,7 +42,8 @@ export default {
|
|||||||
scrollTop: 0,
|
scrollTop: 0,
|
||||||
old: {
|
old: {
|
||||||
scrollTop: 0
|
scrollTop: 0
|
||||||
}
|
},
|
||||||
|
sid:''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@ -57,6 +58,7 @@ export default {
|
|||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
this.value = option.value
|
this.value = option.value
|
||||||
|
this.sid = option.sid
|
||||||
this.setViewHeight();
|
this.setViewHeight();
|
||||||
this.ShopSearch()
|
this.ShopSearch()
|
||||||
this.setNavSearchInput(this.value);
|
this.setNavSearchInput(this.value);
|
||||||
@ -106,11 +108,14 @@ export default {
|
|||||||
// 排序方式 goods_salenum:销量 evaluation_count:评价 goods_price_asc:价格从低到高 goods_price_desc:价格从高到低
|
// 排序方式 goods_salenum:销量 evaluation_count:评价 goods_price_asc:价格从低到高 goods_price_desc:价格从高到低
|
||||||
async ShopSearch({ load = 'reload' } = {}) {
|
async ShopSearch({ load = 'reload' } = {}) {
|
||||||
console.log(this.value);
|
console.log(this.value);
|
||||||
|
console.log(this.sid)
|
||||||
|
|
||||||
const sort = this.setOrderSort();
|
const sort = this.setOrderSort();
|
||||||
const res = await this.$u.api.ShopSearch({
|
const res = await this.$u.api.ShopSearch({
|
||||||
keyword: this.value,
|
keyword: this.value,
|
||||||
page: this.page,
|
page: this.page,
|
||||||
order: sort,
|
order: sort,
|
||||||
|
sid:this.sid
|
||||||
})
|
})
|
||||||
this.timer = true;
|
this.timer = true;
|
||||||
if(res.errCode == 0) {
|
if(res.errCode == 0) {
|
||||||
|
@ -114,7 +114,8 @@ export default {
|
|||||||
},
|
},
|
||||||
onNavigationBarSearchInputClicked() {
|
onNavigationBarSearchInputClicked() {
|
||||||
this.$u.route('pageB/search/index', {
|
this.$u.route('pageB/search/index', {
|
||||||
type: 2
|
type: 1,
|
||||||
|
id:this.sid
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
Loading…
Reference in New Issue
Block a user