搜索页新增求房源判断
This commit is contained in:
BIN
src/assets/img/detail/imageIcon.png
Normal file
BIN
src/assets/img/detail/imageIcon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
BIN
src/assets/img/detail/videoIcon.png
Normal file
BIN
src/assets/img/detail/videoIcon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
@@ -160,22 +160,29 @@ historyArr.data = JSON.parse(localStorage.getItem('historyArr')) || []
|
|||||||
//搜索数据
|
//搜索数据
|
||||||
let seachList = (item) => {
|
let seachList = (item) => {
|
||||||
// console.log(123)
|
// console.log(123)
|
||||||
let string=seachAllType.keyword
|
let string = seachAllType.keyword
|
||||||
if (!string.replace(/\s/g, "")) return
|
if (!string.replace(/\s/g, "")) return
|
||||||
if (historyArr.data.indexOf(seachAllType.keyword) === -1) {
|
if (historyArr.data.indexOf(seachAllType.keyword) === -1) {
|
||||||
historyArr.data.push(seachAllType.keyword)
|
historyArr.data.push(seachAllType.keyword)
|
||||||
}
|
}
|
||||||
localStorage.setItem('historyArr', JSON.stringify(historyArr.data));
|
localStorage.setItem('historyArr', JSON.stringify(historyArr.data));
|
||||||
if (routePath.value === '/') {
|
route.push({
|
||||||
route.push({
|
path: '/seachPage',
|
||||||
path: '/seachPage',
|
query: {
|
||||||
query: {
|
keyword: seachAllType.keyword,
|
||||||
keyword: seachAllType.keyword
|
isNeedHousing:routePath.value === '/needHousing'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}else{
|
// if (routePath.value === '/') {
|
||||||
setSeachConditions()
|
// route.push({
|
||||||
}
|
// path: '/seachPage',
|
||||||
|
// query: {
|
||||||
|
// keyword: seachAllType.keyword
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// }else{
|
||||||
|
// setSeachConditions()
|
||||||
|
// }
|
||||||
|
|
||||||
// getDataList(seachAllType)
|
// getDataList(seachAllType)
|
||||||
}
|
}
|
||||||
@@ -418,6 +425,7 @@ defineExpose({
|
|||||||
border-radius: 0 8px 8px 0;
|
border-radius: 0 8px 8px 0;
|
||||||
line-height: 48px;
|
line-height: 48px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
transform: translateX(-3px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.img {
|
.img {
|
||||||
|
|||||||
@@ -25,20 +25,33 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="seach-info-box body-maxWidth">
|
<div class="seach-info-box body-maxWidth">
|
||||||
<div class="top-box dis-f al-item">
|
<div class="top-box dis-f al-item">
|
||||||
<div class="top-btn dis-f jus-x al-item first" @click="selectPage('person')"
|
<div class="top-btn dis-f jus-x al-item first" v-if="!isNeedHousing" @click="selectPage('person')"
|
||||||
:class="{ 'select-top-btn-bg': tabType === 'person' }">
|
:class="{ 'select-top-btn-bg': tabType === 'person' }">
|
||||||
<div class="top-btn" :class="[tabType === 'person' ? 'select-top-btn' : 'first-no-select']"
|
<div class="top-btn" :class="[tabType === 'person' ? 'select-top-btn' : 'first-no-select']"
|
||||||
v-show="tabType === 'person'">
|
v-show="tabType === 'person'">
|
||||||
个人房源 521
|
个人房源 {{ seachKey.key&&seachKey.key.personal&&seachKey.key.personal.count }}
|
||||||
</div>
|
</div>
|
||||||
个人房源 521
|
个人房源 {{ seachKey.key&&seachKey.key.personal&&seachKey.key.personal.count }}
|
||||||
<div class="second-select" v-show="tabType === 'intermediary'">
|
<div class="second-select" v-show="tabType === 'intermediary'">
|
||||||
<div class="box">
|
<div class="box">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="top-btn dis-f jus-x al-item second" @click="selectPage('intermediary')"
|
<div class="top-btn dis-f jus-x al-item first" v-if="isNeedHousing" @click="selectPage('person')"
|
||||||
|
:class="{ 'select-top-btn-bg': tabType === 'person' }">
|
||||||
|
<div class="top-btn" :class="[tabType === 'person' ? 'select-top-btn' : 'first-no-select']"
|
||||||
|
v-show="tabType === 'person'">
|
||||||
|
求房源 {{ seachKey.key&&seachKey.key.personal&&seachKey.key.personal.count }}
|
||||||
|
</div>
|
||||||
|
求房源 {{ seachKey.key&&seachKey.key.personal&&seachKey.key.personal.count }}
|
||||||
|
<div class="second-select" v-show="tabType === 'intermediary'">
|
||||||
|
<div class="box">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="top-btn dis-f jus-x al-item second" v-if="!isNeedHousing" @click="selectPage('intermediary')"
|
||||||
:class="{ 'select-top-btn-bg': tabType === 'intermediary' }">
|
:class="{ 'select-top-btn-bg': tabType === 'intermediary' }">
|
||||||
<div class="first-select" v-show="tabType === 'person'">
|
<div class="first-select" v-show="tabType === 'person'">
|
||||||
<div class="box">
|
<div class="box">
|
||||||
@@ -52,12 +65,12 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="top-btn" :class="[tabType === 'intermediary' ? 'select-top-btn' : 'first-no-select']"
|
<div class="top-btn" :class="[tabType === 'intermediary' ? 'select-top-btn' : 'first-no-select']"
|
||||||
v-show="tabType === 'intermediary'">
|
v-show="tabType === 'intermediary'">
|
||||||
中介房源 82
|
中介房源 {{ seachKey.key&&seachKey.key.intermediary&&seachKey.key.intermediary.count }}
|
||||||
</div>
|
</div>
|
||||||
中介房源 82
|
中介房源 {{ seachKey.key&&seachKey.key.intermediary&&seachKey.key.intermediary.count }}
|
||||||
</div>
|
</div>
|
||||||
<div class="top-btn dis-f jus-x al-item third" @click="selectPage('apartment')"
|
<div class="top-btn dis-f jus-x al-item third" @click="selectPage('apartment')"
|
||||||
:class="{ 'select-top-btn-bg': tabType === 'apartment' }">
|
:class="{ 'select-top-btn-bg': tabType === 'apartment' }" v-if="!isNeedHousing">
|
||||||
<div class="second-select-third-box" v-show="tabType === 'intermediary'">
|
<div class="second-select-third-box" v-show="tabType === 'intermediary'">
|
||||||
<div class="box">
|
<div class="box">
|
||||||
|
|
||||||
@@ -65,9 +78,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="top-btn" :class="[tabType === 'apartment' ? 'select-top-btn' : 'first-no-select']"
|
<div class="top-btn" :class="[tabType === 'apartment' ? 'select-top-btn' : 'first-no-select']"
|
||||||
v-show="tabType === 'apartment'">
|
v-show="tabType === 'apartment'">
|
||||||
品牌公寓 6
|
品牌公寓 {{ seachKey.key&&seachKey.key.studentapartment&&seachKey.key.studentapartment.count }}
|
||||||
</div>
|
</div>
|
||||||
学生公寓 6
|
学生公寓 {{ seachKey.key&&seachKey.key.studentapartment&&seachKey.key.studentapartment.count }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-show="tabType === 'apartment'" :class="{ 'show-box-pd': !showSelectModule }">
|
<div v-show="tabType === 'apartment'" :class="{ 'show-box-pd': !showSelectModule }">
|
||||||
@@ -203,7 +216,11 @@ let getDataList = props.getDataList
|
|||||||
|
|
||||||
//搜索内容
|
//搜索内容
|
||||||
let seachVal = ref('')
|
let seachVal = ref('')
|
||||||
|
let isNeedHousing=ref(false)
|
||||||
seachVal.value = route.currentRoute.value.query.keyword
|
seachVal.value = route.currentRoute.value.query.keyword
|
||||||
|
|
||||||
|
//判断是否从求房源页面跳转
|
||||||
|
isNeedHousing.value = route.currentRoute.value.query.isNeedHousing==='true'
|
||||||
//搜索key
|
//搜索key
|
||||||
let seachKey = reactive({ key: {} })
|
let seachKey = reactive({ key: {} })
|
||||||
|
|
||||||
@@ -253,11 +270,11 @@ let setPageKey = () => {
|
|||||||
|
|
||||||
//搜索初始化
|
//搜索初始化
|
||||||
let searchInit = (data) => {
|
let searchInit = (data) => {
|
||||||
|
console.log(123456)
|
||||||
api.search({ keyword: data }).then(res => {
|
api.search({ keyword: data }).then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
seachKey.key = res.data
|
seachKey.key = res.data
|
||||||
seachAllType.searchid = setPageKey()
|
seachAllType.searchid = setPageKey()
|
||||||
// console.log(seachAllType)
|
|
||||||
getDataList(seachAllType, tabType.value)
|
getDataList(seachAllType, tabType.value)
|
||||||
} else {
|
} else {
|
||||||
ElMessage({
|
ElMessage({
|
||||||
@@ -269,7 +286,7 @@ let searchInit = (data) => {
|
|||||||
}
|
}
|
||||||
//搜索数据
|
//搜索数据
|
||||||
let seachList = (item) => {
|
let seachList = (item) => {
|
||||||
if(seachVal.value.replace(/\s/g,""))return
|
if(!seachVal.value.replace(/\s/g,""))return
|
||||||
if (!seachVal.value) {
|
if (!seachVal.value) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -242,6 +242,25 @@ import store from '../../store/index';
|
|||||||
//数据包
|
//数据包
|
||||||
let configData = reactive({ data: {} })
|
let configData = reactive({ data: {} })
|
||||||
|
|
||||||
|
//保存筛选参数
|
||||||
|
let setStoreSelectData=(obj,data,type)=>{
|
||||||
|
console.log(store.state.seachSelect)
|
||||||
|
// otherCheck['list']
|
||||||
|
// releaseObj.id
|
||||||
|
// gender.id
|
||||||
|
// hireDate.id
|
||||||
|
// hireDate.title
|
||||||
|
// hireTypeObj.id
|
||||||
|
// hireTypeObj.title
|
||||||
|
// hireTypeObj.hireId
|
||||||
|
// selectTabCheck.id
|
||||||
|
// selectTabCheck.title
|
||||||
|
// selectTabCheck.data
|
||||||
|
// selectData.data
|
||||||
|
// schoolSelectObj.id
|
||||||
|
// schoolSelectObj.title
|
||||||
|
}
|
||||||
|
|
||||||
//监听路由
|
//监听路由
|
||||||
const route = useRouter()
|
const route = useRouter()
|
||||||
let routePath = ref('')
|
let routePath = ref('')
|
||||||
@@ -362,15 +381,6 @@ let nextSchoolData = () => {
|
|||||||
//设置状态
|
//设置状态
|
||||||
let setSelectPosition = (type) => {
|
let setSelectPosition = (type) => {
|
||||||
selectPosition.value = type
|
selectPosition.value = type
|
||||||
// if (type === 'school') {
|
|
||||||
// selectTabCheck.id = '';
|
|
||||||
// selectTabCheck.title = '不限'
|
|
||||||
// selectTabCheck.data = [];
|
|
||||||
// selectData.data = []
|
|
||||||
// } else {
|
|
||||||
// schoolSelectObj.id = ''
|
|
||||||
// schoolSelectObj.title = ''
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//点击区域/学校选项
|
//点击区域/学校选项
|
||||||
@@ -533,6 +543,7 @@ let otherCheck = reactive({ list: [] })
|
|||||||
|
|
||||||
//设置其他
|
//设置其他
|
||||||
let setOtherCheck = (data) => {
|
let setOtherCheck = (data) => {
|
||||||
|
// setStoreSelectData('otherCheck',data)
|
||||||
setSeachCondition('', data)
|
setSeachCondition('', data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ import Axios from '@/utils/axios';
|
|||||||
|
|
||||||
api.index().then(res => {
|
api.index().then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
|
console.log(123)
|
||||||
store.state.seachTypeData = res.data.combination
|
store.state.seachTypeData = res.data.combination
|
||||||
store.state.indexData = res.data
|
store.state.indexData = res.data
|
||||||
store.state.ListSelectBtn = res.data.recommendedTab
|
store.state.ListSelectBtn = res.data.recommendedTab
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ export default createStore({
|
|||||||
wechat: {}, // 微信号 二维码等数据
|
wechat: {}, // 微信号 二维码等数据
|
||||||
nav: [], // 顶部的导航数据
|
nav: [], // 顶部的导航数据
|
||||||
apartment: {}, // 公寓筛选的字段
|
apartment: {}, // 公寓筛选的字段
|
||||||
// <<<<<<< HEAD
|
|
||||||
routeList:{
|
routeList:{
|
||||||
index:{
|
index:{
|
||||||
path:'/',
|
path:'/',
|
||||||
@@ -20,9 +19,8 @@ export default createStore({
|
|||||||
title:'',
|
title:'',
|
||||||
}
|
}
|
||||||
},//导航路由列表
|
},//导航路由列表
|
||||||
// =======
|
seachSelect:{},//保存筛选条件
|
||||||
showloginmodal: false, // 是否需要登录状态
|
showloginmodal: false, // 是否需要登录状态
|
||||||
// >>>>>>> 542e853 (提交)
|
|
||||||
},
|
},
|
||||||
getters: {
|
getters: {
|
||||||
|
|
||||||
|
|||||||
@@ -44,8 +44,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div class="image-box">
|
||||||
|
<div class="dis-f al-item">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
@@ -185,6 +188,31 @@ img {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.image-box {
|
||||||
|
margin-top: 35px;
|
||||||
|
|
||||||
|
.img-video {
|
||||||
|
width: 26px;
|
||||||
|
height: 26px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.img-icon {
|
||||||
|
width: 22px;
|
||||||
|
height: 22px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.num-box {
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
border-radius: 50%;
|
||||||
|
color: #333333;
|
||||||
|
font-family: 'PingFangSC-Regular', 'PingFang SC', sans-serif;
|
||||||
|
font-weight: 400;
|
||||||
|
font-style: normal;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
@@ -181,7 +181,7 @@ onMounted(() => {
|
|||||||
routeQuery.data = route.currentRoute.value.query
|
routeQuery.data = route.currentRoute.value.query
|
||||||
console.log(routeQuery)
|
console.log(routeQuery)
|
||||||
if(routeQuery.data.keyword){
|
if(routeQuery.data.keyword){
|
||||||
inputModuleInfo.value.searchInit(routeQuery.data.keyword)
|
inputModuleInfo.value.searchInit(routeQuery.data.keyword)//调用搜索组件的搜索功能
|
||||||
route.currentRoute.value.query={}
|
route.currentRoute.value.query={}
|
||||||
}else{
|
}else{
|
||||||
getDataList()
|
getDataList()
|
||||||
|
|||||||
Reference in New Issue
Block a user