From ecec637f0505f6a6232fd1cae9f99d3c94dfc5b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E6=A2=93=E5=BD=AD?= Date: Mon, 27 Apr 2026 11:23:40 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=9B=E4=BA=8B=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../match/manage/Steps/Step1BasicInfo.vue | 39 +++- .../user/registration/UserStep4FeeConfig.vue | 192 ++++++++++++++++++ src/views/user/registration/index.vue | 48 +++-- 3 files changed, 256 insertions(+), 23 deletions(-) create mode 100644 src/views/user/registration/UserStep4FeeConfig.vue diff --git a/src/views/match/manage/Steps/Step1BasicInfo.vue b/src/views/match/manage/Steps/Step1BasicInfo.vue index 7ccbe6f..27e24ca 100644 --- a/src/views/match/manage/Steps/Step1BasicInfo.vue +++ b/src/views/match/manage/Steps/Step1BasicInfo.vue @@ -44,24 +44,33 @@ - + + + {{ localFormData.eventType === 0 ? '线上' : localFormData.eventType === 1 ? '线下' : '-' }} + - + 个人报名 团队报名 个人/团队报名 + + {{ localFormData.registrationType === 0 ? '个人报名' : localFormData.registrationType === 1 ? '团队报名' : localFormData.registrationType === 2 ? '个人/团队报名' : '-' }} + - + + + {{ localFormData.pointsRuleName || '-' }} + @@ -89,19 +98,22 @@ -
+
+ @change="handleProvinceChange" clearable> + @change="handleCityChange" clearable> - +
+
+ {{ [localFormData.provinceName, localFormData.cityName, localFormData.districtName].filter(x => x).join(' / ') || '-' }} +
@@ -138,8 +150,12 @@ const localFormData = ref({ coverImage: '', eventVideo: '', eventType: undefined, // 0/1 - registrationType: '', // OnlyIndividual/OnlyTeam/Both + registrationType: undefined, // 0/1/2 pointsRuleId: undefined, + pointsRuleName: '', + provinceName: '', + cityName: '', + districtName: '', registrationTime: [], isNeedMaterial: false, materialRemark: '', @@ -162,10 +178,15 @@ watch( if(k === 'regionIds' && Array.isArray(v[k])) { // 确保 regionIds 是长度为 3 的数组 for(let i = 0; i < 3; i++) { - if (v[k][i] !== undefined) localFormData.value.regionIds[i] = v[k][i].toString(); + if (v[k][i] !== undefined) localFormData.value.regionIds[i] = v[k][i] !== null ? v[k][i].toString() : undefined; } } }); + // 确保新字段也被赋值 + if (v.pointsRuleName !== undefined) localFormData.value.pointsRuleName = v.pointsRuleName; + if (v.provinceName !== undefined) localFormData.value.provinceName = v.provinceName; + if (v.cityName !== undefined) localFormData.value.cityName = v.cityName; + if (v.districtName !== undefined) localFormData.value.districtName = v.districtName; console.log('after init', localFormData.value); // 如果有省份数据,重新加载对应的城市和区县数据 diff --git a/src/views/user/registration/UserStep4FeeConfig.vue b/src/views/user/registration/UserStep4FeeConfig.vue new file mode 100644 index 0000000..876c2ba --- /dev/null +++ b/src/views/user/registration/UserStep4FeeConfig.vue @@ -0,0 +1,192 @@ + + + + + diff --git a/src/views/user/registration/index.vue b/src/views/user/registration/index.vue index e0830ef..d229b1a 100644 --- a/src/views/user/registration/index.vue +++ b/src/views/user/registration/index.vue @@ -65,7 +65,7 @@
- +
@@ -467,7 +467,7 @@ import QRCode from 'qrcodejs2-fixes'; import Step1BasicInfo from '/@/views/match/manage/Steps/Step1BasicInfo.vue'; import Step2Units from '/@/views/match/manage/Steps/Step2Units.vue'; import Step3ProjectConfig from '/@/views/match/manage/Steps/Step3ProjectConfig.vue'; -import Step4FeeConfig from '/@/views/match/manage/Steps/Step4FeeConfig.vue'; +import UserStep4FeeConfig from './UserStep4FeeConfig.vue'; import PreviewImage from '/@/components/PreviewImage/index.vue'; const tableRef = ref(); @@ -638,9 +638,13 @@ const formData = ref({ eventName: '', coverImage: '', eventVideo: '', - eventType: '', - registrationType: '', + eventType: undefined, + registrationType: undefined, pointsRuleId: undefined, + pointsRuleName: '', + provinceName: '', + cityName: '', + districtName: '', registrationTime: [], isNeedMaterial: false, materialRemark: '', @@ -665,13 +669,14 @@ const formData = ref({ }, // 步骤4:费用与账户配置 feeConfig: { - chargeMode: 'Free', + chargeMode: 0, price: 0, merchantId: undefined, merchantName: '', creditCode: '', bankName: '', accountNumber: '', + projects: [], }, }); @@ -684,9 +689,13 @@ const clearDetailState = () => { eventName: '', coverImage: '', eventVideo: '', - eventType: '', - registrationType: '', + eventType: undefined, + registrationType: undefined, pointsRuleId: undefined, + pointsRuleName: '', + provinceName: '', + cityName: '', + districtName: '', registrationTime: [], isNeedMaterial: false, materialRemark: '', @@ -703,13 +712,14 @@ const clearDetailState = () => { registrationLimit: { individualProjectLimit: 1, teamProjectLimit: 1 }, }, feeConfig: { - chargeMode: 'Free', + chargeMode: 0, price: 0, merchantId: undefined, merchantName: '', creditCode: '', bankName: '', accountNumber: '', + projects: [], }, }; }; @@ -735,25 +745,35 @@ const openDetailDialog = async (row) => { eventName: data.name || data.eventName || '', coverImage: data.coverImage || '', eventVideo: data.eventVideo || '', - eventType: data.type || data.eventType || '', - registrationType: data.registrationType || data.registrationMode || '', + eventType: data.type, + registrationType: data.registrationType, pointsRuleId: data.pointsRuleId, + pointsRuleName: data.pointsRuleName || '', + provinceName: data.provinceName || '', + cityName: data.cityName || '', + districtName: data.districtName || '', registrationTime: [data.registrationStartTime, data.registrationEndTime], isNeedMaterial: !!data.isNeedMaterial, materialRemark: data.materialRemark || '', materialUploadTime: [data.materialUploadStartTime, data.materialUploadEndTime], matchTime: [data.matchStartTime, data.matchEndTime], regionIds: [data.provinceId, data.cityId, data.districtId].filter((x) => x !== undefined && x !== null), - detailAddress: data.detailAddress || '', - eventIntroduction: data.eventIntroduction || '', + detailAddress: data.address || data.detailAddress || '', + eventIntroduction: data.description || data.eventIntroduction || '', customConfigJson: data.customConfigJson || '', }; formData.value.units = { units: data.units || [] }; formData.value.projectConfig = { projects: data.projects || [], - registrationLimit: data.registrationLimit || { individualProjectLimit: 1, teamProjectLimit: 1 }, + registrationLimit: data.limitConfig || data.registrationLimit || { individualProjectLimit: 1, teamProjectLimit: 1 }, + }; + // 处理 feeConfig 数据,确保包含项目信息 + formData.value.feeConfig = { + ...formData.value.feeConfig, + ...(data.feeConfig || {}), + chargeMode: data.feeConfig?.chargeMode, + projects: data.projects || [] }; - formData.value.feeConfig = { ...formData.value.feeConfig, ...(data.feeConfig || {}) }; } } catch { ElMessage.error('赛事详情加载失败');