TeachLogCell.m 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. //
  2. // TeachLogCell.m
  3. // LNManager
  4. //
  5. // Created by EchoShacolee on 2017/4/12.
  6. // Copyright © 2017年 lee. All rights reserved.
  7. //
  8. #import "TeachLogCell.h"
  9. @implementation TeachLogCell
  10. - (void)awakeFromNib {
  11. [super awakeFromNib];
  12. }
  13. /*
  14. CLASSID = 1291492734225373;
  15. ENDTIME = "2017-04-21 08:48:01";
  16. MILE = 0;
  17. STARTTIME = "2017-04-21 08:23:45";
  18. STUNAME = "\U5b98\U4e3d\U73cd";
  19. STUNUM = 2101040744781282;
  20. SUBJECT = 2;
  21. TIME = 21;
  22. */
  23. -(void)setDataWithDic:(NSDictionary *)dic{
  24. _nameLabel.text = dic[@"STUNAME"];
  25. switch ([[NSString stringWithFormat:@"%@",dic[@"SUBJECT"]] integerValue]) {
  26. case 1:
  27. _subjectlabel.text = @"科目:科目一";
  28. break;
  29. case 2:
  30. _subjectlabel.text = @"科目:科目二";
  31. break;
  32. case 3:
  33. _subjectlabel.text = @"科目:科目三";
  34. break;
  35. case 4:
  36. _subjectlabel.text = @"科目:科目四";
  37. break;
  38. default:
  39. break;
  40. }
  41. _trainTimeLabel.text = [NSString stringWithFormat:@"训练时长:%@分钟",dic[@"TIME"]];
  42. _mileAgeLabel.text = [NSString stringWithFormat:@"训练里程:%@km",dic[@"MILE"]];
  43. if ([dic[@"ENDTIME"] length] > 11) {
  44. _dateLabel.text = [NSString stringWithFormat:@"训练时段:%@至%@",dic[@"STARTTIME"],[dic[@"ENDTIME"] substringFromIndex:11]];
  45. }else {
  46. _dateLabel.text = [NSString stringWithFormat:@"%@至%@",dic[@"STARTTIME"],dic[@"ENDTIME"]];
  47. }
  48. _classIdlabel.text = [NSString stringWithFormat:@"课程编码:%@",dic[@"CLASSID"]];
  49. _stuNumberLabel.text = [NSString stringWithFormat:@"学员全国编号:%@",dic[@"STUNUM"]];
  50. }
  51. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  52. [super setSelected:selected animated:animated];
  53. // Configure the view for the selected state
  54. }
  55. @end