feat(mobile-app): 用户资料页添加"同伴认种"标题和快捷标签

- 在统计卡片上方添加"同伴认种"标题(紫色)
- 在统计卡片下方添加"引荐"、"同伴"、"本人"快捷标签

🤖 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 2026-01-05 18:35:21 -08:00
parent e6da0cbb05
commit d274444ca9
1 changed files with 73 additions and 36 deletions

View File

@ -375,45 +375,82 @@ class _UserProfilePageState extends ConsumerState<UserProfilePage> {
} }
Widget _buildStatsCard(UserProfileResponse profile) { Widget _buildStatsCard(UserProfileResponse profile) {
return Container( return Column(
padding: const EdgeInsets.symmetric(vertical: 16, horizontal: 12), crossAxisAlignment: CrossAxisAlignment.end,
decoration: BoxDecoration( children: [
color: Colors.white.withValues(alpha: 0.9), // "同伴认种"
borderRadius: BorderRadius.circular(16), Text(
boxShadow: [ '同伴认种',
BoxShadow( style: TextStyle(
color: const Color(0xFFD4AF37).withValues(alpha: 0.1), fontSize: 18,
blurRadius: 10, fontWeight: FontWeight.w600,
offset: const Offset(0, 2), color: const Color(0xFF9C27B0).withValues(alpha: 0.8),
), ),
], ),
), const SizedBox(height: 8),
child: Row( //
children: [ Container(
_buildStatItem( padding: const EdgeInsets.symmetric(vertical: 16, horizontal: 12),
label: '直推', decoration: BoxDecoration(
value: '${profile.directReferralCount}', color: Colors.white.withValues(alpha: 0.9),
color: const Color(0xFF4CAF50), borderRadius: BorderRadius.circular(16),
boxShadow: [
BoxShadow(
color: const Color(0xFFD4AF37).withValues(alpha: 0.1),
blurRadius: 10,
offset: const Offset(0, 2),
),
],
), ),
_buildStatDivider(), child: Row(
_buildStatItem( children: [
label: '伞下', _buildStatItem(
value: '${profile.umbrellaUserCount}', label: '直推',
color: const Color(0xFF2196F3), value: '${profile.directReferralCount}',
color: const Color(0xFF4CAF50),
),
_buildStatDivider(),
_buildStatItem(
label: '伞下',
value: '${profile.umbrellaUserCount}',
color: const Color(0xFF2196F3),
),
_buildStatDivider(),
_buildStatItem(
label: '个人认种',
value: '${profile.personalPlantingCount}',
color: const Color(0xFF8BC34A),
),
_buildStatDivider(),
_buildStatItem(
label: '团队认种',
value: '${profile.teamPlantingCount}',
color: const Color(0xFFD4AF37),
),
],
), ),
_buildStatDivider(), ),
_buildStatItem( const SizedBox(height: 12),
label: '个人认种', //
value: '${profile.personalPlantingCount}', Row(
color: const Color(0xFF8BC34A), mainAxisAlignment: MainAxisAlignment.spaceEvenly,
), children: [
_buildStatDivider(), _buildQuickLabel('引荐', const Color(0xFF4CAF50)),
_buildStatItem( _buildQuickLabel('同伴', const Color(0xFF9C27B0)),
label: '团队认种', _buildQuickLabel('本人', const Color(0xFFD4AF37)),
value: '${profile.teamPlantingCount}', ],
color: const Color(0xFFD4AF37), ),
), ],
], );
}
Widget _buildQuickLabel(String text, Color color) {
return Text(
text,
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w600,
color: color,
), ),
); );
} }