diff --git a/mini-program/src/pages/main/ScriptLibraryView.vue b/mini-program/src/pages/main/ScriptLibraryView.vue index e6f3733..578d1d8 100644 --- a/mini-program/src/pages/main/ScriptLibraryView.vue +++ b/mini-program/src/pages/main/ScriptLibraryView.vue @@ -235,7 +235,18 @@ const getTags = (script) => { return [] } -const getChapterCount = (script) => script.chapterCount || script.chapters || 0 +const getChapterCount = (script) => { + // 优先从 beats 数组长度获取(Task 1-5 部署后新剧本结构) + const beats = script?.plotJson?.stages?.outline?.beats + if (Array.isArray(beats) && beats.length > 0) return beats.length + + // Fallback:根据 length 字段估算(老剧本无 beats 数据) + const length = script?.length + if (length === 'short') return 1 + if (length === 'medium') return 2 + if (length === 'long') return 4 + return 1 +} const getWordCount = (script) => { const count = Number(script.wordCount || 0)