This commit is contained in:
2025-12-14 17:39:19 +08:00
parent 0f3cfee622
commit 78291bb76b
12 changed files with 181 additions and 44 deletions

View File

@@ -171,6 +171,7 @@
import competitionAPI from '@/api/competition.js'
import athleteAPI from '@/api/athlete.js'
import registrationAPI from '@/api/registration.js'
import { getUserInfo } from '@/utils/auth.js'
export default {
data() {
@@ -286,9 +287,21 @@ export default {
*/
async loadPlayerList() {
try {
// 获取当前用户信息
const userInfo = getUserInfo()
if (!userInfo || !userInfo.userId) {
uni.showToast({
title: '请先登录',
icon: 'none'
})
return
}
// 只查询当前用户创建的选手
const res = await athleteAPI.getAthleteList({
current: 1,
size: 100
size: 100,
createUser: userInfo.userId
})
let list = []
@@ -363,8 +376,10 @@ export default {
}
},
goToAddPlayer() {
// 传递赛事ID和项目ID到新增选手页面
const projectIds = this.selectedProjects.map(p => p.id).join(',')
uni.navigateTo({
url: '/pages/add-player/add-player'
url: `/pages/add-player/add-player?competitionId=${this.eventId}&projectIds=${projectIds}`
});
},
handleEdit(item) {