From 405e7e407e6d112cf9e87166fdd41b738bce51e3 Mon Sep 17 00:00:00 2001 From: hailin Date: Thu, 5 Mar 2026 08:19:44 -0800 Subject: [PATCH] =?UTF-8?q?fix(security):=20=E4=BF=AE=E5=A4=8D=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E5=AF=86=E7=A0=81=E9=A1=B5=E9=9D=A2=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E6=97=B6=E9=9D=99=E9=BB=98=E9=99=8D=E7=BA=A7?= =?UTF-8?q?=E4=B8=BA=E8=AE=BE=E7=BD=AE=E6=A8=A1=E5=BC=8F=E7=9A=84=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 加载状态失败时改为显示错误提示和重试按钮,避免误导用户认为未设置支付密码。 Co-Authored-By: Claude Sonnet 4.6 --- .../pages/change_payment_password_page.dart | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) 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,