feat(mobile-app): 隐藏"我的团队"功能,需秘密点击解锁

- 默认隐藏"我的团队"树形组件
- 在"团队种植数"区域连续点击19次后显示
- 点击间隔超过1秒自动重置计数器
- 退出页面后状态自动重置

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2025-12-27 09:29:20 -08:00
parent aa180c54bc
commit b20be7213c
1 changed files with 71 additions and 36 deletions

View File

@ -187,6 +187,11 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
Timer? _walletDebounceTimer; Timer? _walletDebounceTimer;
static const int _debounceDelayMs = 300; // 300ms static const int _debounceDelayMs = 300; // 300ms
// "我的团队"
int _teamPlantingTapCount = 0;
DateTime? _lastTeamPlantingTapTime;
bool _showMyTeamTree = false;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -1866,9 +1871,11 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
// //
_buildReferralList(), _buildReferralList(),
const SizedBox(height: 16), const SizedBox(height: 16),
// // 19
_buildMyTeamTree(), if (_showMyTeamTree) ...[
const SizedBox(height: 16), _buildMyTeamTree(),
const SizedBox(height: 16),
],
// //
_buildShareButton(), _buildShareButton(),
// //
@ -3166,6 +3173,31 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
); );
} }
/// 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() { Widget _buildTeamStats() {
return Row( return Row(
@ -3253,42 +3285,45 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
), ),
const SizedBox(width: 8), const SizedBox(width: 8),
Expanded( Expanded(
child: Container( child: GestureDetector(
padding: const EdgeInsets.all(12), onTap: _onTeamPlantingTap,
decoration: BoxDecoration( child: Container(
color: const Color(0xFFFFF5E6), padding: const EdgeInsets.all(12),
borderRadius: BorderRadius.circular(8), decoration: BoxDecoration(
border: Border.all( color: const Color(0xFFFFF5E6),
color: const Color(0x33D4AF37), borderRadius: BorderRadius.circular(8),
width: 1, border: Border.all(
color: const Color(0x33D4AF37),
width: 1,
),
), ),
), child: Column(
child: Column( children: [
children: [ const Text(
const Text( '团队种植数',
'团队种植数', style: TextStyle(
style: TextStyle( fontSize: 12,
fontSize: 12, fontFamily: 'Inter',
fontFamily: 'Inter', fontWeight: FontWeight.w500,
fontWeight: FontWeight.w500, height: 1.5,
height: 1.5, color: Color(0xCC5D4037),
color: Color(0xCC5D4037), ),
textAlign: TextAlign.center,
), ),
textAlign: TextAlign.center, const SizedBox(height: 6),
), Text(
const SizedBox(height: 6), _formatInt(_teamPlantingCount),
Text( style: const TextStyle(
_formatInt(_teamPlantingCount), fontSize: 20,
style: const TextStyle( fontFamily: 'Inter',
fontSize: 20, fontWeight: FontWeight.w700,
fontFamily: 'Inter', height: 1.25,
fontWeight: FontWeight.w700, color: Color(0xFF5D4037),
height: 1.25, ),
color: Color(0xFF5D4037), textAlign: TextAlign.center,
), ),
textAlign: TextAlign.center, ],
), ),
],
), ),
), ),
), ),