refactor(frontend): replace all '直推' with '引荐'
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
1efe39c6bd
commit
747e8bfee1
|
|
@ -9,7 +9,7 @@ abstract class ReferralRemoteDataSource {
|
||||||
required String accountSequence,
|
required String accountSequence,
|
||||||
});
|
});
|
||||||
|
|
||||||
/// 获取指定用户的直推列表(用于伞下树懒加载)
|
/// 获取指定用户的引荐列表(用于伞下树懒加载)
|
||||||
Future<DirectReferralsResponse> getUserDirectReferrals({
|
Future<DirectReferralsResponse> getUserDirectReferrals({
|
||||||
required String accountSequence,
|
required String accountSequence,
|
||||||
int limit = 100,
|
int limit = 100,
|
||||||
|
|
@ -50,7 +50,7 @@ class ReferralRemoteDataSourceImpl implements ReferralRemoteDataSource {
|
||||||
int offset = 0,
|
int offset = 0,
|
||||||
}) async {
|
}) async {
|
||||||
try {
|
try {
|
||||||
debugPrint('获取用户直推列表: accountSequence=$accountSequence');
|
debugPrint('获取用户引荐列表: accountSequence=$accountSequence');
|
||||||
final response = await client.get(
|
final response = await client.get(
|
||||||
ApiEndpoints.teamDirectReferrals(accountSequence),
|
ApiEndpoints.teamDirectReferrals(accountSequence),
|
||||||
queryParameters: {
|
queryParameters: {
|
||||||
|
|
@ -61,13 +61,13 @@ class ReferralRemoteDataSourceImpl implements ReferralRemoteDataSource {
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
final data = response.data as Map<String, dynamic>;
|
final data = response.data as Map<String, dynamic>;
|
||||||
debugPrint('用户直推列表获取成功: total=${data['total']}');
|
debugPrint('用户引荐列表获取成功: total=${data['total']}');
|
||||||
return DirectReferralsResponse.fromJson(data);
|
return DirectReferralsResponse.fromJson(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw Exception('获取用户直推列表失败');
|
throw Exception('获取用户引荐列表失败');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
debugPrint('获取用户直推列表失败: $e');
|
debugPrint('获取用户引荐列表失败: $e');
|
||||||
rethrow;
|
rethrow;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ class ReferralInfoResponse {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 直推成员信息
|
/// 引荐成员信息
|
||||||
class DirectReferralInfo {
|
class DirectReferralInfo {
|
||||||
final String accountSequence;
|
final String accountSequence;
|
||||||
final int personalPlantingCount;
|
final int personalPlantingCount;
|
||||||
|
|
@ -46,7 +46,7 @@ class DirectReferralInfo {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 直推列表响应
|
/// 引荐列表响应
|
||||||
class DirectReferralsResponse {
|
class DirectReferralsResponse {
|
||||||
final List<DirectReferralInfo> referrals;
|
final List<DirectReferralInfo> referrals;
|
||||||
final int total;
|
final int total;
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ class Contribution extends Equatable {
|
||||||
final String totalContribution;
|
final String totalContribution;
|
||||||
/// 是否已参与
|
/// 是否已参与
|
||||||
final bool hasAdopted;
|
final bool hasAdopted;
|
||||||
/// 直推参与用户数
|
/// 引荐参与用户数
|
||||||
final int directReferralAdoptedCount;
|
final int directReferralAdoptedCount;
|
||||||
/// 已解锁层级深度
|
/// 已解锁层级深度
|
||||||
final int unlockedLevelDepth;
|
final int unlockedLevelDepth;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import 'package:equatable/equatable.dart';
|
||||||
/// 贡献值来源类型
|
/// 贡献值来源类型
|
||||||
enum ContributionSourceType {
|
enum ContributionSourceType {
|
||||||
personal, // 个人 - 参与
|
personal, // 个人 - 参与
|
||||||
teamLevel, // 团队层级 - 直推/间推奖励
|
teamLevel, // 团队层级 - 引荐/间推奖励
|
||||||
teamBonus, // 团队奖励 - 额外奖励
|
teamBonus, // 团队奖励 - 额外奖励
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -48,7 +48,7 @@ class ContributionRecord extends Equatable {
|
||||||
return '参与';
|
return '参与';
|
||||||
case ContributionSourceType.teamLevel:
|
case ContributionSourceType.teamLevel:
|
||||||
if (levelDepth == 1) {
|
if (levelDepth == 1) {
|
||||||
return '直推奖励';
|
return '引荐奖励';
|
||||||
}
|
}
|
||||||
return '团队奖励($levelDepth级)';
|
return '团队奖励($levelDepth级)';
|
||||||
case ContributionSourceType.teamBonus:
|
case ContributionSourceType.teamBonus:
|
||||||
|
|
|
||||||
|
|
@ -207,7 +207,7 @@ class _TeamPageState extends ConsumerState<TeamPage> {
|
||||||
),
|
),
|
||||||
_buildDivider(),
|
_buildDivider(),
|
||||||
_buildStatItem(
|
_buildStatItem(
|
||||||
'直推人数',
|
'引荐人数',
|
||||||
'${_rootNode?.directReferralCount ?? 0} 人',
|
'${_rootNode?.directReferralCount ?? 0} 人',
|
||||||
Icons.person_add,
|
Icons.person_add,
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ class UserStats {
|
||||||
/// 是否已参与
|
/// 是否已参与
|
||||||
final bool hasAdopted;
|
final bool hasAdopted;
|
||||||
|
|
||||||
/// 直推参与用户数
|
/// 引荐参与用户数
|
||||||
final int directReferralAdoptedCount;
|
final int directReferralAdoptedCount;
|
||||||
|
|
||||||
/// 已解锁层级深度(可理解为团队层数)
|
/// 已解锁层级深度(可理解为团队层数)
|
||||||
|
|
@ -47,7 +47,7 @@ class UserStats {
|
||||||
return 'V$unlockedBonusTiers';
|
return 'V$unlockedBonusTiers';
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 参与数量(简化展示直推数)
|
/// 参与数量(简化展示引荐数)
|
||||||
int get adoptionCount => hasAdopted ? 1 : 0;
|
int get adoptionCount => hasAdopted ? 1 : 0;
|
||||||
|
|
||||||
/// 团队人数估算(基于已解锁层级)
|
/// 团队人数估算(基于已解锁层级)
|
||||||
|
|
|
||||||
|
|
@ -480,8 +480,8 @@ class _NodeDetailsSheet extends StatelessWidget {
|
||||||
_buildDetailRow('团队参与', '${node.teamPlantingCount} 棵'),
|
_buildDetailRow('团队参与', '${node.teamPlantingCount} 棵'),
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
|
|
||||||
// 直推人数
|
// 引荐人数
|
||||||
_buildDetailRow('直推人数', '${node.directReferralCount} 人'),
|
_buildDetailRow('引荐人数', '${node.directReferralCount} 人'),
|
||||||
const SizedBox(height: 24),
|
const SizedBox(height: 24),
|
||||||
|
|
||||||
// 操作按钮
|
// 操作按钮
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue