个人房源列表
This commit is contained in:
@@ -7,52 +7,87 @@
|
||||
</div>
|
||||
<div class="top-box">
|
||||
<div class="title-text">
|
||||
123456789
|
||||
{{ data&&data.subject||'暂无标题' }}
|
||||
</div>
|
||||
<div class="mg-t-10 dis-f al-item jus-bet s-w-100">
|
||||
<div>
|
||||
<div class="dis-f al-item">
|
||||
<div class="tab-item" :class="[{ 'mg-l-5': i > 0 }, { 'first-tab': i === 0 }]"
|
||||
v-for="(item, i) in 5" :key="i">
|
||||
{{ item }}
|
||||
<div class="tab-item first-tab">
|
||||
{{ data&&data.gptype||'' }}
|
||||
</div>
|
||||
<div class="tab-item mg-l-8">
|
||||
{{ listData&&listData.data&&listData.data.type[data&&data.type]||'' }}
|
||||
</div>
|
||||
<div class="tab-item mg-l-8" v-if="data&&data.elevator!==-1">
|
||||
{{ listData&&listData.data&&listData.data.elevator[data&&data.elevator]||'' }}
|
||||
</div>
|
||||
<div class="tab-item mg-l-8" v-if="data&&data.sunshinearea!==-1">
|
||||
{{ listData&&listData.data&&listData.data.sunshinearea[data&&data.sunshinearea]||'' }}
|
||||
</div>
|
||||
<div class="tab-item mg-l-8">
|
||||
{{ listData&&listData.data&&listData.data.gender[data&&data.gender]||'' }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="address-text dis-f al-item">
|
||||
<img src="../../assets/homeImage/addMarker.png" class="img" alt="">
|
||||
<span>九龙 > 尖沙咀/佐敦</span>
|
||||
<span>{{
|
||||
location&&location.data&&location.data[1]?`${ location&&location.data&&location.data[data&&data.location&&data.location.substring(0,1)] } > ${ location&&location.data[data&&data.location] }`:''
|
||||
}}</span>
|
||||
</div>
|
||||
<div class="price-text dis-f" style="align-items: end;">
|
||||
<span class="unit">HK$</span>
|
||||
<span class="price">5600</span>
|
||||
<span class="price">{{ data&&data.rent }}</span>
|
||||
<span>/月</span>
|
||||
<span class="time">[123456]</span>
|
||||
<span class="time" v-show="data&&data.rentalduration!=0">[ 租期{{ data&&data.rentalduration }}{{ data&&data.rentalperiod }} ]</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="img">
|
||||
<img src="" class="img " alt="">
|
||||
<img src="" class="s-img" alt="" v-if="false">
|
||||
<img :src="data&&data.ispic?data&&data.imageurl:data&&data.isvideo?data&&data.imageurl:''" class="img " alt="">
|
||||
<div class="s-img dis-f jus-x al-item" v-if="data&&data.isvideo">
|
||||
<img src="../../assets/homeImage/videoIcon.svg" class="img" alt="">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<img src="../../assets/homeImage/corner.svg" class="tab-img" v-if="routePath==='/personHousing'" alt="">
|
||||
<img src="../../assets/homeImage/intermediaryCorner.svg" v-if="routePath==='/intermediaryHousing'" class="tab-img" alt="">
|
||||
</div>
|
||||
<div class="btm-box dis-f al-item">
|
||||
<img src="" class="user-img" alt="">
|
||||
<span class="user-name">123</span>
|
||||
<div class="btn">456456</div>
|
||||
<img src="../../assets/homeImage/intermediaryTabImg.png" class="intermediary-tab-img" alt="">
|
||||
<img :src="data&&data.avatar" class="user-img" alt="">
|
||||
<span class="user-name">{{ data&&data.author }}</span>
|
||||
<div class="btn" v-if="data&&data.isintermediary !== 1&&!data.intermediary_text">{{ listData&&listData.data&&listData.data.intermediary[data&&data.intermediary] }}</div>
|
||||
<div class="btn" v-if="data&&data.isintermediary !== 1&&data.intermediary_text">{{ data&&data.intermediary_text }}</div>
|
||||
<img src="../../assets/homeImage/intermediaryTabImg.png" v-if="data&&data.isintermediary == 1" class="intermediary-tab-img" alt="">
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from "vue";
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { ref ,defineProps,reactive} from "vue";
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import store from '../../store/index';
|
||||
let props = defineProps({
|
||||
item:{
|
||||
type:Object
|
||||
}
|
||||
})
|
||||
let data={}
|
||||
data= props.item
|
||||
|
||||
//监听路由
|
||||
const route = useRoute()
|
||||
let routePath = ref('')
|
||||
routePath.value = route.path
|
||||
//地区数据
|
||||
let location=reactive({data:{}})
|
||||
location.data=store.state.indexData&&store.state.indexData.config&&store.state.indexData.config.location
|
||||
|
||||
|
||||
//数据包
|
||||
let listData=reactive({data:{}})
|
||||
listData.data=store.state.indexData&&store.state.indexData.config
|
||||
console.log(listData.data)
|
||||
|
||||
</script>
|
||||
<style scoped>
|
||||
img {
|
||||
@@ -128,14 +163,24 @@ img {
|
||||
|
||||
.img {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
/* height: 100px; */
|
||||
object-fit: cover;
|
||||
border-radius: 10px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.s-img {
|
||||
width: 110px;
|
||||
width: 100px;
|
||||
height:100%;
|
||||
border-radius: 10px;
|
||||
position: absolute;
|
||||
top:0;
|
||||
left:0;
|
||||
background: rgba(51, 51, 51, 0.733333333333333);
|
||||
.img{
|
||||
width:30px;
|
||||
height:30px;
|
||||
}
|
||||
}
|
||||
|
||||
.top-box {
|
||||
@@ -163,8 +208,8 @@ img {
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
|
||||
.mg-l-5 {
|
||||
margin-left: 5px;
|
||||
.mg-l-8 {
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
.tab-item {
|
||||
|
||||
@@ -82,7 +82,6 @@ let bannerLists = reactive({data:[]})
|
||||
watchEffect(() => {
|
||||
user.data=store.state.user
|
||||
bannerLists.data=props.bannerList
|
||||
console.log(bannerLists.data)
|
||||
if (!store.state.indexData.menu) return
|
||||
store.state.indexData.menu.map(res => {
|
||||
if (res.name === '首页') {
|
||||
|
||||
@@ -74,8 +74,9 @@
|
||||
</div>
|
||||
<!-- -->
|
||||
<div
|
||||
v-if="routePath === '/personHousing' || routePath === '/intermediaryHousing' || routePath === '/needHousing'">
|
||||
v-if="routePath === '/personHousing' || routePath === '/intermediaryHousing' || routePath === '/needHousing'" :count="counti">
|
||||
<selectTabBox></selectTabBox>
|
||||
{{ counti }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -84,13 +85,20 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, watchEffect, reactive, beforeMount } from 'vue';
|
||||
import { ref, watchEffect, reactive, defineProps } from 'vue';
|
||||
import seachInfo from '../indexSeachInfo/indexSeachInfo.vue';
|
||||
import selectTabBox from "../selectTabBox/selectTabBox.vue";
|
||||
import { useRoute } from 'vue-router';
|
||||
import store from '../../store/index';
|
||||
import api from "../../utils/api";
|
||||
|
||||
const props=defineProps({
|
||||
count:{
|
||||
type:Number,
|
||||
default:0
|
||||
}
|
||||
})
|
||||
let counti = ref(0)
|
||||
|
||||
//搜索框
|
||||
let seachValue = ref('')
|
||||
@@ -107,7 +115,6 @@ let hotArr = reactive({ data: [] })
|
||||
|
||||
//获取区域下列数据
|
||||
let getLocationData = (data) => {
|
||||
console.log(seachArea.data)
|
||||
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) {
|
||||
@@ -117,7 +124,6 @@ let getLocationData = (data) => {
|
||||
})
|
||||
}
|
||||
}
|
||||
console.log(store.state)
|
||||
}
|
||||
|
||||
//监听路由
|
||||
@@ -130,9 +136,9 @@ 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(store.state.indexData.config.location
|
||||
)
|
||||
if (seachArea.data.length > 0 && !seachArea.data[0].data) getLocationData(store.state.indexData.config.location)
|
||||
hotArr.data = store.state.indexData.hotSearcheWords
|
||||
counti.value=props.count
|
||||
})
|
||||
|
||||
//获取历史搜索记录
|
||||
|
||||
@@ -193,7 +193,7 @@
|
||||
</div>
|
||||
<div class="btm-list">
|
||||
<div class="dis-f al-item">
|
||||
共<span class="count">123</span>条个人房源 <span v-show="selectTabCheck.title&&selectTabCheck.id">   |  </span>
|
||||
共<span class="count">{{ counti }}</span>条个人房源 <span v-show="selectTabCheck.title&&selectTabCheck.id">   |  </span>
|
||||
<div class="dis-f al-item">
|
||||
<div v-show="selectTabCheck.id&&selectTabCheck.title">{{ selectTabCheck.title }}:</div>
|
||||
<div v-for="(item, i) in selectData.data" :key="i" class="btm-btn">
|
||||
@@ -210,12 +210,26 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, ref, getCurrentInstance } from 'vue';
|
||||
import { reactive, ref, getCurrentInstance,defineProps,watchEffect } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import checkBoxGroup from "../../components/checkGroup/checkBoxGroup.vue";
|
||||
|
||||
const { proxy } = getCurrentInstance()
|
||||
|
||||
const props=defineProps({
|
||||
count:{
|
||||
type:Number,
|
||||
default:0
|
||||
}
|
||||
})
|
||||
|
||||
//当前数据数量
|
||||
let counti = ref(0)
|
||||
watchEffect(()=>{
|
||||
counti.value=props.count
|
||||
console.log(counti.value)
|
||||
})
|
||||
|
||||
let list = [{
|
||||
title: '不限',
|
||||
id: ''
|
||||
@@ -284,7 +298,6 @@ setSchoolData()
|
||||
let setSchoolObj = (obj) => {
|
||||
schoolSelectObj.id = obj.id
|
||||
schoolSelectObj.title = obj.title
|
||||
console.log(schoolSelectObj)
|
||||
}
|
||||
|
||||
//学校轮播组件
|
||||
@@ -337,11 +350,9 @@ let watchData = (data) => {
|
||||
const route = useRoute()
|
||||
let routePath = ref('')
|
||||
routePath.value = route.path
|
||||
console.log(123,routePath.value)
|
||||
|
||||
//底部删除按钮
|
||||
let deleteSelect = (id) => {
|
||||
console.log(id)
|
||||
selectData.data.splice(id, 1)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user