SPSBSalaryViewController.m 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. //
  2. // SPSBSalaryViewController.m
  3. // 我的社保
  4. //
  5. // Created by shanp on 2021/6/16.
  6. //
  7. #import "SPSBSalaryViewController.h"
  8. #import "SPSBUIGeneralHeader.h"
  9. #import <JXHFixHeaderViewController.h>
  10. #import <JXHFixHeaderViewHeaderController.h>
  11. #import <JXHClassifyView.h>
  12. #import "SPSBSalaryTableViewController.h"
  13. @interface SPSBSalaryViewController () {
  14. JXHFixHeaderViewController *_contentVC;
  15. NSArray<SPSBSalaryTableViewController *> *_tableViews;
  16. }
  17. @end
  18. @implementation SPSBSalaryViewController
  19. - (void)viewDidLoad {
  20. [super viewDidLoad];
  21. [self setupUI];
  22. }
  23. #pragma mark - Action
  24. #pragma mark - Network Action
  25. #pragma mark - UI
  26. - (void)setupUI {
  27. self.title = @"社保流水";
  28. [self createContentView];
  29. [self addClassifyView];
  30. [self createLists];
  31. [_contentVC.jxh_bgScrollView.panGestureRecognizer requireGestureRecognizerToFail:self.navigationController.interactivePopGestureRecognizer];
  32. }
  33. - (void)createLists {
  34. NSMutableArray *arr = NSMutableArray.new;
  35. for (NSInteger i = 0; i < 2; i ++) {
  36. SPSBSalaryTableViewController *list = SPSBSalaryTableViewController.new;
  37. list.spsb_type = i;
  38. [arr addObject:list];
  39. }
  40. _tableViews = arr;
  41. [_contentVC setListViews:_tableViews];
  42. }
  43. - (void)addClassifyView {
  44. JXHClassifyViewConfiguration *configuration = ({
  45. JXHClassifyViewConfiguration *configuration = JXHClassifyViewConfiguration.new;
  46. configuration.jxh_titleArray = @[@"待处理", @"已处理"];
  47. configuration.jxh_height = 50;
  48. configuration.jxh_font = spsb_font(16);
  49. configuration.jxh_normalColor = spsb_666666_color();
  50. configuration.jxh_selectedColor = spsb_3296FB_color();
  51. configuration.jxh_margen = 0.f;
  52. configuration.jxh_interval = 0.f;
  53. configuration.jxh_selectedViewSize = (CGSize){60, 2.5};
  54. configuration.jxh_selectedViewColor = spsb_3296FB_color();
  55. configuration.jxh_equalWidth = jxh_screenWidth() / 2;
  56. configuration.jxh_isNeedSelectedView = true;
  57. configuration;
  58. });
  59. [_contentVC setExteriorClassifyViewWithConfiguration:configuration];
  60. [self.view addSubview:_contentVC.jxh_classifyView];
  61. [_contentVC.jxh_classifyView makeConstraints:^(JXHConstraintMaker *make) {
  62. make.top.equalTo(self.view.safetop);
  63. make.leading.and.trailing.equalTo(0);
  64. make.height.equalTo(configuration.jxh_height);
  65. }];
  66. }
  67. - (void)createContentView {
  68. _contentVC = JXHFixHeaderViewController.new;
  69. [self addChildViewController:_contentVC];
  70. [self.view addSubview:_contentVC.view];
  71. [_contentVC.view makeConstraints:^(JXHConstraintMaker *make) {
  72. make.top.equalTo(self.view.safetop).offset(50);
  73. make.leading.and.trailing.and.bottom.equalTo(0);;
  74. }];
  75. JXHFixHeaderViewHeaderController *header = JXHFixHeaderViewHeaderController.new;
  76. [_contentVC setHeader:header];
  77. }
  78. @end