|
@@ -84,6 +84,7 @@
|
|
|
<text class="card-title">📝 生成结果</text>
|
|
<text class="card-title">📝 生成结果</text>
|
|
|
<view class="header-actions">
|
|
<view class="header-actions">
|
|
|
<text class="header-action" @click="copyContent">📋 复制</text>
|
|
<text class="header-action" @click="copyContent">📋 复制</text>
|
|
|
|
|
+ <text class="header-action" @click="showDebug = !showDebug">🔧 调试</text>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
@@ -94,6 +95,26 @@
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
|
|
+ <!-- 调试信息(Prompt) -->
|
|
|
|
|
+ <view v-if="showDebug && generatedDebug" class="debug-section">
|
|
|
|
|
+ <view class="debug-header">
|
|
|
|
|
+ <text class="debug-title">🔍 调试信息</text>
|
|
|
|
|
+ <text class="debug-close" @click="showDebug = false">✕</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="debug-item">
|
|
|
|
|
+ <text class="debug-label">用户输入:</text>
|
|
|
|
|
+ <text class="debug-text">{{ generatedDebug.prompt }}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="debug-item">
|
|
|
|
|
+ <text class="debug-label">发送给AI的Prompt:</text>
|
|
|
|
|
+ <text class="debug-text">{{ generatedDebug.finalPrompt }}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="debug-item">
|
|
|
|
|
+ <text class="debug-label">使用模型:</text>
|
|
|
|
|
+ <text class="debug-text">{{ generatedDebug.model }}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
<!-- 生成的内容 -->
|
|
<!-- 生成的内容 -->
|
|
|
<view v-if="generatedContent" class="result-content">
|
|
<view v-if="generatedContent" class="result-content">
|
|
|
<text class="content-text">{{ generatedContent }}</text>
|
|
<text class="content-text">{{ generatedContent }}</text>
|
|
@@ -145,11 +166,13 @@ const targetLength = ref(1000);
|
|
|
const generating = ref(false);
|
|
const generating = ref(false);
|
|
|
const generatingProgress = ref('');
|
|
const generatingProgress = ref('');
|
|
|
const generatedContent = ref('');
|
|
const generatedContent = ref('');
|
|
|
|
|
+const generatedDebug = ref<any>(null); // 调试信息
|
|
|
const currentTaskId = ref('');
|
|
const currentTaskId = ref('');
|
|
|
let pollTimer: ReturnType<typeof setInterval> | null = null;
|
|
let pollTimer: ReturnType<typeof setInterval> | null = null;
|
|
|
|
|
|
|
|
// UI状态
|
|
// UI状态
|
|
|
const showHelp = ref(false);
|
|
const showHelp = ref(false);
|
|
|
|
|
+const showDebug = ref(false); // 是否显示调试信息
|
|
|
|
|
|
|
|
const quickTemplates = [
|
|
const quickTemplates = [
|
|
|
{ label: '朋友圈', text: '发一条朋友圈,分享今天的心情' },
|
|
{ label: '朋友圈', text: '发一条朋友圈,分享今天的心情' },
|
|
@@ -195,6 +218,8 @@ async function pollTaskStatus(taskId: string) {
|
|
|
// 任务完成
|
|
// 任务完成
|
|
|
stopPolling();
|
|
stopPolling();
|
|
|
generatedContent.value = task.result?.content || task.result?.text || '生成内容为空';
|
|
generatedContent.value = task.result?.content || task.result?.text || '生成内容为空';
|
|
|
|
|
+ // 保存调试信息
|
|
|
|
|
+ generatedDebug.value = task.result?.debug || null;
|
|
|
generatingProgress.value = '生成完成';
|
|
generatingProgress.value = '生成完成';
|
|
|
generating.value = false;
|
|
generating.value = false;
|
|
|
uni.hideLoading();
|
|
uni.hideLoading();
|
|
@@ -293,7 +318,9 @@ function reset() {
|
|
|
currentTaskId.value = '';
|
|
currentTaskId.value = '';
|
|
|
currentStep.value = 0;
|
|
currentStep.value = 0;
|
|
|
generatedContent.value = '';
|
|
generatedContent.value = '';
|
|
|
|
|
+ generatedDebug.value = null;
|
|
|
generatingProgress.value = '';
|
|
generatingProgress.value = '';
|
|
|
|
|
+ showDebug.value = false;
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
@@ -376,6 +403,62 @@ function reset() {
|
|
|
color: #4F46E5;
|
|
color: #4F46E5;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+/* 调试信息 */
|
|
|
|
|
+.debug-section {
|
|
|
|
|
+ background: #f3f4f6;
|
|
|
|
|
+ border-radius: 12rpx;
|
|
|
|
|
+ padding: 20rpx;
|
|
|
|
|
+ margin-bottom: 24rpx;
|
|
|
|
|
+ max-height: 400rpx;
|
|
|
|
|
+ overflow-y: auto;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.debug-header {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: space-between;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ margin-bottom: 16rpx;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.debug-title {
|
|
|
|
|
+ font-size: 28rpx;
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ color: #1f2937;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.debug-close {
|
|
|
|
|
+ font-size: 32rpx;
|
|
|
|
|
+ color: #9ca3af;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.debug-item {
|
|
|
|
|
+ margin-bottom: 16rpx;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.debug-item:last-child {
|
|
|
|
|
+ margin-bottom: 0;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.debug-label {
|
|
|
|
|
+ font-size: 24rpx;
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ color: #6b7280;
|
|
|
|
|
+ display: block;
|
|
|
|
|
+ margin-bottom: 8rpx;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.debug-text {
|
|
|
|
|
+ font-size: 22rpx;
|
|
|
|
|
+ color: #374151;
|
|
|
|
|
+ line-height: 1.6;
|
|
|
|
|
+ white-space: pre-wrap;
|
|
|
|
|
+ word-break: break-all;
|
|
|
|
|
+ background: #fff;
|
|
|
|
|
+ padding: 12rpx;
|
|
|
|
|
+ border-radius: 8rpx;
|
|
|
|
|
+ display: block;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
/* 表单 */
|
|
/* 表单 */
|
|
|
.form-item {
|
|
.form-item {
|
|
|
margin-bottom: 32rpx;
|
|
margin-bottom: 32rpx;
|