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

This commit is contained in:
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>
<div class="tab-item mg-l-8" <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 {{ data.data.rentalduration
=== '0' ? '租期不限' : === '0' ? '租期不限' :
listData.data.rentalduration[data.data && data.data.rentalduration] || '' listData.data.rentalduration[data.data && data.data.rentalduration] || ''
@@ -81,10 +81,10 @@
&& data.data.rent }}</div> && data.data.rent }}</div>
<div class="price" v-if="Array.isArray(data && data.data && data.data.rent)">{{ data && data.data <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>/{{ data && data.data && data.data.rentalperiod }}</span>
<span class="time" <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] listData.data.rentalduration[data.data && data.data.rentalduration]
}}]</span> }}]</span>

View File

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

View File

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

View File

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