style: 优化剧本生成器页面布局(方案 A)
主要变更: - 修复输入框溢出问题,添加 box-sizing: border-box - 重构参数区域为垂直堆叠布局,匹配原型图 - 添加 NPC 容器背景和边框,增强视觉层次 - 优化字体大小和间距,适配移动端屏幕 - 调整圆角尺寸,与原型保持一致 设计文档: docs/plans/2026-03-07-script-view-optimization.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
<template>
|
||||
<view class="script-view">
|
||||
<text class="page-title font-serif">剧本生成器</text>
|
||||
|
||||
|
||||
<view class="section-card glass-card">
|
||||
<view class="section-header">
|
||||
<text class="section-title">我的基础人设</text>
|
||||
<text class="section-hint">可自由修改</text>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="profile-grid">
|
||||
<input
|
||||
class="glass-input"
|
||||
@@ -27,44 +27,46 @@
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="section-card glass-card">
|
||||
|
||||
<view class="section-card glass-card-main">
|
||||
<view class="input-group">
|
||||
<text class="label">剧本主题</text>
|
||||
<input
|
||||
class="glass-input"
|
||||
class="glass-input theme-input"
|
||||
placeholder="如:巅峰重现、治愈之旅、赛博觉醒..."
|
||||
v-model="scriptConfig.theme"
|
||||
/>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="input-group">
|
||||
<view class="npc-header">
|
||||
<text class="label">关键配角/新的人设</text>
|
||||
<button class="add-btn" @click="addNpc">+ 添加</button>
|
||||
</view>
|
||||
|
||||
<view class="npc-form">
|
||||
<input
|
||||
class="glass-input npc-input"
|
||||
placeholder="姓名"
|
||||
v-model="npcConfig.name"
|
||||
|
||||
<view class="npc-container">
|
||||
<view class="npc-form">
|
||||
<input
|
||||
class="glass-input npc-input"
|
||||
placeholder="姓名"
|
||||
v-model="npcConfig.name"
|
||||
/>
|
||||
<picker class="glass-picker npc-picker" mode="selector" :range="npcRoleOptions" :value="npcRoleIndex" @change="onNpcRoleChange">
|
||||
<view class="picker-value">{{ npcConfig.role || '角色' }}</view>
|
||||
</picker>
|
||||
<picker class="glass-picker npc-picker" mode="selector" :range="npcRelationOptions" :value="npcRelationIndex" @change="onNpcRelationChange">
|
||||
<view class="picker-value">{{ npcConfig.relation || '关系' }}</view>
|
||||
</picker>
|
||||
</view>
|
||||
|
||||
<textarea
|
||||
class="glass-textarea"
|
||||
placeholder="自由描述 TA 的人设特点或关键剧情点..."
|
||||
v-model="npcConfig.desc"
|
||||
rows="2"
|
||||
/>
|
||||
<picker class="glass-picker npc-picker" mode="selector" :range="npcRoleOptions" :value="npcRoleIndex" @change="onNpcRoleChange">
|
||||
<view class="picker-value">{{ npcConfig.role || '角色' }}</view>
|
||||
</picker>
|
||||
<picker class="glass-picker npc-picker" mode="selector" :range="npcRelationOptions" :value="npcRelationIndex" @change="onNpcRelationChange">
|
||||
<view class="picker-value">{{ npcConfig.relation || '关系' }}</view>
|
||||
</picker>
|
||||
</view>
|
||||
|
||||
<textarea
|
||||
class="glass-textarea"
|
||||
placeholder="自由描述TA的人设特点或关键剧情点..."
|
||||
v-model="npcConfig.desc"
|
||||
rows="2"
|
||||
/>
|
||||
|
||||
|
||||
<view class="npc-list">
|
||||
<view
|
||||
v-for="(npc, index) in customNpcs"
|
||||
@@ -76,9 +78,9 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="params-row">
|
||||
<view class="param-group">
|
||||
|
||||
<view class="params-section">
|
||||
<view class="param-row">
|
||||
<text class="param-label">叙事风格</text>
|
||||
<view class="param-options">
|
||||
<text
|
||||
@@ -92,8 +94,10 @@
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="param-group">
|
||||
</view>
|
||||
|
||||
<view class="params-section">
|
||||
<view class="param-row">
|
||||
<text class="param-label">故事篇幅</text>
|
||||
<view class="param-options">
|
||||
<text
|
||||
@@ -108,7 +112,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<button
|
||||
class="btn-primary generate-btn"
|
||||
:loading="isGenerating"
|
||||
@@ -119,7 +123,7 @@
|
||||
<text v-else>生成平行人生剧本</text>
|
||||
</button>
|
||||
</view>
|
||||
|
||||
|
||||
<view v-if="scripts.length > 0" class="scripts-list">
|
||||
<view
|
||||
v-for="script in scripts"
|
||||
@@ -131,9 +135,9 @@
|
||||
<text class="script-title">{{ script.title }}</text>
|
||||
<text class="script-persona">{{ script.theme || '追光者' }}</text>
|
||||
</view>
|
||||
|
||||
|
||||
<text class="script-summary" lines="3">{{ getScriptSummary(script) }}</text>
|
||||
|
||||
|
||||
<view class="script-footer">
|
||||
<text class="script-style">{{ script.style || '风格' }}</text>
|
||||
<button class="select-btn" @click="selectScript(script.id)">
|
||||
@@ -142,12 +146,12 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<view v-else-if="!isGenerating" class="empty-state glass-card">
|
||||
<text class="empty-icon">🎬</text>
|
||||
<text class="empty-text">尚未生成剧本,定义你的未来篇章</text>
|
||||
</view>
|
||||
|
||||
|
||||
<view v-if="isGenerating" class="generating-state glass-card">
|
||||
<view class="spinner"></view>
|
||||
<text class="generating-text">正在采集星海中的深紫色碎屑...</text>
|
||||
@@ -233,9 +237,9 @@ const removeNpc = (index) => {
|
||||
|
||||
const generateScript = async () => {
|
||||
if (!scriptConfig.theme || isGenerating.value) return
|
||||
|
||||
|
||||
isGenerating.value = true
|
||||
|
||||
|
||||
try {
|
||||
await store.createScript({
|
||||
theme: scriptConfig.theme,
|
||||
@@ -271,39 +275,44 @@ onMounted(async () => {
|
||||
.script-view {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 32rpx;
|
||||
gap: 24rpx;
|
||||
min-height: 100%;
|
||||
}
|
||||
|
||||
.page-title {
|
||||
font-size: 36rpx;
|
||||
font-weight: 400;
|
||||
font-size: 32rpx;
|
||||
font-weight: 300;
|
||||
color: rgba(255, 255, 255, 0.9);
|
||||
margin-bottom: 8rpx;
|
||||
letter-spacing: 4rpx;
|
||||
}
|
||||
|
||||
.section-card {
|
||||
padding: 24rpx;
|
||||
border-radius: 32rpx;
|
||||
}
|
||||
|
||||
.glass-card-main {
|
||||
padding: 32rpx;
|
||||
border-radius: 48rpx;
|
||||
}
|
||||
|
||||
.section-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 24rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 22rpx;
|
||||
font-size: 18rpx;
|
||||
color: rgba(192, 132, 252, 0.6);
|
||||
font-weight: 600;
|
||||
letter-spacing: 4rpx;
|
||||
letter-spacing: 3rpx;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.section-hint {
|
||||
font-size: 16rpx;
|
||||
font-size: 14rpx;
|
||||
color: rgba(255, 255, 255, 0.35);
|
||||
font-style: italic;
|
||||
}
|
||||
@@ -311,59 +320,73 @@ onMounted(async () => {
|
||||
.profile-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 16rpx;
|
||||
gap: 12rpx;
|
||||
}
|
||||
|
||||
.glass-input, .glass-picker {
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
height: 72rpx;
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
border-radius: 16rpx;
|
||||
padding: 0 24rpx;
|
||||
border-radius: 24rpx;
|
||||
padding: 0 20rpx;
|
||||
color: rgba(255, 255, 255, 0.9);
|
||||
font-size: 26rpx;
|
||||
font-size: 22rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.glass-input::placeholder {
|
||||
color: rgba(255, 255, 255, 0.3);
|
||||
}
|
||||
|
||||
.theme-input {
|
||||
height: 80rpx;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.picker-value {
|
||||
line-height: 80rpx;
|
||||
line-height: 72rpx;
|
||||
color: rgba(255, 255, 255, 0.9);
|
||||
}
|
||||
|
||||
.input-group {
|
||||
margin-bottom: 24rpx;
|
||||
margin-bottom: 28rpx;
|
||||
}
|
||||
|
||||
.label {
|
||||
display: block;
|
||||
font-size: 18rpx;
|
||||
font-size: 16rpx;
|
||||
color: rgba(255, 255, 255, 0.35);
|
||||
font-weight: 600;
|
||||
letter-spacing: 4rpx;
|
||||
letter-spacing: 3rpx;
|
||||
text-transform: uppercase;
|
||||
margin-bottom: 16rpx;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
|
||||
.npc-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 16rpx;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
|
||||
.add-btn {
|
||||
font-size: 20rpx;
|
||||
font-size: 18rpx;
|
||||
color: #C084FC;
|
||||
border: 1px solid rgba(192, 132, 252, 0.3);
|
||||
padding: 8rpx 16rpx;
|
||||
padding: 6rpx 12rpx;
|
||||
border-radius: 12rpx;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.npc-container {
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
border-radius: 32rpx;
|
||||
padding: 24rpx;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
|
||||
.npc-form {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr 1fr;
|
||||
@@ -372,26 +395,26 @@ onMounted(async () => {
|
||||
}
|
||||
|
||||
.npc-input, .npc-picker {
|
||||
height: 72rpx;
|
||||
height: 64rpx;
|
||||
padding: 0 16rpx;
|
||||
font-size: 24rpx;
|
||||
font-size: 20rpx;
|
||||
}
|
||||
|
||||
.npc-picker .picker-value {
|
||||
line-height: 72rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 64rpx;
|
||||
font-size: 20rpx;
|
||||
}
|
||||
|
||||
.glass-textarea {
|
||||
width: 100%;
|
||||
height: 120rpx;
|
||||
height: 100rpx;
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
border-radius: 16rpx;
|
||||
padding: 20rpx;
|
||||
border-radius: 24rpx;
|
||||
padding: 16rpx;
|
||||
color: rgba(255, 255, 255, 0.9);
|
||||
font-size: 24rpx;
|
||||
margin-bottom: 16rpx;
|
||||
font-size: 20rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.npc-list {
|
||||
@@ -414,41 +437,38 @@ onMounted(async () => {
|
||||
|
||||
.delete-btn {
|
||||
color: rgba(255, 255, 255, 0.4);
|
||||
font-size: 28rpx;
|
||||
font-size: 24rpx;
|
||||
padding: 0 4rpx;
|
||||
}
|
||||
|
||||
.params-row {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 24rpx;
|
||||
margin-bottom: 32rpx;
|
||||
.params-section {
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
|
||||
.param-group {
|
||||
.param-row {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12rpx;
|
||||
}
|
||||
|
||||
.param-label {
|
||||
font-size: 18rpx;
|
||||
font-size: 16rpx;
|
||||
color: rgba(255, 255, 255, 0.35);
|
||||
margin-left: 8rpx;
|
||||
margin-left: 4rpx;
|
||||
}
|
||||
|
||||
.param-options {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 12rpx;
|
||||
gap: 8rpx;
|
||||
}
|
||||
|
||||
.param-option {
|
||||
padding: 10rpx 20rpx;
|
||||
padding: 8rpx 16rpx;
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
border-radius: 16rpx;
|
||||
font-size: 22rpx;
|
||||
border-radius: 20rpx;
|
||||
font-size: 18rpx;
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
|
||||
@@ -460,19 +480,21 @@ onMounted(async () => {
|
||||
|
||||
.generate-btn {
|
||||
width: 100%;
|
||||
height: 96rpx;
|
||||
box-shadow: 0 8rpx 40rpx rgba(168, 85, 247, 0.3);
|
||||
height: 88rpx;
|
||||
border-radius: 32rpx;
|
||||
box-shadow: 0 8rpx 32rpx rgba(168, 85, 247, 0.3);
|
||||
}
|
||||
|
||||
.scripts-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 24rpx;
|
||||
gap: 20rpx;
|
||||
}
|
||||
|
||||
.script-card {
|
||||
padding: 32rpx;
|
||||
padding: 24rpx;
|
||||
border-left: 4rpx solid transparent;
|
||||
border-radius: 32rpx;
|
||||
}
|
||||
|
||||
.script-card.selected {
|
||||
@@ -483,30 +505,30 @@ onMounted(async () => {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 16rpx;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
|
||||
.script-title {
|
||||
font-size: 32rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
color: rgba(255, 255, 255, 0.9);
|
||||
}
|
||||
|
||||
.script-persona {
|
||||
font-size: 18rpx;
|
||||
font-size: 16rpx;
|
||||
color: rgba(168, 85, 247, 0.6);
|
||||
background: rgba(168, 85, 247, 0.1);
|
||||
padding: 6rpx 16rpx;
|
||||
padding: 6rpx 12rpx;
|
||||
border-radius: 12rpx;
|
||||
border: 1px solid rgba(168, 85, 247, 0.2);
|
||||
}
|
||||
|
||||
.script-summary {
|
||||
display: block;
|
||||
font-size: 24rpx;
|
||||
font-size: 22rpx;
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
line-height: 1.6;
|
||||
margin-bottom: 24rpx;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
|
||||
.script-footer {
|
||||
@@ -516,48 +538,52 @@ onMounted(async () => {
|
||||
}
|
||||
|
||||
.script-style {
|
||||
font-size: 20rpx;
|
||||
font-size: 18rpx;
|
||||
color: #C084FC;
|
||||
}
|
||||
|
||||
.select-btn {
|
||||
font-size: 24rpx;
|
||||
font-size: 20rpx;
|
||||
color: #C084FC;
|
||||
font-weight: 600;
|
||||
background: transparent;
|
||||
border: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
padding: 80rpx 48rpx;
|
||||
padding: 64rpx 40rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 24rpx;
|
||||
gap: 20rpx;
|
||||
opacity: 0.5;
|
||||
border-radius: 48rpx;
|
||||
}
|
||||
|
||||
.empty-icon {
|
||||
font-size: 64rpx;
|
||||
font-size: 56rpx;
|
||||
}
|
||||
|
||||
.empty-text {
|
||||
font-size: 24rpx;
|
||||
font-size: 22rpx;
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.generating-state {
|
||||
padding: 80rpx 48rpx;
|
||||
padding: 64rpx 40rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 32rpx;
|
||||
gap: 24rpx;
|
||||
border-radius: 48rpx;
|
||||
}
|
||||
|
||||
.spinner {
|
||||
width: 64rpx;
|
||||
height: 64rpx;
|
||||
border: 4rpx solid #A855F7;
|
||||
width: 56rpx;
|
||||
height: 56rpx;
|
||||
border: 3rpx solid #A855F7;
|
||||
border-top-color: transparent;
|
||||
border-radius: 50%;
|
||||
animation: spin 0.8s linear infinite;
|
||||
@@ -569,7 +595,7 @@ onMounted(async () => {
|
||||
}
|
||||
|
||||
.generating-text {
|
||||
font-size: 26rpx;
|
||||
font-size: 24rpx;
|
||||
color: rgba(192, 132, 252, 0.6);
|
||||
font-style: italic;
|
||||
letter-spacing: 2rpx;
|
||||
|
||||
Reference in New Issue
Block a user