diff --git a/mini-program/src/pages/main/ScriptView.vue b/mini-program/src/pages/main/ScriptView.vue index 4c93da4..8a4f44f 100644 --- a/mini-program/src/pages/main/ScriptView.vue +++ b/mini-program/src/pages/main/ScriptView.vue @@ -619,20 +619,33 @@ const resultHasScriptReplies = computed(() => { const currentScriptContent = computed(() => { const targetId = selectedVersionMessageId.value || currentVersionMessageId.value const targetMessage = messages.value.find(m => m.id === targetId && m.type === 'script') + let result if (!targetMessage || !targetMessage.metadata) { - return { + result = { title: currentResult.value?.title || '', plotIntro: currentResult.value?.plotIntro || '', plotTurning: currentResult.value?.plotTurning || '', plotClimax: currentResult.value?.plotClimax || '', plotEnding: currentResult.value?.plotEnding || '' } + } else { + try { + result = JSON.parse(targetMessage.metadata) + } catch (e) { + result = { title: '', plotIntro: targetMessage.metadata || '' } + } } - try { - return JSON.parse(targetMessage.metadata) - } catch (e) { - return { title: '', plotIntro: targetMessage.metadata || '' } + + // 章节字段全空时,用 plotJson.fullContent 作为 fallback + const hasChapter = result.plotIntro || result.plotTurning || result.plotClimax || result.plotEnding + if (!hasChapter) { + const fullContent = currentResult.value?.plotJson?.fullContent || '' + if (fullContent) { + result.plotIntro = fullContent + } } + + return result }) const displayMessages = computed(() => messages.value)