jvs-ppt-ui 0.0.25 → 0.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/jvs-ppt-ui.es.js +16182 -15674
- package/dist/lib/jvs-ppt-ui.umd.js +67 -67
- package/dist/lib/style.css +1 -1
- package/package.json +1 -1
- package/src/components/PptEditor.vue +63 -0
- package/src/components/SidebarRight.vue +77 -21
- package/src/components/SvgChart.vue +1 -1
- package/src/components/TemplateGallery.vue +916 -93
- package/src/components/canvas/elements/CanvasShapeElement.vue +5 -0
- package/src/components/canvas/elements/CanvasTextElement.vue +5 -0
- package/src/components/material/CreateMaterialPanel.vue +64 -3
- package/src/components/material/MyAssetsPanel.vue +61 -3
- package/src/components/sidebar/panels/SidebarDesignPanel.vue +2 -2
- package/src/components/sidebar/panels/SidebarTextFormatPanel.vue +66 -17
- package/src/composables/useSlides.ts +25 -20
- package/src/index.ts +2 -1
- package/src/style.css +63 -2
- package/src/utils/textTypes.ts +1 -1
|
@@ -64,6 +64,9 @@ export type StockSubType =
|
|
|
64
64
|
| 'Photos'
|
|
65
65
|
| 'Illustrations'
|
|
66
66
|
| 'Videos'
|
|
67
|
+
| 'Icons'
|
|
68
|
+
| 'Music'
|
|
69
|
+
| 'Sound_Effects'
|
|
67
70
|
|
|
68
71
|
interface OverviewCategoryConfig {
|
|
69
72
|
key: StockSubType
|
|
@@ -72,7 +75,7 @@ interface OverviewCategoryConfig {
|
|
|
72
75
|
tags: string[]
|
|
73
76
|
}
|
|
74
77
|
|
|
75
|
-
// 图二:固定
|
|
78
|
+
// 图二:固定 7 大核心分类区块配置(矢量图 / 照片 / 插画 / 高清视频 / 图标元素 / 背景音乐 / 音效),每个分类对应后端 subType 参数独立请求一次接口
|
|
76
79
|
const overviewCategories: OverviewCategoryConfig[] = [
|
|
77
80
|
{
|
|
78
81
|
key: 'Vectors',
|
|
@@ -97,6 +100,24 @@ const overviewCategories: OverviewCategoryConfig[] = [
|
|
|
97
100
|
label: '高清视频',
|
|
98
101
|
subType: 'Videos',
|
|
99
102
|
tags: ['风景', '商务', '科技', '自然', '城市', '航拍', '办公']
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
key: 'Icons',
|
|
106
|
+
label: '图标元素',
|
|
107
|
+
subType: 'Icons',
|
|
108
|
+
tags: ['箭头', '商务', '科技', '办公', '社交', '图表', '医疗']
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
key: 'Music',
|
|
112
|
+
label: '背景音乐',
|
|
113
|
+
subType: 'Music',
|
|
114
|
+
tags: ['轻快', '商务', '舒缓', '科技', '钢琴', '振奋', '环境']
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
key: 'Sound_Effects',
|
|
118
|
+
label: '音效',
|
|
119
|
+
subType: 'Sound_Effects',
|
|
120
|
+
tags: ['点击', '转场', '提示音', '掌声', '倒计时', '自然', '科技']
|
|
100
121
|
}
|
|
101
122
|
]
|
|
102
123
|
|
|
@@ -104,7 +125,21 @@ const subTypeNameMap: Record<StockSubType, string> = {
|
|
|
104
125
|
Vectors: '矢量图',
|
|
105
126
|
Photos: '照片',
|
|
106
127
|
Illustrations: '插画',
|
|
107
|
-
Videos: '高清视频'
|
|
128
|
+
Videos: '高清视频',
|
|
129
|
+
Icons: '图标元素',
|
|
130
|
+
Music: '背景音乐',
|
|
131
|
+
Sound_Effects: '音效'
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// 后端 /jvs-dam/stock/search 在未输入搜索词时的默认分类回退词(对齐 jvs-material-ui)
|
|
135
|
+
const defaultCategoryKeywordMap: Record<StockSubType, string> = {
|
|
136
|
+
Vectors: 'vectors',
|
|
137
|
+
Photos: 'photos',
|
|
138
|
+
Illustrations: 'illustrations',
|
|
139
|
+
Videos: 'videos',
|
|
140
|
+
Icons: 'icons',
|
|
141
|
+
Music: 'music',
|
|
142
|
+
Sound_Effects: 'sound-effects'
|
|
108
143
|
}
|
|
109
144
|
|
|
110
145
|
// 顶层 3-Tab 状态(联网搜索 / AI生成 / 我的空间)与 jvs_session_v3 鉴权
|
|
@@ -325,13 +360,58 @@ const detailHeaderTitle = computed(() => {
|
|
|
325
360
|
return baseDetailTitle.value || subTypeNameMap[filterParams.activeSubType] || '素材库'
|
|
326
361
|
})
|
|
327
362
|
|
|
363
|
+
function normalizeIconifyUrl(rawUrl?: string): string {
|
|
364
|
+
if (!rawUrl) return ''
|
|
365
|
+
if (rawUrl.includes('api.iconify.design') && rawUrl.includes('.svg')) {
|
|
366
|
+
if (!rawUrl.includes('width=') && !rawUrl.includes('height=')) {
|
|
367
|
+
const sep = rawUrl.includes('?') ? '&' : '?'
|
|
368
|
+
return `${rawUrl}${sep}width=256&height=256`
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
return rawUrl
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
function isAudioUrl(url?: string): boolean {
|
|
375
|
+
if (!url) return false
|
|
376
|
+
const clean = url.split('?')[0].split('#')[0].toLowerCase()
|
|
377
|
+
return (
|
|
378
|
+
clean.endsWith('.mp3') ||
|
|
379
|
+
clean.endsWith('.wav') ||
|
|
380
|
+
clean.endsWith('.flac') ||
|
|
381
|
+
clean.endsWith('.aac') ||
|
|
382
|
+
clean.endsWith('.m4a')
|
|
383
|
+
)
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
function isAudioMaterial(item: MaterialItem): boolean {
|
|
387
|
+
return (
|
|
388
|
+
item.type === 'audio' ||
|
|
389
|
+
String(item.assetType || '').toUpperCase() === 'AUDIO' ||
|
|
390
|
+
item.assetSubType === 'Music' ||
|
|
391
|
+
item.assetSubType === 'Sound_Effects' ||
|
|
392
|
+
item.subType === 'Music' ||
|
|
393
|
+
item.subType === 'Sound_Effects' ||
|
|
394
|
+
isAudioUrl(item.sourceUrl || item.url || item.downloadUrl)
|
|
395
|
+
)
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
function isIconMaterial(item: MaterialItem): boolean {
|
|
399
|
+
return (
|
|
400
|
+
item.assetSubType === 'Icons' ||
|
|
401
|
+
item.subType === 'Icons' ||
|
|
402
|
+
String(item.sourcePlatform || '').toUpperCase() === 'ICONIFY' ||
|
|
403
|
+
String(item.previewUrl || item.url || '').includes('api.iconify.design')
|
|
404
|
+
)
|
|
405
|
+
}
|
|
406
|
+
|
|
328
407
|
function isVideoUrl(url?: string): boolean {
|
|
329
408
|
if (!url) return false
|
|
330
409
|
const clean = url.split('?')[0].toLowerCase()
|
|
331
|
-
return clean.endsWith('.mp4') || clean.endsWith('.webm') || clean.endsWith('.mov') || clean.endsWith('.m4v')
|
|
410
|
+
return clean.endsWith('.mp4') || clean.endsWith('.webm') || clean.endsWith('.mov') || clean.endsWith('.m4v')
|
|
332
411
|
}
|
|
333
412
|
|
|
334
413
|
function isVideoMaterial(item: MaterialItem): boolean {
|
|
414
|
+
if (isAudioMaterial(item)) return false
|
|
335
415
|
return (
|
|
336
416
|
item.type === 'video' ||
|
|
337
417
|
item.assetType === 'VIDEO' ||
|
|
@@ -341,16 +421,44 @@ function isVideoMaterial(item: MaterialItem): boolean {
|
|
|
341
421
|
)
|
|
342
422
|
}
|
|
343
423
|
|
|
424
|
+
function getAudioCoverImg(item: MaterialItem): string {
|
|
425
|
+
const candidates = [item.coverUrl, item.image, item.thumbnail, item.previewUrl]
|
|
426
|
+
for (const c of candidates) {
|
|
427
|
+
if (c && typeof c === 'string' && !isAudioUrl(c) && !isVideoUrl(c) && !c.split('?')[0].toLowerCase().endsWith('.ogg')) {
|
|
428
|
+
return c
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
return ''
|
|
432
|
+
}
|
|
433
|
+
|
|
344
434
|
function getMaterialThumb(item: MaterialItem): string {
|
|
345
|
-
|
|
435
|
+
if (isAudioMaterial(item)) {
|
|
436
|
+
return getAudioCoverImg(item)
|
|
437
|
+
}
|
|
438
|
+
const raw = item.previewUrl || item.image || item.coverUrl || item.thumbnail || item.url || item.sourceUrl || item.downloadUrl || ''
|
|
439
|
+
return normalizeIconifyUrl(raw)
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
function formatAudioDuration(seconds?: number | string): string {
|
|
443
|
+
const num = Number(seconds)
|
|
444
|
+
if (!Number.isFinite(num) || num <= 0) return ''
|
|
445
|
+
const totalSec = Math.max(1, Math.round(num))
|
|
446
|
+
const mins = Math.floor(totalSec / 60)
|
|
447
|
+
const secs = totalSec % 60
|
|
448
|
+
return `${mins}:${secs < 10 ? '0' : ''}${secs}`
|
|
346
449
|
}
|
|
347
450
|
|
|
348
451
|
function getItemFormat(item: MaterialItem): string {
|
|
349
452
|
if (item.format) return item.format.toUpperCase()
|
|
350
453
|
const u = (item.sourceUrl || item.url || item.previewUrl || item.fileName || '').toLowerCase()
|
|
454
|
+
if (u.includes('.mp3')) return 'MP3'
|
|
455
|
+
if (u.includes('.wav')) return 'WAV'
|
|
456
|
+
if (u.includes('.flac')) return 'FLAC'
|
|
457
|
+
if (u.includes('.m4a') || u.includes('.aac')) return 'AAC'
|
|
458
|
+
if (isAudioMaterial(item)) return 'MP3'
|
|
351
459
|
if (u.includes('.mp4')) return 'MP4'
|
|
352
460
|
if (u.includes('.mov') || u.includes('.webm')) return 'VIDEO'
|
|
353
|
-
if (u.includes('.svg')) return 'SVG'
|
|
461
|
+
if (u.includes('.svg') || isIconMaterial(item)) return 'SVG'
|
|
354
462
|
if (u.includes('.png')) return 'PNG'
|
|
355
463
|
if (u.includes('.gif')) return 'GIF'
|
|
356
464
|
if (item.assetSubType === 'Videos' || item.type === 'video') return 'MP4'
|
|
@@ -358,10 +466,55 @@ function getItemFormat(item: MaterialItem): string {
|
|
|
358
466
|
return 'JPG'
|
|
359
467
|
}
|
|
360
468
|
|
|
361
|
-
//
|
|
469
|
+
// 抽屉内联音频试听控制(背景音乐 / 音效卡片直接点击播放按钮即可试听)
|
|
470
|
+
const playingAudioId = ref<string | number | null>(null)
|
|
471
|
+
let inlineAudioPlayer: HTMLAudioElement | null = null
|
|
472
|
+
|
|
473
|
+
function stopInlineAudio() {
|
|
474
|
+
if (inlineAudioPlayer) {
|
|
475
|
+
inlineAudioPlayer.pause()
|
|
476
|
+
inlineAudioPlayer.currentTime = 0
|
|
477
|
+
}
|
|
478
|
+
playingAudioId.value = null
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
function toggleInlineAudioPlay(item: MaterialItem, e?: Event) {
|
|
482
|
+
if (e) {
|
|
483
|
+
e.stopPropagation()
|
|
484
|
+
e.preventDefault()
|
|
485
|
+
}
|
|
486
|
+
const audioSrc = item.sourceUrl || item.url || item.downloadUrl || item.previewUrl || ''
|
|
487
|
+
if (!audioSrc) {
|
|
488
|
+
notify('该音频暂无可用试听地址')
|
|
489
|
+
return
|
|
490
|
+
}
|
|
491
|
+
if (playingAudioId.value === item.id && inlineAudioPlayer && !inlineAudioPlayer.paused) {
|
|
492
|
+
stopInlineAudio()
|
|
493
|
+
return
|
|
494
|
+
}
|
|
495
|
+
if (!inlineAudioPlayer) {
|
|
496
|
+
inlineAudioPlayer = new Audio()
|
|
497
|
+
inlineAudioPlayer.addEventListener('ended', () => {
|
|
498
|
+
playingAudioId.value = null
|
|
499
|
+
})
|
|
500
|
+
inlineAudioPlayer.addEventListener('error', () => {
|
|
501
|
+
playingAudioId.value = null
|
|
502
|
+
})
|
|
503
|
+
}
|
|
504
|
+
inlineAudioPlayer.pause()
|
|
505
|
+
inlineAudioPlayer.src = audioSrc
|
|
506
|
+
playingAudioId.value = item.id
|
|
507
|
+
inlineAudioPlayer.play().catch(() => {
|
|
508
|
+
playingAudioId.value = null
|
|
509
|
+
notify('音频加载失败或暂不支持在线试听')
|
|
510
|
+
})
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
// 全屏大图/视频/音频预览状态
|
|
362
514
|
interface PreviewItem {
|
|
363
515
|
url: string
|
|
364
516
|
isVideo: boolean
|
|
517
|
+
isAudio: boolean
|
|
365
518
|
title: string
|
|
366
519
|
format: string
|
|
367
520
|
meta: MaterialItem
|
|
@@ -382,9 +535,12 @@ function openPreview(item: MaterialItem, e?: Event) {
|
|
|
382
535
|
e.stopPropagation()
|
|
383
536
|
e.preventDefault()
|
|
384
537
|
}
|
|
538
|
+
stopInlineAudio()
|
|
385
539
|
|
|
386
|
-
const
|
|
387
|
-
|
|
540
|
+
const isAud = isAudioMaterial(item)
|
|
541
|
+
const isVid = !isAud && isVideoMaterial(item)
|
|
542
|
+
const currentUrl = (isAud || isVid)
|
|
543
|
+
? (item.sourceUrl || item.url || item.downloadUrl || item.previewUrl || getMaterialThumb(item))
|
|
388
544
|
: getMaterialThumb(item)
|
|
389
545
|
|
|
390
546
|
if (!currentUrl) {
|
|
@@ -399,14 +555,16 @@ function openPreview(item: MaterialItem, e?: Event) {
|
|
|
399
555
|
|
|
400
556
|
const validItems: PreviewItem[] = []
|
|
401
557
|
sourceList.forEach(m => {
|
|
402
|
-
const
|
|
403
|
-
const
|
|
404
|
-
|
|
558
|
+
const mAud = isAudioMaterial(m)
|
|
559
|
+
const mVid = !mAud && isVideoMaterial(m)
|
|
560
|
+
const u = (mAud || mVid)
|
|
561
|
+
? (m.sourceUrl || m.url || m.downloadUrl || m.previewUrl || getMaterialThumb(m))
|
|
405
562
|
: getMaterialThumb(m)
|
|
406
563
|
if (u) {
|
|
407
564
|
validItems.push({
|
|
408
565
|
url: u,
|
|
409
|
-
isVideo:
|
|
566
|
+
isVideo: mVid && isVideoUrl(u),
|
|
567
|
+
isAudio: mAud,
|
|
410
568
|
title: m.title || '素材预览',
|
|
411
569
|
format: getItemFormat(m),
|
|
412
570
|
meta: m
|
|
@@ -420,7 +578,8 @@ function openPreview(item: MaterialItem, e?: Event) {
|
|
|
420
578
|
} else {
|
|
421
579
|
validItems.unshift({
|
|
422
580
|
url: currentUrl,
|
|
423
|
-
isVideo:
|
|
581
|
+
isVideo: isVid && isVideoUrl(currentUrl),
|
|
582
|
+
isAudio: isAud,
|
|
424
583
|
title: item.title || '素材预览',
|
|
425
584
|
format: getItemFormat(item),
|
|
426
585
|
meta: item
|
|
@@ -440,15 +599,18 @@ function openPreview(item: MaterialItem, e?: Event) {
|
|
|
440
599
|
previewVisible.value = true
|
|
441
600
|
}
|
|
442
601
|
|
|
443
|
-
//
|
|
602
|
+
// 供「我的素材」与「创建素材」子面板复用的全屏大图/视频/音频预览
|
|
444
603
|
function openCustomListPreview(item: MaterialItem, list: MaterialItem[], e?: Event) {
|
|
445
604
|
if (e) {
|
|
446
605
|
e.stopPropagation()
|
|
447
606
|
e.preventDefault()
|
|
448
607
|
}
|
|
608
|
+
stopInlineAudio()
|
|
449
609
|
|
|
450
|
-
const
|
|
451
|
-
|
|
610
|
+
const isAud = isAudioMaterial(item)
|
|
611
|
+
const isVid = !isAud && isVideoMaterial(item)
|
|
612
|
+
const currentUrl = (isAud || isVid)
|
|
613
|
+
? (item.sourceUrl || item.url || item.downloadUrl || item.previewUrl || getMaterialThumb(item))
|
|
452
614
|
: getMaterialThumb(item)
|
|
453
615
|
|
|
454
616
|
if (!currentUrl) {
|
|
@@ -460,14 +622,16 @@ function openCustomListPreview(item: MaterialItem, list: MaterialItem[], e?: Eve
|
|
|
460
622
|
const validItems: PreviewItem[] = []
|
|
461
623
|
|
|
462
624
|
sourceList.forEach(m => {
|
|
463
|
-
const
|
|
464
|
-
const
|
|
465
|
-
|
|
625
|
+
const mAud = isAudioMaterial(m)
|
|
626
|
+
const mVid = !mAud && isVideoMaterial(m)
|
|
627
|
+
const u = (mAud || mVid)
|
|
628
|
+
? (m.sourceUrl || m.url || m.downloadUrl || m.previewUrl || getMaterialThumb(m))
|
|
466
629
|
: getMaterialThumb(m)
|
|
467
630
|
if (u) {
|
|
468
631
|
validItems.push({
|
|
469
632
|
url: u,
|
|
470
|
-
isVideo:
|
|
633
|
+
isVideo: mVid && isVideoUrl(u),
|
|
634
|
+
isAudio: mAud,
|
|
471
635
|
title: m.title || '素材预览',
|
|
472
636
|
format: getItemFormat(m),
|
|
473
637
|
meta: m
|
|
@@ -481,7 +645,8 @@ function openCustomListPreview(item: MaterialItem, list: MaterialItem[], e?: Eve
|
|
|
481
645
|
} else {
|
|
482
646
|
validItems.unshift({
|
|
483
647
|
url: currentUrl,
|
|
484
|
-
isVideo:
|
|
648
|
+
isVideo: isVid && isVideoUrl(currentUrl),
|
|
649
|
+
isAudio: isAud,
|
|
485
650
|
title: item.title || '素材预览',
|
|
486
651
|
format: getItemFormat(item),
|
|
487
652
|
meta: item
|
|
@@ -606,13 +771,21 @@ function normalizeMaterialItem(item: any, defaultSubType: StockSubType = 'Photos
|
|
|
606
771
|
const subType = (item.assetSubType || item.subType || defaultSubType) as StockSubType
|
|
607
772
|
let type = item.type || ''
|
|
608
773
|
if (!type) {
|
|
609
|
-
if (subType === '
|
|
610
|
-
|
|
611
|
-
else
|
|
774
|
+
if (subType === 'Music' || subType === 'Sound_Effects' || String(item.assetType || '').toUpperCase() === 'AUDIO') {
|
|
775
|
+
type = 'audio'
|
|
776
|
+
} else if (subType === 'Videos' || item.assetType === 'VIDEO') {
|
|
777
|
+
type = 'video'
|
|
778
|
+
} else if (subType === 'Vectors' || subType === 'Icons') {
|
|
779
|
+
type = 'svg'
|
|
780
|
+
} else {
|
|
781
|
+
type = 'image'
|
|
782
|
+
}
|
|
612
783
|
}
|
|
613
784
|
|
|
614
|
-
const
|
|
615
|
-
const
|
|
785
|
+
const rawPreviewUrl = item.previewUrl || item.image || item.coverUrl || item.thumbnail || item.url || item.downloadUrl || item.sourceUrl || ''
|
|
786
|
+
const rawSourceUrl = item.sourceUrl || item.downloadUrl || item.url || rawPreviewUrl
|
|
787
|
+
const previewUrl = normalizeIconifyUrl(rawPreviewUrl)
|
|
788
|
+
const sourceUrl = normalizeIconifyUrl(rawSourceUrl)
|
|
616
789
|
const url = sourceUrl || previewUrl
|
|
617
790
|
|
|
618
791
|
const platform = item.sourcePlatform || (item.id && typeof item.id === 'string' && item.id.includes('_') ? item.id.split('_')[0].toUpperCase() : '')
|
|
@@ -622,6 +795,9 @@ function normalizeMaterialItem(item: any, defaultSubType: StockSubType = 'Photos
|
|
|
622
795
|
if (!ratio && item.width && item.height) {
|
|
623
796
|
ratio = `${item.width} / ${item.height}`
|
|
624
797
|
}
|
|
798
|
+
if (subType === 'Icons') {
|
|
799
|
+
ratio = '1 / 1'
|
|
800
|
+
}
|
|
625
801
|
|
|
626
802
|
return {
|
|
627
803
|
...item,
|
|
@@ -639,8 +815,8 @@ function normalizeMaterialItem(item: any, defaultSubType: StockSubType = 'Photos
|
|
|
639
815
|
color: item.color || item.primaryColor || '',
|
|
640
816
|
primaryColor: item.primaryColor || item.color || '',
|
|
641
817
|
aspectRatio: ratio || '4 / 3',
|
|
642
|
-
originalWidth: item.width || item.originalWidth,
|
|
643
|
-
originalHeight: item.height || item.originalHeight,
|
|
818
|
+
originalWidth: item.width || item.originalWidth || (subType === 'Icons' ? 256 : undefined),
|
|
819
|
+
originalHeight: item.height || item.originalHeight || (subType === 'Icons' ? 256 : undefined),
|
|
644
820
|
tags: Array.isArray(item.tags) ? item.tags : []
|
|
645
821
|
}
|
|
646
822
|
}
|
|
@@ -665,32 +841,63 @@ function parseMaterialList(data: any, defaultSubType: StockSubType = 'Photos'):
|
|
|
665
841
|
}
|
|
666
842
|
|
|
667
843
|
// ============================================================================
|
|
668
|
-
// 图二:概览页
|
|
844
|
+
// 图二:概览页 7 大固定类型(Vectors / Photos / Illustrations / Videos / Icons / Music / Sound_Effects),每个类型独立请求一次接口
|
|
669
845
|
// ============================================================================
|
|
670
846
|
const overviewItemsMap = reactive<Record<StockSubType, MaterialItem[]>>({
|
|
671
847
|
Vectors: [],
|
|
672
848
|
Photos: [],
|
|
673
849
|
Illustrations: [],
|
|
674
|
-
Videos: []
|
|
850
|
+
Videos: [],
|
|
851
|
+
Icons: [],
|
|
852
|
+
Music: [],
|
|
853
|
+
Sound_Effects: []
|
|
675
854
|
})
|
|
676
855
|
|
|
677
856
|
const overviewLoadingMap = reactive<Record<StockSubType, boolean>>({
|
|
678
857
|
Vectors: false,
|
|
679
858
|
Photos: false,
|
|
680
859
|
Illustrations: false,
|
|
681
|
-
Videos: false
|
|
860
|
+
Videos: false,
|
|
861
|
+
Icons: false,
|
|
862
|
+
Music: false,
|
|
863
|
+
Sound_Effects: false
|
|
682
864
|
})
|
|
683
865
|
|
|
684
|
-
const rowRefs
|
|
866
|
+
const rowRefs: Record<string, HTMLElement | null> = {}
|
|
685
867
|
const rowScrollState = reactive<Record<StockSubType, { canLeft: boolean; canRight: boolean }>>({
|
|
686
868
|
Vectors: { canLeft: false, canRight: false },
|
|
687
869
|
Photos: { canLeft: false, canRight: false },
|
|
688
870
|
Illustrations: { canLeft: false, canRight: false },
|
|
689
|
-
Videos: { canLeft: false, canRight: false }
|
|
871
|
+
Videos: { canLeft: false, canRight: false },
|
|
872
|
+
Icons: { canLeft: false, canRight: false },
|
|
873
|
+
Music: { canLeft: false, canRight: false },
|
|
874
|
+
Sound_Effects: { canLeft: false, canRight: false }
|
|
690
875
|
})
|
|
691
876
|
|
|
877
|
+
let trackResizeObserver: ResizeObserver | null = null
|
|
878
|
+
|
|
879
|
+
function ensureTrackObservers() {
|
|
880
|
+
if (typeof window === 'undefined') return
|
|
881
|
+
if (!trackResizeObserver && typeof ResizeObserver !== 'undefined') {
|
|
882
|
+
trackResizeObserver = new ResizeObserver(() => {
|
|
883
|
+
updateAllRowScrollStates()
|
|
884
|
+
})
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
|
|
692
888
|
function setRowRef(key: StockSubType, el: any) {
|
|
693
|
-
rowRefs[key]
|
|
889
|
+
const prevEl = rowRefs[key] || null
|
|
890
|
+
const nextEl = (el as HTMLElement | null) || null
|
|
891
|
+
if (prevEl === nextEl) return
|
|
892
|
+
if (prevEl && trackResizeObserver) {
|
|
893
|
+
trackResizeObserver.unobserve(prevEl)
|
|
894
|
+
}
|
|
895
|
+
rowRefs[key] = nextEl
|
|
896
|
+
if (nextEl) {
|
|
897
|
+
ensureTrackObservers()
|
|
898
|
+
trackResizeObserver?.observe(nextEl)
|
|
899
|
+
requestAnimationFrame(() => updateRowScrollState(key))
|
|
900
|
+
}
|
|
694
901
|
}
|
|
695
902
|
|
|
696
903
|
function updateRowScrollState(key: StockSubType) {
|
|
@@ -698,7 +905,17 @@ function updateRowScrollState(key: StockSubType) {
|
|
|
698
905
|
if (!el) return
|
|
699
906
|
const canLeft = el.scrollLeft > 4
|
|
700
907
|
const canRight = el.scrollWidth - el.clientWidth - el.scrollLeft > 4
|
|
701
|
-
rowScrollState[key]
|
|
908
|
+
const state = rowScrollState[key]
|
|
909
|
+
if (state) {
|
|
910
|
+
if (state.canLeft !== canLeft) state.canLeft = canLeft
|
|
911
|
+
if (state.canRight !== canRight) state.canRight = canRight
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
function updateAllRowScrollStates() {
|
|
916
|
+
overviewCategories.forEach(cat => {
|
|
917
|
+
updateRowScrollState(cat.key)
|
|
918
|
+
})
|
|
702
919
|
}
|
|
703
920
|
|
|
704
921
|
function scrollCategoryRow(key: StockSubType, dir: 'left' | 'right') {
|
|
@@ -709,8 +926,33 @@ function scrollCategoryRow(key: StockSubType, dir: 'left' | 'right') {
|
|
|
709
926
|
setTimeout(() => updateRowScrollState(key), 260)
|
|
710
927
|
}
|
|
711
928
|
|
|
712
|
-
//
|
|
713
|
-
function
|
|
929
|
+
// 高清视频、背景音乐、音效不支持颜色/画幅/题材/尺寸筛选条件
|
|
930
|
+
function isNonImageFilterSubType(subType: StockSubType): boolean {
|
|
931
|
+
return (
|
|
932
|
+
subType === 'Videos' ||
|
|
933
|
+
subType === 'Music' ||
|
|
934
|
+
subType === 'Sound_Effects'
|
|
935
|
+
)
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
const isCurrentDetailFilterDisabled = computed(() => {
|
|
939
|
+
return viewMode.value === 'detail' && isNonImageFilterSubType(filterParams.activeSubType)
|
|
940
|
+
})
|
|
941
|
+
|
|
942
|
+
function resolveEffectiveKeyword(rawKeyword: string, subType: StockSubType): string {
|
|
943
|
+
const trimmed = (rawKeyword || '').trim()
|
|
944
|
+
if (trimmed) return trimmed
|
|
945
|
+
if (!isNonImageFilterSubType(subType) && filterParams.category) {
|
|
946
|
+
return filterParams.category
|
|
947
|
+
}
|
|
948
|
+
return defaultCategoryKeywordMap[subType] || 'wallpaper'
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
// 统一追加筛选条件到 URLSearchParams(与 jvs-material-ui StockSearchParams 1:1 对齐,非图片类型不传图片专属过滤项)
|
|
952
|
+
function appendStockFilterParams(params: URLSearchParams, subType: StockSubType) {
|
|
953
|
+
if (isNonImageFilterSubType(subType)) {
|
|
954
|
+
return
|
|
955
|
+
}
|
|
714
956
|
if (filterParams.color) {
|
|
715
957
|
params.append('color', filterParams.color)
|
|
716
958
|
}
|
|
@@ -742,11 +984,8 @@ async function fetchOverviewCategory(cat: OverviewCategoryConfig, keyword = '')
|
|
|
742
984
|
params.append('current', '1')
|
|
743
985
|
params.append('size', '12')
|
|
744
986
|
params.append('subType', cat.subType)
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
params.append('keyword', trimmedKeyword)
|
|
748
|
-
}
|
|
749
|
-
appendStockFilterParams(params)
|
|
987
|
+
params.append('keyword', resolveEffectiveKeyword(keyword, cat.subType))
|
|
988
|
+
appendStockFilterParams(params, cat.subType)
|
|
750
989
|
|
|
751
990
|
const fullUrl = `${stockUrl}${stockUrl.includes('?') ? '&' : '?'}${params.toString()}`
|
|
752
991
|
const data = await safeFetchJson(fullUrl, {
|
|
@@ -766,19 +1005,30 @@ async function fetchOverviewCategory(cat: OverviewCategoryConfig, keyword = '')
|
|
|
766
1005
|
overviewLoadingMap[cat.key] = false
|
|
767
1006
|
nextTick(() => {
|
|
768
1007
|
updateRowScrollState(cat.key)
|
|
769
|
-
|
|
1008
|
+
requestAnimationFrame(() => updateRowScrollState(cat.key))
|
|
1009
|
+
setTimeout(() => updateRowScrollState(cat.key), 120)
|
|
1010
|
+
setTimeout(() => updateRowScrollState(cat.key), 350)
|
|
770
1011
|
})
|
|
771
1012
|
}
|
|
772
1013
|
}
|
|
773
1014
|
|
|
774
|
-
// 遍历
|
|
1015
|
+
// 遍历 7 种固定类型,每一个类型单独请求一次接口
|
|
775
1016
|
function fetchAllOverviewCategories(keyword = overviewQuery.value) {
|
|
776
1017
|
overviewCategories.forEach(cat => {
|
|
777
1018
|
fetchOverviewCategory(cat, keyword)
|
|
778
1019
|
})
|
|
779
1020
|
}
|
|
780
1021
|
|
|
781
|
-
//
|
|
1022
|
+
// 仅刷新支持图片筛选条件的分类(不对高清视频、背景音乐、音效生效)
|
|
1023
|
+
function fetchImageOnlyOverviewCategories(keyword = overviewQuery.value) {
|
|
1024
|
+
overviewCategories.forEach(cat => {
|
|
1025
|
+
if (!isNonImageFilterSubType(cat.subType)) {
|
|
1026
|
+
fetchOverviewCategory(cat, keyword)
|
|
1027
|
+
}
|
|
1028
|
+
})
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
// 关键词搜索触发(概览页刷新全部 7 类,详情页刷新当前类)
|
|
782
1032
|
function triggerSearchNow() {
|
|
783
1033
|
filterParams.query = overviewQuery.value.trim()
|
|
784
1034
|
if (viewMode.value === 'detail') {
|
|
@@ -792,23 +1042,47 @@ function triggerSearchNow() {
|
|
|
792
1042
|
}
|
|
793
1043
|
}
|
|
794
1044
|
|
|
1045
|
+
// 筛选条件变更触发(对高清视频、背景音乐、音效不生效)
|
|
1046
|
+
function triggerFilterChange() {
|
|
1047
|
+
filterParams.query = overviewQuery.value.trim()
|
|
1048
|
+
if (viewMode.value === 'detail') {
|
|
1049
|
+
if (isNonImageFilterSubType(filterParams.activeSubType)) {
|
|
1050
|
+
return
|
|
1051
|
+
}
|
|
1052
|
+
currentPage.value = 1
|
|
1053
|
+
pagedMaterials.value = []
|
|
1054
|
+
reachEnd.value = false
|
|
1055
|
+
loadFailed.value = false
|
|
1056
|
+
fetchMaterials(1, false)
|
|
1057
|
+
} else {
|
|
1058
|
+
fetchImageOnlyOverviewCategories(overviewQuery.value)
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
|
|
795
1062
|
function toggleFilterPopover(forceState?: boolean) {
|
|
1063
|
+
if (isCurrentDetailFilterDisabled.value) {
|
|
1064
|
+
filterPopoverOpen.value = false
|
|
1065
|
+
return
|
|
1066
|
+
}
|
|
796
1067
|
filterPopoverOpen.value = typeof forceState === 'boolean' ? forceState : !filterPopoverOpen.value
|
|
797
1068
|
}
|
|
798
1069
|
|
|
799
1070
|
function selectColorFilter(val: StockColor | '') {
|
|
1071
|
+
if (isCurrentDetailFilterDisabled.value) return
|
|
800
1072
|
filterParams.color = filterParams.color === val ? '' : val
|
|
801
|
-
|
|
1073
|
+
triggerFilterChange()
|
|
802
1074
|
}
|
|
803
1075
|
|
|
804
1076
|
function selectOrientationFilter(val: StockOrientation | '') {
|
|
1077
|
+
if (isCurrentDetailFilterDisabled.value) return
|
|
805
1078
|
filterParams.orientation = filterParams.orientation === val ? '' : val
|
|
806
|
-
|
|
1079
|
+
triggerFilterChange()
|
|
807
1080
|
}
|
|
808
1081
|
|
|
809
1082
|
function selectTopicFilter(val: StockTopicCategory | '') {
|
|
1083
|
+
if (isCurrentDetailFilterDisabled.value) return
|
|
810
1084
|
filterParams.category = filterParams.category === val ? '' : val
|
|
811
|
-
|
|
1085
|
+
triggerFilterChange()
|
|
812
1086
|
}
|
|
813
1087
|
|
|
814
1088
|
function toggleShowAllTopics() {
|
|
@@ -816,6 +1090,7 @@ function toggleShowAllTopics() {
|
|
|
816
1090
|
}
|
|
817
1091
|
|
|
818
1092
|
function selectSizePresetFilter(id: '' | 'hd' | 'fhd' | 'qhd' | 'uhd') {
|
|
1093
|
+
if (isCurrentDetailFilterDisabled.value) return
|
|
819
1094
|
const preset = SIZE_PRESETS.find(p => p.id === id)
|
|
820
1095
|
if (!preset || id === '' || filterParams.sizePresetId === id) {
|
|
821
1096
|
filterParams.sizePresetId = ''
|
|
@@ -830,10 +1105,11 @@ function selectSizePresetFilter(id: '' | 'hd' | 'fhd' | 'qhd' | 'uhd') {
|
|
|
830
1105
|
customMinWidthInput.value = preset.minWidth ? String(preset.minWidth) : ''
|
|
831
1106
|
customMinHeightInput.value = preset.minHeight ? String(preset.minHeight) : ''
|
|
832
1107
|
}
|
|
833
|
-
|
|
1108
|
+
triggerFilterChange()
|
|
834
1109
|
}
|
|
835
1110
|
|
|
836
1111
|
function handleCustomSizeInput() {
|
|
1112
|
+
if (isCurrentDetailFilterDisabled.value) return
|
|
837
1113
|
const wVal = parseInt(customMinWidthInput.value, 10)
|
|
838
1114
|
const hVal = parseInt(customMinHeightInput.value, 10)
|
|
839
1115
|
filterParams.minWidth = !Number.isNaN(wVal) && wVal > 0 ? wVal : undefined
|
|
@@ -850,7 +1126,7 @@ function handleCustomSizeInput() {
|
|
|
850
1126
|
|
|
851
1127
|
if (customSizeDebounceTimer) clearTimeout(customSizeDebounceTimer)
|
|
852
1128
|
customSizeDebounceTimer = setTimeout(() => {
|
|
853
|
-
|
|
1129
|
+
triggerFilterChange()
|
|
854
1130
|
}, 380)
|
|
855
1131
|
}
|
|
856
1132
|
|
|
@@ -864,11 +1140,12 @@ function clearAllFilters() {
|
|
|
864
1140
|
filterParams.minHeight = undefined
|
|
865
1141
|
customMinWidthInput.value = ''
|
|
866
1142
|
customMinHeightInput.value = ''
|
|
867
|
-
|
|
1143
|
+
triggerFilterChange()
|
|
868
1144
|
}
|
|
869
1145
|
|
|
870
1146
|
// 从图二点击「查看全部」进入图三(保留当前搜索词与筛选条件)
|
|
871
1147
|
async function openCategoryDetail(subType: StockSubType) {
|
|
1148
|
+
stopInlineAudio()
|
|
872
1149
|
const cat = overviewCategories.find(c => c.subType === subType)
|
|
873
1150
|
filterParams.activeSubType = subType
|
|
874
1151
|
const q = overviewQuery.value.trim()
|
|
@@ -897,6 +1174,7 @@ function clearOverviewQuery() {
|
|
|
897
1174
|
|
|
898
1175
|
// 图三点击左上角返回箭头回到图二
|
|
899
1176
|
function backToOverview() {
|
|
1177
|
+
stopInlineAudio()
|
|
900
1178
|
filterPopoverOpen.value = false
|
|
901
1179
|
viewMode.value = 'overview'
|
|
902
1180
|
fetchAllOverviewCategories(overviewQuery.value)
|
|
@@ -909,6 +1187,12 @@ const loading = ref(false)
|
|
|
909
1187
|
const pagedMaterials = ref<MaterialItem[]>([])
|
|
910
1188
|
const currentPage = ref(1)
|
|
911
1189
|
const pageSize = 24
|
|
1190
|
+
const brokenImgMap = ref<Record<string, boolean>>({})
|
|
1191
|
+
|
|
1192
|
+
function markMaterialImgBroken(id?: string | number) {
|
|
1193
|
+
if (id === undefined || id === null) return
|
|
1194
|
+
brokenImgMap.value[String(id)] = true
|
|
1195
|
+
}
|
|
912
1196
|
|
|
913
1197
|
const loadingMore = ref(false)
|
|
914
1198
|
const loadFailed = ref(false)
|
|
@@ -936,12 +1220,8 @@ async function fetchMaterials(page = 1, append = false) {
|
|
|
936
1220
|
params.append('current', String(page))
|
|
937
1221
|
params.append('size', String(pageSize))
|
|
938
1222
|
params.append('subType', filterParams.activeSubType)
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
if (q) {
|
|
942
|
-
params.append('keyword', q)
|
|
943
|
-
}
|
|
944
|
-
appendStockFilterParams(params)
|
|
1223
|
+
params.append('keyword', resolveEffectiveKeyword(filterParams.query, filterParams.activeSubType))
|
|
1224
|
+
appendStockFilterParams(params, filterParams.activeSubType)
|
|
945
1225
|
|
|
946
1226
|
const fullUrl = `${stockUrl}${stockUrl.includes('?') ? '&' : '?'}${params.toString()}`
|
|
947
1227
|
const data = await safeFetchJson(fullUrl, {
|
|
@@ -1004,14 +1284,20 @@ const waterfallColumns = computed<[MaterialItem[], MaterialItem[]]>(() => {
|
|
|
1004
1284
|
|
|
1005
1285
|
displayedMaterials.value.forEach((item, idx) => {
|
|
1006
1286
|
let ratio = 0.75
|
|
1007
|
-
|
|
1008
|
-
const h = Number(item.originalHeight || item.height)
|
|
1009
|
-
if (w > 0 && h > 0) {
|
|
1010
|
-
ratio = Math.max(0.45, Math.min(1.8, h / w))
|
|
1011
|
-
} else if (idx % 3 === 1) {
|
|
1012
|
-
ratio = 1.25
|
|
1013
|
-
} else if (idx % 4 === 2) {
|
|
1287
|
+
if (isAudioMaterial(item)) {
|
|
1014
1288
|
ratio = 0.65
|
|
1289
|
+
} else if (isIconMaterial(item)) {
|
|
1290
|
+
ratio = 1
|
|
1291
|
+
} else {
|
|
1292
|
+
const w = Number(item.originalWidth || item.width)
|
|
1293
|
+
const h = Number(item.originalHeight || item.height)
|
|
1294
|
+
if (w > 0 && h > 0) {
|
|
1295
|
+
ratio = Math.max(0.45, Math.min(1.8, h / w))
|
|
1296
|
+
} else if (idx % 3 === 1) {
|
|
1297
|
+
ratio = 1.25
|
|
1298
|
+
} else if (idx % 4 === 2) {
|
|
1299
|
+
ratio = 0.65
|
|
1300
|
+
}
|
|
1015
1301
|
}
|
|
1016
1302
|
|
|
1017
1303
|
if (leftHeight <= rightHeight) {
|
|
@@ -1049,9 +1335,10 @@ function formatMaterialTitle(title?: string, fallback = '素材', maxLen = 12):
|
|
|
1049
1335
|
return text.length > maxLen ? `${text.slice(0, maxLen)}...` : text
|
|
1050
1336
|
}
|
|
1051
1337
|
|
|
1052
|
-
//
|
|
1338
|
+
// 点击素材卡片插入画布(区分音频、视频与图片/矢量/插画/图标,若当前处于图片占位符替换状态则优先替换占位符)
|
|
1053
1339
|
function handleSelectMaterial(meta: MaterialItem) {
|
|
1054
|
-
const
|
|
1340
|
+
const isAud = isAudioMaterial(meta)
|
|
1341
|
+
const isVid = !isAud && isVideoMaterial(meta)
|
|
1055
1342
|
const targetUrl = meta.sourceUrl || meta.url || meta.downloadUrl || meta.previewUrl
|
|
1056
1343
|
|
|
1057
1344
|
if (!targetUrl) {
|
|
@@ -1059,6 +1346,17 @@ function handleSelectMaterial(meta: MaterialItem) {
|
|
|
1059
1346
|
return
|
|
1060
1347
|
}
|
|
1061
1348
|
|
|
1349
|
+
if (isAud) {
|
|
1350
|
+
stopInlineAudio()
|
|
1351
|
+
addElement('audio', targetUrl)
|
|
1352
|
+
const audioTypeLabel =
|
|
1353
|
+
meta.subType === 'Sound_Effects' || meta.assetSubType === 'Sound_Effects'
|
|
1354
|
+
? '音效'
|
|
1355
|
+
: '背景音乐'
|
|
1356
|
+
notify(`已成功添加${audioTypeLabel} "${formatMaterialTitle(meta.title, audioTypeLabel, 12)}" 到画布`)
|
|
1357
|
+
return
|
|
1358
|
+
}
|
|
1359
|
+
|
|
1062
1360
|
const rawW = meta.originalWidth || meta.width
|
|
1063
1361
|
const rawH = meta.originalHeight || meta.height
|
|
1064
1362
|
|
|
@@ -1089,7 +1387,9 @@ function handleSelectMaterial(meta: MaterialItem) {
|
|
|
1089
1387
|
}
|
|
1090
1388
|
|
|
1091
1389
|
let initialDimensions: { width?: number; height?: number } | undefined = undefined
|
|
1092
|
-
if (
|
|
1390
|
+
if (isIconMaterial(meta)) {
|
|
1391
|
+
initialDimensions = { width: 120, height: 120 }
|
|
1392
|
+
} else if (rawW && rawH && rawW > 0 && rawH > 0) {
|
|
1093
1393
|
const maxWidth = 480
|
|
1094
1394
|
const maxHeight = 360
|
|
1095
1395
|
const scale = Math.min(maxWidth / rawW, maxHeight / rawH, 1)
|
|
@@ -1104,11 +1404,12 @@ function handleSelectMaterial(meta: MaterialItem) {
|
|
|
1104
1404
|
notify(`已成功添加视频 "${formatMaterialTitle(meta.title, '高清视频', 12)}" 到画布`)
|
|
1105
1405
|
} else {
|
|
1106
1406
|
addElement('image', targetUrl, undefined, undefined, undefined, initialDimensions)
|
|
1107
|
-
notify(`已成功添加素材 "${formatMaterialTitle(meta.title, '图片', 12)}" 到画布`)
|
|
1407
|
+
notify(`已成功添加素材 "${formatMaterialTitle(meta.title, isIconMaterial(meta) ? '图标' : '图片', 12)}" 到画布`)
|
|
1108
1408
|
}
|
|
1109
1409
|
}
|
|
1110
1410
|
|
|
1111
1411
|
function handleCloseDrawer() {
|
|
1412
|
+
stopInlineAudio()
|
|
1112
1413
|
activeTab.value = null
|
|
1113
1414
|
}
|
|
1114
1415
|
|
|
@@ -1139,10 +1440,22 @@ onMounted(() => {
|
|
|
1139
1440
|
})
|
|
1140
1441
|
|
|
1141
1442
|
onUnmounted(() => {
|
|
1443
|
+
stopInlineAudio()
|
|
1444
|
+
trackResizeObserver?.disconnect()
|
|
1142
1445
|
window.removeEventListener('keydown', handleKeydown)
|
|
1143
1446
|
window.removeEventListener('mousedown', handleGlobalMouseDown, true)
|
|
1144
1447
|
})
|
|
1145
1448
|
|
|
1449
|
+
watch(
|
|
1450
|
+
[() => materialPopoverVisible?.value, () => activeTab?.value, () => activeMainTab.value, () => viewMode.value],
|
|
1451
|
+
() => {
|
|
1452
|
+
nextTick(() => {
|
|
1453
|
+
updateAllRowScrollStates()
|
|
1454
|
+
setTimeout(() => updateAllRowScrollStates(), 140)
|
|
1455
|
+
})
|
|
1456
|
+
}
|
|
1457
|
+
)
|
|
1458
|
+
|
|
1146
1459
|
watch([() => materialApiUrl?.value, () => materialPageApiUrl?.value, () => materialTreeApiUrl?.value], () => {
|
|
1147
1460
|
fetchAllOverviewCategories()
|
|
1148
1461
|
if (viewMode.value === 'detail') {
|
|
@@ -1260,14 +1573,14 @@ watch([() => materialApiUrl?.value, () => materialPageApiUrl?.value, () => mater
|
|
|
1260
1573
|
<!-- 顶部共用搜索框 + 筛选按钮 + 已选标签条 + 悬浮复合筛选面板 -->
|
|
1261
1574
|
<div class="stock-search-filter-header">
|
|
1262
1575
|
<div class="stock-search-bar-wrapper">
|
|
1263
|
-
<div class="stock-search-box" :class="{ 'is-filter-open': filterPopoverOpen }">
|
|
1576
|
+
<div class="stock-search-box" :class="{ 'is-filter-open': filterPopoverOpen && !isCurrentDetailFilterDisabled }">
|
|
1264
1577
|
<el-icon class="stock-search-icon" @click="handleOverviewSearch">
|
|
1265
1578
|
<Search />
|
|
1266
1579
|
</el-icon>
|
|
1267
1580
|
<input
|
|
1268
1581
|
v-model="overviewQuery"
|
|
1269
1582
|
type="text"
|
|
1270
|
-
placeholder="
|
|
1583
|
+
placeholder="搜索图片、插画、图标、视频、音乐、音效..."
|
|
1271
1584
|
class="stock-search-input"
|
|
1272
1585
|
@keyup.enter="handleOverviewSearch"
|
|
1273
1586
|
/>
|
|
@@ -1284,8 +1597,12 @@ watch([() => materialApiUrl?.value, () => materialPageApiUrl?.value, () => mater
|
|
|
1284
1597
|
<button
|
|
1285
1598
|
type="button"
|
|
1286
1599
|
class="stock-filter-trigger-btn"
|
|
1287
|
-
:
|
|
1288
|
-
|
|
1600
|
+
:disabled="isCurrentDetailFilterDisabled"
|
|
1601
|
+
:class="{
|
|
1602
|
+
'is-active': !isCurrentDetailFilterDisabled && (filterPopoverOpen || activeFilterCount > 0),
|
|
1603
|
+
'is-disabled': isCurrentDetailFilterDisabled
|
|
1604
|
+
}"
|
|
1605
|
+
:title="isCurrentDetailFilterDisabled ? '高清视频、背景音乐、音效不支持该筛选条件' : '筛选条件'"
|
|
1289
1606
|
@click.stop="toggleFilterPopover()"
|
|
1290
1607
|
>
|
|
1291
1608
|
<svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
|
|
@@ -1296,14 +1613,14 @@ watch([() => materialApiUrl?.value, () => materialPageApiUrl?.value, () => mater
|
|
|
1296
1613
|
<line x1="4" y1="18" x2="20" y2="18" />
|
|
1297
1614
|
<circle cx="10" cy="18" r="2" fill="#fff" />
|
|
1298
1615
|
</svg>
|
|
1299
|
-
<span v-if="activeFilterCount > 0" class="stock-filter-count-dot">
|
|
1616
|
+
<span v-if="!isCurrentDetailFilterDisabled && activeFilterCount > 0" class="stock-filter-count-dot">
|
|
1300
1617
|
{{ activeFilterCount }}
|
|
1301
1618
|
</span>
|
|
1302
1619
|
</button>
|
|
1303
1620
|
</div>
|
|
1304
1621
|
|
|
1305
1622
|
<!-- 已选筛选条件胶囊条 -->
|
|
1306
|
-
<div v-if="activeFilterCount > 0" class="stock-active-filter-chips">
|
|
1623
|
+
<div v-if="!isCurrentDetailFilterDisabled && activeFilterCount > 0" class="stock-active-filter-chips">
|
|
1307
1624
|
<div
|
|
1308
1625
|
v-if="filterParams.color"
|
|
1309
1626
|
class="stock-filter-chip"
|
|
@@ -1354,8 +1671,11 @@ watch([() => materialApiUrl?.value, () => materialPageApiUrl?.value, () => mater
|
|
|
1354
1671
|
</div>
|
|
1355
1672
|
|
|
1356
1673
|
<!-- 悬浮复合筛选面板 Popover -->
|
|
1357
|
-
<div v-if="filterPopoverOpen" class="stock-filter-popover" @click.stop>
|
|
1674
|
+
<div v-if="filterPopoverOpen && !isCurrentDetailFilterDisabled" class="stock-filter-popover" @click.stop>
|
|
1358
1675
|
<div class="stock-filter-popover-body">
|
|
1676
|
+
<div class="stock-filter-scope-tip">
|
|
1677
|
+
<span>仅对矢量图、照片、插画、图标生效(对视频、音乐、音效不生效)</span>
|
|
1678
|
+
</div>
|
|
1359
1679
|
<!-- 1. 颜色 -->
|
|
1360
1680
|
<div class="stock-filter-section">
|
|
1361
1681
|
<div class="stock-filter-section-header">
|
|
@@ -1516,8 +1836,8 @@ watch([() => materialApiUrl?.value, () => materialPageApiUrl?.value, () => mater
|
|
|
1516
1836
|
|
|
1517
1837
|
<!-- 图二:素材库分类概览视图 -->
|
|
1518
1838
|
<div v-if="viewMode === 'overview'" class="material-overview-body">
|
|
1519
|
-
<!--
|
|
1520
|
-
<div class="overview-sections-scroll">
|
|
1839
|
+
<!-- 7大固定分类横向预览列表(Vectors / Photos / Illustrations / Videos / Icons / Music / Sound_Effects) -->
|
|
1840
|
+
<div class="overview-sections-scroll" @scroll.passive="updateAllRowScrollStates">
|
|
1521
1841
|
<div
|
|
1522
1842
|
v-for="cat in overviewCategories"
|
|
1523
1843
|
:key="cat.key"
|
|
@@ -1530,7 +1850,7 @@ watch([() => materialApiUrl?.value, () => materialPageApiUrl?.value, () => mater
|
|
|
1530
1850
|
</button>
|
|
1531
1851
|
</div>
|
|
1532
1852
|
|
|
1533
|
-
<div class="section-carousel-container">
|
|
1853
|
+
<div class="section-carousel-container" @mouseenter="updateRowScrollState(cat.key)">
|
|
1534
1854
|
<div
|
|
1535
1855
|
:ref="el => setRowRef(cat.key, el)"
|
|
1536
1856
|
class="section-carousel-track"
|
|
@@ -1547,29 +1867,105 @@ watch([() => materialApiUrl?.value, () => materialPageApiUrl?.value, () => mater
|
|
|
1547
1867
|
v-for="(item, idx) in overviewItemsMap[cat.key]"
|
|
1548
1868
|
:key="item.id || idx"
|
|
1549
1869
|
class="overview-thumb-card"
|
|
1870
|
+
:class="{
|
|
1871
|
+
'is-icon-card': cat.subType === 'Icons' || isIconMaterial(item),
|
|
1872
|
+
'is-audio-card': cat.subType === 'Music' || cat.subType === 'Sound_Effects' || isAudioMaterial(item)
|
|
1873
|
+
}"
|
|
1550
1874
|
@click.stop="handleSelectMaterial(item)"
|
|
1551
1875
|
>
|
|
1876
|
+
<!-- 音频/音效横向卡片 -->
|
|
1877
|
+
<div
|
|
1878
|
+
v-if="cat.subType === 'Music' || cat.subType === 'Sound_Effects' || isAudioMaterial(item)"
|
|
1879
|
+
class="overview-audio-inner"
|
|
1880
|
+
:class="{
|
|
1881
|
+
'is-sfx': cat.subType === 'Sound_Effects' || item.assetSubType === 'Sound_Effects' || item.subType === 'Sound_Effects',
|
|
1882
|
+
'is-playing': playingAudioId === item.id
|
|
1883
|
+
}"
|
|
1884
|
+
>
|
|
1885
|
+
<div class="overview-audio-top">
|
|
1886
|
+
<button
|
|
1887
|
+
type="button"
|
|
1888
|
+
class="audio-play-toggle-btn"
|
|
1889
|
+
:title="playingAudioId === item.id ? '暂停试听' : '试听音频'"
|
|
1890
|
+
@click.stop="toggleInlineAudioPlay(item, $event)"
|
|
1891
|
+
>
|
|
1892
|
+
<svg
|
|
1893
|
+
v-if="playingAudioId === item.id"
|
|
1894
|
+
viewBox="0 0 24 24"
|
|
1895
|
+
width="12"
|
|
1896
|
+
height="12"
|
|
1897
|
+
fill="currentColor"
|
|
1898
|
+
>
|
|
1899
|
+
<rect x="6" y="5" width="4" height="14" rx="1" />
|
|
1900
|
+
<rect x="14" y="5" width="4" height="14" rx="1" />
|
|
1901
|
+
</svg>
|
|
1902
|
+
<svg
|
|
1903
|
+
v-else
|
|
1904
|
+
viewBox="0 0 24 24"
|
|
1905
|
+
width="12"
|
|
1906
|
+
height="12"
|
|
1907
|
+
fill="currentColor"
|
|
1908
|
+
>
|
|
1909
|
+
<polygon points="7 4 20 12 7 20 7 4" />
|
|
1910
|
+
</svg>
|
|
1911
|
+
</button>
|
|
1912
|
+
<div class="audio-wave-bars" :class="{ active: playingAudioId === item.id }">
|
|
1913
|
+
<span></span>
|
|
1914
|
+
<span></span>
|
|
1915
|
+
<span></span>
|
|
1916
|
+
<span></span>
|
|
1917
|
+
<span></span>
|
|
1918
|
+
</div>
|
|
1919
|
+
<span class="audio-duration-tag">
|
|
1920
|
+
{{ formatAudioDuration(item.duration) || (cat.subType === 'Sound_Effects' ? 'SFX' : 'BGM') }}
|
|
1921
|
+
</span>
|
|
1922
|
+
</div>
|
|
1923
|
+
<div class="overview-audio-title" :title="item.title">
|
|
1924
|
+
{{ item.title || cat.label }}
|
|
1925
|
+
</div>
|
|
1926
|
+
</div>
|
|
1927
|
+
|
|
1928
|
+
<!-- 视频卡片 -->
|
|
1552
1929
|
<VideoCoverThumb
|
|
1553
|
-
v-if="cat.subType === 'Videos' || isVideoMaterial(item) || isVideoUrl(getMaterialThumb(item))"
|
|
1930
|
+
v-else-if="cat.subType === 'Videos' || isVideoMaterial(item) || isVideoUrl(getMaterialThumb(item))"
|
|
1554
1931
|
:video-url="item.sourceUrl || item.url || getMaterialThumb(item)"
|
|
1555
1932
|
:cover-url="item.coverUrl || item.image || item.thumbnail || (!isVideoUrl(item.previewUrl) ? item.previewUrl : '')"
|
|
1556
1933
|
:alt="item.title || cat.label"
|
|
1557
1934
|
class="overview-thumb-img"
|
|
1558
1935
|
@loaded="updateRowScrollState(cat.key)"
|
|
1559
1936
|
/>
|
|
1937
|
+
|
|
1938
|
+
<!-- 图片 / 矢量 / 插画 / 图标卡片 -->
|
|
1560
1939
|
<img
|
|
1561
|
-
v-else-if="getMaterialThumb(item)"
|
|
1940
|
+
v-else-if="getMaterialThumb(item) && !brokenImgMap[item.id]"
|
|
1562
1941
|
:src="getMaterialThumb(item)"
|
|
1563
|
-
|
|
1942
|
+
alt=""
|
|
1564
1943
|
loading="lazy"
|
|
1565
1944
|
class="overview-thumb-img"
|
|
1945
|
+
:class="{ 'is-icon-img': cat.subType === 'Icons' || isIconMaterial(item) }"
|
|
1566
1946
|
@load="updateRowScrollState(cat.key)"
|
|
1947
|
+
@error="markMaterialImgBroken(item.id)"
|
|
1567
1948
|
/>
|
|
1949
|
+
<div v-else class="detail-card-placeholder">
|
|
1950
|
+
<svg viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="#94a3b8" stroke-width="1.5">
|
|
1951
|
+
<rect x="3" y="3" width="18" height="18" rx="2" ry="2" />
|
|
1952
|
+
<circle cx="8.5" cy="8.5" r="1.5" />
|
|
1953
|
+
<polyline points="21 15 16 10 5 21" />
|
|
1954
|
+
</svg>
|
|
1955
|
+
</div>
|
|
1568
1956
|
<span v-if="cat.subType === 'Videos' || isVideoMaterial(item)" class="video-badge-icon">
|
|
1569
1957
|
<el-icon><VideoPlay /></el-icon>
|
|
1570
1958
|
</span>
|
|
1571
1959
|
<button
|
|
1572
|
-
v-if="
|
|
1960
|
+
v-if="
|
|
1961
|
+
isDamLoggedIn &&
|
|
1962
|
+
cat.subType !== 'Videos' &&
|
|
1963
|
+
cat.subType !== 'Music' &&
|
|
1964
|
+
cat.subType !== 'Sound_Effects' &&
|
|
1965
|
+
!isVideoMaterial(item) &&
|
|
1966
|
+
!isAudioMaterial(item) &&
|
|
1967
|
+
getMaterialThumb(item)
|
|
1968
|
+
"
|
|
1573
1969
|
type="button"
|
|
1574
1970
|
class="overview-card-ref-btn"
|
|
1575
1971
|
title="作为参考图发送到「AI生成」"
|
|
@@ -1635,21 +2031,86 @@ watch([() => materialApiUrl?.value, () => materialPageApiUrl?.value, () => mater
|
|
|
1635
2031
|
v-for="(item, idx) in colItems"
|
|
1636
2032
|
:key="item.id || idx"
|
|
1637
2033
|
class="detail-masonry-card"
|
|
2034
|
+
:class="{
|
|
2035
|
+
'is-icon-card': filterParams.activeSubType === 'Icons' || isIconMaterial(item),
|
|
2036
|
+
'is-audio-card': filterParams.activeSubType === 'Music' || filterParams.activeSubType === 'Sound_Effects' || isAudioMaterial(item)
|
|
2037
|
+
}"
|
|
1638
2038
|
@click.stop="handleSelectMaterial(item)"
|
|
1639
2039
|
>
|
|
2040
|
+
<!-- 详情页音频/音效卡片 -->
|
|
2041
|
+
<div
|
|
2042
|
+
v-if="filterParams.activeSubType === 'Music' || filterParams.activeSubType === 'Sound_Effects' || isAudioMaterial(item)"
|
|
2043
|
+
class="detail-audio-inner"
|
|
2044
|
+
:class="{
|
|
2045
|
+
'is-sfx': filterParams.activeSubType === 'Sound_Effects' || item.assetSubType === 'Sound_Effects' || item.subType === 'Sound_Effects',
|
|
2046
|
+
'is-playing': playingAudioId === item.id
|
|
2047
|
+
}"
|
|
2048
|
+
>
|
|
2049
|
+
<div class="detail-audio-header">
|
|
2050
|
+
<button
|
|
2051
|
+
type="button"
|
|
2052
|
+
class="audio-play-toggle-btn"
|
|
2053
|
+
:title="playingAudioId === item.id ? '暂停试听' : '点击试听'"
|
|
2054
|
+
@click.stop="toggleInlineAudioPlay(item, $event)"
|
|
2055
|
+
>
|
|
2056
|
+
<svg
|
|
2057
|
+
v-if="playingAudioId === item.id"
|
|
2058
|
+
viewBox="0 0 24 24"
|
|
2059
|
+
width="13"
|
|
2060
|
+
height="13"
|
|
2061
|
+
fill="currentColor"
|
|
2062
|
+
>
|
|
2063
|
+
<rect x="6" y="5" width="4" height="14" rx="1" />
|
|
2064
|
+
<rect x="14" y="5" width="4" height="14" rx="1" />
|
|
2065
|
+
</svg>
|
|
2066
|
+
<svg
|
|
2067
|
+
v-else
|
|
2068
|
+
viewBox="0 0 24 24"
|
|
2069
|
+
width="13"
|
|
2070
|
+
height="13"
|
|
2071
|
+
fill="currentColor"
|
|
2072
|
+
>
|
|
2073
|
+
<polygon points="7 4 20 12 7 20 7 4" />
|
|
2074
|
+
</svg>
|
|
2075
|
+
</button>
|
|
2076
|
+
<div class="audio-wave-bars" :class="{ active: playingAudioId === item.id }">
|
|
2077
|
+
<span></span>
|
|
2078
|
+
<span></span>
|
|
2079
|
+
<span></span>
|
|
2080
|
+
<span></span>
|
|
2081
|
+
<span></span>
|
|
2082
|
+
<span></span>
|
|
2083
|
+
</div>
|
|
2084
|
+
</div>
|
|
2085
|
+
<div class="detail-audio-title" :title="item.title">
|
|
2086
|
+
{{ item.title || subTypeNameMap[filterParams.activeSubType] }}
|
|
2087
|
+
</div>
|
|
2088
|
+
<div class="detail-audio-meta">
|
|
2089
|
+
<span class="detail-audio-badge">{{ getItemFormat(item) }}</span>
|
|
2090
|
+
<span v-if="formatAudioDuration(item.duration)" class="detail-audio-dur">
|
|
2091
|
+
{{ formatAudioDuration(item.duration) }}
|
|
2092
|
+
</span>
|
|
2093
|
+
</div>
|
|
2094
|
+
</div>
|
|
2095
|
+
|
|
2096
|
+
<!-- 详情页视频卡片 -->
|
|
1640
2097
|
<VideoCoverThumb
|
|
1641
|
-
v-if="filterParams.activeSubType === 'Videos' || isVideoMaterial(item) || isVideoUrl(getMaterialThumb(item))"
|
|
2098
|
+
v-else-if="filterParams.activeSubType === 'Videos' || isVideoMaterial(item) || isVideoUrl(getMaterialThumb(item))"
|
|
1642
2099
|
:video-url="item.sourceUrl || item.url || getMaterialThumb(item)"
|
|
1643
2100
|
:cover-url="item.coverUrl || item.image || item.thumbnail || (!isVideoUrl(item.previewUrl) ? item.previewUrl : '')"
|
|
1644
2101
|
:alt="item.title || '素材'"
|
|
1645
2102
|
class="detail-card-img"
|
|
1646
2103
|
/>
|
|
2104
|
+
|
|
2105
|
+
<!-- 详情页图片 / 矢量 / 插画 / 图标卡片 -->
|
|
1647
2106
|
<img
|
|
1648
|
-
v-else-if="getMaterialThumb(item)"
|
|
2107
|
+
v-else-if="getMaterialThumb(item) && !brokenImgMap[item.id]"
|
|
1649
2108
|
:src="getMaterialThumb(item)"
|
|
1650
|
-
|
|
2109
|
+
alt=""
|
|
1651
2110
|
loading="lazy"
|
|
1652
2111
|
class="detail-card-img"
|
|
2112
|
+
:class="{ 'is-icon-img': filterParams.activeSubType === 'Icons' || isIconMaterial(item) }"
|
|
2113
|
+
@error="markMaterialImgBroken(item.id)"
|
|
1653
2114
|
/>
|
|
1654
2115
|
<div v-else class="detail-card-placeholder">
|
|
1655
2116
|
<svg viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="#94a3b8" stroke-width="1.5">
|
|
@@ -1657,6 +2118,7 @@ watch([() => materialApiUrl?.value, () => materialPageApiUrl?.value, () => mater
|
|
|
1657
2118
|
<circle cx="8.5" cy="8.5" r="1.5" />
|
|
1658
2119
|
<polyline points="21 15 16 10 5 21" />
|
|
1659
2120
|
</svg>
|
|
2121
|
+
<span style="font-size: 11px; color: #94a3b8; margin-top: 4px;">图片已失效</span>
|
|
1660
2122
|
</div>
|
|
1661
2123
|
|
|
1662
2124
|
<span v-if="filterParams.activeSubType === 'Videos' || isVideoMaterial(item)" class="video-badge-icon">
|
|
@@ -1665,7 +2127,15 @@ watch([() => materialApiUrl?.value, () => materialPageApiUrl?.value, () => mater
|
|
|
1665
2127
|
|
|
1666
2128
|
<!-- 悬浮设为参考图按钮 -->
|
|
1667
2129
|
<button
|
|
1668
|
-
v-if="
|
|
2130
|
+
v-if="
|
|
2131
|
+
isDamLoggedIn &&
|
|
2132
|
+
filterParams.activeSubType !== 'Videos' &&
|
|
2133
|
+
filterParams.activeSubType !== 'Music' &&
|
|
2134
|
+
filterParams.activeSubType !== 'Sound_Effects' &&
|
|
2135
|
+
!isVideoMaterial(item) &&
|
|
2136
|
+
!isAudioMaterial(item) &&
|
|
2137
|
+
getMaterialThumb(item)
|
|
2138
|
+
"
|
|
1669
2139
|
type="button"
|
|
1670
2140
|
class="detail-card-ref-btn"
|
|
1671
2141
|
title="作为参考图发送到「AI生成」"
|
|
@@ -1676,10 +2146,10 @@ watch([() => materialApiUrl?.value, () => materialPageApiUrl?.value, () => mater
|
|
|
1676
2146
|
|
|
1677
2147
|
<!-- 悬浮预览小按钮 -->
|
|
1678
2148
|
<button
|
|
1679
|
-
v-if="getMaterialThumb(item)"
|
|
2149
|
+
v-if="getMaterialThumb(item) || isAudioMaterial(item)"
|
|
1680
2150
|
type="button"
|
|
1681
2151
|
class="detail-card-preview-btn"
|
|
1682
|
-
title="大图预览"
|
|
2152
|
+
:title="isAudioMaterial(item) ? '全屏试听' : '大图预览'"
|
|
1683
2153
|
@click.stop.prevent="openPreview(item, $event)"
|
|
1684
2154
|
>
|
|
1685
2155
|
<el-icon><View /></el-icon>
|
|
@@ -1788,8 +2258,27 @@ watch([() => materialApiUrl?.value, () => materialPageApiUrl?.value, () => mater
|
|
|
1788
2258
|
</button>
|
|
1789
2259
|
|
|
1790
2260
|
<div class="preview-stage-viewport" @click.self="closePreview">
|
|
2261
|
+
<div
|
|
2262
|
+
v-if="currentPreviewItem?.isAudio && currentPreviewItem?.url"
|
|
2263
|
+
class="preview-audio-stage-card"
|
|
2264
|
+
>
|
|
2265
|
+
<div class="preview-audio-disc">
|
|
2266
|
+
<svg viewBox="0 0 24 24" width="38" height="38" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
2267
|
+
<path d="M9 18V5l12-2v13" />
|
|
2268
|
+
<circle cx="6" cy="18" r="3" />
|
|
2269
|
+
<circle cx="18" cy="16" r="3" />
|
|
2270
|
+
</svg>
|
|
2271
|
+
</div>
|
|
2272
|
+
<div class="preview-audio-stage-title">{{ currentPreviewItem.title }}</div>
|
|
2273
|
+
<audio
|
|
2274
|
+
:src="currentPreviewItem.url"
|
|
2275
|
+
controls
|
|
2276
|
+
autoplay
|
|
2277
|
+
class="preview-stage-audio-el"
|
|
2278
|
+
/>
|
|
2279
|
+
</div>
|
|
1791
2280
|
<video
|
|
1792
|
-
v-if="currentPreviewItem?.isVideo && currentPreviewItem?.url"
|
|
2281
|
+
v-else-if="currentPreviewItem?.isVideo && currentPreviewItem?.url"
|
|
1793
2282
|
:src="currentPreviewItem.url"
|
|
1794
2283
|
controls
|
|
1795
2284
|
autoplay
|
|
@@ -1797,11 +2286,20 @@ watch([() => materialApiUrl?.value, () => materialPageApiUrl?.value, () => mater
|
|
|
1797
2286
|
class="preview-stage-img"
|
|
1798
2287
|
/>
|
|
1799
2288
|
<img
|
|
1800
|
-
v-else-if="currentPreviewItem?.url"
|
|
2289
|
+
v-else-if="currentPreviewItem?.url && !brokenImgMap['preview_' + currentPreviewItem.url]"
|
|
1801
2290
|
:src="currentPreviewItem.url"
|
|
1802
|
-
|
|
2291
|
+
alt=""
|
|
1803
2292
|
class="preview-stage-img"
|
|
2293
|
+
@error="markMaterialImgBroken('preview_' + currentPreviewItem.url)"
|
|
1804
2294
|
/>
|
|
2295
|
+
<div v-else class="detail-card-placeholder" style="width: 320px; height: 220px; border-radius: 12px; background: rgba(30, 41, 59, 0.7);">
|
|
2296
|
+
<svg viewBox="0 0 24 24" width="36" height="36" fill="none" stroke="#94a3b8" stroke-width="1.5">
|
|
2297
|
+
<rect x="3" y="3" width="18" height="18" rx="2" ry="2" />
|
|
2298
|
+
<circle cx="8.5" cy="8.5" r="1.5" />
|
|
2299
|
+
<polyline points="21 15 16 10 5 21" />
|
|
2300
|
+
</svg>
|
|
2301
|
+
<span style="font-size: 13px; color: #94a3b8; margin-top: 8px;">图片已失效</span>
|
|
2302
|
+
</div>
|
|
1805
2303
|
</div>
|
|
1806
2304
|
|
|
1807
2305
|
<div class="preview-footer-bar">
|
|
@@ -2096,7 +2594,7 @@ watch([() => materialApiUrl?.value, () => materialPageApiUrl?.value, () => mater
|
|
|
2096
2594
|
transition: all 0.15s;
|
|
2097
2595
|
flex-shrink: 0;
|
|
2098
2596
|
|
|
2099
|
-
&:hover {
|
|
2597
|
+
&:hover:not(.is-disabled) {
|
|
2100
2598
|
color: #1e293b;
|
|
2101
2599
|
}
|
|
2102
2600
|
|
|
@@ -2104,6 +2602,12 @@ watch([() => materialApiUrl?.value, () => materialPageApiUrl?.value, () => mater
|
|
|
2104
2602
|
background: transparent;
|
|
2105
2603
|
color: #2563eb;
|
|
2106
2604
|
}
|
|
2605
|
+
|
|
2606
|
+
&.is-disabled {
|
|
2607
|
+
color: #cbd5e1;
|
|
2608
|
+
cursor: not-allowed;
|
|
2609
|
+
opacity: 0.55;
|
|
2610
|
+
}
|
|
2107
2611
|
}
|
|
2108
2612
|
|
|
2109
2613
|
.stock-filter-count-dot {
|
|
@@ -2215,6 +2719,17 @@ watch([() => materialApiUrl?.value, () => materialPageApiUrl?.value, () => mater
|
|
|
2215
2719
|
}
|
|
2216
2720
|
}
|
|
2217
2721
|
|
|
2722
|
+
.stock-filter-scope-tip {
|
|
2723
|
+
margin-bottom: 12px;
|
|
2724
|
+
padding: 5px 8px;
|
|
2725
|
+
border-radius: 6px;
|
|
2726
|
+
background: #f8fafc;
|
|
2727
|
+
border: 1px solid #e2e8f0;
|
|
2728
|
+
font-size: 11px;
|
|
2729
|
+
line-height: 1.4;
|
|
2730
|
+
color: #64748b;
|
|
2731
|
+
}
|
|
2732
|
+
|
|
2218
2733
|
.stock-filter-section {
|
|
2219
2734
|
margin-bottom: 14px;
|
|
2220
2735
|
|
|
@@ -2665,6 +3180,24 @@ watch([() => materialApiUrl?.value, () => materialPageApiUrl?.value, () => mater
|
|
|
2665
3180
|
cursor: pointer;
|
|
2666
3181
|
position: relative;
|
|
2667
3182
|
|
|
3183
|
+
&.is-icon-card {
|
|
3184
|
+
width: 84px;
|
|
3185
|
+
border: 1px solid #f1f5f9;
|
|
3186
|
+
background-color: #f8fafc;
|
|
3187
|
+
background-image:
|
|
3188
|
+
linear-gradient(45deg, #f1f5f9 25%, transparent 25%),
|
|
3189
|
+
linear-gradient(-45deg, #f1f5f9 25%, transparent 25%),
|
|
3190
|
+
linear-gradient(45deg, transparent 75%, #f1f5f9 75%),
|
|
3191
|
+
linear-gradient(-45deg, transparent 75%, #f1f5f9 75%);
|
|
3192
|
+
background-size: 12px 12px;
|
|
3193
|
+
background-position: 0 0, 0 6px, 6px -6px, -6px 0;
|
|
3194
|
+
}
|
|
3195
|
+
|
|
3196
|
+
&.is-audio-card {
|
|
3197
|
+
width: 146px;
|
|
3198
|
+
height: 84px;
|
|
3199
|
+
}
|
|
3200
|
+
|
|
2668
3201
|
&:hover .overview-thumb-img {
|
|
2669
3202
|
transform: scale(1.04);
|
|
2670
3203
|
}
|
|
@@ -2705,6 +3238,152 @@ watch([() => materialApiUrl?.value, () => materialPageApiUrl?.value, () => mater
|
|
|
2705
3238
|
display: block;
|
|
2706
3239
|
border-radius: 8px;
|
|
2707
3240
|
transition: transform 0.25s ease;
|
|
3241
|
+
|
|
3242
|
+
&.is-icon-img {
|
|
3243
|
+
width: 84px;
|
|
3244
|
+
height: 84px;
|
|
3245
|
+
min-width: 84px;
|
|
3246
|
+
max-width: 84px;
|
|
3247
|
+
object-fit: contain;
|
|
3248
|
+
padding: 16px;
|
|
3249
|
+
box-sizing: border-box;
|
|
3250
|
+
}
|
|
3251
|
+
}
|
|
3252
|
+
|
|
3253
|
+
/* 概览与详情音频卡片样式 */
|
|
3254
|
+
.overview-audio-inner {
|
|
3255
|
+
width: 100%;
|
|
3256
|
+
height: 100%;
|
|
3257
|
+
padding: 10px 10px 8px;
|
|
3258
|
+
box-sizing: border-box;
|
|
3259
|
+
display: flex;
|
|
3260
|
+
flex-direction: column;
|
|
3261
|
+
justify-content: space-between;
|
|
3262
|
+
background: linear-gradient(135deg, #eff6ff 0%, #e0e7ff 100%);
|
|
3263
|
+
border: 1px solid #dbeafe;
|
|
3264
|
+
border-radius: 8px;
|
|
3265
|
+
transition: all 0.18s ease;
|
|
3266
|
+
|
|
3267
|
+
&.is-sfx {
|
|
3268
|
+
background: linear-gradient(135deg, #f0fdfa 0%, #e0f2fe 100%);
|
|
3269
|
+
border-color: #ccfbf1;
|
|
3270
|
+
}
|
|
3271
|
+
|
|
3272
|
+
&.is-playing {
|
|
3273
|
+
border-color: #3b82f6;
|
|
3274
|
+
box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.28);
|
|
3275
|
+
}
|
|
3276
|
+
|
|
3277
|
+
&:hover {
|
|
3278
|
+
filter: brightness(0.98);
|
|
3279
|
+
}
|
|
3280
|
+
}
|
|
3281
|
+
|
|
3282
|
+
.overview-audio-top {
|
|
3283
|
+
display: flex;
|
|
3284
|
+
align-items: center;
|
|
3285
|
+
justify-content: space-between;
|
|
3286
|
+
gap: 6px;
|
|
3287
|
+
}
|
|
3288
|
+
|
|
3289
|
+
.audio-play-toggle-btn {
|
|
3290
|
+
width: 26px;
|
|
3291
|
+
height: 26px;
|
|
3292
|
+
border-radius: 50%;
|
|
3293
|
+
border: none;
|
|
3294
|
+
background: #2563eb;
|
|
3295
|
+
color: #ffffff;
|
|
3296
|
+
display: inline-flex;
|
|
3297
|
+
align-items: center;
|
|
3298
|
+
justify-content: center;
|
|
3299
|
+
cursor: pointer;
|
|
3300
|
+
flex-shrink: 0;
|
|
3301
|
+
padding: 0;
|
|
3302
|
+
box-shadow: 0 2px 6px rgba(37, 99, 235, 0.28);
|
|
3303
|
+
transition: transform 0.15s ease, background 0.15s ease;
|
|
3304
|
+
|
|
3305
|
+
&:hover {
|
|
3306
|
+
background: #1d4ed8;
|
|
3307
|
+
transform: scale(1.08);
|
|
3308
|
+
}
|
|
3309
|
+
}
|
|
3310
|
+
|
|
3311
|
+
.is-sfx .audio-play-toggle-btn {
|
|
3312
|
+
background: #0d9488;
|
|
3313
|
+
box-shadow: 0 2px 6px rgba(13, 148, 136, 0.26);
|
|
3314
|
+
|
|
3315
|
+
&:hover {
|
|
3316
|
+
background: #0f766e;
|
|
3317
|
+
}
|
|
3318
|
+
}
|
|
3319
|
+
|
|
3320
|
+
.audio-wave-bars {
|
|
3321
|
+
display: inline-flex;
|
|
3322
|
+
align-items: center;
|
|
3323
|
+
gap: 2.5px;
|
|
3324
|
+
height: 16px;
|
|
3325
|
+
flex: 1;
|
|
3326
|
+
justify-content: center;
|
|
3327
|
+
|
|
3328
|
+
span {
|
|
3329
|
+
display: inline-block;
|
|
3330
|
+
width: 2.5px;
|
|
3331
|
+
border-radius: 2px;
|
|
3332
|
+
background: #60a5fa;
|
|
3333
|
+
transition: height 0.2s ease;
|
|
3334
|
+
|
|
3335
|
+
&:nth-child(1) { height: 6px; }
|
|
3336
|
+
&:nth-child(2) { height: 12px; }
|
|
3337
|
+
&:nth-child(3) { height: 8px; }
|
|
3338
|
+
&:nth-child(4) { height: 14px; }
|
|
3339
|
+
&:nth-child(5) { height: 7px; }
|
|
3340
|
+
&:nth-child(6) { height: 10px; }
|
|
3341
|
+
}
|
|
3342
|
+
|
|
3343
|
+
&.active span {
|
|
3344
|
+
background: #2563eb;
|
|
3345
|
+
animation: audioWavePulse 0.75s ease-in-out infinite alternate;
|
|
3346
|
+
|
|
3347
|
+
&:nth-child(2) { animation-delay: 0.12s; }
|
|
3348
|
+
&:nth-child(3) { animation-delay: 0.24s; }
|
|
3349
|
+
&:nth-child(4) { animation-delay: 0.08s; }
|
|
3350
|
+
&:nth-child(5) { animation-delay: 0.2s; }
|
|
3351
|
+
&:nth-child(6) { animation-delay: 0.3s; }
|
|
3352
|
+
}
|
|
3353
|
+
}
|
|
3354
|
+
|
|
3355
|
+
.is-sfx .audio-wave-bars span {
|
|
3356
|
+
background: #2dd4bf;
|
|
3357
|
+
}
|
|
3358
|
+
|
|
3359
|
+
.is-sfx .audio-wave-bars.active span {
|
|
3360
|
+
background: #0d9488;
|
|
3361
|
+
}
|
|
3362
|
+
|
|
3363
|
+
@keyframes audioWavePulse {
|
|
3364
|
+
0% { height: 4px; }
|
|
3365
|
+
100% { height: 15px; }
|
|
3366
|
+
}
|
|
3367
|
+
|
|
3368
|
+
.audio-duration-tag {
|
|
3369
|
+
font-size: 10px;
|
|
3370
|
+
font-weight: 600;
|
|
3371
|
+
color: #475569;
|
|
3372
|
+
background: rgba(255, 255, 255, 0.75);
|
|
3373
|
+
padding: 1px 5px;
|
|
3374
|
+
border-radius: 4px;
|
|
3375
|
+
flex-shrink: 0;
|
|
3376
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace;
|
|
3377
|
+
}
|
|
3378
|
+
|
|
3379
|
+
.overview-audio-title {
|
|
3380
|
+
font-size: 11.5px;
|
|
3381
|
+
font-weight: 500;
|
|
3382
|
+
color: #1e293b;
|
|
3383
|
+
white-space: nowrap;
|
|
3384
|
+
overflow: hidden;
|
|
3385
|
+
text-overflow: ellipsis;
|
|
3386
|
+
line-height: 1.3;
|
|
2708
3387
|
}
|
|
2709
3388
|
|
|
2710
3389
|
.video-badge-icon {
|
|
@@ -2816,6 +3495,23 @@ watch([() => materialApiUrl?.value, () => materialPageApiUrl?.value, () => mater
|
|
|
2816
3495
|
background: #f1f5f9;
|
|
2817
3496
|
cursor: pointer;
|
|
2818
3497
|
|
|
3498
|
+
&.is-icon-card {
|
|
3499
|
+
aspect-ratio: 1 / 1;
|
|
3500
|
+
border: 1px solid #f1f5f9;
|
|
3501
|
+
background-color: #f8fafc;
|
|
3502
|
+
background-image:
|
|
3503
|
+
linear-gradient(45deg, #f1f5f9 25%, transparent 25%),
|
|
3504
|
+
linear-gradient(-45deg, #f1f5f9 25%, transparent 25%),
|
|
3505
|
+
linear-gradient(45deg, transparent 75%, #f1f5f9 75%),
|
|
3506
|
+
linear-gradient(-45deg, transparent 75%, #f1f5f9 75%);
|
|
3507
|
+
background-size: 14px 14px;
|
|
3508
|
+
background-position: 0 0, 0 7px, 7px -7px, -7px 0;
|
|
3509
|
+
}
|
|
3510
|
+
|
|
3511
|
+
&.is-audio-card {
|
|
3512
|
+
background: transparent;
|
|
3513
|
+
}
|
|
3514
|
+
|
|
2819
3515
|
&:hover .detail-card-img {
|
|
2820
3516
|
transform: scale(1.03);
|
|
2821
3517
|
}
|
|
@@ -2826,6 +3522,76 @@ watch([() => materialApiUrl?.value, () => materialPageApiUrl?.value, () => mater
|
|
|
2826
3522
|
}
|
|
2827
3523
|
}
|
|
2828
3524
|
|
|
3525
|
+
.detail-audio-inner {
|
|
3526
|
+
width: 100%;
|
|
3527
|
+
padding: 10px 10px 9px;
|
|
3528
|
+
box-sizing: border-box;
|
|
3529
|
+
display: flex;
|
|
3530
|
+
flex-direction: column;
|
|
3531
|
+
gap: 7px;
|
|
3532
|
+
background: linear-gradient(135deg, #eff6ff 0%, #e0e7ff 100%);
|
|
3533
|
+
border: 1px solid #dbeafe;
|
|
3534
|
+
border-radius: 8px;
|
|
3535
|
+
transition: all 0.18s ease;
|
|
3536
|
+
|
|
3537
|
+
&.is-sfx {
|
|
3538
|
+
background: linear-gradient(135deg, #f0fdfa 0%, #e0f2fe 100%);
|
|
3539
|
+
border-color: #ccfbf1;
|
|
3540
|
+
}
|
|
3541
|
+
|
|
3542
|
+
&.is-playing {
|
|
3543
|
+
border-color: #3b82f6;
|
|
3544
|
+
box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.3);
|
|
3545
|
+
}
|
|
3546
|
+
}
|
|
3547
|
+
|
|
3548
|
+
.detail-audio-header {
|
|
3549
|
+
display: flex;
|
|
3550
|
+
align-items: center;
|
|
3551
|
+
gap: 8px;
|
|
3552
|
+
padding-right: 22px;
|
|
3553
|
+
}
|
|
3554
|
+
|
|
3555
|
+
.detail-audio-title {
|
|
3556
|
+
font-size: 12px;
|
|
3557
|
+
font-weight: 600;
|
|
3558
|
+
color: #1e293b;
|
|
3559
|
+
line-height: 1.35;
|
|
3560
|
+
display: -webkit-box;
|
|
3561
|
+
-webkit-line-clamp: 2;
|
|
3562
|
+
-webkit-box-orient: vertical;
|
|
3563
|
+
overflow: hidden;
|
|
3564
|
+
word-break: break-word;
|
|
3565
|
+
}
|
|
3566
|
+
|
|
3567
|
+
.detail-audio-meta {
|
|
3568
|
+
display: flex;
|
|
3569
|
+
align-items: center;
|
|
3570
|
+
justify-content: space-between;
|
|
3571
|
+
gap: 6px;
|
|
3572
|
+
}
|
|
3573
|
+
|
|
3574
|
+
.detail-audio-badge {
|
|
3575
|
+
font-size: 9.5px;
|
|
3576
|
+
font-weight: 700;
|
|
3577
|
+
color: #2563eb;
|
|
3578
|
+
background: rgba(255, 255, 255, 0.85);
|
|
3579
|
+
padding: 1px 5px;
|
|
3580
|
+
border-radius: 4px;
|
|
3581
|
+
letter-spacing: 0.3px;
|
|
3582
|
+
}
|
|
3583
|
+
|
|
3584
|
+
.is-sfx .detail-audio-badge {
|
|
3585
|
+
color: #0d9488;
|
|
3586
|
+
}
|
|
3587
|
+
|
|
3588
|
+
.detail-audio-dur {
|
|
3589
|
+
font-size: 10.5px;
|
|
3590
|
+
font-weight: 500;
|
|
3591
|
+
color: #64748b;
|
|
3592
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace;
|
|
3593
|
+
}
|
|
3594
|
+
|
|
2829
3595
|
.detail-card-ref-btn {
|
|
2830
3596
|
position: absolute;
|
|
2831
3597
|
left: 6px;
|
|
@@ -2857,13 +3623,28 @@ watch([() => materialApiUrl?.value, () => materialPageApiUrl?.value, () => mater
|
|
|
2857
3623
|
display: block;
|
|
2858
3624
|
border-radius: 8px;
|
|
2859
3625
|
transition: transform 0.25s ease;
|
|
3626
|
+
|
|
3627
|
+
&.is-icon-img {
|
|
3628
|
+
width: 100%;
|
|
3629
|
+
height: 100%;
|
|
3630
|
+
min-height: 84px;
|
|
3631
|
+
max-height: none;
|
|
3632
|
+
object-fit: contain;
|
|
3633
|
+
padding: 18%;
|
|
3634
|
+
box-sizing: border-box;
|
|
3635
|
+
}
|
|
2860
3636
|
}
|
|
2861
3637
|
|
|
2862
3638
|
.detail-card-placeholder {
|
|
2863
|
-
|
|
3639
|
+
width: 100%;
|
|
3640
|
+
min-width: 96px;
|
|
3641
|
+
height: 96px;
|
|
2864
3642
|
display: flex;
|
|
3643
|
+
flex-direction: column;
|
|
2865
3644
|
align-items: center;
|
|
2866
3645
|
justify-content: center;
|
|
3646
|
+
background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
|
|
3647
|
+
border-radius: 8px;
|
|
2867
3648
|
}
|
|
2868
3649
|
|
|
2869
3650
|
.detail-card-preview-btn {
|
|
@@ -3103,6 +3884,48 @@ watch([() => materialApiUrl?.value, () => materialPageApiUrl?.value, () => mater
|
|
|
3103
3884
|
transition: transform 0.25s ease;
|
|
3104
3885
|
}
|
|
3105
3886
|
|
|
3887
|
+
.preview-audio-stage-card {
|
|
3888
|
+
width: min(440px, 88vw);
|
|
3889
|
+
padding: 32px 28px 28px;
|
|
3890
|
+
border-radius: 18px;
|
|
3891
|
+
background: rgba(30, 41, 59, 0.88);
|
|
3892
|
+
border: 1px solid rgba(255, 255, 255, 0.14);
|
|
3893
|
+
box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
|
|
3894
|
+
display: flex;
|
|
3895
|
+
flex-direction: column;
|
|
3896
|
+
align-items: center;
|
|
3897
|
+
gap: 16px;
|
|
3898
|
+
}
|
|
3899
|
+
|
|
3900
|
+
.preview-audio-disc {
|
|
3901
|
+
width: 78px;
|
|
3902
|
+
height: 78px;
|
|
3903
|
+
border-radius: 50%;
|
|
3904
|
+
background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
|
|
3905
|
+
color: #ffffff;
|
|
3906
|
+
display: flex;
|
|
3907
|
+
align-items: center;
|
|
3908
|
+
justify-content: center;
|
|
3909
|
+
box-shadow: 0 10px 25px rgba(37, 99, 235, 0.45);
|
|
3910
|
+
}
|
|
3911
|
+
|
|
3912
|
+
.preview-audio-stage-title {
|
|
3913
|
+
color: #f8fafc;
|
|
3914
|
+
font-size: 15px;
|
|
3915
|
+
font-weight: 600;
|
|
3916
|
+
text-align: center;
|
|
3917
|
+
max-width: 100%;
|
|
3918
|
+
overflow: hidden;
|
|
3919
|
+
text-overflow: ellipsis;
|
|
3920
|
+
white-space: nowrap;
|
|
3921
|
+
}
|
|
3922
|
+
|
|
3923
|
+
.preview-stage-audio-el {
|
|
3924
|
+
width: 100%;
|
|
3925
|
+
height: 40px;
|
|
3926
|
+
outline: none;
|
|
3927
|
+
}
|
|
3928
|
+
|
|
3106
3929
|
.preview-arrow-btn {
|
|
3107
3930
|
position: absolute;
|
|
3108
3931
|
top: 50%;
|