123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- //
- // TerminalListCell.m
- // LN_School
- //
- // Created by EchoShacolee on 2017/8/3.
- // Copyright © 2017年 Danson. All rights reserved.
- //
- #import "TerminalListCell.h"
- @implementation TerminalListCell
- +(instancetype)cellForTableView:(UITableView *)tableView{
-
- TerminalListCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cellID"];
- if (!cell) {
- cell = [[[NSBundle mainBundle]loadNibNamed:@"TerminalListCell" 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 isOnline = [dic[@"TDI_IS_CONNECT"] integerValue] == 1;
- self.status.textColor = isOnline ? [UIColor darkGrayColor] : [UIColor lightGrayColor];
- self.status.text = isOnline ? @"在线":@"不在线";
-
- self.type.textColor = KContentTextColor;
- NSString *subTitle = @"";
- switch ([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 isRegister = [dic[@"TDI_REG_STATUS"] integerValue] == 1;
- self.registerLab.textColor = isRegister ? KContentTextColor : [UIColor redColor];
- self.registerLab.text = isRegister ? @"已注册" : @"未注册";
- }
- - (IBAction)orbitClick:(id)sender {
- //轨迹
- if (self.clickBlock) {
- self.clickBlock(@1);
- }
- }
- - (IBAction)sendMsgClick:(id)sender {
- //发送消息
- if (self.clickBlock) {
- self.clickBlock(@2);
- }
- }
- - (IBAction)cancleAlarmClick:(id)sender {
- //解除警报
- if (self.clickBlock) {
- self.clickBlock(@3);
- }
- }
- - (IBAction)videoClick:(id)sender {
- //录像
- if (self.clickBlock) {
- self.clickBlock(@4);
- }
- }
- - (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
|