This commit is contained in:
sion
2026-04-21 08:09:45 +08:00
parent 0066615054
commit 5264043c21
1831 changed files with 15376 additions and 39973 deletions

View File

@@ -14,6 +14,12 @@ class Coin {
final double? volume24h;
final int status;
final int sort;
final int isPlatform;
final double? todayProfitRate; // 今日盈利比率(平台代币)
final String? tradeStartAm;
final String? tradeEndAm;
final String? tradeStartPm;
final String? tradeEndPm;
Coin({
required this.id,
@@ -30,6 +36,12 @@ class Coin {
this.volume24h,
required this.status,
this.sort = 0,
this.isPlatform = 0,
this.todayProfitRate,
this.tradeStartAm,
this.tradeEndAm,
this.tradeStartPm,
this.tradeEndPm,
});
factory Coin.fromJson(Map<String, dynamic> json) {
@@ -48,6 +60,12 @@ class Coin {
volume24h: (json['volume24h'] as num?)?.toDouble(),
status: json['status'] as int? ?? 1,
sort: json['sort'] as int? ?? 0,
isPlatform: json['isPlatform'] as int? ?? 0,
todayProfitRate: (json['todayProfitRate'] as num?)?.toDouble(),
tradeStartAm: json['tradeStartAm'] as String?,
tradeEndAm: json['tradeEndAm'] as String?,
tradeStartPm: json['tradeStartPm'] as String?,
tradeEndPm: json['tradeEndPm'] as String?,
);
}
@@ -67,6 +85,7 @@ class Coin {
'volume24h': volume24h,
'status': status,
'sort': sort,
'isPlatform': isPlatform,
};
}

View File

@@ -8,7 +8,8 @@ class OrderTrade {
final String price;
final String quantity;
final String amount;
final int status; // 1=待處理, 2=已成, 3=已取消
final int status; // 0=委托中, 1=已成交, 2=失败, 3=已取消
final int? orderType; // 1=市价单, 2=限价单
final DateTime? createTime;
final DateTime? updateTime;
@@ -22,6 +23,7 @@ class OrderTrade {
required this.quantity,
required this.amount,
required this.status,
this.orderType,
this.createTime,
this.updateTime,
});
@@ -37,6 +39,7 @@ class OrderTrade {
quantity: json['quantity']?.toString() ?? '0',
amount: json['amount']?.toString() ?? '0.00',
status: json['status'] as int? ?? 1,
orderType: json['orderType'] as int?,
createTime: json['createTime'] != null
? DateTime.tryParse(json['createTime'])
: null,
@@ -52,10 +55,12 @@ class OrderTrade {
/// 狀態文字
String get statusText {
switch (status) {
case 0:
return '委托中';
case 1:
return '待處理';
return '已成交';
case 2:
return '已完成';
return '失败';
case 3:
return '已取消';
default:
@@ -63,8 +68,14 @@ class OrderTrade {
}
}
/// 是否为委托中
bool get isPending => status == 0;
/// 是否為買入
bool get isBuy => direction == 1;
/// 订单类型文字
String get orderTypeText => orderType == 2 ? '限价' : '市价';
}
/// 充提訂單模型