diff --git a/frontend/mobile-app/lib/features/security/presentation/pages/change_payment_password_page.dart b/frontend/mobile-app/lib/features/security/presentation/pages/change_payment_password_page.dart index 182d72d0..5189994b 100644 --- a/frontend/mobile-app/lib/features/security/presentation/pages/change_payment_password_page.dart +++ b/frontend/mobile-app/lib/features/security/presentation/pages/change_payment_password_page.dart @@ -31,6 +31,7 @@ class _ChangePaymentPasswordPageState bool _isSubmitting = false; bool _hasPaymentPassword = false; bool _isLoading = true; + bool _isLoadError = false; @override void initState() { @@ -60,7 +61,7 @@ class _ChangePaymentPasswordPageState } catch (e) { if (mounted) { setState(() { - _hasPaymentPassword = false; + _isLoadError = true; _isLoading = false; }); } @@ -160,7 +161,24 @@ class _ChangePaymentPasswordPageState Color(0xFFD4AF37)), ), ) - : SingleChildScrollView( + : _isLoadError + ? Center( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + const Icon(Icons.error_outline, color: Colors.red, size: 48), + const SizedBox(height: 12), + const Text('加载失败,请重试', style: TextStyle(color: Colors.red)), + const SizedBox(height: 16), + ElevatedButton( + onPressed: _loadStatus, + style: ElevatedButton.styleFrom(backgroundColor: const Color(0xFFD4AF37)), + child: const Text('重试', style: TextStyle(color: Colors.white)), + ), + ], + ), + ) + : SingleChildScrollView( padding: const EdgeInsets.all(16), child: Column( crossAxisAlignment: CrossAxisAlignment.start,