From 0a4ec49c8a91210604ab6b72a3e41d3667390d8b Mon Sep 17 00:00:00 2001 From: hailin Date: Wed, 24 Dec 2025 07:38:26 -0800 Subject: [PATCH] =?UTF-8?q?fix(kyc):=20=E4=BF=AE=E5=A4=8D=E6=9B=B4?= =?UTF-8?q?=E6=8D=A2=E6=89=8B=E6=9C=BA=E5=8F=B7=E9=A1=B5=E9=9D=A2=E5=8F=91?= =?UTF-8?q?=E9=80=81=E9=AA=8C=E8=AF=81=E7=A0=81=E6=8C=89=E9=92=AE=E5=8F=AF?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E7=82=B9=E5=87=BB=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加 _isSendingCode 状态检查,防止发送中重复点击 - 发送中显示 loading 指示器 - 倒计时期间和发送中均禁用按钮 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../presentation/pages/change_phone_page.dart | 30 ++++++++++++------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/frontend/mobile-app/lib/features/kyc/presentation/pages/change_phone_page.dart b/frontend/mobile-app/lib/features/kyc/presentation/pages/change_phone_page.dart index 9e7f33c5..98651b98 100644 --- a/frontend/mobile-app/lib/features/kyc/presentation/pages/change_phone_page.dart +++ b/frontend/mobile-app/lib/features/kyc/presentation/pages/change_phone_page.dart @@ -587,9 +587,10 @@ class _ChangePhonePageState extends ConsumerState { } Widget _buildSendCodeButton(Future Function() onSend) { + final canSend = _countdown == 0 && !_isSendingCode; return Center( child: GestureDetector( - onTap: _countdown > 0 ? null : () async { + onTap: canSend ? () async { try { await onSend(); } catch (e) { @@ -599,15 +600,24 @@ class _ChangePhonePageState extends ConsumerState { }); } } - }, - child: Text( - _countdown > 0 ? '$_countdown秒后重新发送' : '发送验证码', - style: TextStyle( - fontSize: 14.sp, - fontWeight: FontWeight.w500, - color: _countdown > 0 ? const Color(0xFF999999) : const Color(0xFF2E7D32), - ), - ), + } : null, + child: _isSendingCode + ? SizedBox( + width: 20.sp, + height: 20.sp, + child: const CircularProgressIndicator( + strokeWidth: 2, + valueColor: AlwaysStoppedAnimation(Color(0xFF999999)), + ), + ) + : Text( + _countdown > 0 ? '$_countdown秒后重新发送' : '发送验证码', + style: TextStyle( + fontSize: 14.sp, + fontWeight: FontWeight.w500, + color: canSend ? const Color(0xFF2E7D32) : const Color(0xFF999999), + ), + ), ), ); }