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

This commit is contained in:
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">