From 3072815881a950090c69e09bd4e59b20cf8fa56e Mon Sep 17 00:00:00 2001 From: Jowe <123822645+Selei1983@users.noreply.github.com> Date: Sat, 28 Mar 2026 10:00:43 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=88=86=E6=9E=90?= =?UTF-8?q?=E8=BF=9B=E5=BA=A6=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 显示当前分析步骤:调用服务/调用AI/生成结果 - 提升用户体验,便于定位问题 Co-Authored-By: Claude Sonnet 4.6 --- src/pages/FormPage.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pages/FormPage.tsx b/src/pages/FormPage.tsx index 010a6b8..d4eb6ef 100644 --- a/src/pages/FormPage.tsx +++ b/src/pages/FormPage.tsx @@ -13,6 +13,7 @@ export function FormPage({ onSubmit, onBack }: FormPageProps) { const [gender, setGender] = useState<'male' | 'female'>('male'); const [birthPlace, setBirthPlace] = useState(''); const [isAnalyzing, setIsAnalyzing] = useState(false); + const [analyzeStep, setAnalyzeStep] = useState(''); const [errorMessage, setErrorMessage] = useState(''); const handleSubmit = async (e: React.FormEvent) => { @@ -21,6 +22,7 @@ export function FormPage({ onSubmit, onBack }: FormPageProps) { setIsAnalyzing(true); setErrorMessage(''); + setAnalyzeStep('正在调用分析服务...'); const input: UserInput = { birthDate, @@ -30,7 +32,9 @@ export function FormPage({ onSubmit, onBack }: FormPageProps) { }; try { + setAnalyzeStep('正在调用 AI 模型分析...'); const result = await requestFortuneAnalysis(input); + setAnalyzeStep('正在生成分析结果...'); onSubmit(input, result); } catch (error) { setErrorMessage( @@ -38,6 +42,7 @@ export function FormPage({ onSubmit, onBack }: FormPageProps) { ); } finally { setIsAnalyzing(false); + setAnalyzeStep(''); } }; @@ -161,7 +166,7 @@ export function FormPage({ onSubmit, onBack }: FormPageProps) { {isAnalyzing ? ( - 分析中... + {analyzeStep || '分析中...'} ) : ( '开始分析'