From 7b53821cece592e258faa4b8938c32121689c1ee Mon Sep 17 00:00:00 2001 From: Peanut Date: Tue, 21 Jul 2026 20:25:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=BE=84=E6=B8=85=E5=8D=A1=E7=89=87=20a?= =?UTF-8?q?llow=5Fcustom=20=E6=97=B6=E5=85=81=E8=AE=B8=E7=BA=AF=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E8=BE=93=E5=85=A5=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - canSubmit 逻辑重构:纯文本卡片只需 customText 非空 - 有选项卡片:满足最小选择数,或(allow_custom 且 customText 非空)即可提交 - 修复其他,请简单描述输入自定义内容后提交按钮灰显的问题 Co-Authored-By: Claude Opus 4.8 (1M context) --- mini-program/src/components/ClarificationCard.vue | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mini-program/src/components/ClarificationCard.vue b/mini-program/src/components/ClarificationCard.vue index f29265f..2858e4c 100644 --- a/mini-program/src/components/ClarificationCard.vue +++ b/mini-program/src/components/ClarificationCard.vue @@ -63,10 +63,14 @@ const isSingle = computed(() => props.card.card_type === 'single_select') const isMulti = computed(() => props.card.card_type === 'multi_select' || props.card.card_type === 'mixed') const canSubmit = computed(() => { + // 纯文本输入卡片:只需 customText 非空 + if (isTextInput.value) return customText.value.trim().length > 0 + + // 有选项的卡片:满足最小选择数,或(允许自定义且 customText 非空) const minSel = props.card.min_selections || 1 - if (selectedValues.value.length < minSel) return false - if (isTextInput.value && !customText.value.trim()) return false - return true + if (selectedValues.value.length >= minSel) return true + if (props.card.allow_custom && customText.value.trim()) return true + return false }) function isSelected(value) {