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), + ), + ), ), ); }