MinRecordeCell.m 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. //
  2. // MinRecordeCell.m
  3. // LNManager
  4. //
  5. // Created by EchoShacolee on 2017/4/14.
  6. // Copyright © 2017年 lee. All rights reserved.
  7. //
  8. #import "MinRecordeCell.h"
  9. @implementation MinRecordeCell
  10. - (void)awakeFromNib {
  11. [super awakeFromNib];
  12. // Initialization code
  13. }
  14. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  15. [super setSelected:selected animated:animated];
  16. // Configure the view for the selected state
  17. }
  18. -(void)upDataWithDic:(NSDictionary *)dic{
  19. //@RQ-MARK 1.0.5优化“分钟学时记录”列表,新增“异常原因”展示,新增”记录状态“文字颜色(待审核:橘色;审核通过:绿色;异常记录:红色;异常原因:红色),“记录时间”对服务端返回的时间戳进行转换后展示
  20. _speed.text = [NSString stringWithFormat:@"%@km/h",dic[@"MAXSPEED"]? : @"0"];
  21. _time.text = [Tools dateWithTimestamp:dic[@"RECORDTIME"]]? : @"1999-12-31 23:59:59";
  22. _phoneNum.text = dic[@"SIM"]? : @"110";
  23. _mile.text = [NSString stringWithFormat:@"%@m",dic[@"MILEAGE"]? :@"0"];
  24. NSInteger k = [[NSString stringWithFormat:@"%@",dic[@"RECORDSTATUS"]] integerValue];
  25. if (k == 0) {
  26. _status.text = @"未审核";
  27. _status.textColor = [UIColor orangeColor];
  28. _reason.hidden = YES;
  29. _reasonTitle.hidden = YES;
  30. }else if (k == 1) {
  31. _status.text = @"异常记录";
  32. _status.textColor = [UIColor redColor];
  33. if ([dic[@"AUDIT_REASON"] isKindOfClass:[NSString class]]) {
  34. _reason.text = dic[@"AUDIT_REASON"];
  35. }else {
  36. _reason.text = @"未知原因";
  37. }
  38. _reason.hidden = NO;
  39. _reasonTitle.hidden = NO;
  40. }else {
  41. _status.text = @"审核通过";
  42. _status.textColor = [UIColor greenColor];
  43. _reason.hidden = YES;
  44. _reasonTitle.hidden = YES;
  45. }
  46. [self updateConstraintsIfNeeded];
  47. }
  48. @end