// // KDPAccountList.m // KuDianProject // // Created by 学丽 on 2019/7/8. // Copyright © 2019 KDP. All rights reserved. // #import "KDPAccountListCell.h" @implementation KDPAccountListCell -(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { self=[super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { self.iconImgV=[[UIImageView alloc]initWithFrame:CGRectMake(15, 14, 42, 42)]; self.iconImgV.backgroundColor=[UIColor colorWithHexString:LineColor]; self.iconImgV.layer.cornerRadius=21; self.iconImgV.layer.masksToBounds=YES; [self addSubview:self.iconImgV]; self.titleLabel =[[UILabel alloc]initWithFrame:CGRectMake(self.iconImgV.right+13, self.iconImgV.top, 100, 22)]; self.titleLabel.textColor=[UIColor colorWithHexString:fontColor]; self.titleLabel.font=[UIFont systemFontOfSize:16]; self.titleLabel.text=@"----"; [self addSubview:self.titleLabel]; self.timeLabel=[[UILabel alloc]initWithFrame:CGRectMake(self.titleLabel.left, self.titleLabel.bottom+4, 100, 17)]; self.timeLabel.textColor=[UIColor colorWithHexString:@"#999999"]; self.timeLabel.text=@"----"; self.timeLabel.font=[UIFont systemFontOfSize:12]; [self addSubview:self.timeLabel]; self.moneyLabel=[[UILabel alloc]initWithFrame:CGRectMake(SCREEN_WIDTH-155, self.iconImgV.top, 140, 25)]; self.moneyLabel.textColor=[UIColor colorWithHexString:fontColor]; self.moneyLabel.font=[UIFont boldSystemFontOfSize:18]; // self.moneyLabel.text=@"--"; self.moneyLabel.textAlignment=NSTextAlignmentRight; [self addSubview:self.moneyLabel]; self.tipeLabel =[[UILabel alloc]initWithFrame:CGRectMake(SCREEN_WIDTH-205, self.moneyLabel.bottom+2, 190, 17)]; self.tipeLabel.textColor=[UIColor colorWithHexString:@"#E04A4A"]; self.tipeLabel.font=[UIFont systemFontOfSize:12]; self.tipeLabel.textAlignment=NSTextAlignmentRight; [self addSubview:self.tipeLabel]; UIView *lineV=[[UIView alloc]initWithFrame:CGRectMake(self.iconImgV.right, 79, self.width-self.iconImgV.right-10, 1)]; lineV.backgroundColor=[UIColor colorWithHexString:LineColor]; [self addSubview:lineV]; } return self; } -(void)setModel:(KDPBalanceModel *)model { _model=model; [self.iconImgV sd_setImageWithURL:[NSURL URLWithString:model.img]placeholderImage:[UIImage imageNamed:placholderImg]]; self.titleLabel.text=model.title; self.timeLabel.text=model.create_time; self.tipeLabel.text=model.message; if (model.mode.integerValue == 1) {//佣金收入 self.moneyLabel.textColor=[UIColor colorWithHexString:@"#FF8712"]; self.moneyLabel.text=[NSString stringWithFormat:@"%@",model.rebate]; }else if (model.mode.integerValue == 2){//提现 self.moneyLabel.textColor=[UIColor colorWithHexString:@"#343434"]; self.moneyLabel.text=[NSString stringWithFormat:@"%@",model.rebate]; } } @end