个人/中介房源 求房源页面
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="seachAllType.seachValue" placeholder="搜索房源或输入房源ID" @keyup.enter='seachList'
|
||||
<el-input v-model="seachAllType.keyword" 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,8 +24,8 @@
|
||||
<div class="title">
|
||||
历史搜索
|
||||
</div>
|
||||
<div class="info-box" @click="setSeachVal(item)">
|
||||
<div v-for="(item, i) in historyArr.data" :key="i" class="btn">
|
||||
<div class="info-box">
|
||||
<div v-for="(item, i) in historyArr.data" :key="i" class="btn" @click="setSeachVal(item)">
|
||||
{{ item }}
|
||||
</div>
|
||||
</div>
|
||||
@@ -35,7 +35,7 @@
|
||||
热门推荐
|
||||
</div>
|
||||
<div class="info-box">
|
||||
<div v-for="(item, i) in hotArr.data" :key="i" class="btn">
|
||||
<div v-for="(item, i) in hotArr.data" :key="i" class="btn" @click="setHotSeach(item)">
|
||||
{{ item }}
|
||||
</div>
|
||||
</div>
|
||||
@@ -105,6 +105,12 @@ let getDataList = props.getDataList
|
||||
//搜索框
|
||||
let historyShow = ref(false);
|
||||
let setHistoryShow = () => {
|
||||
if(historyShow.value){
|
||||
setTimeout(() => {
|
||||
historyShow.value = !historyShow.value
|
||||
},500);
|
||||
return
|
||||
}
|
||||
historyShow.value = !historyShow.value
|
||||
}
|
||||
let seachSchoolBtn = reactive({ data: [] });//学校地区
|
||||
@@ -114,9 +120,8 @@ let seachArea = {};//区域找房
|
||||
let historyArr = reactive({ data: [] })//历史查找记录
|
||||
let hotArr = reactive({ data: [] })
|
||||
let seachAllType = reactive({
|
||||
seachValue: '',
|
||||
location: [],
|
||||
types: ''
|
||||
keyword: '',
|
||||
location: []
|
||||
})
|
||||
|
||||
|
||||
@@ -151,14 +156,12 @@ watchEffect(() => {
|
||||
historyArr.data = JSON.parse(localStorage.getItem('historyArr')) || []
|
||||
|
||||
//搜索数据
|
||||
let seachList = () => {
|
||||
console.log()
|
||||
let data = {
|
||||
searchid: seachAllType.seachValue,
|
||||
types: ''
|
||||
let seachList = (item) => {
|
||||
if(historyArr.data.indexOf(seachAllType.keyword)===-1){
|
||||
historyArr.data.push(seachAllType.keyword)
|
||||
}
|
||||
localStorage.setItem('historyArr', JSON.stringify(historyArr.data));
|
||||
getDataList(data)
|
||||
getDataList(seachAllType)
|
||||
}
|
||||
|
||||
//设置搜索数据
|
||||
@@ -173,13 +176,21 @@ let setSeachConditions = (type, data) => {
|
||||
data.indexOf('iselevator')!==-1?seachAllType['iselevator']=1:seachAllType['iselevator']=0
|
||||
data.indexOf('issunshinearea')!==-1?seachAllType['issunshinearea']=1:seachAllType['issunshinearea']=0
|
||||
}
|
||||
console.log(seachAllType)
|
||||
getDataList(seachAllType)
|
||||
}
|
||||
|
||||
//点击历史搜索记录
|
||||
let setSeachVal = (item) => {
|
||||
seachAllType.seachValue = item
|
||||
seachList()
|
||||
seachAllType.keyword = item
|
||||
getDataList(seachAllType)
|
||||
}
|
||||
|
||||
//点击热门地区
|
||||
let setHotSeach=(item)=>{
|
||||
seachAllType.keyword = item
|
||||
if(historyArr.data.indexOf(item)===-1)historyArr.data.push(item)
|
||||
localStorage.setItem('historyArr', JSON.stringify(historyArr.data));
|
||||
getDataList(seachAllType)
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user