|
@@ -167,14 +167,19 @@
|
|
if (e.searchVal) that.searchValue = e.searchVal;
|
|
if (e.searchVal) that.searchValue = e.searchVal;
|
|
e.navTitle ? that.navTitle = e.navTitle : ''
|
|
e.navTitle ? that.navTitle = e.navTitle : ''
|
|
e.id ? that.cateId = e.id : ''
|
|
e.id ? that.cateId = e.id : ''
|
|
|
|
+ const allData = {
|
|
|
|
+ name : '全部',
|
|
|
|
+ id : 0,
|
|
|
|
+ icon : '/static/img/quanbu.png',
|
|
|
|
+ };
|
|
getProduct(that.cateId).then(res => {
|
|
getProduct(that.cateId).then(res => {
|
|
const data = res.data;
|
|
const data = res.data;
|
|
- // data[0].id = 0;
|
|
|
|
if (data.length !== 0) {
|
|
if (data.length !== 0) {
|
|
- that.optionIndex = data[0].id;
|
|
|
|
- data[0].name = '全部';
|
|
|
|
- data[0].icon = '/static/img/quanbu.png';
|
|
|
|
- that.optionData = data
|
|
|
|
|
|
+ that.optionIndex =0;
|
|
|
|
+ that.optionData.push(allData)
|
|
|
|
+ data.forEach(function(item) {
|
|
|
|
+ that.optionData.push(item);
|
|
|
|
+ });
|
|
}
|
|
}
|
|
that.getMatchedData()
|
|
that.getMatchedData()
|
|
})
|
|
})
|
|
@@ -186,8 +191,9 @@
|
|
getMerchantSearchList({
|
|
getMerchantSearchList({
|
|
latitude: uni.getStorageSync('user_latitude'),
|
|
latitude: uni.getStorageSync('user_latitude'),
|
|
longitude: uni.getStorageSync('user_longitude'),
|
|
longitude: uni.getStorageSync('user_longitude'),
|
|
- productType: this.optionIndex || this.cateId,
|
|
|
|
|
|
+ productType: this.cateId,
|
|
keywords: this.searchValue,
|
|
keywords: this.searchValue,
|
|
|
|
+ typeIds: this.optionIndex==0?"":this.optionIndex,
|
|
page: this.page,
|
|
page: this.page,
|
|
limit: 10
|
|
limit: 10
|
|
}).then(res => {
|
|
}).then(res => {
|