-(UITableViewCell) renderEthTransactionCell:(CellTransactionInfo)cell inexPath:(NSIndexPath*)indexPath {
Transaction *t = self.dataList[indexPath.row];
if (_pageType != TransactionPageTypeOneToken) {
if ([t.Status isEqualToString:@”0”]) {
cell.icon.image = [UIImage imageNamed:@”ic_transaction_error”];
cell.pending.hidden = NO;
cell.pending.text = @”交易失败”;
cell.pending.textColor = UIColorFromRGB(0xFF1A1A);
cell.addrees.text = t.To;
cell.time.text = [t.Timestamp FormatUnixTimeStringToDate];
[cell.value setMultipleFont:@[
[NSString stringWithFormat:@”-%@ “, [t.Value RemoveExcessZeros]],
t.Symbol,
] fonts:@[
[UIFont fontWithName:@”DIN Alternate” size:16],
[UIFont systemFontOfSize:12 weight:UIFontWeightSemibold],
] colors:@[
UIColorFromRGB(0x19B4E3),
UIColorFromRGB(0x19B4E3),
]];
}else if ([[t.From lowercaseString] isEqualToString:[_currentWallet.Address lowercaseString]]) {
cell.icon.image = [UIImage imageNamed:@”ic_transaction_out”];
cell.pending.hidden = YES;
if (tglStringIsNilOrEmpty(t.BlockNumber)) {
cell.time.text = @”处理中”;
}else {
cell.time.text = [t.Timestamp FormatUnixTimeStringToDate];
}
cell.addrees.text = t.To;
[cell.value setMultipleFont:@[
[NSString stringWithFormat:@”-%@ “, [t.Value RemoveExcessZeros]],
t.Symbol,
] fonts:@[
[UIFont fontWithName:@”DIN Alternate” size:16],
[UIFont systemFontOfSize:12 weight:UIFontWeightSemibold],
] colors:@[
UIColorFromRGB(0x19B4E3),
UIColorFromRGB(0x19B4E3),
]];
}else {
if ([self checkFromInWalletList:t.From]) {
cell.icon.image = [UIImage imageNamed:@”ic_transaction_out”];
[cell.value setMultipleFont:@[
[NSString stringWithFormat:@”-%@ “, [t.Value RemoveExcessZeros]],
t.Symbol,
] fonts:@[
[UIFont fontWithName:@”DIN Alternate” size:16],
[UIFont systemFontOfSize:12 weight:UIFontWeightSemibold],
] colors:@[
UIColorFromRGB(0x19B4E3),
UIColorFromRGB(0x19B4E3),
]];
}else {
cell.icon.image = [UIImage imageNamed:@”ic_transaction_in”];
[cell.value setMultipleFont:@[
[NSString stringWithFormat:@”+%@ “, [t.Value RemoveExcessZeros]],
t.Symbol,
] fonts:@[
[UIFont fontWithName:@”DIN Alternate” size:16],
[UIFont systemFontOfSize:12 weight:UIFontWeightSemibold],
] colors:@[
UIColorFromRGB(0x14c4c4),
UIColorFromRGB(0x14c4c4),
]];
}
cell.pending.hidden = YES;
cell.time.text = [t.Timestamp FormatUnixTimeStringToDate];
cell.addrees.text = t.From;
}
if (![t.Status isEqualToString:@"0"]) {
if ([t.Confirmations integerValue] <= 12 && [t.Confirmations integerValue] > 0) {
[cell setProgressIndex:[t.Confirmations integerValue]];
cell.pending.hidden = NO;
cell.pending.textColor = UIColorFromRGB(0x8B8D8F);
cell.pending.text = [NSString stringWithFormat:@"%ld / 12", [t.Confirmations integerValue]];
}else {
[cell setProgressIndex:0];
cell.pending.hidden = YES;
}
}
}else {
if ([_choosedToken.Symbol isEqualToString:@"ETH"]) {
t.Symbol = @"ETH";
if ([t.Status isEqualToString:@"0"]) {
cell.icon.image = [UIImage imageNamed:@"ic_transaction_error"];
cell.pending.hidden = NO;
cell.pending.text = @"转账失败";
cell.pending.textColor = UIColorFromRGB(0xFF1A1A);
[cell.value setMultipleFont:@[
[NSString stringWithFormat:@"-%@ ", [t.Value RemoveExcessZeros]],
t.Symbol,
] fonts:@[
[UIFont fontWithName:@"DIN Alternate" size:16],
[UIFont systemFontOfSize:12 weight:UIFontWeightSemibold],
] colors:@[
UIColorFromRGB(0x19B4E3),
UIColorFromRGB(0x19B4E3),
]];
cell.addrees.text = t.To;
if (!tglStringIsNilOrEmpty(t.Timestamp)) {
cell.time.text = [t.Timestamp FormatUnixTimeStringToDate];
}
}else if ([[t.From lowercaseString] isEqualToString:[_currentWallet.Address lowercaseString]]) {
cell.pending.hidden = YES;
cell.icon.image = [UIImage imageNamed:@"ic_transaction_out"];
[cell.value setMultipleFont:@[
[NSString stringWithFormat:@"-%@ ", [t.Value RemoveExcessZeros]],
t.Symbol,
] fonts:@[
[UIFont fontWithName:@"DIN Alternate" size:16],
[UIFont systemFontOfSize:12 weight:UIFontWeightSemibold],
] colors:@[
UIColorFromRGB(0x19B4E3),
UIColorFromRGB(0x19B4E3),
]];
cell.addrees.text = t.To;
if (tglStringIsNilOrEmpty(t.BlockNumber)) {
cell.time.text = @"处理中";
}else {
cell.time.text = [t.Timestamp FormatUnixTimeStringToDate];
}
}else {
cell.pending.hidden = false;
[cell.value setMultipleFont:@[
[NSString stringWithFormat:@"+%@ ", [t.Value RemoveExcessZeros]],
t.Symbol,
] fonts:@[
[UIFont fontWithName:@"DIN Alternate" size:16],
[UIFont systemFontOfSize:12 weight:UIFontWeightSemibold],
] colors:@[
UIColorFromRGB(0x14c4c4),
UIColorFromRGB(0x14c4c4),
]];
cell.icon.image = [UIImage imageNamed:@"ic_transaction_in"];
cell.addrees.text = t.From;
if (!tglStringIsNilOrEmpty(t.Timestamp)) {
cell.time.text = [t.Timestamp FormatUnixTimeStringToDate];
}
}
}else {
if ([[t.From lowercaseString] isEqualToString:[_currentWallet.Address lowercaseString]]) {
cell.pending.hidden = YES;
cell.icon.image = [UIImage imageNamed:@"ic_transaction_out"];
cell.value.textColor = UIColorFromRGB(0x19B4E3);
cell.addrees.text = t.To;
if (t.IsPending) {
cell.time.text = @"处理中";
}else {
if (!tglStringIsNilOrEmpty(t.Timestamp)) {
cell.time.text = [t.Timestamp FormatUnixTimeStringToDate];
}
}
[cell.value setMultipleFont:@[
[NSString stringWithFormat:@"-%@ ", [t.Value RemoveExcessZeros]],
t.Symbol,
] fonts:@[
[UIFont fontWithName:@"DIN Alternate" size:16],
[UIFont systemFontOfSize:12 weight:UIFontWeightSemibold],
] colors:@[
UIColorFromRGB(0x19B4E3),
UIColorFromRGB(0x19B4E3),
]];
}else {
cell.pending.hidden = YES;
[cell.value setMultipleFont:@[
[NSString stringWithFormat:@"+%@ ", [t.Value RemoveExcessZeros]],
t.Symbol,
] fonts:@[
[UIFont fontWithName:@"DIN Alternate" size:16],
[UIFont systemFontOfSize:12 weight:UIFontWeightSemibold],
] colors:@[
UIColorFromRGB(0x14c4c4),
UIColorFromRGB(0x14c4c4),
]];
cell.icon.image = [UIImage imageNamed:@"ic_transaction_in"];
cell.value.textColor = UIColorFromRGB(0x14c4c4);
cell.addrees.text = t.From;
if (!tglStringIsNilOrEmpty(t.Timestamp)) {
cell.time.text = [t.Timestamp FormatUnixTimeStringToDate];
}
}
}
if (![t.Status isEqualToString:@"0"]) {
if ([t.Confirmations integerValue] <= 12 && [t.Confirmations integerValue] > 0) {
[cell setProgressIndex:[t.Confirmations integerValue]];
cell.pending.hidden = NO;
cell.pending.textColor = UIColorFromRGB(0x8B8D8F);
cell.pending.text = [NSString stringWithFormat:@"%ld / 12", [t.Confirmations integerValue]];
}else {
[cell setProgressIndex:0];
cell.pending.hidden = YES;
}
}
}
return cell; }
近期评论