From b20be7213c40cea5403bc3198078cec69573de64 Mon Sep 17 00:00:00 2001 From: hailin Date: Sat, 27 Dec 2025 09:29:20 -0800 Subject: [PATCH] =?UTF-8?q?feat(mobile-app):=20=E9=9A=90=E8=97=8F"?= =?UTF-8?q?=E6=88=91=E7=9A=84=E5=9B=A2=E9=98=9F"=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=EF=BC=8C=E9=9C=80=E7=A7=98=E5=AF=86=E7=82=B9=E5=87=BB=E8=A7=A3?= =?UTF-8?q?=E9=94=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 默认隐藏"我的团队"树形组件 - 在"团队种植数"区域连续点击19次后显示 - 点击间隔超过1秒自动重置计数器 - 退出页面后状态自动重置 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../presentation/pages/profile_page.dart | 107 ++++++++++++------ 1 file changed, 71 insertions(+), 36 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 166e568c..3b47bc99 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 @@ -187,6 +187,11 @@ class _ProfilePageState extends ConsumerState { Timer? _walletDebounceTimer; static const int _debounceDelayMs = 300; // 300ms 防抖延迟 + // 隐藏"我的团队"功能的秘密点击计数器 + int _teamPlantingTapCount = 0; + DateTime? _lastTeamPlantingTapTime; + bool _showMyTeamTree = false; + @override void initState() { super.initState(); @@ -1866,9 +1871,11 @@ class _ProfilePageState extends ConsumerState { // 直推列表 _buildReferralList(), const SizedBox(height: 16), - // 我的团队 - _buildMyTeamTree(), - const SizedBox(height: 16), + // 我的团队(仅在解锁后显示:团队种植数区域连续点击19次) + if (_showMyTeamTree) ...[ + _buildMyTeamTree(), + const SizedBox(height: 16), + ], // 分享邀请按钮 _buildShareButton(), // 社区权益考核(仅在有社区授权时显示) @@ -3166,6 +3173,31 @@ class _ProfilePageState extends ConsumerState { ); } + /// 处理团队种植数区域的秘密点击(连续点击19次显示"我的团队") + void _onTeamPlantingTap() { + final now = DateTime.now(); + + // 如果距离上次点击超过1秒,重置计数 + if (_lastTeamPlantingTapTime != null && + now.difference(_lastTeamPlantingTapTime!).inMilliseconds > 1000) { + _teamPlantingTapCount = 0; + } + + _lastTeamPlantingTapTime = now; + _teamPlantingTapCount++; + + // 严格等于19次时显示 + if (_teamPlantingTapCount == 19) { + setState(() { + _showMyTeamTree = true; + }); + } + // 超过19次重置,防止累积 + else if (_teamPlantingTapCount > 19) { + _teamPlantingTapCount = 0; + } + } + /// 构建团队统计 Widget _buildTeamStats() { return Row( @@ -3253,42 +3285,45 @@ class _ProfilePageState extends ConsumerState { ), const SizedBox(width: 8), Expanded( - child: Container( - padding: const EdgeInsets.all(12), - decoration: BoxDecoration( - color: const Color(0xFFFFF5E6), - borderRadius: BorderRadius.circular(8), - border: Border.all( - color: const Color(0x33D4AF37), - width: 1, + child: GestureDetector( + onTap: _onTeamPlantingTap, + child: Container( + padding: const EdgeInsets.all(12), + decoration: BoxDecoration( + color: const Color(0xFFFFF5E6), + borderRadius: BorderRadius.circular(8), + border: Border.all( + color: const Color(0x33D4AF37), + width: 1, + ), ), - ), - child: Column( - children: [ - const Text( - '团队种植数', - style: TextStyle( - fontSize: 12, - fontFamily: 'Inter', - fontWeight: FontWeight.w500, - height: 1.5, - color: Color(0xCC5D4037), + child: Column( + children: [ + const Text( + '团队种植数', + style: TextStyle( + fontSize: 12, + fontFamily: 'Inter', + fontWeight: FontWeight.w500, + height: 1.5, + color: Color(0xCC5D4037), + ), + textAlign: TextAlign.center, ), - textAlign: TextAlign.center, - ), - const SizedBox(height: 6), - Text( - _formatInt(_teamPlantingCount), - style: const TextStyle( - fontSize: 20, - fontFamily: 'Inter', - fontWeight: FontWeight.w700, - height: 1.25, - color: Color(0xFF5D4037), + const SizedBox(height: 6), + Text( + _formatInt(_teamPlantingCount), + style: const TextStyle( + fontSize: 20, + fontFamily: 'Inter', + fontWeight: FontWeight.w700, + height: 1.25, + color: Color(0xFF5D4037), + ), + textAlign: TextAlign.center, ), - textAlign: TextAlign.center, - ), - ], + ], + ), ), ), ),