From adbafedb5be7c68148b23f5b6334acc94f3b2f60 Mon Sep 17 00:00:00 2001 From: DevOps Date: Wed, 31 Dec 2025 13:30:39 +0800 Subject: [PATCH] =?UTF-8?q?fix(register):=20=E7=A1=AE=E4=BF=9D=E9=9B=86?= =?UTF-8?q?=E4=BD=93=E9=A1=B9=E7=9B=AE=E6=8A=A5=E5=90=8D=E6=97=B6=E4=BC=A0?= =?UTF-8?q?=E9=80=92type=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在项目列表中保存type字段 - 跳转报名页面时传递完整的项目信息(包含type) - 确保集体项目报名时显示集体选择而非选手选择 --- src/pages/select-event/select-event.vue | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/pages/select-event/select-event.vue b/src/pages/select-event/select-event.vue index 5c9791d..09da1c3 100644 --- a/src/pages/select-event/select-event.vue +++ b/src/pages/select-event/select-event.vue @@ -43,16 +43,11 @@ export default { 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 params = { competitionId: eventId } @@ -77,6 +72,7 @@ export default { id: item.id, name: item.name || item.projectName, price: item.price || item.registrationFee || 0, + type: item.type || (this.type === 'team' ? 2 : 1), selected: false })) } catch (err) { @@ -92,6 +88,7 @@ export default { item.selected = !item.selected; this.$forceUpdate(); }, + handleRegister() { const selectedProjects = this.projectList.filter(item => item.selected); if (selectedProjects.length === 0) { @@ -102,8 +99,16 @@ export default { return; } + // Include type in selected projects data + const projectsData = selectedProjects.map(p => ({ + id: p.id, + name: p.name, + price: p.price, + type: p.type + })) + uni.navigateTo({ - url: `/pages/event-register/event-register?eventId=${this.eventId}&projects=${encodeURIComponent(JSON.stringify(selectedProjects))}` + url: `/pages/event-register/event-register?eventId=${this.eventId}&projects=${encodeURIComponent(JSON.stringify(projectsData))}` }); } }