StudentListCell.m 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. //
  2. // StudentListCell.m
  3. // LNManager
  4. //
  5. // Created by apple on 2017/5/5.
  6. // Copyright © 2017年 lee. All rights reserved.
  7. //
  8. #import "StudentListCell.h"
  9. @implementation StudentListCell
  10. - (void)awakeFromNib {
  11. [super awakeFromNib];
  12. // Initialization code
  13. }
  14. -(void)setDataDic:(NSDictionary *)dataDic {
  15. _dataDic = dataDic;
  16. //赋值
  17. _nameLabel.text = dataDic[@"TSO_NAME"];
  18. _carTypeLabel.text = dataDic[@"TSO_TRAINTYPE"];
  19. NSString *subject = [NSString stringWithFormat:@"%@",dataDic[@"TSO_STATE"]];
  20. switch ([subject integerValue]) {
  21. case 1:
  22. _dateLabel.text = @"科目一";
  23. _dateLabel.textColor = COLOR_THEME;
  24. break;
  25. case 2:
  26. _dateLabel.text = @"科目二";
  27. _dateLabel.textColor = COLOR_THEME;
  28. break;
  29. case 3:
  30. _dateLabel.text = @"科目三";
  31. _dateLabel.textColor = COLOR_THEME;
  32. break;
  33. case 4:
  34. _dateLabel.text = @"科目四";
  35. _dateLabel.textColor = COLOR_THEME;
  36. break;
  37. case 5:
  38. _dateLabel.text = @"已结业";
  39. _dateLabel.textColor = [UIColor redColor];
  40. break;
  41. default:
  42. break;
  43. }
  44. }
  45. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  46. [super setSelected:selected animated:animated];
  47. // Configure the view for the selected state
  48. }
  49. @end