个人房源---差下拉更多 搜索信息
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
<div class="triangle"></div>
|
||||
</div>
|
||||
<div class="dis-f al-item pos-r">
|
||||
<el-input v-model="seachValue" placeholder="搜索房源或输入房源ID" @keyup.enter='seachList'
|
||||
<el-input v-model="seachAllType.seachValue" placeholder="搜索房源或输入房源ID" @keyup.enter='seachList'
|
||||
@blur="setHistoryShow" @focus="setHistoryShow" style="height:48px;width:460px;"></el-input>
|
||||
<div class="seach-btn dis-f al-item jus-x" @click="seachList">
|
||||
<img src="../../assets/homeImage/seachImg.svg" class="img" alt="">
|
||||
@@ -24,7 +24,7 @@
|
||||
<div class="title">
|
||||
历史搜索
|
||||
</div>
|
||||
<div class="info-box">
|
||||
<div class="info-box" @click="setSeachVal(item)">
|
||||
<div v-for="(item, i) in historyArr.data" :key="i" class="btn">
|
||||
{{ item }}
|
||||
</div>
|
||||
@@ -74,9 +74,8 @@
|
||||
</div>
|
||||
<!-- -->
|
||||
<div
|
||||
v-if="routePath === '/personHousing' || routePath === '/intermediaryHousing' || routePath === '/needHousing'" :count="counti">
|
||||
<selectTabBox></selectTabBox>
|
||||
{{ counti }}
|
||||
v-if="routePath === '/personHousing' || routePath === '/intermediaryHousing' || routePath === '/needHousing'">
|
||||
<selectTabBox :setSeachCondition="setSeachConditions"></selectTabBox>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -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
|
||||
})
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
Reference in New Issue
Block a user