学校跳转

This commit is contained in:
2023-07-27 18:50:47 +08:00
parent bb45673420
commit b50ec200ad
2 changed files with 28 additions and 12 deletions

View File

@@ -579,20 +579,34 @@ let cleanSelect = () => {
//查找数据 //查找数据
let getAddressListId=(id,type)=>{ let getAddressListId=(id,type)=>{
console.log(store.state.seachTypeData[0].where)
let data=null let data=null
let checkList= type==='location'?list:type==='types'?hireTypeArr:type==='school'?school:'' let checkList= type==='location'?list:type==='types'?hireTypeArr:type==='school'?store.state.seachTypeData[0].where:''
let dataId= type==='location'?id:type==='types'?id.substring(0,1):'' let dataId=type==='types'?id.substring(0,1):id
checkList.map(res=>{ checkList.map(res=>{
console.log(res,id) console.log(res,id)
if(res.id==dataId){ if(res.id==dataId){
console.log(res) console.log(res)
data= res if(type==='types'){
data=getHireType(res.hireType,id)
}else{
data= res
}
} }
}) })
console.log(data) console.log(data)
return data return data
} }
//查找出租类型
let getHireType=(data,id)=>{
let obj=null
data.map(res=>{
if(res.id==id)obj=res
})
return obj
}
//解数据 //解数据
let deconstructionData=(data={})=>{ let deconstructionData=(data={})=>{
//第一个为type //第一个为type
@@ -602,7 +616,7 @@ let deconstructionData=(data={})=>{
key.map((res,index)=>{ key.map((res,index)=>{
if(index===0){//类型 if(index===0){//类型
seachData['type']=res seachData['type']=res
seachData['selectData']=seachData['type']==='location'?data[res].split(','):getAddressListId(data[res],'types') 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') return
@@ -636,15 +650,17 @@ 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 (routeQuery.data.type === 'school') { if (deconstructionSeachData.type === 'school') {
selectPosition.value = 'school' selectPosition.value = 'school'
schoolSelectObj.id = data.id schoolSelectObj.id = deconstructionSeachData.selectData.id
schoolSelectObj.title = data.title schoolSelectObj.title = deconstructionSeachData.selectData.name
} else if (deconstructionSeachData.type === 'types') { } else if (deconstructionSeachData.type === 'types') {
let type = deconstructionSeachData.selectData.toString().substring(0, 1) let type = deconstructionSeachData.selectData.id.toString().substring(0, 1)
hireTypeObj.id = data.id hireTypeObj.id = deconstructionSeachData.selectData.id
hireTypeObj.title = data.name hireTypeObj.title = deconstructionSeachData.selectData.title
hireTypeObj.hireId = type == 1 ? '合租' : type == 2 ? '整租' : '不限' hireTypeObj.hireId = type == 1 ? '合租' : type == 2 ? '整租' : '不限'
} else if (deconstructionSeachData.type === 'location') { } else if (deconstructionSeachData.type === 'location') {

View File

@@ -378,7 +378,7 @@ let personHouseingInfo = (type, data, areaItem) => {
if(type==="location"){ if(type==="location"){
areaItems=JSON.parse(areaItem) areaItems=JSON.parse(areaItem)
setData=data.toString() setData=data.toString()
}else if(type==='types'){ }else{
setData=data.id setData=data.id
} }
router.push({ router.push({