diff --git a/src/pages/select-event/select-event.vue b/src/pages/select-event/select-event.vue index 9a30f5d..5c9791d 100644 --- a/src/pages/select-event/select-event.vue +++ b/src/pages/select-event/select-event.vue @@ -39,19 +39,32 @@ export default { onLoad(options) { if (options.eventId) { this.eventId = options.eventId; - this.loadProjectList(options.eventId) } if (options.type) { this.type = options.type; } + // Load project list after type is set + if (this.eventId) { + this.loadProjectList(this.eventId) + } }, methods: { /** - * 加载报名项目列表 + * Load project list filtered by participation type + * @param {String} eventId Competition ID */ async loadProjectList(eventId) { try { - const res = await competitionAPI.getProjectList({ competitionId: eventId }) + const params = { competitionId: eventId } + + // Filter by participation type: single=1, team=2 + if (this.type === 'single') { + params.type = 1 + } else if (this.type === 'team') { + params.type = 2 + } + + const res = await competitionAPI.getProjectList(params) let list = [] if (res.records) { @@ -60,7 +73,6 @@ export default { list = res } - // 数据映射 this.projectList = list.map(item => ({ id: item.id, name: item.name || item.projectName,