diff --git a/src/components/image-editor/model3d-generation/Model3dGenerationFormModel.ts b/src/components/image-editor/model3d-generation/Model3dGenerationFormModel.ts index 0c274eaec..df6daaf44 100644 --- a/src/components/image-editor/model3d-generation/Model3dGenerationFormModel.ts +++ b/src/components/image-editor/model3d-generation/Model3dGenerationFormModel.ts @@ -46,6 +46,13 @@ export function isModel3dGenerationMode( export const MODEL3D_GENERATION_DIALOG_LABEL = '3D 模型生成'; export const MODEL3D_GENERATION_SUBMIT_LABEL = '生成 3D 模型'; export const MODEL3D_PRICING_UNAVAILABLE_REASON = '3D 模型定价尚未配置'; +/** 当前模型版本在这个端点没有底价:与「整段没配」分开说,用户才知道该改哪里。 */ +export const MODEL3D_PRICING_MISSING_BASE_PRICE_REASON = + '3D 模型定价缺少该档位底价'; +/** 某个加价项缺价:报价必须整项算得出来才算数,缺一项就不可提交。 */ +export function resolveModel3dPricingMissingAddOnReason(addOn: string) { + return `3D 模型定价缺少 ${addOn} 价格`; +} /** 面板本身不是 3D 生成模式:与「定价缺失」是两回事,不能共用一句话。 */ export const MODEL3D_MODE_UNSUPPORTED_REASON = '当前面板不是 3D 模型模式'; @@ -302,13 +309,16 @@ export function resolveModel3dPrice({ params.texture ? basePriceRow?.texture : basePriceRow?.noTexture, ); if (basePrice === null) { - return { ok: false, reason: '3D 模型定价缺少该档位底价' }; + return { ok: false, reason: MODEL3D_PRICING_MISSING_BASE_PRICE_REASON }; } let price = basePrice; for (const key of resolveModel3dAddOnKeys(params)) { const addOnPrice = readPrice(pricing.addOnPrices?.[key]); if (addOnPrice === null) { - return { ok: false, reason: `3D 模型定价缺少 ${key} 价格` }; + return { + ok: false, + reason: resolveModel3dPricingMissingAddOnReason(key), + }; } price += addOnPrice; }