fix(mobile): 修正火柴人进度计算,使用固定目标值

- 省公司: 目标固定5万,达到或超过5万停在红旗
- 市公司: 目标固定1万,达到或超过1万停在红旗
- 进度 = completedCount / targetCount,clamp到0-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-24 02:16:54 -08:00
parent 7d1a392d9e
commit 0623169d19
2 changed files with 8 additions and 9 deletions

View File

@ -8,11 +8,10 @@ class StickmanRankingData {
final String nickname;
final String? avatarUrl;
final int completedCount; //
final int targetCount; // ()
final int targetCount; // (5/1)
final double monthlyEarnings; //
final bool isCurrentUser; //
final String? accountSequence; //
final double progressPercentage; // (0-100, )
StickmanRankingData({
required this.id,
@ -23,11 +22,13 @@ class StickmanRankingData {
required this.monthlyEarnings,
this.isCurrentUser = false,
this.accountSequence,
required this.progressPercentage,
});
/// (0.0 - 1.0)使
double get progress => (progressPercentage / 100).clamp(0.0, 1.0);
/// (0.0 - 1.0)
/// completedCount / targetCount 100%
double get progress => targetCount > 0
? (completedCount / targetCount).clamp(0.0, 1.0)
: 0.0;
}
///

View File

@ -609,11 +609,10 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
nickname: r.nickname,
avatarUrl: r.avatarUrl,
completedCount: r.completedCount,
targetCount: r.finalTarget,
targetCount: 50000, // 5
monthlyEarnings: r.monthlyEarnings,
isCurrentUser: r.isCurrentUser,
accountSequence: r.accountSequence,
progressPercentage: r.progressPercentage,
)).toList();
});
}
@ -644,11 +643,10 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
nickname: r.nickname,
avatarUrl: r.avatarUrl,
completedCount: r.completedCount,
targetCount: r.finalTarget,
targetCount: 10000, // 1
monthlyEarnings: r.monthlyEarnings,
isCurrentUser: r.isCurrentUser,
accountSequence: r.accountSequence,
progressPercentage: r.progressPercentage,
)).toList();
});
}