Skip to content

🎬 火宝短剧 - 基于AI的一站式短剧生成平台 《一句话生成完整短剧,从剧本到成片全自动化》 Huobao Drama - An AI-Powered End-to-End Short Drama Generator "One Sentence to Complete Drama: Fully Automated from Script to Final Video"

TypeScript

feat(episode): 剧集列表卡片点击直接添加集

Connor309589ef5365
diff --git a/frontend/app/pages/drama/[id]/index.vue b/frontend/app/pages/drama/[id]/index.vue
index c986ca8..e7038e9 100644
--- a/frontend/app/pages/drama/[id]/index.vue
+++ b/frontend/app/pages/drama/[id]/index.vue
@@ -134,8 +134,8 @@
</div>
</div>
- <!-- Empty episode state -->
- <div v-if="!drama.episodes?.length" class="card ep-empty">
+ <!-- Empty episode state(点击也可直接添加第一集) -->
+ <div v-if="!drama.episodes?.length" class="card ep-empty" role="button" tabindex="0" title="点击创建第一集" @click="openAddEpisode" @keydown.enter="openAddEpisode">
<div class="ep-empty-icon">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round">
<circle cx="12" cy="12" r="10"/>
@@ -143,7 +143,19 @@
<line x1="8" y1="12" x2="16" y2="12"/>
</svg>
</div>
- <p>点击上方「添加集」创建第一集</p>
+ <p>点击创建第一集</p>
+ </div>
+
+ <!-- 已有剧集时,列表末尾常驻「添加下一集」卡片 -->
+ <div v-else class="card ep-empty ep-add" role="button" tabindex="0" :title="`添加第 ${(drama.episodes?.length || 0) + 1} 集`" @click="openAddEpisode" @keydown.enter="openAddEpisode">
+ <div class="ep-empty-icon">
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round">
+ <circle cx="12" cy="12" r="10"/>
+ <line x1="12" y1="8" x2="12" y2="16"/>
+ <line x1="8" y1="12" x2="16" y2="12"/>
+ </svg>
+ </div>
+ <p>添加第 {{ (drama.episodes?.length || 0) + 1 }} 集</p>
</div>
</div>
@@ -199,7 +211,7 @@
<div class="character-asset-main">
<div class="character-asset-overview">
<div class="character-portrait">
- <img v-if="matHasImage(m)" :src="assetSrc(m)" class="previewable-image" @click.stop="openAssetViewer(m)" />
+ <img v-if="matHasImage(m)" :src="thumbOf(assetSrc(m))" class="previewable-image" loading="lazy" @error="thumbFallback($event, assetSrc(m))" @click.stop="openAssetViewer(m)" />
<div v-else class="character-portrait-empty">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>
</div>
@@ -245,7 +257,7 @@
@keydown.space.prevent="openEdit(m)"
>
<div class="asset-cover wide">
- <img v-if="matHasImage(m)" :src="assetSrc(m)" class="previewable-image" @click.stop="openAssetViewer(m)" />
+ <img v-if="matHasImage(m)" :src="thumbOf(assetSrc(m))" class="previewable-image" loading="lazy" @error="thumbFallback($event, assetSrc(m))" @click.stop="openAssetViewer(m)" />
<div v-else class="asset-cover-empty">
<svg v-if="g.kindKey === 'scene'" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"/><circle cx="12" cy="10" r="3"/></svg>
<svg v-else width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"><path d="M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"/><polyline points="3.27 6.96 12 12.01 20.73 6.96"/><line x1="12" y1="22.08" x2="12" y2="12"/></svg>
@@ -331,7 +343,7 @@
:disabled="!matHasImage(editTarget)"
@click.stop="openAssetViewer(editTarget)"
>
- <img v-if="matHasImage(editTarget)" :src="assetSrc(editTarget)" />
+ <img v-if="matHasImage(editTarget)" :src="thumbOf(assetSrc(editTarget))" @error="thumbFallback($event, assetSrc(editTarget))" />
<span v-else class="mat-detail-media-empty">
<svg v-if="editTarget.kindKey === 'character'" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>
<svg v-else-if="editTarget.kindKey === 'prop'" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"><path d="M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"/><polyline points="3.27 6.96 12 12.01 20.73 6.96"/><line x1="12" y1="22.08" x2="12" y2="12"/></svg>
@@ -1081,11 +1093,19 @@ onMounted(load)
display: flex; flex-direction: column; align-items: center; gap: 10px;
padding: 48px; text-align: center; color: var(--text-3); font-size: 13px;
border-style: dashed;
+ cursor: pointer;
+ transition: border-color 0.2s, color 0.2s, background 0.2s;
}
+.ep-empty:hover { border-color: var(--accent-text); color: var(--accent-text); background: var(--accent-bg); }
+.ep-empty:hover .ep-empty-icon { transform: scale(1.06); }
+/* 列表末尾的「添加下一集」卡片:与剧集卡片等高、内容居中 */
+.ep-add { justify-content: center; min-height: 150px; padding: 24px; }
+.ep-add .ep-empty-icon { width: 40px; height: 40px; }
.ep-empty-icon {
width: 48px; height: 48px; border-radius: 50%;
background: var(--accent-bg); color: var(--accent-text);
display: flex; align-items: center; justify-content: center;
+ transition: transform 0.2s;
}
/* Create Episode Dialog (on top of global .dialog skeleton) */