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
+5
View File
@@ -65,6 +65,11 @@ export function getHotelInfo(params) {
return request.get("merchantApply/info/hotel", params, {login: true}) return request.get("merchantApply/info/hotel", params, {login: true})
} }
// 获取千县名品店铺类型列表
export function getCountyFamousHotelType() {
return request.get("/countyFamous/hotelType", {}, {login: true})
}
/** /**
* 旅居管家入驻申请详情 * 旅居管家入驻申请详情
*/ */
+4
View File
@@ -312,3 +312,7 @@ export function getCityNewsCategory() {
export function getCityShopList(params) { export function getCityShopList(params) {
return request.get('/countyFamous/hotel', params, {login: true}) return request.get('/countyFamous/hotel', params, {login: true})
} }
export function getCountyFamousHotelType() {
return request.get('/countyFamous/hotelType', {}, {login: true})
}
+102 -3
View File
@@ -175,6 +175,33 @@
</template> </template>
</u-cell> </u-cell>
</view> </view>
<u-form-item prop="isCountyFamous">
<u-cell title="是否县域店铺" :border="false">
<template #icon>
<text class="required">*</text>
</template>
<template #value>
<u-radio-group
v-model="form.isCountyFamous"
:disabled="reviewing"
placement="row"
@change="countyFamousChange"
>
<u-radio
:name="0"
:customStyle="{marginRight: '16px'}"
active-color="red"
label="否"
/>
<u-radio
:name="1"
active-color="red"
label="是"
/>
</u-radio-group>
</template>
</u-cell>
</u-form-item>
<u-form-item prop="typeText"> <u-form-item prop="typeText">
<u-cell title="店铺类型" :border="false" isLink> <u-cell title="店铺类型" :border="false" isLink>
<template #icon> <template #icon>
@@ -316,7 +343,15 @@
<text class="required">*</text> <text class="required">*</text>
</template> </template>
<template #value> <template #value>
<u--text :text="form.serviceTime + ' - ' + form.serviceEndTime"></u--text> <u--text
v-if="form.serviceTime && form.serviceEndTime"
:text="form.serviceTime + ' - ' + form.serviceEndTime"
></u--text>
<u--text
v-else
text="请选择营业时间"
color="#c0c4cc"
></u--text>
<tpf-time-range <tpf-time-range
startTime="00:00" startTime="00:00"
endTime="23:59" endTime="23:59"
@@ -414,7 +449,8 @@ import {
getShopInfo, getShopInfo,
removeApply, removeApply,
saveShop, saveShop,
getHotelInfo getHotelInfo,
getCountyFamousHotelType
} from '@/api/join' } from '@/api/join'
import { import {
getCity, getCity,
@@ -449,6 +485,8 @@ export default {
qualification: '', qualification: '',
type: 0, type: 0,
typeText: '', typeText: '',
isCountyFamous: 0,
countyFamousHotelType: null,
phone: '', phone: '',
captcha: '', captcha: '',
area: '', area: '',
@@ -483,6 +521,12 @@ export default {
message: '请上传店铺LOGO', message: '请上传店铺LOGO',
trigger: ['blur', 'change'] trigger: ['blur', 'change']
}, },
'isCountyFamous': {
type: 'number',
required: true,
message: '请选择是否为县域店铺',
trigger: ['blur', 'change']
},
'typeText': { 'typeText': {
type: 'string', type: 'string',
required: true, required: true,
@@ -539,6 +583,8 @@ export default {
} }
}, },
columnsType: [], columnsType: [],
hotelTypeList: [],
countyFamousHotelTypeList: [],
indexType: [0], indexType: [0],
district: [], district: [],
address: {}, address: {},
@@ -574,6 +620,8 @@ export default {
qualification: '', qualification: '',
type: 0, type: 0,
typeText: '', typeText: '',
isCountyFamous: 0,
countyFamousHotelType: null,
phone: '', phone: '',
captcha: '', captcha: '',
area: '', area: '',
@@ -646,9 +694,18 @@ export default {
this.district = data this.district = data
}) })
getShopData().then(({data}) => { getShopData().then(({data}) => {
this.columnsType = data.hotelTypeList this.hotelTypeList = data.hotelTypeList || []
this.columnsType = this.hotelTypeList
this.notice = data.merchantApplyNotice this.notice = data.merchantApplyNotice
getCountyFamousHotelType().then(res => {
const listData = Array.isArray(res.data)
? res.data
: (res.data && (res.data.hotelTypeList || res.data.list || res.data.records)) || []
this.countyFamousHotelTypeList = listData || []
this.initInfo() this.initInfo()
}).catch(() => {
this.initInfo()
})
}) })
}, },
@@ -685,6 +742,10 @@ export default {
// 店铺图片 // 店铺图片
this.pics = [] this.pics = []
this.form = data.hotelInfo this.form = data.hotelInfo
if (!this.form.serviceTime || !this.form.serviceEndTime) {
this.form.serviceTime = ''
this.form.serviceEndTime = ''
}
this.form.coverVideo = this.form.coverType === 2 ? this.form.cover : '' this.form.coverVideo = this.form.coverType === 2 ? this.form.cover : ''
const picsTemp = this.form.pics.split(',') const picsTemp = this.form.pics.split(',')
if (picsTemp.length > 0) { if (picsTemp.length > 0) {
@@ -704,7 +765,16 @@ export default {
} }
}) })
} }
if (this.form.isCountyFamous !== 1 && this.form.isCountyFamous !== 0) {
this.form.isCountyFamous = 0
}
if (this.form.isCountyFamous === 1) {
this.columnsType = this.countyFamousHotelTypeList
this.indexType = this.columnsType.findIndex(item => item.id === this.form.countyFamousHotelType)
} else {
this.columnsType = this.hotelTypeList
this.indexType = this.columnsType.findIndex(item => item.id === this.form.type) this.indexType = this.columnsType.findIndex(item => item.id === this.form.type)
}
if (this.indexType !== -1) { if (this.indexType !== -1) {
this.form.typeText = this.columnsType[this.indexType].name this.form.typeText = this.columnsType[this.indexType].name
} }
@@ -767,14 +837,43 @@ export default {
}) })
} }
}, },
countyFamousChange(e) {
const value = parseInt(e)
this.form.isCountyFamous = value
if (value === 1) {
if (this.countyFamousHotelTypeList.length === 0) {
getCountyFamousHotelType().then(res => {
const listData = Array.isArray(res.data)
? res.data
: (res.data && (res.data.hotelTypeList || res.data.list || res.data.records)) || []
this.countyFamousHotelTypeList = listData || []
this.columnsType = this.countyFamousHotelTypeList
})
} else {
this.columnsType = this.countyFamousHotelTypeList
}
this.indexType = 0
this.form.typeText = ''
this.form.countyFamousHotelType = null
} else {
this.columnsType = this.hotelTypeList
this.indexType = 0
this.form.typeText = ''
this.form.type = 0
}
},
typeChange(e) { typeChange(e) {
const idx = parseInt(e.detail.value) const idx = parseInt(e.detail.value)
this.columnsType.map((item, index) => { this.columnsType.map((item, index) => {
if (index === idx) { if (index === idx) {
this.form.typeText = item.name this.form.typeText = item.name
this.indexType = index this.indexType = index
if (this.form.isCountyFamous === 1) {
this.form.countyFamousHotelType = item.id
} else {
this.form.type = item.id this.form.type = item.id
} }
}
}) })
}, },
// 省市区 // 省市区
+39 -7
View File
@@ -552,6 +552,16 @@
</view> </view>
</view> </view>
<view class="village-wrap v12-pt-3"> <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-if="shopList.length > 0" class="village-list">
<view <view
v-for="(shop, shopIndex) in shopList" v-for="(shop, shopIndex) in shopList"
@@ -876,7 +886,8 @@ import {
getSaleList, getSaleList,
getJiaLouList, getJiaLouList,
getCityNewsCategory, getCityNewsCategory,
getCityShopList getCityShopList,
getCountyFamousHotelType
} from '@/api/qianxian' } from '@/api/qianxian'
import ProductWindow from '@/components/ProductWindow' import ProductWindow from '@/components/ProductWindow'
import goCartMixin from '@/mixins/goCartMixins' import goCartMixin from '@/mixins/goCartMixins'
@@ -966,6 +977,8 @@ export default {
newsCategoryList: [], newsCategoryList: [],
newsCurrent: 0, newsCurrent: 0,
shopList: [], shopList: [],
shopTypeList: [],
shopTypeActive: '',
} }
}, },
onShareAppMessage() { onShareAppMessage() {
@@ -1641,7 +1654,7 @@ export default {
industryTabItemClick(index) { industryTabItemClick(index) {
if (index === this.industryTabIndex) return if (index === this.industryTabIndex) return
this.industryTabIndex = index this.industryTabIndex = index
if(index === 2) { if (index === 2) {
const params = { const params = {
countyId: this.countyId, countyId: this.countyId,
shopType: 'countyFamous', shopType: 'countyFamous',
@@ -1649,22 +1662,41 @@ export default {
page: 1, page: 1,
limit: 9999 limit: 9999
} }
console.log(this.inn);
getJiaLouList(params).then(res => { getJiaLouList(params).then(res => {
this.jiaLouList = res.data.records || [] this.jiaLouList = res.data.records || []
}) })
} }
if(index === 1) { if (index === 1) {
this.shopTypeActive = ''
if (this.shopTypeList.length === 0) {
this.getShopTypeList()
}
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 = { const params = {
countyFamousDataId: this.id, countyFamousDataId: this.id,
countyFamousHotelType: this.shopTypeActive,
page: 1, page: 1,
limit: 9999 limit: 9999
} }
getCityShopList(params).then(res => { getCityShopList(params).then(res => {
this.shopList = res.data.records || [] 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) { fileItemClick(file) {
const url = file.attachment || '' const url = file.attachment || ''