|
|
@@ -106,7 +106,10 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
- <button class="next-btn" @click="goToStep2">下一步:生成大纲 →</button>
|
|
|
+ <button class="next-btn" :disabled="generatingOutline" @click="goToStep2">
|
|
|
+ <text v-if="generatingOutline">生成大纲中...</text>
|
|
|
+ <text v-else>下一步:生成大纲 →</text>
|
|
|
+ </button>
|
|
|
</view>
|
|
|
|
|
|
<!-- 步骤2:大纲预览 -->
|
|
|
@@ -141,7 +144,10 @@
|
|
|
|
|
|
<view class="btn-row">
|
|
|
<button class="back-btn" @click="currentStep = 0">← 上一步</button>
|
|
|
- <button class="next-btn" @click="goToStep3">下一步:生成内容 →</button>
|
|
|
+ <button class="next-btn" :disabled="generating" @click="goToStep3">
|
|
|
+ <text v-if="generatingCharacters">生成角色中...</text>
|
|
|
+ <text v-else>下一步:生成内容 →</text>
|
|
|
+ </button>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
@@ -330,6 +336,7 @@ const outline = ref<{ title: string; description: string; wordCount: number }[]>
|
|
|
|
|
|
// 角色
|
|
|
const characters = ref<any[]>([]);
|
|
|
+const generatingCharacters = ref(false);
|
|
|
|
|
|
// 内容生成
|
|
|
const generating = ref(false);
|
|
|
@@ -369,12 +376,18 @@ async function goToStep2() {
|
|
|
uni.showToast({ title: '请输入创作主题', icon: 'none' });
|
|
|
return;
|
|
|
}
|
|
|
+ uni.showLoading({ title: '正在生成大纲...' });
|
|
|
await generateOutline();
|
|
|
- currentStep.value = 1;
|
|
|
+ uni.hideLoading();
|
|
|
+ if (outline.value.length > 0) {
|
|
|
+ currentStep.value = 1;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
async function goToStep3() {
|
|
|
+ uni.showLoading({ title: '正在生成角色...' });
|
|
|
await generateCharacters();
|
|
|
+ uni.hideLoading();
|
|
|
currentStep.value = 2;
|
|
|
}
|
|
|
|
|
|
@@ -399,6 +412,7 @@ async function regenerateOutline() {
|
|
|
}
|
|
|
|
|
|
async function generateCharacters() {
|
|
|
+ generatingCharacters.value = true;
|
|
|
try {
|
|
|
const result = await post<any>('/ai-content/characters/generate', {
|
|
|
type: selectedType.value,
|
|
|
@@ -410,6 +424,8 @@ async function generateCharacters() {
|
|
|
{ id: 'char-1', name: '张三', age: 30, gender: '男', personality: '正直勇敢', role: '主角' },
|
|
|
{ id: 'char-2', name: '李四', age: 28, gender: '女', personality: '聪明机智', role: '女主' },
|
|
|
];
|
|
|
+ } finally {
|
|
|
+ generatingCharacters.value = false;
|
|
|
}
|
|
|
}
|
|
|
|