123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- //
- // ClsTheoryListCell.m
- // JSJPCoach
- //
- // Created by EchoShacolee on 2017/7/19.
- // Copyright © 2017年 Danson. All rights reserved.
- //
- #define dingColor [UIColor colorWithRed:236/255.0 green:190/255.0 blue:44/255.0 alpha:1]
- #import "ClsTheoryListCell.h"
- @implementation ClsTheoryListCell
- +(ClsTheoryListCell *)cellForTableView:(UITableView *)tableView{
- ClsTheoryListCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ClsTheoryListCell"];
- if (!cell) {
- cell = [[NSBundle mainBundle] loadNibNamed:@"ClsTheoryListCell" owner:nil options:nil].lastObject;
- }
-
- return cell;
- }
- -(void)setDic:(NSDictionary *)dic{
-
- _dic = dic;
-
- self.issueNum.textColor = dingColor;
- self.issueNum.font = [UIFont scaleSize:17];
- self.issueNum.text = [NSString stringWithFormat:@"%@期",dic[@"TSC_CLASS_NAME"]];
-
- self.status.font = [UIFont scaleSize:15];
- NSString *statuStr = @"";
- switch ([[NSString stringWithFormat:@"%@",dic[@"TR_AUDIT_STATUS"]] intValue]) {
- case 0:
- statuStr = @"待审核";
- self.status.textColor = [UIColor lightGrayColor];
- break;
- case 1:
- statuStr = @"审核通过";
- self.status.textColor = contentTextColor;
- break;
- case 2:
- statuStr = @"审核不通过";
- self.status.textColor = [UIColor redColor];
- break;
-
- default:
- break;
- }
- self.status.text = [NSString stringWithFormat:@"%@",statuStr];
-
- self.kemu.font = [UIFont scaleSize:15];
- self.kemu.textColor = contentTextColor;
- NSString *kemuStr = @"";
- switch ([[NSString stringWithFormat:@"%@",dic[@"TSC_SUBJECT"]] intValue]) {
- case 1:
- kemuStr = @"一";
- break;
- case 2:
- kemuStr = @"二";
- break;
- case 3:
- kemuStr = @"三";
- break;
- case 4:
- kemuStr = @"四";
- break;
-
- default:
- break;
- }
- if ([[NSString stringWithFormat:@"%@",dic[@"TSC_TYPE"]] isEqualToString:@"1"]) {
- kemuStr = [kemuStr stringByAppendingString:@"理论"];
- }else{
- kemuStr = [kemuStr stringByAppendingString:@"模拟"];
- }
- self.kemu.text = [NSString stringWithFormat:@"科目%@",kemuStr];
-
- self.coach.font = [UIFont scaleSize:15];
- self.coach.textColor = contentTextColor;
- self.coach.text = [NSString stringWithFormat:@"带班教练:%@",dic[@"TSC_COACH_NAME"]];
-
- self.date.font = [UIFont scaleSize:15];
- self.date.textColor = contentTextColor;
-
- NSString *start = [NSString stringWithFormat:@"%@",dic[@"TSC_CLASS_DATE"]];
- if (start.length >= 10) {
- start = [start substringToIndex:10];
- }
- NSString *end = [NSString stringWithFormat:@"%@",dic[@"TSC_END_TIME"]];
- if (end.length >= 10) {
- end = [end substringToIndex:10];
- }
-
-
- self.date.text = [NSString stringWithFormat:@"开班日期:%@ ~ %@",start,end];
- }
- - (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
|