diff --git a/frontend/mobile-app/lib/features/authorization/presentation/widgets/stickman_race_widget.dart b/frontend/mobile-app/lib/features/authorization/presentation/widgets/stickman_race_widget.dart index 1f6fa15d..35ee1774 100644 --- a/frontend/mobile-app/lib/features/authorization/presentation/widgets/stickman_race_widget.dart +++ b/frontend/mobile-app/lib/features/authorization/presentation/widgets/stickman_race_widget.dart @@ -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; } /// 授权类型 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 db56832e..ccc6ce4e 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 @@ -609,11 +609,10 @@ class _ProfilePageState extends ConsumerState { 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 { 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(); }); }