From a198607e0afbcb1391f8f25dec113a1390fe52d5 Mon Sep 17 00:00:00 2001 From: luJianJun <2587063613@qq.com> Date: Mon, 17 Jul 2023 18:56:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E6=88=BF=E6=BA=90---?= =?UTF-8?q?=E5=B7=AE=E4=B8=8B=E6=8B=89=E6=9B=B4=E5=A4=9A=20=20=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/seachModule/seachModule.vue | 61 +- src/components/selectTabBox/selectTabBox.vue | 313 +- src/views/housingView/person.vue | 20 +- yarn.lock | 8108 +++++++++--------- 4 files changed, 4316 insertions(+), 4186 deletions(-) diff --git a/src/components/seachModule/seachModule.vue b/src/components/seachModule/seachModule.vue index cc32ba3..cba4e77 100644 --- a/src/components/seachModule/seachModule.vue +++ b/src/components/seachModule/seachModule.vue @@ -12,7 +12,7 @@
-
@@ -24,7 +24,7 @@
历史搜索
-
+
{{ item }}
@@ -74,9 +74,8 @@
- - {{ counti }} + v-if="routePath === '/personHousing' || routePath === '/intermediaryHousing' || routePath === '/needHousing'"> +
@@ -92,16 +91,18 @@ import { useRoute } from 'vue-router'; import store from '../../store/index'; import api from "../../utils/api"; -const props=defineProps({ - count:{ - type:Number, - default:0 +const props = defineProps({ + getDataList: { + type: Function } }) -let counti = ref(0) + +//数据包 +let configData = store.state.indexData.config + +let getDataList = props.getDataList //搜索框 -let seachValue = ref('') let historyShow = ref(false); let setHistoryShow = () => { historyShow.value = !historyShow.value @@ -112,6 +113,12 @@ let allHireType = {};//合租 let seachArea = {};//区域找房 let historyArr = reactive({ data: [] })//历史查找记录 let hotArr = reactive({ data: [] }) +let seachAllType = reactive({ + seachValue: '', + location: [], + types: '' +}) + //获取区域下列数据 let getLocationData = (data) => { @@ -138,7 +145,6 @@ 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) hotArr.data = store.state.indexData.hotSearcheWords - counti.value=props.count }) //获取历史搜索记录 @@ -146,14 +152,39 @@ historyArr.data = JSON.parse(localStorage.getItem('historyArr')) || [] //搜索数据 let seachList = () => { - + console.log() + let data = { + searchid: seachAllType.seachValue, + types: '' + } localStorage.setItem('historyArr', JSON.stringify(historyArr.data)); + getDataList(data) +} + +//设置搜索数据 +let setSeachConditions = (type, data) => { + if (type === 'rent') { + seachAllType['rent_min'] = data.min + seachAllType['rent_max'] = data.max + } else if(type!==''){ + seachAllType[type] = data + }else if(type===''){ + data.indexOf('isverified')!==-1?seachAllType['isverified']=1:seachAllType['isverified']=0 + data.indexOf('iselevator')!==-1?seachAllType['iselevator']=1:seachAllType['iselevator']=0 + data.indexOf('issunshinearea')!==-1?seachAllType['issunshinearea']=1:seachAllType['issunshinearea']=0 + } + console.log(seachAllType) +} + +//点击历史搜索记录 +let setSeachVal = (item) => { + seachAllType.seachValue = item + seachList() } defineExpose({ - historyShow, - seachValue + historyShow })