TrainSummaryViewController.m 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. //
  2. // TrainSummaryViewController.m
  3. // LN_School
  4. //
  5. // Created by 张嵘 on 2019/7/26.
  6. // Copyright © 2019 Danson. All rights reserved.
  7. //
  8. #import "TrainSummaryViewController.h"
  9. @interface TrainSummaryViewController ()
  10. @property (nonatomic, readwrite, strong) TrainSummaryViewModel *trainSummaryViewModel;
  11. @end
  12. @implementation TrainSummaryViewController
  13. #pragma mark - Life Cycle
  14. - (void)viewDidLoad {
  15. [super viewDidLoad];
  16. [self initUI];
  17. }
  18. #pragma mark - Private Functions
  19. - (void)initUI {
  20. self.title = @"培训汇总";
  21. self.view.backgroundColor = KBackGroundColor;
  22. [self goBackByNavigation];
  23. [self.multipleSc mas_makeConstraints:^(MASConstraintMaker *make) {
  24. make.left.mas_equalTo(self.view.hd_mas_left);
  25. make.right.mas_equalTo(self.view.hd_mas_right);
  26. make.bottom.mas_equalTo(0);
  27. make.top.mas_equalTo(self.view.hd_mas_top);
  28. }];
  29. /// 初始化数据
  30. __weak typeof(self) weakS = self;
  31. [self.multipleSc configWithConfiger:^(HDMultipleScrollListConfiger * _Nonnull configer) {
  32. [weakS setWith:configer];
  33. }];
  34. /// 点击回调
  35. [self.multipleSc.mainCollecitonV hd_setAllEventCallBack:^(id backModel, HDCallBackType type) {
  36. if (type == HDCellCallBack) {
  37. [weakS clickCell:backModel];
  38. }else if (type == HDSectionHeaderCallBack){
  39. [weakS clickHeader:backModel];
  40. }
  41. }];
  42. /// 标签个性化设置
  43. [self jxCustomSetting];
  44. }
  45. /// 标签个性化设置
  46. - (void)jxCustomSetting {
  47. self.multipleSc.jxTitle.titleSelectedColor = RQSubColor;
  48. self.multipleSc.jxTitle.titleColorGradientEnabled = YES;
  49. self.multipleSc.jxTitle.titleFont = [UIFont systemFontOfSize:17];
  50. self.multipleSc.jxLineView.indicatorLineViewColor = RQSubColor;
  51. self.multipleSc.jxLineView.lineStyle = JXCategoryIndicatorLineStyle_IQIYI;
  52. self.multipleSc.jxLineView.indicatorWidth = kScreenWidth / 10.0;
  53. self.multipleSc.jxLineView.indicatorHeight = 3;
  54. self.multipleSc.jxLineView.indicatorCornerRadius = 3;
  55. }
  56. /// 初始化数据
  57. - (void)setWith:(HDMultipleScrollListConfiger*)configer {
  58. configer.topSecArr = self.trainSummaryViewModel.topSecArr;
  59. configer.isHeaderNeedStop = self.trainSummaryViewModel.headerStop;
  60. configer.titleContentSize = self.trainSummaryViewModel.titleSize;
  61. configer.controllers = self.trainSummaryViewModel.controllers;
  62. configer.titles = self.trainSummaryViewModel.titles;
  63. }
  64. - (void)clickCell:(HDCellModel*)cellM {
  65. NSLog(@"点击了%zd--%zd cell",cellM.indexP.section,cellM.indexP.item);
  66. }
  67. - (void)clickHeader:(HDSectionModel*)secM {
  68. NSLog(@"点击了段头");
  69. }
  70. #pragma mark - Lazy Load
  71. - (TrainSummaryViewModel *)trainSummaryViewModel {
  72. if (!_trainSummaryViewModel) {
  73. _trainSummaryViewModel = [[TrainSummaryViewModel alloc] init];
  74. }
  75. return _trainSummaryViewModel;
  76. }
  77. @end