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

@@ -60,6 +60,7 @@
import CustomTabs from '../../components/custom-tabs/custom-tabs.vue';
import ConfirmModal from '../../components/confirm-modal/confirm-modal.vue';
import athleteAPI from '@/api/athlete.js';
import { getUserInfo } from '@/utils/auth.js';
export default {
components: {
@@ -89,9 +90,21 @@ export default {
*/
async loadPlayerList() {
try {
// 获取当前用户信息
const userInfo = getUserInfo()
if (!userInfo || !userInfo.userId) {
console.error('未获取到用户信息')
uni.showToast({
title: '请先登录',
icon: 'none'
})
return
}
const res = await athleteAPI.getAthleteList({
current: 1,
size: 100
size: 100,
createUser: userInfo.userId // 只查询当前用户创建的选手
})
let list = []
@@ -104,11 +117,11 @@ export default {
// 数据映射
this.playerList = list.map(item => ({
id: item.id,
name: item.name,
name: item.name || item.playerName,
idCard: item.idCard || item.idCardNumber,
gender: item.gender,
team: item.team,
phone: item.phone
team: item.team || item.teamName,
phone: item.phone || item.contactPhone
}))
} catch (err) {
console.error('加载选手列表失败:', err)