TerminalListCell2.m 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. //
  2. // TerminalListCell2.m
  3. // LN_School
  4. //
  5. // Created by EchoShacolee on 2017/8/18.
  6. // Copyright © 2017年 Danson. All rights reserved.
  7. //
  8. #import "TerminalListCell2.h"
  9. @implementation TerminalListCell2
  10. +(instancetype)cellForTableView:(UITableView *)tableView{
  11. TerminalListCell2 *cell = [tableView dequeueReusableCellWithIdentifier:@"cellID2"];
  12. if (!cell) {
  13. cell = [[[NSBundle mainBundle]loadNibNamed:@"TerminalListCell2" owner:nil options:nil]lastObject];
  14. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  15. }
  16. return cell;
  17. }
  18. -(void)setDic:(NSDictionary *)dic{
  19. self.carNum.textColor = KTitleColor;
  20. self.carNum.text = dic[@"TCO_LICNUM"];
  21. BOOL isOnlinezz = [dic[@"TDI_IS_CONNECT"] integerValue] == 1;
  22. self.isOnline.textColor = isOnlinezz ? [UIColor darkGrayColor] : [UIColor lightGrayColor];
  23. self.isOnline.text = isOnlinezz ? @"在线":@"不在线";
  24. self.type.textColor = KContentTextColor;
  25. NSString *subTitle = @"";
  26. switch ([[NSString stringWithFormat:@"%@",dic[@"TDI_TERMTYPE"]] integerValue]) {
  27. case 1:
  28. subTitle = @"车载计程计时终端";
  29. break;
  30. case 2:
  31. subTitle = @"课堂教学计时终端";
  32. break;
  33. case 3:
  34. subTitle = @"模拟训练计时终端";
  35. break;
  36. case 0:
  37. subTitle = @"教练APP设备";
  38. break;
  39. case 10:
  40. subTitle = @"学员APP设备";
  41. break;
  42. default:
  43. break;
  44. }
  45. self.type.text = [NSString stringWithFormat:@"终端类型:%@",subTitle];
  46. BOOL isRegisterzz = [dic[@"TDI_REG_STATUS"] integerValue] == 1;
  47. self.isRegister.textColor = isRegisterzz ? KContentTextColor : [UIColor redColor];
  48. self.isRegister.text = isRegisterzz ? @"已注册" : @"未注册";
  49. }
  50. - (void)awakeFromNib {
  51. [super awakeFromNib];
  52. // Initialization code
  53. }
  54. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  55. [super setSelected:selected animated:animated];
  56. // Configure the view for the selected state
  57. }
  58. @end