From 86543df75df30016a1d051400105129495ae485f Mon Sep 17 00:00:00 2001 From: Peanut Date: Tue, 30 Jun 2026 07:45:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20currentScriptContent=20=E7=AB=A0?= =?UTF-8?q?=E8=8A=82=E5=AD=97=E6=AE=B5=E5=85=A8=E7=A9=BA=E6=97=B6=E7=94=A8?= =?UTF-8?q?=20plotJson.fullContent=20=E4=BD=9C=E4=B8=BA=20fallback?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mini-program/src/pages/main/ScriptView.vue | 23 +++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) 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)