From 8da2aaf4824c6ccde421adf20727a978ef9638d8 Mon Sep 17 00:00:00 2001 From: luJianJun <2587063613@qq.com> Date: Fri, 28 Jul 2023 17:43:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AD=E4=BB=8B=E8=AF=A6=E6=83=85=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=88=BF=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../biserialListItem/biserialListItem.vue | 8 +----- src/components/detail/breadcrumb.vue | 10 +++---- .../indexWaterfallBox/indexWaterfallBox.vue | 5 ++-- src/store/index.js | 5 ++-- src/views/detail.vue | 26 ++++++++++--------- src/views/housingView/intermediary.vue | 8 +++++- src/views/housingView/needHousing.vue | 8 +++++- src/views/housingView/person.vue | 8 +++++- src/views/seachIndex.vue | 25 ++++++++++++------ 9 files changed, 63 insertions(+), 40 deletions(-) diff --git a/src/components/biserialListItem/biserialListItem.vue b/src/components/biserialListItem/biserialListItem.vue index 78d187c..276cf31 100644 --- a/src/components/biserialListItem/biserialListItem.vue +++ b/src/components/biserialListItem/biserialListItem.vue @@ -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 }) diff --git a/src/components/detail/breadcrumb.vue b/src/components/detail/breadcrumb.vue index 6329434..802a588 100644 --- a/src/components/detail/breadcrumb.vue +++ b/src/components/detail/breadcrumb.vue @@ -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 }) @@ -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; diff --git a/src/components/indexWaterfallBox/indexWaterfallBox.vue b/src/components/indexWaterfallBox/indexWaterfallBox.vue index 1d60912..d48c3c6 100644 --- a/src/components/indexWaterfallBox/indexWaterfallBox.vue +++ b/src/components/indexWaterfallBox/indexWaterfallBox.vue @@ -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() } } diff --git a/src/store/index.js b/src/store/index.js index 95ab310..d510537 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -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 } } }) diff --git a/src/views/detail.vue b/src/views/detail.vue index 06981a0..8eb4d12 100644 --- a/src/views/detail.vue +++ b/src/views/detail.vue @@ -629,7 +629,7 @@
房源 x{{ housingInfo['data'] && housingInfo['data'].intermediarylistingcount @@ -759,7 +759,7 @@
+ v-if="(pageType === 1&&recommendListData.length > 0) || (pageType === 2 && recommendListData.length > 0 && housingInfo['data'] && housingInfo['data'].isintermediary)"> - {{ loadText }} -
@@ -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', diff --git a/src/views/housingView/intermediary.vue b/src/views/housingView/intermediary.vue index 57252d3..4e7b99d 100644 --- a/src/views/housingView/intermediary.vue +++ b/src/views/housingView/intermediary.vue @@ -19,7 +19,7 @@
- + @@ -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() } diff --git a/src/views/housingView/needHousing.vue b/src/views/housingView/needHousing.vue index a1186d7..2bff7b9 100644 --- a/src/views/housingView/needHousing.vue +++ b/src/views/housingView/needHousing.vue @@ -19,7 +19,7 @@ - + @@ -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() } diff --git a/src/views/housingView/person.vue b/src/views/housingView/person.vue index 6ec60eb..4577c22 100644 --- a/src/views/housingView/person.vue +++ b/src/views/housingView/person.vue @@ -19,7 +19,7 @@ - + @@ -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() } diff --git a/src/views/seachIndex.vue b/src/views/seachIndex.vue index 4bc6408..a0d3d69 100644 --- a/src/views/seachIndex.vue +++ b/src/views/seachIndex.vue @@ -5,7 +5,7 @@
+ v-show="dataList.data && dataList.data.length > 0 && seachSelectData.data.tabType !== 'apartment' && seachSelectData.data.intermediary !== ''">
@@ -15,7 +15,7 @@ listId="2">
-
@@ -24,12 +24,11 @@
- + -