From b8dc438cbe29d4e860c43bcdd69ef5d4462c3802 Mon Sep 17 00:00:00 2001 From: Peanut Date: Tue, 7 Apr 2026 22:17:39 +0800 Subject: [PATCH] =?UTF-8?q?fix(mini-program):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=89=A7=E6=9C=AC=E8=AF=A6=E6=83=85=E9=A1=B5=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E5=92=8C=E5=86=85=E5=AE=B9=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 样式修复: - 标题添加 flex:1 和 text-overflow: ellipsis,长文本自动省略 - 标题添加左右 margin,避免与返回按钮重叠 - 返回按钮添加 flex-shrink:0 和 z-index,确保不被压缩 内容显示修复: - 优先读取 script.content 字段(转换后的标准格式) - 兼容 script.plotJson.fullContent 格式(旧数据) --- mini-program/src/pages/main/ScriptDetailView.vue | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/mini-program/src/pages/main/ScriptDetailView.vue b/mini-program/src/pages/main/ScriptDetailView.vue index eb4a313..ad14eaa 100644 --- a/mini-program/src/pages/main/ScriptDetailView.vue +++ b/mini-program/src/pages/main/ScriptDetailView.vue @@ -59,7 +59,10 @@ onMounted(() => { // 从 store 获取剧本详情 if (scriptId) { script.value = scripts.value.find(s => s.id === scriptId) - if (script.value?.plotJson?.fullContent) { + // 优先读取 content 字段(转换后的格式),兼容 plotJson.fullContent + if (script.value?.content) { + fullContent.value = script.value.content + } else if (script.value?.plotJson?.fullContent) { fullContent.value = script.value.plotJson.fullContent } else { fullContent.value = '暂无完整内容' @@ -90,6 +93,7 @@ const goBack = () => { background: rgba(168, 85, 247, 0.1); border-bottom: 1px solid rgba(168, 85, 247, 0.2); flex-shrink: 0; + position: relative; } .header-left { @@ -100,6 +104,8 @@ const goBack = () => { border-radius: 24rpx; background: rgba(168, 85, 247, 0.15); border: 1px solid rgba(168, 85, 247, 0.2); + z-index: 10; + flex-shrink: 0; } .back-icon { @@ -118,6 +124,13 @@ const goBack = () => { font-weight: 500; color: rgba(243, 232, 255, 0.9); font-family: 'Cinzel', 'Inter', serif; + flex: 1; + text-align: center; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + margin-left: 8rpx; + margin-right: 8rpx; } /* ==================== 滚动内容区 ==================== */