diff --git a/src/views/user/record/index.vue b/src/views/user/record/index.vue index 89533d8..df94366 100644 --- a/src/views/user/record/index.vue +++ b/src/views/user/record/index.vue @@ -814,6 +814,21 @@ const getEventStatusText = (status) => { const disableCancel = computed(() => { if (!currentRow.value) return true; + + // 检查是否已超过赛事报名截止时间 + if (currentRow.value.registrationEndTime) { + try { + const endTime = new Date(currentRow.value.registrationEndTime); + const currentTime = new Date(); + if (currentTime > endTime) { + // 已超过报名截止时间,禁用取消报名 + return true; + } + } catch { + // 日期解析失败,继续检查其他条件 + } + } + const payStatus = normalizeToNumber(currentRow.value.payStatus); const paymentMethod = normalizeToNumber(currentRow.value.paymentMethod); // 如果是线下支付(1),仅当支付状态为未支付(0)或已支付(1)时允许取消 @@ -827,6 +842,21 @@ const disableCancel = computed(() => { const isCancelDisabledByRow = (row) => { if (!row) return true; + + // 检查是否已超过赛事报名截止时间 + if (row.registrationEndTime) { + try { + const endTime = new Date(row.registrationEndTime); + const currentTime = new Date(); + if (currentTime > endTime) { + // 已超过报名截止时间,禁用取消报名 + return true; + } + } catch { + // 日期解析失败,继续检查其他条件 + } + } + const payStatus = normalizeToNumber(row.payStatus); const paymentMethod = normalizeToNumber(row.paymentMethod); // 如果是线下支付(1),仅当支付状态为未支付(0)或已支付(1)时允许取消 @@ -1565,6 +1595,7 @@ watch(cancelAll, async (newVal) => { const openCancelDialog = async (row) => { if (!row?.registrationId) return; + isShowCancelDialog.value = true; isCancelConfirmed.value = false; cancelLoading.value = true; @@ -1590,6 +1621,17 @@ const openCancelDialog = async (row) => { // 根据后端返回的数据设置是否为免费项目 isFreeProject.value = data?.chargeMode === 0 || data?.actualPaidAmount <= 0; + // 检查支付方式和审核状态:如果是银行卡转账且未审批通过,则显示提示 + const paymentMethod = normalizeToNumber(data.paymentMethod || row.paymentMethod); + const auditStatus = normalizeToNumber(data.auditStatus || row.auditStatus); // 审核状态字段 + + // 银行卡转账为 3,已审核通过为 2,未审核/审核中为 0/1 + if (paymentMethod === 3 && auditStatus !== 2) { + ElMessage.warning('该订单目前处于审核处理阶段,暂时无法进行退款操作,请等待审核完成后方可申请退款'); + isShowCancelDialog.value = false; + return; + } + // 初始化退款计算结果 - 先使用preview数据 refundCalculationResult.value = { // 初始状态下没有选择取消项,所以本次退款金额为0 diff --git a/src/views/user/registration/index.vue b/src/views/user/registration/index.vue index d229b1a..5b95957 100644 --- a/src/views/user/registration/index.vue +++ b/src/views/user/registration/index.vue @@ -313,7 +313,7 @@