修改湖畔社区页面显示数据的逻辑

This commit is contained in:
赵毅 2025-10-17 09:18:49 +08:00
parent 71332e070a
commit e4a21804b0

View File

@ -124,9 +124,9 @@ export default {
return item;
});
// 1km
// 1km0
processedList = processedList.filter(item =>
item.distanceValue && item.distanceValue <= 1
item.distanceValue !== undefined && item.distanceValue !== null && item.distanceValue <= 1
);
// API1km
@ -179,10 +179,10 @@ export default {
mergedList = uniqueByField(mergedList, 'community_id');
}
//
// 0
mergedList.sort((a, b) => {
const distanceA = a.distanceValue || Infinity;
const distanceB = b.distanceValue || Infinity;
const distanceA = a.distanceValue !== undefined && a.distanceValue !== null ? a.distanceValue : Infinity;
const distanceB = b.distanceValue !== undefined && b.distanceValue !== null ? b.distanceValue : Infinity;
return distanceA - distanceB;
});