求房源页面+接口修改

This commit is contained in:
2023-07-28 18:50:22 +08:00
parent 902fd71ce2
commit 088e684466
9 changed files with 4101 additions and 4157 deletions

51
package-lock.json generated
View File

@@ -17,8 +17,7 @@
"vue-meta": "^3.0.0-alpha.2", "vue-meta": "^3.0.0-alpha.2",
"vue-router": "^4.0.3", "vue-router": "^4.0.3",
"vue3-lazyload": "^0.3.6", "vue3-lazyload": "^0.3.6",
"vuex": "^4.0.0", "vuex": "^4.0.0"
"vuex-persistedstate": "^4.1.0"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "~5.0.0", "@vue/cli-plugin-babel": "~5.0.0",
@@ -9044,12 +9043,6 @@
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
} }
}, },
"node_modules/shvl": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/shvl/-/shvl-2.0.3.tgz",
"integrity": "sha512-V7C6S9Hlol6SzOJPnQ7qzOVEWUQImt3BNmmzh40wObhla3XOYMe4gGiYzLrJd5TFa+cI2f9LKIRJTTKZSTbWgw==",
"deprecated": "older versions vulnerable to prototype pollution"
},
"node_modules/side-channel": { "node_modules/side-channel": {
"version": "1.0.4", "version": "1.0.4",
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz",
@@ -9954,27 +9947,6 @@
"vue": "^3.2.0" "vue": "^3.2.0"
} }
}, },
"node_modules/vuex-persistedstate": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/vuex-persistedstate/-/vuex-persistedstate-4.1.0.tgz",
"integrity": "sha512-3SkEj4NqwM69ikJdFVw6gObeB0NHyspRYMYkR/EbhR0hbvAKyR5gksVhtAfY1UYuWUOCCA0QNGwv9pOwdj+XUQ==",
"deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.",
"dependencies": {
"deepmerge": "^4.2.2",
"shvl": "^2.0.3"
},
"peerDependencies": {
"vuex": "^3.0 || ^4.0.0-rc"
}
},
"node_modules/vuex-persistedstate/node_modules/deepmerge": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz",
"integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/watchpack": { "node_modules/watchpack": {
"version": "2.4.0", "version": "2.4.0",
"resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz",
@@ -17167,11 +17139,6 @@
"integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==", "integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==",
"dev": true "dev": true
}, },
"shvl": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/shvl/-/shvl-2.0.3.tgz",
"integrity": "sha512-V7C6S9Hlol6SzOJPnQ7qzOVEWUQImt3BNmmzh40wObhla3XOYMe4gGiYzLrJd5TFa+cI2f9LKIRJTTKZSTbWgw=="
},
"side-channel": { "side-channel": {
"version": "1.0.4", "version": "1.0.4",
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz",
@@ -17819,22 +17786,6 @@
"@vue/devtools-api": "^6.0.0-beta.11" "@vue/devtools-api": "^6.0.0-beta.11"
} }
}, },
"vuex-persistedstate": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/vuex-persistedstate/-/vuex-persistedstate-4.1.0.tgz",
"integrity": "sha512-3SkEj4NqwM69ikJdFVw6gObeB0NHyspRYMYkR/EbhR0hbvAKyR5gksVhtAfY1UYuWUOCCA0QNGwv9pOwdj+XUQ==",
"requires": {
"deepmerge": "^4.2.2",
"shvl": "^2.0.3"
},
"dependencies": {
"deepmerge": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz",
"integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A=="
}
}
},
"watchpack": { "watchpack": {
"version": "2.4.0", "version": "2.4.0",
"resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz",

View File

@@ -16,8 +16,7 @@
"vue-meta": "^3.0.0-alpha.2", "vue-meta": "^3.0.0-alpha.2",
"vue-router": "^4.0.3", "vue-router": "^4.0.3",
"vue3-lazyload": "^0.3.6", "vue3-lazyload": "^0.3.6",
"vuex": "^4.0.0", "vuex": "^4.0.0"
"vuex-persistedstate": "^4.1.0"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "~5.0.0", "@vue/cli-plugin-babel": "~5.0.0",

View File

@@ -266,4 +266,3 @@ img {
display: none; display: none;
} }
</style> </style>

View File

@@ -185,7 +185,8 @@ let seachList = (item) => {
} }
//设置搜索数据 //设置搜索数据
let setSeachConditions = (type, data,second) => { let setSeachConditions = (type, data,second=null) => {
console.log(type,data,second)
if (type === 'rent') { if (type === 'rent') {
seachAllType['rent_min'] = data.min seachAllType['rent_min'] = data.min
seachAllType['rent_max'] = data.max seachAllType['rent_max'] = data.max
@@ -203,7 +204,11 @@ let setSeachConditions = (type, data,second) => {
if (type === 'location') { if (type === 'location') {
seachAllType.school = '' seachAllType.school = ''
} }
if(second){
seachAllType[second.type]=second.id
}
// console.log('seachAllType', seachAllType) // console.log('seachAllType', seachAllType)
// return
getDataList(seachAllType) getDataList(seachAllType)
} }

View File

@@ -656,6 +656,7 @@ let routerQuerySet = () => {
selectPosition.value = 'school' selectPosition.value = 'school'
schoolSelectObj.id = deconstructionSeachData.selectData.id schoolSelectObj.id = deconstructionSeachData.selectData.id
schoolSelectObj.title = deconstructionSeachData.selectData.name schoolSelectObj.title = deconstructionSeachData.selectData.name
setSeachCondition('school', schoolSelectObj.id )
} else if (deconstructionSeachData.type === 'types') { } else if (deconstructionSeachData.type === 'types') {
@@ -663,6 +664,7 @@ let routerQuerySet = () => {
hireTypeObj.id = deconstructionSeachData.selectData.id hireTypeObj.id = deconstructionSeachData.selectData.id
hireTypeObj.title = deconstructionSeachData.selectData.title hireTypeObj.title = deconstructionSeachData.selectData.title
hireTypeObj.hireId = type == 1 ? '合租' : type == 2 ? '整租' : '不限' hireTypeObj.hireId = type == 1 ? '合租' : type == 2 ? '整租' : '不限'
setSeachCondition('types', hireTypeObj.id )
} else if (deconstructionSeachData.type === 'location') { } else if (deconstructionSeachData.type === 'location') {
@@ -677,6 +679,9 @@ let routerQuerySet = () => {
hireTypeObj.title = deconstructionSeachData.cotenancyData.title hireTypeObj.title = deconstructionSeachData.cotenancyData.title
hireTypeObj.hireId = type == 1 ? '合租' : type == 2 ? '整租' : '不限' hireTypeObj.hireId = type == 1 ? '合租' : type == 2 ? '整租' : '不限'
} }
console.log(deconstructionSeachData)
setSeachCondition('location', deconstructionSeachData.selectData[0]?deconstructionSeachData.selectData:[deconstructionSeachData.areaItem.id],{type:'types',id:hireTypeObj.id} )
if(deconstructionSeachData.selectData[0]) if(deconstructionSeachData.selectData[0])
nextTick(() => { nextTick(() => {
setCheckBoxData(deconstructionSeachData.selectData)//设置地区选项 setCheckBoxData(deconstructionSeachData.selectData)//设置地区选项

View File

@@ -1,5 +1,4 @@
import { createStore } from 'vuex' import { createStore } from 'vuex'
import createPersistedstate from "vuex-persistedstate";
export default createStore({ export default createStore({
state: { state: {
@@ -35,15 +34,6 @@ export default createStore({
modules: { modules: {
}, },
plugins:[ plugins:[
createPersistedstate({
key:'data',
storage:window.sessionStorage,
reducer(val){
console.log('val',val)
return{
routeList:val.routeList
}
}
})
] ]
}) })

View File

@@ -412,6 +412,7 @@ const cloaseImageShow = (list, index) => {
} }
imageShow.value = !imageShow.value imageShow.value = !imageShow.value
} }
console.log('imageList',imageList)
// 房间类型 // 房间类型
let roomList = ref([]) let roomList = ref([])

View File

@@ -142,7 +142,8 @@
</div> </div>
</div> </div>
</div> </div>
<div class="image-box"> <div class="image-box" v-if="(housingInfo['data'] && housingInfo['data'].info && housingInfo['data'].info.video) ||
(housingInfo['data'] && housingInfo['data'].info && housingInfo['data'].info.picturegroup)">
<div class="dis-f al-item"> <div class="dis-f al-item">
<img src="../assets/img/detail/videoIcon.png" v-if="housingInfo['data'] && <img src="../assets/img/detail/videoIcon.png" v-if="housingInfo['data'] &&
housingInfo['data'].info.video && housingInfo['data'].info.video &&
@@ -609,7 +610,7 @@
<img src="../assets/homeImage/intermediaryTabImg.png" class="intermediary-logo" alt=""> <img src="../assets/homeImage/intermediaryTabImg.png" class="intermediary-logo" alt="">
</div> </div>
<div class="dis-f jus-x" <div class="dis-f jus-x"
v-if="pageType == 1 || (pageType == 2 && housingInfo['data'] && housingInfo['data'].isintermediary != 1)"> v-if="!(pageType == 2 && housingInfo['data'] && housingInfo['data'].isintermediary != 1)">
<div class="user-type"> <div class="user-type">
{{ {{
indexData['data'] && indexData['data'] &&
@@ -759,7 +760,7 @@
</div> </div>
<div class="dis-f jus-x bottom-tps" <div class="dis-f jus-x bottom-tps"
v-if="(pageType === 1&&recommendListData.length > 0) || (pageType === 2 && recommendListData.length > 0 && housingInfo['data'] && housingInfo['data'].isintermediary)"> v-if="(pageType === 1 && recommendListData.length > 0) || (pageType === 2 && recommendListData.length > 0 && housingInfo['data'] && housingInfo['data'].isintermediary)">
- {{ loadText }} - - {{ loadText }} -
</div> </div>
<footerTool class="mg-t-60"></footerTool> <footerTool class="mg-t-60"></footerTool>
@@ -1163,15 +1164,16 @@ let location = store.state.indexData.config && store.state.indexData.config.loca
let setNavigation = () => { 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()
if (!location) return if (!location) return
if (pageType.value == 1 || pageType.value == 2) { if (pageType.value == 1 || pageType.value == 2) {
// location=3.8,3.13&areaItem=3 // location=3.8,3.13&areaItem=3
// console.log(`${store.state.routeList['secondaryIndex'].path}/location/${JSON.stringify([housingInfo['data']['info'].location.substring(0, 1)])}`) // console.log(`${store.state.routeList['secondaryIndex'].path}/location/${JSON.stringify([housingInfo['data']['info'].location.substring(0, 1)])}`)
store.state.routeList['secondaryIndex'] = { store.state.routeList['secondaryIndex'] = {
path: pageType.value===2 ? '/intermediaryHousing' : path: pageType.value === 2 ? '/intermediaryHousing' :
pageType.value===3 ? '/needHousing' : '/personHousing', pageType.value === 3 ? '/needHousing' : '/personHousing',
title: pageType.value === 2 ? '中介房源' : title: pageType.value === 2 ? '中介房源' :
pageType.value===3 ? '求房源' : '个人房源' pageType.value === 3 ? '求房源' : '个人房源'
} }
store.state.routeList['thirdIndex'] = { store.state.routeList['thirdIndex'] = {
path: `${store.state.routeList['secondaryIndex'].path}`, path: `${store.state.routeList['secondaryIndex'].path}`,
@@ -1194,8 +1196,16 @@ let setNavigation = () => {
title: `${location[housingInfo['data']['info'].location]}${type[housingInfo['data']['info'].type]}` title: `${location[housingInfo['data']['info'].location]}${type[housingInfo['data']['info'].type]}`
} }
} else { } else {
store.state.routeList['thirdIndex'] = '' store.state.routeList = {
store.state.routeList['fourthIndex'] = '' index: {
path: '/',
title: '港校租房'
},
secondaryIndex: {
path: '/needHousing',
title:'求房源'
}
}
} }
} }
//中介数据 //中介数据
@@ -1212,7 +1222,7 @@ let getHousingInfo = () => {
console.log(res) console.log(res)
if (res.code === 200) { if (res.code === 200) {
housingInfo['data'] = res.data housingInfo['data'] = res.data
pageType.value =housingInfo['data']['info'].intermediary===1?2:housingInfo['data']['info'].intermediary===6?3:1 //1个人 2中介 3求房源 pageType.value = housingInfo['data']['info'].intermediary === 1 ? 2 : housingInfo['data']['info'].intermediary === 6 ? 3 : 1 //1个人 2中介 3求房源
setHousingArr() setHousingArr()
setNavigation() setNavigation()
distanceList.value = housingInfo['data']['info'].pointData || [] distanceList.value = housingInfo['data']['info'].pointData || []
@@ -1226,6 +1236,8 @@ let getHousingInfo = () => {
getPublisherList() getPublisherList()
} else if (pageType.value != 3) { } else if (pageType.value != 3) {
recommendList() recommendList()
} else {
loadMore.value = false
} }
} else { } else {
@@ -1396,7 +1408,7 @@ let route = useRoute()
watch(route, () => { watch(route, () => {
let { id } = router.currentRoute.value.query let { id } = router.currentRoute.value.query
uniqid.value = id uniqid.value = id
pageType.value = housingInfo['data']['info'].intermediary===1?2:housingInfo['data']['info'].intermediary===6?3:1 //1个人 2中介 3求房源 pageType.value = housingInfo['data']['info'].intermediary === 1 ? 2 : housingInfo['data']['info'].intermediary === 6 ? 3 : 1 //1个人 2中介 3求房源
publisherList.value = [] publisherList.value = []
recommendListData.value = [] recommendListData.value = []
getHousingInfo() getHousingInfo()

8144
yarn.lock

File diff suppressed because it is too large Load Diff