// // TerminalListCell2.m // LN_School // // Created by EchoShacolee on 2017/8/18. // Copyright © 2017年 Danson. All rights reserved. // #import "TerminalListCell2.h" @implementation TerminalListCell2 +(instancetype)cellForTableView:(UITableView *)tableView{ TerminalListCell2 *cell = [tableView dequeueReusableCellWithIdentifier:@"cellID2"]; if (!cell) { cell = [[[NSBundle mainBundle]loadNibNamed:@"TerminalListCell2" owner:nil options:nil]lastObject]; cell.selectionStyle = UITableViewCellSelectionStyleNone; } return cell; } -(void)setDic:(NSDictionary *)dic{ self.carNum.textColor = KTitleColor; self.carNum.text = dic[@"TCO_LICNUM"]; BOOL isOnlinezz = [dic[@"TDI_IS_CONNECT"] integerValue] == 1; self.isOnline.textColor = isOnlinezz ? [UIColor darkGrayColor] : [UIColor lightGrayColor]; self.isOnline.text = isOnlinezz ? @"在线":@"不在线"; self.type.textColor = KContentTextColor; NSString *subTitle = @""; switch ([[NSString stringWithFormat:@"%@",dic[@"TDI_TERMTYPE"]] integerValue]) { case 1: subTitle = @"车载计程计时终端"; break; case 2: subTitle = @"课堂教学计时终端"; break; case 3: subTitle = @"模拟训练计时终端"; break; case 0: subTitle = @"教练APP设备"; break; case 10: subTitle = @"学员APP设备"; break; default: break; } self.type.text = [NSString stringWithFormat:@"终端类型:%@",subTitle]; BOOL isRegisterzz = [dic[@"TDI_REG_STATUS"] integerValue] == 1; self.isRegister.textColor = isRegisterzz ? KContentTextColor : [UIColor redColor]; self.isRegister.text = isRegisterzz ? @"已注册" : @"未注册"; } - (void)awakeFromNib { [super awakeFromNib]; // Initialization code } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; // Configure the view for the selected state } @end