From 3c4571fd532c8bce55fa0c88a52ff6a58a8c6913 Mon Sep 17 00:00:00 2001 From: A1300399510 Date: Tue, 1 Aug 2023 15:18:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=90=9C=E7=B4=A2=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E7=9A=84=E6=88=91=E7=9A=84=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/seachPage/input.vue | 47 +++++++++++++++++------------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/src/components/seachPage/input.vue b/src/components/seachPage/input.vue index 0586365..0f70bbd 100644 --- a/src/components/seachPage/input.vue +++ b/src/components/seachPage/input.vue @@ -18,7 +18,7 @@ 我的收藏 -
+
我的发布
@@ -55,7 +55,7 @@
-
@@ -74,7 +74,8 @@ 中介房源 {{ seachKey.key && seachKey.key.intermediary && seachKey.key.intermediary.count }}
+ :class="{ 'select-top-btn-bg': tabType === 'apartment' }" + v-if="!isNeedHousing && houseingPageType != 6">
@@ -197,7 +198,7 @@ let selectTabBoxInfo = ref(null)//个人/中介筛选实例 let apartmentSelectInfo = ref(null)//公寓筛选实例 //设置请求数据 let selectPage = (type) => { - if (type === seachAllType['tabType']||houseingPageType==6) return + if (type === seachAllType['tabType'] || houseingPageType == 6) return if (type === 'apartment') { selectTabBoxInfo.value.cleanSelect()//清空筛选数据 } else { @@ -215,13 +216,13 @@ let selectPage = (type) => { seachAllType['searchid'] = setPageKey() if (type === 'person') { seachAllType['intermediary'] = 0 - houseingPageType='0' - sessionStorage.setItem('houseingPageType',0) + houseingPageType = '0' + sessionStorage.setItem('houseingPageType', 0) selectTabBoxInfo.value.routerQuerySet() } else if (type === 'intermediary') { seachAllType['intermediary'] = 1 - houseingPageType='1' - sessionStorage.setItem('houseingPageType',1) + houseingPageType = '1' + sessionStorage.setItem('houseingPageType', 1) // route.currentRoute.value.query.houseingPageType='1' selectTabBoxInfo.value.routerQuerySet() } else { @@ -235,14 +236,14 @@ let getDataList = props.getDataList //搜索内容 let seachVal = ref('') let isNeedHousing = ref(false) -seachVal.value = route.currentRoute.value.query.keyword&&route.currentRoute.value.query.keyword.replace(/\s/g, "") +seachVal.value = route.currentRoute.value.query.keyword && route.currentRoute.value.query.keyword.replace(/\s/g, "") //判断是否从求房源页面跳转 isNeedHousing.value = route.currentRoute.value.query.isNeedHousing === 'true' //判断当前是什么页面 let houseingPageType = sessionStorage.getItem('houseingPageType') -console.log('houseingPageType',houseingPageType) +console.log('houseingPageType', houseingPageType) let type = houseingPageType === '0' ? 'person' : houseingPageType === '1' ? 'intermediary' : houseingPageType === '6' ? 'need' : 'apartment' tabType.value = type @@ -250,7 +251,7 @@ tabType.value = type let checkPageType = () => { // houseingPageType 0个人 1中介 6求房源 let type = houseingPageType === '0' ? 'person' : houseingPageType === '1' ? 'intermediary' : houseingPageType === '6' ? 'need' : 'apartment' - console.log('type',type) + console.log('type', type) tabType.value = type seachAllType['tabType'] = type if (type === 'person') { @@ -285,14 +286,14 @@ let seachAllType = reactive({ }) //直接输入url -if(isNeedHousing.value){ +if (isNeedHousing.value) { tabType.value = 'need' seachAllType['intermediary'] = 6 } //设置搜索数据 let setSeachConditions = (type, data) => { - console.log(1,seachAllType) + console.log(1, seachAllType) console.log(type.value) if (seachAllType['tabType'] !== 'apartment') { if (type === 'rent') { @@ -313,7 +314,7 @@ let setSeachConditions = (type, data) => { } } else { seachAllType = { - tabType:'apartment', + tabType: 'apartment', ...type.value } } @@ -359,10 +360,10 @@ let seachList = (item) => { searchInit(seachVal.value) } route.push({ - path:routeInfo.path, - query:{ - keyword:seachVal.value, - isNeedHousing:routeInfo.query.isNeedHousing + path: routeInfo.path, + query: { + keyword: seachVal.value, + isNeedHousing: routeInfo.query.isNeedHousing } }) } @@ -438,7 +439,13 @@ defineExpose({ }) // 跳转我的页面 -const gouser = tab => route.push(`/user?tab=${tab}`) +const gouser = tab => { + if (!store.state['user']['uid']) { + store.state.showloginmodal = true + return + } + route.push(`/user?tab=${tab}`) +}