中介详情显示房源

This commit is contained in:
luJianJun 2023-07-28 17:43:00 +08:00
parent 7bf9f59c75
commit 8da2aaf482
9 changed files with 63 additions and 40 deletions

View File

@ -173,19 +173,13 @@ let watchInfo = () => {
path: '/detail',
query: {
id: data.data.uniqid,
type:pageType.value
}
})
}
onMounted(() => {
imgRef = getCurrentInstance()
let {type}=router.currentRoute.value.query
if(type){
pageType.value=type
}else{
pageType.value=data.data.intermediary===1?2:data.data.intermediary===6?3:1
}
pageType.value=data.data.intermediary===1?2:data.data.intermediary===6?3:1
})
</script>

View File

@ -103,7 +103,7 @@ let storeData = store.state.routeList
watchEffect(() => {
data['data'] = props.data
console.log(pageType.value)
if(data['data']&&data['data']['info'])pageType.value=data['data']['info'].intermediary===1?2:data['data']['info'].intermediary===6?3:1
})
</script>
@ -221,12 +221,12 @@ img {
.top-round-s {
position: absolute;
top: -13px;
left: -1px;
top: -17px;
left: 0px;
border-radius: 0 0 16px 0;
background: rgba(174, 159, 251, 1);
width: 23px;
height: 20px;
width: 22px;
height: 24px;
}
.intermediary-bg{
background: rgba(173,214,247,1) !important;

View File

@ -116,13 +116,11 @@ location.data = store.state.indexData.config.location
let router = useRouter()
let watchInfo = () => {
console.log(itemData.type)
router.push({
path: itemData.type === 'apartment' ? '/apartmentDetail' : '/detail',
query: {
// id: itemData.type=='apartment'?itemData.id:itemData.uniqid,
[itemData.type == 'apartment' ? "uniqid" : "id"]: itemData.type == 'apartment' ? itemData.id : itemData.uniqid,
type: itemData.intermediary == '1' ? 2 : itemData.intermediary == '6' ? 3 : !itemData.intermediary ? '' : 1
[itemData.type == 'apartment' ? "uniqid" : "id"]: itemData.type == 'apartment' ? itemData.id : itemData.uniqid
}
})
}
@ -131,6 +129,7 @@ let watchAdv = () => {
if (itemData.url) {
window.open(itemData.url)
} else {
if(!itemData.path)return
watchInfo()
}
}

View File

@ -36,11 +36,12 @@ export default createStore({
},
plugins:[
createPersistedstate({
key:'data',
storage:window.sessionStorage,
reducer(val){
console.log('val',val)
return{
routeList:val.routeList,
indexData:val.indexData
routeList:val.routeList
}
}
})

View File

@ -629,7 +629,7 @@
<div v-if="checkUpdateTime(housingInfo['data'] && housingInfo['data'].info.updatetime)">
<div class="dis-f al-item jus-x time-box" v-if="housingInfo['data'] &&
housingInfo['data'].intermediarylistingcount > 0 &&
housingInfo['data'] && ['config']['intermediary'] == 1 &&
housingInfo['data']['info']['intermediary'] == 1 &&
housingInfo['data'].isintermediary == 1">
<img src="../assets/img/detail/presonNumIcon.png" class="icon" alt="">
<span>房源 x{{ housingInfo['data'] && housingInfo['data'].intermediarylistingcount
@ -759,7 +759,7 @@
</div>
<div class="dis-f jus-x bottom-tps"
v-if="pageType === 1 || (pageType === 2 && recommendListData.length > 0 && housingInfo['data'] && housingInfo['data'].isintermediary)">
v-if="(pageType === 1&&recommendListData.length > 0) || (pageType === 2 && recommendListData.length > 0 && housingInfo['data'] && housingInfo['data'].isintermediary)">
- {{ loadText }} -
</div>
<footerTool class="mg-t-60"></footerTool>
@ -1165,10 +1165,10 @@ let setNavigation = () => {
// location=3.8,3.13&areaItem=3
// console.log(`${store.state.routeList['secondaryIndex'].path}/location/${JSON.stringify([housingInfo['data']['info'].location.substring(0, 1)])}`)
store.state.routeList['secondaryIndex'] = {
path: housingInfo['data']['info'].intermediary === 1 ? '/intermediaryHousing' :
housingInfo['data']['info'].intermediary === 6 ? '/needHousing' : '/personHousing',
title: housingInfo['data']['info'].intermediary === 1 ? '中介房源' :
housingInfo['data']['info'].intermediary === 6 ? '求房源' : '个人房源'
path: pageType.value===2 ? '/intermediaryHousing' :
pageType.value===3 ? '/needHousing' : '/personHousing',
title: pageType.value === 2 ? '中介房源' :
pageType.value===3 ? '求房源' : '个人房源'
}
store.state.routeList['thirdIndex'] = {
path: `${store.state.routeList['secondaryIndex'].path}`,
@ -1209,6 +1209,7 @@ let getHousingInfo = () => {
console.log(res)
if (res.code === 200) {
housingInfo['data'] = res.data
pageType.value =housingInfo['data']['info'].intermediary===1?2:housingInfo['data']['info'].intermediary===6?3:1 //1 2 3
setHousingArr()
setNavigation()
distanceList.value = housingInfo['data']['info'].pointData || []
@ -1218,7 +1219,6 @@ let getHousingInfo = () => {
})
concatInfo['data'] = store.state.indexData.wechat
if (res.data.contacts) contacts['data'] = res.data.contacts
console.log('pageType', pageType.value)
if (pageType.value == 2 && housingInfo['data'].isintermediary) {
getPublisherList()
} else if (pageType.value != 3) {
@ -1253,7 +1253,10 @@ let setOperation = () => {
//
let concatData = reactive({})
let getConcatData = () => {
if (concatData['data']) return
if (concatData['data']){
showConcat.value = true
return
}
api.contactData({
token: housingInfo['data'].token
}).then(res => {
@ -1391,9 +1394,9 @@ let router = useRouter()
let route = useRoute()
watch(route, () => {
let { id, type } = router.currentRoute.value.query
let { id } = router.currentRoute.value.query
uniqid.value = id
pageType.value = type //1 2 3
pageType.value = housingInfo['data']['info'].intermediary===1?2:housingInfo['data']['info'].intermediary===6?3:1 //1 2 3
publisherList.value = []
recommendListData.value = []
getHousingInfo()
@ -1410,9 +1413,8 @@ watch(route, () => {
})
onMounted(() => {
let { id, type } = router.currentRoute.value.query
let { id } = router.currentRoute.value.query
uniqid.value = id
pageType.value = type //1 2 3
getHousingInfo()
masonryInstance = new Masonry(gridContainer.value, {
itemSelector: '.waterfall-box',

View File

@ -19,7 +19,7 @@
</div>
</div>
</div>
<loadMoreText :loadText="loading?'加载中....':'到底了'"></loadMoreText>
<loadMoreText :loadText="loadingText"></loadMoreText>
<listBtmPrompt></listBtmPrompt>
<footerTool></footerTool>
</div>
@ -52,6 +52,7 @@ let dataCount = ref(0)
let pageList = reactive({ 1: [], 2: [], height1: 0, height2: 0, tab: 1 })
let seachSelectData = reactive({ data: {} })
let loading = ref(true)
let loadingText=ref(' 加载中... ')
provide('count', dataCount)
//
@ -85,6 +86,11 @@ let getDataList = (data) => {
api.getLists(postData).then(res => {
if (res.code === 200) {
dataList.data = res.data.data
if(res.data.data.length<20){
loadingText.value=' 到底了 '
}else{
loadingText.value=' 加载中... '
}
if (pages.value === 1) {
setInitial()
}

View File

@ -19,7 +19,7 @@
</div>
</div>
</div>
<loadMoreText :loadText="loading?'加载中....':'到底了'"></loadMoreText>
<loadMoreText :loadText="loadingText"></loadMoreText>
<listBtmPrompt></listBtmPrompt>
<footerTool></footerTool>
</div>
@ -52,6 +52,7 @@ let dataCount = ref(0)
let pageList = reactive({ 1: [], 2: [], height1: 0, height2: 0, tab: 1 })
let seachSelectData = reactive({ data: {} })
let loading = ref(true)
let loadingText=ref(' 加载中... ')
provide('count', dataCount)
//
@ -85,6 +86,11 @@ let getDataList = (data) => {
api.getLists(postData).then(res => {
if (res.code === 200) {
dataList.data = res.data.data
if(res.data.data.length<20){
loadingText.value=' 到底了 '
}else{
loadingText.value=' 加载中... '
}
if (pages.value === 1) {
setInitial()
}

View File

@ -19,7 +19,7 @@
</div>
</div>
</div>
<loadMoreText :loadText="loading ? '加载中....' : '到底了'"></loadMoreText>
<loadMoreText :loadText="loadingText"></loadMoreText>
<listBtmPrompt></listBtmPrompt>
<footerTool></footerTool>
</div>
@ -58,6 +58,7 @@ let dataCount = ref(0)
let pageList = reactive({ 1: [], 2: [], height1: 0, height2: 0, tab: 1 })
let seachSelectData = reactive({ data: {} })
let loading = ref(true)
let loadingText = ref(' 加载中... ')
provide('count', dataCount)
//
@ -91,6 +92,11 @@ let getDataList = (data) => {
api.getLists(postData).then(res => {
if (res.code === 200) {
dataList.data = res.data.data
if(res.data.data.length<20){
loadingText.value=' 到底了 '
}else{
loadingText.value=' 加载中... '
}
if (pages.value === 1) {
setInitial()
}

View File

@ -5,7 +5,7 @@
<div class="dis-f jus-x al-item">
<div class="body-maxWidth mg-t-35">
<div class="dis-f jus-bet"
v-show="dataList.data && dataList.data.length > 0&&seachSelectData.data.tabType!=='apartment' && seachSelectData.data.intermediary !== ''">
v-show="dataList.data && dataList.data.length > 0 && seachSelectData.data.tabType !== 'apartment' && seachSelectData.data.intermediary !== ''">
<div ref="list">
<biserialItem v-for="(item, i) in pageList['1']" :key="i" :item="item" :imgLoad="watchImgLoad"
listId="1"></biserialItem>
@ -15,7 +15,7 @@
listId="2"></biserialItem>
</div>
</div>
<div v-show="seachSelectData.data&&seachSelectData.data.tabType==='apartment' && dataList.data && dataList.data.length > 0"
<div v-show="seachSelectData.data && seachSelectData.data.tabType === 'apartment' && dataList.data && dataList.data.length > 0"
ref="gridContainer">
<apartment-item v-for="item in listApartment" :item="item"></apartment-item>
</div>
@ -24,12 +24,11 @@
</div>
</div>
</div>
<loadMoreText :loadText="loading ? '加载中....' : '到底了'"></loadMoreText>
<loadMoreText :loadText="loadingText"></loadMoreText>
<listBtmPrompt></listBtmPrompt>
<footerTool></footerTool>
</div>
<back-to-top></back-to-top>
</template>
<script setup>
@ -60,6 +59,7 @@ let dataCount = ref(0)//数据数量
let pageList = reactive({ 1: [], 2: [], height1: 0, height2: 0, tab: 1 })//
let seachSelectData = reactive({ data: {} })//
let loading = ref(true)//
let loadingText = ref(` 加载中..... `)
let listApartment = ref([])//
let masonryInstance = null//
provide('count', dataCount)
@ -108,6 +108,11 @@ let getDataList = (data) => {
console.log(res.data)
// console.log(seachSelectData.data)
dataList.data = res.data.data
if (res.data.data.length < 20) {
loadingText.value = ` 到底了 `
} else {
loadingText.value = ' 加载中... '
}
if (seachSelectData.data.tabType !== 'apartment') {
if (pages.value === 1) {
setInitial()
@ -123,12 +128,16 @@ let getDataList = (data) => {
let data = res.data
dataList.count = res.data.count
dataCount.value = res.data.count
if(pages.value===1)listApartment.value=[]
if (pages.value === 1) listApartment.value = []
listApartment.value = listApartment.value.concat(data.data)
console.log(seachSelectData.data)
nextTick(() => {
masonryInstance.reloadItems();
masonryInstance.layout();
if (res.data.data.length >= 20) {
console.log(123)
loading.value = true
}
})
}
inputModuleInfo.value.setListCount(seachSelectData.data, dataList.count)
@ -189,9 +198,9 @@ onMounted(() => {
gutter: 20
});
routeQuery.data = route.currentRoute.value.query
if (routeQuery.data.keyword && routeQuery.data.keyword.replace(/\s/g, "")&&routeQuery.data.houseingPageType!=6) {
inputModuleInfo.value.searchInit(routeQuery.data.keyword)//
route.currentRoute.value.query.keyword = ''
if (routeQuery.data.keyword && routeQuery.data.keyword.replace(/\s/g, "") && routeQuery.data.houseingPageType != 6) {
inputModuleInfo.value.searchInit(routeQuery.data.keyword)//
route.currentRoute.value.query.keyword = ''
} else {
console.log(seachSelectData.data)
inputModuleInfo.value.checkPageType()