首页
This commit is contained in:
@@ -12,8 +12,8 @@
|
||||
<div class="triangle"></div>
|
||||
</div>
|
||||
<div class="dis-f al-item pos-r">
|
||||
<el-input v-model="seachValue" placeholder="搜索房源或输入房源ID" @keyup.enter='seachList' @blur="setHistoryShow"
|
||||
@focus="setHistoryShow" style="height:48px;width:460px;"></el-input>
|
||||
<el-input v-model="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="">
|
||||
搜索
|
||||
@@ -51,23 +51,29 @@
|
||||
<img src="../../assets/homeImage/addBtn.png" class="img" alt="">
|
||||
发布房源
|
||||
</div>
|
||||
<div class=" dis-f jus-x al-item authentication-btn" v-if="routePath==='/personHousing'">
|
||||
<div class=" dis-f jus-x al-item authentication-btn" v-if="routePath === '/personHousing'">
|
||||
<img src="../../assets/homeImage/authenticationBtnImg.png" class="text-img" alt="">
|
||||
<img src="../../assets/homeImage/authenticationBtnCode.svg" class="code-img" alt="">
|
||||
<img src="../../assets/homeImage/personAuthentication.svg" class="btn-qrcode" alt="">
|
||||
</div>
|
||||
<div class=" dis-f jus-x al-item authentication-btn intermediary-btn" v-if="routePath==='/intermediaryHousing'">
|
||||
<div class=" dis-f jus-x al-item authentication-btn intermediary-btn"
|
||||
v-if="routePath === '/intermediaryHousing'">
|
||||
<img src="../../assets/homeImage/intermediaryText.png" class="text-img" alt="">
|
||||
<img src="../../assets/homeImage/intermediaryCode.svg" class="code-img" alt="">
|
||||
<img src="../../assets/homeImage/intermediaryAuthentication.svg" class="btn-qrcode" alt="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="seach-info-box dis-f" v-if="routePath==='/'">
|
||||
<seachInfo title="学校附近" :btn="seachSchoolBtn.data" seachType="1" v-if="seachSchoolBtn.data.length"></seachInfo>
|
||||
<div class="seach-info-box dis-f" v-if="routePath === '/'">
|
||||
<seachInfo title="学校附近" :btn="seachSchoolBtn.data" seachType="1" v-if="seachSchoolBtn.data.length">
|
||||
</seachInfo>
|
||||
<seachInfo title="合租" seachType="2" :btn="hireType.data" v-if="hireType.data.length"></seachInfo>
|
||||
<seachInfo title="区域找房" seachType="3" style="margin-top:30px;" :btn="seachArea.data" v-if="seachArea.data.length"></seachInfo>
|
||||
<seachInfo title="整租" seachType="2" style="margin-top:30px;" :btn="allHireType.data" v-if="allHireType.data.length"></seachInfo>
|
||||
<seachInfo title="区域找房" seachType="3" style="margin-top:30px;" :btn="seachArea.data"
|
||||
v-if="seachArea.data.length"></seachInfo>
|
||||
<seachInfo title="整租" seachType="2" style="margin-top:30px;" :btn="allHireType.data"
|
||||
v-if="allHireType.data.length"></seachInfo>
|
||||
</div>
|
||||
<!-- -->
|
||||
<div v-if="routePath==='/personHousing'||routePath==='/intermediaryHousing'">
|
||||
<div v-if="routePath === '/personHousing' || routePath === '/intermediaryHousing'||routePath === '/needHousing'">
|
||||
<selectTabBox></selectTabBox>
|
||||
</div>
|
||||
</div>
|
||||
@@ -77,7 +83,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, watchEffect,reactive,watch } from 'vue';
|
||||
import { ref, watchEffect, reactive, watch } from 'vue';
|
||||
import seachInfo from '../indexSeachInfo/indexSeachInfo.vue';
|
||||
import selectTabBox from "../selectTabBox/selectTabBox.vue";
|
||||
import { useRoute } from 'vue-router';
|
||||
@@ -90,31 +96,31 @@ let historyShow = ref(false);
|
||||
let setHistoryShow = () => {
|
||||
historyShow.value = !historyShow.value
|
||||
}
|
||||
let seachSchoolBtn=reactive({data:[]});//学校地区
|
||||
let hireType={};//整租
|
||||
let allHireType={};//合租
|
||||
let seachArea={};//区域找房
|
||||
let historyArr =reactive({data:[]})//历史查找记录
|
||||
let hotArr =reactive({data:[]})
|
||||
let seachSchoolBtn = reactive({ data: [] });//学校地区
|
||||
let hireType = {};//整租
|
||||
let allHireType = {};//合租
|
||||
let seachArea = {};//区域找房
|
||||
let historyArr = reactive({ data: [] })//历史查找记录
|
||||
let hotArr = reactive({ data: [] })
|
||||
|
||||
//监听路由
|
||||
const route = useRoute()
|
||||
let routePath=ref('')
|
||||
routePath.value=route.path
|
||||
let routePath = ref('')
|
||||
routePath.value = route.path
|
||||
|
||||
watchEffect(() => {
|
||||
seachSchoolBtn.data = store.state.seachTypeData[0] ? store.state.seachTypeData[0].where : []
|
||||
hireType.data = store.state.seachTypeData[2] ? store.state.seachTypeData[2].where[0].data : []
|
||||
allHireType.data = store.state.seachTypeData[2] ? store.state.seachTypeData[2].where[1].data : []
|
||||
seachArea.data = store.state.seachTypeData[1] ? store.state.seachTypeData[1].where : []
|
||||
hotArr.data=store.state.indexData.hotSearcheWords
|
||||
hotArr.data = store.state.indexData.hotSearcheWords
|
||||
})
|
||||
|
||||
//获取历史搜索记录
|
||||
historyArr.data=JSON.parse(localStorage.getItem('historyArr'))||[]
|
||||
historyArr.data = JSON.parse(localStorage.getItem('historyArr')) || []
|
||||
|
||||
//搜索数据
|
||||
let seachList=()=>{
|
||||
let seachList = () => {
|
||||
|
||||
localStorage.setItem('historyArr', JSON.stringify(historyArr.data));
|
||||
}
|
||||
@@ -154,6 +160,20 @@ defineExpose({
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.authentication-btn:hover .btn-qrcode {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.btn-qrcode {
|
||||
width: 390px;
|
||||
height: 612px;
|
||||
position: absolute;
|
||||
right: -14px;
|
||||
top: 45px;
|
||||
z-index: 333;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.seach-box-bg {
|
||||
background: #d7d7d7 !important;
|
||||
background: inherit;
|
||||
@@ -175,9 +195,11 @@ defineExpose({
|
||||
position: relative;
|
||||
justify-content: end;
|
||||
border-bottom: 1px solid #ebebeb;
|
||||
.intermediary-btn{
|
||||
background:rgba(241, 245, 247, 1);
|
||||
|
||||
.intermediary-btn {
|
||||
background: rgba(241, 245, 247, 1);
|
||||
}
|
||||
|
||||
.authentication-btn {
|
||||
width: 160px;
|
||||
height: 48px;
|
||||
@@ -190,6 +212,7 @@ defineExpose({
|
||||
box-shadow: none;
|
||||
margin-left: 20px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
|
||||
.text-img {
|
||||
width: 100px;
|
||||
@@ -199,7 +222,7 @@ defineExpose({
|
||||
.code-img {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
margin-left:8px;
|
||||
margin-left: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user