// // KDPForecastListCell.m // KuDianProject // // Created by 学丽 on 2019/7/8. // Copyright © 2019 KDP. All rights reserved. // #import "KDPForecastListCell.h" @implementation KDPForecastListCell -(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { self=[super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { self.timeMonthLabel =[[UILabel alloc]initWithFrame:CGRectMake(19, 4, 50, 25)]; self.timeMonthLabel.text=@"--月"; self.timeMonthLabel.font=[UIFont systemFontOfSize:18]; self.timeMonthLabel.textColor=[UIColor colorWithHexString:fontColor]; [self addSubview:self.timeMonthLabel]; self.timeYearLabel =[[UILabel alloc]initWithFrame:CGRectMake(self.timeMonthLabel.left, self.timeMonthLabel.bottom, 50, 14)]; self.timeYearLabel.font=[UIFont systemFontOfSize:10]; self.timeYearLabel.textColor=[UIColor colorWithHexString:@"#706F6F"]; self.timeYearLabel.text=@"----年"; [self addSubview:self.timeYearLabel]; self.numberLabel=[[UILabel alloc]initWithFrame:CGRectMake(self.timeMonthLabel.right+20, 0, 100, 49)]; self.numberLabel.text=@"----单"; self.numberLabel.font=[UIFont systemFontOfSize:15]; self.numberLabel.textColor=[UIColor colorWithHexString:@"#706F6F"]; [self addSubview:self.numberLabel]; self.moneyLabel=[[UILabel alloc]initWithFrame:CGRectMake(SCREEN_WIDTH-200, 0, 170, 49)]; self.moneyLabel.textColor=[UIColor colorWithHexString:ThemeColor]; self.moneyLabel.font=[UIFont systemFontOfSize:18]; self.moneyLabel.textAlignment=NSTextAlignmentRight; self.moneyLabel.text=@"¥---"; [self addSubview:self.moneyLabel]; UIView *lineV=[[UIView alloc]initWithFrame:CGRectMake(10, 49, SCREEN_WIDTH-20, 1)]; lineV.backgroundColor=[UIColor colorWithHexString:LineColor]; [self addSubview:lineV]; } return self; } -(void)setModel:(KDPBalanceModel *)model { _model = model; NSArray *array =[model.yearAndMonth componentsSeparatedByString:@"-"]; if (array.count > 1) { self.timeMonthLabel.text=[NSString stringWithFormat:@"%@月",array[1]]; self.timeYearLabel.text=[NSString stringWithFormat:@"%@年",array[0]]; } self.numberLabel.text=[NSString stringWithFormat:@"共%@单",model.totalOrder]; self.moneyLabel.text=[NSString stringWithFormat:@"¥%@",model.rebateMoney]; } @end