酷店

KDPForecastListCell.m 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. //
  2. // KDPForecastListCell.m
  3. // KuDianProject
  4. //
  5. // Created by 学丽 on 2019/7/8.
  6. // Copyright © 2019 KDP. All rights reserved.
  7. //
  8. #import "KDPForecastListCell.h"
  9. @implementation KDPForecastListCell
  10. -(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
  11. {
  12. self=[super initWithStyle:style reuseIdentifier:reuseIdentifier];
  13. if (self) {
  14. self.timeMonthLabel =[[UILabel alloc]initWithFrame:CGRectMake(19, 4, 50, 25)];
  15. self.timeMonthLabel.text=@"--月";
  16. self.timeMonthLabel.font=[UIFont systemFontOfSize:18];
  17. self.timeMonthLabel.textColor=[UIColor colorWithHexString:fontColor];
  18. [self addSubview:self.timeMonthLabel];
  19. self.timeYearLabel =[[UILabel alloc]initWithFrame:CGRectMake(self.timeMonthLabel.left, self.timeMonthLabel.bottom, 50, 14)];
  20. self.timeYearLabel.font=[UIFont systemFontOfSize:10];
  21. self.timeYearLabel.textColor=[UIColor colorWithHexString:@"#706F6F"];
  22. self.timeYearLabel.text=@"----年";
  23. [self addSubview:self.timeYearLabel];
  24. self.numberLabel=[[UILabel alloc]initWithFrame:CGRectMake(self.timeMonthLabel.right+20, 0, 100, 49)];
  25. self.numberLabel.text=@"----单";
  26. self.numberLabel.font=[UIFont systemFontOfSize:15];
  27. self.numberLabel.textColor=[UIColor colorWithHexString:@"#706F6F"];
  28. [self addSubview:self.numberLabel];
  29. self.moneyLabel=[[UILabel alloc]initWithFrame:CGRectMake(SCREEN_WIDTH-200, 0, 170, 49)];
  30. self.moneyLabel.textColor=[UIColor colorWithHexString:ThemeColor];
  31. self.moneyLabel.font=[UIFont systemFontOfSize:18];
  32. self.moneyLabel.textAlignment=NSTextAlignmentRight;
  33. self.moneyLabel.text=@"¥---";
  34. [self addSubview:self.moneyLabel];
  35. UIView *lineV=[[UIView alloc]initWithFrame:CGRectMake(10, 49, SCREEN_WIDTH-20, 1)];
  36. lineV.backgroundColor=[UIColor colorWithHexString:LineColor];
  37. [self addSubview:lineV];
  38. }
  39. return self;
  40. }
  41. -(void)setModel:(KDPBalanceModel *)model
  42. {
  43. _model = model;
  44. NSArray *array =[model.yearAndMonth componentsSeparatedByString:@"-"];
  45. if (array.count > 1) {
  46. self.timeMonthLabel.text=[NSString stringWithFormat:@"%@月",array[1]];
  47. self.timeYearLabel.text=[NSString stringWithFormat:@"%@年",array[0]];
  48. }
  49. self.numberLabel.text=[NSString stringWithFormat:@"共%@单",model.totalOrder];
  50. self.moneyLabel.text=[NSString stringWithFormat:@"¥%@",model.rebateMoney];
  51. }
  52. @end