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次重置,防止累积