首页添加底部导航 修改区域选项设置

This commit is contained in:
luJianJun 2023-07-14 18:30:02 +08:00
parent 76ccf5432b
commit 2e5147329f
6 changed files with 29 additions and 25 deletions

View File

@ -31,10 +31,10 @@
</span>
<span v-if="itemData.type === 'apartment'">{{ itemData.propaganda }}</span>
</div>
<!-- <div style="padding: 0 10px;margin-top:15px;" class="dis-f al-item" v-if="itemData.type === 'housing'">
<div style="padding: 0 10px;margin-top:15px;" class="dis-f al-item" v-if="itemData.type === 'housing'">
<img src="../../assets/homeImage/addMarker.png" class="add-marker" alt="">
<span class="address-text">九龙 > 尖沙咀/佐敦</span>
</div> -->
<span class="address-text">{{ location.data&&location.data[itemData.location&&itemData.location.substring(0,1)] }} > {{ location.data&&location.data[itemData.location] }}</span>
</div>
<div style="padding:0 10px;margin-top:12px;" v-if="itemData.type === 'housing'">
<span class="unit">{{ itemData.currency }}</span>
<span class="price">{{ itemData.rent }}</span>
@ -90,6 +90,7 @@
<script setup>
import { defineProps, reactive } from 'vue'
import store from '../../store/index';
const props = defineProps({
data: {
type: Object,
@ -99,6 +100,8 @@ const props = defineProps({
}
})
let itemData = props.data
let location=reactive({data:{}})
location.data=store.state.indexData.config.location
</script>
<style scoped>

View File

@ -275,6 +275,7 @@ tabBtnType.value = route.path
margin: 0 auto;
width: 660px;
height: 280px;
border-radius:15px;
}
.user-box:hover .user-out-box {
@ -288,7 +289,7 @@ tabBtnType.value = route.path
font-style: normal;
font-size: 10px;
position: absolute;
bottom: -35px;
bottom: -32px;
display: none;
}

View File

@ -106,22 +106,18 @@ let historyArr = reactive({ data: [] })//历史查找记录
let hotArr = reactive({ data: [] })
//
let getLocationData = () => {
let getLocationData = (data) => {
console.log(seachArea.data)
api.getLocationData().then(res => {
console.log(res)
if (res.code === 200) {
for (let item in res.data) {
if (!seachArea.data[item.substring(0, 1) - 1].data) seachArea.data[item.substring(0, 1) - 1].data = []
if (item.length > 1) {
seachArea.data[item.substring(0, 1) - 1].data.push({
title: res.data[item],
id: item
})
}
}
for (let item in data) {
if (!seachArea.data[item.substring(0, 1) - 1].data) seachArea.data[item.substring(0, 1) - 1].data = []
if (item.length > 1) {
seachArea.data[item.substring(0, 1) - 1].data.push({
title: data[item],
id: item
})
}
})
}
console.log(store.state)
}
//
@ -134,7 +130,8 @@ watchEffect(() => {
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 : []
if (seachArea.data.length > 0&&!seachArea.data[0].data) getLocationData()
if (seachArea.data.length > 0 && !seachArea.data[0].data) getLocationData(store.state.indexData.config.location
)
hotArr.data = store.state.indexData.hotSearcheWords
})

View File

@ -3,7 +3,7 @@
<div class="select-box s-w-50 bor-r">
<div class="dis-f bor-b-das" :class="{'al-item housing-pd':routePath==='/needHousing'}">
<div class="tab-title">{{routePath==='/needHousing'?'目标区域':'地理位置'}}</div>
<!-- 非求房源页面 -->
<!-- 中介/个人房源页面 -->
<div class="tab-text" v-if="routePath!=='/needHousing'">
<div class="dis-f">
<div class="btn jus-x al-item dis-f" :class="{ 'btn-check': selectPosition === 'region' }"

View File

@ -1,6 +1,6 @@
<template>
<div>
<el-skeleton style="width: 240px" animated="true">
<el-skeleton style="width: 240px" :animated="true">
<template #template>
<el-skeleton-item variant="image" style="width: 240px; height: 240px" />
<div style="padding: 14px">

View File

@ -1,7 +1,6 @@
<template>
<div class="home">
<pageTopBar :bannerList="bannerList.data"></pageTopBar>
<!-- <headerNavigation></headerNavigation> -->
<!-- 搜索模块 -->
<seachModule></seachModule>
<!-- 房源展示 -->
@ -178,8 +177,9 @@
</div>
</div>
<div class="dis-f jus-x bottom-tps">
- 到底了 -
- {{loadText}} -
</div>
<footerTool></footerTool>
<indexRegularBox></indexRegularBox>
</div>
</template>
@ -192,7 +192,7 @@ import indexWaterfallBox from "../components/indexWaterfallBox/indexWaterfallBox
import seachModule from "../components/seachModule/seachModule.vue";
import indexRegularBox from '../components/indexRegularBox/indexRegularBox.vue';
import skeletonBox from '../components/skeletonBox/skeletonBox.vue'
import headerNavigation from '../components/public/head.vue';
import footerTool from '@/components/footer/footer.vue'
import { useRouter } from 'vue-router'
import store from '../store/index';
import api from "../utils/api";
@ -286,6 +286,7 @@ let addListData = (data) => {
}
//
let loadMore = ref(true)
let loadText=ref('加载中.....')
//
let getRecommendList = () => {
api.recommendList({
@ -304,6 +305,7 @@ let getRecommendList = () => {
loadMore.value = true
} else {
loadMore.value = false
loadText.value='到底了'
}
}
})
@ -325,7 +327,7 @@ let listDataTypeChange = (item) => {
//
const onPageSrcoll = (e) => {
if (!loadMore.value) return
if (!loadMore.value||waterfallList['4'].length===0) return
let body = document.documentElement ? document.documentElement : document.body ?
document.body :
document.querySelector('.element');
@ -412,6 +414,7 @@ img {
font-size: 14px;
color: #555555;
text-align: center;
padding:30px 0;
}
.information-box {