个人房源

This commit is contained in:
2023-07-13 18:08:54 +08:00
parent c051c60e7e
commit 5a918cda3e
7 changed files with 367 additions and 49 deletions

View File

@@ -51,21 +51,21 @@
<img src="../../assets/homeImage/addBtn.png" class="img" alt="">
发布房源
</div>
<div class=" dis-f jus-x al-item authentication-btn">
<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="">
</div>
</div>
<div class="seach-info-box dis-f">
<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>
</div>
<!-- -->
<!-- <div>
<div v-if="routePath==='/personHousing'">
<selectTabBox></selectTabBox>
</div> -->
</div>
</div>
</div>
</div>
@@ -73,30 +73,13 @@
</template>
<script setup>
import { ref, defineProps, 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 { useRouter} from 'vue-router'
//监听路由
const router = useRouter()
watch(()=>router.currentRoute.value,(nVal)=>{
console.log(nVal)
})
import { useRoute } from 'vue-router';
import store from '../../store/index';
const props = defineProps({
list: {
type: Array,
default: function () {
return []
}
},
hotList:{
type:Array,
default:function(){
return []
}
}
})
//搜索框
let seachValue = ref('')
let historyShow = ref(false);
@@ -109,12 +92,18 @@ let allHireType={};//合租
let seachArea={};//区域找房
let historyArr =reactive({data:[]})//历史查找记录
let hotArr =reactive({data:[]})
//监听路由
const route = useRoute()
let routePath=ref('')
routePath.value=route.path
watchEffect(() => {
seachSchoolBtn.data = props.list[0] ? props.list[0].where : []
hireType.data = props.list[2] ? props.list[2].where[0].data : []
allHireType.data = props.list[2] ? props.list[2].where[1].data : []
seachArea.data = props.list[1] ? props.list[1].where : []
hotArr.data=props.hotList
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
})
//获取历史搜索记录
@@ -126,8 +115,6 @@ let seachList=()=>{
localStorage.setItem('historyArr', JSON.stringify(historyArr.data));
}
defineExpose({
historyShow,
seachValue