111
This commit is contained in:
@@ -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'])
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
/// 格式化漲跌幅
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user