提交
This commit is contained in:
@@ -266,8 +266,11 @@ const route = useRouter()
|
|||||||
let routePath = ref('')
|
let routePath = ref('')
|
||||||
let routeQuery = reactive({ data: {} })
|
let routeQuery = reactive({ data: {} })
|
||||||
routePath.value = route.currentRoute.value.path
|
routePath.value = route.currentRoute.value.path
|
||||||
|
if(route.currentRoute.value.params.type){
|
||||||
|
routeQuery.data = route.currentRoute.value.params
|
||||||
|
}else{
|
||||||
routeQuery.data = route.currentRoute.value.query
|
routeQuery.data = route.currentRoute.value.query
|
||||||
|
}
|
||||||
const { proxy } = getCurrentInstance()
|
const { proxy } = getCurrentInstance()
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@@ -600,6 +603,7 @@ let routerQuerySet = () => {
|
|||||||
setCheckBoxData(data)//设置地区选项
|
setCheckBoxData(data)//设置地区选项
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setRouterQuerySet.value = false
|
setRouterQuerySet.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -608,6 +612,7 @@ watchEffect(() => {
|
|||||||
if (configData.data) {
|
if (configData.data) {
|
||||||
hireTypeArr[1].hireType = setHireTypeArr(store.state.seachTypeData[2] ? store.state.seachTypeData[2].where[0].data : [], 1)
|
hireTypeArr[1].hireType = setHireTypeArr(store.state.seachTypeData[2] ? store.state.seachTypeData[2].where[0].data : [], 1)
|
||||||
hireTypeArr[2].hireType = setHireTypeArr(store.state.seachTypeData[2] ? store.state.seachTypeData[2].where[1].data : [], 2)
|
hireTypeArr[2].hireType = setHireTypeArr(store.state.seachTypeData[2] ? store.state.seachTypeData[2].where[1].data : [], 2)
|
||||||
|
console.log('route',route)
|
||||||
if (setRouterQuerySet.value) {
|
if (setRouterQuerySet.value) {
|
||||||
setRegionList()//设置地区数据
|
setRegionList()//设置地区数据
|
||||||
setSchoolData()//设置学校数据
|
setSchoolData()//设置学校数据
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ const routes = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{//个人房源
|
{//个人房源
|
||||||
path: '/personHousing',
|
path: '/personHousing/:type?/:data?/:areaItem?',
|
||||||
component: () => import(/* webpackChunkName: "housing" */ '@/views/housingView/person.vue'),
|
component: () => import(/* webpackChunkName: "housing" */ '@/views/housingView/person.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
title: '个人房源'
|
title: '个人房源'
|
||||||
@@ -101,7 +101,10 @@ router.beforeEach((to, from, next) => {
|
|||||||
//导航数据
|
//导航数据
|
||||||
if (/['seachPage','needHousing','intermediaryHousing','personHousing']/.test(from.path)) {
|
if (/['seachPage','needHousing','intermediaryHousing','personHousing']/.test(from.path)) {
|
||||||
store.state.routeList.secondaryIndex.title = from.meta.title
|
store.state.routeList.secondaryIndex.title = from.meta.title
|
||||||
store.state.routeList.secondaryIndex.path = from.path
|
store.state.routeList.secondaryIndex.path = from.path==='/needHousing'?'/needHousing':
|
||||||
|
from.path==='/intermediaryHousing'?'/intermediaryHousing':
|
||||||
|
from.path==='/personHousing'?'/personHousing':
|
||||||
|
from.path==='/seachPage'?'/seachPage':''
|
||||||
}
|
}
|
||||||
next()
|
next()
|
||||||
let meta = to['meta'] || {}
|
let meta = to['meta'] || {}
|
||||||
|
|||||||
@@ -1103,12 +1103,13 @@ let setNavigation = () => {
|
|||||||
let type = store.state.indexData.config && store.state.indexData.config.type
|
let type = store.state.indexData.config && store.state.indexData.config.type
|
||||||
indexData['data'] = store.state.indexData
|
indexData['data'] = store.state.indexData
|
||||||
console.log('routeLis',store.state)
|
console.log('routeLis',store.state)
|
||||||
|
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":"九龙"}
|
// type=location&data=["2.2"]&areaItem={"id":2,"name":"九龙"}
|
||||||
console.log(`${store.state.routeList['secondaryIndex'].path}?type=location&data=${housingInfo['data']['info'].location.substring(0, 1)}`)
|
console.log(`${store.state.routeList['secondaryIndex'].path}/location/${housingInfo['data']['info'].location.substring(0, 1)}`)
|
||||||
store.state.routeList['thirdIndex'] = {
|
store.state.routeList['thirdIndex'] = {
|
||||||
path: `${store.state.routeList['secondaryIndex'].path}?type=location&data=${housingInfo['data']['info'].location.substring(0, 1)}`,
|
path: `${store.state.routeList['secondaryIndex'].path}/location/${housingInfo['data']['info'].location.substring(0, 1)}`,
|
||||||
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)
|
||||||
|
|||||||
@@ -143,7 +143,17 @@ let downLoadMore = () => {
|
|||||||
|
|
||||||
//listImg
|
//listImg
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
console.log(123)
|
||||||
|
let type=null,data=null
|
||||||
|
if (router.currentRoute.value.params.type) {
|
||||||
|
let { type, data } = router.currentRoute.value.params
|
||||||
|
type=type
|
||||||
|
data=data
|
||||||
|
} else {
|
||||||
let { type, data } = router.currentRoute.value.query
|
let { type, data } = router.currentRoute.value.query
|
||||||
|
type=type
|
||||||
|
data=data
|
||||||
|
}
|
||||||
let typeData = null
|
let typeData = null
|
||||||
if (data) typeData = JSON.parse(data)
|
if (data) typeData = JSON.parse(data)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user