搜索为空可以跳转搜索页

This commit is contained in:
2023-07-21 16:14:58 +08:00
parent a8e75b0f98
commit da63d7358e
3 changed files with 12 additions and 8 deletions

View File

@@ -3,7 +3,7 @@
<div class="body-maxWidth ">
<div class="input-box dis-f al-item jus-bet body-maxWidth">
<div class="dis-f al-item">
<el-input v-model="seachVal" class="input-s" placeholder="输入关键字" @keyup.enter='seachList'>
<el-input v-model="seachVal" class="input-s" placeholder="搜索房源或输入房源ID" @keyup.enter='seachList'>
<template #suffix>
<img src="../../assets/homeImage/seachIcon.svg" class="icon" alt="" @click="seachList">
</template>
@@ -181,6 +181,7 @@ let selectTabBoxInfo = ref(null)//个人/中介筛选实例
let apartmentSelectInfo = ref(null)//公寓筛选实例
//设置请求数据
let selectPage = (type) => {
if(type===seachAllType['tabType'])return
if (type === 'apartment') {
selectTabBoxInfo.value.cleanSelect()//清空筛选数据
} else {
@@ -211,7 +212,7 @@ let getDataList = props.getDataList
//搜索内容
let seachVal = ref('')
let isNeedHousing = ref(false)
seachVal.value = route.currentRoute.value.query.keyword
seachVal.value = route.currentRoute.value.query.keyword.replace(/\s/g, "")
//判断是否从求房源页面跳转
isNeedHousing.value = route.currentRoute.value.query.isNeedHousing === 'true'
@@ -235,6 +236,7 @@ let checkPageType = () => {
} else {
seachAllType['intermediary'] = ''
}
getDataList(seachAllType)
}
@@ -379,8 +381,6 @@ let setListCount=(item,num)=>{
}
}
//调用判断页面
checkPageType()
watchEffect(() => {
seachArea.data = store.state.seachTypeData[1] ? store.state.seachTypeData[1].where : []
@@ -388,7 +388,8 @@ watchEffect(() => {
})
defineExpose({
searchInit,
setListCount
setListCount,
checkPageType
})
</script>