YOUPAIHRChatRoomContributeListVC.m 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. //
  2. // YOUPAIHRChatRoomContributeListVC.m
  3. // VQU
  4. //
  5. // Created by xiaohaoran on 2021/11/3.
  6. // Copyright © 2021 MS. All rights reserved.
  7. //
  8. #import "YOUPAIHRChatRoomContributeListVC.h"
  9. #import "JXCategoryView.h"
  10. #import "YOUPAIJXCategoryTitleBackgroundView.h"
  11. #import "JXCategoryListContainerView.h"
  12. //#import "YOUPAIHRChatRoomCurrentAudienceVC.h"
  13. #import "YOUPAIHRChatRoomContributeDetailVC.h"
  14. @interface YOUPAIHRChatRoomContributeListVC ()<JXCategoryViewDelegate,JXCategoryListContainerViewDelegate>
  15. @end
  16. @implementation YOUPAIHRChatRoomContributeListVC
  17. - (void)viewDidLoad {
  18. [super viewDidLoad];
  19. self.baseView.hidden = YES;
  20. [self youpaifinitUI];
  21. }
  22. - (void)youpaifinitUI{
  23. UIView *bgV = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, KScreenWidth, 400.0f + SafeHeight)];
  24. bgV.backgroundColor = LCBkgColor;
  25. [LCTools clipCorner:UIRectCornerTopLeft|UIRectCornerTopRight View:bgV size:CGSizeMake(20.0f, 20.0f)];
  26. [self.view addSubview:bgV];
  27. [bgV mas_makeConstraints:^(MASConstraintMaker *make) {
  28. make.left.offset(0.0f);
  29. make.right.offset(0.0f);
  30. make.bottom.offset(0.0f);
  31. make.height.offset(400.0f + SafeHeight);
  32. }];
  33. YOUPAIJXCategoryTitleBackgroundView *youpaipcategoryView = [[YOUPAIJXCategoryTitleBackgroundView alloc] init];
  34. youpaipcategoryView.backgroundColor = LCBkgColor;
  35. youpaipcategoryView.titles = self.titles;
  36. youpaipcategoryView.delegate = self;
  37. youpaipcategoryView.titleSelectedColor = HexColorFromRGB(0xF4003F);
  38. youpaipcategoryView.titleColor = HexColorFromRGB(0xffffff);
  39. youpaipcategoryView.titleColorGradientEnabled = YES;
  40. youpaipcategoryView.titleFont = LCFont(16.0f);
  41. youpaipcategoryView.titleSelectedFont = LCFont(16.0f);
  42. youpaipcategoryView.averageCellSpacingEnabled = YES;
  43. youpaipcategoryView.normalBackgroundColor = [UIColor clearColor];
  44. youpaipcategoryView.selectedBackgroundColor = LCBkgColor;
  45. youpaipcategoryView.cellWidthIncrement = 0;
  46. youpaipcategoryView.normalBorderColor = [UIColor clearColor];
  47. youpaipcategoryView.selectedBorderColor = [UIColor clearColor];
  48. youpaipcategoryView.borderLineWidth = 0;
  49. youpaipcategoryView.backgroundCornerRadius = 0.0f;
  50. [youpaipcategoryView addLineWithColor:[[UIColor whiteColor] colorWithAlphaComponent:0.07f] lineRect:CGRectMake(0.0f, 44.5f, KScreenWidth, 0.5f)];
  51. [bgV addSubview:youpaipcategoryView];
  52. JXCategoryIndicatorLineView *lineView = [[JXCategoryIndicatorLineView alloc] init];
  53. lineView.verticalMargin = 4.0f;
  54. lineView.indicatorHeight = 2.5f;
  55. lineView.indicatorWidth = 8.0f;
  56. lineView.indicatorColor = HexColorFromRGB(0xF4003F);
  57. youpaipcategoryView.indicators = @[lineView];
  58. JXCategoryListContainerView *pagerView = [[JXCategoryListContainerView alloc] initWithType:JXCategoryListContainerType_CollectionView delegate:self];
  59. pagerView.listCellBackgroundColor = LCBkgColor;
  60. [bgV addSubview:pagerView];
  61. youpaipcategoryView.listContainer = pagerView;
  62. [youpaipcategoryView mas_makeConstraints:^(MASConstraintMaker *make) {
  63. make.left.right.top.offset(0.0f);
  64. make.height.offset(45.0f);
  65. }];
  66. [pagerView mas_makeConstraints:^(MASConstraintMaker *make) {
  67. make.left.right.bottom.offset(0.0f);
  68. make.top.equalTo(youpaipcategoryView.mas_bottom).offset(0.0f);
  69. }];
  70. }
  71. - (NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView{
  72. return self.titles.count;
  73. }
  74. - (id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index{
  75. YOUPAIHRChatRoomContributeDetailVC *vc = [YOUPAIHRChatRoomContributeDetailVC new];
  76. vc.youpaipchatroomModel = self.youpaipchatroomModel;
  77. if (index == 0) {
  78. vc.youpaiptype = 1;
  79. }else{
  80. vc.youpaiptype = 0;
  81. }
  82. @weakify(self);
  83. [vc setYoupaiptouchUserBlock:^(NSString * _Nonnull userId) {
  84. @strongify(self);
  85. [self dismissViewControllerAnimated:YES completion:^{
  86. @strongify(self);
  87. self.youpaiptouchUserBlock(userId);
  88. }];
  89. }];
  90. return vc;
  91. }
  92. - (NSArray <NSString *> *)titles{
  93. return @[@"魅力榜",@"财富榜"];
  94. }
  95. @end