我的页面的跳转

This commit is contained in:
A1300399510
2023-07-26 19:14:37 +08:00
parent 0f3c5fd311
commit 44d99b26ce
3 changed files with 27 additions and 67 deletions

View File

@@ -8,16 +8,17 @@
<img src="../../assets/homeImage/seachIcon.svg" class="icon" alt="" @click="seachList"> <img src="../../assets/homeImage/seachIcon.svg" class="icon" alt="" @click="seachList">
</template> </template>
</el-input> </el-input>
<div class="map-box dis-f jus-x al-item"> <!-- 地图找房的入口 暂时隐藏 -->
<!-- <div class="map-box dis-f jus-x al-item">
<img src="../../assets/homeImage/mapImg.png" class="img" alt=""> <img src="../../assets/homeImage/mapImg.png" class="img" alt="">
</div> </div> -->
</div> </div>
<div class="dis-f al-item"> <div class="dis-f al-item">
<div class="tool-btn dis-f al-item jus-x"> <div class="tool-btn dis-f al-item jus-x" @click="gouser('fav')">
<img src="../../assets/homeImage/Mycollect.png" class="img" alt=""> <img src="../../assets/homeImage/Mycollect.png" class="img" alt="">
我的收藏 我的收藏
</div> </div>
<div class="tool-btn dis-f al-item jus-x mg-l-10"> <div class="tool-btn dis-f al-item jus-x mg-l-10" @click="gouser('fav')">
<img src="../../assets/homeImage/informationO.png" class="img" alt=""> <img src="../../assets/homeImage/informationO.png" class="img" alt="">
我的发布 我的发布
</div> </div>
@@ -46,8 +47,8 @@
</div> </div>
求房源 求房源
</div> </div>
<div class="top-btn dis-f jus-x al-item second" v-if="isNeedHousing" <div class="top-btn dis-f jus-x al-item second" v-if="isNeedHousing" @click="selectPage('intermediary')"
@click="selectPage('intermediary')" :class="{ 'select-top-btn-bg': tabType === 'intermediary' }"> :class="{ 'select-top-btn-bg': tabType === 'intermediary' }">
<div class="first-select"> <div class="first-select">
<div class="box"> <div class="box">
@@ -175,7 +176,7 @@ import selectTabBox from "../selectTabBox/selectTabBox.vue";
import apartmentSelect from '../apartment/seachModule.vue' import apartmentSelect from '../apartment/seachModule.vue'
import store from '../../store/index'; import store from '../../store/index';
import api from '@/utils/api'; import api from '@/utils/api';
import { useRouter } from 'vue-router'; import { useRoute, useRouter } from 'vue-router';
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
//路由 //路由
@@ -407,6 +408,9 @@ defineExpose({
checkPageType checkPageType
}) })
// 跳转我的页面
const gouser = tab => route.push(`/user?tab=${tab}`)
</script> </script>
<style scoped> <style scoped>
img { img {

View File

@@ -18,7 +18,6 @@
<el-carousel-item class="flexcenter" v-for="item in allCarouselsData"> <el-carousel-item class="flexcenter" v-for="item in allCarouselsData">
<img class="img" :src="item['image'] || item['imageurl']" <img class="img" :src="item['image'] || item['imageurl']"
@click="cloaseImageShow(allCarouselsData)"> @click="cloaseImageShow(allCarouselsData)">
<!-- <img class="video-icon" src="@/assets/img/publicImage/video-icon.svg" alt=""> -->
</el-carousel-item> </el-carousel-item>
</el-carousel> </el-carousel>
<div class="indicate-type flexacenter" v-if="allCarouselsData.length != 0"> <div class="indicate-type flexacenter" v-if="allCarouselsData.length != 0">
@@ -180,8 +179,8 @@
<img class="icon" src="@/assets/img/apartmentDetail/location-icon.png"> <img class="icon" src="@/assets/img/apartmentDetail/location-icon.png">
{{ info.location || '位置' }} {{ info.location || '位置' }}
</div> </div>
<!-- <view-map :latlng="{ longitude: info['coordinate'][0], latitude: info['coordinate'][1] }" <view-map :latlng="{ longitude: info['coordinate'][0], latitude: info['coordinate'][1] }"
:name="info['address']"></view-map> --> :name="info['address']"></view-map>
<!-- 交通 --> <!-- 交通 -->
<div class="traffic-box" v-if="info['traffic']"> <div class="traffic-box" v-if="info['traffic']">
@@ -428,15 +427,9 @@ proxy.$get("/tenement/pc/api/apartment/details", { uniqid }).then(res => {
handleAllCarouselsData() handleAllCarouselsData()
// setTimeout(() => { nextTick(() => handleNavData())
nextTick(() => {
handleNavData()
})
// }, 2000)
if (data.withsameapartments > 0) dualBrandData() if (data.withsameapartments > 0) dualBrandData()
}) })
@@ -516,52 +509,15 @@ let navTab = ref("roomEle")
// 处理 navList 数据 // 处理 navList 数据
const handleNavData = () => { const handleNavData = () => {
navconfig.forEach(element => { navconfig.forEach(element => {
console.log("element", eval(element['value']).value);
if (eval(element['value']).value) navList.value.push(element) if (eval(element['value']).value) navList.value.push(element)
// if (info.value[element.value] && element.value != 'roomEle' && element.value != 'companyEle') navList.value.push(element)
// else navList.value.push(element)
}) })
} }
// 处理点击nav 滚动事件 // 处理点击nav 滚动事件
const handleClickNav = value => { const handleClickNav = value => {
let scrollTop = 0 let scrollTop = eval(value).value.offsetTop + 136
switch (value) {
case "roomEle":
scrollTop = roomEle.value.offsetTop - 110;
break;
case "specialEle":
scrollTop = specialEle.value.offsetTop - 110;
break;
case "addressEle":
scrollTop = addressEle.value.offsetTop - 110;
break;
case "messageEle":
scrollTop = messageEle.value.offsetTop - 110;
break;
case "facilitiesEle":
scrollTop = facilitiesEle.value.offsetTop - 110;
break;
case "lifeEle":
scrollTop = lifeEle.value.offsetTop - 110;
break;
case "companyEle":
scrollTop = companyEle.value.offsetTop - 110;
break;
case "eleseEle":
scrollTop = eleseEle.value.offsetTop - 110;
break;
default:
break;
}
if (value != 'eleseEle') navTab.value = value if (value != 'eleseEle') navTab.value = value
window.scrollTo({ top: scrollTop, behavior: 'smooth' }); window.scrollTo({ top: scrollTop, behavior: 'smooth' });
} }

