增加加载提示语 添加搜索同步url 修改搜索页搜索类型显示
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//筛选词条
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user