合并视频等待提示调整

This commit is contained in:
chenpei 2026-08-21 13:42:26 +08:00
commit daa79fdecd
2 changed files with 15 additions and 10 deletions

View File

@ -119,8 +119,8 @@ describe('MaterialCard', () => {
expect(screen.getByText('未设置')).toBeInTheDocument()
})
test('15天策略隐藏源地址时仍显示视频转码进度', () => {
render(
test('15天策略隐藏源地址时仍显示视频转码进度,提示不遮挡预览', () => {
const { container } = render(
<MaterialCard
{...defaultProps}
material={{
@ -137,7 +137,11 @@ describe('MaterialCard', () => {
expect(screen.getByRole('status')).toHaveTextContent('等待中')
expect(screen.getByRole('progressbar')).toHaveAttribute('aria-valuenow', '5')
expect(screen.getByText('15天后可查看详情')).toBeInTheDocument()
const previewArea = container.querySelector('[data-material-link="true"]')
const notice = screen.getByText('15天后可查看详情')
expect(previewArea).not.toBeNull()
expect(previewArea).not.toContainElement(notice)
expect(notice).toHaveAttribute('data-video-preview-notice', 'true')
})
test('视频卡片初始只加载封面,悬停时才挂载视频预览', () => {

View File

@ -568,13 +568,6 @@ export default function MaterialCard({
{Math.floor(material.videoDuration / 60)}:{(material.videoDuration % 60).toString().padStart(2, '0')}
</div>
)}
{isPreviewWaiting && (
<div className="absolute inset-0 z-30 flex items-center justify-center bg-[#fafafa]/55 px-4 text-center">
<div className="rounded-[8px] border border-[#e7e8ea] bg-white px-3 py-2 text-xs font-medium text-[#1a1c1d]">
{material.videoPreviewRemainingDays || videoDownloadAvailability.remainingDays || VIDEO_DOWNLOAD_WAIT_DAYS}天后可查看详情
</div>
</div>
)}
</div>
<div className="pt-4">
@ -599,6 +592,14 @@ export default function MaterialCard({
>
ID {material.id}
</p>
{isPreviewWaiting && (
<p
data-video-preview-notice="true"
className="mt-2 text-xs font-medium text-[#5f6469]"
>
{material.videoPreviewRemainingDays || videoDownloadAvailability.remainingDays || VIDEO_DOWNLOAD_WAIT_DAYS}天后可查看详情
</p>
)}
<div className="mt-3 flex flex-wrap items-center gap-x-4 gap-y-1 text-[13px]">
<button