修改公寓列表筛选算法
This commit is contained in:
@@ -65,7 +65,6 @@ onMounted(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (route.query['companyid']) pitchValue['companyid'] = route.query['companyid']
|
if (route.query['companyid']) pitchValue['companyid'] = route.query['companyid']
|
||||||
|
|
||||||
getData()
|
getData()
|
||||||
|
|
||||||
window.addEventListener('scroll', handleScroll);
|
window.addEventListener('scroll', handleScroll);
|
||||||
@@ -119,23 +118,25 @@ const handleScroll = () => {
|
|||||||
if (scrollTop + clientHeight >= scrollHeight - 350) getData()
|
if (scrollTop + clientHeight >= scrollHeight - 350) getData()
|
||||||
};
|
};
|
||||||
|
|
||||||
let pitchValue = {}
|
let pitchValue = {
|
||||||
|
companyid: 0,
|
||||||
|
roomtype: 0,
|
||||||
|
rent_min: null, // 租金
|
||||||
|
rent_max: null, // 租金
|
||||||
|
school: 0,
|
||||||
|
roomlistings: 0,
|
||||||
|
keyword: "",
|
||||||
|
}
|
||||||
|
|
||||||
// 筛选组件的参数的中转
|
// 筛选组件的参数的中转
|
||||||
const handleTransfer = (data) => {
|
const handleTransfer = (data) => {
|
||||||
for (const key in data.value) {
|
for (const key in data.value) {
|
||||||
if (data.value[key] != pitchValue[key]) {
|
if (data.value[key] != pitchValue[key]) {
|
||||||
pitchValue = { ...data.value }
|
pitchValue = { ...data.value }
|
||||||
|
page = 1
|
||||||
for (const key in pitchValue) {
|
list.value = []
|
||||||
if (pitchValue[key]) {
|
getData()
|
||||||
page = 1
|
break
|
||||||
list.value = []
|
|
||||||
getData()
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user