fix(experience-center): 统一图像与视频生成界面并修复参数显示
对齐表单、预览与任务区,跟随系统主题色,修复图片尺寸选择和视频高级参数显示。已通过本地浏览器验收、Lint、UI 审计和单测;未做生产测试。
This commit is contained in:
@@ -91,7 +91,6 @@ const VideoPreviewPanel = ({
|
||||
videoMaxHeight: '600px',
|
||||
buttonSize: 'large',
|
||||
titleSize: 4,
|
||||
iconSize: 64,
|
||||
progressWidth: 120,
|
||||
};
|
||||
}
|
||||
@@ -102,7 +101,6 @@ const VideoPreviewPanel = ({
|
||||
videoMaxHeight: '500px',
|
||||
buttonSize: 'default',
|
||||
titleSize: 5,
|
||||
iconSize: 56,
|
||||
progressWidth: 100,
|
||||
};
|
||||
}
|
||||
@@ -113,7 +111,6 @@ const VideoPreviewPanel = ({
|
||||
videoMaxHeight: '400px',
|
||||
buttonSize: 'default',
|
||||
titleSize: 5,
|
||||
iconSize: 48,
|
||||
progressWidth: 90,
|
||||
};
|
||||
}
|
||||
@@ -124,7 +121,6 @@ const VideoPreviewPanel = ({
|
||||
videoMaxHeight: '350px',
|
||||
buttonSize: 'small',
|
||||
titleSize: 6,
|
||||
iconSize: 40,
|
||||
progressWidth: 80,
|
||||
};
|
||||
};
|
||||
@@ -241,28 +237,8 @@ const VideoPreviewPanel = ({
|
||||
const renderTopBar = () => {
|
||||
// 优先显示从任务列表选择的任务
|
||||
const displayTask = selectedTaskForPlay || currentTask;
|
||||
const normalizedStatus = normalizeVideoTaskStatus(displayTask?.status);
|
||||
const isCompleted = normalizedStatus === 'success';
|
||||
|
||||
// 检查是否有视频URL
|
||||
let _hasVideo = false;
|
||||
if (displayTask) {
|
||||
const videoUrl = getVideoURLFromDetail(displayTask);
|
||||
_hasVideo = isCompleted && !!videoUrl;
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
padding: windowWidth > 768 ? '16px 20px' : '12px 16px',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
gap: '12px',
|
||||
backgroundColor: 'var(--ui-color-bg-1)',
|
||||
borderBottom: '1px solid var(--ui-color-border)',
|
||||
flexShrink: 0,
|
||||
}}
|
||||
>
|
||||
<div className='video-preview-actions'>
|
||||
{needTopUp ? (
|
||||
<Button
|
||||
type='warning'
|
||||
@@ -283,14 +259,7 @@ const VideoPreviewPanel = ({
|
||||
onClick={isButtonDisabled ? undefined : handleGenerate}
|
||||
disabled={isButtonDisabled || submitting}
|
||||
loading={submitting}
|
||||
style={{
|
||||
fontWeight: 600,
|
||||
background:
|
||||
isButtonDisabled || submitting
|
||||
? undefined
|
||||
: 'linear-gradient(135deg, var(--ui-color-primary) 0%, var(--ui-color-primary-active, var(--ui-color-primary)) 100%)',
|
||||
border: 'none',
|
||||
}}
|
||||
className='video-generate-button'
|
||||
>
|
||||
{submitting
|
||||
? t('提交中...')
|
||||
@@ -344,8 +313,6 @@ const VideoPreviewPanel = ({
|
||||
</Text>
|
||||
)}
|
||||
|
||||
<div style={{ flex: 1 }} />
|
||||
|
||||
<Tooltip
|
||||
content={
|
||||
<div style={{ padding: '12px', maxWidth: '300px' }}>
|
||||
@@ -368,11 +335,13 @@ const VideoPreviewPanel = ({
|
||||
</div>
|
||||
}
|
||||
position='bottomRight'
|
||||
trigger='hover'
|
||||
trigger={['hover', 'focus']}
|
||||
showArrow={true}
|
||||
>
|
||||
<Button
|
||||
icon={<ActionHelpCircle size={18} />}
|
||||
className='video-help-button'
|
||||
aria-label={t('使用提示')}
|
||||
type='tertiary'
|
||||
size={windowWidth > 768 ? 'default' : 'small'}
|
||||
/>
|
||||
@@ -702,199 +671,31 @@ const VideoPreviewPanel = ({
|
||||
);
|
||||
}
|
||||
|
||||
// 默认空状态 - 纯CSS电影感动画背景(无网络资源消耗)
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
minHeight: config.minHeight,
|
||||
height: '100%',
|
||||
position: 'relative',
|
||||
borderRadius: '12px',
|
||||
overflow: 'hidden',
|
||||
margin: '16px',
|
||||
background:
|
||||
'linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%)',
|
||||
}}
|
||||
>
|
||||
{/* CSS动画背景 - 流动光效(增强版) */}
|
||||
<div
|
||||
style={{
|
||||
position: 'absolute',
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
overflow: 'hidden',
|
||||
pointerEvents: 'none',
|
||||
}}
|
||||
>
|
||||
{/* 动态光晕1 - 紫色 */}
|
||||
<div
|
||||
className='video-preview-glow1'
|
||||
style={{
|
||||
position: 'absolute',
|
||||
width: '60%',
|
||||
height: '60%',
|
||||
top: '10%',
|
||||
left: '5%',
|
||||
background:
|
||||
'radial-gradient(ellipse at center, color-mix(in srgb, var(--brand-gradient-via) 35%, transparent) 0%, color-mix(in srgb, var(--brand-gradient-via) 10%, transparent) 40%, transparent 70%)',
|
||||
borderRadius: '50%',
|
||||
filter: 'blur(40px)',
|
||||
}}
|
||||
/>
|
||||
{/* 动态光晕2 - 橙红色 */}
|
||||
<div
|
||||
className='video-preview-glow2'
|
||||
style={{
|
||||
position: 'absolute',
|
||||
width: '50%',
|
||||
height: '50%',
|
||||
bottom: '10%',
|
||||
right: '5%',
|
||||
background:
|
||||
'radial-gradient(ellipse at center, rgba(251, 146, 60, 0.3) 0%, rgba(251, 146, 60, 0.1) 40%, transparent 70%)',
|
||||
borderRadius: '50%',
|
||||
filter: 'blur(40px)',
|
||||
}}
|
||||
/>
|
||||
{/* 动态光晕3 - 金色中心 */}
|
||||
<div
|
||||
className='video-preview-glow3'
|
||||
style={{
|
||||
position: 'absolute',
|
||||
width: '40%',
|
||||
height: '40%',
|
||||
top: '30%',
|
||||
left: '30%',
|
||||
background:
|
||||
'radial-gradient(ellipse at center, rgba(251, 191, 36, 0.25) 0%, transparent 60%)',
|
||||
borderRadius: '50%',
|
||||
filter: 'blur(30px)',
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* 电影宽银幕效果 - 上下黑边 */}
|
||||
<div
|
||||
style={{
|
||||
position: 'absolute',
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
height: '6%',
|
||||
background:
|
||||
'linear-gradient(180deg, rgba(0,0,0,0.95) 0%, transparent 100%)',
|
||||
zIndex: 2,
|
||||
}}
|
||||
/>
|
||||
<div
|
||||
style={{
|
||||
position: 'absolute',
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
height: '6%',
|
||||
background:
|
||||
'linear-gradient(0deg, rgba(0,0,0,0.95) 0%, transparent 100%)',
|
||||
zIndex: 2,
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* 中央内容区域 */}
|
||||
<div
|
||||
style={{
|
||||
flex: 1,
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
padding: config.padding,
|
||||
color: 'white',
|
||||
position: 'relative',
|
||||
zIndex: 3,
|
||||
}}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
backgroundColor: 'rgba(255, 255, 255, 0.1)',
|
||||
borderRadius: '50%',
|
||||
padding: windowWidth > 1024 ? '32px' : '24px',
|
||||
marginBottom: windowWidth > 768 ? '32px' : '24px',
|
||||
border: '1px solid rgba(255, 255, 255, 0.2)',
|
||||
boxShadow: '0 8px 32px rgba(0, 0, 0, 0.3)',
|
||||
transition: 'transform 0.3s ease',
|
||||
}}
|
||||
onMouseEnter={(e) => {
|
||||
e.currentTarget.style.transform = 'scale(1.05)';
|
||||
}}
|
||||
onMouseLeave={(e) => {
|
||||
e.currentTarget.style.transform = 'scale(1)';
|
||||
}}
|
||||
>
|
||||
<Film
|
||||
size={config.iconSize}
|
||||
style={{
|
||||
color: 'rgba(255, 220, 180, 0.9)',
|
||||
filter: 'drop-shadow(0 2px 12px rgba(255,200,150,0.4))',
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<Title
|
||||
heading={config.titleSize}
|
||||
style={{
|
||||
marginBottom: '12px',
|
||||
color: 'rgba(255, 250, 245, 0.95)',
|
||||
fontWeight: 700,
|
||||
textShadow: '0 4px 20px rgba(0, 0, 0, 0.6)',
|
||||
letterSpacing: '3px',
|
||||
}}
|
||||
>
|
||||
{t('AI 视频生成')}
|
||||
</Title>
|
||||
|
||||
<Text
|
||||
style={{
|
||||
marginBottom: windowWidth > 768 ? '24px' : '16px',
|
||||
textAlign: 'center',
|
||||
fontSize: windowWidth > 768 ? '16px' : '14px',
|
||||
padding: '0 16px',
|
||||
color: 'rgba(255, 255, 255, 0.7)',
|
||||
maxWidth: '500px',
|
||||
lineHeight: '1.8',
|
||||
textShadow: '0 2px 8px rgba(0, 0, 0, 0.5)',
|
||||
}}
|
||||
>
|
||||
{formData.mode === 'text2video'
|
||||
? t('输入提示词,让 AI 为你创造精彩视频')
|
||||
: t('上传图片并输入提示词,生成动态视频')}
|
||||
</Text>
|
||||
</div>
|
||||
<div className='video-preview-empty'>
|
||||
<span className='video-preview-empty-icon' aria-hidden='true'>
|
||||
<Film size={28} />
|
||||
</span>
|
||||
<h3>{t('AI 视频生成')}</h3>
|
||||
<p>
|
||||
{formData.mode === 'text2video'
|
||||
? t('输入提示词,让 AI 为你创造精彩视频')
|
||||
: t('上传图片并输入提示词,生成动态视频')}
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<Card
|
||||
style={{ height: '100%', display: 'flex', flexDirection: 'column' }}
|
||||
styles={{
|
||||
body: {
|
||||
flex: 1,
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
overflow: 'hidden',
|
||||
padding: 0,
|
||||
},
|
||||
}}
|
||||
>
|
||||
{/* 始终显示的顶部操作栏 */}
|
||||
{renderTopBar()}
|
||||
|
||||
{/* 内容区域 */}
|
||||
<div style={{ flex: 1, overflow: 'auto' }}>{renderPreview()}</div>
|
||||
<Card className='video-preview-panel'>
|
||||
<header className='video-panel-header video-preview-header'>
|
||||
<div className='video-panel-heading'>
|
||||
<Film size={17} aria-hidden='true' />
|
||||
<h2>{t('视频预览')}</h2>
|
||||
</div>
|
||||
{renderTopBar()}
|
||||
</header>
|
||||
<div className='video-preview-stage app-scrollbar'>{renderPreview()}</div>
|
||||
</Card>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user