This commit is contained in:
sion
2026-04-07 01:05:05 +08:00
parent edad10ff06
commit 5ca1274607
83 changed files with 1561 additions and 1241 deletions

View File

@@ -1,4 +1,4 @@
/// 资产总览模型
/// 資產總覽模型
class AssetOverview {
final String totalAsset;
final String fundBalance;
@@ -22,7 +22,7 @@ class AssetOverview {
}
}
/// 资金账户模型
/// 資金賬戶模型
class AccountFund {
final int id;
final int userId;
@@ -51,7 +51,7 @@ class AccountFund {
}
}
/// 交易账户模型(持
/// 交易賬戶模型(持
class AccountTrade {
final int id;
final int userId;
@@ -78,7 +78,7 @@ class AccountTrade {
});
factory AccountTrade.fromJson(Map<String, dynamic> json) {
// 端返回 value当前价值),前端用 currentValue
// 端返回 value當前價值),前端用 currentValue
final quantityNum =
double.tryParse(json['quantity']?.toString() ?? '0') ?? 0;
final avgPriceNum =
@@ -108,7 +108,7 @@ class AccountTrade {
);
}
/// 格式化盈
/// 格式化盈
String get formattedProfitRate {
final prefix = profitRate >= 0 ? '+' : '';
return '$prefix${profitRate.toStringAsFixed(2)}%';
@@ -118,7 +118,7 @@ class AccountTrade {
bool get isProfit => profitRate >= 0;
}
/// 金流水模型
/// 金流水模型
class AccountFlow {
final int id;
final int userId;
@@ -155,26 +155,26 @@ class AccountFlow {
);
}
/// 流水型文字
/// 流水型文字
String get flowTypeText {
switch (flowType) {
case '1':
return '充值';
case '2':
return '';
return '';
case '3':
return '入交易账户';
return '入交易賬戶';
case '4':
return '交易账户转';
return '交易賬戶轉';
case '5':
return '出收入';
return '出收入';
case '6':
return '入支出';
return '入支出';
default:
return '未知';
}
}
/// 是否收入
/// 是否收入
bool get isIncome => ['1', '3', '5'].contains(flowType);
}