酷店

KDPAccountListCell.m 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. //
  2. // KDPAccountList.m
  3. // KuDianProject
  4. //
  5. // Created by 学丽 on 2019/7/8.
  6. // Copyright © 2019 KDP. All rights reserved.
  7. //
  8. #import "KDPAccountListCell.h"
  9. @implementation KDPAccountListCell
  10. -(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
  11. {
  12. self=[super initWithStyle:style reuseIdentifier:reuseIdentifier];
  13. if (self) {
  14. self.iconImgV=[[UIImageView alloc]initWithFrame:CGRectMake(15, 14, 42, 42)];
  15. self.iconImgV.backgroundColor=[UIColor colorWithHexString:LineColor];
  16. self.iconImgV.layer.cornerRadius=21;
  17. self.iconImgV.layer.masksToBounds=YES;
  18. [self addSubview:self.iconImgV];
  19. self.titleLabel =[[UILabel alloc]initWithFrame:CGRectMake(self.iconImgV.right+13, self.iconImgV.top, 100, 22)];
  20. self.titleLabel.textColor=[UIColor colorWithHexString:fontColor];
  21. self.titleLabel.font=[UIFont systemFontOfSize:16];
  22. self.titleLabel.text=@"----";
  23. [self addSubview:self.titleLabel];
  24. self.timeLabel=[[UILabel alloc]initWithFrame:CGRectMake(self.titleLabel.left, self.titleLabel.bottom+4, 100, 17)];
  25. self.timeLabel.textColor=[UIColor colorWithHexString:@"#999999"];
  26. self.timeLabel.text=@"----";
  27. self.timeLabel.font=[UIFont systemFontOfSize:12];
  28. [self addSubview:self.timeLabel];
  29. self.moneyLabel=[[UILabel alloc]initWithFrame:CGRectMake(SCREEN_WIDTH-155, self.iconImgV.top, 140, 25)];
  30. self.moneyLabel.textColor=[UIColor colorWithHexString:fontColor];
  31. self.moneyLabel.font=[UIFont boldSystemFontOfSize:18];
  32. // self.moneyLabel.text=@"--";
  33. self.moneyLabel.textAlignment=NSTextAlignmentRight;
  34. [self addSubview:self.moneyLabel];
  35. self.tipeLabel =[[UILabel alloc]initWithFrame:CGRectMake(SCREEN_WIDTH-205, self.moneyLabel.bottom+2, 190, 17)];
  36. self.tipeLabel.textColor=[UIColor colorWithHexString:@"#E04A4A"];
  37. self.tipeLabel.font=[UIFont systemFontOfSize:12];
  38. self.tipeLabel.textAlignment=NSTextAlignmentRight;
  39. [self addSubview:self.tipeLabel];
  40. UIView *lineV=[[UIView alloc]initWithFrame:CGRectMake(self.iconImgV.right, 79, self.width-self.iconImgV.right-10, 1)];
  41. lineV.backgroundColor=[UIColor colorWithHexString:LineColor];
  42. [self addSubview:lineV];
  43. }
  44. return self;
  45. }
  46. -(void)setModel:(KDPBalanceModel *)model
  47. {
  48. _model=model;
  49. [self.iconImgV sd_setImageWithURL:[NSURL URLWithString:model.img]placeholderImage:[UIImage imageNamed:placholderImg]];
  50. self.titleLabel.text=model.title;
  51. self.timeLabel.text=model.create_time;
  52. self.tipeLabel.text=model.message;
  53. if (model.mode.integerValue == 1) {//佣金收入
  54. self.moneyLabel.textColor=[UIColor colorWithHexString:@"#FF8712"];
  55. self.moneyLabel.text=[NSString stringWithFormat:@"%@",model.rebate];
  56. }else if (model.mode.integerValue == 2){//提现
  57. self.moneyLabel.textColor=[UIColor colorWithHexString:@"#343434"];
  58. self.moneyLabel.text=[NSString stringWithFormat:@"%@",model.rebate];
  59. }
  60. }
  61. @end