增加换肤功能
This commit is contained in:
16
QXLive/HomePage(声播)/Controlller/QXHomeSearchResultVC.h
Normal file
16
QXLive/HomePage(声播)/Controlller/QXHomeSearchResultVC.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QXHomeSearchResultVC.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/7/10.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXHomeSearchResultVC : QXBaseViewController
|
||||
@property (nonatomic,strong)NSArray *resultArray;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
87
QXLive/HomePage(声播)/Controlller/QXHomeSearchResultVC.m
Normal file
87
QXLive/HomePage(声播)/Controlller/QXHomeSearchResultVC.m
Normal file
@@ -0,0 +1,87 @@
|
||||
//
|
||||
// QXHomeSearchResultVC.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/7/10.
|
||||
//
|
||||
|
||||
#import "QXHomeSearchResultVC.h"
|
||||
#import "QXHomeRoomCell.h"
|
||||
|
||||
@interface QXHomeSearchResultVC ()<UICollectionViewDelegate,UICollectionViewDataSource>
|
||||
@property (nonatomic,strong)UICollectionView *collectionView;
|
||||
@end
|
||||
|
||||
@implementation QXHomeSearchResultVC
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
-(void)setNavgationItems{
|
||||
[super setNavgationItems];
|
||||
self.navigationItem.title = @"搜索结果";
|
||||
}
|
||||
-(void)viewWillAppear:(BOOL)animated{
|
||||
[super viewWillAppear:animated];
|
||||
[self.navigationController setNavigationBarHidden:NO animated:YES];
|
||||
}
|
||||
-(void)initSubViews{
|
||||
[self.view addSubview:self.collectionView];
|
||||
}
|
||||
|
||||
-(void)setResultArray:(NSArray *)resultArray{
|
||||
_resultArray = resultArray;
|
||||
[self.collectionView reloadData];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout
|
||||
-(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView{
|
||||
return 1;
|
||||
}
|
||||
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
|
||||
return self.resultArray.count;
|
||||
}
|
||||
-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXHomeRoomCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXHomeRoomCell" forIndexPath:indexPath];
|
||||
cell.searchModel = self.resultArray[indexPath.row];
|
||||
return cell;
|
||||
}
|
||||
|
||||
-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
return CGSizeMake((SCREEN_WIDTH-15*3-1)/2.0, (SCREEN_WIDTH-15*3-1)/2.0);
|
||||
}
|
||||
|
||||
|
||||
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXSearchModel *model = self.resultArray[indexPath.row];
|
||||
[[QXGlobal shareGlobal] joinRoomWithRoomId:model.id isRejoin:NO navagationController:self.navigationController];
|
||||
}
|
||||
|
||||
|
||||
-(UICollectionView *)collectionView{
|
||||
if (!_collectionView) {
|
||||
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
|
||||
layout.minimumLineSpacing = 15;
|
||||
layout.minimumInteritemSpacing = 15;
|
||||
layout.sectionInset = UIEdgeInsetsMake(0, 15, 0, 15);
|
||||
_collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 16, SCREEN_WIDTH, SCREEN_HEIGHT-(NavContentHeight+TabbarContentHeight)) collectionViewLayout:layout];
|
||||
_collectionView.delegate = self;
|
||||
_collectionView.dataSource = self;
|
||||
_collectionView.backgroundColor = [UIColor clearColor];
|
||||
[_collectionView registerNib:[UINib nibWithNibName:@"QXHomeRoomCell" bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:@"QXHomeRoomCell"];
|
||||
}
|
||||
return _collectionView;
|
||||
}
|
||||
/*
|
||||
#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
|
||||
18
QXLive/HomePage(声播)/Controlller/QXHomeSubViewController.h
Normal file
18
QXLive/HomePage(声播)/Controlller/QXHomeSubViewController.h
Normal file
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// QXHomeSubViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/7.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
#import "JXPagerView.h"
|
||||
#import "QXRoomListModel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXHomeSubViewController : QXBaseViewController<JXPagerViewListViewDelegate>
|
||||
@property (nonatomic, copy) void(^listScrollCallback)(UIScrollView *scrollView);
|
||||
@property (nonatomic, strong)QXMyRoomType *roomType;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
117
QXLive/HomePage(声播)/Controlller/QXHomeSubViewController.m
Normal file
117
QXLive/HomePage(声播)/Controlller/QXHomeSubViewController.m
Normal file
@@ -0,0 +1,117 @@
|
||||
//
|
||||
// QXHomeSubViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/7.
|
||||
//
|
||||
|
||||
#import "QXHomeSubViewController.h"
|
||||
#import "QXHomeRoomCell.h"
|
||||
#import "QXHomePageNetwork.h"
|
||||
|
||||
@interface QXHomeSubViewController ()<UICollectionViewDelegate,UICollectionViewDataSource>
|
||||
@property (nonatomic,strong)UICollectionView *collectionView;
|
||||
@property (nonatomic, copy) void(^scrollCallback)(UIScrollView *scrollView);
|
||||
@end
|
||||
|
||||
@implementation QXHomeSubViewController
|
||||
-(UIView *)listView{
|
||||
return self.view;
|
||||
}
|
||||
-(void)listWillAppear{
|
||||
[self getRoomList];
|
||||
}
|
||||
-(UIScrollView *)listScrollView{
|
||||
return self.collectionView;
|
||||
}
|
||||
- (void)listViewDidScrollCallback:(void (^)(UIScrollView *))callback {
|
||||
self.scrollCallback = callback;
|
||||
}
|
||||
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
|
||||
if (self.scrollCallback != nil) {
|
||||
self.scrollCallback(scrollView);
|
||||
}
|
||||
}
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
|
||||
}
|
||||
-(void)initSubViews{
|
||||
self.page = 1;
|
||||
[self.view addSubview:self.collectionView];
|
||||
// [self getRoomList];
|
||||
self.bgImageHidden = YES;
|
||||
}
|
||||
-(void)viewDidAppear:(BOOL)animated{
|
||||
[super viewDidAppear:animated];
|
||||
[self.collectionView reloadData];
|
||||
}
|
||||
-(void)setRoomType:(QXMyRoomType *)roomType{
|
||||
_roomType = roomType;
|
||||
[self getRoomList];
|
||||
}
|
||||
- (void)getRoomList {
|
||||
__weak typeof(self)weakSelf = self;
|
||||
[QXHomePageNetwork homeRoomListWithPage:self.page is_top:NO label_id:self.roomType.id successBlock:^(NSArray<QXRoomListModel *> * _Nonnull list, BOOL isAppStore) {
|
||||
if (self.page == 1) {
|
||||
[weakSelf.dataArray removeAllObjects];
|
||||
}
|
||||
[weakSelf.dataArray addObjectsFromArray:list];
|
||||
[self.collectionView reloadData];
|
||||
if (list.count == 0) {
|
||||
self.collectionView.mj_footer.state = MJRefreshStateNoMoreData;
|
||||
}else{
|
||||
[self.collectionView.mj_footer endRefreshing];
|
||||
}
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
[self.collectionView.mj_footer endRefreshing];
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout
|
||||
-(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView{
|
||||
return 1;
|
||||
}
|
||||
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
|
||||
return self.dataArray.count;
|
||||
}
|
||||
-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXHomeRoomCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXHomeRoomCell" forIndexPath:indexPath];
|
||||
cell.model = self.dataArray[indexPath.row];
|
||||
return cell;
|
||||
}
|
||||
|
||||
-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
return CGSizeMake((SCREEN_WIDTH-15*3-1)/2.0, (SCREEN_WIDTH-15*3-1)/2.0);
|
||||
}
|
||||
|
||||
|
||||
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXRoomListModel *model = self.dataArray[indexPath.row];
|
||||
[[QXGlobal shareGlobal] joinRoomWithRoomId:model.room_id isRejoin:NO navagationController:self.navigationController];
|
||||
}
|
||||
|
||||
|
||||
-(UICollectionView *)collectionView{
|
||||
if (!_collectionView) {
|
||||
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
|
||||
layout.minimumLineSpacing = 15;
|
||||
layout.minimumInteritemSpacing = 15;
|
||||
layout.sectionInset = UIEdgeInsetsMake(0, 15, 0, 15);
|
||||
_collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT-(NavContentHeight+TabbarContentHeight)) collectionViewLayout:layout];
|
||||
_collectionView.delegate = self;
|
||||
_collectionView.dataSource = self;
|
||||
_collectionView.backgroundColor = [UIColor clearColor];
|
||||
[_collectionView registerNib:[UINib nibWithNibName:@"QXHomeRoomCell" bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:@"QXHomeRoomCell"];
|
||||
MJWeakSelf
|
||||
_collectionView.mj_footer = [MJRefreshBackStateFooter footerWithRefreshingBlock:^{
|
||||
weakSelf.page++;
|
||||
[weakSelf getRoomList];
|
||||
}];
|
||||
}
|
||||
return _collectionView;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
16
QXLive/HomePage(声播)/Controlller/QXHomeViewController.h
Normal file
16
QXLive/HomePage(声播)/Controlller/QXHomeViewController.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QXHomeViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/4/24.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
#import "QXGiftScrollView.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXHomeViewController : QXBaseViewController
|
||||
-(void)giftScrollViewShowWithModel:(QXGiftScrollModel*)model;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
470
QXLive/HomePage(声播)/Controlller/QXHomeViewController.m
Normal file
470
QXLive/HomePage(声播)/Controlller/QXHomeViewController.m
Normal file
@@ -0,0 +1,470 @@
|
||||
//
|
||||
// QXHomeViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/4/24.
|
||||
//
|
||||
|
||||
#import "QXHomeViewController.h"
|
||||
#import "JXCategoryView.h"
|
||||
#import "GKCycleScrollView.h"
|
||||
#import "QXHomeTopCell.h"
|
||||
#import "QXHomeSubViewController.h"
|
||||
#import "QXSearchViewController.h"
|
||||
#import "QXRankHomeVC.h"
|
||||
#import "SDCycleScrollView.h"
|
||||
#import "JXPagerView.h"
|
||||
#import "QXHomePageNetwork.h"
|
||||
#import "QXMyRoomViewController.h"
|
||||
#import "QXUserHomePageViewController.h"
|
||||
#import "QXFirstRechargePopView.h"
|
||||
#import "QXRechargeView.h"
|
||||
#import "QXAppstoreHomeView.h"
|
||||
|
||||
@interface QXHomeViewController ()<JXPagerViewDelegate,JXCategoryViewDelegate,GKCycleScrollViewDataSource,GKCycleScrollViewDelegate,QXGiftScrollViewDelegate,SDCycleScrollViewDelegate>
|
||||
@property (nonatomic, strong) JXPagerView *pagingView;
|
||||
@property (nonatomic,strong)JXCategoryTitleView *categoryView;
|
||||
@property (nonatomic,strong)NSMutableArray <UIViewController*>*listVCArray;
|
||||
@property (nonatomic,strong)NSMutableArray *titles;
|
||||
@property (nonatomic,strong)NSArray *titleModelArray;
|
||||
@property (nonatomic,strong)GKCycleScrollView *cycleScrollView;
|
||||
@property (nonatomic,strong)JXCategoryIndicatorImageView *indicatorView;
|
||||
@property (nonatomic,strong)UIButton *rankRightBtn;
|
||||
@property (nonatomic,strong)UIButton *searchRightBtn;
|
||||
@property (nonatomic,strong)UIButton *roomBtn;
|
||||
@property (nonatomic,strong)QXGiftScrollView *giftScrollView;
|
||||
@property (nonatomic,strong)SDCycleScrollView *bannerScrollView;
|
||||
@property (nonatomic,assign)BOOL isShowGiftScrollView;
|
||||
@property (nonatomic,strong)NSMutableArray *bannerArry;
|
||||
|
||||
@property (nonatomic,strong)UIView *headerView;
|
||||
@property (nonatomic,strong)UIView *sectionView;
|
||||
|
||||
@property (nonatomic,strong)UIButton *firstRechargeBtn;
|
||||
@property (nonatomic,strong)UIButton *skyDownBtn;
|
||||
@property (nonatomic,strong)QXFirstRechargePopView *firstRechargeView;
|
||||
|
||||
@property (nonatomic,strong)QXAppstoreHomeView *appStoreView;
|
||||
@end
|
||||
|
||||
@implementation QXHomeViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(loginSuccess) name:noticeUserLogin object:nil];
|
||||
}
|
||||
-(void)viewWillAppear:(BOOL)animated{
|
||||
[super viewWillAppear:animated];
|
||||
[self.navigationController setNavigationBarHidden:YES animated:YES];
|
||||
}
|
||||
|
||||
- (void)initSubViews{
|
||||
UILabel *tLabel = [[UILabel alloc] init];
|
||||
tLabel.text = QXText(@"羽声");
|
||||
tLabel.font = [UIFont boldSystemFontOfSize:20];
|
||||
[self.view addSubview:tLabel];
|
||||
[tLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(16);
|
||||
make.top.mas_equalTo(kSafeAreaTop +10);
|
||||
}];
|
||||
[self.view addSubview:self.rankRightBtn];
|
||||
[self.view addSubview:self.searchRightBtn];
|
||||
[self.view addSubview:self.roomBtn];
|
||||
|
||||
[self.roomBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.height.mas_equalTo(30);
|
||||
make.centerY.equalTo(tLabel);
|
||||
make.right.equalTo(self.view).offset(-10);
|
||||
}];
|
||||
[self.searchRightBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.equalTo(self.roomBtn.mas_left).offset(-10);
|
||||
make.centerY.width.height.equalTo(self.roomBtn);
|
||||
}];
|
||||
[self.rankRightBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.equalTo(self.searchRightBtn.mas_left).offset(-10);
|
||||
make.centerY.equalTo(self.roomBtn);
|
||||
make.width.height.mas_equalTo(30);
|
||||
}];
|
||||
|
||||
self.listVCArray = [NSMutableArray array];
|
||||
[self requestSlideToolData];
|
||||
[self getTopRoomList];
|
||||
_pagingView = [[JXPagerView alloc] initWithDelegate:self];
|
||||
_pagingView.mainTableView.backgroundColor = [UIColor clearColor];
|
||||
self.pagingView.backgroundColor = [UIColor clearColor];
|
||||
[self.view addSubview:self.pagingView];
|
||||
|
||||
self.categoryView.listContainer = (id<JXCategoryViewListContainer>)self.pagingView.listContainerView;
|
||||
self.pagingView.listContainerView.listCellBackgroundColor = [UIColor clearColor];
|
||||
// [self performSelector:@selector(giftScrollViewShow) afterDelay:5];
|
||||
MJWeakSelf
|
||||
self.pagingView.mainTableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
|
||||
[weakSelf requestSlideToolData];
|
||||
[weakSelf getTopRoomList];
|
||||
[weakSelf getBanner];
|
||||
}];
|
||||
|
||||
self.firstRechargeBtn.hidden = YES;
|
||||
[self.view addSubview:self.firstRechargeBtn];
|
||||
[self.firstRechargeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(-(TabbarContentHeight+5));
|
||||
make.right.equalTo(self.view).offset(-17);
|
||||
make.width.height.mas_equalTo(ScaleWidth(57));
|
||||
}];
|
||||
[self getBanner];
|
||||
[self getFirstRechargePermission];
|
||||
self.appStoreView.hidden = YES;
|
||||
[self.view addSubview:self.appStoreView];
|
||||
}
|
||||
- (void)viewDidLayoutSubviews {
|
||||
[super viewDidLayoutSubviews];
|
||||
|
||||
self.pagingView.frame = CGRectMake(0, NavContentHeight, SCREEN_WIDTH, SCREEN_HEIGHT-NavContentHeight-TabbarContentHeight);
|
||||
}
|
||||
-(void)loginSuccess{
|
||||
[self requestSlideToolData];
|
||||
[self getTopRoomList];
|
||||
[self getBanner];
|
||||
}
|
||||
- (void)requestSlideToolData {
|
||||
__weak typeof(self) weakSelf = self;
|
||||
[QXHomePageNetwork homeRoomLabelListsuccessBlock:^(NSArray<QXMyRoomType *> * _Nonnull list) {
|
||||
[weakSelf.titles removeAllObjects];
|
||||
NSMutableArray *arr = [NSMutableArray array];
|
||||
[weakSelf.titles addObjectsFromArray:list];
|
||||
for (QXMyRoomType *md in list) {
|
||||
[arr addObject:md.label_name];
|
||||
}
|
||||
weakSelf.categoryView.titles = arr;
|
||||
[weakSelf.categoryView reloadData];
|
||||
[weakSelf.pagingView.mainTableView.mj_header endRefreshing];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
[weakSelf.pagingView.mainTableView.mj_header endRefreshing];
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)getFirstRechargePermission{
|
||||
MJWeakSelf
|
||||
[QXHomePageNetwork getFirstRechargePermissionSuccessBlock:^(BOOL isShow) {
|
||||
weakSelf.firstRechargeBtn.hidden = !isShow;
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
|
||||
-(void)firstAction{
|
||||
[self popFirstRechargeView];
|
||||
}
|
||||
-(void)popFirstRechargeView{
|
||||
MJWeakSelf
|
||||
// view.giftArray = @[@"",@"",@"",@"",@"",@""];
|
||||
self.firstRechargeView.closeActionBlock = ^{
|
||||
[[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{
|
||||
QXLOG(@"页面关闭");
|
||||
|
||||
}];
|
||||
};
|
||||
self.firstRechargeView.rechargeActionBlock = ^(NSString * _Nonnull money) {
|
||||
[[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{
|
||||
QXLOG(@"页面关闭");
|
||||
QXRechargeView *recharge = [[QXRechargeView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
|
||||
QXRechargeListModel *model = [[QXRechargeListModel alloc] init];
|
||||
model.money = money;
|
||||
recharge.selectedModel = model;
|
||||
recharge.isPop = YES;
|
||||
recharge.isOnlyDisplayPayType = YES;
|
||||
[recharge showInView:KEYWINDOW];
|
||||
}];
|
||||
};
|
||||
[self.firstRechargeView reloadData];
|
||||
[[QXGlobal shareGlobal] showView:self.firstRechargeView popType:(PopViewTypeTopToCenter) tapDismiss:NO finishBlock:^{
|
||||
|
||||
}];
|
||||
}
|
||||
#pragma mark - JXPagingViewDelegate
|
||||
|
||||
- (UIView *)tableHeaderViewInPagerView:(JXPagerView *)pagerView {
|
||||
return self.headerView;
|
||||
}
|
||||
- (NSUInteger)tableHeaderViewHeightInPagerView:(JXPagerView *)pagerView {
|
||||
return self.headerView.height;
|
||||
}
|
||||
|
||||
- (NSUInteger)heightForPinSectionHeaderInPagerView:(JXPagerView *)pagerView {
|
||||
return 48;
|
||||
}
|
||||
- (UIView *)viewForPinSectionHeaderInPagerView:(JXPagerView *)pagerView {
|
||||
return self.sectionView;
|
||||
}
|
||||
|
||||
- (NSInteger)numberOfListsInPagerView:(JXPagerView *)pagerView {
|
||||
return self.titles.count;
|
||||
}
|
||||
|
||||
- (id<JXPagerViewListViewDelegate>)pagerView:(JXPagerView *)pagerView initListAtIndex:(NSInteger)index {
|
||||
QXHomeSubViewController *vc = [[QXHomeSubViewController alloc] init];
|
||||
QXMyRoomType *model = self.titles[index];
|
||||
vc.roomType = model;
|
||||
return vc;
|
||||
}
|
||||
-(void)categoryView:(JXCategoryBaseView *)categoryView didClickSelectedItemAtIndex:(NSInteger)index{
|
||||
|
||||
}
|
||||
|
||||
-(void)giftScrollViewShowWithModel:(QXGiftScrollModel*)model{
|
||||
if (self.isShowGiftScrollView == NO) {
|
||||
// self.categoryView.frame = CGRectMake(15, self.giftScrollView.bottom, SCREEN_WIDTH-30, 44);
|
||||
// self.containerView.frame = CGRectMake(0, self.categoryView.bottom, SCREEN_WIDTH, SCREEN_HEIGHT-self.categoryView.bottom-TabbarHeight);
|
||||
self.bannerScrollView.top = self.giftScrollView.bottom+12;
|
||||
self.headerView.height += 12+self.giftScrollView.height;
|
||||
[self.headerView addSubview:self.giftScrollView];
|
||||
// [self.pagingView reloadData];
|
||||
[self.pagingView resizeTableHeaderViewHeightWithAnimatable:YES duration:0.1 curve:UIViewAnimationCurveLinear];
|
||||
}
|
||||
++self.page;
|
||||
self.giftScrollView.model = model;
|
||||
self.isShowGiftScrollView = YES;
|
||||
}
|
||||
-(void)didClickGiftScrollView:(QXGiftScrollView *)giftScrollView index:(NSInteger)index model:(QXGiftScrollModel *)model{
|
||||
[[QXGlobal shareGlobal] joinRoomWithRoomId:model.roomId isRejoin:NO navagationController:self.navigationController];
|
||||
}
|
||||
- (void)getTopRoomList {
|
||||
__weak typeof(self)weakSelf = self;
|
||||
[QXHomePageNetwork homeRoomListWithPage:0 is_top:YES label_id:@"" successBlock:^(NSArray<QXRoomListModel *> * _Nonnull list, BOOL isAppStore) {
|
||||
[weakSelf.dataArray removeAllObjects];
|
||||
[weakSelf.dataArray addObjectsFromArray:list];
|
||||
if (isAppStore) {
|
||||
self.appStoreView.hidden = NO;
|
||||
}else{
|
||||
self.appStoreView.hidden = YES;
|
||||
}
|
||||
// weakSelf.appStoreView.dataArray = list;
|
||||
[weakSelf.cycleScrollView reloadData];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
|
||||
}
|
||||
-(void)getBanner{
|
||||
MJWeakSelf
|
||||
[QXHomePageNetwork homeBannerSuccessBlock:^(NSArray<QXBanner *> * _Nonnull list) {
|
||||
NSMutableArray *arr = [NSMutableArray array];
|
||||
for (QXBanner *banner in list) {
|
||||
[arr addObject:banner.image];
|
||||
}
|
||||
[weakSelf.bannerArry removeAllObjects];
|
||||
[weakSelf.bannerArry addObjectsFromArray:list];
|
||||
weakSelf.appStoreView.bannerArray = list;
|
||||
weakSelf.bannerScrollView.imageURLStringsGroup = arr;
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
#pragma mark - GKCycleScrollViewDataSource,GKCycleScrollViewDelegate
|
||||
- (NSInteger)numberOfCellsInCycleScrollView:(GKCycleScrollView *)cycleScrollView {
|
||||
return self.dataArray.count;
|
||||
}
|
||||
- (GKCycleScrollViewCell *)cycleScrollView:(GKCycleScrollView *)cycleScrollView cellForViewAtIndex:(NSInteger)index {
|
||||
GKCycleScrollViewCell *cell = [cycleScrollView dequeueReusableCell];
|
||||
if (!cell) {
|
||||
cell = [QXHomeTopCell new];
|
||||
}
|
||||
QXHomeTopCell *topcell = (QXHomeTopCell*)cell;
|
||||
topcell.roomModel = [self.dataArray objectAtIndex:index];
|
||||
return cell;
|
||||
}
|
||||
|
||||
- (CGSize)sizeForCellInCycleScrollView:(GKCycleScrollView *)cycleScrollView {
|
||||
return CGSizeMake((SCREEN_WIDTH)/3, 113);
|
||||
}
|
||||
|
||||
- (void)cycleScrollView:(GKCycleScrollView *)cycleScrollView didSelectCellAtIndex:(NSInteger)index {
|
||||
QXRoomListModel *model = self.dataArray[index];
|
||||
[[QXGlobal shareGlobal] joinRoomWithRoomId:model.room_id isRejoin:NO navagationController:self.navigationController];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - SDCycleScrollViewDelegate
|
||||
-(void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didSelectItemAtIndex:(NSInteger)index{
|
||||
if (!QXGlobal.shareGlobal.isLogin) {
|
||||
[[QXGlobal shareGlobal] logOut];
|
||||
return;
|
||||
}
|
||||
QXBanner *banner = self.bannerArry[index];
|
||||
if ([banner.type isEqualToString:@"2"]) {
|
||||
QXBaseWebViewController *webVc = [[QXBaseWebViewController alloc] init];
|
||||
webVc.urlStr = banner.url;
|
||||
[self.navigationController pushViewController:webVc animated:YES];
|
||||
}else if ([banner.type isEqualToString:@"3"]){
|
||||
[[QXGlobal shareGlobal] joinRoomWithRoomId:banner.aid isRejoin:NO navagationController:self.navigationController];
|
||||
}else if ([banner.type isEqualToString:@"4"]){
|
||||
QXUserHomePageViewController *userHomePage = [[QXUserHomePageViewController alloc] init];
|
||||
userHomePage.user_id = banner.aid;
|
||||
[self.navigationController pushViewController:userHomePage animated:YES];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-(void)gotoRoom{
|
||||
if (!QXGlobal.shareGlobal.isLogin) {
|
||||
[[QXGlobal shareGlobal] logOut];
|
||||
return;
|
||||
}
|
||||
QXMyRoomViewController *vc = [[QXMyRoomViewController alloc] init];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
-(void)gotoSearchVC{
|
||||
if (!QXGlobal.shareGlobal.isLogin) {
|
||||
[[QXGlobal shareGlobal] logOut];
|
||||
return;
|
||||
}
|
||||
QXSearchViewController *vc = [[QXSearchViewController alloc] init];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
-(void)gotoRankVC{
|
||||
if (!QXGlobal.shareGlobal.isLogin) {
|
||||
[[QXGlobal shareGlobal] logOut];
|
||||
return;
|
||||
}
|
||||
QXRankHomeVC *vc = [[QXRankHomeVC alloc] init];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
-(UIButton *)roomBtn{
|
||||
if (!_roomBtn) {
|
||||
_roomBtn = [[UIButton alloc] init];
|
||||
[_roomBtn setImage:[UIImage imageNamed:@"home_room"] forState:UIControlStateNormal];
|
||||
[_roomBtn setImage:[UIImage imageNamed:@"home_room"] forState:UIControlStateHighlighted];
|
||||
[_roomBtn addTarget:self action:@selector(gotoRoom) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _roomBtn;
|
||||
}
|
||||
- (UIButton *)rankRightBtn {
|
||||
if (!_rankRightBtn) {
|
||||
_rankRightBtn = [[UIButton alloc] init];
|
||||
[_rankRightBtn setImage:[UIImage imageNamed:@"home_ranking"] forState:UIControlStateNormal];
|
||||
[_rankRightBtn setImage:[UIImage imageNamed:@"home_ranking"] forState:UIControlStateHighlighted];
|
||||
[_rankRightBtn addTarget:self action:@selector(gotoRankVC) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _rankRightBtn;
|
||||
}
|
||||
|
||||
- (UIButton *)searchRightBtn {
|
||||
if (!_searchRightBtn) {
|
||||
_searchRightBtn = [[UIButton alloc] init];
|
||||
[_searchRightBtn setImage:[UIImage imageNamed:@"home_search"] forState:UIControlStateNormal];
|
||||
[_searchRightBtn setImage:[UIImage imageNamed:@"home_search"] forState:UIControlStateHighlighted];
|
||||
[_searchRightBtn addTarget:self action:@selector(gotoSearchVC) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _searchRightBtn;
|
||||
}
|
||||
-(UIView *)sectionView{
|
||||
if (!_sectionView) {
|
||||
_sectionView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 44)];
|
||||
[_sectionView addSubview:self.categoryView];
|
||||
}
|
||||
return _sectionView;
|
||||
}
|
||||
-(JXCategoryTitleView *)categoryView{
|
||||
if (!_categoryView) {
|
||||
_categoryView = [[JXCategoryTitleView alloc] init];
|
||||
_categoryView.frame = CGRectMake(15, 0, SCREEN_WIDTH-30, 44);
|
||||
_categoryView.delegate = self;
|
||||
_categoryView.titleSelectedColor = [UIColor colorWithHexString:@"#333333"];
|
||||
_categoryView.titleColor = [UIColor colorWithHexString:@"#666666"];
|
||||
_categoryView.cellWidth = JXCategoryViewAutomaticDimension;
|
||||
_categoryView.contentEdgeInsetLeft = 3;
|
||||
_categoryView.cellSpacing = 16;
|
||||
_categoryView.titleLabelZoomEnabled = YES;
|
||||
_categoryView.titleFont = [UIFont boldSystemFontOfSize:13];
|
||||
_categoryView.titleSelectedFont = [UIFont boldSystemFontOfSize:18];
|
||||
_categoryView.averageCellSpacingEnabled = NO;
|
||||
JXCategoryIndicatorImageView *indicatorView = [[JXCategoryIndicatorImageView alloc] init];
|
||||
indicatorView.indicatorWidth = JXCategoryViewAutomaticDimension;
|
||||
indicatorView.indicatorImageView.image = [UIImage imageNamed:@"home_slider"];
|
||||
indicatorView.indicatorImageViewSize = CGSizeMake(29, 8);
|
||||
self.indicatorView = indicatorView;
|
||||
indicatorView.verticalMargin = 11;
|
||||
_categoryView.indicators = @[indicatorView];
|
||||
}
|
||||
return _categoryView;
|
||||
}
|
||||
-(UIView *)headerView{
|
||||
if (!_headerView) {
|
||||
_headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, self.cycleScrollView.height+self.bannerScrollView.height)];
|
||||
[_headerView addSubview:self.cycleScrollView];
|
||||
[_headerView addSubview:self.bannerScrollView];
|
||||
}
|
||||
return _headerView;
|
||||
}
|
||||
-(SDCycleScrollView *)bannerScrollView{
|
||||
if (!_bannerScrollView) {
|
||||
_bannerScrollView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(16, self.cycleScrollView.bottom, SCREEN_WIDTH-32, ScaleWidth(95)) delegate:self placeholderImage:nil];
|
||||
_bannerScrollView.backgroundColor = [UIColor clearColor];
|
||||
_bannerScrollView.bannerImageViewContentMode = UIViewContentModeScaleAspectFill;
|
||||
[_bannerScrollView addRoundedCornersWithRadius:8] ;
|
||||
_bannerScrollView.delegate = self;
|
||||
}
|
||||
return _bannerScrollView;
|
||||
}
|
||||
-(GKCycleScrollView *)cycleScrollView{
|
||||
if (!_cycleScrollView) {
|
||||
_cycleScrollView = [[GKCycleScrollView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, ScaleWidth(113))];
|
||||
_cycleScrollView.dataSource = self;
|
||||
_cycleScrollView.delegate = self;
|
||||
_cycleScrollView.minimumCellAlpha = 0.0;
|
||||
_cycleScrollView.leftRightMargin = 16.0f;
|
||||
_cycleScrollView.topBottomMargin = 10.0f;
|
||||
}
|
||||
return _cycleScrollView;
|
||||
}
|
||||
-(QXGiftScrollView *)giftScrollView{
|
||||
if (!_giftScrollView) {
|
||||
_giftScrollView = [[QXGiftScrollView alloc] initWithFrame:CGRectMake(16, self.cycleScrollView.bottom, SCREEN_WIDTH-32, 31)];
|
||||
_giftScrollView.delegate = self;
|
||||
}
|
||||
return _giftScrollView;
|
||||
}
|
||||
-(NSMutableArray *)titles{
|
||||
if (!_titles) {
|
||||
_titles = [NSMutableArray array];
|
||||
}
|
||||
return _titles;
|
||||
}
|
||||
-(NSMutableArray *)bannerArry{
|
||||
if (!_bannerArry) {
|
||||
_bannerArry = [NSMutableArray array];
|
||||
}
|
||||
return _bannerArry;
|
||||
}
|
||||
-(UIButton *)firstRechargeBtn{
|
||||
if (!_firstRechargeBtn) {
|
||||
_firstRechargeBtn = [[UIButton alloc] init];
|
||||
[_firstRechargeBtn setBackgroundImage:[UIImage imageNamed:@"first_recharge_icon"] forState:(UIControlStateNormal)];
|
||||
[_firstRechargeBtn addTarget:self action:@selector(firstAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
}
|
||||
return _firstRechargeBtn;
|
||||
}
|
||||
-(UIButton *)skyDownBtn{
|
||||
if (!_skyDownBtn) {
|
||||
_skyDownBtn = [[UIButton alloc] init];
|
||||
[_skyDownBtn setBackgroundImage:[UIImage imageNamed:@"sky_down_gift_icon"] forState:(UIControlStateNormal)];
|
||||
}
|
||||
return _skyDownBtn;
|
||||
}
|
||||
-(QXFirstRechargePopView *)firstRechargeView{
|
||||
if (!_firstRechargeView) {
|
||||
_firstRechargeView = [[QXFirstRechargePopView alloc] init];
|
||||
}
|
||||
return _firstRechargeView;
|
||||
}
|
||||
|
||||
|
||||
-(QXAppstoreHomeView *)appStoreView{
|
||||
if (!_appStoreView) {
|
||||
_appStoreView = [[QXAppstoreHomeView alloc] initWithFrame:CGRectMake(0, NavContentHeight, SCREEN_WIDTH, SCREEN_HEIGHT-NavContentHeight-TabbarContentHeight)];
|
||||
}
|
||||
return _appStoreView;
|
||||
}
|
||||
@end
|
||||
21
QXLive/HomePage(声播)/Controlller/QXRankHomeSubVC.h
Normal file
21
QXLive/HomePage(声播)/Controlller/QXRankHomeSubVC.h
Normal file
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// QXRankHomeSubVC.h
|
||||
// IsLandVoice
|
||||
//
|
||||
// Created by 启星 on 2025/3/3.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
#import "JXCategoryView.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXRankHomeSubVC : QXBaseViewController<JXCategoryListContentViewDelegate>
|
||||
@property (nonatomic,strong)NSString *roomId;
|
||||
/// 1日 2 周 3月
|
||||
@property (nonatomic,strong)NSString *dataType;
|
||||
/// 1 魅力 2 财富 3 房间 4 cp
|
||||
@property (nonatomic,assign)NSInteger rankType;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
251
QXLive/HomePage(声播)/Controlller/QXRankHomeSubVC.m
Normal file
251
QXLive/HomePage(声播)/Controlller/QXRankHomeSubVC.m
Normal file
@@ -0,0 +1,251 @@
|
||||
//
|
||||
// QXRankHomeSubVC.m
|
||||
// IsLandVoice
|
||||
//
|
||||
// Created by 启星 on 2025/3/3.
|
||||
//
|
||||
|
||||
#import "QXRankHomeSubVC.h"
|
||||
#import "QXRankTypeView.h"
|
||||
#import "QXRankListCell.h"
|
||||
#import "QXRankTopThreeView.h"
|
||||
//#import "SRRankListRequest.h"
|
||||
//#import "SRRankListAdapter.h"
|
||||
#import "QXMyRankView.h"
|
||||
#import "QXRankCPListCell.h"
|
||||
#import "QXRankCPTopThreeView.h"
|
||||
#import "QXHomePageNetwork.h"
|
||||
|
||||
@interface QXRankHomeSubVC ()<UITableViewDelegate,UITableViewDataSource>
|
||||
@property (nonatomic,strong)QXRankTypeView *rankTypeView;
|
||||
@property (nonatomic,strong)UITableView *tableView;
|
||||
@property (nonatomic, strong) QXRankTopThreeView *headerView;
|
||||
@property (nonatomic, strong) QXRankCPTopThreeView *cpHeaderView;
|
||||
@property (nonatomic, strong) QXMyRankView *myRankView;
|
||||
@property (nonatomic, strong) NSMutableArray *topDataArray;
|
||||
@end
|
||||
|
||||
@implementation QXRankHomeSubVC
|
||||
-(UIView *)listView{
|
||||
return self.view;
|
||||
}
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
[self initSubViews];
|
||||
}
|
||||
|
||||
-(void)initSubViews{
|
||||
self.bgImageHidden = YES;
|
||||
self.dataType = @"1";
|
||||
self.view.backgroundColor = [UIColor clearColor];
|
||||
[self.view addSubview:self.rankTypeView];
|
||||
[self.view addSubview:self.myRankView];
|
||||
if (self.rankType == 4) {
|
||||
self.tableView.tableHeaderView = self.cpHeaderView;
|
||||
self.myRankView.isCP = YES;
|
||||
}else{
|
||||
self.myRankView.isCP = NO;
|
||||
self.tableView.tableHeaderView = self.headerView;
|
||||
}
|
||||
[self.view addSubview:self.tableView];
|
||||
[self getRankData];
|
||||
}
|
||||
|
||||
|
||||
-(void)getRankData{
|
||||
MJWeakSelf
|
||||
if (self.rankType == 0) {//房间榜
|
||||
[QXHomePageNetwork rankOfRoomWithType:self.dataType successBlock:^(QXRankModel * _Nonnull model) {
|
||||
[weakSelf.headerView resetView];
|
||||
if (weakSelf.page == 1) {
|
||||
[weakSelf.dataArray removeAllObjects];
|
||||
[weakSelf.topDataArray removeAllObjects];
|
||||
for (int i = 0; i < model.lists.count; i++) {
|
||||
if (i < 3) {
|
||||
[weakSelf.topDataArray addObject:model.lists[i]];
|
||||
}else{
|
||||
[weakSelf.dataArray addObject:model.lists[i]];
|
||||
}
|
||||
}
|
||||
}
|
||||
weakSelf.headerView.roomList = weakSelf.topDataArray;
|
||||
weakSelf.myRankView.roomModel = model.my_ranking;
|
||||
weakSelf.tableView.tableHeaderView = weakSelf.headerView;
|
||||
[weakSelf.tableView.mj_header endRefreshing];
|
||||
[weakSelf.tableView reloadData];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
[weakSelf.tableView.mj_header endRefreshing];
|
||||
}];
|
||||
}else if (self.rankType == 1){//财富榜
|
||||
[QXHomePageNetwork rankOfCharmWithRankingType:@"1" type:self.dataType page:self.page successBlock:^(QXRankModel * _Nonnull model) {
|
||||
[weakSelf.headerView resetView];
|
||||
if (weakSelf.page == 1) {
|
||||
[weakSelf.dataArray removeAllObjects];
|
||||
[weakSelf.topDataArray removeAllObjects];
|
||||
for (int i = 0; i < model.lists.count; i++) {
|
||||
if (i < 3) {
|
||||
[weakSelf.topDataArray addObject:model.lists[i]];
|
||||
}else{
|
||||
[weakSelf.dataArray addObject:model.lists[i]];
|
||||
}
|
||||
}
|
||||
}
|
||||
weakSelf.headerView.list = weakSelf.topDataArray;
|
||||
weakSelf.myRankView.model = model.my_ranking;
|
||||
weakSelf.tableView.tableHeaderView = weakSelf.headerView;
|
||||
[weakSelf.tableView.mj_header endRefreshing];
|
||||
[weakSelf.tableView reloadData];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
[weakSelf.tableView.mj_header endRefreshing];
|
||||
}];
|
||||
}else if (self.rankType == 2){//魅力榜
|
||||
[QXHomePageNetwork rankOfCharmWithRankingType:@"2" type:self.dataType page:self.page successBlock:^(QXRankModel * _Nonnull model) {
|
||||
[weakSelf.headerView resetView];
|
||||
if (weakSelf.page == 1) {
|
||||
[weakSelf.dataArray removeAllObjects];
|
||||
[weakSelf.topDataArray removeAllObjects];
|
||||
for (int i = 0; i < model.lists.count; i++) {
|
||||
if (i < 3) {
|
||||
[weakSelf.topDataArray addObject:model.lists[i]];
|
||||
}else{
|
||||
[weakSelf.dataArray addObject:model.lists[i]];
|
||||
}
|
||||
}
|
||||
}
|
||||
weakSelf.headerView.list = weakSelf.topDataArray;
|
||||
weakSelf.myRankView.model = model.my_ranking;
|
||||
weakSelf.tableView.tableHeaderView = weakSelf.headerView;
|
||||
[weakSelf.tableView.mj_header endRefreshing];
|
||||
[weakSelf.tableView reloadData];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
[weakSelf.tableView.mj_header endRefreshing];
|
||||
}];
|
||||
}else if (self.rankType == 3){//公会榜
|
||||
[QXHomePageNetwork rankOfGuildWithType:self.dataType successBlock:^(QXRankModel * _Nonnull model) {
|
||||
[weakSelf.headerView resetView];
|
||||
if (weakSelf.page == 1) {
|
||||
[weakSelf.dataArray removeAllObjects];
|
||||
[weakSelf.topDataArray removeAllObjects];
|
||||
for (int i = 0; i < model.lists.count; i++) {
|
||||
if (i < 3) {
|
||||
[weakSelf.topDataArray addObject:model.lists[i]];
|
||||
}else{
|
||||
[weakSelf.dataArray addObject:model.lists[i]];
|
||||
}
|
||||
}
|
||||
}
|
||||
weakSelf.headerView.guildList = weakSelf.topDataArray;
|
||||
weakSelf.myRankView.guildModel = model.my_ranking;
|
||||
weakSelf.tableView.tableHeaderView = weakSelf.headerView;
|
||||
[weakSelf.tableView.mj_header endRefreshing];
|
||||
[weakSelf.tableView reloadData];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
[weakSelf.tableView.mj_header endRefreshing];
|
||||
}];
|
||||
|
||||
}else{//cp榜
|
||||
[QXHomePageNetwork rankOfRealLoveWithType:self.dataType successBlock:^(QXRankModel * _Nonnull model) {
|
||||
[weakSelf.cpHeaderView resetView];
|
||||
if (weakSelf.page == 1) {
|
||||
[weakSelf.dataArray removeAllObjects];
|
||||
[weakSelf.topDataArray removeAllObjects];
|
||||
for (int i = 0; i < model.lists.count; i++) {
|
||||
if (i < 3) {
|
||||
[weakSelf.topDataArray addObject:model.lists[i]];
|
||||
}else{
|
||||
[weakSelf.dataArray addObject:model.lists[i]];
|
||||
}
|
||||
}
|
||||
}
|
||||
weakSelf.cpHeaderView.list = weakSelf.topDataArray;
|
||||
weakSelf.myRankView.cpModel = model.my_ranking;
|
||||
weakSelf.tableView.tableHeaderView = weakSelf.cpHeaderView;
|
||||
[weakSelf.tableView.mj_header endRefreshing];
|
||||
[weakSelf.tableView reloadData];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
[weakSelf.tableView.mj_header endRefreshing];
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - <UITableViewDelegate,UITableViewDataSource>
|
||||
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
||||
return 1;
|
||||
}
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||
return self.dataArray.count;
|
||||
}
|
||||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
if (self.rankType == 4) {//CP
|
||||
QXRankCPListCell *cell = [QXRankCPListCell cellWithTableView:tableView];
|
||||
// cell.model = self.dataArray[indexPath.row];
|
||||
return cell;
|
||||
}else{
|
||||
QXRankListCell *cell = [QXRankListCell cellWithTableView:tableView];
|
||||
cell.rankType = self.rankType;
|
||||
cell.model = self.dataArray[indexPath.row];
|
||||
return cell;
|
||||
}
|
||||
}
|
||||
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
// if (self.rankType != 4) {//CP
|
||||
// QXHomeRoomListModel *model = self.dataArray[indexPath.row];
|
||||
// SRPersonalViewController *pvc = [[SRPersonalViewController alloc] initWithUserId:[model.user_id longLongValue]];
|
||||
// pvc.emchatUsername = model.emchat_username;
|
||||
// [self.navigationController pushViewController:pvc animated:YES];
|
||||
// }
|
||||
}
|
||||
-(QXRankTypeView *)rankTypeView{
|
||||
if (!_rankTypeView) {
|
||||
_rankTypeView = [[QXRankTypeView alloc] initWithFrame:CGRectMake(0, kSafeAreaTop+30, SCREEN_WIDTH, 30)];
|
||||
MJWeakSelf
|
||||
_rankTypeView.rankTypeBlock = ^(QXRankType type) {
|
||||
weakSelf.dataType = [NSString stringWithFormat:@"%ld",type];
|
||||
[weakSelf getRankData];
|
||||
};
|
||||
}
|
||||
return _rankTypeView;
|
||||
}
|
||||
-(QXRankTopThreeView *)headerView{
|
||||
if (!_headerView) {
|
||||
_headerView = [[QXRankTopThreeView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 230)];
|
||||
}
|
||||
return _headerView;
|
||||
}
|
||||
-(QXRankCPTopThreeView *)cpHeaderView{
|
||||
if (!_cpHeaderView) {
|
||||
_cpHeaderView = [[QXRankCPTopThreeView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 230)];
|
||||
}
|
||||
return _cpHeaderView;
|
||||
}
|
||||
-(QXMyRankView *)myRankView{
|
||||
if (!_myRankView) {
|
||||
_myRankView = [[QXMyRankView alloc] initWithFrame:CGRectMake(0, SCREEN_HEIGHT-TabbarContentHeight-60-44, SCREEN_WIDTH, 60)];
|
||||
}
|
||||
return _myRankView;
|
||||
}
|
||||
-(UITableView *)tableView{
|
||||
if (!_tableView) {
|
||||
_tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, self.rankTypeView.bottom+10, SCREEN_WIDTH, self.myRankView.top - self.rankTypeView.bottom-10) style:(UITableViewStyleGrouped)];
|
||||
_tableView.dataSource = self;
|
||||
_tableView.delegate = self;
|
||||
_tableView.backgroundColor = [UIColor clearColor];
|
||||
_tableView.tableFooterView = [UIView new];
|
||||
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
_tableView.rowHeight = 50;
|
||||
MJWeakSelf
|
||||
_tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
|
||||
[weakSelf getRankData];
|
||||
}];
|
||||
}
|
||||
return _tableView;
|
||||
}
|
||||
|
||||
-(NSMutableArray *)topDataArray{
|
||||
if (!_topDataArray) {
|
||||
_topDataArray = [NSMutableArray array] ;
|
||||
}
|
||||
return _topDataArray;
|
||||
}
|
||||
@end
|
||||
16
QXLive/HomePage(声播)/Controlller/QXRankHomeVC.h
Normal file
16
QXLive/HomePage(声播)/Controlller/QXRankHomeVC.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QXRankHomeVC.h
|
||||
// IsLandVoice
|
||||
//
|
||||
// Created by 启星 on 2025/3/3.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXRankHomeVC : QXBaseViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
80
QXLive/HomePage(声播)/Controlller/QXRankHomeVC.m
Normal file
80
QXLive/HomePage(声播)/Controlller/QXRankHomeVC.m
Normal file
@@ -0,0 +1,80 @@
|
||||
//
|
||||
// QXRankHomeVC.m
|
||||
// IsLandVoice
|
||||
//
|
||||
// Created by 启星 on 2025/3/3.
|
||||
//
|
||||
|
||||
#import "QXRankHomeVC.h"
|
||||
#import "JXCategoryView.h"
|
||||
#import "QXRankHomeSubVC.h"
|
||||
|
||||
@interface QXRankHomeVC ()<JXCategoryViewDelegate,JXCategoryListContainerViewDelegate>
|
||||
@property (nonatomic,strong)JXCategoryTitleView *categoryView;
|
||||
@property (nonatomic,strong)JXCategoryListContainerView *containerView;
|
||||
@property (nonatomic,strong)NSMutableArray <UIViewController*>*listVCArray;
|
||||
@property (nonatomic,strong)NSArray*titles;
|
||||
@end
|
||||
|
||||
@implementation QXRankHomeVC
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
|
||||
}
|
||||
-(void)viewWillAppear:(BOOL)animated{
|
||||
[super viewWillAppear:animated];
|
||||
[self.navigationController setNavigationBarHidden:NO animated:YES];
|
||||
}
|
||||
-(void)initSubViews{
|
||||
self.view.backgroundColor = [UIColor whiteColor];
|
||||
self.titles = @[@"房间榜", @"财富榜", @"魅力榜",@"公会榜",@"真爱榜"];
|
||||
self.listVCArray = [NSMutableArray array];
|
||||
self.categoryView = [[JXCategoryTitleView alloc] init];
|
||||
self.categoryView.frame = CGRectMake(0, 0, SCREEN_WIDTH-100, 44);
|
||||
self.categoryView.delegate = self;
|
||||
self.categoryView.titles = self.titles;
|
||||
self.categoryView.titleSelectedColor = [UIColor colorWithHexString:@"#333333"];
|
||||
self.categoryView.titleColor = [UIColor colorWithHexString:@"#999999"];
|
||||
JXCategoryIndicatorImageView *indicatorImageView = [[JXCategoryIndicatorImageView alloc] init];
|
||||
indicatorImageView.indicatorImageView.image = [UIImage imageNamed:@"home_slider"];
|
||||
indicatorImageView.indicatorWidth = (SCREEN_WIDTH-100)/5.0;
|
||||
indicatorImageView.indicatorHeight = 5;
|
||||
self.categoryView.indicators = @[indicatorImageView];
|
||||
self.categoryView.cellWidth = (SCREEN_WIDTH-100)/5.0;
|
||||
self.categoryView.contentEdgeInsetLeft = 0;
|
||||
self.categoryView.cellSpacing = 0;
|
||||
self.categoryView.titleLabelZoomScale = 1.1;
|
||||
self.categoryView.titleLabelZoomEnabled = YES;
|
||||
self.categoryView.titleFont = [UIFont systemFontOfSize:14];
|
||||
self.categoryView.averageCellSpacingEnabled = NO;
|
||||
|
||||
self.containerView = [[JXCategoryListContainerView alloc] initWithType:(JXCategoryListContainerType_ScrollView) delegate:self];
|
||||
self.containerView.frame = CGRectMake(0, self.categoryView.bottom, SCREEN_WIDTH, SCREEN_HEIGHT-self.categoryView.bottom);
|
||||
self.navigationItem.titleView = self.categoryView;
|
||||
[self.view addSubview:self.containerView];
|
||||
self.categoryView.listContainer = self.containerView;
|
||||
}
|
||||
-(NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView{
|
||||
return self.titles.count;
|
||||
}
|
||||
-(id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index{
|
||||
QXRankHomeSubVC *vc = [[QXRankHomeSubVC alloc] init];
|
||||
vc.rankType = index;
|
||||
return vc;
|
||||
}
|
||||
- (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index {
|
||||
self.navigationController.interactivePopGestureRecognizer.enabled = (index == 0);
|
||||
}
|
||||
/*
|
||||
#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
|
||||
16
QXLive/HomePage(声播)/Controlller/QXSearchViewController.h
Normal file
16
QXLive/HomePage(声播)/Controlller/QXSearchViewController.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QXSearchViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/8.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXSearchViewController : QXBaseViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
145
QXLive/HomePage(声播)/Controlller/QXSearchViewController.m
Normal file
145
QXLive/HomePage(声播)/Controlller/QXSearchViewController.m
Normal file
@@ -0,0 +1,145 @@
|
||||
//
|
||||
// QXSearchViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/8.
|
||||
//
|
||||
|
||||
#import "QXSearchViewController.h"
|
||||
#import "ZLCollectionViewVerticalLayout.h"
|
||||
#import "QXSearchTopView.h"
|
||||
#import "QXSearchHeaderView.h"
|
||||
#import "QXSearchCell.h"
|
||||
#import "QXFileManager.h"
|
||||
#import "QXMineNetwork.h"
|
||||
#import "QXSearchModel.h"
|
||||
#import "QXHomeSearchResultVC.h"
|
||||
|
||||
@interface QXSearchViewController ()<UIGestureRecognizerDelegate,UICollectionViewDelegate,UICollectionViewDataSource,ZLCollectionViewBaseFlowLayoutDelegate,QXSearchTopViewDelegate>
|
||||
@property(nonatomic,strong)UICollectionView* collectionView;
|
||||
@property(nonatomic,strong)QXSearchTopView *topView;
|
||||
|
||||
@property(nonatomic,strong)NSMutableArray *resultArray;
|
||||
@end
|
||||
|
||||
@implementation QXSearchViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
-(void)viewWillAppear:(BOOL)animated{
|
||||
[super viewWillAppear:animated];
|
||||
[self.navigationController setNavigationBarHidden:YES animated:YES];
|
||||
}
|
||||
- (void)initSubViews{
|
||||
|
||||
[self.view addSubview:self.topView];
|
||||
[self.view addSubview:self.collectionView];
|
||||
[self getHistoryData];
|
||||
}
|
||||
-(void)getHistoryData{
|
||||
self.dataArray = [NSMutableArray arrayWithArray:[QXFileManager getSearchHistory]];
|
||||
[self.collectionView reloadData];
|
||||
}
|
||||
#pragma mark - QXSearchTopViewDelegate
|
||||
-(void)didClickCancel{
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
-(void)didClickSearchWithKeywords:(NSString *)keywords{
|
||||
// 搜索
|
||||
[QXFileManager writeSearchHistoryWithContent:keywords];
|
||||
self.dataArray = [NSMutableArray arrayWithArray:[QXFileManager getSearchHistory]];
|
||||
[self.collectionView reloadData];
|
||||
[self searchActionWithKeywords:keywords];
|
||||
}
|
||||
|
||||
-(void)searchActionWithKeywords:(NSString *)keywords{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork searchApiWithType:2 search:keywords successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
[weakSelf.resultArray removeAllObjects];
|
||||
NSArray *arr = [NSArray yy_modelArrayWithClass:[QXSearchModel class] json:dict];
|
||||
if (arr.count == 0) {
|
||||
showToast(@"暂无搜索结果");
|
||||
return;
|
||||
}
|
||||
[weakSelf.resultArray addObjectsFromArray:arr];
|
||||
[weakSelf pushToResultVC];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)pushToResultVC{
|
||||
QXHomeSearchResultVC *vc = [[QXHomeSearchResultVC alloc] init];
|
||||
vc.resultArray = self.resultArray;
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - UICollectionViewDelegate,UICollectionViewDataSource
|
||||
-(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView{
|
||||
return 1;
|
||||
}
|
||||
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
|
||||
return self.dataArray.count;
|
||||
}
|
||||
-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXSearchCell *cell = [QXSearchCell cellWithCollectionView:collectionView forIndexPath:indexPath];
|
||||
cell.titleLabel.text = self.dataArray[indexPath.row];
|
||||
return cell;
|
||||
}
|
||||
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||
return CGSizeMake([self.dataArray[indexPath.row] boundingRectWithSize:CGSizeMake(1000000, 22) options:NSStringDrawingUsesLineFragmentOrigin|NSStringDrawingUsesFontLeading attributes:@{NSFontAttributeName: [UIFont boldSystemFontOfSize:12]} context:nil].size.width + 20, 22);
|
||||
}
|
||||
- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath {
|
||||
if ([kind isEqualToString : UICollectionElementKindSectionHeader]){
|
||||
QXSearchHeaderView* headerView = [QXSearchHeaderView headerViewWithCollectionView:collectionView forIndexPath:indexPath];
|
||||
headerView.title = QXText(@"历史记录");
|
||||
return headerView;
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section{
|
||||
return CGSizeMake(SCREEN_WIDTH, 24);
|
||||
}
|
||||
- (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout insetForSectionAtIndex:(NSInteger)section {
|
||||
return UIEdgeInsetsMake(12, 16, 12, 16);
|
||||
}
|
||||
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
NSString *keywords = self.dataArray[indexPath.row];
|
||||
[self searchActionWithKeywords:keywords];
|
||||
}
|
||||
-(UICollectionView *)collectionView{
|
||||
if (!_collectionView) {
|
||||
ZLCollectionViewVerticalLayout *flowLayout = [[ZLCollectionViewVerticalLayout alloc] init];
|
||||
flowLayout.delegate = self;
|
||||
flowLayout.canDrag = NO;
|
||||
flowLayout.isFloor = NO;
|
||||
flowLayout.header_suspension = NO;
|
||||
flowLayout.columnSortType = Sequence;
|
||||
_collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, self.topView.bottom+12, SCREEN_WIDTH, SCREEN_HEIGHT-self.topView.bottom-12) collectionViewLayout:flowLayout];
|
||||
_collectionView.delegate = self;
|
||||
_collectionView.dataSource = self;
|
||||
_collectionView.backgroundColor = [UIColor clearColor];
|
||||
[_collectionView registerClass:[QXSearchHeaderView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:[QXSearchHeaderView headerViewIdentifier]];
|
||||
[_collectionView registerClass:[QXSearchCell class] forCellWithReuseIdentifier:[QXSearchCell cellIdentifier]];
|
||||
_collectionView.keyboardDismissMode = UIScrollViewKeyboardDismissModeOnDrag;
|
||||
}
|
||||
return _collectionView;
|
||||
}
|
||||
-(QXSearchTopView *)topView{
|
||||
if (!_topView) {
|
||||
_topView = [[QXSearchTopView alloc] initWithFrame:CGRectMake(0, kSafeAreaTop, SCREEN_WIDTH, NavHeight)];
|
||||
_topView.delegate = self;
|
||||
}
|
||||
return _topView;
|
||||
}
|
||||
-(NSMutableArray *)resultArray{
|
||||
if (!_resultArray) {
|
||||
_resultArray = [NSMutableArray array];
|
||||
}
|
||||
return _resultArray;
|
||||
}
|
||||
|
||||
@end
|
||||
18
QXLive/HomePage(声播)/Controlller/房间/QXRoomViewController.h
Normal file
18
QXLive/HomePage(声播)/Controlller/房间/QXRoomViewController.h
Normal file
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// QXRoomViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/6/7.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXRoomViewController : QXBaseViewController
|
||||
@property (nonatomic,strong)NSString *roomId;
|
||||
/// 是否为最小化房间进来
|
||||
@property (nonatomic,assign)BOOL isReJoin;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
1732
QXLive/HomePage(声播)/Controlller/房间/QXRoomViewController.m
Normal file
1732
QXLive/HomePage(声播)/Controlller/房间/QXRoomViewController.m
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user