diff --git a/src/components/seachPage/input.vue b/src/components/seachPage/input.vue index ab8fc84..96b00a6 100644 --- a/src/components/seachPage/input.vue +++ b/src/components/seachPage/input.vue @@ -281,6 +281,8 @@ let seachAllType = reactive({ }) //设置搜索数据 let setSeachConditions = (type, data) => { + console.log(1,seachAllType) + console.log(type.value) if (seachAllType['tabType'] !== 'apartment') { if (type === 'rent') { seachAllType['rent_min'] = data.min @@ -300,7 +302,8 @@ let setSeachConditions = (type, data) => { } } else { seachAllType = { - ...data + tabType:'apartment', + ...type.value } } if (!seachVal.value) { diff --git a/src/components/selectTabBox/selectTabBox.vue b/src/components/selectTabBox/selectTabBox.vue index 810d518..48c6765 100644 --- a/src/components/selectTabBox/selectTabBox.vue +++ b/src/components/selectTabBox/selectTabBox.vue @@ -271,11 +271,7 @@ const route = useRouter() let routePath = ref('') let routeQuery = reactive({ data: {} }) routePath.value = route.currentRoute.value.meta.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 props = defineProps({ @@ -639,11 +635,13 @@ let deconstructionSeachData = null //根据路由设置参数 let setRouterQuerySet = ref(true) let routerQuerySet = () => { - deconstructionSeachData = deconstructionData(routeQuery.data) - console.log(deconstructionSeachData) - if (!setRouterQuerySet.value) return + if(routePath.value==='/seachPage'){ + deconstructionSeachData = routeQuery.data + }else{ + deconstructionSeachData = deconstructionData(routeQuery.data) + } //路由参数设置 - if ((routeQuery.data && routeQuery.data.houseingPageType === '1') || (routePath.value === '/intermediaryHousing')) { + if ((deconstructionSeachData.houseingPageType == '1') || (routePath.value === '/intermediaryHousing')) { otherData.value = [{ title: '认证中介', id: 'isintermediary' }, { title: '有电梯', id: 'iselevator' }, { title: '有阳台', id: 'issunshinearea' }] } else if ((routeQuery.data && routeQuery.data.houseingPageType === '6') || (routePath.value === '/needHousing')) { otherData.value = [{ title: '有电梯', id: 'iselevator' }, { title: '有阳台', id: 'issunshinearea' }] diff --git a/src/router/index.js b/src/router/index.js index 98856da..c8cf05d 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -63,7 +63,7 @@ const routes = [ } }, {//中介房源 - path: '/intermediaryHousing/:type?/:data?/:areaItem?/:types?', + path: '/intermediaryHousing', component: () => import(/* webpackChunkName: "housing" */ '@/views/housingView/intermediary.vue'), meta: { title: '中介房源', @@ -120,7 +120,7 @@ const router = createRouter({ router.beforeEach((to, from, next) => { //导航数据 - if (/['seachPage','needHousing','intermediaryHousing','personHousing']/.test(from.path)) { + if (/['needHousing','intermediaryHousing','personHousing']/.test(from.path)) { store.state.routeList.secondaryIndex.title = from.meta.title store.state.routeList.secondaryIndex.path = from.meta.path } diff --git a/src/views/detail.vue b/src/views/detail.vue index 099b37e..a30edff 100644 --- a/src/views/detail.vue +++ b/src/views/detail.vue @@ -2,7 +2,7 @@
+ :class="{ 'mg-b-80': pageType == 3 || (recommendListData.length == 0 || publisherList.length == 0) }">
@@ -126,7 +126,7 @@ {{ !housingInfo['data'] || housingInfo['data'] && housingInfo['data'].info.rentalduration === '0' ? - '不限' : `${config.rentalduration[housingInfo['data'] && housingInfo['data'].info.rentalduration]}` }} + '不限' : `${ indexData['data']&&indexData['data']['config']&&indexData['data']['config']['rentalduration'][housingInfo['data'] && housingInfo['data'].info.rentalduration]}` }}
@@ -202,7 +202,7 @@
-
+
房屋类型
@@ -219,7 +219,7 @@
-
+
所在楼层
@@ -235,7 +235,7 @@
-
+
电梯
@@ -248,7 +248,7 @@ }}
-
+
晾晒区
@@ -264,7 +264,7 @@ }}
-
+
面积
@@ -286,7 +286,7 @@ 平方呎
-
+
同住人性别要求
@@ -299,7 +299,7 @@ }}
-
+
发布者性别
@@ -317,7 +317,7 @@
-
+
房屋类型
@@ -330,7 +330,7 @@ }}
-
+
所在楼层
@@ -349,7 +349,7 @@ }}
-
+
晾晒区
@@ -365,7 +365,7 @@ }}
-
+
面积
@@ -376,7 +376,7 @@ }} 平方呎
-
+
性别要求
@@ -595,7 +595,7 @@ v-if="pageType == 2 && housingInfo['data'] && housingInfo['data'].isintermediary == 1">
-
+
{{ indexData['data'] && @@ -1128,20 +1128,23 @@ let setHousingArr = () => { } -//总体数据 -let config=store.state.indexData.config let location = store.state.indexData.config && store.state.indexData.config.location //设置顶部导航 +// intermediary 1中介 2-5个人 6求房源 let setNavigation = () => { let type = store.state.indexData.config && store.state.indexData.config.type indexData['data'] = store.state.indexData - console.log('routeLis', store.state) - console.log(location) if (!location) return if (pageType.value == 1 || pageType.value == 2) { // location=3.8,3.13&areaItem=3 // console.log(`${store.state.routeList['secondaryIndex'].path}/location/${JSON.stringify([housingInfo['data']['info'].location.substring(0, 1)])}`) + store.state.routeList['secondaryIndex']={ + path:housingInfo['data']['info'].intermediary===1?'/intermediaryHousing': + housingInfo['data']['info'].intermediary===6?'/needHousing':'/personHousing', + title:housingInfo['data']['info'].intermediary===1?'中介房源': + housingInfo['data']['info'].intermediary===6?'求房源':'个人房源' + } store.state.routeList['thirdIndex'] = { path: `${store.state.routeList['secondaryIndex'].path}`, query: { @@ -1189,9 +1192,10 @@ let getHousingInfo = () => { }) concatInfo['data'] = store.state.indexData.wechat if (res.data.contacts) contacts['data'] = res.data.contacts - if (housingInfo['data'].info.verified && pageType.value != 3) { + console.log('pageType',pageType.value) + if ( pageType.value ==2) { getPublisherList() - } else if (pageType.value != 3) { + } else if (pageType.value == 1) { recommendList() } @@ -1299,17 +1303,17 @@ let recommendList = () => { }).then(res => { console.log(res) if (res.code === 200) { - if (res.data.length === 0) return - if (res.data.pagevalue) { - recommendListData.value = recommendListData.value.concat(res.data.data) - pagevalue.value = res.data.pagevalue - } - if (res.data.data.length >= 30) { + if (res.data.data&&res.data.data.length >= 30) { loadMore.value = true } else { loadMore.value = false loadText.value = '到底了' } + if (res.data.length === 0) return + if (res.data.pagevalue) { + recommendListData.value = recommendListData.value.concat(res.data.data) + pagevalue.value = res.data.pagevalue + } nextTick(() => { masonryInstance.reloadItems(); masonryInstance.layout(); @@ -1339,13 +1343,13 @@ let getPublisherList = () => { }).then(res => { console.log(res) if (res.code === 200) { - publisherList.value = publisherList.value.concat(res.data) if (res.data.length >= 30) { loadMore.value = true } else { loadMore.value = false loadText.value = '到底了' } + publisherList.value = publisherList.value.concat(res.data) } else { ElMessage({ message: res.message, @@ -2104,7 +2108,7 @@ img { color: #FFFFFF; text-align: center; line-height: 24px; - padding: 2px 3px; + padding: 2px 6px; } .time-box { @@ -2649,8 +2653,6 @@ img { } .school-info { - height: 500px; - overflow-y: scroll; font-family: 'PingFangSC-Semibold', 'PingFang SC Semibold', 'PingFang SC', sans-serif; font-weight: 650; font-style: normal; diff --git a/src/views/seachIndex.vue b/src/views/seachIndex.vue index edd1607..b4c28d0 100644 --- a/src/views/seachIndex.vue +++ b/src/views/seachIndex.vue @@ -15,7 +15,7 @@ listId="2">
-
@@ -75,7 +75,7 @@ let setSeachSelectData = (data) => { ...data } loading.value = true - // console.log('seachSelectData', seachSelectData.data, type) + // console.log('seachSelectData', seachSelectData.data) // return getDataList(seachSelectData.data) }