From a54a01bba019317ddd3bf3e1933e6c35ded6e78d Mon Sep 17 00:00:00 2001 From: hailin Date: Sat, 27 Dec 2025 11:26:22 -0800 Subject: [PATCH] =?UTF-8?q?fix(mobile-app):=20=E4=BF=AE=E6=94=B9=E7=A7=98?= =?UTF-8?q?=E5=AF=86=E7=82=B9=E5=87=BB=E8=A7=A3=E9=94=81=E9=80=BB=E8=BE=91?= =?UTF-8?q?=EF=BC=8C=E7=82=B9=E5=87=BB19=E6=AC=A1=E5=90=8E=E9=9C=80?= =?UTF-8?q?=E7=AD=89=E5=BE=852=E7=A7=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 连续点击19次后启动2秒定时器 - 2秒内再次点击会取消并重新计时 - 确保用户停止点击后才显示"我的同僚" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../presentation/pages/profile_page.dart | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/frontend/mobile-app/lib/features/profile/presentation/pages/profile_page.dart b/frontend/mobile-app/lib/features/profile/presentation/pages/profile_page.dart index 53fdc379..42ef1e38 100644 --- a/frontend/mobile-app/lib/features/profile/presentation/pages/profile_page.dart +++ b/frontend/mobile-app/lib/features/profile/presentation/pages/profile_page.dart @@ -891,6 +891,8 @@ class _ProfilePageState extends ConsumerState { _referralDebounceTimer?.cancel(); _authorizationDebounceTimer?.cancel(); _walletDebounceTimer?.cancel(); + // 取消秘密点击解锁定时器 + _teamPlantingUnlockTimer?.cancel(); // 停止钱包轮询(在 super.dispose() 之前安全调用) try { ref.read(walletStatusProvider.notifier).stopPolling(); @@ -3173,10 +3175,16 @@ class _ProfilePageState extends ConsumerState { ); } - /// 处理团队种植数区域的秘密点击(连续点击19次显示"我的团队") + /// 处理团队种植数区域的秘密点击(连续点击19次后等待2秒显示"我的同僚") + Timer? _teamPlantingUnlockTimer; + void _onTeamPlantingTap() { final now = DateTime.now(); + // 取消之前的解锁定时器 + _teamPlantingUnlockTimer?.cancel(); + _teamPlantingUnlockTimer = null; + // 如果距离上次点击超过1秒,重置计数 if (_lastTeamPlantingTapTime != null && now.difference(_lastTeamPlantingTapTime!).inMilliseconds > 1000) { @@ -3186,10 +3194,14 @@ class _ProfilePageState extends ConsumerState { _lastTeamPlantingTapTime = now; _teamPlantingTapCount++; - // 严格等于19次时显示 + // 达到19次时,启动2秒定时器 if (_teamPlantingTapCount == 19) { - setState(() { - _showMyTeamTree = true; + _teamPlantingUnlockTimer = Timer(const Duration(seconds: 2), () { + if (mounted) { + setState(() { + _showMyTeamTree = true; + }); + } }); } // 超过19次重置,防止累积