fix(mining-app): update profile page - hide items and rename label
- Rename "团队层级" to "团队下级" in stats row - Hide "实名认证" option from account settings - Hide "我的邀请码" card section entirely - Remove unused _buildInvitationCard and _buildActionButton methods Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
42a28efe74
commit
adeeadb495
|
|
@ -23,7 +23,6 @@ class ProfilePage extends ConsumerWidget {
|
|||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final user = ref.watch(userNotifierProvider);
|
||||
final statsAsync = ref.watch(userStatsProvider);
|
||||
final invitationCode = ref.watch(invitationCodeProvider);
|
||||
|
||||
final isStatsLoading = statsAsync.isLoading;
|
||||
final stats = statsAsync.valueOrNull;
|
||||
|
|
@ -51,11 +50,6 @@ class ProfilePage extends ConsumerWidget {
|
|||
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// 邀请码卡片
|
||||
_buildInvitationCard(context, invitationCode),
|
||||
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// 账户设置
|
||||
_buildAccountSettings(context, user),
|
||||
|
||||
|
|
@ -264,7 +258,7 @@ class ProfilePage extends ConsumerWidget {
|
|||
),
|
||||
_buildDivider(),
|
||||
_buildStatItem(
|
||||
'团队层级',
|
||||
'团队下级',
|
||||
stats?.unlockedLevelDepth.toString() ?? '0',
|
||||
isLoading,
|
||||
),
|
||||
|
|
@ -312,108 +306,6 @@ class ProfilePage extends ConsumerWidget {
|
|||
);
|
||||
}
|
||||
|
||||
Widget _buildInvitationCard(BuildContext context, String invitationCode) {
|
||||
return Container(
|
||||
margin: const EdgeInsets.symmetric(horizontal: 16),
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Text(
|
||||
'我的邀请码',
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: _grayText,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 12,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: _bgGray,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Text(
|
||||
invitationCode,
|
||||
style: const TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: _darkText,
|
||||
letterSpacing: 2,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
_buildActionButton(
|
||||
icon: Icons.copy,
|
||||
label: '复制',
|
||||
onTap: () {
|
||||
Clipboard.setData(ClipboardData(text: invitationCode));
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text('邀请码已复制'),
|
||||
duration: Duration(seconds: 1),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
_buildActionButton(
|
||||
icon: Icons.share,
|
||||
label: '分享',
|
||||
onTap: () {
|
||||
// TODO: 分享功能
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildActionButton({
|
||||
required IconData icon,
|
||||
required String label,
|
||||
required VoidCallback onTap,
|
||||
}) {
|
||||
return GestureDetector(
|
||||
onTap: onTap,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
||||
decoration: BoxDecoration(
|
||||
color: _orange,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(icon, size: 16, color: Colors.white),
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
label,
|
||||
style: const TextStyle(
|
||||
fontSize: 12,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildAccountSettings(BuildContext context, UserState user) {
|
||||
return Container(
|
||||
margin: const EdgeInsets.symmetric(horizontal: 16),
|
||||
|
|
@ -440,18 +332,6 @@ class ProfilePage extends ConsumerWidget {
|
|||
label: '账户安全',
|
||||
onTap: () => context.push(Routes.changePassword),
|
||||
),
|
||||
_buildSettingItem(
|
||||
icon: Icons.verified_user,
|
||||
label: '实名认证',
|
||||
trailing: Text(
|
||||
user.isKycVerified ? '已认证' : '未认证',
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: user.isKycVerified ? _green : _lightGray,
|
||||
),
|
||||
),
|
||||
onTap: () {},
|
||||
),
|
||||
_buildSettingItem(
|
||||
icon: Icons.lock_outline,
|
||||
label: '支付密码',
|
||||
|
|
|
|||
Loading…
Reference in New Issue