123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- //
- // TeachLogCell.m
- // LNManager
- //
- // Created by EchoShacolee on 2017/4/12.
- // Copyright © 2017年 lee. All rights reserved.
- //
- #import "TeachLogCell.h"
- @implementation TeachLogCell
- - (void)awakeFromNib {
- [super awakeFromNib];
-
- }
- -(void)setDataWithDic:(NSDictionary *)dic{
-
- _classId.text = [NSString stringWithFormat:@"%@",dic[@"CRI_CLASSID"]];
- _startTime.text = [NSString stringWithFormat:@"%@",dic[@"CRI_STARTTIME"]];
- _endTime.text = [NSString stringWithFormat:@"%@",dic[@"CRI_ENDTIME"]];
- _stuNum.text = [NSString stringWithFormat:@"%@",dic[@"STUSIM"]];
-
- //二次审核相关
- _checkMan.text = [NSString stringWithFormat:@"审核人 : %@",dic[@"CRI_AUDIT_USERNAME"]];
- _reason.text = [NSString stringWithFormat:@"审核原因: %@",dic[@"CRI_SECOND_AUDIT_REASON"]];
- _checkTime.text = [NSString stringWithFormat:@"审核时间: %@",dic[@"CRI_AUDIT_TIME"]];
- _status.text = [NSString stringWithFormat:@"%@",dic[@"CRI_SECOND_AUDIT_RESULT"]];
- if ([_status.text isEqualToString:@"1"]) {
- //@"审核不通过";
- self.kemuTop.constant = 0;
- _checkMan.hidden = NO;
- _status.hidden = NO;
- _reason.hidden = NO;
- _checkTime.hidden = NO;
-
- _status.text = @"审核不通过";
- _status.textColor = [UIColor redColor];
-
- }else{
- self.kemuTop.constant = -75;
- _checkMan.hidden = YES;
- _status.hidden = YES;
- _reason.hidden = YES;
- _checkTime.hidden = YES;
-
- if ([_status.text isEqualToString:@"0"]) {
- _status.text = @"审核通过";
- _status.textColor = defGreen;
- }else if ([_status.text isEqualToString:@"2"]) {
- _status.text = @"待审核";
- _status.textColor = [UIColor lightGrayColor];
- }
- }
-
- _kumu.text = @"";
- switch ([[NSString stringWithFormat:@"%@",dic[@"CRI_TRAIN_SUBJECT"]] integerValue]) {
- case 1:
- _kumu.text = @"科目:科目一";
- break;
- case 2:
- _kumu.text = @"科目:科目二";
- break;
- case 3:
- _kumu.text = @"科目:科目三";
- break;
- case 4:
- _kumu.text = @"科目:科目四";
- break;
-
- default:
- break;
- }
- _trainTime.text = [NSString stringWithFormat:@"训练时长:%@分钟",dic[@"CRI_VAILD_TIME"]];
- _trainKMeters.text = [NSString stringWithFormat:@"训练里程:%.2fKM",[dic[@"CRI_MILEAGE"] floatValue]/1000];
-
- }
- + (CGFloat)heightForDic:(NSDictionary *)dic
- {
- // 而高度是动态返回
- if (![[NSString stringWithFormat:@"%@",dic[@"CRI_SECOND_AUDIT_RESULT"]] isEqualToString:@"1"]) {
-
- return 131;
- }
-
- CGRect bounds = [[NSString stringWithFormat:@"审核原因:%@",dic[@"CRI_SECOND_AUDIT_REASON"]] boundingRectWithSize:CGSizeMake(kSize.width-36, 1000) options:NSStringDrawingUsesLineFragmentOrigin attributes:[NSDictionary dictionaryWithObject:[UIFont systemFontOfSize:15] forKey:NSFontAttributeName] context:nil];
- return 181 + (bounds.size.height > 25 ? bounds.size.height : 25);
- }
- - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
- [super setSelected:selected animated:animated];
- // Configure the view for the selected state
- }
- @end
|