YOUPAILZLiveAnchorHotWindow.m 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. #import "YOUPAILZLiveAnchorHotWindow.h"
  2. #import "JXCategoryView.h"
  3. #import "YOUPAIJXCategoryTitleBackgroundView.h"
  4. #import "JXCategoryListContainerView.h"
  5. #import "YOUPAILZLiveAnchorHotListVC.h"
  6. @interface YOUPAILZLiveAnchorHotWindow ()<JXCategoryViewDelegate,JXCategoryListContainerViewDelegate>
  7. @end
  8. @implementation YOUPAILZLiveAnchorHotWindow
  9. - (void)viewDidLoad {
  10. [super viewDidLoad];
  11. self.baseView.hidden = YES;
  12. [self youpaifinitUI];
  13. }
  14. - (void)youpaifinitUI{
  15. UIImageView *youpaipbgImgV = [[UIImageView alloc] initWithImage:[LCTools ColorImage:CGSizeMake(KScreenWidth, KScreenHeight * 0.6f) FromColors:@[HexColorFromRGB(0xF775BD),HexColorFromRGB(0xF43333)] ByGradientType:GradientTopToBottom]];
  16. youpaipbgImgV.frame = CGRectMake(0.0f, 0.0f, KScreenWidth, KScreenHeight * 0.6f);
  17. youpaipbgImgV.userInteractionEnabled = YES;
  18. [LCTools clipCorner:UIRectCornerTopLeft|UIRectCornerTopRight View:youpaipbgImgV size:CGSizeMake(20.0f, 20.0f)];
  19. [self.view addSubview:youpaipbgImgV];
  20. [youpaipbgImgV mas_makeConstraints:^(MASConstraintMaker *make) {
  21. make.left.right.offset(0.0f);
  22. make.bottom.offset(1.5f);
  23. make.height.offset(KScreenHeight * 0.6f);
  24. }];
  25. // vqu_images_L_live_anchor_hot
  26. UIView *bgV = [[UIView alloc] initWithFrame:CGRectMake(1.5f, 1.5f, KScreenWidth - 3.0f, KScreenHeight * 0.6f - 3.0f)];
  27. bgV.backgroundColor = LCBkgColor;
  28. [LCTools clipCorner:UIRectCornerTopLeft|UIRectCornerTopRight View:bgV size:CGSizeMake(20.0f, 20.0f)];
  29. [youpaipbgImgV addSubview:bgV];
  30. [bgV mas_makeConstraints:^(MASConstraintMaker *make) {
  31. make.left.offset(1.5f);
  32. make.top.offset(1.5f);
  33. make.right.offset(-1.5f);
  34. make.bottom.offset(0.0f);
  35. }];
  36. UIImageView *hotImageView = [UIImageView new];
  37. [self.view addSubview:hotImageView];
  38. [hotImageView mas_makeConstraints:^(MASConstraintMaker *make) {
  39. make.centerX.mas_equalTo(0);
  40. make.top.mas_equalTo(youpaipbgImgV.mas_top).offset(-30);
  41. make.size.mas_equalTo(CGSizeMake(190, 57));
  42. }];
  43. hotImageView.image = [UIImage imageNamed:@"vqu_images_L_live_anchor_hot"];
  44. YOUPAIJXCategoryTitleBackgroundView *youpaipcategoryView = [[YOUPAIJXCategoryTitleBackgroundView alloc] init];
  45. youpaipcategoryView.backgroundColor = HexColorFromRGB(0xFF9494);
  46. youpaipcategoryView.titles = self.titles;
  47. youpaipcategoryView.delegate = self;
  48. youpaipcategoryView.titleSelectedColor = HexColorFromRGB(0xffffff);
  49. youpaipcategoryView.titleColor = HexColorFromRGB(0xFF9494);
  50. youpaipcategoryView.titleColorGradientEnabled = YES;
  51. youpaipcategoryView.titleFont = LCFont(14.0f);
  52. youpaipcategoryView.titleSelectedFont = LCFont(14.0f);
  53. youpaipcategoryView.cellWidth = 82.0f;
  54. youpaipcategoryView.cellSpacing = 1.0f;
  55. youpaipcategoryView.averageCellSpacingEnabled = NO;
  56. youpaipcategoryView.normalBackgroundColor = LCBkgColor;
  57. youpaipcategoryView.selectedBackgroundColor = [UIColor colorWithPatternImage:[LCTools ColorImage:CGSizeMake(82.0f, 27.0f) FromColors:@[HexColorFromRGB(0xF775BD),HexColorFromRGB(0xF43333)] ByGradientType:GradientTopToBottom]];
  58. youpaipcategoryView.cellWidthIncrement = 0;
  59. youpaipcategoryView.normalBorderColor = [UIColor clearColor];
  60. youpaipcategoryView.selectedBorderColor = [UIColor clearColor];
  61. youpaipcategoryView.borderLineWidth = 0;
  62. youpaipcategoryView.backgroundCornerRadius = 0.0f;
  63. youpaipcategoryView.backgroundWidth = JXCategoryViewAutomaticDimension;
  64. youpaipcategoryView.backgroundHeight = 27.0f;
  65. youpaipcategoryView.layer.cornerRadius = 27/2.f;
  66. youpaipcategoryView.clipsToBounds = YES;
  67. youpaipcategoryView.layer.borderColor = HexColorFromRGB(0xFF9494).CGColor;
  68. youpaipcategoryView.layer.borderWidth = 1.0f;
  69. [bgV addSubview:youpaipcategoryView];
  70. JXCategoryListContainerView *pagerView = [[JXCategoryListContainerView alloc] initWithType:JXCategoryListContainerType_CollectionView delegate:self];
  71. pagerView.listCellBackgroundColor = LCBkgColor;
  72. [bgV addSubview:pagerView];
  73. youpaipcategoryView.listContainer = pagerView;
  74. [youpaipcategoryView mas_makeConstraints:^(MASConstraintMaker *make) {
  75. make.centerX.equalTo(bgV.mas_centerX);
  76. make.top.offset(26.0f);
  77. make.size.mas_offset(CGSizeMake(250.0f, 27.0f));
  78. }];
  79. [pagerView mas_makeConstraints:^(MASConstraintMaker *make) {
  80. make.left.right.bottom.offset(0.0f);
  81. make.top.equalTo(youpaipcategoryView.mas_bottom).offset(14.0f);
  82. }];
  83. }
  84. - (NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView{
  85. return self.titles.count;
  86. }
  87. - (id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index{
  88. if (index == 0) {
  89. YOUPAILZLiveAnchorHotListVC *vc = [[YOUPAILZLiveAnchorHotListVC alloc] init];
  90. vc.youpaiplive_id = self.youpaiplive_id;
  91. vc.youpaiptype = LZLiveAnchorHotListType_day;
  92. vc.selectedMemberBlock = self.selectedMemberBlock;
  93. return vc;
  94. }else if(index == 1) {
  95. YOUPAILZLiveAnchorHotListVC *vc = [[YOUPAILZLiveAnchorHotListVC alloc] init];
  96. vc.youpaiplive_id = self.youpaiplive_id;
  97. vc.youpaiptype = LZLiveAnchorHotListType_week;
  98. vc.selectedMemberBlock = self.selectedMemberBlock;
  99. return vc;
  100. }else{
  101. YOUPAILZLiveAnchorHotListVC *vc = [[YOUPAILZLiveAnchorHotListVC alloc] init];
  102. vc.youpaiplive_id = self.youpaiplive_id;
  103. vc.youpaiptype = LZLiveAnchorHotListType_month;
  104. vc.selectedMemberBlock = self.selectedMemberBlock;
  105. return vc;
  106. }
  107. }
  108. - (NSArray <NSString *> *)titles{
  109. return @[@"日榜",@"周榜",@"月榜"];
  110. }
  111. @end