个人房源跳转

This commit is contained in:
2023-07-27 19:43:15 +08:00
parent 81fbcd6b6e
commit 9879550544
2 changed files with 61 additions and 50 deletions

View File

@@ -19,9 +19,11 @@
@click="setSelectData(item.id, item.data, item.name)" v-for="(item, i) in list" :key="i"> @click="setSelectData(item.id, item.data, item.name)" v-for="(item, i) in list" :key="i">
<div class="dis-f al-item">{{ item.name }} <div class="dis-f al-item" <div class="dis-f al-item">{{ item.name }} <div class="dis-f al-item"
v-show="selectTabCheck.id === item.id && selectTabCheck.id">&nbsp>&nbsp v-show="selectTabCheck.id === item.id && selectTabCheck.id">&nbsp>&nbsp
<div :class="{ 'check-data': selectData.data && selectData.data.length > 0&&selectData.data.length!==selectTabCheck.data.length }"> <div
:class="{ 'check-data': selectData.data && selectData.data.length > 0 && selectData.data.length !== selectTabCheck.data.length }">
{{ {{
selectData.data && selectData.data.length === 0||selectData.data.length===selectTabCheck.data.length ?'不限' : selectData.data && selectData.data.length ===
0 || selectData.data.length === selectTabCheck.data.length ? '不限' :
selectData.data && selectData.data.length selectData.data && selectData.data.length
}} }}
</div> </div>
@@ -75,7 +77,8 @@
v-show="selectTabCheck.id === item.id && selectTabCheck.id">&nbsp>&nbsp v-show="selectTabCheck.id === item.id && selectTabCheck.id">&nbsp>&nbsp
<div :class="{ 'select-num': selectData.data && selectData.data.length }"> <div :class="{ 'select-num': selectData.data && selectData.data.length }">
{{ {{
selectData.data && selectData.data.length === 0||selectData.data.length===selectTabCheck.data.length ? '不限' : selectData.data && selectData.data.length ===
0 || selectData.data.length === selectTabCheck.data.length ? '不限' :
selectData.data && selectData.data.length selectData.data && selectData.data.length
}} }}
</div> </div>
@@ -595,6 +598,7 @@ let getAddressListId=(id,type)=>{
//查找出租类型 //查找出租类型
let getHireType = (data, id) => { let getHireType = (data, id) => {
console.log(data)
let obj = null let obj = null
data.map(res => { data.map(res => {
if (res.id == id) obj = res if (res.id == id) obj = res
@@ -614,13 +618,18 @@ let deconstructionData=(data={})=>{
seachData['selectData'] = seachData['type'] === 'location' ? data[res].split(',') : seachData['type'] === 'types' ? getAddressListId(data[res], 'types') : seachData['type'] === 'school' ? getAddressListId(data[res], 'school') : '' seachData['selectData'] = seachData['type'] === 'location' ? data[res].split(',') : seachData['type'] === 'types' ? getAddressListId(data[res], 'types') : seachData['type'] === 'school' ? getAddressListId(data[res], 'school') : ''
} }
if (index === 1) {//类型参数 if (index === 1) {//类型参数
if(seachData['type']!=='location') return if (seachData['type'] === 'location') {
let address = getAddressListId(data[res], 'location') let address = getAddressListId(data[res], 'location')
seachData['areaItem'] = {} seachData['areaItem'] = {}
seachData['areaItem'].id = address.id seachData['areaItem'].id = address.id
seachData['areaItem'].name = address.name seachData['areaItem'].name = address.name
seachData['areaItem'].data = address.data seachData['areaItem'].data = address.data
} }
}
if (index === 2) {
seachData['cotenancy'] = res
seachData['cotenancyData'] = getAddressListId(data[res], 'types')
}
}) })
return seachData return seachData
} }
@@ -643,7 +652,7 @@ let routerQuerySet = () => {
} }
if (Object.keys(routeQuery.data).length > 0) { if (Object.keys(routeQuery.data).length > 0) {
if (Object.keys(deconstructionSeachData).length === 0) return if (Object.keys(deconstructionSeachData).length === 0) return
let data = deconstructionSeachData.areaItem // let data = deconstructionSeachData.areaItem
if (deconstructionSeachData.type === 'school') { if (deconstructionSeachData.type === 'school') {
selectPosition.value = 'school' selectPosition.value = 'school'
@@ -664,14 +673,13 @@ let routerQuerySet = () => {
selectTabCheck.data = deconstructionSeachData.areaItem.data; selectTabCheck.data = deconstructionSeachData.areaItem.data;
selectData.data = seachAreaId(deconstructionSeachData.selectData) selectData.data = seachAreaId(deconstructionSeachData.selectData)
if (routeQuery.data.types) { if (deconstructionSeachData.cotenancy) {
let types = JSON.parse(routeQuery.data.types) let type = deconstructionSeachData.cotenancyData.id.toString().substring(0, 1)
let { data } = types hireTypeObj.id = deconstructionSeachData.cotenancyData.id
let type = data.id.toString().substring(0, 1) hireTypeObj.title = deconstructionSeachData.cotenancyData.title
hireTypeObj.id = selectData.data.length == 0 ? '' : data.id
hireTypeObj.title = selectData.data.length == 0 ? '' : data.name
hireTypeObj.hireId = type == 1 ? '合租' : type == 2 ? '整租' : '不限' hireTypeObj.hireId = type == 1 ? '合租' : type == 2 ? '整租' : '不限'
} }
if(deconstructionSeachData.selectData[0])
nextTick(() => { nextTick(() => {
setCheckBoxData(deconstructionSeachData.selectData)//设置地区选项 setCheckBoxData(deconstructionSeachData.selectData)//设置地区选项
}) })

View File

@@ -963,7 +963,6 @@
<!-- 右下角咨询 --> <!-- 右下角咨询 -->
<circle-btn></circle-btn> <circle-btn></circle-btn>
<back-to-top></back-to-top> <back-to-top></back-to-top>
</template> </template>
<script setup> <script setup>
@@ -1140,21 +1139,25 @@ let setNavigation = () => {
console.log(location) console.log(location)
if (!location) return if (!location) return
if (pageType.value == 1 || pageType.value == 2) { if (pageType.value == 1 || pageType.value == 2) {
// type=location&data=["2.2"]&areaItem={"id":2,"name":"九龙"} // location=3.8,3.13&areaItem=3
// console.log(`${store.state.routeList['secondaryIndex'].path}/location/${JSON.stringify([housingInfo['data']['info'].location.substring(0, 1)])}`) // console.log(`${store.state.routeList['secondaryIndex'].path}/location/${JSON.stringify([housingInfo['data']['info'].location.substring(0, 1)])}`)
store.state.routeList['thirdIndex'] = { store.state.routeList['thirdIndex'] = {
path: `${store.state.routeList['secondaryIndex'].path}`, path: `${store.state.routeList['secondaryIndex'].path}`,
query: { query: {
type: 'location', location: '',
name: location[housingInfo['data']['info'].location.substring(0, 1)], areaItem: housingInfo['data']['info'].location.substring(0, 1),
id: housingInfo['data']['info'].location.substring(0, 1), types: housingInfo['data']['info'].type.substring(0, 1)
types: `${type[housingInfo['data']['info'].type.substring(0, 1)]},${housingInfo['data']['info'].type}`
}, },
title: `${location[housingInfo['data']['info'].location.substring(0, 1)]}${type[housingInfo['data']['info'].type.substring(0, 1)]}房源` title: `${location[housingInfo['data']['info'].location.substring(0, 1)]}${type[housingInfo['data']['info'].type.substring(0, 1)]}房源`
} }
if (housingInfo['data']['info'].location.length > 0) if (housingInfo['data']['info'].location.length > 0)
store.state.routeList['fourthIndex'] = { store.state.routeList['fourthIndex'] = {
path: `${store.state.routeList['secondaryIndex'].path}/location/${JSON.stringify([housingInfo['data']['info'].location.substring(0, 3)])}/${JSON.stringify({ id: housingInfo['data']['info'].location.substring(0, 1), name: location[housingInfo['data']['info'].location.substring(0, 1)] })}/${JSON.stringify({ type: 'types', data: { name: type[housingInfo['data']['info'].type.substring(0, 3)], id: housingInfo['data']['info'].type } })}`, query: {
location: housingInfo['data']['info'].location.substring(0, 3),
areaItem: housingInfo['data']['info'].location.substring(0, 1),
types: housingInfo['data']['info'].location.substring(0, 1)
},
path: `${store.state.routeList['secondaryIndex'].path}}/${JSON.stringify({ id: , name: location[housingInfo['data']['info'].location.substring(0, 1)] })}/${JSON.stringify({ type: 'types', data: { name: type[housingInfo['data']['info'].type.substring(0, 3)], id: housingInfo['data']['info'].type } })}`,
title: `${location[housingInfo['data']['info'].location]}${type[housingInfo['data']['info'].type]}` title: `${location[housingInfo['data']['info'].location]}${type[housingInfo['data']['info'].type]}`
} }
} else if (pageType.value == 4) { } else if (pageType.value == 4) {