筛选优化

This commit is contained in:
luJianJun 2023-08-10 14:29:35 +08:00
parent f7fe717a7e
commit 84b9ac51aa
8 changed files with 32 additions and 19 deletions

View File

@ -151,4 +151,7 @@ input[type="number"] {
.rotate180 {
transform: rotate(180deg);
}
.el-loading-mask{
z-index:2100 !important;
}
</style>

View File

@ -81,7 +81,7 @@
&& data.data.rent }}</div>
<div class="price" v-if="Array.isArray(data && data.data && data.data.rent)">{{ data && data.data
&&
data.data.rent[0] }}<span v-if="data && data.data && data.data.rent[1]">~{{ data && data.data && data.data.rent[1] }}</span></div>
data.data.rent[0] }}<span class="price" v-if="data && data.data && data.data.rent[1]">~{{ data && data.data && data.data.rent[1] }}</span></div>
<span>/{{ data && data.data && data.data.rentalperiod }}</span>
<span class="time"
v-show="data && data.data && data.data.rentalduration != 0 && pageType == 2">[

View File

@ -137,7 +137,8 @@ let historyArr = reactive({ data: [] })//历史查找记录
let hotArr = reactive({ data: [] })
let seachAllType = reactive({
keyword: '',
location: []
location: [],
orderby: 'timestamp'
})

View File

@ -368,6 +368,7 @@ let setSchoolData = () => {
//
let setSchoolObj = (obj) => {
if(obj.id===schoolSelectObj.id)return
schoolSelectObj.id = obj.id
schoolSelectObj.title = obj.title
selectTabCheck.id = '';
@ -442,6 +443,7 @@ let setCheckBoxData = (data) => {
checkBoxGroupInfo.value && checkBoxGroupInfo.value.setCheckData(data)
}
let loactionArr=shallowReactive({data:null})
//
let selectSeach = (data = []) => {
selectData.data = seachAreaId(data)
@ -449,10 +451,14 @@ let selectSeach = (data = []) => {
if (data.length === 0 && selectTabCheck.id) {
data.push(selectTabCheck.id)
selectData.data = [{ title: '不限', id: '' }]
setCheckBoxData([])
}
schoolSelectObj.id = ''
schoolSelectObj.title = ''
if(loactionArr.data&&(loactionArr.data.toString()===data.toString()))return
loactionArr.data=JSON.parse(JSON.stringify(data))
setSeachCondition('location', data)
}
@ -479,6 +485,7 @@ let deleteSelect = (i, id) => {
//
let listSortCheck = (item) => {
let obj = listSort.type[item]
if(obj.type===listSort.checkType)return
listSort.checkType = obj.type
listSort.check = obj.title
setSeachCondition('orderby', obj.type)
@ -487,7 +494,7 @@ let listSortCheck = (item) => {
//
let hireTypeArr = shallowReactive([{ hireType: [], title: '不限' }, { title: '合租', id: 1, hireType: [] }, { hireType: [], id: 2, title: '整租' }])
let hireTypeArr = shallowReactive([{ hireType: [],id:'', title: '不限' }, { title: '合租', id: 1, hireType: [] }, { hireType: [], id: 2, title: '整租' }])
//
let setHireTypeArr = (type, id) => {
@ -502,29 +509,27 @@ let setHireTypeArr = (type, id) => {
}
let hireTypeObj = reactive({ id: '', title: '', hireId: '不限' })//
let hireTypeObj = reactive({ id: '', title: '', hireId: '不限',checkId:'' })//
let setHireId = (item) => {
if(item.id===hireTypeObj.id)return
if (hireTypeObj.hireId != item.title) {
hireTypeObj.id = ''
hireTypeObj.title = ''
hireTypeObj.checkId=item.id
}
if (item.hireType.length === 0) {
setSeachCondition('types', '')
}
if(hireTypeObj.checkId.toString().length>1)return
hireTypeObj.hireId = item.title
if(!hireTypeObj.id){
hireTypeObj.id = item.id
setLocation('types',hireTypeObj.id)
}
hireTypeObj.id = item.id
setSeachCondition('types',hireTypeObj.id)
}
let dropdownCommand = (obj) => {
if(obj.id===hireTypeObj.checkId)return
hireTypeObj.id = obj.id
hireTypeObj.checkId = obj.id
hireTypeObj.title = obj.title
// store.state.routeList['hireTypeObj'] = JSON.parse(JSON.stringify(hireTypeObj))
console.log('obj',hireTypeObj)
setSeachCondition('types', obj.id)
}
@ -547,6 +552,7 @@ let hireData = reactive([{ title: '不限', id: 0 }, { title: '一年以上', id
let hireDate = reactive({ id: 0, title: '' })
//
let setHireDate = (item) => {
if(item.id===hireDate.id)return
hireDate.id = item.id
setSeachCondition('leaseterm', item.id)
}
@ -556,6 +562,7 @@ let genderData = reactive([{ title: '不限', id: 0 }, { title: '女', id: 1 },
let gender = reactive({ id: 0 })
//
let setGender = (item) => {
if(item.id===gender.id)return
gender.id = item.id
setSeachCondition('gender', item.id)
}
@ -566,6 +573,7 @@ let releaseObj = reactive({ id: 0 })
//
let setReleaseObj = (item) => {
if(item.id===releaseObj.id)return
releaseObj.id = item.id
setSeachCondition('publish', item.id)
}

View File

@ -4,7 +4,7 @@ function startLoading() {
loading = ElLoading.service({
lock: true,
text: 'Loading',
background: 'rgba(0, 0, 0, 0.7)',
background: 'rgba(0, 0, 0, 0.7)'
})
}
// 关闭loading事件

View File

@ -33,8 +33,8 @@
v-if="Array.isArray(housingInfo['data'] && housingInfo['data'].info.rent)">
{{
housingInfo['data'] && housingInfo['data'].info.rent[0]
}}<span
v-if="housingInfo['data'] && housingInfo['data'].info.rent[1]">~{{ housingInfo['data']
}}<span class="rent" v-if="housingInfo['data'] && housingInfo['data'].info.rent[1]" >~</span><span class="rent" style="margin:0;"
v-if="housingInfo['data'] && housingInfo['data'].info.rent[1]">{{ housingInfo['data']
&& housingInfo['data'].info.rent[1] }}</span>
</span>
<span>/{{ housingInfo['data'] && housingInfo['data'].info.rentalperiod }}</span>
@ -110,7 +110,7 @@
<span class="rent" v-if="Array.isArray(housingInfo['data'] && housingInfo['data'].info.rent)">
{{
housingInfo['data'] && housingInfo['data'].info.rent[0]
}}<span
}}<span class="rent" style="margin:0;"
v-if="housingInfo['data'] && housingInfo['data'].info.rent[1]">~{{ housingInfo['data'] &&
housingInfo['data'].info.rent[1] }}</span>
</span>
@ -735,7 +735,7 @@
</div>
<div class="mg-t-10" v-if="contacts['data'].companyname">
<span>
代理人牌照号
所属公司
</span>
<span>
{{ contacts['data'].companyname }}

View File

@ -83,6 +83,7 @@ let getDataList = (data) => {
intermediary: 0,
...data
}
if(!postData['orderby'])postData['orderby']='timestamp'
api.getLists(postData).then(res => {
if (res.code === 200) {
dataList.data = res.data.data

View File

@ -18,7 +18,7 @@
</div>
</div>
</div>
<loadMoreText :loadText="loadingText"></loadMoreText>
<loadMoreText :loadText="loadingText" v-show="dataList.data && dataList.data.length>0"></loadMoreText>
<listBtmPrompt></listBtmPrompt>
<footerTool></footerTool>
</div>