修改搜索页面的我的按钮

This commit is contained in:
A1300399510 2023-08-01 15:18:11 +08:00
parent 54bc83080d
commit 3c4571fd53

View File

@ -18,7 +18,7 @@
<img src="../../assets/homeImage/Mycollect.png" class="img" alt="">
我的收藏
</div>
<div class="tool-btn dis-f al-item jus-x mg-l-10" @click="gouser('fav')">
<div class="tool-btn dis-f al-item jus-x mg-l-10" @click="gouser('publish')">
<img src="../../assets/homeImage/informationO.png" class="img" alt="">
我的发布
</div>
@ -55,7 +55,7 @@
</div>
</div>
</div>
<div class="top-btn dis-f jus-x al-item second" v-if="!isNeedHousing&&houseingPageType!=6"
<div class="top-btn dis-f jus-x al-item second" v-if="!isNeedHousing && houseingPageType != 6"
@click="selectPage('intermediary')" :class="{ 'select-top-btn-bg': tabType === 'intermediary' }">
<div class="first-select" v-show="tabType === 'person'">
<div class="box">
@ -74,7 +74,8 @@
中介房源 {{ seachKey.key && seachKey.key.intermediary && seachKey.key.intermediary.count }}
</div>
<div class="top-btn dis-f jus-x al-item third" @click="selectPage('apartment')"
:class="{ 'select-top-btn-bg': tabType === 'apartment' }" v-if="!isNeedHousing&&houseingPageType!=6">
:class="{ 'select-top-btn-bg': tabType === 'apartment' }"
v-if="!isNeedHousing && houseingPageType != 6">
<div class="second-select-third-box" v-show="tabType === 'intermediary'">
<div class="box">
@ -197,7 +198,7 @@ let selectTabBoxInfo = ref(null)//个人/中介筛选实例
let apartmentSelectInfo = ref(null)//
//
let selectPage = (type) => {
if (type === seachAllType['tabType']||houseingPageType==6) return
if (type === seachAllType['tabType'] || houseingPageType == 6) return
if (type === 'apartment') {
selectTabBoxInfo.value.cleanSelect()//
} else {
@ -215,13 +216,13 @@ let selectPage = (type) => {
seachAllType['searchid'] = setPageKey()
if (type === 'person') {
seachAllType['intermediary'] = 0
houseingPageType='0'
sessionStorage.setItem('houseingPageType',0)
houseingPageType = '0'
sessionStorage.setItem('houseingPageType', 0)
selectTabBoxInfo.value.routerQuerySet()
} else if (type === 'intermediary') {
seachAllType['intermediary'] = 1
houseingPageType='1'
sessionStorage.setItem('houseingPageType',1)
houseingPageType = '1'
sessionStorage.setItem('houseingPageType', 1)
// route.currentRoute.value.query.houseingPageType='1'
selectTabBoxInfo.value.routerQuerySet()
} else {
@ -235,14 +236,14 @@ let getDataList = props.getDataList
//
let seachVal = ref('')
let isNeedHousing = ref(false)
seachVal.value = route.currentRoute.value.query.keyword&&route.currentRoute.value.query.keyword.replace(/\s/g, "")
seachVal.value = route.currentRoute.value.query.keyword && route.currentRoute.value.query.keyword.replace(/\s/g, "")
//
isNeedHousing.value = route.currentRoute.value.query.isNeedHousing === 'true'
//
let houseingPageType = sessionStorage.getItem('houseingPageType')
console.log('houseingPageType',houseingPageType)
console.log('houseingPageType', houseingPageType)
let type = houseingPageType === '0' ? 'person' : houseingPageType === '1' ? 'intermediary' : houseingPageType === '6' ? 'need' : 'apartment'
tabType.value = type
@ -250,7 +251,7 @@ tabType.value = type
let checkPageType = () => {
// houseingPageType 0 1 6
let type = houseingPageType === '0' ? 'person' : houseingPageType === '1' ? 'intermediary' : houseingPageType === '6' ? 'need' : 'apartment'
console.log('type',type)
console.log('type', type)
tabType.value = type
seachAllType['tabType'] = type
if (type === 'person') {
@ -285,14 +286,14 @@ let seachAllType = reactive({
})
//url
if(isNeedHousing.value){
if (isNeedHousing.value) {
tabType.value = 'need'
seachAllType['intermediary'] = 6
}
//
let setSeachConditions = (type, data) => {
console.log(1,seachAllType)
console.log(1, seachAllType)
console.log(type.value)
if (seachAllType['tabType'] !== 'apartment') {
if (type === 'rent') {
@ -313,7 +314,7 @@ let setSeachConditions = (type, data) => {
}
} else {
seachAllType = {
tabType:'apartment',
tabType: 'apartment',
...type.value
}
}
@ -359,10 +360,10 @@ let seachList = (item) => {
searchInit(seachVal.value)
}
route.push({
path:routeInfo.path,
query:{
keyword:seachVal.value,
isNeedHousing:routeInfo.query.isNeedHousing
path: routeInfo.path,
query: {
keyword: seachVal.value,
isNeedHousing: routeInfo.query.isNeedHousing
}
})
}
@ -438,7 +439,13 @@ defineExpose({
})
//
const gouser = tab => route.push(`/user?tab=${tab}`)
const gouser = tab => {
if (!store.state['user']['uid']) {
store.state.showloginmodal = true
return
}
route.push(`/user?tab=${tab}`)
}
</script>
<style scoped>
@ -891,7 +898,7 @@ img {
width: 150px;
background: inherit;
background-color: rgba(255, 255, 255, 1);
padding:10px;
padding: 10px;
}
.dropdown-check-text {