顶部跳转判断

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)=>{
console.log(checkList.list)
console.log(123,checkList.list)
checkList.list=data
}

View File

@@ -40,7 +40,7 @@
</div>
</div>
<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="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)">
@@ -119,6 +119,8 @@ let topTabSelect = (type, item) => {
//页面跳转
const router = useRouter()
let tabBtnType = ref('/')
let pageTopBarShow= router.currentRoute.value.meta.topBarShow
let changeTabBtnType = (item) => {
tabBtnType.value = item.path
router.push({

View File

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

View File

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

View File

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

View File

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