46 lines
1.7 KiB
Objective-C
46 lines
1.7 KiB
Objective-C
//
|
|
// QXFamilyPriceRecordCell.m
|
|
// QXLive
|
|
//
|
|
// Created by 启星 on 2025/11/26.
|
|
//
|
|
|
|
#import "QXFamilyPriceRecordCell.h"
|
|
|
|
@implementation QXFamilyPriceRecordCell
|
|
+(instancetype)cellWithTableView:(UITableView *)tableView{
|
|
static NSString *cellId = @"QXFamilyPriceRecordCell";
|
|
QXFamilyPriceRecordCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
|
|
if (!cell) {
|
|
cell = [[NSBundle mainBundle] loadNibNamed:cellId owner:nil options:nil].lastObject;
|
|
cell.backgroundColor = [UIColor clearColor];
|
|
cell.contentView.backgroundColor = [UIColor clearColor];
|
|
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
|
}
|
|
return cell;
|
|
}
|
|
-(void)setModel:(QXFamilyEarningModel *)model{
|
|
_model = model;
|
|
self.nameLabel.text = model.nickname;
|
|
self.giftLabel.text = [NSString stringWithFormat:@"礼物名称:%@",model.gift_name];
|
|
self.giftPriceLabel.text = [NSString stringWithFormat:@"礼物金额:%@",model.gift_price];
|
|
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;
|
|
self.moneyLabel.text = [NSString stringWithFormat:@"+%@",model.earnings];
|
|
}
|
|
- (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
|