Feat:寻千县万村店铺增加2级分类

This commit is contained in:
LinCyJang
2026-01-31 15:45:51 +08:00
parent 2682ecaecd
commit 7b1ac89b5b
4 changed files with 158 additions and 18 deletions
+44 -12
View File
@@ -552,6 +552,16 @@
</view>
</view>
<view class="village-wrap v12-pt-3">
<view class="v12-pa-2 sale-wrap">
<view
v-for="(type, typeIndex) in shopTypeList"
:key="typeIndex"
:class="{ saleActive: shopTypeActive === type.id }"
@click="handleShopType(type)"
>
{{ type.name }}
</view>
</view>
<view v-if="shopList.length > 0" class="village-list">
<view
v-for="(shop, shopIndex) in shopList"
@@ -876,7 +886,8 @@ import {
getSaleList,
getJiaLouList,
getCityNewsCategory,
getCityShopList
getCityShopList,
getCountyFamousHotelType
} from '@/api/qianxian'
import ProductWindow from '@/components/ProductWindow'
import goCartMixin from '@/mixins/goCartMixins'
@@ -966,6 +977,8 @@ export default {
newsCategoryList: [],
newsCurrent: 0,
shopList: [],
shopTypeList: [],
shopTypeActive: '',
}
},
onShareAppMessage() {
@@ -1641,7 +1654,7 @@ export default {
industryTabItemClick(index) {
if (index === this.industryTabIndex) return
this.industryTabIndex = index
if(index === 2) {
if (index === 2) {
const params = {
countyId: this.countyId,
shopType: 'countyFamous',
@@ -1649,23 +1662,42 @@ export default {
page: 1,
limit: 9999
}
console.log(this.inn);
getJiaLouList(params).then(res => {
this.jiaLouList = res.data.records || []
})
}
if(index === 1) {
const params = {
countyFamousDataId: this.id,
page: 1,
limit: 9999
if (index === 1) {
this.shopTypeActive = ''
if (this.shopTypeList.length === 0) {
this.getShopTypeList()
}
getCityShopList(params).then(res => {
this.shopList = res.data.records || []
})
this.getShopList()
}
},
getShopTypeList() {
getCountyFamousHotelType().then(res => {
const listData = Array.isArray(res.data)
? res.data
: (res.data && (res.data.hotelTypeList || res.data.list || res.data.records)) || []
this.shopTypeList = [{ name: '全部', id: '' }].concat(listData || [])
})
},
getShopList() {
const params = {
countyFamousDataId: this.id,
countyFamousHotelType: this.shopTypeActive,
page: 1,
limit: 9999
}
getCityShopList(params).then(res => {
this.shopList = (res.data && (res.data.records || res.data.list)) || []
})
},
handleShopType(type) {
if (this.shopTypeActive === type.id) return
this.shopTypeActive = type.id
this.getShopList()
},
fileItemClick(file) {
const url = file.attachment || ''
if (!url) return