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:
parent
aa180c54bc
commit
b20be7213c
|
|
@ -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次)
|
||||||
|
if (_showMyTeamTree) ...[
|
||||||
_buildMyTeamTree(),
|
_buildMyTeamTree(),
|
||||||
const SizedBox(height: 16),
|
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,6 +3285,8 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
Expanded(
|
Expanded(
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: _onTeamPlantingTap,
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: const EdgeInsets.all(12),
|
padding: const EdgeInsets.all(12),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
|
|
@ -3292,6 +3326,7 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue