2025-08-08 10:49:36 +08:00
|
|
|
//
|
|
|
|
|
// QXCornRecordCell.m
|
|
|
|
|
// QXLive
|
|
|
|
|
//
|
|
|
|
|
// Created by 启星 on 2025/5/27.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
#import "QXCornRecordCell.h"
|
|
|
|
|
#import "NSDate+QX.h"
|
|
|
|
|
|
|
|
|
|
@implementation QXCornRecordCell
|
|
|
|
|
+(instancetype)cellWithTableView:(UITableView *)tableView{
|
|
|
|
|
static NSString *cellId = @"QXCornRecordCell";
|
|
|
|
|
QXCornRecordCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
|
|
|
|
|
if (!cell) {
|
|
|
|
|
cell = [[NSBundle mainBundle] loadNibNamed:cellId owner:nil options:nil].lastObject;
|
|
|
|
|
cell.backgroundColor = [UIColor clearColor];
|
|
|
|
|
}
|
|
|
|
|
return cell;
|
|
|
|
|
}
|
2025-10-20 09:43:10 +08:00
|
|
|
-(void)setIsCoin:(BOOL)isCoin{
|
|
|
|
|
_isCoin = isCoin;
|
2025-12-01 18:42:49 +08:00
|
|
|
self.iconImageView.image = [UIImage imageNamed:isCoin?@"mine_recharge_corn":@"family_diamond"];
|
2025-10-20 09:43:10 +08:00
|
|
|
}
|
2025-08-08 10:49:36 +08:00
|
|
|
-(void)setModel:(QXCoinDetailModel *)model{
|
|
|
|
|
_model = model;
|
|
|
|
|
self.reasonLabel.text = model.remarks;
|
|
|
|
|
NSDate *date = [NSDate dateWithTimeIntervalSince1970:model.createtime.longLongValue]; //此处根据项目需求,选择是否除以1000 , 如果时间戳精确到秒则去掉1000
|
|
|
|
|
NSDateFormatter *formatter = [[NSDateFormatter alloc]init];
|
|
|
|
|
formatter.dateFormat = @"yyyy-MM-dd HH:mm:ss";
|
|
|
|
|
NSString*time = [formatter stringFromDate:date];
|
|
|
|
|
self.timeLabel.text = time;
|
2025-10-20 09:43:10 +08:00
|
|
|
if (self.isCoin) {
|
|
|
|
|
self.priceLabel.text = [NSString stringWithFormat:@"%.2f",model.change_value.doubleValue];
|
|
|
|
|
}else{
|
|
|
|
|
self.priceLabel.text = [NSString stringWithFormat:@"%.4f",model.change_value.doubleValue];
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-08 10:49:36 +08:00
|
|
|
}
|
|
|
|
|
- (void)awakeFromNib {
|
|
|
|
|
[super awakeFromNib];
|
|
|
|
|
// Initialization code
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
|
|
|
|
|
[super setSelected:selected animated:animated];
|
|
|
|
|
|
|
|
|
|
// Configure the view for the selected state
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@end
|