FenceSiteVC.m 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. //
  2. // FenceSiteVC.m
  3. // jiaPei
  4. //
  5. // Created by apple on 2017/8/16.
  6. // Copyright © 2017年 JCZ. All rights reserved.
  7. //
  8. #import "FenceSiteVC.h"
  9. #import "FenceSiteCell.h"
  10. #import "AllCoachPlanVC.h"
  11. @interface FenceSiteVC ()<UITableViewDelegate,UITableViewDataSource>
  12. {
  13. UITableView *mainTableView;
  14. }
  15. @end
  16. @implementation FenceSiteVC
  17. - (void)viewDidLoad {
  18. [super viewDidLoad];
  19. self.title = @"选择训练场";
  20. self.view.backgroundColor = backGroundColor;
  21. [self configNavigationBar];
  22. mainTableView = [[UITableView alloc] initWithFrame:kFrame style:UITableViewStyleGrouped];
  23. mainTableView.height -= kNavOffSet;
  24. mainTableView.delegate = self;
  25. mainTableView.dataSource = self;
  26. mainTableView.rowHeight = 380;
  27. [self.view addSubview:mainTableView];
  28. }
  29. -(void)viewDidAppear:(BOOL)animated{
  30. [super viewDidAppear:animated];
  31. self.tabBarController.tabBar.hidden = YES;
  32. }
  33. -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
  34. return _dataArray.count;
  35. }
  36. -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  37. {
  38. return 1;
  39. }
  40. -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  41. {
  42. FenceSiteCell *cell = [tableView dequeueReusableCellWithIdentifier:@"FenceSiteCell"];
  43. if (cell == nil)
  44. {
  45. cell = [[FenceSiteCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"FenceSiteCell"];
  46. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  47. cell.superVC = self;
  48. }
  49. cell.dataDic = _dataArray[indexPath.section];
  50. return cell;
  51. }
  52. -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  53. {
  54. AllCoachPlanVC *vc = [[AllCoachPlanVC alloc] init];
  55. NSDictionary *dic = _dataArray[indexPath.section];
  56. vc.fenceSiteID = dic[@"ID"];
  57. vc.dqbh = _dqbh;
  58. [self navPushHideTabbarToVC:vc];
  59. }
  60. - (void)didReceiveMemoryWarning {
  61. [super didReceiveMemoryWarning];
  62. }
  63. @end