View File

@@ -103,13 +103,14 @@ import pageFooter from '@/components/footer/footer.vue'
import publicListItem from '@/components/public/public-list-item.vue' import publicListItem from '@/components/public/public-list-item.vue'
import emptyDuck from '@/components/public/empty-duck.vue' import emptyDuck from '@/components/public/empty-duck.vue'
import { ref, reactive, onMounted, onUnmounted, getCurrentInstance, nextTick } from 'vue' import { ref, reactive, onMounted, onUnmounted, getCurrentInstance, nextTick } from 'vue'
import { useRouter } from 'vue-router'; import { useRoute, useRouter } from 'vue-router';
import { ElLoading, ElMessage } from 'element-plus' import { ElLoading, ElMessage } from 'element-plus'
import Masonry from 'masonry-layout'; import Masonry from 'masonry-layout';
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const route = useRoute();
const gridContainer = ref(null); const gridContainer = ref(null);
const gridContainerpublish = ref(null); const gridContainerpublish = ref(null);
@@ -149,13 +150,13 @@ const init = () => {
if (res.code != 200) return if (res.code != 200) return
let data = res.data let data = res.data
if (data.count['publish'] > 0) { if (!route.query['tab']) {
tabState.value = 'publish' if (data.count['publish'] > 0) tabState.value = 'publish'
getPublishData() else tabState.value = 'fav'
} else { } else tabState.value = route.query['tab']
tabState.value = 'fav'
getFavData() if (tabState.value == 'publish') getPublishData()
} else getFavData()
user.value = data.user user.value = data.user
count.value = data.count count.value = data.count
@@ -522,5 +523,4 @@ onUnmounted(() => {
align-items: center; align-items: center;
border-radius: 16px; border-radius: 16px;
} }
</style> </style>