TrainInfoVC.m 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604
  1. //
  2. // TrainInfoVC.m
  3. // jiaPei
  4. //
  5. // Created by apple on 16/1/29.
  6. // Copyright © 2016年 JCZ. All rights reserved.
  7. //
  8. #import "TrainInfoVC.h"
  9. #import "TrainRecord.h"
  10. #import "TrainDetailVC.h"
  11. #import "TrainInfoTableViewCell.h"
  12. @interface TrainInfoVC ()<UITableViewDataSource,UITableViewDelegate>
  13. {
  14. UITableView *mainTableView;
  15. BOOL isclose[3];
  16. NSInteger showMnState;// 1显示 0不显示
  17. NSMutableArray *modelsArray;
  18. NSArray<NSString *> *totalTimeArray;
  19. NSMutableDictionary *dataDic;
  20. NSMutableDictionary *otherdataDic;//里程数和审核状态
  21. NSDictionary *trainTimeDic;//各个阶段总学时
  22. NSMutableArray *timeArray;
  23. NSInteger whichOne;
  24. NSMutableArray *sureBtnsArray;//确定button数组
  25. NSMutableArray *sureStatusArray;//确定状态数组
  26. }
  27. @property (strong, readwrite, nonatomic) UILabel *totalMileageLabel;
  28. @end
  29. @implementation TrainInfoVC
  30. - (void)viewDidLoad {
  31. [super viewDidLoad];
  32. self.title = @"我的学时";
  33. self.view.backgroundColor = backGroundColor;
  34. // if (self.skipType == 1) {
  35. // [self configNavigationBarDismissNav];
  36. // }else {
  37. // }
  38. [self configNavigationBar];
  39. showMnState = 0;
  40. for (NSDictionary * dic in defUser.userDict[@"params"]) {
  41. if ([dic[@"KEY"] isEqualToString:@"SP_SHOW_MN"]) {
  42. showMnState = [dic[@"VALUE"] integerValue];
  43. }
  44. }
  45. NSString *pxjd = [NSString stringWithFormat:@"%@",defUser.userDict[@"pxjd"]];
  46. NSInteger currentSubject = [pxjd integerValue];
  47. if (currentSubject>=1 && currentSubject <= 4) {
  48. isclose[currentSubject-1] = YES;
  49. }
  50. [self myInit];
  51. }
  52. -(void)viewWillAppear:(BOOL)animated{
  53. [super viewWillAppear:animated];
  54. [self clearData];//数据初始化(更新需调用清零)
  55. [self getStudentTrainCheck];//获取确认状态
  56. [self getTotalTrainTime];//获取总时长
  57. }
  58. -(void)myInit
  59. {
  60. mainTableView = [[UITableView alloc] initWithFrame:kFrame];
  61. mainTableView.height -= kNavOffSet;
  62. mainTableView.delegate = self;
  63. mainTableView.dataSource = self;
  64. mainTableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine;
  65. mainTableView.tableFooterView = [UIView new];
  66. [self.view addSubview:mainTableView];
  67. }
  68. - (void)clearData{
  69. modelsArray = [NSMutableArray array];
  70. totalTimeArray = [NSArray array];
  71. timeArray = [NSMutableArray array];
  72. sureStatusArray = [NSMutableArray array];
  73. sureBtnsArray = [NSMutableArray array];
  74. for (int i=0; i<4; i++) {
  75. [sureStatusArray addObject:@"1"];
  76. [sureBtnsArray addObject:[NSNull null]];
  77. }
  78. dataDic = [NSMutableDictionary dictionaryWithCapacity:4];
  79. NSArray *array1 = [DB_Helper quearyTrain:defUser.userStuId Subject:@"1"];
  80. NSArray *array4 = [DB_Helper quearyTrain:defUser.userStuId Subject:@"4"];
  81. if (array4.count < 1) {
  82. array4 = [DB_Helper quearyTrain:defUser.userStuId Subject:@"3"];
  83. }
  84. for (int i = 1; i < 5; i ++) {
  85. NSMutableDictionary *rowDic = [NSMutableDictionary dictionaryWithCapacity:2];
  86. if (i == 1) {
  87. [rowDic setObject:[NSMutableArray arrayWithArray:array1] forKey:@"0"];
  88. }else if (i == 4) {
  89. [rowDic setObject:[NSMutableArray arrayWithArray:array4] forKey:@"0"];
  90. }else{
  91. [rowDic setObject:[NSMutableArray array] forKey:@"0"];
  92. }
  93. [rowDic setObject:[NSMutableArray array] forKey:@"1"];
  94. [dataDic setObject:rowDic forKey:[NSString stringWithFormat:@"%d",i]];
  95. }
  96. }
  97. #pragma mark 数据请求
  98. -(void)getTotalTrainTime
  99. {
  100. if (![Util connectedToNetWork]) {
  101. showMsgUnconnect();
  102. return;
  103. }
  104. NSMutableArray* arr = [NSMutableArray array];
  105. [arr addPro:@"cx" Value:defUser.userDict[@"carType"]];
  106. [arr addPro:@"dqbh" Value:defUser.userDict[@"city"]];
  107. [arr addPro:@"isShowMn" Value:showMnState==1?@"1":@"0"];
  108. NSString* method = @"getTrainSubjectCredit";
  109. [MBProgressHUD showLoadToView:self.view];
  110. [jiaPeiManager requestAnythingWithURL:method array:arr data:nil completion:^(NSDictionary * root) {
  111. [MBProgressHUD hideHUDForView:self.view animated:NO];
  112. if (!root)
  113. {
  114. showMsgByAlert(self, @"请求失败");
  115. return;
  116. }
  117. if ([root[@"code"] intValue] == 1) {
  118. showMsgByAlert(self, root[@"body"]);
  119. return;
  120. }
  121. NSArray *array = root[@"body"];
  122. if (![array isKindOfClass:[NSArray class]] || array.count == 0) {
  123. return;
  124. }
  125. NSMutableArray *totalArray = [NSMutableArray array];
  126. for (int i = 1; i < 7; i ++) {
  127. for (NSDictionary *dic in array) {
  128. if ([dic[@"SUBJECT"] intValue] == i) {
  129. [totalArray addObject:dic[@"RATION"]];
  130. }
  131. }
  132. }
  133. if (showMnState != 1) {
  134. //如果不显示模拟 要把模拟数据加到理论数据中
  135. [totalArray replaceObjectAtIndex:2 withObject:[NSString stringWithFormat:@"%d",([totalArray[1] intValue] + [totalArray[2] intValue])]];
  136. [totalArray replaceObjectAtIndex:4 withObject:[NSString stringWithFormat:@"%d",([totalArray[3] intValue] + [totalArray[4] intValue])]];
  137. }
  138. totalTimeArray = nil;
  139. totalTimeArray = [NSArray arrayWithArray:totalArray];
  140. [mainTableView reloadData];
  141. [self getTrainInfo];
  142. }];
  143. }
  144. //获取计时信息
  145. -(void)getTrainInfo
  146. {
  147. if (![Util connectedToNetWork]) {
  148. showMsgUnconnect();
  149. return;
  150. }
  151. NSMutableArray* arr = [NSMutableArray array];
  152. [arr addPro:@"stuOutId" Value:defUser.userDict[@"outId"]];
  153. [arr addPro:@"dqbh" Value:defUser.userDict[@"city"]];
  154. NSString* method = @"getTrainFinish";
  155. [MBProgressHUD showLoadToView:self.view];
  156. [jiaPeiManager requestAnythingWithURL:method array:arr data:nil completion:^(NSDictionary * root) {
  157. [MBProgressHUD hideHUDForView:self.view];
  158. if (!root){
  159. ShowMsg(@"请求失败");
  160. return;
  161. }
  162. if ([root[@"code"] intValue] == 1){
  163. ShowMsg(root[@"msg"]);
  164. return;
  165. }
  166. if ([root[@"body"] count] < 1){
  167. return;
  168. }
  169. modelsArray = root[@"body"];
  170. if ([root[@"other"] isKindOfClass:[NSDictionary class]]) {
  171. otherdataDic = [NSMutableDictionary dictionaryWithDictionary:root[@"other"]];
  172. }
  173. /*
  174. CRI_VAILD_TIME:有效学时
  175. CRI_TRAIN_SUBJECT:学时阶段 1-4
  176. CRI_DURATION:培训学时
  177. PXKMTYPE:1实操 (2课堂教练==》服务器改为返回到4里面去了) 3模拟器教学 4远程教学(理论)+ (终端)理论
  178. TCI_PHOTO_PATH:教练员照片
  179. TCI_NAME:教练名称
  180. CRI_STARTTIME:开始时间
  181. CRI_ENDTIME:结束时间
  182. */
  183. for (NSDictionary *dic in modelsArray) {
  184. //解析数据
  185. switch ([dic[@"PXKMTYPE"] integerValue]) {
  186. case 1:
  187. {
  188. [[[dataDic objectForKey:dic[@"CRI_TRAIN_SUBJECT"]] objectForKey:@"1"] addObject:dic];
  189. }
  190. break;
  191. // case 2:
  192. // {
  193. // //这个一般用不到 【lee:18/5/11 这个东西就不应该。科一/四 终端理论学时不应该拿来替换作为本地未上传的学时】
  194. // [[[dataDic objectForKey:dic[@"CRI_TRAIN_SUBJECT"]] objectForKey:@"0"] addObject:dic];
  195. // }
  196. // break;
  197. case 3:
  198. {
  199. [[[dataDic objectForKey:dic[@"CRI_TRAIN_SUBJECT"]] objectForKey:@"0"] addObject:dic];
  200. }
  201. break;
  202. case 4:
  203. {
  204. [[[dataDic objectForKey:dic[@"CRI_TRAIN_SUBJECT"]] objectForKey:@"1"] addObject:dic];
  205. }
  206. break;
  207. default:
  208. break;
  209. }
  210. }
  211. [mainTableView reloadData];
  212. }];
  213. }
  214. //获取确认状态
  215. -(void)getStudentTrainCheck
  216. {
  217. if (![Util connectedToNetWork]) {
  218. showMsgUnconnect();
  219. return;
  220. }
  221. NSMutableArray* arr = [NSMutableArray array];
  222. [arr addPro:@"dqbh" Value:defUser.userDict[@"city"]];
  223. [arr addPro:@"stuId" Value:defUser.userDict[@"outId"]];
  224. NSString* method = @"getStudentTrainCheck";
  225. [jiaPeiManager requestAnythingWithURL:method array:arr data:nil completion:^(NSDictionary * root) {
  226. if (!root || [root[@"code"] intValue] == 1)
  227. {
  228. return;
  229. }
  230. NSDictionary *dic = root[@"body"];
  231. trainTimeDic = dic;
  232. NSArray *arr = @[@"ONECHECK",@"TWOCHECK",@"THREECHECK",@"FOURCHECK"];
  233. for (int i=0; i<4; i++) {
  234. NSString *status = [NSString stringWithFormat:@"%@",dic[arr[i]]];
  235. if (![status isEqualToString:@"1"]) {
  236. [sureStatusArray replaceObjectAtIndex:i withObject:status];
  237. if ([sureBtnsArray[i] isKindOfClass:[UIButton class]]) {
  238. UIButton *btn = sureBtnsArray[i];
  239. btn.selected = YES;
  240. }
  241. }
  242. }
  243. }];
  244. }
  245. -(void)updateStudentTrainCheckWithSubject:(UIButton *)sureBtn
  246. {
  247. if (![Util connectedToNetWork]) {
  248. showMsgUnconnect();
  249. return;
  250. }
  251. NSString *subject = [NSString stringWithFormat:@"%ld",(long)sureBtn.tag+1-10];
  252. NSMutableArray* arr = [NSMutableArray array];
  253. [arr addPro:@"dqbh" Value:defUser.userDict[@"city"]];
  254. [arr addPro:@"stuId" Value:defUser.userDict[@"outId"]];
  255. [arr addPro:@"subject" Value:subject];
  256. [arr addPro:@"cx" Value:defUser.userDict[@"carType"]];
  257. NSString* method = @"updateStudentTrainCheck";
  258. [MBProgressHUD showLoadToView:self.view];
  259. [jiaPeiManager requestAnythingWithURL:method array:arr data:nil completion:^(NSDictionary * root) {
  260. [MBProgressHUD hideHUDForView:self.view];
  261. if (!root) {
  262. ShowMsg(@"请求失败,请重试");
  263. }
  264. if ([root[@"code"] intValue] == 1)
  265. {
  266. ShowMsg(root[@"body"]);
  267. return;
  268. }
  269. //确认成功
  270. sureBtn.selected = NO;
  271. [sureStatusArray replaceObjectAtIndex:sureBtn.tag-10 withObject:@"1"];
  272. }];
  273. }
  274. #pragma mark tableView delegate
  275. -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
  276. {
  277. return 4;
  278. }
  279. -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  280. {
  281. if (isclose[section] == YES)
  282. {
  283. if (showMnState != 1) {
  284. if (section == 1) {
  285. return 1;
  286. }else {
  287. return 2;
  288. }
  289. }else {
  290. if (section == 2) {
  291. return 3;
  292. }else {
  293. return 2;
  294. }
  295. }
  296. }else {
  297. return 0;
  298. }
  299. }
  300. -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  301. {
  302. NSMutableArray *rowArray = (NSMutableArray *)[[dataDic objectForKey:[NSString stringWithFormat:@"%d",(int)indexPath.section + 1]] objectForKey:[NSString stringWithFormat:@"%d",(int)indexPath.row]];
  303. if (showMnState != 1 && (indexPath.section == 1 || indexPath.section == 2)) {
  304. rowArray = (NSMutableArray *)[[dataDic objectForKey:[NSString stringWithFormat:@"%d",(int)indexPath.section + 1]] objectForKey:@"1"];
  305. }
  306. if ((indexPath.section == 0 || indexPath.section == 3) && indexPath.row == 0) {
  307. //本地学时(科一/科四 理论)
  308. UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
  309. if (cell == nil)
  310. {
  311. cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
  312. cell.x += 20;
  313. cell.width -= 20;
  314. cell.textLabel.font = [UIFont scaleSize:FontTitle];
  315. cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
  316. }
  317. int time = 0;
  318. for (TrainRecord *train in rowArray)
  319. {
  320. time += [train.trainTime intValue];
  321. }
  322. int hour = time/60;
  323. int min = time%60;
  324. NSString *dbTime = [NSString stringWithFormat:@"%d小时%d分钟",hour,min];
  325. if (hour == 0)
  326. {
  327. dbTime = [NSString stringWithFormat:@"%d分钟",min];
  328. if (min == 0) {
  329. dbTime = @"0分钟";
  330. }
  331. }
  332. if (time != 0) {
  333. cell.textLabel.text = [NSString stringWithFormat:@"理论(未上传) %@",dbTime];
  334. }else {
  335. cell.textLabel.text = [NSString stringWithFormat:@"本地无未上传学时"];
  336. }
  337. return cell;
  338. }else if ((indexPath.section == 2 && indexPath.row == 1 && showMnState != 1) || (indexPath.section == 2 && indexPath.row == 2 && showMnState == 1)) {
  339. UITableViewCell *totalMileageCell = [tableView dequeueReusableCellWithIdentifier:@"foote"];
  340. if (!totalMileageCell) {
  341. totalMileageCell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"totalMileageCell"];
  342. _totalMileageLabel = [[UILabel alloc] initWithFrame:CGRectMake(65, 0, kScreenWidth, 50)];
  343. [_totalMileageLabel setText:@"总里程:" Font:FontTitle TextColor:kTitleColor];
  344. [totalMileageCell.contentView addSubview:_totalMileageLabel];
  345. }
  346. _totalMileageLabel.text = [NSString stringWithFormat:@"总里程:%@km",otherdataDic[@"SRI_TRAIN_THREE_MILEAGE"]? : @"0"];
  347. return totalMileageCell;
  348. }else {
  349. //服务器数据
  350. NSString *titString = @"理论";
  351. if (indexPath.section == 1 || indexPath.section == 2) {
  352. titString = @"模拟";
  353. if (indexPath.row == 1) {
  354. titString = @"实操";
  355. }
  356. if (showMnState != 1) {
  357. titString = @"实操";
  358. }
  359. }
  360. NSInteger index = indexPath.section * 2 + indexPath.row - 1;
  361. if (showMnState != 1 && (indexPath.section == 1 || indexPath.section == 2)) {
  362. index = indexPath.section * 2;
  363. }
  364. if (indexPath.section == 3) {
  365. index -= 1;
  366. }
  367. NSString *allTimeString = @"720";
  368. if (totalTimeArray.count > index) {
  369. allTimeString = totalTimeArray[index];
  370. }
  371. TrainInfoTableViewCell *cell = [TrainInfoTableViewCell cellForTabelView:tableView];
  372. cell.titleString = titString;
  373. cell.allNeedTime = [allTimeString integerValue];
  374. cell.dataArray = rowArray;
  375. //在每个科目判断是否存在学时?显示审核图标 : 隐藏审核图标
  376. NSArray *trainTimeArr = @[trainTimeDic[@"SRI_TRAIN_ONE"]? : @"0",
  377. trainTimeDic[@"SRI_TRAIN_TWO"]? : @"0",
  378. trainTimeDic[@"SRI_TRAIN_THREE"]? : @"0",
  379. trainTimeDic[@"SRI_TRAIN_FOUR"]? : @"0",];
  380. cell.checkImg.hidden = [trainTimeArr[indexPath.section] integerValue] == 0;
  381. //判断审核状态(2 : 显示审核通过; 0 : 未审核 ; 其他 : 隐藏图标)
  382. NSArray *statusArr = @[otherdataDic[@"SRI_TRAIN_ONE_STATUS"]? : @"100",
  383. otherdataDic[@"SRI_TRAIN_TWO_STATUS"]? : @"100",
  384. otherdataDic[@"SRI_TRAIN_THREE_STATUS"]? : @"100",
  385. otherdataDic[@"SRI_TRAIN_FOUR_STATUS"]? : @"100"];
  386. cell.checkImg.selected = ([statusArr[indexPath.section] integerValue] == 2);
  387. return cell;
  388. }
  389. }
  390. -(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
  391. {
  392. NSString *viewId = [NSString stringWithFormat:@"headview%d",(int)section];
  393. UITableViewHeaderFooterView *view = [tableView dequeueReusableHeaderFooterViewWithIdentifier:viewId];
  394. if (!view) {
  395. view = [[UITableViewHeaderFooterView alloc]initWithReuseIdentifier:viewId];
  396. view.frame = CGRectMake(0, 0, kSize.width, 50);
  397. view.backgroundColor = backGroundColor;
  398. view.layer.borderWidth = .5;
  399. view.layer.borderColor = KlineColor.CGColor;
  400. UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(60, 0, 120, 50)];
  401. if (section == 0)
  402. {
  403. label.text = @"科目一";
  404. }
  405. if (section == 1)
  406. {
  407. label.text = @"科目二";
  408. }
  409. if (section == 2)
  410. {
  411. label.text = @"科目三";
  412. }
  413. if (section == 3)
  414. {
  415. label.text = @"科目四";
  416. }
  417. [view addSubview:label];
  418. UIImageView *secImage = [[UIImageView alloc] initWithFrame:CGRectMake(20, 15, 20, 20)];
  419. secImage.image = [UIImage imageNamed:@"location_more_arrow"];
  420. [view addSubview:secImage];
  421. UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, kSize.width, 50)];
  422. btn.tag = section;
  423. [btn addTarget:self action:@selector(clickToChange:) forControlEvents:UIControlEventTouchUpInside];
  424. [view addSubview:btn];
  425. UIButton *sureBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  426. sureBtn.layer.cornerRadius = 5;
  427. sureBtn.layer.masksToBounds = YES;
  428. sureBtn.frame =CGRectMake(kSize.width-100, 10, 80, 30);
  429. sureBtn.titleLabel.font = [UIFont systemFontOfSize:14];
  430. [sureBtn setTitle:@"已确认" textColor:[UIColor lightGrayColor] font:FontTitle fotState:UIControlStateNormal];
  431. [sureBtn setBackgroundImage:[UIImage imageWithColor:[UIColor whiteColor]] forState:UIControlStateNormal];
  432. [sureBtn setTitle:@"确认学时" textColor:[UIColor whiteColor] font:FontTitle fotState:UIControlStateSelected];
  433. [sureBtn setBackgroundImage:[UIImage imageWithColor:defGreen] forState:UIControlStateSelected];
  434. [sureBtn target:self tag:10+section];
  435. [view addSubview:sureBtn];
  436. [sureBtnsArray replaceObjectAtIndex:section withObject:sureBtn];
  437. }
  438. for (UIView *subview in view.subviews) {
  439. if ([subview isKindOfClass:[UIImageView class]]) {
  440. UIImageView *secImage = (UIImageView *)subview;
  441. secImage.transform = isclose[section] == YES?CGAffineTransformMakeRotation(M_PI):CGAffineTransformIdentity;
  442. }
  443. }
  444. UIButton *sureBtn = [view.subviews lastObject];
  445. sureBtn.selected = [sureStatusArray[section] isEqualToString:@"0"];
  446. return view;
  447. }
  448. -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
  449. {
  450. if ((indexPath.section == 0 || indexPath.section == 3) && indexPath.row == 0) {
  451. return 45;
  452. }else if ((indexPath.section == 2 && indexPath.row == 1 && showMnState != 1) || (indexPath.section == 2 && indexPath.row == 2 && showMnState == 1)) {
  453. return 45;
  454. }else{
  455. return 80;
  456. }
  457. }
  458. - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
  459. return 50;
  460. }
  461. -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  462. {
  463. NSMutableArray *rowArray = (NSMutableArray *)[[dataDic objectForKey:[NSString stringWithFormat:@"%d",(int)indexPath.section + 1]] objectForKey:[NSString stringWithFormat:@"%d",(int)indexPath.row]];
  464. if (showMnState != 1 && (indexPath.section == 1 || indexPath.section == 2)) {
  465. rowArray = (NSMutableArray *)[[dataDic objectForKey:[NSString stringWithFormat:@"%d",(int)indexPath.section + 1]] objectForKey:@"1"];
  466. }
  467. TrainDetailVC *detail = [[TrainDetailVC alloc] init];
  468. detail.datasourceArray = rowArray;
  469. detail.type = @"2";
  470. if ((indexPath.section == 0 || indexPath.section == 3) && indexPath.row == 0) {
  471. //本地的学时 要上传
  472. detail.type = @"1";
  473. }
  474. [self navPushHideTabbarToVC:detail];
  475. }
  476. -(void)clickToChange:(UIButton *)sender
  477. {
  478. isclose[sender.tag] = !isclose[sender.tag];
  479. [mainTableView reloadData];
  480. }
  481. -(void)btnClick:(UIButton *)sender{
  482. if (sender.isSelected == NO) {
  483. return;
  484. }
  485. // if ([defUser.userDict[@"imei"] length] > 0) {
  486. //
  487. // if (![defUser.userDict[@"imei"] isEqualToString:[Tools getIDFV]]) {
  488. // ShowMsg(@"账号与绑定手机不匹配,请用本人手机确认学时");
  489. // [Tools playAudioWithString:@"账号与绑定手机不匹配,请用本人手机确认学时"];
  490. // [self.navigationController popViewControllerAnimated:YES];
  491. // return;
  492. // }
  493. // }
  494. //确认学时
  495. [self updateStudentTrainCheckWithSubject:sender];
  496. }
  497. - (void)didReceiveMemoryWarning {
  498. [super didReceiveMemoryWarning];
  499. }
  500. @end