This commit is contained in:
sion
2026-04-23 00:44:39 +08:00
parent 685202dd55
commit 8047cfaa76
209 changed files with 2660 additions and 5560 deletions

View File

@@ -122,20 +122,26 @@ class AccountTrade {
class AccountFlow {
final int id;
final int userId;
final String flowNo;
final String flowType;
final String amount;
final String balanceBefore;
final String balanceAfter;
final String coinCode;
final String relatedOrderNo;
final String remark;
final DateTime? createTime;
AccountFlow({
required this.id,
required this.userId,
required this.flowNo,
required this.flowType,
required this.amount,
required this.balanceBefore,
required this.balanceAfter,
required this.coinCode,
required this.relatedOrderNo,
required this.remark,
this.createTime,
});
@@ -144,10 +150,13 @@ class AccountFlow {
return AccountFlow(
id: json['id'] as int? ?? 0,
userId: json['userId'] as int? ?? 0,
flowNo: json['flowNo']?.toString() ?? '',
flowType: json['flowType']?.toString() ?? '',
amount: json['amount']?.toString() ?? '0.00',
balanceBefore: json['balanceBefore']?.toString() ?? '0.00',
balanceAfter: json['balanceAfter']?.toString() ?? '0.00',
coinCode: json['coinCode']?.toString() ?? 'USDT',
relatedOrderNo: json['relatedOrderNo']?.toString() ?? '',
remark: json['remark']?.toString() ?? '',
createTime: json['createTime'] != null
? DateTime.tryParse(json['createTime'])

View File

@@ -107,8 +107,7 @@ class Coin {
/// 格式化價格顯示
String get formattedPrice {
if (price >= 1000) return price.toStringAsFixed(2);
if (price >= 1) return price.toStringAsFixed(4);
return price.toStringAsFixed(6);
return price.toStringAsFixed(4);
}
/// 格式化漲跌幅

View File

@@ -47,6 +47,13 @@ class FundService {
);
}
/// 提现前检查45天规则
Future<ApiResponse<Map<String, dynamic>>> withdrawCheck() async {
return _client.get<Map<String, dynamic>>(
ApiEndpoints.withdrawCheck,
);
}
/// 申請提現
Future<ApiResponse<Map<String, dynamic>>> withdraw({
required String amount,

View File

@@ -14,16 +14,21 @@ class TradeService {
required String coinCode,
required String price,
required String quantity,
int orderType = 1, // 1=市价单, 2=限价单
int orderType = 1,
String? tradeCode,
}) async {
final data = <String, dynamic>{
'coinCode': coinCode,
'price': price,
'quantity': quantity,
'orderType': orderType,
};
if (tradeCode != null && tradeCode.isNotEmpty) {
data['tradeCode'] = tradeCode;
}
return _client.post<Map<String, dynamic>>(
ApiEndpoints.buy,
data: {
'coinCode': coinCode,
'price': price,
'quantity': quantity,
'orderType': orderType,
},
data: data,
);
}
@@ -88,4 +93,9 @@ class TradeService {
data: {'orderNo': orderNo},
);
}
/// 獲取今日買入配額
Future<ApiResponse<Map<String, dynamic>>> getBuyQuota() async {
return _client.get<Map<String, dynamic>>(ApiEndpoints.buyQuota);
}
}