顶部跳转判断

This commit is contained in:
2023-07-27 19:04:50 +08:00
parent 8fbe531684
commit ff5f842595
6 changed files with 19 additions and 17 deletions

View File

@@ -86,7 +86,7 @@ let closeBtn=()=>{
//设置参数 //设置参数
let setCheckData=(data)=>{ let setCheckData=(data)=>{
console.log(checkList.list) console.log(123,checkList.list)
checkList.list=data checkList.list=data
} }

View File

@@ -40,7 +40,7 @@
</div> </div>
</div> </div>
<div class="btm-seach-btn-box dis-f al-item jus-x" <div class="btm-seach-btn-box dis-f al-item jus-x"
v-if="routePath !== '/seachPage' && routePath !== '/detail' && routePath !== '/apartmentDetail' && routePath !== '/edit'"> v-if="pageTopBarShow">
<div class="body-maxWidth dis-f" style="height:48px;"> <div class="body-maxWidth dis-f" style="height:48px;">
<div class="tab-btn dis-f al-item jus-x" :class="{ 'tab-btn-click': item.path === tabBtnType }" <div class="tab-btn dis-f al-item jus-x" :class="{ 'tab-btn-click': item.path === tabBtnType }"
v-for="(item, i) in seachTab.data" :key="i" @click="changeTabBtnType(item)"> v-for="(item, i) in seachTab.data" :key="i" @click="changeTabBtnType(item)">
@@ -119,6 +119,8 @@ let topTabSelect = (type, item) => {
//页面跳转 //页面跳转
const router = useRouter() const router = useRouter()
let tabBtnType = ref('/') let tabBtnType = ref('/')
let pageTopBarShow= router.currentRoute.value.meta.topBarShow
let changeTabBtnType = (item) => { let changeTabBtnType = (item) => {
tabBtnType.value = item.path tabBtnType.value = item.path
router.push({ router.push({

View File

@@ -486,7 +486,6 @@ let setHireTypeArr = (type, id) => {
let hireTypeObj = reactive({ id: '', title: '', hireId: '不限' })//出租方式所选 let hireTypeObj = reactive({ id: '', title: '', hireId: '不限' })//出租方式所选
let setHireId = (item) => { let setHireId = (item) => {
console.log(item)
if (hireTypeObj.hireId != item.title) { if (hireTypeObj.hireId != item.title) {
hireTypeObj.id = '' hireTypeObj.id = ''
hireTypeObj.title = '' hireTypeObj.title = ''
@@ -579,14 +578,11 @@ let cleanSelect = () => {
//查找数据 //查找数据
let getAddressListId=(id,type)=>{ let getAddressListId=(id,type)=>{
console.log(store.state.seachTypeData[0].where)
let data=null let data=null
let checkList= type==='location'?list:type==='types'?hireTypeArr:type==='school'?store.state.seachTypeData[0].where:'' let checkList= type==='location'?list:type==='types'?hireTypeArr:type==='school'?store.state.seachTypeData[0].where:''
let dataId=type==='types'?id.substring(0,1):id let dataId=type==='types'?id.substring(0,1):id
checkList.map(res=>{ checkList.map(res=>{
console.log(res,id)
if(res.id==dataId){ if(res.id==dataId){
console.log(res)
if(type==='types'){ if(type==='types'){
data=getHireType(res.hireType,id) data=getHireType(res.hireType,id)
}else{ }else{
@@ -594,7 +590,6 @@ let getAddressListId=(id,type)=>{
} }
} }
}) })
console.log(data)
return data return data
} }
@@ -635,7 +630,6 @@ let deconstructionSeachData=null
//根据路由设置参数 //根据路由设置参数
let setRouterQuerySet = ref(true) let setRouterQuerySet = ref(true)
let routerQuerySet = () => { let routerQuerySet = () => {
console.log(123, routeQuery)
deconstructionSeachData=deconstructionData(routeQuery.data) deconstructionSeachData=deconstructionData(routeQuery.data)
console.log(deconstructionSeachData) console.log(deconstructionSeachData)
if (!setRouterQuerySet.value) return if (!setRouterQuerySet.value) return
@@ -678,7 +672,9 @@ let routerQuerySet = () => {
hireTypeObj.title = selectData.data.length == 0 ? '' : data.name hireTypeObj.title = selectData.data.length == 0 ? '' : data.name
hireTypeObj.hireId = type == 1 ? '合租' : type == 2 ? '整租' : '不限' hireTypeObj.hireId = type == 1 ? '合租' : type == 2 ? '整租' : '不限'
} }
setCheckBoxData(deconstructionSeachData.selectData)//设置地区选项 nextTick(()=>{
setCheckBoxData(deconstructionSeachData.selectData)//设置地区选项
})
} }
} }
setRouterQuerySet.value = false setRouterQuerySet.value = false

View File

@@ -10,7 +10,8 @@ const routes = [
component: HomeView, component: HomeView,
meta: { meta: {
title: "首页", title: "首页",
path:'/' path:'/',
topBarShow:true
} }
}, },
{ {
@@ -40,7 +41,8 @@ const routes = [
component: () => import(/* webpackChunkName: "user" */ '@/views/user.vue'), component: () => import(/* webpackChunkName: "user" */ '@/views/user.vue'),
meta: { meta: {
title: "我的", title: "我的",
path:'/user' path:'/user',
topBarShow:true
} }
}, },
{ {
@@ -56,7 +58,8 @@ const routes = [
component: () => import(/* webpackChunkName: "housing" */ '@/views/housingView/person.vue'), component: () => import(/* webpackChunkName: "housing" */ '@/views/housingView/person.vue'),
meta: { meta: {
title: '个人房源', title: '个人房源',
path:'/personHousing' path:'/personHousing',
topBarShow:true
} }
}, },
{//中介房源 {//中介房源
@@ -64,7 +67,8 @@ const routes = [
component: () => import(/* webpackChunkName: "housing" */ '@/views/housingView/intermediary.vue'), component: () => import(/* webpackChunkName: "housing" */ '@/views/housingView/intermediary.vue'),
meta: { meta: {
title: '中介房源', title: '中介房源',
path:'/intermediaryHousing' path:'/intermediaryHousing',
topBarShow:true
} }
}, },
{//求房源 {//求房源
@@ -72,7 +76,8 @@ const routes = [
component: () => import(/* webpackChunkName: "housing" */ '@/views/housingView/needHousing.vue'), component: () => import(/* webpackChunkName: "housing" */ '@/views/housingView/needHousing.vue'),
meta: { meta: {
title: '求房源', title: '求房源',
path:'/needHousing' path:'/needHousing',
topBarShow:true
} }
}, },
{//搜索 {//搜索
@@ -88,7 +93,8 @@ const routes = [
component: () => import(/* webpackChunkName: "housing" */ '@/views/housingView/apartment.vue'), component: () => import(/* webpackChunkName: "housing" */ '@/views/housingView/apartment.vue'),
meta: { meta: {
title: "品牌公寓", title: "品牌公寓",
path:'/apartment' path:'/apartment',
topBarShow:true
} }
}, },
{ {

View File

@@ -388,7 +388,6 @@ let personHouseingInfo = (type, data, areaItem) => {
query: { query: {
[type]:setData, [type]:setData,
areaItem:areaItems['id']?`${areaItems['id']}`:'' areaItem:areaItems['id']?`${areaItems['id']}`:''
}, },
// params:{ // params:{
// type, // type,

View File

@@ -147,7 +147,6 @@ let downLoadMore = () => {
//listImg //listImg
onMounted(() => { onMounted(() => {
console.log(router.currentRoute.value.query)
let {type,data}=router.currentRoute.value.query let {type,data}=router.currentRoute.value.query
let typeData = null let typeData = null
if (data) typeData = JSON.parse(data) if (data) typeData = JSON.parse(data)