更新云市场

This commit is contained in:
weipengfei 2023-12-04 16:42:18 +08:00
parent f9c2e90785
commit b561aac302

View File

@ -89,11 +89,11 @@
<view class="menu_cls">
<u-scroll-list indicatorActiveColor='#FF6D20' :indicator="true">
<view class="menu_li" :class="{'menu_li_on': item.store_category_id==store_category_id}" @click="changeMerchant(item.store_category_id)" v-for="item,index in menuList"
<view class="menu_li" :class="{'menu_li_on': item.merchant_category_id==merchant_category_id}" @click="changeMerchant(item.merchant_category_id)" v-for="item,index in menuList"
:key="index">
<u--image class="image" :showLoading="true" :src="item.pic" width="87.62rpx" height="87.62rpx" shape="circle"
<u--image class="image" :showLoading="true" :src="item.background" width="87.62rpx" height="87.62rpx" shape="circle"
></u--image>
<view class="li_text" style="display: block;font-size: 26.29rpx;margin-top: 10rpx;">{{item.cate_name}}</view>
<view class="li_text" style="display: block;font-size: 26.29rpx;margin-top: 10rpx;">{{item.category_name}}</view>
</view>
</u-scroll-list>
</view>
@ -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) {