131 lines
4.6 KiB
Mathematica
131 lines
4.6 KiB
Mathematica
|
|
//
|
|||
|
|
// AmPKVC.m
|
|||
|
|
// romantic
|
|||
|
|
//
|
|||
|
|
// Created by DLAN on 2023/2/13.
|
|||
|
|
// Copyright © 2023 romantic. All rights reserved.
|
|||
|
|
//
|
|||
|
|
|
|||
|
|
#import "AmPKVC.h"
|
|||
|
|
#import "PkListVC.h"
|
|||
|
|
#import "PkjiluViewVC.h"
|
|||
|
|
#import "PKRecordListVC.h"
|
|||
|
|
|
|||
|
|
@interface AmPKVC ()<JXCategoryListContainerViewDelegate>
|
|||
|
|
@property (nonatomic, strong) JXCategoryTitleView *categoryView;
|
|||
|
|
@property (nonatomic, strong) JXCategoryListContainerView *listContainerView;
|
|||
|
|
@property (nonatomic, strong) NSArray *titles;
|
|||
|
|
@end
|
|||
|
|
|
|||
|
|
@implementation AmPKVC
|
|||
|
|
|
|||
|
|
- (void)viewDidLoad {
|
|||
|
|
[super viewDidLoad];
|
|||
|
|
|
|||
|
|
[self loadBar:YES needBack:YES needBackground:NO];
|
|||
|
|
self.titleLabel.text = @"发起PK";
|
|||
|
|
self.titleLabel.textColor = kWhiteColor;
|
|||
|
|
self.view.backgroundColor = HEXCOLOR(0x13131F);
|
|||
|
|
self.barView.backgroundColor = kClearColor;
|
|||
|
|
// [self.leftButton setImage:ImageNamed(@"whiteBack") forState:UIControlStateNormal];
|
|||
|
|
[self.rightButton setTitle:@"PK记录" forState:UIControlStateNormal];
|
|||
|
|
self.rightButton.frame = CGRectMake(ScreenWidth-12-60, ZJStatusBarH+12, 60, 20);
|
|||
|
|
self.rightButton.titleLabel.font = [UIFont systemFontOfSize:13];
|
|||
|
|
[self.rightButton setTitleColor:kBlackColor forState:UIControlStateNormal];
|
|||
|
|
self.rightButton.backgroundColor = mainDeepColor;
|
|||
|
|
self.rightButton.layer.cornerRadius = 10;
|
|||
|
|
|
|||
|
|
// self.titles = @[@"按钻石价值PK", @"按人气票数PK"];
|
|||
|
|
self.titles = @[@"按钻石价值PK"];
|
|||
|
|
|
|||
|
|
[self createUI];
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
-(void)rightButtonClick:(UIButton *)sender{
|
|||
|
|
PKRecordListVC *vc = [[PKRecordListVC alloc]init];
|
|||
|
|
vc.roomId = self.roomId;
|
|||
|
|
|
|||
|
|
[self.navigationController pushViewController:vc animated:YES];
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
-(void)createUI {
|
|||
|
|
[self.view addSubview:self.categoryView];
|
|||
|
|
[self.view addSubview:self.listContainerView];
|
|||
|
|
|
|||
|
|
[self.categoryView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|||
|
|
make.top.equalTo(self.view).offset(yb_NavigationBar_H);
|
|||
|
|
make.centerX.equalTo(self.view);
|
|||
|
|
make.width.mas_equalTo(260);
|
|||
|
|
make.height.mas_equalTo(0);
|
|||
|
|
}];
|
|||
|
|
[self.listContainerView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|||
|
|
make.top.equalTo(self.categoryView.mas_bottom).offset(10);
|
|||
|
|
make.left.right.equalTo(self.view);
|
|||
|
|
make.bottom.equalTo(self.view);
|
|||
|
|
}];
|
|||
|
|
}
|
|||
|
|
// 分页菜单视图
|
|||
|
|
- (JXCategoryTitleView *)categoryView {
|
|||
|
|
if (!_categoryView) {
|
|||
|
|
_categoryView = [[JXCategoryTitleView alloc] init];
|
|||
|
|
_categoryView.titleFont = YBMediumFont(15);
|
|||
|
|
_categoryView.titleSelectedFont = YBBoldFont(15);
|
|||
|
|
_categoryView.titleColor = HEXCOLOR(0xFFFFFF);
|
|||
|
|
_categoryView.titleSelectedColor = HEXCOLOR(0xFFFFFF);
|
|||
|
|
_categoryView.contentEdgeInsetLeft = 15;
|
|||
|
|
_categoryView.cellSpacing = 24;
|
|||
|
|
_categoryView.averageCellSpacingEnabled = NO;
|
|||
|
|
|
|||
|
|
_categoryView.listContainer = self.listContainerView;
|
|||
|
|
_categoryView.titles = self.titles;
|
|||
|
|
|
|||
|
|
JXCategoryIndicatorLineView *lineView = [[JXCategoryIndicatorLineView alloc] init];
|
|||
|
|
lineView.indicatorWidth = 49;
|
|||
|
|
lineView.indicatorHeight = 8;
|
|||
|
|
lineView.indicatorCornerRadius = 4;
|
|||
|
|
lineView.indicatorColor = HEXCOLORA(0xFDE837, 0.37);
|
|||
|
|
lineView.verticalMargin = 10;
|
|||
|
|
lineView.lineStyle = JXCategoryIndicatorLineStyle_Lengthen;
|
|||
|
|
_categoryView.indicators = @[lineView];
|
|||
|
|
}
|
|||
|
|
return _categoryView;
|
|||
|
|
}
|
|||
|
|
// 列表容器视图
|
|||
|
|
- (JXCategoryListContainerView *)listContainerView {
|
|||
|
|
if (!_listContainerView) {
|
|||
|
|
_listContainerView = [[JXCategoryListContainerView alloc] initWithType:JXCategoryListContainerType_ScrollView delegate:self];
|
|||
|
|
}
|
|||
|
|
return _listContainerView;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#pragma mark - JXCategoryListContainerViewDelegate
|
|||
|
|
|
|||
|
|
// 返回列表的数量
|
|||
|
|
- (NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView {
|
|||
|
|
return self.titles.count;
|
|||
|
|
}
|
|||
|
|
// 返回各个列表菜单下的实例,该实例需要遵守并实现 <JXCategoryListContentViewDelegate> 协议
|
|||
|
|
- (id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index {
|
|||
|
|
PkListVC *list = [[PkListVC alloc] init];
|
|||
|
|
WEAK_SELF
|
|||
|
|
list.quitPkSet = ^{
|
|||
|
|
if(weakSelf.ShowPkView){
|
|||
|
|
weakSelf.ShowPkView();
|
|||
|
|
}
|
|||
|
|
};
|
|||
|
|
list.type = index+1;
|
|||
|
|
list.roomId = self.roomId;
|
|||
|
|
return list;
|
|||
|
|
}
|
|||
|
|
/*
|
|||
|
|
#pragma mark - Navigation
|
|||
|
|
|
|||
|
|
// In a storyboard-based application, you will often want to do a little preparation before navigation
|
|||
|
|
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
|
|||
|
|
// Get the new view controller using [segue destinationViewController].
|
|||
|
|
// Pass the selected object to the new view controller.
|
|||
|
|
}
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
@end
|