NYGetjobTimeVC.m 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. //
  2. // NYGetjobTimeVC.m
  3. // jiaPei
  4. //
  5. // Created by Ning.ge on 2023/6/8.
  6. // Copyright © 2023 JCZ. All rights reserved.
  7. //
  8. #import "NYGetjobTimeVC.h"
  9. #import "NYGetjobTimeViewModel.h"
  10. @interface NYGetjobTimeVC ()
  11. /// viewModel
  12. @property (nonatomic, readonly, strong) NYGetjobTimeViewModel *viewModel;
  13. @end
  14. @implementation NYGetjobTimeVC
  15. @dynamic viewModel;
  16. #pragma mark - SystemMethod
  17. - (void)viewDidLoad {
  18. [super viewDidLoad];
  19. // Do any additional setup after loading the view.
  20. self.view.backgroundColor = UIColor.whiteColor;
  21. self.collectionView.backgroundColor = UIColor.clearColor;
  22. self.collectionView.backgroundView.backgroundColor = UIColor.clearColor;
  23. UIImageView *bgImageView = [[UIImageView alloc] initWithImage: [UIImage imageNamed:@"背景bg_top"]];
  24. [self.view insertSubview:bgImageView atIndex:0];
  25. [bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
  26. make.left.top.right.mas_equalTo(self.view);
  27. make.height.mas_equalTo(184.f);
  28. }];
  29. }
  30. - (UIColor *)qmui_titleViewTintColor
  31. {
  32. return UIColor.whiteColor;
  33. }
  34. - (UIImage *)qmui_navigationBarBackgroundImage
  35. {
  36. return [UIImage qmui_imageWithColor:UIColor.clearColor];
  37. }
  38. #pragma mark - OverrideMethods
  39. /// 配置collectionView的区域
  40. - (UIEdgeInsets)contentInset {
  41. return UIEdgeInsetsMake(RQ_APPLICATION_STATUS_BAR_HEIGHT + RQ_APPLICATION_NAV_BAR_HEIGHT, 0, 0, 0);
  42. }
  43. - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView dequeueReusableCellWithIdentifier:(NSString *)identifier forIndexPath:(NSIndexPath *)indexPath {
  44. RQCommonGroupViewModel *groupViewModel = self.viewModel.dataSource[indexPath.section];
  45. RQCommonCollectionItemViewModel *itemViewModel = groupViewModel.itemViewModels[indexPath.row];
  46. return [NSClassFromString(itemViewModel.itemClassName) cellWithCollectionView:collectionView forIndexPath:indexPath];
  47. }
  48. - (void)configureCell:(RQCommonCell *)cell atIndexPath:(NSIndexPath *)indexPath withObject:(id)object {
  49. [cell bindViewModel:object];
  50. }
  51. - (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section {
  52. switch (section) {
  53. case 1: {
  54. return UIEdgeInsetsMake(0, 16, 0, 16);
  55. }
  56. default: {
  57. return UIEdgeInsetsZero;
  58. }
  59. }
  60. }
  61. - (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section {
  62. switch (section) {
  63. case 1:
  64. return (RQ_SCREEN_WIDTH - 32 - (RQ_FIT_HORIZONTAL(90.f) * 3)) / 2.f;
  65. default:
  66. return 8;
  67. }
  68. }
  69. @end