视频复刻积分规则优化

This commit is contained in:
Azmat@qq.com
2026-09-04 17:51:16 +08:00
parent 15718a60bf
commit ee3ddb49b4
8 changed files with 132 additions and 21 deletions
+12 -3
View File
@@ -29,7 +29,8 @@ import type { NavigateFn } from "./route-config";
export const REMIX_PROMPT_KEY = "fc-remix-prompt";
const REMIX_DRAFT_KEY = "vr-digest-draft";
const JOB_KEY = "airshelf:video-remix-job";
const VIDEO_DIGEST_POINTS = 30;
/** 未挂牌时的回落价(与后端 VIDEO_DIGEST_POINTS 一致)。 */
const VIDEO_DIGEST_POINTS_FALLBACK = 30;
type ProgressStage = "upload" | "analyze" | "prompt";
@@ -190,9 +191,17 @@ export function VideoRemixPage({ textModels = [], onNotify, onBack, navigate }:
useEffect(() => {
void api.billingConfig().then((cfg) => setPriceMultiplier(Number(cfg.team_price_multiplier) || 1)).catch(() => undefined);
}, []);
// 与后端一致:只认挂牌 points_per_call,不吃 unit_price;未挂牌回落 30
const hangpaiCall = (() => {
const raw = (activeModel?.metadata?.points_pricing as { points_per_call?: unknown } | undefined)?.points_per_call;
if (raw == null) return null;
const n = Number(raw);
return Number.isFinite(n) && n > 0 ? n : null;
})();
const listedPoints = hangpaiCall ?? VIDEO_DIGEST_POINTS_FALLBACK;
const estimatedPoints = priceMultiplier === 1
? VIDEO_DIGEST_POINTS
: Math.max(1, Math.round(Number((VIDEO_DIGEST_POINTS * priceMultiplier).toFixed(6))));
? listedPoints
: Math.max(1, Math.round(Number((listedPoints * priceMultiplier).toFixed(6))));
const loadHistory = async () => {
try {