123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- //
- // YOUPAILZLiveInviteVC.m
- // TIANYAN
- //
- // Created by CY on 2021/5/28.
- // Copyright © 2021 leo. All rights reserved.
- //
- #import "YOUPAILZLiveInviteVC.h"
- #import "YOUPAILZLiveInviteListVC.h"
- #import "JXCategoryView.h"
- #import "JXPagerListRefreshView.h"
- @interface YOUPAILZLiveInviteVC () <JXCategoryViewDelegate,JXCategoryListContainerViewDelegate>
- @property (nonatomic,assign) LZLiveInviteType youpaiptype;
- @property (nonatomic, weak) JXPagerListRefreshView *youpaippagerView;
- @property (nonatomic, strong) JXCategoryTitleView *youpaipcategoryView;
- @end
- @implementation YOUPAILZLiveInviteVC
- -(instancetype)initWithType:(LZLiveInviteType)type{
- if (self = [super init]) {
- _youpaiptype = type;
- }
- return self;
- }
- - (void)viewDidLoad {
- [super viewDidLoad];
- self.view.backgroundColor = [UIColor clearColor];
- [self youpaifinitUI];
- }
- - (void)youpaifinitUI{
-
- UIView *bgV = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, KScreenWidth, ScaleSize(343.0f))];
- bgV.layer.borderColor = HexColorFromRGB(0x4F4B5B).CGColor;
- bgV.layer.borderWidth = 0.5f;
- bgV.backgroundColor = LCBkgColor;
- [LCTools clipCorner:UIRectCornerTopLeft|UIRectCornerTopRight View:bgV size:CGSizeMake(20.0f, 20.0f)];
- [self.view addSubview:bgV];
- [bgV mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.right.bottom.offset(0.0f);
- make.height.offset(ScaleSize(343.0f));
- }];
-
- UILabel *titleL = [[UILabel alloc] init];
- titleL.font = LCFont17;
- titleL.textColor = [UIColor whiteColor];
- titleL.textAlignment = NSTextAlignmentCenter;
- titleL.text = self.titleStr;
- [bgV addSubview:titleL];
- [titleL mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.top.right.offset(0.0f);
- make.height.offset(49.0f);
- }];
-
- JXCategoryTitleView *youpaipcategoryView = [[JXCategoryTitleView alloc] init];
- youpaipcategoryView.backgroundColor = LCBkgColor;
- youpaipcategoryView.titles = self.titles;
- youpaipcategoryView.delegate = self;
- youpaipcategoryView.titleSelectedColor = [UIColor whiteColor];
- youpaipcategoryView.titleColor = HexColorFromRGB(0x9F9DA5);
- youpaipcategoryView.titleColorGradientEnabled = YES;
- youpaipcategoryView.titleFont = LCFont(16.0f);
- youpaipcategoryView.titleSelectedFont = LCFont(16.0f);
- youpaipcategoryView.cellSpacing = 0.0f;
- youpaipcategoryView.averageCellSpacingEnabled = YES;
- [bgV addSubview:youpaipcategoryView];
- self.youpaipcategoryView = youpaipcategoryView;
- [youpaipcategoryView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.right.offset(0.0f);
- make.top.equalTo(titleL.mas_bottom).offset(0.0f);
- make.height.offset(43.0f);
- }];
-
- JXCategoryIndicatorLineView *lineView = [[JXCategoryIndicatorLineView alloc] init];
- lineView.verticalMargin = 4.0f;
- lineView.indicatorHeight = 2.0f;
- lineView.indicatorWidth = 18.0f;
- lineView.indicatorColor = [UIColor whiteColor];
- lineView.layer.cornerRadius = 1.0f;
- lineView.clipsToBounds = YES;
- youpaipcategoryView.indicators = @[lineView];
-
- JXCategoryListContainerView *pagerView = [[JXCategoryListContainerView alloc] initWithType:JXCategoryListContainerType_CollectionView delegate:self];
- pagerView.listCellBackgroundColor = LCBkgColor;
- [bgV addSubview:pagerView];
- youpaipcategoryView.listContainer = pagerView;
- [pagerView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.right.bottom.offset(0.0f);
- make.top.equalTo(youpaipcategoryView.mas_bottom).offset(0.0f);
- }];
- }
- - (NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView{
- return self.titles.count;
- }
- - (id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index{
- YOUPAILZLiveInviteListVC *vc = [[YOUPAILZLiveInviteListVC alloc] initWithType:self.youpaiptype];
- vc.youpaipis_invite = index;
- WeakSelf;
- [vc setYoupaipinviteBlock:^(LZLiveInviteType type, YOUPAILZLiveInviteModel * _Nonnull model) {
- [weakSelf dismissViewControllerAnimated:YES completion:^{
- if (weakSelf.youpaipinviteBlock != nil) {
- weakSelf.youpaipinviteBlock(type, model);
- }
- }];
- }];
- return vc;
- }
- - (NSArray <NSString *>*)titles{
- return @[@"可邀请的女神",@"最近邀请过的人"];
- }
- - (NSString *)titleStr{
- if (self.youpaiptype == LZLiveInviteTypePK) {
- return @"发起PK";
- }else{
- return @"发起连麦";
- }
- }
- @end
|