增加加载提示语 添加搜索同步url 修改搜索页搜索类型显示

This commit is contained in:
2023-07-31 16:11:05 +08:00
parent 323e153967
commit 0b3643e04d
10 changed files with 80 additions and 68 deletions

View File

@@ -175,19 +175,18 @@ let seachList = (item) => {
historyArr.data.push(seachAllType.keyword)
}
localStorage.setItem('historyArr', JSON.stringify(historyArr.data));
sessionStorage.setItem('houseingPageType',routePath.value === '/needHousing' ? '6' : routePath.value === '/intermediaryHousing' ? '1' : routePath.value === '/personHousing' ? '0' : '0')
route.push({
path: '/seachPage',
query: {
keyword: seachAllType.keyword,
isNeedHousing: routePath.value === '/needHousing',
houseingPageType: routePath.value === '/needHousing' ? 6 : routePath.value === '/intermediaryHousing' ? 1 : routePath.value === '/personHousing' ? 0 : 0
}
})
}
//设置搜索数据
let setSeachConditions = (type, data,second=null) => {
console.log(type,data,second)
if (type === 'rent') {
seachAllType['rent_min'] = data.min
seachAllType['rent_max'] = data.max

View File

@@ -215,11 +215,14 @@ let selectPage = (type) => {
seachAllType['searchid'] = setPageKey()
if (type === 'person') {
seachAllType['intermediary'] = 0
route.currentRoute.value.query.houseingPageType='0'
houseingPageType='0'
sessionStorage.setItem('houseingPageType',0)
selectTabBoxInfo.value.routerQuerySet()
} else if (type === 'intermediary') {
seachAllType['intermediary'] = 1
route.currentRoute.value.query.houseingPageType='1'
houseingPageType='1'
sessionStorage.setItem('houseingPageType',1)
// route.currentRoute.value.query.houseingPageType='1'
selectTabBoxInfo.value.routerQuerySet()
} else {
seachAllType['intermediary'] = ''
@@ -238,8 +241,8 @@ seachVal.value = route.currentRoute.value.query.keyword&&route.currentRoute.valu
isNeedHousing.value = route.currentRoute.value.query.isNeedHousing === 'true'
//判断当前是什么页面
let houseingPageType = route.currentRoute.value.query.houseingPageType
console.log('houseingPageType',route.currentRoute.value.query)
let houseingPageType = sessionStorage.getItem('houseingPageType')
console.log('houseingPageType',houseingPageType)
let type = houseingPageType === '0' ? 'person' : houseingPageType === '1' ? 'intermediary' : houseingPageType === '6' ? 'need' : 'apartment'
tabType.value = type
@@ -336,6 +339,7 @@ let searchInit = (data) => {
}
//搜索数据
let seachList = (item) => {
let routeInfo = route.currentRoute.value
if (!seachVal.value.replace(/\s/g, "")) return
if (!seachVal.value) {
return
@@ -346,6 +350,13 @@ let seachList = (item) => {
} else {
searchInit(seachVal.value)
}
route.push({
path:routeInfo.path,
query:{
keyword:seachVal.value,
isNeedHousing:routeInfo.query.isNeedHousing
}
})
}
//筛选词条

View File

@@ -637,6 +637,7 @@ let setRouterQuerySet = ref(true)
let routerQuerySet = () => {
if(routePath.value==='/seachPage'){
deconstructionSeachData = routeQuery.data
deconstructionSeachData.houseingPageType=sessionStorage.getItem('houseingPageType')
}else{
deconstructionSeachData = deconstructionData(routeQuery.data)
}