- 求房源 {{ seachKey.key&&seachKey.key.personal&&seachKey.key.personal.count }}
-
- 求房源 {{ seachKey.key&&seachKey.key.personal&&seachKey.key.personal.count }}
-
-
-
-
+
-
+
@@ -65,9 +60,9 @@
- 中介房源 {{ seachKey.key&&seachKey.key.intermediary&&seachKey.key.intermediary.count }}
+ 中介房源 {{ seachKey.key && seachKey.key.intermediary && seachKey.key.intermediary.count }}
- 中介房源 {{ seachKey.key&&seachKey.key.intermediary&&seachKey.key.intermediary.count }}
+ 中介房源 {{ seachKey.key && seachKey.key.intermediary && seachKey.key.intermediary.count }}
@@ -78,9 +73,9 @@
- 品牌公寓 {{ seachKey.key&&seachKey.key.studentapartment&&seachKey.key.studentapartment.count }}
+ 品牌公寓 {{ seachKey.key && seachKey.key.studentapartment && seachKey.key.studentapartment.count }}
- 学生公寓 {{ seachKey.key&&seachKey.key.studentapartment&&seachKey.key.studentapartment.count }}
+ 学生公寓 {{ seachKey.key && seachKey.key.studentapartment && seachKey.key.studentapartment.count }}
@@ -209,20 +204,47 @@ let selectPage = (type) => {
} else {
seachAllType['intermediary'] = ''
}
- getDataList(seachAllType, tabType.value)
+ getDataList(seachAllType)
}
let getDataList = props.getDataList
//搜索内容
let seachVal = ref('')
-let isNeedHousing=ref(false)
+let isNeedHousing = ref(false)
seachVal.value = route.currentRoute.value.query.keyword
//判断是否从求房源页面跳转
-isNeedHousing.value = route.currentRoute.value.query.isNeedHousing==='true'
+isNeedHousing.value = route.currentRoute.value.query.isNeedHousing === 'true'
+
+//判断当前是什么页面
+let houseingPageType = route.currentRoute.value.query.houseingPageType
+
+//页面判断
+let checkPageType = () => {
+ // houseingPageType 0个人 1中介 6求房源
+ let type = houseingPageType === '0' ? 'person' : houseingPageType === '1' ? 'intermediary' : houseingPageType === '6' ? 'need' : 'apartment'
+ tabType.value = type
+ seachAllType['tabType'] = type
+ if (type === 'person') {
+ seachAllType['intermediary'] = 0
+ } else if (type === 'intermediary') {
+ seachAllType['intermediary'] = 1
+ } else if (type === 'need') {
+ seachAllType['intermediary'] = 6
+ seachAllType['keyword'] = seachVal.value
+ } else {
+ seachAllType['intermediary'] = ''
+ }
+}
+
+
//搜索key
-let seachKey = reactive({ key: {} })
+let seachKey = reactive({ key: {
+ personal:{},
+ intermediary:{},
+ studentapartment:{}
+} })
//搜索数据
let seachAllType = reactive({
@@ -255,27 +277,26 @@ let setSeachConditions = (type, data) => {
...data
}
}
- if(!seachVal.value){
- seachAllType.searchid=''
+ if (!seachVal.value) {
+ seachAllType.searchid = ''
}
// console.log('seachAllType', seachAllType)
// return
- getDataList(seachAllType, tabType.value)
+ getDataList(seachAllType)
}
//设置当前搜索key
let setPageKey = () => {
- return tabType.value === 'person' ? seachKey.key.personal.searchid : tabType.value === 'intermediary' ? seachKey.key.intermediary.searchid : seachKey.key.studentapartment.searchid
+ return tabType.value === 'person' ? seachKey.key.personal.searchid : tabType.value === 'intermediary' ? seachKey.key.intermediary.searchid : tabType.value === 'apartment' ? seachKey.key.studentapartment.searchid : ''
}
//搜索初始化
let searchInit = (data) => {
- console.log(123456)
api.search({ keyword: data }).then(res => {
if (res.code === 200) {
seachKey.key = res.data
seachAllType.searchid = setPageKey()
- getDataList(seachAllType, tabType.value)
+ getDataList(seachAllType)
} else {
ElMessage({
message: res.message,
@@ -286,11 +307,16 @@ let searchInit = (data) => {
}
//搜索数据
let seachList = (item) => {
- if(!seachVal.value.replace(/\s/g,""))return
+ if (!seachVal.value.replace(/\s/g, "")) return
if (!seachVal.value) {
return
}
- searchInit(seachVal.value)
+ if(seachAllType['intermediary']===6){
+ seachAllType['keyword']=seachVal.value
+ getDataList(seachAllType)
+ }else{
+ searchInit(seachVal.value)
+ }
}
//筛选词条
@@ -339,6 +365,9 @@ let getLocationData = (data) => {
}
}
+//调用判断页面
+checkPageType()
+
watchEffect(() => {
seachArea.data = store.state.seachTypeData[1] ? store.state.seachTypeData[1].where : []
if (seachArea.data.length > 0 && !seachArea.data[0].data) getLocationData(store.state.indexData.config.location)
diff --git a/src/main.js b/src/main.js
index cd98fd1..149c0ca 100644
--- a/src/main.js
+++ b/src/main.js
@@ -41,7 +41,6 @@ import Axios from '@/utils/axios';
api.index().then(res => {
if (res.code === 200) {
- console.log(123)
store.state.seachTypeData = res.data.combination
store.state.indexData = res.data
store.state.ListSelectBtn = res.data.recommendedTab
diff --git a/src/router/index.js b/src/router/index.js
index e937954..bd01a92 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -104,10 +104,6 @@ router.beforeEach((to, from, next) => {
store.state.routeList.secondaryIndex.title = from.meta.title
store.state.routeList.secondaryIndex.path = from.path
}
-
- //
- // =======
- console.log(to, from);
// >>>>>>> 542e853 (提交)
next()
let meta = to['meta'] || {}
diff --git a/src/toolJs/downLoadMore.js b/src/toolJs/downLoadMore.js
index 5433e00..6290aa8 100644
--- a/src/toolJs/downLoadMore.js
+++ b/src/toolJs/downLoadMore.js
@@ -6,7 +6,7 @@ const loadMore = (loadFunction) => {
let scrollTop = body.scrollTop
let clientHeight = body.clientHeight
let offsetHeight = body.offsetHeight
- if (scrollTop + clientHeight === offsetHeight) {
+ if (scrollTop + clientHeight >= offsetHeight-200) {
loadFunction()
}
}
diff --git a/src/views/housingView/intermediary.vue b/src/views/housingView/intermediary.vue
index a046a84..e937688 100644
--- a/src/views/housingView/intermediary.vue
+++ b/src/views/housingView/intermediary.vue
@@ -19,6 +19,7 @@