fix(event-players): 修复选手列表API响应处理

This commit is contained in:
DevOps
2025-12-31 15:20:59 +08:00
parent c249c9e213
commit 4eddc5a194

View File

@@ -134,22 +134,23 @@ export default {
const res = await athleteAPI.getAthleteList(params)
if (res.code === 200 && res.data) {
const records = res.data.records || []
console.log('=== 选手列表响应 ===', res)
// 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.playersList = Array.isArray(records) ? records : []
this.page = 1
}
this.totalCount = res.data.total || 0
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({