From 0623169d19d168f94e5e933c62667a5b0f2ca1c9 Mon Sep 17 00:00:00 2001 From: hailin Date: Wed, 24 Dec 2025 02:16:54 -0800 Subject: [PATCH] =?UTF-8?q?fix(mobile):=20=E4=BF=AE=E6=AD=A3=E7=81=AB?= =?UTF-8?q?=E6=9F=B4=E4=BA=BA=E8=BF=9B=E5=BA=A6=E8=AE=A1=E7=AE=97=EF=BC=8C?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E5=9B=BA=E5=AE=9A=E7=9B=AE=E6=A0=87=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 省公司: 目标固定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 --- .../presentation/widgets/stickman_race_widget.dart | 11 ++++++----- .../profile/presentation/pages/profile_page.dart | 6 ++---- 2 files changed, 8 insertions(+), 9 deletions(-) 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(); }); }