diff --git a/mini-program/src/pages/main/ScriptView.vue b/mini-program/src/pages/main/ScriptView.vue index bb54a19..c9f9cd6 100644 --- a/mini-program/src/pages/main/ScriptView.vue +++ b/mini-program/src/pages/main/ScriptView.vue @@ -183,7 +183,28 @@ - {{ msg.content }}| + {{ getMessageDisplayContent(msg) }} + | + + + + {{ isMessageCollapsed(msg) ? '展开全文' : '收起全文' }} + + + + + + + + + + + @@ -1444,7 +1465,10 @@ const normalizeGeneratedContent = (text) => { const openScriptChat = async (payload = {}) => { uni.removeStorageSync(PENDING_SCRIPT_CHAT_KEY) const scriptIdParam = String(payload?.id || payload?.scriptId || '') - let script = payload?.script || (payload?.id ? payload : null) + // 优先使用 payload 中携带的完整 script 对象;否则按 id 从 store 取完整数据 + // 修复:payload 只有 id 时,直接用 payload 会导致 conversationId/plotJson 等字段缺失, + // 进而 loadMessages 不会被调用,详情页内容为空 + let script = payload?.script || null if (!script?.id && scriptIdParam) { script = store.getScriptById(scriptIdParam) if (!script) { @@ -4069,4 +4093,107 @@ onUnmounted(() => { 50% { opacity: 0; } } +/* 折叠/展开按钮行 */ +.collapse-toggle-row { + display: flex; + align-items: center; + justify-content: center; + gap: 12rpx; + margin-top: 20rpx; + padding: 16rpx 0; + border-radius: 999rpx; + background: rgba(88, 28, 135, 0.12); + border: 1rpx solid rgba(192, 132, 252, 0.28); + color: rgba(246, 230, 255, 0.96); + font-size: 26rpx; + font-weight: 700; +} + +.collapse-toggle-row:active { + transform: scale(0.98); + opacity: 0.92; +} + +.collapse-toggle-text { + line-height: 1; +} + +/* 折叠箭头图标 */ +.collapse-chevron { + position: relative; + width: 20rpx; + height: 16rpx; + flex-shrink: 0; + transition: transform 0.18s ease; +} + +.collapse-chevron.down { + transform: rotate(180deg); +} + +.collapse-chevron view { + position: absolute; + top: 7rpx; + width: 12rpx; + height: 4rpx; + border-radius: 999rpx; + background: linear-gradient(90deg, #fff3b0, #ffd86b); + box-shadow: 0 0 12rpx rgba(255, 216, 107, 0.5); +} + +.collapse-chevron view:first-child { + left: 0; + transform: rotate(-38deg); + transform-origin: right center; +} + +.collapse-chevron view:last-child { + right: 0; + transform: rotate(38deg); + transform-origin: left center; +} + +/* 操作按钮组 */ +.message-actions { + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); + gap: 14rpx; + margin-top: 20rpx; +} + +.action-btn { + height: 72rpx; + min-height: 72rpx; + padding: 0 8rpx; + border-radius: 28rpx; + display: flex; + align-items: center; + justify-content: center; + color: #e8ccff; + font-size: 26rpx; + font-weight: 700; + line-height: 1.15; + text-align: center; + white-space: normal; + box-sizing: border-box; + background: rgba(88, 28, 135, 0.18); + border: 1rpx solid rgba(192, 132, 252, 0.35); +} + +.action-btn.primary { + color: #fff; + background: linear-gradient(145deg, #8c44f2, #5f1db8); +} + +.action-icon { + margin-right: 8rpx; + font-size: 24rpx; + font-weight: 900; + line-height: 1; +} + +.action-btn::after { + border: 0; +} +