From 4eddc5a194654a2b4dc6ebdf473f08ddcbc5c593 Mon Sep 17 00:00:00 2001 From: DevOps Date: Wed, 31 Dec 2025 15:20:59 +0800 Subject: [PATCH] =?UTF-8?q?fix(event-players):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E9=80=89=E6=89=8B=E5=88=97=E8=A1=A8API=E5=93=8D=E5=BA=94?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/event-players/event-players.vue | 29 ++++++++++++----------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/pages/event-players/event-players.vue b/src/pages/event-players/event-players.vue index 11362d9..e259292 100644 --- a/src/pages/event-players/event-players.vue +++ b/src/pages/event-players/event-players.vue @@ -133,23 +133,24 @@ export default { } const res = await athleteAPI.getAthleteList(params) + + console.log('=== 选手列表响应 ===', res) - if (res.code === 200 && res.data) { - const records = res.data.records || [] + // request.js already extracts data.data, so res is the actual data + const records = res.records || res || [] - if (isLoadMore) { - this.playersList = [...this.playersList, ...records] - } else { - this.playersList = records - this.page = 1 - } - - this.totalCount = res.data.total || 0 - this.hasMore = this.playersList.length < this.totalCount - - // 统计已确认人数 - this.confirmedCount = this.playersList.filter(p => p.registrationStatus === 1).length + if (isLoadMore) { + this.playersList = [...this.playersList, ...records] + } else { + this.playersList = Array.isArray(records) ? records : [] + this.page = 1 } + + this.totalCount = res.total || this.playersList.length + this.hasMore = this.playersList.length < this.totalCount + + // 统计已确认人数 + this.confirmedCount = this.playersList.filter(p => p.registrationStatus === 1).length } catch (error) { console.error('加载选手列表失败:', error) uni.showToast({