YOUPAIHRsendRankVC.m 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. //
  2. // YOUPAIHRsendRankVC.m
  3. // VQU
  4. //
  5. // Created by xiaohaoran on 2021/10/19.
  6. // Copyright © 2021 MS. All rights reserved.
  7. //
  8. #import "YOUPAIHRsendRankVC.h"
  9. #import "JXCategoryView.h"
  10. #import "JXPagerView.h"
  11. #import "YOUPAIHRAccompanyRankVC.h"
  12. #import "YOUPAIHRLiveRankVC.h"
  13. #define LZCategoryViewHeight 44.0f
  14. #define LZCategoryViewItemWidth 34.0f
  15. @interface YOUPAIHRsendRankVC ()<JXCategoryViewDelegate,JXPagerViewDelegate,JXCategoryListContainerViewDelegate>
  16. @property (nonatomic, weak) JXCategoryListContainerView *youpaippagerView;
  17. @property (nonatomic, strong) JXCategoryTitleView *youpaipcategoryView;
  18. @property (strong, nonatomic) NSArray *youpaiptitlesArr;
  19. @end
  20. @implementation YOUPAIHRsendRankVC
  21. -(void)viewWillAppear:(BOOL)animated{
  22. [super viewWillAppear:animated];
  23. self.navigationController.navigationBarHidden = YES;
  24. }
  25. -(void)viewWillDisappear:(BOOL)animated{
  26. [super viewWillDisappear:animated];
  27. self.navigationController.navigationBarHidden = NO;
  28. }
  29. - (void)viewDidLoad {
  30. [super viewDidLoad];
  31. self.view.backgroundColor = [UIColor whiteColor];
  32. self.youpaiptitlesArr = @[@"送礼榜"];
  33. [self youpaifsetupUI];
  34. }
  35. -(void)youpaifsetupUI{
  36. UIView *categoryBgV = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0, KScreenWidth, LZCategoryViewHeight+StatusBarHeight)];
  37. [self.view addSubview:categoryBgV];
  38. // categoryBgV.backgroundColor = LCBkgColor;
  39. JXCategoryTitleView *categoryView = [[JXCategoryTitleView alloc] initWithFrame:CGRectMake(0, StatusBarHeight, KScreenWidth, LZCategoryViewHeight)];
  40. // categoryView.backgroundColor = LCBkgColor;
  41. categoryView.titles = self.youpaiptitlesArr;
  42. categoryView.delegate = self;
  43. categoryView.titleSelectedColor = LZ273145Color;
  44. categoryView.titleColor = LZ273145Color;
  45. categoryView.titleColorGradientEnabled = YES;
  46. categoryView.titleFont = LCFont(18.0f);
  47. categoryView.titleSelectedFont = LCBoldFont(18.0f);
  48. categoryView.cellWidth = 55;
  49. // categoryView.contentEdgeInsetLeft = 0;
  50. // categoryView.contentEdgeInsetRight = 0;
  51. categoryView.averageCellSpacingEnabled = YES;
  52. [categoryBgV addSubview:categoryView];
  53. self.youpaipcategoryView = categoryView;
  54. //返回
  55. UIButton *cancelBtn = [[UIButton alloc]initWithFrame:CGRectMake(19, 11 + StatusBarHeight, 20, 20)];
  56. [categoryBgV addSubview:cancelBtn];
  57. [cancelBtn setBackgroundImage:[UIImage imageNamed:@"vqu_images_navigation_back_black"] forState:UIControlStateNormal];
  58. [cancelBtn addTarget:self action:@selector(youpaifcancelButtonClick) forControlEvents:UIControlEventTouchUpInside];
  59. JXCategoryIndicatorLineView *lineView = [[JXCategoryIndicatorLineView alloc] init];
  60. lineView.verticalMargin = 4.0f;
  61. lineView.indicatorHeight = 2.5f;
  62. lineView.indicatorWidth = 8;
  63. lineView.layer.cornerRadius = 1.25;
  64. lineView.layer.masksToBounds = YES;
  65. [lineView.layer addSublayer:[LCTools getGradientLayerWithSize:CGSizeMake(lineView.indicatorWidth, lineView.indicatorHeight) twoColors:@[HexColorFromRGB(0xffffff),HexColorFromRGB(0xFFFFFF)] gradientType:GradientLeftToRight]];
  66. categoryView.indicators = @[lineView];
  67. JXCategoryListContainerView *pagerView = [[JXCategoryListContainerView alloc] initWithType:JXCategoryListContainerType_CollectionView delegate:self];
  68. // pagerView.listCellBackgroundColor = LCBkgColor;
  69. pagerView.frame = CGRectMake(0.0f, categoryBgV.mj_h, KScreenWidth, KScreenHeight - categoryBgV.mj_h - TabbarHeight+LZCategoryViewHeight);
  70. [self.view addSubview:pagerView];
  71. self.youpaippagerView = pagerView;
  72. self.youpaipcategoryView.listContainer = self.youpaippagerView;
  73. }
  74. -(void)youpaifcancelButtonClick{
  75. [self.navigationController popViewControllerAnimated:YES];
  76. }
  77. // 返回列表的数量
  78. - (NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView {
  79. return self.youpaiptitlesArr.count;
  80. }
  81. // 根据下标 index 返回对应遵守并实现 `JXCategoryListContentViewDelegate` 协议的列表实例
  82. - (id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index {
  83. //1是陪伴榜 2直播榜
  84. YOUPAIHRAccompanyRankVC *vc = [YOUPAIHRAccompanyRankVC new];
  85. return vc;
  86. // if (index == 0) {
  87. //
  88. // }else{
  89. // YOUPAIHRLiveRankVC *vc = [YOUPAIHRLiveRankVC new];
  90. // return vc;
  91. // }
  92. }
  93. @end