搜索页 详情页跳转设置

This commit is contained in:
2023-07-28 11:52:59 +08:00
parent 65f43ea7db
commit a98e3280d5
5 changed files with 48 additions and 45 deletions

View File

@@ -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) {

View File

@@ -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
}
const { proxy } = getCurrentInstance()
const props = defineProps({
@@ -639,11 +635,13 @@ let deconstructionSeachData = null
//根据路由设置参数
let setRouterQuerySet = ref(true)
let routerQuerySet = () => {
if(routePath.value==='/seachPage'){
deconstructionSeachData = routeQuery.data
}else{
deconstructionSeachData = deconstructionData(routeQuery.data)
console.log(deconstructionSeachData)
if (!setRouterQuerySet.value) return
}
//路由参数设置
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' }]

View File

@@ -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
}

View File

@@ -2,7 +2,7 @@
<div>
<pageTopBar></pageTopBar>
<div class="dis-f jus-x al-item"
:class="{ 'mg-b-80': pageType == 3 && (recommendListData.length == 0 || publisherList.length == 0) }">
:class="{ 'mg-b-80': pageType == 3 || (recommendListData.length == 0 || publisherList.length == 0) }">
<div class="body-maxWidth mg-t-35">
<breadcrumb :data="housingInfo['data']" :operation='setOperation'></breadcrumb>
<el-affix :offset="0" @change="changeTitleType" z-index="700">
@@ -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]}` }}
</div>
</div>
<div class="condition">
@@ -202,7 +202,7 @@
</div>
<!-- -->
<div class="need-housing-info" v-if="pageType == 3">
<div class="info dis-f al-item">
<div class="info dis-f al-item" v-if="housingInfo['data'] && housingInfo['data'].info.property">
<div class="title-box">
房屋类型
</div>
@@ -219,7 +219,7 @@
</span>
</div>
</div>
<div class="info dis-f al-item">
<div class="info dis-f al-item" v-if="housingInfo['data'] && housingInfo['data'].info.floor">
<div class="title-box">
所在楼层
</div>
@@ -235,7 +235,7 @@
<!-- {{ housingInfo['data'] && housingInfo['data'].info.floor }} -->
</div>
</div>
<div class="info dis-f al-item">
<div class="info dis-f al-item" v-if="housingInfo['data'] &&housingInfo['data'].info.elevator">
<div class="title-box">
电梯
</div>
@@ -248,7 +248,7 @@
}}
</div>
</div>
<div class="info dis-f al-item">
<div class="info dis-f al-item" v-if="housingInfo['data'] &&housingInfo['data'].info.sunshinearea">
<div class="title-box">
晾晒区
</div>
@@ -264,7 +264,7 @@
}}
</div>
</div>
<div class="info dis-f al-item">
<div class="info dis-f al-item" v-if="housingInfo['data'] && housingInfo['data'].info.acreage[0]">
<div class="title-box">
面积
</div>
@@ -286,7 +286,7 @@
平方呎
</div>
</div>
<div class="info dis-f al-item">
<div class="info dis-f al-item" v-if="housingInfo['data'] &&housingInfo['data'].info.publishergender">
<div class="title-box">
同住人性别要求
</div>
@@ -299,7 +299,7 @@
}}
</div>
</div>
<div class="info dis-f al-item">
<div class="info dis-f al-item" v-if="housingInfo['data'] && housingInfo['data'].info.gender">
<div class="title-box">
发布者性别
</div>
@@ -317,7 +317,7 @@
</div>
<!-- -->
<div class="info-box-s" v-if="pageType != 3">
<div class="info dis-f al-item">
<div class="info dis-f al-item" v-if="housingInfo['data'] &&housingInfo['data'].info.property">
<div class="title-box">
房屋类型
</div>
@@ -330,7 +330,7 @@
}}
</span>
</div>
<div class="info dis-f al-item">
<div class="info dis-f al-item" v-if="housingInfo['data'] &&housingInfo['data'].info.elevator">
<div class="title-box">
所在楼层
</div>
@@ -349,7 +349,7 @@
}}
</span>
</div>
<div class="info dis-f al-item">
<div class="info dis-f al-item" v-if="housingInfo['data'] &&housingInfo['data'].info.sunshinearea">
<div class="title-box">
晾晒区
</div>
@@ -365,7 +365,7 @@
}}
</span>
</div>
<div class="info dis-f al-item" style="margin-top:30px;">
<div class="info dis-f al-item" style="margin-top:30px;" v-if="housingInfo['data'] && housingInfo['data'].info.acreage">
<div class="title-box">
面积
</div>
@@ -376,7 +376,7 @@
}} 平方呎
</span>
</div>
<div class="info dis-f al-item" style="margin-top:30px;">
<div class="info dis-f al-item" style="margin-top:30px;" v-if="housingInfo['data'] &&housingInfo['data'].info.gender">
<div class="title-box">
性别要求
</div>
@@ -595,7 +595,7 @@
v-if="pageType == 2 && housingInfo['data'] && housingInfo['data'].isintermediary == 1">
<img src="../assets/homeImage/intermediaryTabImg.png" class="intermediary-logo" alt="">
</div>
<div class="dis-f jus-x" v-if="pageType == 1">
<div class="dis-f jus-x" v-if="pageType == 1||(pageType == 2 && housingInfo['data'] && housingInfo['data'].isintermediary != 1)">
<div class="user-type">
{{
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;

View File

@@ -15,7 +15,7 @@
listId="2"></biserialItem>
</div>
</div>
<div v-show="seachSelectData.data.intermediary === '' && dataList.data && dataList.data.length > 0"
<div v-show="seachSelectData.data&&seachSelectData.data.intermediary === '' && dataList.data && dataList.data.length > 0"
ref="gridContainer">
<apartment-item v-for="item in listApartment" :item="item"></apartment-item>
</div>
@@ -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)
}