diff --git a/frontend/src/features/seller/composables/usePublishForm.ts b/frontend/src/features/seller/composables/usePublishForm.ts index 3cc7f05..982f18b 100644 --- a/frontend/src/features/seller/composables/usePublishForm.ts +++ b/frontend/src/features/seller/composables/usePublishForm.ts @@ -612,6 +612,17 @@ export function usePublishForm(options: UsePublishFormOptions) { } } + // 失焦时实时校正:押金低于(或低于等于无效/为空)智能推荐时自动补到推荐值并提示。 + function handleDepositBlur() { + const recommended = pricing.recommendedDepositAmount.value + if (recommended <= 0) return + const current = Number(form.depositAmountYuan) + if (form.depositAmountYuan === '' || !Number.isFinite(current) || current < recommended) { + form.depositAmountYuan = recommended + options.notifyWarning(`押金不能低于智能推荐 ¥${recommended},已自动调整`) + } + } + function clearForbiddenQuantityItems() { for (const item of pricing.quantityItems.value) { if (!pricing.isQuantityItemDisabled(item)) continue @@ -959,6 +970,7 @@ export function usePublishForm(options: UsePublishFormOptions) { handleAcceleratedSaleRatioInput, syncRecommendedDeposit, useRecommendedDeposit, + handleDepositBlur, clearForbiddenQuantityItems, setQuantityMode, clampAcceleratedSaleRatioInput, diff --git a/frontend/src/features/seller/views/MobileSellerListingCreateView.vue b/frontend/src/features/seller/views/MobileSellerListingCreateView.vue index a6263b7..522fcdc 100644 --- a/frontend/src/features/seller/views/MobileSellerListingCreateView.vue +++ b/frontend/src/features/seller/views/MobileSellerListingCreateView.vue @@ -81,6 +81,7 @@ const { handleFireLevelInput, handleAcceleratedSaleRatioInput, useRecommendedDeposit, + handleDepositBlur, setQuantityMode, clampAcceleratedSaleRatioInput, useReferenceSaleRatio, @@ -177,7 +178,7 @@ const screenshotGuides: Record = { = { type="number" inputmode="decimal" :placeholder="priceConfig.deposit_placeholder" + @blur="handleDepositBlur" /> diff --git a/frontend/src/features/seller/views/SellerListingCreateView.vue b/frontend/src/features/seller/views/SellerListingCreateView.vue index 6521672..d9dc872 100644 --- a/frontend/src/features/seller/views/SellerListingCreateView.vue +++ b/frontend/src/features/seller/views/SellerListingCreateView.vue @@ -90,6 +90,7 @@ const { handleFireLevelInput, handleAcceleratedSaleRatioInput, useRecommendedDeposit, + handleDepositBlur, setQuantityMode, clampAcceleratedSaleRatioInput, useReferenceSaleRatio, @@ -513,6 +514,7 @@ function selectDailyLoss(value: string | number) { :min="0" :controls="false" :placeholder="priceConfig.deposit_placeholder" + @blur="handleDepositBlur" />