From 0b3643e04d464ee4f7ece7e88a5d2688ab634832 Mon Sep 17 00:00:00 2001 From: luJianJun <2587063613@qq.com> Date: Mon, 31 Jul 2023 16:11:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8A=A0=E8=BD=BD=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E8=AF=AD=20=20=20=20=E6=B7=BB=E5=8A=A0=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E5=90=8C=E6=AD=A5url=20=20=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E9=A1=B5=E6=90=9C=E7=B4=A2=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 5 ++ src/components/seachModule/seachModule.vue | 3 +- src/components/seachPage/input.vue | 19 +++++-- src/components/selectTabBox/selectTabBox.vue | 1 + src/views/HomeView.vue | 54 ++++++++++++++------ src/views/detail.vue | 8 +-- src/views/housingView/intermediary.vue | 7 +-- src/views/housingView/needHousing.vue | 7 +-- src/views/housingView/person.vue | 7 +-- src/views/seachIndex.vue | 37 ++------------ 10 files changed, 80 insertions(+), 68 deletions(-) diff --git a/src/App.vue b/src/App.vue index c3e2718..07efd99 100644 --- a/src/App.vue +++ b/src/App.vue @@ -73,6 +73,11 @@ img { width: 1200px; } +.box-min-1200-src{ + min-width:1200px; + overflow-x: scroll; +} + /* // 全局css 加上以下代码,可以隐藏上下箭头 */ /* // 取消input的上下箭头 */ diff --git a/src/components/seachModule/seachModule.vue b/src/components/seachModule/seachModule.vue index 4b457ee..00b42b6 100644 --- a/src/components/seachModule/seachModule.vue +++ b/src/components/seachModule/seachModule.vue @@ -175,19 +175,18 @@ let seachList = (item) => { historyArr.data.push(seachAllType.keyword) } localStorage.setItem('historyArr', JSON.stringify(historyArr.data)); + sessionStorage.setItem('houseingPageType',routePath.value === '/needHousing' ? '6' : routePath.value === '/intermediaryHousing' ? '1' : routePath.value === '/personHousing' ? '0' : '0') route.push({ path: '/seachPage', query: { keyword: seachAllType.keyword, isNeedHousing: routePath.value === '/needHousing', - houseingPageType: routePath.value === '/needHousing' ? 6 : routePath.value === '/intermediaryHousing' ? 1 : routePath.value === '/personHousing' ? 0 : 0 } }) } //设置搜索数据 let setSeachConditions = (type, data,second=null) => { - console.log(type,data,second) if (type === 'rent') { seachAllType['rent_min'] = data.min seachAllType['rent_max'] = data.max diff --git a/src/components/seachPage/input.vue b/src/components/seachPage/input.vue index 32eed59..097aff9 100644 --- a/src/components/seachPage/input.vue +++ b/src/components/seachPage/input.vue @@ -215,11 +215,14 @@ let selectPage = (type) => { seachAllType['searchid'] = setPageKey() if (type === 'person') { seachAllType['intermediary'] = 0 - route.currentRoute.value.query.houseingPageType='0' + houseingPageType='0' + sessionStorage.setItem('houseingPageType',0) selectTabBoxInfo.value.routerQuerySet() } else if (type === 'intermediary') { seachAllType['intermediary'] = 1 - route.currentRoute.value.query.houseingPageType='1' + houseingPageType='1' + sessionStorage.setItem('houseingPageType',1) + // route.currentRoute.value.query.houseingPageType='1' selectTabBoxInfo.value.routerQuerySet() } else { seachAllType['intermediary'] = '' @@ -238,8 +241,8 @@ seachVal.value = route.currentRoute.value.query.keyword&&route.currentRoute.valu isNeedHousing.value = route.currentRoute.value.query.isNeedHousing === 'true' //判断当前是什么页面 -let houseingPageType = route.currentRoute.value.query.houseingPageType -console.log('houseingPageType',route.currentRoute.value.query) +let houseingPageType = sessionStorage.getItem('houseingPageType') +console.log('houseingPageType',houseingPageType) let type = houseingPageType === '0' ? 'person' : houseingPageType === '1' ? 'intermediary' : houseingPageType === '6' ? 'need' : 'apartment' tabType.value = type @@ -336,6 +339,7 @@ let searchInit = (data) => { } //搜索数据 let seachList = (item) => { + let routeInfo = route.currentRoute.value if (!seachVal.value.replace(/\s/g, "")) return if (!seachVal.value) { return @@ -346,6 +350,13 @@ let seachList = (item) => { } else { searchInit(seachVal.value) } + route.push({ + path:routeInfo.path, + query:{ + keyword:seachVal.value, + isNeedHousing:routeInfo.query.isNeedHousing + } + }) } //筛选词条 diff --git a/src/components/selectTabBox/selectTabBox.vue b/src/components/selectTabBox/selectTabBox.vue index b19424c..607a4f3 100644 --- a/src/components/selectTabBox/selectTabBox.vue +++ b/src/components/selectTabBox/selectTabBox.vue @@ -637,6 +637,7 @@ let setRouterQuerySet = ref(true) let routerQuerySet = () => { if(routePath.value==='/seachPage'){ deconstructionSeachData = routeQuery.data + deconstructionSeachData.houseingPageType=sessionStorage.getItem('houseingPageType') }else{ deconstructionSeachData = deconstructionData(routeQuery.data) } diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index 18363ae..c61012c 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -1,5 +1,5 @@