feat:ScriptLibraryView 新增大纲预览行
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -86,6 +86,10 @@
|
||||
<text v-for="tag in getTags(script)" :key="tag" class="tag">{{ tag }}</text>
|
||||
</view>
|
||||
|
||||
<view v-if="getOutlinePreview(script)" class="outline-preview-row">
|
||||
<text class="outline-preview-text">{{ getOutlinePreview(script) }}</text>
|
||||
</view>
|
||||
|
||||
<text class="summary">{{ script.summary || script.content || '一段正在生成中的平行人生剧本。' }}</text>
|
||||
|
||||
<view class="meta-row">
|
||||
@@ -249,6 +253,20 @@ const getProgress = (script) => Math.max(0, Math.min(99, Number(script.progress
|
||||
|
||||
const getInitial = (script) => (script.title || '剧').slice(0, 1)
|
||||
|
||||
/**
|
||||
* 获取大纲预览文本(前 2 章标题)
|
||||
* 数据来源:script.plotJson.stages.outline.beats
|
||||
*/
|
||||
const getOutlinePreview = (script) => {
|
||||
const beats = script?.plotJson?.stages?.outline?.beats
|
||||
if (!Array.isArray(beats) || beats.length === 0) return ''
|
||||
const parts = beats.slice(0, 2).map((beat, i) => {
|
||||
const title = beat.title || ''
|
||||
return `第${i + 1}章:${title}`
|
||||
})
|
||||
return `📋 ${parts.join(' · ')}`
|
||||
}
|
||||
|
||||
const isFavorite = (script) => {
|
||||
return Boolean(favoriteStatus.value[String(script.id)])
|
||||
}
|
||||
@@ -795,6 +813,19 @@ const confirmDeleteScript = async () => {
|
||||
background: rgba(149, 55, 255, 0.2);
|
||||
}
|
||||
|
||||
.outline-preview-row {
|
||||
margin-top: 10rpx;
|
||||
padding: 10rpx 14rpx;
|
||||
border-radius: 14rpx;
|
||||
background: rgba(168, 85, 247, 0.08);
|
||||
border: 1rpx solid rgba(168, 85, 247, 0.16);
|
||||
}
|
||||
.outline-preview-text {
|
||||
font-size: 22rpx;
|
||||
color: rgba(193, 134, 255, 0.88);
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.summary {
|
||||
display: -webkit-box;
|
||||
margin-top: 14rpx;
|
||||
|
||||
Reference in New Issue
Block a user