112 lines
3.5 KiB
Objective-C
Executable File
112 lines
3.5 KiB
Objective-C
Executable File
//
|
|
// SPBangDanContainerVC.m
|
|
// SweetParty
|
|
//
|
|
// Created by bj_szd on 2022/6/8.
|
|
//
|
|
|
|
#import "SPBangDanContainerVC.h"
|
|
#import "SPBangDanDateVC.h"
|
|
|
|
@interface SPBangDanContainerVC ()<JXCategoryListContainerViewDelegate, JXCategoryViewDelegate>
|
|
|
|
@property (nonatomic, strong) NSArray *titles;
|
|
@property (nonatomic, strong) JXCategoryImageView *categoryView;
|
|
@property (nonatomic, strong) JXCategoryListContainerView *listContainerView;
|
|
|
|
@property (nonatomic, strong) UIImageView *bgImgV;
|
|
|
|
@end
|
|
|
|
@implementation SPBangDanContainerVC
|
|
|
|
- (void)viewDidLoad {
|
|
[super viewDidLoad];
|
|
|
|
self.titles = @[@"贡献榜", @"魅力榜", @"房间榜"];
|
|
|
|
[self showNaviBarWithTitle:@""];
|
|
|
|
[self createUI];
|
|
}
|
|
|
|
- (void)createUI {
|
|
UIImageView *imgV = [[UIImageView alloc] initWithImage:ImageNamed(@"bang_bg_gx")];
|
|
[self.view addSubview:imgV];
|
|
[self.view sendSubviewToBack:imgV];
|
|
self.bgImgV = imgV;
|
|
[imgV mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.top.left.right.equalTo(self.view);
|
|
make.height.mas_equalTo(ScreenWidth/375*360);
|
|
}];
|
|
|
|
[self.view addSubview:self.categoryView];
|
|
[self.view addSubview:self.listContainerView];
|
|
|
|
[self.categoryView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.top.equalTo(self.view).offset(yb_StatusBar_H+10);
|
|
make.centerX.equalTo(self.view);
|
|
make.width.mas_equalTo(APPW-130);
|
|
make.height.mas_equalTo(44);
|
|
}];
|
|
[self.listContainerView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.top.equalTo(self.categoryView.mas_bottom);
|
|
make.left.right.bottom.equalTo(self.view);
|
|
}];
|
|
}
|
|
|
|
// 分页菜单视图
|
|
- (JXCategoryImageView *)categoryView {
|
|
if (!_categoryView) {
|
|
_categoryView = [[JXCategoryImageView alloc] init];
|
|
_categoryView.delegate = self;
|
|
_categoryView.imageSize = CGSizeMake(54, 21);
|
|
_categoryView.contentEdgeInsetLeft = 10;
|
|
_categoryView.contentEdgeInsetRight = 10;
|
|
_categoryView.imageZoomEnabled = YES;
|
|
|
|
_categoryView.listContainer = self.listContainerView;
|
|
|
|
_categoryView.imageNames = @[@"gxb_nor", @"mlb_nor", @"room_nor"];
|
|
_categoryView.selectedImageNames = @[@"gxb_sel", @"mlb_sel", @"room_sel"];
|
|
}
|
|
return _categoryView;
|
|
}
|
|
|
|
// 列表容器视图
|
|
- (JXCategoryListContainerView *)listContainerView {
|
|
if (!_listContainerView) {
|
|
_listContainerView = [[JXCategoryListContainerView alloc] initWithType:JXCategoryListContainerType_ScrollView delegate:self];
|
|
}
|
|
return _listContainerView;
|
|
}
|
|
|
|
- (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index {
|
|
if (index == 0) {
|
|
self.bgImgV.image = ImageNamed(@"bang_bg_gx");
|
|
}else if (index == 1) {
|
|
self.bgImgV.image = ImageNamed(@"bang_bg_ml");
|
|
}else if (index == 2) {
|
|
self.bgImgV.image = ImageNamed(@"bang_bg_room");
|
|
}
|
|
|
|
}
|
|
|
|
#pragma mark - JXCategoryListContainerViewDelegate
|
|
|
|
// 返回列表的数量
|
|
- (NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView {
|
|
return self.titles.count;
|
|
}
|
|
|
|
// 返回各个列表菜单下的实例,该实例需要遵守并实现 <JXCategoryListContentViewDelegate> 协议
|
|
- (id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index {
|
|
SPBangDanDateVC *list = [[SPBangDanDateVC alloc] init];
|
|
list.rid = self.rid;
|
|
list.type = index+1;
|
|
return list;
|
|
}
|
|
|
|
@end
|
|
|