Add 2 files
Browse files- README.md +6 -4
- index.html +478 -19
README.md
CHANGED
@@ -1,10 +1,12 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
colorFrom: blue
|
5 |
-
colorTo:
|
6 |
sdk: static
|
7 |
pinned: false
|
|
|
|
|
8 |
---
|
9 |
|
10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
---
|
2 |
+
title: financial-question-generator-chinese
|
3 |
+
emoji: 🐳
|
4 |
colorFrom: blue
|
5 |
+
colorTo: yellow
|
6 |
sdk: static
|
7 |
pinned: false
|
8 |
+
tags:
|
9 |
+
- deepsite
|
10 |
---
|
11 |
|
12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
@@ -1,19 +1,478 @@
|
|
1 |
-
<!
|
2 |
-
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="zh-CN">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>金融问题生成器 - Financial Question Generator</title>
|
7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
9 |
+
<style>
|
10 |
+
.category-chip {
|
11 |
+
transition: all 0.3s ease;
|
12 |
+
}
|
13 |
+
.category-chip:hover {
|
14 |
+
transform: translateY(-2px);
|
15 |
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
16 |
+
}
|
17 |
+
.question-card {
|
18 |
+
transition: all 0.3s ease;
|
19 |
+
}
|
20 |
+
.question-card:hover {
|
21 |
+
transform: translateY(-3px);
|
22 |
+
box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
|
23 |
+
}
|
24 |
+
.fade-in {
|
25 |
+
animation: fadeIn 0.5s ease-in;
|
26 |
+
}
|
27 |
+
@keyframes fadeIn {
|
28 |
+
from { opacity: 0; transform: translateY(10px); }
|
29 |
+
to { opacity: 1; transform: translateY(0); }
|
30 |
+
}
|
31 |
+
.progress-bar {
|
32 |
+
transition: width 0.3s ease;
|
33 |
+
}
|
34 |
+
</style>
|
35 |
+
</head>
|
36 |
+
<body class="bg-gray-50 min-h-screen">
|
37 |
+
<div class="container mx-auto px-4 py-8">
|
38 |
+
<!-- Header -->
|
39 |
+
<header class="mb-10 text-center">
|
40 |
+
<h1 class="text-4xl font-bold text-indigo-700 mb-2">金融问题生成器</h1>
|
41 |
+
<p class="text-lg text-gray-600">为金融业务和钱包相关业务生成高质量的中文问题数据集</p>
|
42 |
+
</header>
|
43 |
+
|
44 |
+
<!-- Main Content -->
|
45 |
+
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
|
46 |
+
<!-- Control Panel -->
|
47 |
+
<div class="bg-white rounded-xl shadow-md p-6 lg:col-span-1">
|
48 |
+
<h2 class="text-xl font-semibold text-gray-800 mb-4 flex items-center">
|
49 |
+
<i class="fas fa-sliders-h mr-2 text-indigo-500"></i> 生成设置
|
50 |
+
</h2>
|
51 |
+
|
52 |
+
<!-- Number of Questions -->
|
53 |
+
<div class="mb-6">
|
54 |
+
<label class="block text-sm font-medium text-gray-700 mb-2">问题数量</label>
|
55 |
+
<div class="flex items-center">
|
56 |
+
<input type="number" min="1" max="100" value="10"
|
57 |
+
class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500">
|
58 |
+
<span class="ml-2 text-gray-500">个</span>
|
59 |
+
</div>
|
60 |
+
</div>
|
61 |
+
|
62 |
+
<!-- Difficulty Level -->
|
63 |
+
<div class="mb-6">
|
64 |
+
<label class="block text-sm font-medium text-gray-700 mb-2">难度级别</label>
|
65 |
+
<div class="grid grid-cols-2 gap-2">
|
66 |
+
<button class="difficulty-btn bg-green-100 text-green-800" data-level="simple">简单</button>
|
67 |
+
<button class="difficulty-btn bg-yellow-100 text-yellow-800" data-level="medium">中等</button>
|
68 |
+
<button class="difficulty-btn bg-red-100 text-red-800" data-level="complex">复杂</button>
|
69 |
+
<button class="difficulty-btn bg-gray-100 text-gray-800 active" data-level="random">随机</button>
|
70 |
+
</div>
|
71 |
+
</div>
|
72 |
+
|
73 |
+
<!-- Categories -->
|
74 |
+
<div class="mb-6">
|
75 |
+
<label class="block text-sm font-medium text-gray-700 mb-2">问题分类</label>
|
76 |
+
<div class="flex flex-wrap gap-2">
|
77 |
+
<div class="category-chip bg-blue-100 text-blue-800 px-3 py-1 rounded-full text-sm cursor-pointer active" data-category="all">全部</div>
|
78 |
+
<div class="category-chip bg-purple-100 text-purple-800 px-3 py-1 rounded-full text-sm cursor-pointer" data-category="recharge">充值问题</div>
|
79 |
+
<div class="category-chip bg-green-100 text-green-800 px-3 py-1 rounded-full text-sm cursor-pointer" data-category="transfer">转账问题</div>
|
80 |
+
<div class="category-chip bg-yellow-100 text-yellow-800 px-3 py-1 rounded-full text-sm cursor-pointer" data-category="withdraw">提现问题</div>
|
81 |
+
<div class="category-chip bg-red-100 text-red-800 px-3 py-1 rounded-full text-sm cursor-pointer" data-category="security">账户安全</div>
|
82 |
+
<div class="category-chip bg-indigo-100 text-indigo-800 px-3 py-1 rounded-full text-sm cursor-pointer" data-category="payment">支付问题</div>
|
83 |
+
<div class="category-chip bg-pink-100 text-pink-800 px-3 py-1 rounded-full text-sm cursor-pointer" data-category="card">银行卡管理</div>
|
84 |
+
<div class="category-chip bg-teal-100 text-teal-800 px-3 py-1 rounded-full text-sm cursor-pointer" data-category="bill">账单与记录</div>
|
85 |
+
<div class="category-chip bg-gray-100 text-gray-800 px-3 py-1 rounded-full text-sm cursor-pointer" data-category="basic">基础功能</div>
|
86 |
+
<div class="category-chip bg-orange-100 text-orange-800 px-3 py-1 rounded-full text-sm cursor-pointer" data-category="other">其他问题</div>
|
87 |
+
</div>
|
88 |
+
</div>
|
89 |
+
|
90 |
+
<!-- RAG Data Upload -->
|
91 |
+
<div class="mb-6">
|
92 |
+
<label class="block text-sm font-medium text-gray-700 mb-2">外部数据导入 (RAG)</label>
|
93 |
+
<div class="flex items-center">
|
94 |
+
<input type="file" id="rag-upload" class="hidden">
|
95 |
+
<label for="rag-upload" class="cursor-pointer bg-gray-100 hover:bg-gray-200 text-gray-700 px-4 py-2 rounded-md text-sm flex items-center">
|
96 |
+
<i class="fas fa-file-upload mr-2"></i> 选择文件
|
97 |
+
</label>
|
98 |
+
<span id="rag-filename" class="ml-2 text-sm text-gray-500 truncate max-w-xs">未选择文件</span>
|
99 |
+
</div>
|
100 |
+
<p class="text-xs text-gray-500 mt-1">支持.txt, .pdf, .docx格式</p>
|
101 |
+
</div>
|
102 |
+
|
103 |
+
<!-- User Suggestions -->
|
104 |
+
<div class="mb-6">
|
105 |
+
<label class="block text-sm font-medium text-gray-700 mb-2">自定义提示</label>
|
106 |
+
<textarea class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-indigo-500"
|
107 |
+
rows="3" placeholder="输入您的特殊要求,将作为Prompt传递给模型..."></textarea>
|
108 |
+
</div>
|
109 |
+
|
110 |
+
<!-- Generate Button -->
|
111 |
+
<button id="generate-btn" class="w-full bg-indigo-600 hover:bg-indigo-700 text-white py-3 px-4 rounded-md font-medium flex items-center justify-center">
|
112 |
+
<i class="fas fa-magic mr-2"></i> 生成问题
|
113 |
+
</button>
|
114 |
+
|
115 |
+
<!-- API Status -->
|
116 |
+
<div class="mt-4 text-sm text-gray-600 flex items-center">
|
117 |
+
<div id="api-status" class="flex items-center">
|
118 |
+
<span class="w-2 h-2 rounded-full bg-gray-400 mr-2"></span>
|
119 |
+
<span>DeepSeek API 未连接</span>
|
120 |
+
</div>
|
121 |
+
</div>
|
122 |
+
</div>
|
123 |
+
|
124 |
+
<!-- Results Panel -->
|
125 |
+
<div class="bg-white rounded-xl shadow-md p-6 lg:col-span-2">
|
126 |
+
<div class="flex justify-between items-center mb-6">
|
127 |
+
<h2 class="text-xl font-semibold text-gray-800 flex items-center">
|
128 |
+
<i class="fas fa-list-ul mr-2 text-indigo-500"></i> 生成结果
|
129 |
+
</h2>
|
130 |
+
<div class="flex items-center">
|
131 |
+
<button id="export-json" class="text-sm bg-gray-100 hover:bg-gray-200 text-gray-700 px-3 py-1 rounded-md mr-2 flex items-center">
|
132 |
+
<i class="fas fa-file-export mr-1"></i> JSON
|
133 |
+
</button>
|
134 |
+
<button id="export-csv" class="text-sm bg-gray-100 hover:bg-gray-200 text-gray-700 px-3 py-1 rounded-md flex items-center">
|
135 |
+
<i class="fas fa-file-csv mr-1"></i> CSV
|
136 |
+
</button>
|
137 |
+
</div>
|
138 |
+
</div>
|
139 |
+
|
140 |
+
<!-- Progress Bar -->
|
141 |
+
<div id="progress-container" class="mb-4 hidden">
|
142 |
+
<div class="flex justify-between text-sm text-gray-600 mb-1">
|
143 |
+
<span>生成进度</span>
|
144 |
+
<span id="progress-text">0%</span>
|
145 |
+
</div>
|
146 |
+
<div class="w-full bg-gray-200 rounded-full h-2.5">
|
147 |
+
<div id="progress-bar" class="progress-bar bg-indigo-600 h-2.5 rounded-full" style="width: 0%"></div>
|
148 |
+
</div>
|
149 |
+
</div>
|
150 |
+
|
151 |
+
<!-- Filter Controls -->
|
152 |
+
<div class="mb-4 flex flex-wrap items-center gap-2">
|
153 |
+
<div class="relative">
|
154 |
+
<select class="appearance-none bg-gray-100 border border-gray-300 text-gray-700 py-1 px-3 pr-8 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500">
|
155 |
+
<option>所有分类</option>
|
156 |
+
<option>充值问题</option>
|
157 |
+
<option>转账问题</option>
|
158 |
+
<option>提现问题</option>
|
159 |
+
<option>账户安全</option>
|
160 |
+
<option>支付问题</option>
|
161 |
+
<option>银行卡管理</option>
|
162 |
+
<option>账单与记录</option>
|
163 |
+
<option>基础功能</option>
|
164 |
+
<option>其他问题</option>
|
165 |
+
</select>
|
166 |
+
<div class="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700">
|
167 |
+
<i class="fas fa-chevron-down text-xs"></i>
|
168 |
+
</div>
|
169 |
+
</div>
|
170 |
+
<div class="relative">
|
171 |
+
<select class="appearance-none bg-gray-100 border border-gray-300 text-gray-700 py-1 px-3 pr-8 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500">
|
172 |
+
<option>所有难度</option>
|
173 |
+
<option>简单</option>
|
174 |
+
<option>中等</option>
|
175 |
+
<option>复杂</option>
|
176 |
+
</select>
|
177 |
+
<div class="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700">
|
178 |
+
<i class="fas fa-chevron-down text-xs"></i>
|
179 |
+
</div>
|
180 |
+
</div>
|
181 |
+
<div class="relative flex-grow max-w-xs">
|
182 |
+
<input type="text" placeholder="搜索问题..." class="w-full bg-gray-100 border border-gray-300 text-gray-700 py-1 px-3 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500">
|
183 |
+
<div class="absolute inset-y-0 right-0 flex items-center pr-3 text-gray-500">
|
184 |
+
<i class="fas fa-search"></i>
|
185 |
+
</div>
|
186 |
+
</div>
|
187 |
+
</div>
|
188 |
+
|
189 |
+
<!-- Results Container -->
|
190 |
+
<div id="results-container" class="space-y-4">
|
191 |
+
<div class="text-center py-10 text-gray-500">
|
192 |
+
<i class="fas fa-comment-dots text-4xl mb-3"></i>
|
193 |
+
<p>点击"生成问题"按钮开始生成金融相关问题</p>
|
194 |
+
</div>
|
195 |
+
</div>
|
196 |
+
|
197 |
+
<!-- Pagination -->
|
198 |
+
<div class="mt-6 flex justify-between items-center text-sm text-gray-600">
|
199 |
+
<div>
|
200 |
+
显示 <span class="font-medium">0</span> 个问题中的 <span class="font-medium">0-0</span>
|
201 |
+
</div>
|
202 |
+
<div class="flex space-x-1">
|
203 |
+
<button class="px-3 py-1 rounded-md bg-gray-100 text-gray-700 disabled:opacity-50" disabled>
|
204 |
+
<i class="fas fa-chevron-left"></i>
|
205 |
+
</button>
|
206 |
+
<button class="px-3 py-1 rounded-md bg-gray-100 text-gray-700 font-medium">1</button>
|
207 |
+
<button class="px-3 py-1 rounded-md bg-gray-100 text-gray-700 hover:bg-gray-200">
|
208 |
+
<i class="fas fa-chevron-right"></i>
|
209 |
+
</button>
|
210 |
+
</div>
|
211 |
+
</div>
|
212 |
+
</div>
|
213 |
+
</div>
|
214 |
+
</div>
|
215 |
+
|
216 |
+
<script>
|
217 |
+
document.addEventListener('DOMContentLoaded', function() {
|
218 |
+
// 模拟API连接状态
|
219 |
+
setTimeout(() => {
|
220 |
+
document.getElementById('api-status').innerHTML = `
|
221 |
+
<span class="w-2 h-2 rounded-full bg-green-500 mr-2"></span>
|
222 |
+
<span>DeepSeek API 已连接</span>
|
223 |
+
`;
|
224 |
+
}, 1500);
|
225 |
+
|
226 |
+
// 难度按钮切换
|
227 |
+
const difficultyBtns = document.querySelectorAll('.difficulty-btn');
|
228 |
+
difficultyBtns.forEach(btn => {
|
229 |
+
btn.addEventListener('click', function() {
|
230 |
+
difficultyBtns.forEach(b => b.classList.remove('active', 'ring-2', 'ring-offset-2'));
|
231 |
+
this.classList.add('active', 'ring-2', 'ring-offset-2');
|
232 |
+
|
233 |
+
// 根据难度设置不同的ring颜色
|
234 |
+
const level = this.dataset.level;
|
235 |
+
let ringColor = 'ring-gray-400';
|
236 |
+
if (level === 'simple') ringColor = 'ring-green-400';
|
237 |
+
else if (level === 'medium') ringColor = 'ring-yellow-400';
|
238 |
+
else if (level === 'complex') ringColor = 'ring-red-400';
|
239 |
+
|
240 |
+
this.classList.add(ringColor);
|
241 |
+
});
|
242 |
+
});
|
243 |
+
|
244 |
+
// 分类标签切换
|
245 |
+
const categoryChips = document.querySelectorAll('.category-chip');
|
246 |
+
categoryChips.forEach(chip => {
|
247 |
+
chip.addEventListener('click', function() {
|
248 |
+
if (this.dataset.category === 'all') {
|
249 |
+
categoryChips.forEach(c => c.classList.remove('active', 'ring-2', 'ring-offset-2', 'ring-blue-400'));
|
250 |
+
this.classList.add('active', 'ring-2', 'ring-offset-2', 'ring-blue-400');
|
251 |
+
} else {
|
252 |
+
document.querySelector('.category-chip[data-category="all"]').classList.remove('active', 'ring-2', 'ring-offset-2', 'ring-blue-400');
|
253 |
+
this.classList.toggle('active');
|
254 |
+
this.classList.toggle('ring-2');
|
255 |
+
this.classList.toggle('ring-offset-2');
|
256 |
+
|
257 |
+
// 根据分类设置不同的ring颜色
|
258 |
+
const category = this.dataset.category;
|
259 |
+
let ringColor = 'ring-gray-400';
|
260 |
+
if (category === 'recharge') ringColor = 'ring-purple-400';
|
261 |
+
else if (category === 'transfer') ringColor = 'ring-green-400';
|
262 |
+
else if (category === 'withdraw') ringColor = 'ring-yellow-400';
|
263 |
+
else if (category === 'security') ringColor = 'ring-red-400';
|
264 |
+
else if (category === 'payment') ringColor = 'ring-indigo-400';
|
265 |
+
else if (category === 'card') ringColor = 'ring-pink-400';
|
266 |
+
else if (category === 'bill') ringColor = 'ring-teal-400';
|
267 |
+
else if (category === 'basic') ringColor = 'ring-gray-400';
|
268 |
+
else if (category === 'other') ringColor = 'ring-orange-400';
|
269 |
+
|
270 |
+
if (this.classList.contains('active')) {
|
271 |
+
this.classList.add(ringColor);
|
272 |
+
} else {
|
273 |
+
this.classList.remove(ringColor);
|
274 |
+
}
|
275 |
+
}
|
276 |
+
});
|
277 |
+
});
|
278 |
+
|
279 |
+
// 文件上传显示文件名
|
280 |
+
document.getElementById('rag-upload').addEventListener('change', function(e) {
|
281 |
+
const fileName = e.target.files[0]?.name || '未选择文件';
|
282 |
+
document.getElementById('rag-filename').textContent = fileName;
|
283 |
+
});
|
284 |
+
|
285 |
+
// 生成问题按钮
|
286 |
+
document.getElementById('generate-btn').addEventListener('click', function() {
|
287 |
+
const btn = this;
|
288 |
+
const originalText = btn.innerHTML;
|
289 |
+
|
290 |
+
// 显示进度条
|
291 |
+
document.getElementById('progress-container').classList.remove('hidden');
|
292 |
+
|
293 |
+
// 模拟API调用过程
|
294 |
+
btn.innerHTML = '<i class="fas fa-spinner fa-spin mr-2"></i> 生成中...';
|
295 |
+
btn.disabled = true;
|
296 |
+
|
297 |
+
// 模拟进度更新
|
298 |
+
let progress = 0;
|
299 |
+
const progressInterval = setInterval(() => {
|
300 |
+
progress += Math.random() * 10;
|
301 |
+
if (progress > 100) progress = 100;
|
302 |
+
|
303 |
+
document.getElementById('progress-bar').style.width = `${progress}%`;
|
304 |
+
document.getElementById('progress-text').textContent = `${Math.floor(progress)}%`;
|
305 |
+
|
306 |
+
if (progress >= 100) {
|
307 |
+
clearInterval(progressInterval);
|
308 |
+
|
309 |
+
// 模拟API响应时间
|
310 |
+
setTimeout(() => {
|
311 |
+
btn.innerHTML = originalText;
|
312 |
+
btn.disabled = false;
|
313 |
+
|
314 |
+
// 显示生成的问题
|
315 |
+
displayGeneratedQuestions();
|
316 |
+
}, 500);
|
317 |
+
}
|
318 |
+
}, 200);
|
319 |
+
});
|
320 |
+
|
321 |
+
// 导出按钮
|
322 |
+
document.getElementById('export-json').addEventListener('click', function() {
|
323 |
+
alert('JSON导出功能将在实际实现中完成');
|
324 |
+
});
|
325 |
+
|
326 |
+
document.getElementById('export-csv').addEventListener('click', function() {
|
327 |
+
alert('CSV导出功能将在实际实现中完成');
|
328 |
+
});
|
329 |
+
|
330 |
+
// 显示生成的问题 (模拟数据)
|
331 |
+
function displayGeneratedQuestions() {
|
332 |
+
const categories = ['充值问题', '转账问题', '提现问题', '账户安全', '支付问题', '银行卡管理', '账单与记录', '基础功能', '其他问题'];
|
333 |
+
const difficulties = ['简单', '中等', '复杂'];
|
334 |
+
|
335 |
+
const numQuestions = parseInt(document.querySelector('input[type="number"]').value) || 10;
|
336 |
+
const container = document.getElementById('results-container');
|
337 |
+
container.innerHTML = '';
|
338 |
+
|
339 |
+
for (let i = 0; i < numQuestions; i++) {
|
340 |
+
const randomCategory = categories[Math.floor(Math.random() * categories.length)];
|
341 |
+
const randomDifficulty = difficulties[Math.floor(Math.random() * difficulties.length)];
|
342 |
+
|
343 |
+
// 根据分类设置不同的颜色
|
344 |
+
let categoryColor = 'bg-gray-100 text-gray-800';
|
345 |
+
if (randomCategory === '充值问题') categoryColor = 'bg-purple-100 text-purple-800';
|
346 |
+
else if (randomCategory === '转账问题') categoryColor = 'bg-green-100 text-green-800';
|
347 |
+
else if (randomCategory === '提现问题') categoryColor = 'bg-yellow-100 text-yellow-800';
|
348 |
+
else if (randomCategory === '账户安全') categoryColor = 'bg-red-100 text-red-800';
|
349 |
+
else if (randomCategory === '支付问题') categoryColor = 'bg-indigo-100 text-indigo-800';
|
350 |
+
else if (randomCategory === '银行卡管理') categoryColor = 'bg-pink-100 text-pink-800';
|
351 |
+
else if (randomCategory === '账单与记录') categoryColor = 'bg-teal-100 text-teal-800';
|
352 |
+
else if (randomCategory === '基础功能') categoryColor = 'bg-gray-100 text-gray-800';
|
353 |
+
else if (randomCategory === '其他问题') categoryColor = 'bg-orange-100 text-orange-800';
|
354 |
+
|
355 |
+
// 根据难度设置不同的颜色
|
356 |
+
let difficultyColor = 'bg-gray-100 text-gray-800';
|
357 |
+
if (randomDifficulty === '简单') difficultyColor = 'bg-green-100 text-green-800';
|
358 |
+
else if (randomDifficulty === '中等') difficultyColor = 'bg-yellow-100 text-yellow-800';
|
359 |
+
else if (randomDifficulty === '复杂') difficultyColor = 'bg-red-100 text-red-800';
|
360 |
+
|
361 |
+
// 生成随机问题 (实际实现中会调用DeepSeek API)
|
362 |
+
const question = generateRandomQuestion(randomCategory, randomDifficulty);
|
363 |
+
|
364 |
+
const questionCard = document.createElement('div');
|
365 |
+
questionCard.className = `question-card bg-white p-4 rounded-lg shadow-sm border-l-4 border-indigo-500 fade-in`;
|
366 |
+
questionCard.style.animationDelay = `${i * 0.05}s`;
|
367 |
+
questionCard.innerHTML = `
|
368 |
+
<div class="flex justify-between items-start mb-2">
|
369 |
+
<h3 class="font-medium text-gray-800">${question}</h3>
|
370 |
+
<div class="flex space-x-2">
|
371 |
+
<span class="${categoryColor} text-xs px-2 py-1 rounded-full">${randomCategory}</span>
|
372 |
+
<span class="${difficultyColor} text-xs px-2 py-1 rounded-full">${randomDifficulty}</span>
|
373 |
+
</div>
|
374 |
+
</div>
|
375 |
+
<div class="flex justify-between items-center text-sm text-gray-500">
|
376 |
+
<span>ID: ${Math.floor(Math.random() * 10000)}</span>
|
377 |
+
<div class="flex space-x-2">
|
378 |
+
<button class="text-indigo-500 hover:text-indigo-700"><i class="fas fa-edit"></i></button>
|
379 |
+
<button class="text-red-500 hover:text-red-700"><i class="fas fa-trash"></i></button>
|
380 |
+
</div>
|
381 |
+
</div>
|
382 |
+
`;
|
383 |
+
|
384 |
+
container.appendChild(questionCard);
|
385 |
+
}
|
386 |
+
|
387 |
+
// 更新分页信息
|
388 |
+
updatePagination(numQuestions);
|
389 |
+
}
|
390 |
+
|
391 |
+
// 更新分页信息
|
392 |
+
function updatePagination(total) {
|
393 |
+
const paginationText = document.querySelector('.flex.justify-between.items-center.text-sm.text-gray-600 div');
|
394 |
+
paginationText.innerHTML = `显示 <span class="font-medium">${total}</span> 个问题中的 <span class="font-medium">1-${total}</span>`;
|
395 |
+
}
|
396 |
+
|
397 |
+
// 生成随机问题 (模拟函数,实际实现中会调用DeepSeek API)
|
398 |
+
function generateRandomQuestion(category, difficulty) {
|
399 |
+
const questions = {
|
400 |
+
'充值问题': [
|
401 |
+
'如何为我的钱包充值?',
|
402 |
+
'充值后资金未到账怎么办?',
|
403 |
+
'充值是否有金额限制?',
|
404 |
+
'哪些银行卡支持快速充值?',
|
405 |
+
'充值失败可能的原因有哪些?'
|
406 |
+
],
|
407 |
+
'转账问题': [
|
408 |
+
'如何向他人转账?',
|
409 |
+
'转账到银行卡需要多长时间?',
|
410 |
+
'转账失败会退款吗?',
|
411 |
+
'每日转账限额是多少?',
|
412 |
+
'如何查看转账记录?'
|
413 |
+
],
|
414 |
+
'提现问题': [
|
415 |
+
'如何将余额提现到银行卡?',
|
416 |
+
'提现手续费是多少?',
|
417 |
+
'提现到账时间是多久?',
|
418 |
+
'为什么我的提现申请被拒绝?',
|
419 |
+
'提现限额如何提升?'
|
420 |
+
],
|
421 |
+
'账户安全': [
|
422 |
+
'如何设置更安全的密码?',
|
423 |
+
'账户被盗怎么办?',
|
424 |
+
'如何开启双重验证?',
|
425 |
+
'收到可疑短信该如何处理?',
|
426 |
+
'如何查看登录记录?'
|
427 |
+
],
|
428 |
+
'支付问题': [
|
429 |
+
'支付时提示风险交易怎么办?',
|
430 |
+
'如何设置支付密码?',
|
431 |
+
'支付失败可能的原因有哪些?',
|
432 |
+
'如何查看支付记录?',
|
433 |
+
'支付限额如何调整?'
|
434 |
+
],
|
435 |
+
'银行卡管理': [
|
436 |
+
'如何添加新的银行卡?',
|
437 |
+
'银行卡绑定失败怎么办?',
|
438 |
+
'如何解除已绑定的银行卡?',
|
439 |
+
'为什么无法绑定某些银行卡?',
|
440 |
+
'银行卡信息变更如何更新?'
|
441 |
+
],
|
442 |
+
'账单与记录': [
|
443 |
+
'如何查看历史交易记录?',
|
444 |
+
'账单可以导出吗?',
|
445 |
+
'交易记录保存多久?',
|
446 |
+
'如何筛选特定时间的交易?',
|
447 |
+
'账单明细包含哪些信息?'
|
448 |
+
],
|
449 |
+
'基础功能': [
|
450 |
+
'如何注册钱包账户?',
|
451 |
+
'如何修改个人信息?',
|
452 |
+
'如何找回登录密码?',
|
453 |
+
'如何联系客服?',
|
454 |
+
'APP有哪些基本功能?'
|
455 |
+
],
|
456 |
+
'其他问题': [
|
457 |
+
'钱包服务费是多少?',
|
458 |
+
'如何申请发票?',
|
459 |
+
'什么是数字货币钱包?',
|
460 |
+
'钱包支持哪些货币?',
|
461 |
+
'如何关闭钱包账户?'
|
462 |
+
]
|
463 |
+
};
|
464 |
+
|
465 |
+
// 根据难度调整问题复杂度
|
466 |
+
let question = questions[category][Math.floor(Math.random() * questions[category].length)];
|
467 |
+
if (difficulty === '中等') {
|
468 |
+
question = question.replace('?', '?请详细说明流程。');
|
469 |
+
} else if (difficulty === '复杂') {
|
470 |
+
question = question.replace('?', '?请分步骤说明可能的原因和解决方案。');
|
471 |
+
}
|
472 |
+
|
473 |
+
return question;
|
474 |
+
}
|
475 |
+
});
|
476 |
+
</script>
|
477 |
+
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - <a href="https://enzostvs-deepsite.hf.space?remix=Bio-Du/financial-question-generator-chinese" style="color: #fff;text-decoration: underline;" target="_blank" >🧬 Remix</a></p></body>
|
478 |
+
</html>
|