HomePageSubViewController.m 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //
  2. // HomePageSubViewController.m
  3. // LN_School
  4. //
  5. // Created by 张嵘 on 2019/7/16.
  6. // Copyright © 2019 Danson. All rights reserved.
  7. //
  8. #import "HomePageSubViewController.h"
  9. #import "HomePageViewController.h"
  10. #import "StudentDetailViewController.h"
  11. @interface HomePageSubViewController ()
  12. @end
  13. @implementation HomePageSubViewController
  14. - (void)viewDidLoad {
  15. [super viewDidLoad];
  16. self.view.backgroundColor = UIColor.whiteColor;
  17. HomePageViewController *mainVC = (HomePageViewController*)self.parentViewController;
  18. HDSectionModel *subSecModel = mainVC.homePageViewModel.subViewControllerSecArr.firstObject;
  19. subSecModel.headerObj = _homePageNumHeaderModel;
  20. [self.collectionV hd_setAllDataArr:@[subSecModel].mutableCopy];
  21. self.collectionV.collectionV.scrollEnabled = NO;
  22. self.collectionV.collectionV.showsVerticalScrollIndicator = NO;
  23. self.collectionV.collectionV.showsHorizontalScrollIndicator = NO;
  24. /// 点击回调
  25. __weak typeof(self) weakS = self;
  26. [self.collectionV hd_setAllEventCallBack:^(id backModel, HDCallBackType type) {
  27. if (type == HDCellCallBack) {
  28. [weakS clickCell:backModel];
  29. }else if (type == HDSectionHeaderCallBack){
  30. [weakS clickHeader:backModel];
  31. }
  32. }];
  33. }
  34. - (void)clickCell:(HDCellModel*)cellM {
  35. NSLog(@"点击了%zd--%zd cell",cellM.indexP.section,cellM.indexP.item);
  36. StudentDetailViewController *vc = [[StudentDetailViewController alloc] init];
  37. [self navPushHideTabbarToVC:vc];
  38. }
  39. - (void)clickHeader:(HDSectionModel*)secM {
  40. NSLog(@"点击了段头");
  41. }
  42. @end