学校跳转
This commit is contained in:
@@ -579,20 +579,34 @@ let cleanSelect = () => {
|
||||
|
||||
//查找数据
|
||||
let getAddressListId=(id,type)=>{
|
||||
console.log(store.state.seachTypeData[0].where)
|
||||
let data=null
|
||||
let checkList= type==='location'?list:type==='types'?hireTypeArr:type==='school'?school:''
|
||||
let dataId= type==='location'?id:type==='types'?id.substring(0,1):''
|
||||
let checkList= type==='location'?list:type==='types'?hireTypeArr:type==='school'?store.state.seachTypeData[0].where:''
|
||||
let dataId=type==='types'?id.substring(0,1):id
|
||||
checkList.map(res=>{
|
||||
console.log(res,id)
|
||||
if(res.id==dataId){
|
||||
console.log(res)
|
||||
data= res
|
||||
if(type==='types'){
|
||||
data=getHireType(res.hireType,id)
|
||||
}else{
|
||||
data= res
|
||||
}
|
||||
}
|
||||
})
|
||||
console.log(data)
|
||||
return data
|
||||
}
|
||||
|
||||
//查找出租类型
|
||||
let getHireType=(data,id)=>{
|
||||
let obj=null
|
||||
data.map(res=>{
|
||||
if(res.id==id)obj=res
|
||||
})
|
||||
return obj
|
||||
}
|
||||
|
||||
//解数据
|
||||
let deconstructionData=(data={})=>{
|
||||
//第一个为type
|
||||
@@ -602,7 +616,7 @@ let deconstructionData=(data={})=>{
|
||||
key.map((res,index)=>{
|
||||
if(index===0){//类型
|
||||
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(seachData['type']!=='location') return
|
||||
@@ -636,17 +650,19 @@ let routerQuerySet = () => {
|
||||
if (Object.keys(routeQuery.data).length > 0) {
|
||||
if (Object.keys(deconstructionSeachData).length===0) return
|
||||
let data = deconstructionSeachData.areaItem
|
||||
if (routeQuery.data.type === 'school') {
|
||||
if (deconstructionSeachData.type === 'school') {
|
||||
|
||||
selectPosition.value = 'school'
|
||||
schoolSelectObj.id = data.id
|
||||
schoolSelectObj.title = data.title
|
||||
schoolSelectObj.id = deconstructionSeachData.selectData.id
|
||||
schoolSelectObj.title = deconstructionSeachData.selectData.name
|
||||
|
||||
} else if (deconstructionSeachData.type === 'types') {
|
||||
|
||||
let type = deconstructionSeachData.selectData.toString().substring(0, 1)
|
||||
hireTypeObj.id = data.id
|
||||
hireTypeObj.title = data.name
|
||||
let type = deconstructionSeachData.selectData.id.toString().substring(0, 1)
|
||||
hireTypeObj.id = deconstructionSeachData.selectData.id
|
||||
hireTypeObj.title = deconstructionSeachData.selectData.title
|
||||
hireTypeObj.hireId = type == 1 ? '合租' : type == 2 ? '整租' : '不限'
|
||||
|
||||
|
||||
} else if (deconstructionSeachData.type === 'location') {
|
||||
|
||||
selectTabCheck.id = deconstructionSeachData.areaItem.id;
|
||||
|
||||
Reference in New Issue
Block a user