ClsTheoryListCell.m 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. //
  2. // ClsTheoryListCell.m
  3. // JSJPCoach
  4. //
  5. // Created by EchoShacolee on 2017/7/19.
  6. // Copyright © 2017年 Danson. All rights reserved.
  7. //
  8. #define dingColor [UIColor colorWithRed:236/255.0 green:190/255.0 blue:44/255.0 alpha:1]
  9. #import "ClsTheoryListCell.h"
  10. @implementation ClsTheoryListCell
  11. +(ClsTheoryListCell *)cellForTableView:(UITableView *)tableView{
  12. ClsTheoryListCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ClsTheoryListCell"];
  13. if (!cell) {
  14. cell = [[NSBundle mainBundle] loadNibNamed:@"ClsTheoryListCell" owner:nil options:nil].lastObject;
  15. }
  16. return cell;
  17. }
  18. -(void)setDic:(NSDictionary *)dic{
  19. _dic = dic;
  20. self.issueNum.textColor = dingColor;
  21. self.issueNum.font = [UIFont scaleSize:17];
  22. self.issueNum.text = [NSString stringWithFormat:@"%@期",dic[@"TSC_CLASS_NAME"]];
  23. self.status.font = [UIFont scaleSize:15];
  24. NSString *statuStr = @"";
  25. switch ([[NSString stringWithFormat:@"%@",dic[@"TR_AUDIT_STATUS"]] intValue]) {
  26. case 0:
  27. statuStr = @"待审核";
  28. self.status.textColor = [UIColor lightGrayColor];
  29. break;
  30. case 1:
  31. statuStr = @"审核通过";
  32. self.status.textColor = contentTextColor;
  33. break;
  34. case 2:
  35. statuStr = @"审核不通过";
  36. self.status.textColor = [UIColor redColor];
  37. break;
  38. default:
  39. break;
  40. }
  41. self.status.text = [NSString stringWithFormat:@"%@",statuStr];
  42. self.kemu.font = [UIFont scaleSize:15];
  43. self.kemu.textColor = contentTextColor;
  44. NSString *kemuStr = @"";
  45. switch ([[NSString stringWithFormat:@"%@",dic[@"TSC_SUBJECT"]] intValue]) {
  46. case 1:
  47. kemuStr = @"一";
  48. break;
  49. case 2:
  50. kemuStr = @"二";
  51. break;
  52. case 3:
  53. kemuStr = @"三";
  54. break;
  55. case 4:
  56. kemuStr = @"四";
  57. break;
  58. default:
  59. break;
  60. }
  61. if ([[NSString stringWithFormat:@"%@",dic[@"TSC_TYPE"]] isEqualToString:@"1"]) {
  62. kemuStr = [kemuStr stringByAppendingString:@"理论"];
  63. }else{
  64. kemuStr = [kemuStr stringByAppendingString:@"模拟"];
  65. }
  66. self.kemu.text = [NSString stringWithFormat:@"科目%@",kemuStr];
  67. self.coach.font = [UIFont scaleSize:15];
  68. self.coach.textColor = contentTextColor;
  69. self.coach.text = [NSString stringWithFormat:@"带班教练:%@",dic[@"TSC_COACH_NAME"]];
  70. self.date.font = [UIFont scaleSize:15];
  71. self.date.textColor = contentTextColor;
  72. NSString *start = [NSString stringWithFormat:@"%@",dic[@"TSC_CLASS_DATE"]];
  73. if (start.length >= 10) {
  74. start = [start substringToIndex:10];
  75. }
  76. NSString *end = [NSString stringWithFormat:@"%@",dic[@"TSC_END_TIME"]];
  77. if (end.length >= 10) {
  78. end = [end substringToIndex:10];
  79. }
  80. self.date.text = [NSString stringWithFormat:@"开班日期:%@ ~ %@",start,end];
  81. }
  82. - (void)awakeFromNib {
  83. [super awakeFromNib];
  84. // Initialization code
  85. }
  86. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  87. [super setSelected:selected animated:animated];
  88. // Configure the view for the selected state
  89. }
  90. @end