fix(mobile-app): 修改秘密点击解锁逻辑,点击19次后需等待2秒
- 连续点击19次后启动2秒定时器 - 2秒内再次点击会取消并重新计时 - 确保用户停止点击后才显示"我的同僚" 🤖 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
b20ec10c75
commit
a54a01bba0
|
|
@ -891,6 +891,8 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
|
||||||
_referralDebounceTimer?.cancel();
|
_referralDebounceTimer?.cancel();
|
||||||
_authorizationDebounceTimer?.cancel();
|
_authorizationDebounceTimer?.cancel();
|
||||||
_walletDebounceTimer?.cancel();
|
_walletDebounceTimer?.cancel();
|
||||||
|
// 取消秘密点击解锁定时器
|
||||||
|
_teamPlantingUnlockTimer?.cancel();
|
||||||
// 停止钱包轮询(在 super.dispose() 之前安全调用)
|
// 停止钱包轮询(在 super.dispose() 之前安全调用)
|
||||||
try {
|
try {
|
||||||
ref.read(walletStatusProvider.notifier).stopPolling();
|
ref.read(walletStatusProvider.notifier).stopPolling();
|
||||||
|
|
@ -3173,10 +3175,16 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 处理团队种植数区域的秘密点击(连续点击19次显示"我的团队")
|
/// 处理团队种植数区域的秘密点击(连续点击19次后等待2秒显示"我的同僚")
|
||||||
|
Timer? _teamPlantingUnlockTimer;
|
||||||
|
|
||||||
void _onTeamPlantingTap() {
|
void _onTeamPlantingTap() {
|
||||||
final now = DateTime.now();
|
final now = DateTime.now();
|
||||||
|
|
||||||
|
// 取消之前的解锁定时器
|
||||||
|
_teamPlantingUnlockTimer?.cancel();
|
||||||
|
_teamPlantingUnlockTimer = null;
|
||||||
|
|
||||||
// 如果距离上次点击超过1秒,重置计数
|
// 如果距离上次点击超过1秒,重置计数
|
||||||
if (_lastTeamPlantingTapTime != null &&
|
if (_lastTeamPlantingTapTime != null &&
|
||||||
now.difference(_lastTeamPlantingTapTime!).inMilliseconds > 1000) {
|
now.difference(_lastTeamPlantingTapTime!).inMilliseconds > 1000) {
|
||||||
|
|
@ -3186,10 +3194,14 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
|
||||||
_lastTeamPlantingTapTime = now;
|
_lastTeamPlantingTapTime = now;
|
||||||
_teamPlantingTapCount++;
|
_teamPlantingTapCount++;
|
||||||
|
|
||||||
// 严格等于19次时显示
|
// 达到19次时,启动2秒定时器
|
||||||
if (_teamPlantingTapCount == 19) {
|
if (_teamPlantingTapCount == 19) {
|
||||||
setState(() {
|
_teamPlantingUnlockTimer = Timer(const Duration(seconds: 2), () {
|
||||||
_showMyTeamTree = true;
|
if (mounted) {
|
||||||
|
setState(() {
|
||||||
|
_showMyTeamTree = true;
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 超过19次重置,防止累积
|
// 超过19次重置,防止累积
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue