diff --git a/packages/community/choseCommunity/index.vue b/packages/community/choseCommunity/index.vue index 78f88d6c..c87a4fb9 100644 --- a/packages/community/choseCommunity/index.vue +++ b/packages/community/choseCommunity/index.vue @@ -267,8 +267,16 @@ export default { : item.label : "", }).then((res) => { - this.filteredFloorsList = - this.step == 4 ? this.filteredFloorsList : res.rows; + // 对楼层数据进行从大到小排序 + if(this.step != 4) { + res.rows.sort((a, b) => { + // 提取楼层数字 + const floorA = parseInt(a.label.replace(/[^\d]/g, '')); + const floorB = parseInt(b.label.replace(/[^\d]/g, '')); + return floorA - floorB; + }); + } + this.filteredFloorsList = this.step == 4 ? this.filteredFloorsList : res.rows; this.searchList = res.rows; this.searchQuery = ""; if (this.step == "1") {