首页
This commit is contained in:
344
src/components/seachModule/seachModule.vue
Normal file
344
src/components/seachModule/seachModule.vue
Normal file
@@ -0,0 +1,344 @@
|
||||
<template>
|
||||
<div class="dis-f jus-x al-item" style="position: relative;z-index: 333;">
|
||||
<div class="body-maxWidth">
|
||||
<div class="s-w-100 seach-box-bg">
|
||||
<div class="seach-box">
|
||||
<div class="top-seach dis-f al-item">
|
||||
<div style="position: absolute;left: -5px;top: 20px;">
|
||||
<div class="location-box dis-f jus-x al-item">
|
||||
<img src="../../assets/homeImage/addressImg.png" class="img" alt="">
|
||||
香港
|
||||
</div>
|
||||
<div class="triangle"></div>
|
||||
</div>
|
||||
<div class="dis-f al-item pos-r">
|
||||
<el-input v-model="seachValue" placeholder="搜索房源或输入房源ID" @blur="setHistoryShow"
|
||||
@focus="setHistoryShow" style="height:48px;width:460px;"></el-input>
|
||||
<div class="seach-btn dis-f al-item jus-x">
|
||||
<img src="../../assets/homeImage/seachImg.svg" class="img" alt="">
|
||||
搜索
|
||||
</div>
|
||||
<div class="seach-hiosory-box" :class="{ 'seach-history-h': historyShow }">
|
||||
<div class="seach-history-info">
|
||||
<div>
|
||||
<div class="title">
|
||||
历史搜索
|
||||
</div>
|
||||
<div class="info-box">
|
||||
<div v-for="(item, i) in historyArr" :key="i" class="btn">
|
||||
{{ item.title }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-top:30px;">
|
||||
<div class="title">
|
||||
热门推荐
|
||||
</div>
|
||||
<div class="info-box">
|
||||
<div v-for="(item, i) in historyArr" :key="i" class="btn">
|
||||
{{ item.title }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="tool-btn dis-f jus-x al-item map-btn">
|
||||
<img src="../assets/homeImage/mapImg.png" class="img" alt="">
|
||||
地图找房
|
||||
</div> -->
|
||||
<div class="tool-btn dis-f jus-x al-item add-btn">
|
||||
<img src="../../assets/homeImage/addBtn.png" class="img" alt="">
|
||||
发布房源
|
||||
</div>
|
||||
<div class=" dis-f jus-x al-item authentication-btn">
|
||||
<img src="../../assets/homeImage/authenticationBtnImg.png" class="text-img" alt="">
|
||||
<img src="../../assets/homeImage/authenticationBtnCode.svg" class="code-img" alt="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="seach-info-box dis-f">
|
||||
<seachInfo title="学校附近" :btn="seachSchoolBtn" seachType="1"></seachInfo>
|
||||
<seachInfo title="合租" seachType="2" :btn="hireType"></seachInfo>
|
||||
<seachInfo title="区域找房" seachType="3" style="margin-top:30px;" :btn="seachArea"></seachInfo>
|
||||
<seachInfo title="整租" seachType="2" style="margin-top:30px;" :btn="allHireType"></seachInfo>
|
||||
</div>
|
||||
<!-- -->
|
||||
<div class="dis-f">
|
||||
<selectTabBox></selectTabBox>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import seachInfo from '../indexSeachInfo/indexSeachInfo.vue';
|
||||
import selectTabBox from "../selectTabBox/selectTabBox.vue";
|
||||
//搜索框
|
||||
let seachValue = ref('')
|
||||
let historyShow = ref(false);
|
||||
let setHistoryShow = () => {
|
||||
historyShow.value = !historyShow.value
|
||||
}
|
||||
|
||||
let seachSchoolBtn = [
|
||||
{ text: '港大' },
|
||||
{ text: '科大' },
|
||||
{ text: '中大' },
|
||||
{ text: '城大' },
|
||||
{ text: '理工' },
|
||||
{ text: '浸会' },
|
||||
{ text: '教大' },
|
||||
{ text: '岭大' },
|
||||
]
|
||||
let hireType = [
|
||||
{ text: '不限' },
|
||||
{ text: '房间' },
|
||||
{ text: '床位' },
|
||||
{ text: '客厅' },
|
||||
{ text: '其他' },
|
||||
]
|
||||
let allHireType = [
|
||||
{ text: '不限' },
|
||||
{ text: 'studio' },
|
||||
{ text: '一房' },
|
||||
{ text: '两房' },
|
||||
{ text: '三房' },
|
||||
{ text: '四房以上' }
|
||||
]
|
||||
let seachArea = [
|
||||
{ text: '港岛' },
|
||||
{ text: '九龙' },
|
||||
{ text: '新界' }
|
||||
]
|
||||
let historyArr = [
|
||||
{ title: '有阳台' },
|
||||
{ title: '有洗衣机' },
|
||||
{ title: '城大' },
|
||||
{ title: '城大' },
|
||||
{ title: '城大' },
|
||||
{ title: '城大' },
|
||||
{ title: '城大' },
|
||||
{ title: '城大' },
|
||||
]
|
||||
defineExpose({
|
||||
historyShow,
|
||||
seachValue
|
||||
})
|
||||
</script>
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.dis-f {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.jus-x {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.al-item {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.pos-r {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.body-maxWidth {
|
||||
width: 1200px;
|
||||
min-width: 1200px;
|
||||
}
|
||||
|
||||
.s-w-100 {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.jus-bet {
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.seach-box-bg {
|
||||
background: #d7d7d7 !important;
|
||||
background: inherit;
|
||||
border: none;
|
||||
border-radius: 16px;
|
||||
-moz-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.117647058823529);
|
||||
-webkit-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.117647058823529);
|
||||
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.117647058823529);
|
||||
font-size: 14px;
|
||||
margin-top: 20px;
|
||||
|
||||
.seach-box {
|
||||
background: #FFFFFF;
|
||||
transform: translate(0, 5px);
|
||||
border-radius: 16px;
|
||||
|
||||
.top-seach {
|
||||
padding: 20px;
|
||||
position: relative;
|
||||
justify-content: end;
|
||||
border-bottom: 1px solid #ebebeb;
|
||||
|
||||
.authentication-btn {
|
||||
width: 160px;
|
||||
height: 48px;
|
||||
background: inherit;
|
||||
background-color: rgba(244, 243, 255, 1);
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
-moz-box-shadow: none;
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
margin-left:20px;
|
||||
.text-img{
|
||||
width:100px;
|
||||
height:26px;
|
||||
}
|
||||
.code-img{
|
||||
width:20px;
|
||||
height:20px;
|
||||
}
|
||||
}
|
||||
|
||||
.seach-history-h {
|
||||
max-height: 375px !important;
|
||||
transition: max-height 0.5s ease-in-out;
|
||||
}
|
||||
|
||||
.seach-hiosory-box {
|
||||
position: absolute;
|
||||
top: 55px;
|
||||
z-index: 99;
|
||||
max-height: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.seach-history-info {
|
||||
width: 560px;
|
||||
background: inherit;
|
||||
background-color: rgba(255, 255, 255, 1);
|
||||
box-sizing: border-box;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-color: rgba(235, 235, 235, 1);
|
||||
border-radius: 16px;
|
||||
-moz-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.0784313725490196);
|
||||
-webkit-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.0784313725490196);
|
||||
box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.0784313725490196);
|
||||
padding: 20px 25px;
|
||||
|
||||
.title {
|
||||
font-family: 'PingFangSC-Semibold', 'PingFang SC Semibold', 'PingFang SC', sans-serif;
|
||||
font-weight: 650;
|
||||
font-style: normal;
|
||||
font-size: 16px;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.info-box {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
font-family: 'PingFangSC-Regular', 'PingFang SC', sans-serif;
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
font-size: 15px;
|
||||
color: #555555;
|
||||
text-align: left;
|
||||
|
||||
.btn {
|
||||
margin: 20px 30px 0 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.location-box {
|
||||
width: 80px;
|
||||
height: 40px;
|
||||
background: inherit;
|
||||
background-color: rgba(68, 68, 68, 1);
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
border-top-left-radius: 0px;
|
||||
border-bottom-left-radius: 0px;
|
||||
-moz-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.117647058823529);
|
||||
-webkit-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.117647058823529);
|
||||
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.117647058823529);
|
||||
font-family: 'PingFangSC-Semibold', 'PingFang SC Semibold', 'PingFang SC', sans-serif;
|
||||
font-weight: 650;
|
||||
font-style: normal;
|
||||
font-size: 14px;
|
||||
color: #FFFFFF;
|
||||
line-height: 48px;
|
||||
position: absolute;
|
||||
z-index: 666;
|
||||
}
|
||||
|
||||
.triangle {
|
||||
border: 5px solid;
|
||||
border-color: transparent #000 transparent transparent;
|
||||
width: 0;
|
||||
height: 0;
|
||||
position: absolute;
|
||||
bottom: -44px;
|
||||
left: -5px;
|
||||
}
|
||||
|
||||
.seach-btn {
|
||||
width: 100px;
|
||||
height: 48px;
|
||||
background: inherit;
|
||||
background-color: rgba(98, 177, 255, 1);
|
||||
border: none;
|
||||
border-right: 0px;
|
||||
border-radius: 0 8px 8px 0;
|
||||
line-height: 48px;
|
||||
}
|
||||
|
||||
.img {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
object-fit: contain;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.map-btn {
|
||||
background: rgba(80, 227, 194, 1);
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
.add-btn {
|
||||
background: rgba(253, 218, 85, 1);
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
.tool-btn {
|
||||
width: 160px;
|
||||
height: 48px;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
font-family: 'PingFangSC-Regular', 'PingFang SC', sans-serif;
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
font-size: 16px;
|
||||
color: #000000;
|
||||
line-height: 48px;
|
||||
}
|
||||
}
|
||||
|
||||
.seach-info-box {
|
||||
padding: 20px 10px;
|
||||
justify-content: space-around;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user