首次提交
This commit is contained in:
121
SweetParty/主类/Mine/GongHui/SPGonghuiDetailListVC.m
Executable file
121
SweetParty/主类/Mine/GongHui/SPGonghuiDetailListVC.m
Executable file
@@ -0,0 +1,121 @@
|
||||
//
|
||||
// SPGonghuiDetailListVC.m
|
||||
// SweetParty
|
||||
//
|
||||
// Created by bj_szd on 2022/6/29.
|
||||
//
|
||||
|
||||
#import "SPGonghuiDetailListVC.h"
|
||||
#import "SPGonghuiRoomListVC.h"
|
||||
#import "SPGonghuiUserListVC.h"
|
||||
|
||||
@interface SPGonghuiDetailListVC ()<JXCategoryListContainerViewDelegate>
|
||||
|
||||
@property (nonatomic, strong) NSArray *titles;
|
||||
@property (nonatomic, strong) JXCategoryTitleView *categoryView;
|
||||
@property (nonatomic, strong) JXCategoryListContainerView *listContainerView;
|
||||
|
||||
@end
|
||||
|
||||
@implementation SPGonghuiDetailListVC
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
|
||||
if (self.type == 2){
|
||||
self.navTitle = @"公会房间";
|
||||
}else{
|
||||
self.navTitle = @"公会成员";
|
||||
}
|
||||
[self.customNavBar styleClear];
|
||||
|
||||
self.titles = @[@"昨日", @"今日", @"本周", @"上周", @"月榜"];
|
||||
|
||||
[self createUI];
|
||||
}
|
||||
|
||||
-(void)createUI {
|
||||
UIImageView *bgImgV = [[UIImageView alloc] initWithImage:ImageNamed(@"gonghui_bg")];
|
||||
[self.view insertSubview:bgImgV atIndex:0];
|
||||
[bgImgV mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.left.right.equalTo(self.view);
|
||||
make.height.mas_equalTo(ScreenWidth/375*812);
|
||||
}];
|
||||
|
||||
[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.left.right.equalTo(self.view);
|
||||
make.height.mas_equalTo(40);
|
||||
}];
|
||||
[self.listContainerView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.categoryView.mas_bottom).offset(0);
|
||||
make.left.right.bottom.equalTo(self.view);
|
||||
}];
|
||||
}
|
||||
|
||||
// 分页菜单视图
|
||||
- (JXCategoryTitleView *)categoryView {
|
||||
if (!_categoryView) {
|
||||
_categoryView = [[JXCategoryTitleView alloc] init];
|
||||
_categoryView.titleFont = YBMediumFont(14);
|
||||
_categoryView.titleSelectedFont = YBBoldFont(16);
|
||||
_categoryView.titleColor = HEXCOLOR(0x999999);
|
||||
_categoryView.titleSelectedColor = HEXCOLOR(0x333333);
|
||||
_categoryView.contentEdgeInsetLeft = 20;
|
||||
_categoryView.contentEdgeInsetRight = 20;
|
||||
|
||||
_categoryView.listContainer = self.listContainerView;
|
||||
_categoryView.titles = self.titles;
|
||||
|
||||
// JXCategoryIndicatorBackgroundView *backgroundView = [[JXCategoryIndicatorBackgroundView alloc] init];
|
||||
// backgroundView.indicatorWidth = 69;
|
||||
// backgroundView.indicatorHeight = 27;
|
||||
// backgroundView.indicatorCornerRadius = 13.5;
|
||||
// backgroundView.indicatorColor = HEXCOLOR(0xFFE95E);
|
||||
// _categoryView.indicators = @[backgroundView];
|
||||
}
|
||||
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 {
|
||||
if (self.type == 1) {
|
||||
SPGonghuiUserListVC *list = [[SPGonghuiUserListVC alloc] init];
|
||||
list.dateType = index+1;
|
||||
list.guild_id = self.guild_id;
|
||||
|
||||
return list;
|
||||
}else {
|
||||
SPGonghuiRoomListVC *list = [[SPGonghuiRoomListVC alloc] init];
|
||||
list.dateType = index+1;
|
||||
list.guild_id = self.guild_id;
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - JXCategoryListContentViewDelegate
|
||||
|
||||
- (UIView *)listView {
|
||||
return self.view;
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user