fix(event-players): 修复选手列表API响应处理
This commit is contained in:
@@ -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)
|
||||
|
||||
if (isLoadMore) {
|
||||
this.playersList = [...this.playersList, ...records]
|
||||
} else {
|
||||
this.playersList = records
|
||||
this.page = 1
|
||||
}
|
||||
// request.js already extracts data.data, so res is the actual data
|
||||
const records = res.records || res || []
|
||||
|
||||
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({
|
||||
|
||||
Reference in New Issue
Block a user