@@ -4,7 +4,6 @@
< div class = "dis-f jus-x al-item" >
< div class = "body-maxWidth mg-t-35" >
< breadcrumb :data = "housingInfo['data']" : operation = 'setOperation' > < / breadcrumb >
{ { pageType == 3 || ( recommendListData . length == 0 || publisherList . length == 0 ) } }
< el-affix :offset = "0" @change ="changeTitleType" z -index = " 700 " >
< div class = "top-bar-box dis-f jus-x" v-show = "titleType" >
< div class = "top-bar dis-f al-item jus-bet" >
@@ -434,7 +433,7 @@
<!-- -->
<div class="map-box"
v-if="pageType != 3 && housingInfo['data'] && housingInfo['data'].info.longitude ">
v-if="pageType != 3 && housingInfo['data'] && housingInfo['data'].info.location ">
<div class="dis-f al-item title-box">
<img src="../assets/img/detail/mapIcon.png" class="img" alt="">
<span class="title">{{
@@ -738,8 +737,8 @@
</div>
<!-- 推荐 -->
<div class="dis-f jus-x" v-if="pageType != 3 && (recommendListData.length > 0 || publisherList.length > 0)">
<div class="body-maxWidth housing-title" style="margin-top:3 0px;">
附近房源
<div class="body-maxWidth housing-title" style="margin-top:5 0px;">
{{ pageType==2&&housingInfo['data'].isintermediary?`发布者的其他房源(${publisherList.length}) `:'附近房源' }}
</div>
</div>
<div class="dis-f jus-x al-item" style="position: relative;" v-if="pageType != 3">
@@ -759,7 +758,7 @@
</div>
<div class="dis-f jus-x bottom-tps"
v-if="pageType != 3 && ( recommendListData.length > 0 || publisherList.length > 0 )">
v-if="pageType ===1 || (pageType===2&& recommendListData.length>0&&housingInfo['data']&&housingInfo['data'].isintermediary )">
- {{ loadText }} -
</div>
<footerTool class="mg-t-60"></footerTool>
@@ -984,7 +983,7 @@
</template>
<script setup>
import { reactive, onMounted, ref, nextTick, onBeforeUnmount } from 'vue'
import { reactive, onMounted, ref, nextTick, onBeforeUnmount,watch } from 'vue'
import pageTopBar from '../components/pageTopBar/pageTopBar.vue';
import circleBtn from '@/components/public/circle-btn.vue'
import api from "../utils/api";
@@ -993,7 +992,7 @@ import watchImage from '../components/detail/imageWatch.vue'
import breadcrumb from '../components/detail/breadcrumb.vue'
import mapInfo from '../components/public/viewMap.vue'
import { ElMessage } from 'element-plus'
import { useRouter } from 'vue-router'
import { useRouter,useRoute } from 'vue-router'
import indexWaterfallBox from "../components/indexWaterfallBox/indexWaterfallBox.vue";
import Masonry from 'masonry-layout';
import transmitBtn from '@/components/public/transmitBtn.vue'
@@ -1208,17 +1207,17 @@ let getHousingInfo = () => {
housingInfo [ 'data' ] = res . data
setHousingArr ( )
setNavigation ( )
distanceList . value = distanceList . value . concat ( housingInfo[ 'data' ] [ 'info' ] . pointData || [ ] )
distanceList . value = housingInfo [ 'data' ] [ 'info' ] . pointData || [ ]
distanceList . value . unshift ( {
address : true ,
name : housingInfo [ 'data' ] [ 'info' ] . address ,
} )
concatInfo [ 'data' ] = store . state . indexData . wechat
if ( res . data . contacts ) contacts [ 'data' ] = res . data . contacts
console . log ( 'pageType' , pageType . value )
if ( pageType . value == 2 ) {
console . log ( 'pageType' , pageType . value )
if ( pageType . value == 2 && housingInfo [ 'data' ] . isintermediary ) {
getPublisherList ( )
} else if ( pageType . value = = 1 ) {
} else if ( pageType . value ! =3 ) {
recommendList ( )
}
@@ -1299,7 +1298,7 @@ const onPageSrcoll = (e) => {
if ( loadMore . value ) {
loadMore . value = false
pages . value += 1
if ( housingInfo [ 'data' ] . info . verified ) {
if ( housingInfo [ 'data' ] . isintermediary ) {
getPublisherList ( )
} else {
recommendList ( )
@@ -1385,6 +1384,27 @@ const gridContainer = ref(null);
let masonryInstance = null
let router = useRouter ( )
let route = useRoute ( )
watch ( route , ( ) => {
let { id , type } = router . currentRoute . value . query
uniqid . value = id
pageType . value = type //1个人 2中介 3求房源
publisherList . value = [ ]
recommendListData . value = [ ]
getHousingInfo ( )
masonryInstance = new Masonry ( gridContainer . value , {
itemSelector : '.waterfall-box' ,
gutter : 10
} ) ;
if ( pageType . value != 3 ) {
setTimeout ( ( ) => {
window . addEventListener ( 'scroll' , onPageSrcoll , true ) ;
document . body . scrollTop = 0
} , 1000 )
}
} )
onMounted ( ( ) => {
let { id , type } = router . currentRoute . value . query
uniqid . value = id
@@ -1400,7 +1420,6 @@ onMounted(() => {
document . body . scrollTop = 0
} , 1000 )
}
} )
onBeforeUnmount ( ( ) => {