diff --git a/pages/nongKe/supply_chain/supplierB.vue b/pages/nongKe/supply_chain/supplierB.vue index 22abd5b..f6c5db4 100644 --- a/pages/nongKe/supply_chain/supplierB.vue +++ b/pages/nongKe/supply_chain/supplierB.vue @@ -89,11 +89,11 @@ - - - {{item.cate_name}} + {{item.category_name}} @@ -308,7 +308,7 @@ page: 1, limit: 10, order: 'location', - store_category_id: '', //商品类型id + merchant_category_id: '', //商品类型id category_id: '', //商户类型id type_id: '', street_id: '', @@ -316,7 +316,7 @@ }, storeKey: 0, storeScroll: true, - store_category_id: '', // 当前选中类型的id + merchant_category_id: '', // 当前选中类型的id mer_id: '', sortId: '', price_on: '', @@ -350,17 +350,16 @@ this.credit_buy = options.credit_buy this.storeParam.type_id = options.type_id this.storeParam.type_id = options.type_id && options.type_id.split(',').toString() || '' - this.storeParam.store_category_id = options.cate_id && options.cate_id.split(',').toString() || '' + this.storeParam.merchant_category_id = options.cate_id && options.cate_id.split(',').toString() || '' this.storeList = []; - getCategoryListLevel().then(res => { + merClassifly().then(res => { this.menuList = res.data; - this.store_category_id = this.menuList[0].store_category_id; - this.storeParam.store_category_id = this.store_category_id; + this.merchant_category_id = this.menuList[0].merchant_category_id; + this.storeParam.merchant_category_id = this.merchant_category_id; if (this.mer_location == 1) { this.selfLocation() } // this.storeMerchantList(); - // this.getClassfication(); this.getStoreType(); this.Area() let that = this @@ -529,32 +528,25 @@ } }, // 获取商户分类 - getClassfication: function() { - let temp = [] - merClassifly() - .then(res => { - temp = res.data.map(item => { - return { - ...item, - check: false - } - }) - if (this.storeParam.store_category_id.length > 0) { - this.storeParam.store_category_id.forEach((ids, index) => { - temp.forEach(el => { - if (ids == el.merchant_category_id) { - el.check = true - } - }) - }) - } - this.merList = temp - }) - .catch(res => { - this.$util.Tips({ - title: res - }); - }); + async getClassfication(res=null) { + let temp = []; + if(!res) res = await merClassifly(); + temp = res.data.map(item => { + return { + ...item, + check: false + } + }) + if (this.storeParam.merchant_category_id.length > 0) { + this.storeParam.merchant_category_id.forEach((ids, index) => { + temp.forEach(el => { + if (ids == el.merchant_category_id) { + el.check = true + } + }) + }) + } + this.merList = temp }, // 获取店铺类型 getStoreType: function() { @@ -717,7 +709,7 @@ page: this.storeParam.page, limit: 10, order: this.storeParam.order, - store_category_id: this.storeParam.store_category_id, + merchant_category_id: this.storeParam.merchant_category_id, type_id: this.storeParam.type_id, credit_buy: this.credit_buy, } @@ -750,10 +742,11 @@ page: this.storeParam.page, limit: 10, order: this.storeParam.order, - store_category_id: this.storeParam.store_category_id, + // merchant_category_id: this.storeParam.merchant_category_id, type_id: this.storeParam.type_id, credit_buy: this.credit_buy, } + rqData.street_id = this.storeParam.street_id if (this.latitude) { rqData.location = this.latitude + ',' + this.longitude } @@ -806,12 +799,12 @@ this.storeParam.type_id = arr1.toString(); } if (data.merList.length == 0) { - this.storeParam.store_category_id = '' + this.storeParam.merchant_category_id = '' } else { data.merList.forEach(item => { arr2.push(item.merchant_category_id) }) - this.storeParam.store_category_id = arr2.toString(); + this.storeParam.merchant_category_id = arr2.toString(); } this.rightBox = data.status this.loadend = false; @@ -855,8 +848,8 @@ }, // 点击商户分类 changeMerchant(id){ - this.store_category_id = id; - this.storeParam.store_category_id = this.store_category_id; + this.merchant_category_id = id; + this.storeParam.merchant_category_id = this.merchant_category_id; this.storeParam.page = 1; this.storeMerchantList() }, @@ -915,7 +908,7 @@ credit_buy: this.credit_buy } if(!this.storeParam.is_recommend){ - rqData.store_category_id = this.storeParam.store_category_id; + rqData.merchant_category_id = this.storeParam.merchant_category_id; rqData.street_id = this.storeParam.street_id; } if (this.latitude) {