行业提词优化,积分不足判断
This commit is contained in:
+613
File diff suppressed because one or more lines are too long
-613
File diff suppressed because one or more lines are too long
-613
File diff suppressed because one or more lines are too long
Vendored
+1
-3
@@ -1,4 +1,3 @@
|
||||
|
||||
<!doctype html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
@@ -29,11 +28,10 @@
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
<script type="module" crossorigin src="/assets/index-BhfopyFy.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-5mDsoYNB.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-Bsz_Xon-.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -43,11 +43,17 @@ interface ProgressItemProps {
|
||||
isPending: boolean;
|
||||
isCompleted: boolean;
|
||||
onAnimationComplete?: () => void;
|
||||
index?: number;
|
||||
}
|
||||
|
||||
const PROGRESS_RATE = 0.6;
|
||||
|
||||
const calculateProgressValue = (createdAt?: string): number => {
|
||||
const seededRandom = (seed: number): number => {
|
||||
const x = Math.sin(seed * 9999) * 10000;
|
||||
return x - Math.floor(x);
|
||||
};
|
||||
|
||||
const calculateProgressValue = (createdAt?: string, index: number = 0): number => {
|
||||
if (!createdAt) return 0;
|
||||
const createdTime = new Date(createdAt).getTime();
|
||||
if (isNaN(createdTime)) return 0;
|
||||
@@ -56,18 +62,24 @@ const calculateProgressValue = (createdAt?: string): number => {
|
||||
if (elapsedSeconds >= MAX_DURATION_SECONDS) {
|
||||
return 99;
|
||||
}
|
||||
return Math.min(99, elapsedSeconds * PROGRESS_RATE);
|
||||
let progress = Math.min(99, elapsedSeconds * PROGRESS_RATE);
|
||||
const baseOffset = index * 3;
|
||||
const randomOffset = seededRandom(index + 1) * 8;
|
||||
const offset = baseOffset + randomOffset;
|
||||
progress = Math.max(0, progress - offset);
|
||||
return progress;
|
||||
};
|
||||
|
||||
const ProgressItem: React.FC<ProgressItemProps> = ({ item, isPending: isPendingProp, isCompleted, onAnimationComplete }) => {
|
||||
const ProgressItem: React.FC<ProgressItemProps> = ({ item, isPending: isPendingProp, isCompleted, onAnimationComplete, index = 0 }) => {
|
||||
const [displayProgress, setDisplayProgress] = useState<number>(0);
|
||||
const [isFinishing, setIsFinishing] = useState(false);
|
||||
const intervalRef = useRef<number | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
const newProgress = calculateProgressValue(item.createdAt);
|
||||
if (isFinishing) return;
|
||||
const newProgress = calculateProgressValue(item.createdAt, index);
|
||||
setDisplayProgress(newProgress);
|
||||
}, [item]);
|
||||
}, [item, index, isFinishing]);
|
||||
|
||||
useEffect(() => {
|
||||
if (isCompleted && !isFinishing) {
|
||||
@@ -84,7 +96,8 @@ const ProgressItem: React.FC<ProgressItemProps> = ({ item, isPending: isPendingP
|
||||
}
|
||||
|
||||
const updateProgress = () => {
|
||||
const newProgress = calculateProgressValue(item.createdAt);
|
||||
if (isFinishing) return;
|
||||
const newProgress = calculateProgressValue(item.createdAt, index);
|
||||
setDisplayProgress(newProgress);
|
||||
};
|
||||
|
||||
@@ -96,7 +109,7 @@ const ProgressItem: React.FC<ProgressItemProps> = ({ item, isPending: isPendingP
|
||||
intervalRef.current = null;
|
||||
}
|
||||
};
|
||||
}, [item.createdAt, isPendingProp, isCompleted, isFinishing, item.id]);
|
||||
}, [item.createdAt, isPendingProp, isCompleted, isFinishing, item.id, index]);
|
||||
|
||||
useEffect(() => {
|
||||
if (isFinishing) {
|
||||
@@ -305,7 +318,7 @@ const GenerationTaskResourceGrid: React.FC<Props> = ({ task, onPreview, resolveU
|
||||
{pending || isFinishing ? <span className="gen-task-aurora-3" /> : null}
|
||||
{pending || isFinishing ? <LoadingOutlined spin style={{ color: '#8b5cf6', fontSize: items.length > 2 ? 20 : 34 }} /> : <WarningOutlined style={{ color: displayStatus === 'deleted' ? '#98A2B3' : '#A45B5B', fontSize: items.length > 2 ? 20 : 34 }} />}
|
||||
<span style={{ fontSize: items.length > 2 ? 10 : 12, color: pending || isFinishing ? '#8b5cf6' : (displayStatus === 'deleted' ? '#98A2B3' : '#A45B5B'), fontWeight: 500 }}>{statusLabel}</span>
|
||||
<ProgressItem item={item} isPending={pending || isFinishing} isCompleted={completed} onAnimationComplete={() => handleFinishAnimation(itemId)} />
|
||||
<ProgressItem item={item} isPending={pending || isFinishing} isCompleted={completed} onAnimationComplete={() => handleFinishAnimation(itemId)} index={item.generationIndex || index} />
|
||||
{!pending && item.errorMessage && items.length <= 2 ? <span style={{ fontSize: 10, color: '#A45B5B', lineHeight: 1.3, maxHeight: 28, overflow: 'hidden' }}>{item.errorMessage}</span> : null}
|
||||
</div>
|
||||
)}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -32,7 +32,7 @@ function buildAssetUrl(url?: string): string {
|
||||
function RemoveInfo() {
|
||||
const { creatID } = useParams<{ creatID: string }>();
|
||||
const navigate = useNavigate();
|
||||
const { user } = useAuthStore();
|
||||
const { user, optimizeHoldCredits } = useAuthStore();
|
||||
const [drawerVisible, setDrawerVisible] = useState(false);
|
||||
const [trimModalVisible, setTrimModalVisible] = useState(false);
|
||||
const [currentSegment, setCurrentSegment] = useState<string | null>(null);
|
||||
@@ -316,19 +316,19 @@ function RemoveInfo() {
|
||||
|
||||
const params = {
|
||||
|
||||
target_project_name: productName.trim(),
|
||||
core_content_point: productSellingPoint.trim(),
|
||||
project_description: productSellingPoint.trim() || undefined,
|
||||
material_image_url: productImage || undefined,
|
||||
material_image_resource_id: productImageResourceId || undefined,
|
||||
video_config: {
|
||||
engine_id: engineId,
|
||||
duration: videoDuration,
|
||||
aspect_ratio: videoAspectRatio,
|
||||
resolution: videoResolution,
|
||||
},
|
||||
idempotency_key: idempotencyKey,
|
||||
};
|
||||
target_project_name: productName.trim(),
|
||||
core_content_point: productSellingPoint.trim(),
|
||||
project_description: productSellingPoint.trim() || undefined,
|
||||
material_image_url: productImage || undefined,
|
||||
material_image_resource_id: productImageResourceId || undefined,
|
||||
video_config: {
|
||||
engine_id: engineId,
|
||||
duration: videoDuration,
|
||||
aspect_ratio: videoAspectRatio,
|
||||
resolution: videoResolution,
|
||||
},
|
||||
idempotency_key: idempotencyKey,
|
||||
};
|
||||
|
||||
|
||||
setLoading(true);
|
||||
@@ -640,7 +640,7 @@ function RemoveInfo() {
|
||||
fixed: 'right',
|
||||
align: 'center' as const,
|
||||
render: (_: any, record: any) => (
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
|
||||
{record.moduleProjectId ? (
|
||||
<Button
|
||||
type="text"
|
||||
@@ -792,34 +792,34 @@ function RemoveInfo() {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{taskDetail.analysisStatus === 'failed' && (
|
||||
<div style={{ marginTop: 12, textAlign: 'center' }}>
|
||||
<Button
|
||||
onClick={handleReanalyze}
|
||||
style={{
|
||||
width: "100%",
|
||||
padding: '6px 16px',
|
||||
borderRadius: 8,
|
||||
fontSize: 12,
|
||||
border: '1px solid #ef4444',
|
||||
color: '#ef4444',
|
||||
background: 'rgba(239, 68, 68, 0.05)',
|
||||
cursor: taskDetail.analysisStatus === 'processing' ? 'not-allowed' : 'pointer',
|
||||
transition: 'all 0.2s',
|
||||
}}
|
||||
onMouseEnter={(e) => {
|
||||
if (taskDetail.analysisStatus !== 'processing') {
|
||||
e.currentTarget.style.background = 'rgba(239, 68, 68, 0.1)';
|
||||
}
|
||||
}}
|
||||
onMouseLeave={(e) => {
|
||||
e.currentTarget.style.background = 'rgba(239, 68, 68, 0.05)';
|
||||
}}
|
||||
>
|
||||
{taskDetail.analysisStatus === 'processing' ? '分析中...' : '重新分析'}
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
{taskDetail.analysisStatus === 'failed' && (
|
||||
<div style={{ marginTop: 12, textAlign: 'center' }}>
|
||||
<Button
|
||||
onClick={handleReanalyze}
|
||||
style={{
|
||||
width: "100%",
|
||||
padding: '6px 16px',
|
||||
borderRadius: 8,
|
||||
fontSize: 12,
|
||||
border: '1px solid #ef4444',
|
||||
color: '#ef4444',
|
||||
background: 'rgba(239, 68, 68, 0.05)',
|
||||
cursor: taskDetail.analysisStatus === 'processing' ? 'not-allowed' : 'pointer',
|
||||
transition: 'all 0.2s',
|
||||
}}
|
||||
onMouseEnter={(e) => {
|
||||
if (taskDetail.analysisStatus !== 'processing') {
|
||||
e.currentTarget.style.background = 'rgba(239, 68, 68, 0.1)';
|
||||
}
|
||||
}}
|
||||
onMouseLeave={(e) => {
|
||||
e.currentTarget.style.background = 'rgba(239, 68, 68, 0.05)';
|
||||
}}
|
||||
>
|
||||
{taskDetail.analysisStatus === 'processing' ? '分析中...' : '重新分析'}
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
</div>
|
||||
|
||||
@@ -1521,34 +1521,50 @@ function RemoveInfo() {
|
||||
</div>
|
||||
|
||||
<div style={{ display: 'flex', gap: 12, marginTop: 8 }}>
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={() => {
|
||||
if ((user?.credits || 0) < estimatedCredits) {
|
||||
message.warning('积分不足,请更换参数/充值积分');
|
||||
return;
|
||||
}
|
||||
handleManualGenerate();
|
||||
}}
|
||||
loading={loading}
|
||||
disabled={loading || !engineId || !selectedEngineSupportsImage || ((user?.credits || 0) < estimatedCredits)}
|
||||
style={{
|
||||
flex: 1,
|
||||
height: 44,
|
||||
borderRadius: 12,
|
||||
fontWeight: 600,
|
||||
fontSize: 15,
|
||||
border: 'none',
|
||||
background: 'linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%)',
|
||||
boxShadow: '0 4px 16px rgba(99, 102, 241, 0.3)',
|
||||
transition: 'all 0.25s cubic-bezier(0.4, 0, 0.2, 1)',
|
||||
}}
|
||||
<Tooltip
|
||||
title={((user?.credits || 0) < (estimatedCredits + optimizeHoldCredits)) ? '积分不足,请更换参数/充值积分' : ''}
|
||||
placement="top"
|
||||
>
|
||||
{loading ? '生成中...' : '手动生成'}
|
||||
<span style={{ color: '#fff', marginLeft: 8, fontSize: 13 }}>
|
||||
预估积分:{estimatedCredits}
|
||||
</span>
|
||||
</Button>
|
||||
<Button
|
||||
type="primary"
|
||||
|
||||
onClick={() => {
|
||||
if ((user?.credits || 0) < (estimatedCredits + optimizeHoldCredits)) {
|
||||
message.warning('积分不足,请更换参数/充值积分');
|
||||
return;
|
||||
}
|
||||
handleManualGenerate();
|
||||
}}
|
||||
loading={loading}
|
||||
// disabled={loading || !engineId || !selectedEngineSupportsImage || ((user?.credits || 0) < (estimatedCredits + optimizeHoldCredits))}
|
||||
style={{
|
||||
flex: 1,
|
||||
height: 44,
|
||||
borderRadius: 12,
|
||||
fontWeight: 600,
|
||||
fontSize: 15,
|
||||
border: 'none',
|
||||
background: 'linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%)',
|
||||
boxShadow: '0 4px 16px rgba(99, 102, 241, 0.3)',
|
||||
transition: 'all 0.25s cubic-bezier(0.4, 0, 0.2, 1)',
|
||||
}}
|
||||
>
|
||||
{loading ? '生成中...' : '手动生成'}
|
||||
|
||||
</Button>
|
||||
</Tooltip>
|
||||
</div>
|
||||
<div style={{ textAlign: 'center' }}>
|
||||
<span style={{ color: '#000000ff', marginLeft: 8, fontSize: 13 }}>
|
||||
视频积分:{estimatedCredits}
|
||||
</span>
|
||||
<span style={{ color: '#000000ff', marginLeft: 8, fontSize: 13 }}>
|
||||
+
|
||||
</span>
|
||||
<span style={{ color: '#000000ff', marginLeft: 8, fontSize: 13 }}>
|
||||
提词暂扣:{optimizeHoldCredits}
|
||||
</span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</Drawer>
|
||||
|
||||
@@ -88,10 +88,10 @@ function InitialInfo() {
|
||||
if (previewVisible && previewType === 'video') {
|
||||
const playVideo = () => {
|
||||
if (videoRef.current) {
|
||||
videoRef.current.play().catch(() => {});
|
||||
videoRef.current.play().catch(() => { });
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
if (videoRef.current) {
|
||||
if (videoRef.current.readyState >= 2) {
|
||||
playVideo();
|
||||
@@ -99,9 +99,9 @@ function InitialInfo() {
|
||||
videoRef.current.addEventListener('loadedmetadata', playVideo);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const timer = setTimeout(playVideo, 300);
|
||||
|
||||
|
||||
return () => {
|
||||
clearTimeout(timer);
|
||||
if (videoRef.current) {
|
||||
@@ -145,7 +145,7 @@ function InitialInfo() {
|
||||
// 当apiSteps更新时,逆向遍历找到第一个已完成或失败的步骤并展开
|
||||
useEffect(() => {
|
||||
const completedFailedKeys = new Set<string>();
|
||||
|
||||
|
||||
activeKey.forEach(key => {
|
||||
const step = steps.find(s => String(s.childId) === key);
|
||||
if (step && (step.status === 'completed' || step.status === 'failed')) {
|
||||
@@ -291,7 +291,7 @@ function InitialInfo() {
|
||||
useEffect(() => {
|
||||
calculateCredits().then((data: any) => {
|
||||
setCreditCalculationData(data);
|
||||
}).catch(() => {});
|
||||
}).catch(() => { });
|
||||
}, []);
|
||||
|
||||
const calculateEstimatedCredits = () => {
|
||||
@@ -317,7 +317,7 @@ function InitialInfo() {
|
||||
}
|
||||
|
||||
let total = (videoDuration * config.perSecondCredits + config.baseCredits) * config.ratio;
|
||||
|
||||
|
||||
const inputVideoDuration = taskDetail?.videoGeneration?.inputMedia?.video?.duration || 0;
|
||||
if (inputVideoDuration > 0) {
|
||||
const inputVideoCost = ((config.inputVideoBaseCredits || 0) + (config.inputVideoPerSecondCredits || 0) * inputVideoDuration) * (config.inputVideoRatio || 1);
|
||||
@@ -367,7 +367,7 @@ function InitialInfo() {
|
||||
}
|
||||
|
||||
let total = (duration * config.perSecondCredits + config.baseCredits) * config.ratio;
|
||||
|
||||
|
||||
const inputVideoDuration = taskDetail?.videoGeneration?.inputMedia?.video?.duration || 0;
|
||||
if (inputVideoDuration > 0) {
|
||||
const inputVideoCost = ((config.inputVideoBaseCredits || 0) + (config.inputVideoPerSecondCredits || 0) * inputVideoDuration) * (config.inputVideoRatio || 1);
|
||||
@@ -564,12 +564,12 @@ function InitialInfo() {
|
||||
}
|
||||
|
||||
removetwo(taskDetail.id, steps[1].id.toString(), params).then((res: any) => {
|
||||
message.info('正在生成图片,请稍候...');
|
||||
|
||||
message.info('正在生成图片,请稍候...');
|
||||
|
||||
refreshTaskDetail();
|
||||
|
||||
}).catch((error: any) => {
|
||||
const errorMsg = error?.message?.split(': ')?.[1] || error?.message || '生成失败';
|
||||
const errorMsg = error?.message?.split(': ')?.[1] || error?.message || '生成失败';
|
||||
message.error(errorMsg);
|
||||
});
|
||||
}
|
||||
@@ -788,7 +788,7 @@ function InitialInfo() {
|
||||
<div className="medio_box" style={{ aspectRatio: '16/9', background: 'linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)', borderRadius: 14, overflow: 'hidden', boxShadow: '0 4px 12px rgba(99, 102, 241, 0.06)', border: '1px solid rgba(99, 102, 241, 0.08)', cursor: taskDetail?.material?.materialVideoUrl ? 'pointer' : 'default' }} onClick={() => taskDetail?.material?.materialVideoUrl && openPreview(taskDetail.material.materialVideoUrl, 'video')}>
|
||||
{taskDetail?.material?.materialVideoUrl ? (
|
||||
<video
|
||||
|
||||
|
||||
src={buildMediaUrl(taskDetail.material.materialVideoUrl)}
|
||||
style={{ width: '100%', height: '100%', objectFit: 'contain' }}
|
||||
/>
|
||||
@@ -837,7 +837,7 @@ function InitialInfo() {
|
||||
</span>
|
||||
<div className="medio_box" style={{ aspectRatio: '16/9', background: 'linear-gradient(135deg, rgba(248,250,252,0.8) 0%, rgba(238,242,255,0.6) 100%)', borderRadius: 14, overflow: 'hidden', boxShadow: '0 4px 12px rgba(99, 102, 241, 0.06)', border: '1px solid rgba(99, 102, 241, 0.08)', cursor: 'pointer' }} onClick={() => openPreview(taskDetail.finalVideoUrl, 'video')}>
|
||||
<video
|
||||
|
||||
|
||||
src={`${import.meta.env.VITE_API_BASE || "http://localhost:8000"}${taskDetail.finalVideoUrl}`}
|
||||
style={{ width: '100%', height: '100%', objectFit: 'contain' }}
|
||||
/>
|
||||
@@ -956,11 +956,7 @@ function InitialInfo() {
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<Button onClick={() => { createone(step.id); }} type="primary" style={{ flex: 1, borderRadius: 10, background: 'linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)', border: 'none', height: 36, fontWeight: 500, boxShadow: '0 4px 12px rgba(99, 102, 241, 0.3)' }} disabled={step.status !== 'completed'}>
|
||||
下一步:生成图片提示词
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div style={{ marginBottom: 8 }}>
|
||||
<span style={{ fontSize: 12, fontWeight: 500, color: '#666666', marginRight: 8 }}>原产品名称:</span>
|
||||
@@ -970,12 +966,37 @@ function InitialInfo() {
|
||||
<span style={{ fontSize: 12, fontWeight: 500, color: '#666666', marginRight: 8 }}>自有产品名称:</span>
|
||||
<span style={{ fontSize: 13, color: '#4b5563' }}>{steps[0]?.input?.payload?.targetProjectName || '-'}</span>
|
||||
</div>
|
||||
<div>
|
||||
<div style={{ marginBottom: 8 }}>
|
||||
<span style={{ fontSize: 12, fontWeight: 500, color: '#666666', marginRight: 8 }}>产品卖点:</span>
|
||||
<span style={{ fontSize: 13, color: '#4b5563' }}>{steps[0]?.input?.payload?.coreContentPoint || '-'}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{!isV2 && (
|
||||
<Tooltip
|
||||
title={((user?.credits || 0) < optimizeHoldCredits) ? `积分不足${optimizeHoldCredits},请充值积分` : ''}
|
||||
placement="top"
|
||||
>
|
||||
<Button
|
||||
onClick={() => {
|
||||
if ((user?.credits || 0) < optimizeHoldCredits) {
|
||||
message.warning(`积分不足${optimizeHoldCredits},请充值积分`);
|
||||
return;
|
||||
}
|
||||
createone(step.id);
|
||||
}}
|
||||
type="primary"
|
||||
style={{ width: '100%', borderRadius: 10, background: 'linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)', border: 'none', height: 36, fontWeight: 500, boxShadow: '0 4px 12px rgba(99, 102, 241, 0.3)' }}
|
||||
disabled={step.status !== 'completed' || ((user?.credits || 0) < optimizeHoldCredits)}
|
||||
>
|
||||
下一步:生成图片提示词
|
||||
</Button>
|
||||
</Tooltip>
|
||||
)}
|
||||
|
||||
|
||||
|
||||
|
||||
</>
|
||||
)}
|
||||
{/* 步骤2: 生成提示词 */}
|
||||
@@ -996,7 +1017,7 @@ function InitialInfo() {
|
||||
>
|
||||
修改提示词
|
||||
</Button>
|
||||
<Button onClick={() => { createimage(step.id); }} type="primary" style={{ flex: 1, borderRadius: 10, background: 'linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)', border: 'none', height: 36, fontWeight: 500, boxShadow: '0 4px 12px rgba(99, 102, 241, 0.3)' }} disabled={step.status !== 'completed'}>
|
||||
<Button onClick={() => { createimage(step.id); }} type="primary" style={{ flex: 1, borderRadius: 10, background: 'linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)', border: 'none', height: 36, fontWeight: 500, boxShadow: '0 4px 12px rgba(99, 102, 241, 0.3)' }} disabled={step.status !== 'completed'}>
|
||||
下一步:生成图片
|
||||
</Button>
|
||||
</Space>
|
||||
@@ -1401,21 +1422,21 @@ function InitialInfo() {
|
||||
>
|
||||
<Button
|
||||
type="primary"
|
||||
style={{
|
||||
width: '100%',
|
||||
borderRadius: 10,
|
||||
background: 'linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)',
|
||||
border: 'none',
|
||||
height: 36,
|
||||
fontWeight: 500,
|
||||
boxShadow: '0 4px 12px rgba(99, 102, 241, 0.3)'
|
||||
style={{
|
||||
width: '100%',
|
||||
borderRadius: 10,
|
||||
background: 'linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)',
|
||||
border: 'none',
|
||||
height: 36,
|
||||
fontWeight: 500,
|
||||
boxShadow: '0 4px 12px rgba(99, 102, 241, 0.3)'
|
||||
}}
|
||||
onClick={() => {
|
||||
onClick={() => {
|
||||
if ((user?.credits || 0) < estimatedCredits) {
|
||||
message.warning('积分不足,请更换参数/充值积分');
|
||||
return;
|
||||
}
|
||||
handleNextStep(step.id);
|
||||
handleNextStep(step.id);
|
||||
}}
|
||||
disabled={step.status !== 'completed' || ((user?.credits || 0) < estimatedCredits)}
|
||||
>
|
||||
@@ -1465,7 +1486,7 @@ function InitialInfo() {
|
||||
})()}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<Space style={{ marginTop: 16, gap: 12, width: '100%', flexWrap: 'wrap' }}>
|
||||
<Button
|
||||
@@ -1499,26 +1520,26 @@ function InitialInfo() {
|
||||
</Button>
|
||||
</Tooltip>
|
||||
)}
|
||||
<Tooltip
|
||||
title={((user?.credits || 0) < calculateCreditsFromVideoConfig()) ? `积分不足${calculateCreditsFromVideoConfig()},请充值积分` : ''}
|
||||
placement="top"
|
||||
<Tooltip
|
||||
title={((user?.credits || 0) < calculateCreditsFromVideoConfig()) ? `积分不足${calculateCreditsFromVideoConfig()},请充值积分` : ''}
|
||||
placement="top"
|
||||
>
|
||||
<Button
|
||||
onClick={() => {
|
||||
const credits = calculateCreditsFromVideoConfig();
|
||||
if ((user?.credits || 0) < credits) {
|
||||
message.warning(`积分不足${credits},请充值积分`);
|
||||
return;
|
||||
}
|
||||
createvideo(step.id, step.engineId);
|
||||
}}
|
||||
type="primary"
|
||||
style={{ flex: '1 0 auto', minWidth: 140, borderRadius: 10, background: 'linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)', border: 'none', height: 36, fontWeight: 500, boxShadow: '0 4px 12px rgba(99, 102, 241, 0.3)' }}
|
||||
disabled={step.status !== 'completed' || ((user?.credits || 0) < calculateCreditsFromVideoConfig())}
|
||||
>
|
||||
<Button
|
||||
onClick={() => {
|
||||
const credits = calculateCreditsFromVideoConfig();
|
||||
if ((user?.credits || 0) < credits) {
|
||||
message.warning(`积分不足${credits},请充值积分`);
|
||||
return;
|
||||
}
|
||||
createvideo(step.id, step.engineId);
|
||||
}}
|
||||
type="primary"
|
||||
style={{ flex: '1 0 auto', minWidth: 140, borderRadius: 10, background: 'linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%)', border: 'none', height: 36, fontWeight: 500, boxShadow: '0 4px 12px rgba(99, 102, 241, 0.3)' }}
|
||||
disabled={step.status !== 'completed' || ((user?.credits || 0) < calculateCreditsFromVideoConfig())}
|
||||
>
|
||||
下一步:生成视频(所需积分:{calculateCreditsFromVideoConfig()})
|
||||
</Button>
|
||||
</Tooltip>
|
||||
下一步:生成视频(所需积分:{calculateCreditsFromVideoConfig()})
|
||||
</Button>
|
||||
</Tooltip>
|
||||
</Space>
|
||||
</>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user