收藏加载界面 详情页求房源增加数组判断

This commit is contained in:
luJianJun 2023-08-09 18:18:48 +08:00
parent c236121b78
commit 9d2af8cd5b
4 changed files with 97 additions and 46 deletions

View File

@ -43,7 +43,7 @@
}}
</div>
<div class="tab-item mg-l-8"
v-if="listData.data && listData.data.rentalduration && data && data.data.rentalduration && pageType == 1&&data.data.verified !== 1">
v-if="listData.data && listData.data.rentalduration && data && data.data.rentalduration&& pageType !== 2">
{{ data.data.rentalduration
=== '0' ? '租期不限' :
listData.data.rentalduration[data.data && data.data.rentalduration] || ''
@ -81,10 +81,10 @@
&& data.data.rent }}</div>
<div class="price" v-if="Array.isArray(data && data.data && data.data.rent)">{{ data && data.data
&&
data.data.rent[0] }}~{{ data && data.data && data.data.rent[1] }}</div>
data.data.rent[0] }}<span v-if="data && data.data && data.data.rent[1]">~{{ data && data.data && data.data.rent[1] }}</span></div>
<span>/{{ data && data.data && data.data.rentalperiod }}</span>
<span class="time"
v-show="data && data.data && data.data.rentalduration != 0 && (pageType == 2 || (pageType == 1 && data.data.verified == 1))">[
v-show="data && data.data && data.data.rentalduration != 0 && pageType == 2">[
租期{{
listData.data.rentalduration[data.data && data.data.rentalduration]
}}]</span>

View File

@ -505,6 +505,7 @@ let setHireTypeArr = (type, id) => {
let hireTypeObj = reactive({ id: '', title: '', hireId: '不限' })//
let setHireId = (item) => {
if (hireTypeObj.hireId != item.title) {
hireTypeObj.id = ''
hireTypeObj.title = ''
@ -513,12 +514,17 @@ let setHireId = (item) => {
setSeachCondition('types', '')
}
hireTypeObj.hireId = item.title
if(!hireTypeObj.id){
hireTypeObj.id = item.id
setLocation('types',hireTypeObj.id)
}
}
let dropdownCommand = (obj) => {
hireTypeObj.id = obj.id
hireTypeObj.title = obj.title
// store.state.routeList['hireTypeObj'] = JSON.parse(JSON.stringify(hireTypeObj))
console.log('obj',hireTypeObj)
setSeachCondition('types', obj.id)
}

View File

@ -11,7 +11,7 @@ axios.defaults.withCredentials = true
axios.interceptors.request.use( //响应拦截
async config => {
showFullScreenLoading()
if(config.url!='/tenement/pc/api/user/operation')showFullScreenLoading()
// 开发时登录用的,可以直接替换小程序的 authorization
// if (process.env.NODE_ENV == "development") config['headers']['authorization'] = "x2mmnl9grt51bpplj2k6ioiuummzhnw3"
if (process.env.NODE_ENV == "development") config['headers']['authorization'] = "0h870ovk2xckoqfsh8a3t3sg4sg5z7eg"

View File

@ -25,15 +25,17 @@
housingInfo['data'].isintermediary == 1"></div>
<span class="need-houing-type" v-if="pageType == 3">预算</span>
<span class="unit">HK$</span>
<span class="rent" v-if="pageType != 3">{{ housingInfo['data'] &&
housingInfo['data'].info.rent }}</span>
<span class="rent" v-if="pageType == 3">
<span class="rent"
v-if="!Array.isArray(housingInfo['data'] && housingInfo['data'].info.rent)">{{
housingInfo['data'] &&
housingInfo['data'].info.rent }}</span>
<span class="rent"
v-if="Array.isArray(housingInfo['data'] && housingInfo['data'].info.rent)">
{{
housingInfo['data'] && housingInfo['data'].info.rent[0]
}}~
{{
housingInfo['data'] && housingInfo['data'].info.rent[1]
}}
}} <span
v-if="housingInfo['data'] && housingInfo['data'].info.rent[1]">~{{ housingInfo['data']
&& housingInfo['data'].info.rent[1] }}</span>
</span>
<span>/{{ housingInfo['data'] && housingInfo['data'].info.rentalperiod }}</span>
<div class="line"></div>
@ -97,15 +99,20 @@
<div class="detail-price-box dis-f" style="align-items: end;">
<span class="need-houing-type" v-if="pageType == 3">预算</span>
<span class="unit" :class="{ 'line-h-17': pageType == 3 }"
:style="{ 'font-size': pageType === 3 ? '20px' : '' }">HK$</span><span class="rent"
:style="{ 'font-size': pageType === 3 ? '20px' : '' }">HK$</span>
<!-- <span class="rent"
v-if="pageType != 3">{{
housingInfo['data'] && housingInfo['data'].info.rent }}</span>
<span class="rent" v-if="pageType == 3">
housingInfo['data'] && housingInfo['data'].info.rent }}</span> -->
<span class="rent"
v-if="!Array.isArray(housingInfo['data'] && housingInfo['data'].info.rent)">{{
housingInfo['data'] &&
housingInfo['data'].info.rent }}</span>
<span class="rent" v-if="Array.isArray(housingInfo['data'] && housingInfo['data'].info.rent)">
{{
housingInfo['data'] && housingInfo['data'].info.rent[0]
}}~{{
housingInfo['data'] && housingInfo['data'].info.rent[1]
}}
}} <span
v-if="housingInfo['data'] && housingInfo['data'].info.rent[1]">~{{ housingInfo['data'] &&
housingInfo['data'].info.rent[1] }}</span>
</span>
<span>/{{ housingInfo['data'] && housingInfo['data'].info.rentalperiod }}</span>
</div>
@ -242,7 +249,8 @@
<div class="title-box">
所在楼层
</div>
<div class="text mg-l-30">
<div class="text mg-l-30"
v-if="Array.isArray(housingInfo['data'] && housingInfo['data'].info.floor)">
<span v-for="(item, i) in housingInfo['data'] && housingInfo['data'].info.floor"
:key="i">
<span v-show="i != 0">/</span>{{
@ -254,6 +262,12 @@
</span>
<!-- {{ housingInfo['data'] && housingInfo['data'].info.floor }} -->
</div>
<div class="text mg-l-30"
v-if="!Array.isArray(housingInfo['data'] && housingInfo['data'].info.floor)">
<span>
{{ housingInfo['data'] && housingInfo['data'].info.floor }}
</span>
</div>
</div>
<div class="info dis-f al-item"
v-if="housingInfo['data'] && housingInfo['data'].info.elevator">
@ -292,17 +306,29 @@
面积
</div>
<div class="text mg-l-30">
<span>
<span v-if="Array.isArray(housingInfo['data'] && housingInfo['data'].info.acreage)">
<span>
{{
housingInfo['data'] && housingInfo['data'].info.acreage[0] ?
housingInfo['data']
&&
housingInfo['data'].info.acreage[0] : 0
}}
</span><span v-if="housingInfo['data'] && housingInfo['data'].info.acreage[1] ? housingInfo['data']
&&
housingInfo['data'].info.acreage[1] : 0">~
{{
housingInfo['data'] && housingInfo['data'].info.acreage[1] ?
housingInfo['data']
&&
housingInfo['data'].info.acreage[1] : 0
}}
</span>
</span>
<span
v-if="!Array.isArray(housingInfo['data'] && housingInfo['data'].info.acreage)">
{{
housingInfo['data'] && housingInfo['data'].info.acreage[0] ? housingInfo['data']
&&
housingInfo['data'].info.acreage[0] : 0
}}
</span>~<span>
{{
housingInfo['data'] && housingInfo['data'].info.acreage[1] ? housingInfo['data']
&&
housingInfo['data'].info.acreage[1] : 0
housingInfo['data'] && housingInfo['data'].info.acreage
}}
</span>
平方呎
@ -428,7 +454,8 @@
目标区域
</span>
</div>
<div class="need-housing-location">
<div class="need-housing-location"
v-if="Array.isArray(housingInfo['data'] && housingInfo['data'].info.location)">
<div class="dis-f al-item" :class="{ 'mg-t-15': i != 0 }"
v-for="(item, i) in housingInfo['data'] && housingInfo['data'].info.location" :key="i">
<span>
@ -446,6 +473,26 @@
</div>
</div>
</div>
<div class="need-housing-location"
v-if="!Array.isArray(housingInfo['data'] && housingInfo['data'].info.location)">
<div class="dis-f al-item" :class="{ 'mg-t-15': i != 0 }">
<span>
{{
location && location[housingInfo['data'] &&
housingInfo['data']['info'].location.substring(0, 1)]
}}
</span>
<div class="icon dis-f jus-x al-item">
<img src="../assets/img/detail/moreAllow.svg" class="icon-img" alt="">
</div>
<div class="text-box">
{{
housingInfo['data'] && housingInfo['data']['info'].location.length == 1 ? '不限' :
location && location[housingInfo['data'] && housingInfo['data']['info'].location]
}}
</div>
</div>
</div>
</div>
<!-- -->
@ -1346,7 +1393,7 @@ const onPageSrcoll = (e) => {
let scrollTop = body.scrollTop
let clientHeight = body.clientHeight
let offsetHeight = body.offsetHeight
if (scrollTop + clientHeight >= offsetHeight-200) {
if (scrollTop + clientHeight >= offsetHeight - 200) {
if (loadMore.value) {
loadMore.value = false
pages.value += 1
@ -2029,16 +2076,14 @@ img {
width: 210px;
}
.fav-btn{
.fav-btn {}
}
.fav-btn:hover .fav-img-f{
.fav-btn:hover .fav-img-f {
opacity: 0.4;
}
.fav-btn:hover .fav-img-t{
opacity:0;
.fav-btn:hover .fav-img-t {
opacity: 0;
}
.tool-btn {
@ -2057,20 +2102,21 @@ img {
font-size: 14px;
cursor: pointer;
.fav-img{
.fav-img {
width: 20px;
height:20px;
height: 20px;
position: absolute;
top:0;
left:0;
top: 0;
left: 0;
transition: all linear 0.2s;
}
.fav-img-f{
opacity:0;
.fav-img-f {
opacity: 0;
}
.fav-img-t{
opacity:1;
.fav-img-t {
opacity: 1;
}
.tool-icon {
@ -3014,6 +3060,5 @@ img {
.el-icon {
display: none;
}
}
</style>
}</style>