diff --git a/src/components/apartment/seachModule.vue b/src/components/apartment/seachModule.vue index f4031d8..4cf62a2 100644 --- a/src/components/apartment/seachModule.vue +++ b/src/components/apartment/seachModule.vue @@ -69,10 +69,10 @@
学校附近
-
不限
{{ item['name'] }}
@@ -80,17 +80,17 @@
租金
- ~ HK$/月 + ~ HK$/月
房型
-
不限
-
{{ item['name'] }}
@@ -102,9 +102,9 @@
品牌
-
不限
-
{{ item['name'] }}
@@ -112,9 +112,10 @@
楼型
-
不限
-
{{ item['name'] }}
@@ -151,13 +152,10 @@ const props = defineProps({ } }) -const emit = defineEmits(['close']) +const emit = defineEmits(['handleTransfer']) let state = ref('pack') // 筛选状态 unfold 展开 pack 收起 -let rent_min = ref(null) // 租金 -let rent_max = ref(null) // 租金 - //搜索框 let seachValue = ref('') let historyShow = ref(false); @@ -177,6 +175,17 @@ let brandList = reactive([]); let brandValue = ref(0); //学校附近选中值 +let pitchValue = ref({ + companyid: 0, + roomtype: 0, + rent_min: null, // 租金 + rent_max: null, // 租金 + school: 0, + roomlistings: 0, +}) + + + let historyArr = reactive({ data: [] })//历史查找记录 let hotArr = reactive({ data: [] }) @@ -197,27 +206,27 @@ historyArr.data = JSON.parse(localStorage.getItem('historyArr')) || [] //搜索数据 let seachList = () => localStorage.setItem('historyArr', JSON.stringify(historyArr.data)); - // 选择选项 const selectOption = (type, value) => { switch (type) { case 'nearSchool': - nearSchoolListValue.value = value + pitchValue.value['school'] = value break; case 'roomType': - roomTypeValue.value = value + pitchValue.value['roomtype'] = value break; case 'brand': - console.log("djkdkdk"); - brandValue.value = value + pitchValue.value['companyid'] = value break; case 'roomlistings': - roomlistingsValue.value = value + pitchValue.value['roomlistings'] = value break; default: break; } + console.log(pitchValue.value); + emit('handleTransfer', pitchValue) } diff --git a/src/components/edit/choosingIdentity.vue b/src/components/edit/choosingIdentity.vue index c246962..90eabd8 100644 --- a/src/components/edit/choosingIdentity.vue +++ b/src/components/edit/choosingIdentity.vue @@ -2,6 +2,7 @@
+
发布房源
请选择:
diff --git a/src/views/housingView/apartment.vue b/src/views/housingView/apartment.vue index da10cd0..aabf3e1 100644 --- a/src/views/housingView/apartment.vue +++ b/src/views/housingView/apartment.vue @@ -3,7 +3,7 @@
- +
@@ -59,7 +59,7 @@ let loading = ref(null) // 加载 let page = 1 const getData = () => { - if (page == 0) return + if (page == 0 || loading['visible']) return loading = ElLoading.service({ @@ -75,8 +75,6 @@ const getData = () => { let data = res.data list.value = list.value.concat(data.data) page = data.page * data.limit >= data.count ? 0 : page + 1, - - nextTick(() => { masonryInstance.reloadItems(); masonryInstance.layout(); @@ -103,8 +101,8 @@ const handleScroll = () => { }; // 筛选组件的参数的中转 -const handleTransfer = () => { - +const handleTransfer = (data) => { + console.log("data", data); }