// // ClassDetailVC.m // LN_School // // Created by EchoShacolee on 2017/12/13. // Copyright © 2017年 Danson. All rights reserved. // #import "ClassDetailVC.h" #import "LocServiceVC.h" @interface ClassDetailVC () @end @implementation ClassDetailVC - (void)viewDidLoad { [super viewDidLoad]; self.navigationItem.title = @"理论教室详情"; [self setSegmentControllWithTitles:@[@"基本信息"] isBttomBar:NO]; [Tools permissionValidationWithID:@"1246" view:self.view result:^(BOOL isCan, NSString *failureStr) { if (isCan) { [self createBottomBarWithtoolTitles:@[@"重置教室位置"]]; } }]; } -(void)setData{ self.headImgStr = self.dataSource[@"EI_PHOTO_PATH"]; _keysArr = @[ @[@"所属机构",@"JXMC"], @[@"教室名称",@"TR_NAME"], @[@"最大人数(个)",@"TR_STUNUM"], @[@"教室地址",@"TR_ADDRESS"], @[@"开课时间",@"TR_STARTTIME"], @[@"下课时间",@"TR_ENDTIME"], @[@"教室类型",@"TR_TYPE"], @[@"教室面积(m2)",@"TR_AREA"] ]; [super setData]; } -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ //这里返回的cell是第一个tableview的。下面对于key的判定isequal和contains的区别在于 一个是独有,一个是共有 UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"cellId"]; if (!cell) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"cellId"]; } NSString * key = _keysArr[indexPath.row][1]; cell.textLabel.text = _keysArr[indexPath.row][0]; if ([key isEqualToString:@"TR_TYPE"]){ NSString *status = [NSString stringWithFormat:@"%@",self.dataSource[key]]; switch ([status integerValue]) { case 1: cell.detailTextLabel.text = @"多媒体理论教室"; break; case 2: cell.detailTextLabel.text = @"模拟器教室"; break; case 3: cell.detailTextLabel.text = @"通用"; break; case 4: cell.detailTextLabel.text = @"教具教室"; break; default: break; } }else{ cell.detailTextLabel.text = [NSString stringWithFormat:@"%@",self.dataSource[_keysArr[indexPath.row][1]]]; } if ([_statusArr[indexPath.row] isEqualToNumber:@1]) { cell.detailTextLabel.numberOfLines = 0; cell.detailTextLabel.textAlignment = NSTextAlignmentLeft; }else{ cell.detailTextLabel.numberOfLines = 1; cell.detailTextLabel.textAlignment = NSTextAlignmentRight; } return cell; } #pragma mark 创建BottomBarButton -(void)createBottomBarWithtoolTitles:(NSArray *)toolTitles{ float widthBtn = (kSize.width-1*toolTitles.count+1)/toolTitles.count; float HeightBth = JOb_DETAIL_BOTTOMBAR_HEIGHT; for (int i=0; i