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 || '分析中...'} ) : ( '开始分析'