覆盖羽声
This commit is contained in:
@@ -6,11 +6,12 @@
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
#import "QXSearchModel.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXHomeSearchResultVC : QXBaseViewController
|
||||
@property (nonatomic,strong)NSArray *resultArray;
|
||||
@property (nonatomic,strong)QXSearchListModel *model;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -7,8 +7,11 @@
|
||||
|
||||
#import "QXHomeSearchResultVC.h"
|
||||
#import "QXHomeRoomCell.h"
|
||||
#import "QXSearchHeaderReusableView.h"
|
||||
#import "QXSearchUserCell.h"
|
||||
#import "QXUserHomePageViewController.h"
|
||||
|
||||
@interface QXHomeSearchResultVC ()<UICollectionViewDelegate,UICollectionViewDataSource>
|
||||
@interface QXHomeSearchResultVC ()<UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout>
|
||||
@property (nonatomic,strong)UICollectionView *collectionView;
|
||||
@end
|
||||
|
||||
@@ -30,33 +33,75 @@
|
||||
[self.view addSubview:self.collectionView];
|
||||
}
|
||||
|
||||
-(void)setResultArray:(NSArray *)resultArray{
|
||||
_resultArray = resultArray;
|
||||
|
||||
-(void)setModel:(QXSearchListModel *)model{
|
||||
_model = model;
|
||||
[self.collectionView reloadData];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout
|
||||
-(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView{
|
||||
return 1;
|
||||
return 2;
|
||||
}
|
||||
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
|
||||
return self.resultArray.count;
|
||||
if (section == 0) {
|
||||
return self.model.rooms.count;
|
||||
}else{
|
||||
return self.model.users.count;
|
||||
}
|
||||
}
|
||||
-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXHomeRoomCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXHomeRoomCell" forIndexPath:indexPath];
|
||||
cell.searchModel = self.resultArray[indexPath.row];
|
||||
return cell;
|
||||
if (indexPath.section == 0) {
|
||||
QXHomeRoomCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXHomeRoomCell" forIndexPath:indexPath];
|
||||
cell.model = self.model.rooms[indexPath.row];
|
||||
return cell;
|
||||
|
||||
}else{
|
||||
QXSearchUserCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXSearchUserCell" forIndexPath:indexPath];
|
||||
cell.model = self.model.users[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);
|
||||
if (indexPath.section == 0) {
|
||||
return CGSizeMake((SCREEN_WIDTH-15*3-1)/2.0, (SCREEN_WIDTH-15*3-1)/2.0);
|
||||
}else{
|
||||
return CGSizeMake(SCREEN_WIDTH, 92);
|
||||
}
|
||||
}
|
||||
|
||||
- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath{
|
||||
if ([kind isEqualToString:UICollectionElementKindSectionHeader]) {
|
||||
QXSearchHeaderReusableView *reusableView = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"QXSearchHeaderReusableView" forIndexPath:indexPath];
|
||||
if (indexPath.section == 0) {
|
||||
reusableView.title = @"相关房间";
|
||||
}else{
|
||||
reusableView.title = @"相关用户";
|
||||
}
|
||||
return reusableView;
|
||||
}else{
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section{
|
||||
return CGSizeMake(SCREEN_WIDTH, 48);
|
||||
}
|
||||
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout referenceSizeForFooterInSection:(NSInteger)section{
|
||||
return CGSizeZero;
|
||||
}
|
||||
|
||||
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXSearchModel *model = self.resultArray[indexPath.row];
|
||||
[[QXGlobal shareGlobal] joinRoomWithRoomId:model.id isRejoin:NO navagationController:self.navigationController];
|
||||
if (indexPath.section == 0) {
|
||||
QXRoomListModel *model = self.model.rooms[indexPath.row];
|
||||
[[QXGlobal shareGlobal] joinRoomWithRoomId:model.room_id isRejoin:NO navagationController:self.navigationController];
|
||||
}else{
|
||||
QXUserHomeModel *model = self.model.users[indexPath.row];
|
||||
QXUserHomePageViewController *vc = [[QXUserHomePageViewController alloc] init];
|
||||
vc.user_id = model.user_id;
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -66,11 +111,14 @@
|
||||
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 = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 16, SCREEN_WIDTH, SCREEN_HEIGHT-NavContentHeight) collectionViewLayout:layout];
|
||||
_collectionView.delegate = self;
|
||||
_collectionView.dataSource = self;
|
||||
_collectionView.bounces = YES;
|
||||
_collectionView.backgroundColor = [UIColor clearColor];
|
||||
[_collectionView registerNib:[UINib nibWithNibName:@"QXHomeRoomCell" bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:@"QXHomeRoomCell"];
|
||||
[_collectionView registerNib:[UINib nibWithNibName:@"QXSearchUserCell" bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:@"QXSearchUserCell"];
|
||||
[_collectionView registerClass:[QXSearchHeaderReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"QXSearchHeaderReusableView"];
|
||||
}
|
||||
return _collectionView;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
return self.view;
|
||||
}
|
||||
-(void)listWillAppear{
|
||||
self.page = 1;
|
||||
[self getRoomList];
|
||||
}
|
||||
-(UIScrollView *)listScrollView{
|
||||
@@ -37,6 +38,10 @@
|
||||
// Do any additional setup after loading the view.
|
||||
|
||||
}
|
||||
-(void)viewWillAppear:(BOOL)animated{
|
||||
[super viewWillAppear:animated];
|
||||
QXLOG(@"========首页子控制器即将展示========");
|
||||
}
|
||||
-(void)initSubViews{
|
||||
self.page = 1;
|
||||
[self.view addSubview:self.collectionView];
|
||||
@@ -47,17 +52,20 @@
|
||||
[super viewDidAppear:animated];
|
||||
[self.collectionView reloadData];
|
||||
}
|
||||
|
||||
-(void)setRoomType:(QXMyRoomType *)roomType{
|
||||
_roomType = roomType;
|
||||
[self getRoomList];
|
||||
}
|
||||
- (void)getRoomList {
|
||||
__weak typeof(self)weakSelf = self;
|
||||
// __weak typeof(self)weakSelf = self;
|
||||
@weakify(self)
|
||||
[QXHomePageNetwork homeRoomListWithPage:self.page is_top:NO label_id:self.roomType.id successBlock:^(NSArray<QXRoomListModel *> * _Nonnull list, BOOL isAppStore) {
|
||||
@strongify(self)
|
||||
if (self.page == 1) {
|
||||
[weakSelf.dataArray removeAllObjects];
|
||||
[self.dataArray removeAllObjects];
|
||||
}
|
||||
[weakSelf.dataArray addObjectsFromArray:list];
|
||||
[self.dataArray addObjectsFromArray:list];
|
||||
[self.collectionView reloadData];
|
||||
if (list.count == 0) {
|
||||
self.collectionView.mj_footer.state = MJRefreshStateNoMoreData;
|
||||
@@ -65,6 +73,7 @@
|
||||
[self.collectionView.mj_footer endRefreshing];
|
||||
}
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
@strongify(self)
|
||||
[self.collectionView.mj_footer endRefreshing];
|
||||
}];
|
||||
}
|
||||
@@ -81,6 +90,14 @@
|
||||
cell.model = self.dataArray[indexPath.row];
|
||||
return cell;
|
||||
}
|
||||
-(void)collectionView:(UICollectionView *)collectionView willDisplayCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXHomeRoomCell *rCell = (QXHomeRoomCell *)cell;
|
||||
[rCell startAnimating];
|
||||
}
|
||||
-(void)collectionView:(UICollectionView *)collectionView didEndDisplayingCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXHomeRoomCell *rCell = (QXHomeRoomCell *)cell;
|
||||
[rCell endAnimating];
|
||||
}
|
||||
|
||||
-(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);
|
||||
@@ -104,10 +121,12 @@
|
||||
_collectionView.dataSource = self;
|
||||
_collectionView.backgroundColor = [UIColor clearColor];
|
||||
[_collectionView registerNib:[UINib nibWithNibName:@"QXHomeRoomCell" bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:@"QXHomeRoomCell"];
|
||||
MJWeakSelf
|
||||
// MJWeakSelf
|
||||
@weakify(self)
|
||||
_collectionView.mj_footer = [MJRefreshBackStateFooter footerWithRefreshingBlock:^{
|
||||
weakSelf.page++;
|
||||
[weakSelf getRoomList];
|
||||
@strongify(self)
|
||||
self.page++;
|
||||
[self getRoomList];
|
||||
}];
|
||||
}
|
||||
return _collectionView;
|
||||
|
||||
@@ -10,7 +10,9 @@
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXHomeViewController : QXBaseViewController
|
||||
-(void)popFirstRechargeView;
|
||||
-(void)giftScrollViewShowWithModel:(QXGiftScrollModel*)model;
|
||||
-(void)giftScrollViewShowWithModelList:(NSArray<QXGiftScrollModel*>*)list;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -17,9 +17,14 @@
|
||||
#import "QXHomePageNetwork.h"
|
||||
#import "QXMyRoomViewController.h"
|
||||
#import "QXUserHomePageViewController.h"
|
||||
#import "QXFirstRechargePopView.h"
|
||||
#import "QXNewPeoplePopView.h"
|
||||
#import "QXRechargeView.h"
|
||||
#import "QXAppstoreHomeView.h"
|
||||
#import "QXConfig.h"
|
||||
#import "QXSkyPraizeView.h"
|
||||
#import "QXRechargePermissionModel.h"
|
||||
#import "QXNiceGiftPopView.h" // 天降好礼
|
||||
#import "QXFirstRechargeView.h" // 首充好礼
|
||||
|
||||
@interface QXHomeViewController ()<JXPagerViewDelegate,JXCategoryViewDelegate,GKCycleScrollViewDataSource,GKCycleScrollViewDelegate,QXGiftScrollViewDelegate,SDCycleScrollViewDelegate>
|
||||
@property (nonatomic, strong) JXPagerView *pagingView;
|
||||
@@ -40,11 +45,15 @@
|
||||
@property (nonatomic,strong)UIView *headerView;
|
||||
@property (nonatomic,strong)UIView *sectionView;
|
||||
|
||||
@property (nonatomic,strong)UIButton *firstRechargeBtn;
|
||||
//@property (nonatomic,strong)UIButton *firstRechargeBtn;
|
||||
@property (nonatomic,strong)UIButton *skyDownBtn;
|
||||
@property (nonatomic,strong)QXFirstRechargePopView *firstRechargeView;
|
||||
@property (nonatomic,strong)QXNewPeoplePopView *nPeopleRechargeView;
|
||||
|
||||
@property (nonatomic,strong)QXAppstoreHomeView *appStoreView;
|
||||
@property (nonatomic,strong)SDCycleScrollView *rechargePermissionView;
|
||||
@property (nonatomic,strong)NSMutableArray *rechargePermissionArray;
|
||||
|
||||
@property (nonatomic,strong)QXRechargePermissionModel *permissionModel;
|
||||
@end
|
||||
|
||||
@implementation QXHomeViewController
|
||||
@@ -53,6 +62,7 @@
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(loginSuccess) name:noticeUserLogin object:nil];
|
||||
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(rechargeSuccess) name:noticeAlipayResult object:nil];
|
||||
}
|
||||
-(void)viewWillAppear:(BOOL)animated{
|
||||
[super viewWillAppear:animated];
|
||||
@@ -60,32 +70,43 @@
|
||||
}
|
||||
|
||||
- (void)initSubViews{
|
||||
UILabel *tLabel = [[UILabel alloc] init];
|
||||
tLabel.text = QXText(@"羽声");
|
||||
tLabel.font = [UIFont boldSystemFontOfSize:20];
|
||||
[self.view addSubview:tLabel];
|
||||
[tLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
if ([QXConfig.backgroundImage hasPrefix:@"http"] || [QXConfig.backgroundImage hasPrefix:@"https"]) {
|
||||
[self updateBgImage:QXConfig.backgroundImage];
|
||||
}else{
|
||||
[self updateBgImage:@"app_home_bg"];
|
||||
}
|
||||
UIImageView *logoImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mi_di"]];
|
||||
[self.view addSubview:logoImageView];
|
||||
[logoImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(16);
|
||||
make.top.mas_equalTo(kSafeAreaTop +10);
|
||||
make.top.mas_equalTo(kSafeAreaTop +8);
|
||||
make.width.mas_equalTo(66);
|
||||
make.height.mas_equalTo(32);
|
||||
}];
|
||||
|
||||
[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.width.mas_equalTo(54);
|
||||
make.height.mas_equalTo(26);
|
||||
make.centerY.equalTo(logoImageView);
|
||||
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.right.equalTo(self.roomBtn.mas_left).offset(-10);
|
||||
make.centerY.equalTo(self.roomBtn);
|
||||
make.width.height.mas_equalTo(32);
|
||||
}];
|
||||
|
||||
[self.searchRightBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.equalTo(self.rankRightBtn.mas_left).offset(-10);
|
||||
make.centerY.equalTo(self.roomBtn);
|
||||
make.width.height.mas_equalTo(30);
|
||||
}];
|
||||
|
||||
|
||||
self.listVCArray = [NSMutableArray array];
|
||||
[self requestSlideToolData];
|
||||
@@ -98,24 +119,32 @@
|
||||
self.categoryView.listContainer = (id<JXCategoryViewListContainer>)self.pagingView.listContainerView;
|
||||
self.pagingView.listContainerView.listCellBackgroundColor = [UIColor clearColor];
|
||||
// [self performSelector:@selector(giftScrollViewShow) afterDelay:5];
|
||||
MJWeakSelf
|
||||
// MJWeakSelf
|
||||
@weakify(self)
|
||||
self.pagingView.mainTableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
|
||||
[weakSelf requestSlideToolData];
|
||||
[weakSelf getTopRoomList];
|
||||
[weakSelf getBanner];
|
||||
@strongify(self)
|
||||
[self requestSlideToolData];
|
||||
[self getTopRoomList];
|
||||
[self 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.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 getRechargePermission];
|
||||
self.appStoreView.hidden = YES;
|
||||
[self.view addSubview:self.appStoreView];
|
||||
|
||||
self.rechargePermissionView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(SCREEN_WIDTH-80-17, SCREEN_HEIGHT-(TabbarContentHeight+90+80), 80, 80) delegate:self placeholderImage:nil];
|
||||
self.rechargePermissionView.pageControlBottomOffset = -15;
|
||||
self.rechargePermissionView.backgroundColor = [UIColor clearColor];
|
||||
self.rechargePermissionView.hidden = YES;
|
||||
[self.view addSubview:self.rechargePermissionView];
|
||||
}
|
||||
- (void)viewDidLayoutSubviews {
|
||||
[super viewDidLayoutSubviews];
|
||||
@@ -127,46 +156,91 @@
|
||||
[self getTopRoomList];
|
||||
[self getBanner];
|
||||
}
|
||||
-(void)rechargeSuccess{
|
||||
[self getRechargePermission];
|
||||
}
|
||||
- (void)requestSlideToolData {
|
||||
__weak typeof(self) weakSelf = self;
|
||||
@weakify(self)
|
||||
[QXHomePageNetwork homeRoomLabelListsuccessBlock:^(NSArray<QXMyRoomType *> * _Nonnull list) {
|
||||
[weakSelf.titles removeAllObjects];
|
||||
@strongify(self)
|
||||
[self.titles removeAllObjects];
|
||||
NSMutableArray *arr = [NSMutableArray array];
|
||||
[weakSelf.titles addObjectsFromArray:list];
|
||||
[self.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];
|
||||
self.categoryView.titles = arr;
|
||||
[self.categoryView reloadData];
|
||||
[self.pagingView.mainTableView.mj_header endRefreshing];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
[weakSelf.pagingView.mainTableView.mj_header endRefreshing];
|
||||
[self.pagingView.mainTableView.mj_header endRefreshing];
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)getFirstRechargePermission{
|
||||
MJWeakSelf
|
||||
[QXHomePageNetwork getFirstRechargePermissionSuccessBlock:^(BOOL isShow) {
|
||||
weakSelf.firstRechargeBtn.hidden = !isShow;
|
||||
//-(void)getFirstRechargePermission{
|
||||
// @weakify(self)
|
||||
// [QXHomePageNetwork getFirstRechargePermissionSuccessBlock:^(BOOL isShow) {
|
||||
// @strongify(self)
|
||||
// self.firstRechargeBtn.hidden = !isShow;
|
||||
// } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
//
|
||||
// }];
|
||||
//}
|
||||
-(void)getRechargePermission{
|
||||
// sky_drop_gift_icon ,new_people_recharge_icon ,first_recharge_icon
|
||||
@weakify(self)
|
||||
[QXHomePageNetwork getRechargePermissionSuccessBlock:^(QXRechargePermissionModel * _Nonnull model) {
|
||||
@strongify(self)
|
||||
self.permissionModel = model;
|
||||
[self.rechargePermissionArray removeAllObjects];
|
||||
NSMutableArray *imgs = [NSMutableArray array];
|
||||
if (model.day_drop_permission.intValue == 1) {
|
||||
[imgs addObject:@"sky_drop_gift_icon"];
|
||||
QXRechargeTypeModel *md = [[QXRechargeTypeModel alloc] init];
|
||||
md.icon = @"sky_drop_gift_icon";
|
||||
md.type = 2;
|
||||
[self.rechargePermissionArray addObject:md];
|
||||
}
|
||||
if (model.first_charge_permission.intValue == 1) {
|
||||
[imgs addObject:@"first_recharge_icon"];
|
||||
QXRechargeTypeModel *md = [[QXRechargeTypeModel alloc] init];
|
||||
md.icon = @"first_recharge_icon";
|
||||
md.type = 3;
|
||||
[self.rechargePermissionArray addObject:md];
|
||||
}
|
||||
if (model.n_people_permission.intValue == 1) {
|
||||
[imgs addObject:@"new_people_recharge_icon"];
|
||||
QXRechargeTypeModel *md = [[QXRechargeTypeModel alloc] init];
|
||||
md.icon = @"new_people_recharge_icon";
|
||||
md.type = 1;
|
||||
[self.rechargePermissionArray addObject:md];
|
||||
}
|
||||
if (imgs.count==0) {
|
||||
return;
|
||||
}
|
||||
self.rechargePermissionView.hidden = NO;
|
||||
self.rechargePermissionView.imageURLStringsGroup = imgs;
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
|
||||
-(void)firstAction{
|
||||
[self popFirstRechargeView];
|
||||
}
|
||||
-(void)popFirstRechargeView{
|
||||
MJWeakSelf
|
||||
//-(void)firstAction{
|
||||
// [self popnPeopleRechargeView];
|
||||
//// QXSkyPraizeView *v = [[QXSkyPraizeView alloc] init];
|
||||
//// [v showInView:self.view];
|
||||
//}
|
||||
-(void)popnPeopleRechargeView{
|
||||
// MJWeakSelf
|
||||
// view.giftArray = @[@"",@"",@"",@"",@"",@""];
|
||||
self.firstRechargeView.closeActionBlock = ^{
|
||||
self.nPeopleRechargeView.closeActionBlock = ^{
|
||||
[[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{
|
||||
QXLOG(@"页面关闭");
|
||||
|
||||
}];
|
||||
};
|
||||
self.firstRechargeView.rechargeActionBlock = ^(NSString * _Nonnull money) {
|
||||
self.nPeopleRechargeView.rechargeActionBlock = ^(NSString * _Nonnull money, NSString * _Nonnull gift_bag_id) {
|
||||
[[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{
|
||||
QXLOG(@"页面关闭");
|
||||
QXRechargeView *recharge = [[QXRechargeView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
|
||||
@@ -174,15 +248,87 @@
|
||||
model.money = money;
|
||||
recharge.selectedModel = model;
|
||||
recharge.isPop = YES;
|
||||
recharge.gift_bag_id = gift_bag_id;
|
||||
recharge.isOnlyDisplayPayType = YES;
|
||||
[recharge showInView:KEYWINDOW];
|
||||
}];
|
||||
};
|
||||
[self.firstRechargeView reloadData];
|
||||
[[QXGlobal shareGlobal] showView:self.firstRechargeView popType:(PopViewTypeTopToCenter) tapDismiss:NO finishBlock:^{
|
||||
[self.nPeopleRechargeView reloadData];
|
||||
[[QXGlobal shareGlobal] showView:self.nPeopleRechargeView popType:(PopViewTypeTopToCenter) tapDismiss:NO finishBlock:^{
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)popNiceGiftView{
|
||||
MJWeakSelf
|
||||
QXNiceGiftPopView *view = [[QXNiceGiftPopView alloc] init];
|
||||
view.closeActionBlock = ^{
|
||||
[[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{
|
||||
QXLOG(@"页面关闭");
|
||||
|
||||
}];
|
||||
};
|
||||
view.rechargeActionBlock = ^(NSString * _Nonnull money, NSString * _Nonnull gift_bag_id) {
|
||||
[[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.gift_bag_id = gift_bag_id;
|
||||
recharge.isOnlyDisplayPayType = YES;
|
||||
[recharge showInView:KEYWINDOW];
|
||||
}];
|
||||
};
|
||||
|
||||
view.refreshBlcock = ^{
|
||||
[weakSelf getRechargePermission];
|
||||
[[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{
|
||||
QXLOG(@"页面关闭");
|
||||
}];
|
||||
};
|
||||
[[QXGlobal shareGlobal] showView:view popType:(PopViewTypeTopToCenter) tapDismiss:NO finishBlock:^{
|
||||
|
||||
}];
|
||||
}
|
||||
-(void)popFirstRechargeView{
|
||||
if (self.permissionModel.first_charge_permission.intValue != 1) {
|
||||
return;
|
||||
}
|
||||
MJWeakSelf
|
||||
QXFirstRechargeView *view = [[QXFirstRechargeView alloc] init];
|
||||
view.closeActionBlock = ^{
|
||||
[[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{
|
||||
QXLOG(@"页面关闭");
|
||||
|
||||
}];
|
||||
};
|
||||
view.rechargeActionBlock = ^(NSString * _Nonnull money, NSString * _Nonnull gift_bag_id) {
|
||||
[[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.gift_bag_id = gift_bag_id;
|
||||
recharge.isOnlyDisplayPayType = YES;
|
||||
[recharge showInView:KEYWINDOW];
|
||||
}];
|
||||
};
|
||||
|
||||
view.refreshBlcock = ^{
|
||||
[weakSelf getRechargePermission];
|
||||
[[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{
|
||||
QXLOG(@"页面关闭");
|
||||
}];
|
||||
};
|
||||
[[QXGlobal shareGlobal] showView:view popType:(PopViewTypeTopToCenter) tapDismiss:NO finishBlock:^{
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - JXPagingViewDelegate
|
||||
|
||||
- (UIView *)tableHeaderViewInPagerView:(JXPagerView *)pagerView {
|
||||
@@ -227,37 +373,50 @@
|
||||
self.giftScrollView.model = model;
|
||||
self.isShowGiftScrollView = YES;
|
||||
}
|
||||
-(void)giftScrollViewShowWithModelList:(NSArray<QXGiftScrollModel*>*)list{
|
||||
if (self.isShowGiftScrollView == NO) {
|
||||
self.bannerScrollView.top = self.giftScrollView.bottom+12;
|
||||
self.headerView.height += 12+self.giftScrollView.height;
|
||||
[self.headerView addSubview:self.giftScrollView];
|
||||
[self.pagingView resizeTableHeaderViewHeightWithAnimatable:YES duration:0.1 curve:UIViewAnimationCurveLinear];
|
||||
}
|
||||
++self.page;
|
||||
self.giftScrollView.list = list;
|
||||
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;
|
||||
@weakify(self)
|
||||
[QXHomePageNetwork homeRoomListWithPage:0 is_top:YES label_id:@"" successBlock:^(NSArray<QXRoomListModel *> * _Nonnull list, BOOL isAppStore) {
|
||||
[weakSelf.dataArray removeAllObjects];
|
||||
[weakSelf.dataArray addObjectsFromArray:list];
|
||||
@strongify(self)
|
||||
[self.dataArray removeAllObjects];
|
||||
[self.dataArray addObjectsFromArray:list];
|
||||
if (isAppStore) {
|
||||
self.appStoreView.hidden = NO;
|
||||
}else{
|
||||
self.appStoreView.hidden = YES;
|
||||
}
|
||||
// weakSelf.appStoreView.dataArray = list;
|
||||
[weakSelf.cycleScrollView reloadData];
|
||||
[self.cycleScrollView reloadData];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
|
||||
}
|
||||
-(void)getBanner{
|
||||
MJWeakSelf
|
||||
@weakify(self)
|
||||
[QXHomePageNetwork homeBannerSuccessBlock:^(NSArray<QXBanner *> * _Nonnull list) {
|
||||
@strongify(self)
|
||||
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;
|
||||
[self.bannerArry removeAllObjects];
|
||||
[self.bannerArry addObjectsFromArray:list];
|
||||
self.appStoreView.bannerArray = list;
|
||||
self.bannerScrollView.imageURLStringsGroup = arr;
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
@@ -277,7 +436,7 @@
|
||||
}
|
||||
|
||||
- (CGSize)sizeForCellInCycleScrollView:(GKCycleScrollView *)cycleScrollView {
|
||||
return CGSizeMake((SCREEN_WIDTH)/3, 113);
|
||||
return CGSizeMake(180, 155);
|
||||
}
|
||||
|
||||
- (void)cycleScrollView:(GKCycleScrollView *)cycleScrollView didSelectCellAtIndex:(NSInteger)index {
|
||||
@@ -292,6 +451,23 @@
|
||||
[[QXGlobal shareGlobal] logOut];
|
||||
return;
|
||||
}
|
||||
if (cycleScrollView == self.rechargePermissionView) {
|
||||
QXRechargeTypeModel *md = self.rechargePermissionArray[index];
|
||||
if (md.type == 1) {
|
||||
[self popnPeopleRechargeView];
|
||||
return;
|
||||
}
|
||||
if (md.type == 2) {
|
||||
[self popNiceGiftView];
|
||||
return;
|
||||
}
|
||||
if (md.type == 3) {
|
||||
[self popFirstRechargeView];
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
QXBanner *banner = self.bannerArry[index];
|
||||
if ([banner.type isEqualToString:@"2"]) {
|
||||
QXBaseWebViewController *webVc = [[QXBaseWebViewController alloc] init];
|
||||
@@ -371,28 +547,28 @@
|
||||
_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.titleSelectedColor = [UIColor colorWithHexString:@"#FFFFFF"];
|
||||
_categoryView.titleColor = RGB16A(0xF1ECFF, 0.45);
|
||||
_categoryView.cellWidth = JXCategoryViewAutomaticDimension;
|
||||
_categoryView.contentEdgeInsetLeft = 3;
|
||||
_categoryView.cellSpacing = 16;
|
||||
_categoryView.titleLabelZoomEnabled = YES;
|
||||
_categoryView.titleFont = [UIFont boldSystemFontOfSize:13];
|
||||
_categoryView.titleSelectedFont = [UIFont boldSystemFontOfSize:18];
|
||||
_categoryView.titleFont = [UIFont boldSystemFontOfSize:16];
|
||||
_categoryView.titleSelectedFont = [UIFont boldSystemFontOfSize:20];
|
||||
_categoryView.averageCellSpacingEnabled = NO;
|
||||
JXCategoryIndicatorImageView *indicatorView = [[JXCategoryIndicatorImageView alloc] init];
|
||||
indicatorView.indicatorWidth = JXCategoryViewAutomaticDimension;
|
||||
indicatorView.indicatorImageView.image = [UIImage imageNamed:@"home_slider"];
|
||||
indicatorView.indicatorImageViewSize = CGSizeMake(29, 8);
|
||||
indicatorView.indicatorImageViewSize = CGSizeMake(50, 28);
|
||||
self.indicatorView = indicatorView;
|
||||
indicatorView.verticalMargin = 11;
|
||||
indicatorView.verticalMargin = 5;
|
||||
_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 = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, self.cycleScrollView.height+self.bannerScrollView.height+10)];
|
||||
[_headerView addSubview:self.cycleScrollView];
|
||||
[_headerView addSubview:self.bannerScrollView];
|
||||
}
|
||||
@@ -400,7 +576,7 @@
|
||||
}
|
||||
-(SDCycleScrollView *)bannerScrollView{
|
||||
if (!_bannerScrollView) {
|
||||
_bannerScrollView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(16, self.cycleScrollView.bottom, SCREEN_WIDTH-32, ScaleWidth(95)) delegate:self placeholderImage:nil];
|
||||
_bannerScrollView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(16, self.cycleScrollView.bottom+10, SCREEN_WIDTH-32, ScaleWidth(95)) delegate:self placeholderImage:nil];
|
||||
_bannerScrollView.backgroundColor = [UIColor clearColor];
|
||||
_bannerScrollView.bannerImageViewContentMode = UIViewContentModeScaleAspectFill;
|
||||
[_bannerScrollView addRoundedCornersWithRadius:8] ;
|
||||
@@ -410,18 +586,20 @@
|
||||
}
|
||||
-(GKCycleScrollView *)cycleScrollView{
|
||||
if (!_cycleScrollView) {
|
||||
_cycleScrollView = [[GKCycleScrollView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, ScaleWidth(113))];
|
||||
_cycleScrollView = [[GKCycleScrollView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 155)];
|
||||
_cycleScrollView.dataSource = self;
|
||||
_cycleScrollView.delegate = self;
|
||||
_cycleScrollView.minimumCellAlpha = 0.0;
|
||||
_cycleScrollView.leftRightMargin = 16.0f;
|
||||
_cycleScrollView.topBottomMargin = 10.0f;
|
||||
_cycleScrollView.topBottomMargin = 15.0f;
|
||||
_cycleScrollView.isInfiniteLoop = YES;
|
||||
_cycleScrollView.isAutoScroll = YES;
|
||||
}
|
||||
return _cycleScrollView;
|
||||
}
|
||||
-(QXGiftScrollView *)giftScrollView{
|
||||
if (!_giftScrollView) {
|
||||
_giftScrollView = [[QXGiftScrollView alloc] initWithFrame:CGRectMake(16, self.cycleScrollView.bottom, SCREEN_WIDTH-32, 31)];
|
||||
_giftScrollView = [[QXGiftScrollView alloc] initWithFrame:CGRectMake(16, self.cycleScrollView.bottom, SCREEN_WIDTH-32, 36)];
|
||||
_giftScrollView.delegate = self;
|
||||
}
|
||||
return _giftScrollView;
|
||||
@@ -438,28 +616,33 @@
|
||||
}
|
||||
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)];
|
||||
//-(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;
|
||||
//}
|
||||
-(QXNewPeoplePopView *)nPeopleRechargeView{
|
||||
if (!_nPeopleRechargeView) {
|
||||
_nPeopleRechargeView = [[QXNewPeoplePopView alloc] init];
|
||||
}
|
||||
return _firstRechargeBtn;
|
||||
return _nPeopleRechargeView;
|
||||
}
|
||||
-(UIButton *)skyDownBtn{
|
||||
if (!_skyDownBtn) {
|
||||
_skyDownBtn = [[UIButton alloc] init];
|
||||
[_skyDownBtn setBackgroundImage:[UIImage imageNamed:@"sky_down_gift_icon"] forState:(UIControlStateNormal)];
|
||||
-(NSMutableArray *)rechargePermissionArray{
|
||||
if (!_rechargePermissionArray) {
|
||||
_rechargePermissionArray = [NSMutableArray array];
|
||||
}
|
||||
return _skyDownBtn;
|
||||
return _rechargePermissionArray;
|
||||
}
|
||||
-(QXFirstRechargePopView *)firstRechargeView{
|
||||
if (!_firstRechargeView) {
|
||||
_firstRechargeView = [[QXFirstRechargePopView alloc] init];
|
||||
}
|
||||
return _firstRechargeView;
|
||||
}
|
||||
|
||||
|
||||
-(QXAppstoreHomeView *)appStoreView{
|
||||
if (!_appStoreView) {
|
||||
@@ -467,4 +650,7 @@
|
||||
}
|
||||
return _appStoreView;
|
||||
}
|
||||
-(void)dealloc{
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
}
|
||||
@end
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#import "QXRankCPListCell.h"
|
||||
#import "QXRankCPTopThreeView.h"
|
||||
#import "QXHomePageNetwork.h"
|
||||
#import "QXUserHomePageViewController.h"
|
||||
|
||||
@interface QXRankHomeSubVC ()<UITableViewDelegate,UITableViewDataSource>
|
||||
@property (nonatomic,strong)QXRankTypeView *rankTypeView;
|
||||
@@ -189,6 +190,19 @@
|
||||
}
|
||||
}
|
||||
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXMyRankModel *model = self.dataArray[indexPath.row];
|
||||
// if (self.rankType == 0) {
|
||||
// if ([model.room_id isExist]) {
|
||||
// [[QXGlobal shareGlobal] joinRoomWithRoomId:model.room_id isRejoin:NO navagationController:self.navigationController];
|
||||
// }
|
||||
// return;
|
||||
// }
|
||||
if (self.rankType == 1 || self.rankType == 2) {
|
||||
QXUserHomePageViewController *vc = [[QXUserHomePageViewController alloc] init];
|
||||
vc.user_id = model.user_id;
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
return;
|
||||
}
|
||||
// if (self.rankType != 4) {//CP
|
||||
// QXHomeRoomListModel *model = self.dataArray[indexPath.row];
|
||||
// SRPersonalViewController *pvc = [[SRPersonalViewController alloc] initWithUserId:[model.user_id longLongValue]];
|
||||
|
||||
@@ -29,7 +29,8 @@
|
||||
}
|
||||
-(void)initSubViews{
|
||||
self.view.backgroundColor = [UIColor whiteColor];
|
||||
self.titles = @[@"房间榜", @"财富榜", @"魅力榜",@"公会榜",@"真爱榜"];
|
||||
// self.titles = @[@"房间榜", @"财富榜", @"魅力榜",@"公会榜",@"真爱榜"];
|
||||
self.titles = @[@"房间榜", @"财富榜", @"魅力榜",@"真爱榜"];
|
||||
self.listVCArray = [NSMutableArray array];
|
||||
self.categoryView = [[JXCategoryTitleView alloc] init];
|
||||
self.categoryView.frame = CGRectMake(0, 0, SCREEN_WIDTH-100, 44);
|
||||
@@ -39,10 +40,10 @@
|
||||
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.indicatorWidth = (SCREEN_WIDTH-100)/self.titles.count;
|
||||
indicatorImageView.indicatorHeight = 5;
|
||||
self.categoryView.indicators = @[indicatorImageView];
|
||||
self.categoryView.cellWidth = (SCREEN_WIDTH-100)/5.0;
|
||||
self.categoryView.cellWidth = (SCREEN_WIDTH-100)/self.titles.count;
|
||||
self.categoryView.contentEdgeInsetLeft = 0;
|
||||
self.categoryView.cellSpacing = 0;
|
||||
self.categoryView.titleLabelZoomScale = 1.1;
|
||||
@@ -61,7 +62,11 @@
|
||||
}
|
||||
-(id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index{
|
||||
QXRankHomeSubVC *vc = [[QXRankHomeSubVC alloc] init];
|
||||
vc.rankType = index;
|
||||
if (index == 3) {
|
||||
vc.rankType = 4;
|
||||
}else{
|
||||
vc.rankType = index;
|
||||
}
|
||||
return vc;
|
||||
}
|
||||
- (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index {
|
||||
|
||||
@@ -18,8 +18,7 @@
|
||||
@interface QXSearchViewController ()<UIGestureRecognizerDelegate,UICollectionViewDelegate,UICollectionViewDataSource,ZLCollectionViewBaseFlowLayoutDelegate,QXSearchTopViewDelegate>
|
||||
@property(nonatomic,strong)UICollectionView* collectionView;
|
||||
@property(nonatomic,strong)QXSearchTopView *topView;
|
||||
|
||||
@property(nonatomic,strong)NSMutableArray *resultArray;
|
||||
@property(nonatomic,strong)QXSearchListModel *model;
|
||||
@end
|
||||
|
||||
@implementation QXSearchViewController
|
||||
@@ -56,23 +55,22 @@
|
||||
|
||||
-(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) {
|
||||
[QXMineNetwork searchListApiWithKetwords:keywords successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
QXSearchListModel *model = [QXSearchListModel yy_modelWithJSON:dict];
|
||||
weakSelf.model = model;
|
||||
if (weakSelf.model.users.count == 0 && weakSelf.model.rooms.count == 0) {
|
||||
showToast(@"暂无搜索结果");
|
||||
return;
|
||||
}
|
||||
[weakSelf.resultArray addObjectsFromArray:arr];
|
||||
[weakSelf pushToResultVC];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
showToast(msg);
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)pushToResultVC{
|
||||
QXHomeSearchResultVC *vc = [[QXHomeSearchResultVC alloc] init];
|
||||
vc.resultArray = self.resultArray;
|
||||
vc.model = self.model;
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
||||
@@ -135,11 +133,6 @@
|
||||
}
|
||||
return _topView;
|
||||
}
|
||||
-(NSMutableArray *)resultArray{
|
||||
if (!_resultArray) {
|
||||
_resultArray = [NSMutableArray array];
|
||||
}
|
||||
return _resultArray;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// QXRedBagRecordViewController.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/10/11.
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXRedBagRecordViewController : QXBaseViewController
|
||||
@property (nonatomic,strong)NSString *redbagId;
|
||||
@end
|
||||
|
||||
@interface QXRedBagRecordCell : UITableViewCell
|
||||
@property (nonatomic,strong)QXDrawRedpacketRecordModel *recordModel;
|
||||
+(instancetype)cellWithTabelView:(UITableView*)tableView;
|
||||
@end
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,262 @@
|
||||
//
|
||||
// QXRedBagRecordViewController.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/10/11.
|
||||
//
|
||||
|
||||
#import "QXRedBagRecordViewController.h"
|
||||
#import "QXMineNetwork.h"
|
||||
@class QXRedBagRecordCell;
|
||||
@interface QXRedBagRecordViewController ()<UITableViewDataSource,UITableViewDelegate>
|
||||
@property (nonatomic,strong)UIView *topView;
|
||||
@property (nonatomic,strong)UIImageView *topImageView;
|
||||
@property (nonatomic,strong)UIImageView *senderHeaderImageView;
|
||||
@property (nonatomic,strong)UILabel *senderNameLabel;
|
||||
@property (nonatomic,strong)UILabel *remarkLabel;
|
||||
@property (nonatomic,strong)UILabel *moneyLabel;
|
||||
@property (nonatomic,strong)UILabel *bottomLabel;
|
||||
@property (nonatomic,strong)UILabel *countLabel;
|
||||
|
||||
@property (nonatomic,strong)UITableView *tableView;
|
||||
@property (nonatomic,strong)QXDrawRedPacketModel *model;
|
||||
@end
|
||||
|
||||
@implementation QXRedBagRecordViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
|
||||
- (void)initSubViews{
|
||||
|
||||
self.topView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, ScaleWidth(308))];
|
||||
self.topImageView = [[UIImageView alloc] init];
|
||||
self.topImageView.image = [UIImage imageNamed:@"red_bag_record_top_bg"];
|
||||
[self.topView addSubview:self.topImageView];
|
||||
[self.topImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.bottom.left.right.equalTo(self.topView);
|
||||
}];
|
||||
|
||||
self.senderNameLabel = [[UILabel alloc] init];
|
||||
self.senderNameLabel.textColor = RGB16(0xffffff);
|
||||
self.senderNameLabel.font = [UIFont systemFontOfSize:18];
|
||||
self.senderNameLabel.text = @"-";
|
||||
[self.topView addSubview:self.senderNameLabel];
|
||||
[self.senderNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.equalTo(self.topView).offset(41-13);;
|
||||
make.top.equalTo(self.topView).offset(92);
|
||||
}];
|
||||
|
||||
self.senderHeaderImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"user_header_placehoulder"]];
|
||||
self.senderHeaderImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
[self.senderHeaderImageView addRoundedCornersWithRadius:20.5];
|
||||
[self.topView addSubview:self.senderHeaderImageView];
|
||||
[self.senderHeaderImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.equalTo(self.senderNameLabel.mas_left).offset(-13);
|
||||
make.centerY.equalTo(self.senderNameLabel);
|
||||
make.width.height.mas_equalTo(41);
|
||||
}];
|
||||
|
||||
self.remarkLabel = [[UILabel alloc] init];
|
||||
self.remarkLabel.text = @"-";
|
||||
self.remarkLabel.textColor = RGB16(0xffffff);
|
||||
self.remarkLabel.font = [UIFont systemFontOfSize:13];
|
||||
[self.topView addSubview:self.remarkLabel];
|
||||
[self.remarkLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.senderHeaderImageView.mas_bottom).offset(5);
|
||||
make.height.mas_equalTo(26);
|
||||
make.centerX.equalTo(self.topView);
|
||||
}];
|
||||
|
||||
self.moneyLabel = [[UILabel alloc] init];
|
||||
self.moneyLabel.font = [UIFont boldSystemFontOfSize:19];
|
||||
self.moneyLabel.textColor = RGB16(0xffffff);
|
||||
self.moneyLabel.text = @"0金币";
|
||||
[self.topView addSubview:self.moneyLabel];
|
||||
[self.moneyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.equalTo(self.topView);
|
||||
make.top.equalTo(self.remarkLabel.mas_bottom);
|
||||
}];
|
||||
|
||||
self.bottomLabel = [[UILabel alloc] init];
|
||||
self.bottomLabel.textColor = RGB16(0xffffff);
|
||||
self.bottomLabel.text = @"已存入钱包";
|
||||
self.bottomLabel.font = [UIFont systemFontOfSize:13];
|
||||
[self.topView addSubview:self.bottomLabel];
|
||||
[self.bottomLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.equalTo(self.topView);
|
||||
make.top.equalTo(self.moneyLabel.mas_bottom);
|
||||
}];
|
||||
|
||||
self.countLabel = [[UILabel alloc] init];
|
||||
self.countLabel.textColor = RGB16(0x999999);
|
||||
self.countLabel.font = [UIFont systemFontOfSize:13];
|
||||
self.countLabel.text = @"已领取0/0";
|
||||
[self.topView addSubview:self.countLabel];
|
||||
[self.countLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo (15);
|
||||
make.bottom.mas_equalTo(-10);
|
||||
}];
|
||||
|
||||
[self.view addSubview:self.topView];
|
||||
|
||||
|
||||
[self.dataArray addObject:@""];
|
||||
[self.dataArray addObject:@""];
|
||||
[self.dataArray addObject:@""];
|
||||
[self.dataArray addObject:@""];
|
||||
[self.dataArray addObject:@""];
|
||||
|
||||
self.tableView = [[UITableView alloc] initWithFrame:CGRectZero style:(UITableViewStylePlain)];
|
||||
self.tableView.dataSource = self;
|
||||
self.tableView.delegate = self;
|
||||
self.tableView.backgroundColor = RGB16(0xffffff);
|
||||
self.tableView.rowHeight = 67;
|
||||
|
||||
// self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
|
||||
[self.view addSubview:self.tableView];
|
||||
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.bottom.equalTo(self.view);
|
||||
make.top.equalTo(self.topView.mas_bottom);
|
||||
}];
|
||||
|
||||
UIButton*backBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, kSafeAreaTop, 44, 44)];
|
||||
[backBtn setImage:[[UIImage imageNamed:@"back"] imageByTintColor:UIColor.whiteColor] forState:(UIControlStateNormal)];
|
||||
// backBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeading;
|
||||
[backBtn addTarget:self action:@selector(backAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self.view addSubview:backBtn];
|
||||
}
|
||||
|
||||
-(void)setRedbagId:(NSString *)redbagId{
|
||||
_redbagId = redbagId;
|
||||
MJWeakSelf
|
||||
[QXMineNetwork getRedpacketRecordWithRedpacketId:redbagId successBlock:^(QXDrawRedPacketModel* model) {
|
||||
weakSelf.model = model;
|
||||
weakSelf.remarkLabel.text = model.redpacket_info.remark;
|
||||
[weakSelf.senderHeaderImageView sd_setImageWithURL:[NSURL URLWithString:model.redpacket_info.avatar]];
|
||||
weakSelf.senderNameLabel.text = [NSString stringWithFormat:@"%@的红包",model.redpacket_info.nickname];
|
||||
NSString *coinStr = @"";
|
||||
if (weakSelf.model.redpacket_info.coin_type.intValue == 1) {
|
||||
weakSelf.bottomLabel.text = @"已存入金币";
|
||||
coinStr = [NSString stringWithFormat:@"%@%@",model.my_record.amount?model.my_record.amount:@"0",@"金币"];
|
||||
}else{
|
||||
weakSelf.bottomLabel.text = @"已存入钻石";
|
||||
coinStr = [NSString stringWithFormat:@"%@%@",model.my_record.amount?model.my_record.amount:@"0",@"钻石"];
|
||||
}
|
||||
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:coinStr];
|
||||
[attr yy_setFont:[UIFont boldSystemFontOfSize:46] range:[coinStr rangeOfString:[NSString stringWithFormat:@"%@",model.my_record.amount?model.my_record.amount:@"0"]]];
|
||||
weakSelf.moneyLabel.attributedText = attr;
|
||||
weakSelf.countLabel.text = [NSString stringWithFormat:@"已领取%ld/%@",model.redpacket_info.total_count.integerValue-model.redpacket_info.left_count.integerValue,model.redpacket_info.total_count];
|
||||
[weakSelf.tableView reloadData];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
||||
return 1;
|
||||
}
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||
return self.model.records.count;
|
||||
}
|
||||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXRedBagRecordCell *cell = [QXRedBagRecordCell cellWithTabelView:tableView];
|
||||
cell.recordModel = self.model.records[indexPath.row];
|
||||
return cell;
|
||||
}
|
||||
-(void)backAction{
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
|
||||
@interface QXRedBagRecordCell()
|
||||
@property (nonatomic,strong)UIView *bgView;
|
||||
@property (nonatomic,strong)UIImageView *userHeaderImageView;
|
||||
@property (nonatomic,strong)UILabel *nameLabel;
|
||||
@property (nonatomic,strong)UILabel *timeLabel;
|
||||
@property (nonatomic,strong)UILabel *moneyLabel;
|
||||
@end
|
||||
|
||||
@implementation QXRedBagRecordCell
|
||||
|
||||
+(instancetype)cellWithTabelView:(UITableView *)tableView{
|
||||
static NSString *cellId = @"QXRedBagRecordCell";
|
||||
QXRedBagRecordCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
|
||||
if (!cell) {
|
||||
cell = [[QXRedBagRecordCell alloc] initWithStyle:(UITableViewCellStyleDefault) reuseIdentifier:cellId];
|
||||
}
|
||||
return cell;
|
||||
}
|
||||
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
|
||||
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
|
||||
self.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
[self initSubviews];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
-(void)setRecordModel:(QXDrawRedpacketRecordModel *)recordModel{
|
||||
_recordModel = recordModel;
|
||||
self.nameLabel.text = recordModel.nickname;
|
||||
[self.userHeaderImageView sd_setImageWithURL:[NSURL URLWithString:recordModel.avatar]];
|
||||
self.timeLabel.text = recordModel.createtime;
|
||||
self.moneyLabel.text = recordModel.amount;
|
||||
}
|
||||
-(void)initSubviews{
|
||||
self.bgView = [[UIView alloc] init];
|
||||
[self.contentView addSubview:self.bgView];
|
||||
[self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(15);
|
||||
make.right.mas_equalTo(-15);
|
||||
make.height.mas_equalTo(52);
|
||||
make.centerY.equalTo(self.contentView);
|
||||
}];
|
||||
|
||||
self.userHeaderImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"user_header_placehoulder"]];
|
||||
self.userHeaderImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
[self.userHeaderImageView addRoundedCornersWithRadius:24.5];
|
||||
[self.bgView addSubview:self.userHeaderImageView];
|
||||
[self.userHeaderImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.centerY.equalTo(self.bgView);
|
||||
make.width.height.mas_equalTo(49);
|
||||
}];
|
||||
|
||||
self.nameLabel = [[UILabel alloc] init];
|
||||
self.nameLabel.textColor = RGB16(0x666666);
|
||||
self.nameLabel.text = @"大家好,我是傻狗涛";
|
||||
self.nameLabel.font = [UIFont systemFontOfSize:14];
|
||||
[self.bgView addSubview:self.nameLabel];
|
||||
[self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.userHeaderImageView.mas_right).offset(13);
|
||||
make.top.equalTo(self.userHeaderImageView);
|
||||
make.height.mas_equalTo(26);
|
||||
}];
|
||||
|
||||
self.timeLabel = [[UILabel alloc] init];
|
||||
self.timeLabel.textColor = RGB16(0x999999);
|
||||
self.timeLabel.font = [UIFont systemFontOfSize:14];
|
||||
self.timeLabel.text = @"00:61";
|
||||
[self.bgView addSubview:self.timeLabel];
|
||||
[self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.userHeaderImageView.mas_right).offset(13);
|
||||
make.bottom.equalTo(self.userHeaderImageView);
|
||||
make.height.mas_equalTo(26);
|
||||
}];
|
||||
|
||||
self.moneyLabel = [[UILabel alloc] init];
|
||||
self.moneyLabel.textColor = RGB16(0x333333);
|
||||
self.moneyLabel.text = @"0 金币";
|
||||
self.moneyLabel.font = [UIFont systemFontOfSize:14];
|
||||
[self.bgView addSubview:self.moneyLabel];
|
||||
[self.moneyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.equalTo(self.bgView);
|
||||
make.centerY.equalTo(self.bgView);
|
||||
}];
|
||||
}
|
||||
@end
|
||||
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QXRoomViewController+Activity.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/10/15.
|
||||
//
|
||||
|
||||
#import "QXRoomViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXRoomViewController (Activity)
|
||||
-(void)initActivityObeserver;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// QXRoomViewController+Activity.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/10/15.
|
||||
//
|
||||
|
||||
#import "QXRoomViewController+Activity.h"
|
||||
#import "QXMeetActivityDriftView.h"
|
||||
@implementation QXRoomViewController (Activity)
|
||||
|
||||
-(void)initActivityObeserver{
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateProgress:) name:noticeXLHNotice object:nil];
|
||||
}
|
||||
|
||||
-(void)updateProgress:(NSNotification *)notice{
|
||||
QXMeetActivityDriftModel *model = notice.object;
|
||||
if (model.from_type == QXMeetActivityTypeAcLock) {
|
||||
[self.meetView updateUserAndGiftInfoWithModel:model];
|
||||
self.acTagView.end_time = model.end_time.longLongValue;
|
||||
return;
|
||||
}
|
||||
if (model.from_type == QXMeetActivityTypeAcProgress) {
|
||||
[self.skyView updateProgress:model.xlh_data];
|
||||
[self.ageView updateProgress:model.xlh_data];
|
||||
[self.timeView updateProgress:model.xlh_data];
|
||||
}
|
||||
if (model.xlh_data.status.intValue == 1) {
|
||||
self.acTagView.end_time = model.xlh_data.end_time;
|
||||
[self.view addSubview:self.acTagView];
|
||||
}else{
|
||||
[self.acTagView stopTimer];
|
||||
[self.acTagView removeFromSuperview];
|
||||
}
|
||||
}
|
||||
@end
|
||||
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// QXRoomViewController+Friend.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/8/20.
|
||||
//
|
||||
|
||||
#import "QXRoomViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXRoomViewController (Friend)
|
||||
/// 重置麦位视图
|
||||
-(void)resetFriendViews;
|
||||
|
||||
/// 交友房阶段发生变化 step 阶段 1等待 2心动 3牵手 friend_id 场次id
|
||||
//-(void)friendPartDidChangedWithType:(NSString*)step friend_id:(NSString*)friend_id;
|
||||
///// 交友房时间发生延时 end_time 截止时间
|
||||
//-(void)friendTimeDelayWithTime:(NSString*)end_time;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
121
QXLive/HomePage(声播)/Controlller/房间/QXRoomViewController+Friend.m
Normal file
121
QXLive/HomePage(声播)/Controlller/房间/QXRoomViewController+Friend.m
Normal file
@@ -0,0 +1,121 @@
|
||||
//
|
||||
// QXRoomViewController+Friend.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/8/20.
|
||||
//
|
||||
|
||||
#import "QXRoomViewController+Friend.h"
|
||||
#import "QXAgoraEngine.h"
|
||||
@implementation QXRoomViewController (Friend)
|
||||
|
||||
-(void)resetFriendViews{
|
||||
[self.seatContentView setType:QXRoomSeatViewTypeFriend];
|
||||
[self.seatContentView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.equalTo(self.view);
|
||||
make.top.mas_equalTo(self.titleView.bottom);
|
||||
make.height.mas_equalTo(ScaleWidth(377));
|
||||
}];
|
||||
[self.chatListView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.equalTo(self.bottomView.mas_top);
|
||||
make.left.equalTo(self.view);
|
||||
make.top.equalTo(self.seatContentView.mas_bottom);
|
||||
// make.right.equalTo(self.soundBtn.mas_left).offset(-16);
|
||||
make.width.mas_equalTo(ScaleWidth(280));
|
||||
}];
|
||||
}
|
||||
-(void)friendPartDidChangedWithType:(NSString*)step friend_id:(NSString*)friend_id end_time:(NSString*)end_time relationModel:(nonnull QXRoomFriendRelationModel *)relationModel{
|
||||
[self.seatContentView friendPartDidChangedWithType:step friend_id:friend_id end_time:end_time relationModel:relationModel];
|
||||
}
|
||||
|
||||
-(void)friendTimeDelayWithTime:(NSString *)end_time{
|
||||
[self.seatContentView friendTimeDelayWithTime:end_time];
|
||||
}
|
||||
-(void)friendSeatDidChanged:(NSArray<QXRoomPitModel *> *)pitArray{
|
||||
BOOL haveMe = NO;
|
||||
if (self.seatContentView.myPitNumber == 9 || self.seatContentView.myPitNumber == 10) {
|
||||
haveMe = YES;
|
||||
}
|
||||
for (QXRoomPitModel*md in pitArray) {
|
||||
if ([md.user_id isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
|
||||
self.seatContentView.myPitNumber = md.pit_number.integerValue;
|
||||
haveMe = YES;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (haveMe == NO) {
|
||||
self.bottomView.status = 1;
|
||||
[[QXAgoraEngine sharedEngine] setClientRoleBroadcaster:NO];
|
||||
}else{
|
||||
self.bottomView.status = 2;
|
||||
if ([QXAgoraEngine sharedEngine].isOpenMic) {
|
||||
[self.bottomView setMuteAudioStatus:1];
|
||||
}else{
|
||||
[self.bottomView setMuteAudioStatus:0];
|
||||
}
|
||||
}
|
||||
[self.seatContentView friendSeatDidChanged:pitArray];
|
||||
}
|
||||
-(void)friendPowerSendGiftWithUser:(QXRoomPitModel *)user heartId:(NSString *)heartId{
|
||||
self.sendGiftView.type = QXSendGiftViewTypeFriend;
|
||||
QXRoomPitModel *model = [[QXRoomPitModel alloc] init];
|
||||
model.pit_number = user.pit_number;
|
||||
model.user_id = user.user_id;
|
||||
model.nickname = user.nickname;
|
||||
model.avatar = user.avatar;
|
||||
self.sendGiftView.userModel = model;
|
||||
self.sendGiftView.heartId = heartId;
|
||||
self.sendGiftView.roomId = self.roomId;
|
||||
[self.sendGiftView showInView:self.view];
|
||||
}
|
||||
-(void)friendHeartNumberDidChanged:(NSArray<QXRoomFriendHeartListModel *> *)heartArray{
|
||||
[self.seatContentView friendHeartNumberDidChanged:heartArray];
|
||||
}
|
||||
/// 关系创建完成
|
||||
-(void)friendRelationIsCreatedWithrelationModel:(QXRoomFriendRelationModel*)relationModel{
|
||||
[self.seatContentView friendRelationIsCreatedWithrelationModel:relationModel];
|
||||
}
|
||||
/// 有人退出交友房私密小屋
|
||||
-(void)friendCabinRoomIsQuit{
|
||||
[[QXGlobal shareGlobal] quitRoomWithRoomId:self.roomId];
|
||||
|
||||
NSMutableArray *viewControllers = [NSMutableArray arrayWithArray:self.navigationController.viewControllers];
|
||||
for (int i = 0; i < viewControllers.count; i++) {
|
||||
UIViewController *vc = [viewControllers objectAtIndex:i];
|
||||
if ([vc isEqual:self]) {
|
||||
QXRoomViewController *roomVc = [[QXRoomViewController alloc] init];
|
||||
roomVc.roomId = QXGlobal.shareGlobal.superRoomId;
|
||||
[viewControllers insertObject:roomVc atIndex:i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
self.navigationController.viewControllers = viewControllers;
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
QXGlobal.shareGlobal.superRoomId = @"";
|
||||
// [self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
/// 私密小屋时间发生延时
|
||||
-(void)friendCabinRoomTimeDelayWithTime:(NSString*)end_time{
|
||||
[self.seatContentView friendCabinRoomTimeDelayWithTime:end_time];
|
||||
}
|
||||
|
||||
|
||||
-(void)meetActivityProgressIsUpdate:(NSDictionary *)updateDict{
|
||||
QXXLHModel *model = [QXXLHModel yy_modelWithJSON:updateDict[@"xlh_data"]];
|
||||
[self.skyView updateProgress:model];
|
||||
[self.ageView updateProgress:model];
|
||||
[self.timeView updateProgress:model];
|
||||
if (model.status.intValue == 1) {
|
||||
self.acTagView.end_time = model.end_time;
|
||||
[self.view addSubview:self.acTagView];
|
||||
}else{
|
||||
[self.acTagView stopTimer];
|
||||
[self.acTagView removeFromSuperview];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)meetActivityGiftInfoIsUpdate:(QXRoomChatListModel *)giftInfo{
|
||||
// [self.meetView updateUserAndGiftInfoWithModel:giftInfo];
|
||||
// self.acTagView.end_time = giftInfo.end_time.longLongValue;
|
||||
}
|
||||
@end
|
||||
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QXRoomViewController+RedPacket.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/10/13.
|
||||
//
|
||||
|
||||
#import "QXRoomViewController.h"
|
||||
#import "QXRedPacketManager.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXRoomViewController (RedPacket)<QXRedPacketManagerDelegate>
|
||||
-(void)initRedpacketManager;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,119 @@
|
||||
//
|
||||
// QXRoomViewController+RedPacket.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/10/13.
|
||||
//
|
||||
|
||||
#import "QXRoomViewController+RedPacket.h"
|
||||
#import "QXMineNetwork.h"
|
||||
@implementation QXRoomViewController (RedPacket)
|
||||
-(void)recievedRedPacket:(QXRedPacketModel *)model{
|
||||
self.redBagTagView.hidden = NO;
|
||||
[[QXRedPacketManager sharedManager] addRedPacket:model];
|
||||
}
|
||||
-(void)redPacketDidFinished:(NSString *)redpacket_id{
|
||||
[[QXRedPacketManager sharedManager] removeRedPacket:redpacket_id];
|
||||
NSArray *arr = [QXRedPacketManager sharedManager].allRedPackets;
|
||||
if (self.redbagListView) {
|
||||
self.redbagListView.dataArray = arr;
|
||||
}
|
||||
self.redBagTagView.count = [NSString stringWithFormat:@"%ld",arr.count];
|
||||
}
|
||||
-(void)initRedpacketManager{
|
||||
[QXRedPacketManager sharedManager].delegate = self;
|
||||
[[QXRedPacketManager sharedManager] startCheckTimer];
|
||||
// 获取红包列表
|
||||
[self getRedBagList];
|
||||
}
|
||||
|
||||
-(void)getRedBagList{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork getRedpacketListWithRoomId:self.roomId successBlock:^(NSArray<QXRedPacketModel *> * _Nonnull list) {
|
||||
if (list.count > 0) {
|
||||
weakSelf.redBagTagView.count = [NSString stringWithFormat:@"%ld",list.count];
|
||||
weakSelf.redBagTagView.hidden = NO;
|
||||
[[QXRedPacketManager sharedManager] addRedPackets:list];
|
||||
}else{
|
||||
[[QXRedPacketManager sharedManager] removeAllRedpackets];
|
||||
}
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
#pragma mark - QXRedPacketManagerDelegate
|
||||
/// 添加红包成功
|
||||
-(void)QXRedPacketManager:(QXRedPacketManager *)manager didAddRedPacket:(QXRedPacketModel *)redPacket remainingCount:(NSInteger)remainingCount{
|
||||
self.redBagTagView.count = [NSString stringWithFormat:@"%ld",remainingCount];
|
||||
}
|
||||
/// 移除红包回调
|
||||
- (void)QXRedPacketManager:(QXRedPacketManager *)manager didRemoveRedPacket:(NSString *)packetId remainingCount:(NSInteger)remainingCount{
|
||||
self.redBagTagView.count = [NSString stringWithFormat:@"%ld",remainingCount];
|
||||
}
|
||||
|
||||
/// 更新红包回调
|
||||
- (void)QXRedPacketManager:(QXRedPacketManager *)manager didUpdateRedPacket:(QXRedPacketModel *)redPacket remainingCount:(NSInteger)remainingCount{
|
||||
if (self.redbagDrawView.redpacketModel != nil && self.redbagDrawView.redpacketModel.countdown > 0) {
|
||||
if (self.redbagDrawView.redpacketModel.type.intValue == 1) {
|
||||
[self.redbagDrawView changeViewType:(QXRedBagDrawTypeOpen)];
|
||||
}else{
|
||||
if (self.redbagDrawView.isFromToComment) {
|
||||
[self.redbagDrawView changeViewType:(QXRedBagDrawTypeOpen)];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)QXRedPacketManager:(QXRedPacketManager *)manager didAddRedPackets:(NSArray<QXRedPacketModel *> *)redPackets remainingCount:(NSInteger)remainingCount{
|
||||
self.redBagTagView.count = [NSString stringWithFormat:@"%ld",remainingCount];
|
||||
}
|
||||
|
||||
- (void)QXRedPacketManager:(QXRedPacketManager *)manager didUpdateRedPacketTime:(long)time redPacket:(QXRedPacketModel *)redPacket {
|
||||
/// 开红包的倒计时
|
||||
if (self.redbagDrawView.redpacketModel != nil && self.redbagDrawView.redpacketModel.countdown > 0 && time>=0) {
|
||||
if (self.redbagDrawView.redpacketModel.type.intValue == 1) {
|
||||
// 普通红包
|
||||
if ([self.redbagDrawView.redpacketModel.conditions containsString:@"1"]) {
|
||||
// 有收藏房间条件
|
||||
if (self.roomModel.user_info.is_collect.intValue == 1) {
|
||||
/// 需要满足收藏再倒计时
|
||||
if (redPacket == self.redbagDrawView.redpacketModel) {
|
||||
self.redbagDrawView.needTime = time;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if (redPacket == self.redbagDrawView.redpacketModel) {
|
||||
self.redbagDrawView.needTime = time;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if (self.redbagDrawView.isFromToComment) {
|
||||
// 普通红包
|
||||
if ([self.redbagDrawView.redpacketModel.conditions containsString:@"1"]) {
|
||||
// 有收藏房间条件
|
||||
if (self.roomModel.user_info.is_collect.intValue == 1) {
|
||||
/// 需要满足收藏再倒计时
|
||||
if (redPacket == self.redbagDrawView.redpacketModel) {
|
||||
self.redbagDrawView.needTime = time;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if (redPacket == self.redbagDrawView.redpacketModel) {
|
||||
self.redbagDrawView.needTime = time;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// 红包列表的倒计时
|
||||
if (self.redbagListView.dataArray.count > 0) {
|
||||
NSInteger index = [self.redbagListView.dataArray indexOfObject:redPacket];
|
||||
[self.redbagListView updateRedpacketTimeWithIndex:index time:time];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@end
|
||||
@@ -6,13 +6,60 @@
|
||||
//
|
||||
|
||||
#import "QXBaseViewController.h"
|
||||
#import "QXGlobal.h"
|
||||
#import "QXRoomSeatView.h"
|
||||
#import "QXRoomChatListView.h"
|
||||
#import "QXRoomTitleView.h"
|
||||
#import "QXRoomBottomView.h"
|
||||
#import "QXRoomMessageManager.h"
|
||||
#import "QXSendGiftView.h"
|
||||
|
||||
/// 活动
|
||||
#import "QXSkyPraizeView.h"/// 天空之境
|
||||
#import "QXAgePraizeView.h"/// 岁月之城
|
||||
#import "QXTimePraizeView.h"/// 时空之巅
|
||||
#import "QXMeetActivityView.h"
|
||||
#import "QXActivityTagView.h"
|
||||
|
||||
/// 红包
|
||||
#import "QXRedBagTagView.h"
|
||||
#import "QXRedBagDrawView.h"
|
||||
#import "QXRedBagListView.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXRoomViewController : QXBaseViewController
|
||||
@interface QXRoomViewController : QXBaseViewController<QXRoomMessageManagerDelegate,QXRoomSeatDelegate>
|
||||
@property (nonatomic,strong)NSString *roomId;
|
||||
/// 是否为最小化房间进来
|
||||
@property (nonatomic,assign)BOOL isReJoin;
|
||||
|
||||
@property (nonatomic,strong)QXRoomModel* roomModel;
|
||||
/// 麦位视图
|
||||
@property (nonatomic,strong)QXRoomSeatView *seatContentView;
|
||||
/// 聊天列表
|
||||
@property (nonatomic,strong)QXRoomChatListView *chatListView;
|
||||
/// 顶部房间信息
|
||||
@property (nonatomic,strong)QXRoomTitleView *titleView;
|
||||
/// 底部工具栏
|
||||
@property (nonatomic,strong)QXRoomBottomView *bottomView;
|
||||
/// 发送礼物
|
||||
@property (nonatomic,strong)QXSendGiftView *sendGiftView;
|
||||
|
||||
/// 红包入口
|
||||
@property (nonatomic,strong)QXRedBagTagView *redBagTagView;
|
||||
@property (nonatomic,strong)QXRedBagDrawView *redbagDrawView;
|
||||
@property (nonatomic,strong)QXRedBagListView *redbagListView;
|
||||
|
||||
|
||||
@property (nonatomic,strong)QXActivityTagView *acTagView;
|
||||
@property (nonatomic,strong)QXSkyPraizeView *skyView;
|
||||
@property (nonatomic,strong)QXAgePraizeView *ageView;
|
||||
@property (nonatomic,strong)QXTimePraizeView *timeView;
|
||||
/// 巡乐会
|
||||
@property (nonatomic,strong)QXMeetActivityView *meetView;
|
||||
-(void)configBottomTools;
|
||||
-(void)stopHWDMP4;
|
||||
-(void)playHWDMP4;
|
||||
-(void)destroyViews;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -6,16 +6,10 @@
|
||||
//
|
||||
|
||||
#import "QXRoomViewController.h"
|
||||
#import "QXRoomTitleView.h"
|
||||
#import "QXRoomSeatView.h"
|
||||
#import "QXRoomBottomView.h"
|
||||
#import "QXRoomChatListView.h"
|
||||
#import "QXRoomSongListView.h"
|
||||
#import "QXSendGiftView.h"
|
||||
#import "QXSoundListView.h"
|
||||
#import "QXUpSeatView.h"
|
||||
#import "QXMineNetwork.h"
|
||||
#import "QXRoomMessageManager.h"
|
||||
#import "QXGiftPlayerManager.h"
|
||||
#import "QXAgoraEngine.h"
|
||||
#import "QXRoomSettingView.h"
|
||||
@@ -34,29 +28,23 @@
|
||||
#import "QXReportViewController.h"
|
||||
#import "QXMessageViewController.h"
|
||||
#import "QXRoomSubsidyViewController.h"
|
||||
#import "QXRoomViewController+Friend.h"
|
||||
#import "QXAllRoomHourRankView.h"
|
||||
#import "QXRedBagSendView.h"
|
||||
#import "QXRoomViewController+RedPacket.h"
|
||||
#import "QXRoomViewController+Activity.h"
|
||||
#import "QXRedBagRecordViewController.h"
|
||||
|
||||
@interface QXRoomViewController ()<
|
||||
QXRoomBottomViewDelegate,
|
||||
QXRoomMessageManagerDelegate,
|
||||
QXRoomSettingViewDelegate,
|
||||
QXAgoraEngineMediaPlayerDelegate,
|
||||
QXRoomSeatDelegate,
|
||||
QXRoomUserInfoViewDelegate
|
||||
>
|
||||
@property (nonatomic,strong)UIImageView *roomBgImageView;
|
||||
@property (nonatomic,strong)UIView *roomBgCoverView;
|
||||
/// 顶部房间信息
|
||||
@property (nonatomic,strong)QXRoomTitleView *titleView;
|
||||
/// 麦位视图
|
||||
@property (nonatomic,strong)QXRoomSeatView *seatContentView;
|
||||
/// 底部工具栏
|
||||
@property (nonatomic,strong)QXRoomBottomView *bottomView;
|
||||
/// 聊天列表
|
||||
@property (nonatomic,strong)QXRoomChatListView *chatListView;
|
||||
/// 点唱view
|
||||
@property (nonatomic,strong)QXRoomSongListView *songListView;
|
||||
/// 发送礼物
|
||||
@property (nonatomic,strong)QXSendGiftView *sendGiftView;
|
||||
/// 声音特效
|
||||
@property (nonatomic,strong)QXSoundListView *soundListView;
|
||||
/// 申请上麦
|
||||
@@ -68,7 +56,6 @@ QXRoomUserInfoViewDelegate
|
||||
/// 排麦按钮
|
||||
@property (nonatomic,strong)QXUpSeatCountView *micTeamView;
|
||||
|
||||
@property (nonatomic,strong)QXRoomModel* roomModel;
|
||||
/// 礼物特效
|
||||
@property (nonatomic,strong)UIView *bgEffectView;
|
||||
/// 设置
|
||||
@@ -89,6 +76,12 @@ QXRoomUserInfoViewDelegate
|
||||
@property (nonatomic,strong)QXCabinMovieView *movieView;
|
||||
/// 连送按钮
|
||||
@property (nonatomic,strong)QXContinuousGiftView *continuousView;
|
||||
|
||||
|
||||
@property (nonatomic,strong)QXAllRoomHourRankView *hourRankView;
|
||||
@property (nonatomic,strong)QXAllRoomHourRankTagView *hourRankIconView;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@implementation QXRoomViewController
|
||||
@@ -96,12 +89,12 @@ QXRoomUserInfoViewDelegate
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
// Do any additional setup after loading the view.
|
||||
|
||||
[self initRedpacketManager];
|
||||
}
|
||||
-(void)viewWillAppear:(BOOL)animated{
|
||||
[super viewWillAppear:animated];
|
||||
[self.navigationController setNavigationBarHidden:YES animated:YES];
|
||||
[UIApplication sharedApplication].idleTimerDisabled = YES;
|
||||
|
||||
}
|
||||
-(void)viewDidAppear:(BOOL)animated{
|
||||
[super viewDidAppear:animated];
|
||||
@@ -119,19 +112,28 @@ QXRoomUserInfoViewDelegate
|
||||
break;
|
||||
}
|
||||
}
|
||||
[self playHWDMP4];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[[QXGiftPlayerManager shareManager] startPlay];
|
||||
});
|
||||
self.navigationController.viewControllers = marr;
|
||||
// self.navigationController.interactivePopGestureRecognizer.enabled = NO;
|
||||
}
|
||||
-(void)viewDidDisappear:(BOOL)animated{
|
||||
[super viewDidDisappear:animated];
|
||||
[UIApplication sharedApplication].idleTimerDisabled = NO;
|
||||
[[QXGiftPlayerManager shareManager] stopPlay];
|
||||
// [[QXGiftPlayerManager shareManager] stopPlay];
|
||||
self.continuousView.hidden = YES;
|
||||
[self stopHWDMP4];
|
||||
|
||||
}
|
||||
-(void)viewWillDisappear:(BOOL)animated{
|
||||
[super viewWillDisappear:animated];
|
||||
[[QXGiftPlayerManager shareManager] stopPlay];
|
||||
}
|
||||
|
||||
-(void)initSubViews{
|
||||
|
||||
// [self updateBgImage:@"room_background"];
|
||||
[self initActivityObeserver];
|
||||
self.bgImageHidden = YES;
|
||||
self.roomBgImageView = [[UIImageView alloc] initWithFrame:self.view.bounds];
|
||||
// self.roomBgImageView.image = [UIImage imageNamed:@"room_background"];
|
||||
@@ -206,6 +208,8 @@ QXRoomUserInfoViewDelegate
|
||||
[self joinRoom];
|
||||
}
|
||||
|
||||
[self.view addSubview:self.hourRankIconView];
|
||||
[self.view addSubview:self.redBagTagView];
|
||||
[self setupEffectView];
|
||||
|
||||
// [self.view addSubview:self.headlineView];
|
||||
@@ -235,27 +239,13 @@ QXRoomUserInfoViewDelegate
|
||||
BOOL isClose = [[NSUserDefaults standardUserDefaults] boolForKey:kEffectsCLose];
|
||||
[[QXGiftPlayerManager shareManager] openOrCloseEffectViewWith:!isClose];
|
||||
}
|
||||
#pragma mark - 获取房间信息
|
||||
-(void)joinRoom{
|
||||
-(void)setRoomModel:(QXRoomModel *)roomModel{
|
||||
_roomModel = roomModel;
|
||||
}
|
||||
-(void)setRoomId:(NSString *)roomId{
|
||||
_roomId = roomId;
|
||||
[self.chatListView insertNoitce];
|
||||
[[QXRoomMessageManager shared] joinGroupWithRoomId:self.roomId];
|
||||
MJWeakSelf
|
||||
[QXMineNetwork joinRoomWithRoomId:self.roomId successBlock:^(QXRoomModel * _Nonnull roomModel) {
|
||||
// roomModel.room_info.pk_room_id = @"33";
|
||||
weakSelf.roomModel = roomModel;
|
||||
[weakSelf resetSubviews];
|
||||
[weakSelf configRoomDataIsJoin:YES];
|
||||
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
showToast(msg);
|
||||
[[QXGlobal shareGlobal] quitRoomWithRoomId:self.roomId];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[weakSelf.navigationController popViewControllerAnimated:YES];
|
||||
});
|
||||
|
||||
}];
|
||||
|
||||
|
||||
[QXMineNetwork roomOnlineListWithRoomId:self.roomId page:1 successBlock:^(NSArray<QXRoomUserInfoModel *> * _Nonnull onPitList, NSArray<QXRoomUserInfoModel *> * _Nonnull offPitList) {
|
||||
NSMutableArray *arr = [NSMutableArray arrayWithArray:onPitList];
|
||||
[arr addObjectsFromArray:offPitList];
|
||||
@@ -263,6 +253,42 @@ QXRoomUserInfoViewDelegate
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
#pragma mark - 获取房间信息
|
||||
-(void)joinRoom{
|
||||
if (self.roomModel) {
|
||||
[self resetSubviews];
|
||||
[self configRoomDataIsJoin:YES];
|
||||
}else{
|
||||
MJWeakSelf
|
||||
[[QXRoomMessageManager shared] joinGroupWithRoomId:self.roomId];
|
||||
[QXMineNetwork joinRoomWithRoomId:self.roomId successBlock:^(QXRoomModel * _Nonnull roomModel) {
|
||||
weakSelf.roomModel = roomModel;
|
||||
[self resetSubviews];
|
||||
[self configRoomDataIsJoin:YES];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
showToast(msg);
|
||||
[[QXGlobal shareGlobal] quitRoomWithRoomId:self.roomId];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[weakSelf.navigationController popViewControllerAnimated:YES];
|
||||
});
|
||||
}];
|
||||
}
|
||||
|
||||
//// roomModel.room_info.pk_room_id = @"33";
|
||||
//
|
||||
//
|
||||
// } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
// showToast(msg);
|
||||
// [[QXGlobal shareGlobal] quitRoomWithRoomId:self.roomId];
|
||||
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
// [weakSelf.navigationController popViewControllerAnimated:YES];
|
||||
// });
|
||||
//
|
||||
// }];
|
||||
|
||||
|
||||
|
||||
}
|
||||
-(void)getUserOnlineStatusWithUserIds:(NSString*)userIds{
|
||||
[QXMineNetwork roomUserOnlineStatusWithUserIds:userIds roomId:self.roomId successBlock:^(NSArray<QXUserModel *> * _Nonnull list) {
|
||||
@@ -300,7 +326,7 @@ QXRoomUserInfoViewDelegate
|
||||
}else{
|
||||
self.roomBgImageView.image = [UIImage imageNamed:@"cp_room_bg"];
|
||||
}
|
||||
if (self.roomModel.room_info.type_id.intValue == 1 || self.roomModel.room_info.type_id.intValue == 3 || self.roomModel.room_info.type_id.intValue == 4) {
|
||||
if (self.roomModel.room_info.type_id.intValue == 1 || self.roomModel.room_info.type_id.intValue == 3 || self.roomModel.room_info.type_id.intValue == 4 || self.roomModel.room_info.type_id.intValue == 8) {
|
||||
// 点唱房
|
||||
if (self.roomModel.room_info.label_id.intValue == 1) {
|
||||
|
||||
@@ -388,6 +414,9 @@ QXRoomUserInfoViewDelegate
|
||||
make.width.mas_equalTo(ScaleWidth(280));
|
||||
}];
|
||||
[self.view insertSubview:self.movieView atIndex:0];
|
||||
}else if (self.roomModel.room_info.type_id.intValue == 7) {
|
||||
/// 交友房
|
||||
[self resetFriendViews];
|
||||
}
|
||||
|
||||
if (self.roomModel.room_info.last_pk_room_id.isExist) {
|
||||
@@ -395,6 +424,18 @@ QXRoomUserInfoViewDelegate
|
||||
[[QXAgoraEngineEx sharedEngine] quitEXChannelWithLastPkRoomId:self.roomModel.room_info.last_pk_room_id];
|
||||
}
|
||||
}
|
||||
if (self.roomModel.gift_cycle.xlh_info.xlh_status.intValue == 1) {
|
||||
self.acTagView.end_time = self.roomModel.gift_cycle.xlh_info.end_time;
|
||||
[self.view addSubview:self.acTagView];
|
||||
}else{
|
||||
[self.acTagView stopTimer];
|
||||
[self.acTagView removeFromSuperview];
|
||||
}
|
||||
if (self.roomModel.hour_ranking_open == 1) {
|
||||
self.hourRankIconView.hidden = NO;
|
||||
}else{
|
||||
self.hourRankIconView.hidden = YES;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -411,19 +452,24 @@ QXRoomUserInfoViewDelegate
|
||||
|
||||
self.micTeamView.countLabel.text = self.roomModel.room_info.queue_number;
|
||||
self.titleView.roomModel = self.roomModel;
|
||||
if (self.roomModel.user_info.pit_number.intValue > 0) {
|
||||
if (self.roomModel.room_info.type_id.intValue == 6) {
|
||||
self.bottomView.isCabinRoom = YES;
|
||||
[[QXAgoraEngine sharedEngine] setClientRoleBroadcaster:YES];
|
||||
[[QXAgoraEngine sharedEngine] enableAudio:NO];
|
||||
[[QXAgoraEngine sharedEngine] muteLocalAudioStream:NO];
|
||||
self.seatContentView.myPitNumber = self.roomModel.user_info.pit_number.intValue;
|
||||
}else{
|
||||
self.seatContentView.myPitNumber = -1;
|
||||
[[QXAgoraEngine sharedEngine] setClientRoleBroadcaster:NO];
|
||||
[[QXAgoraEngine sharedEngine] enableAudio:NO];
|
||||
[[QXAgoraEngine sharedEngine] muteLocalAudioStream:YES];
|
||||
if (self.roomModel.user_info.pit_number.intValue > 0) {
|
||||
[[QXAgoraEngine sharedEngine] setClientRoleBroadcaster:YES];
|
||||
[[QXAgoraEngine sharedEngine] enableAudio:NO];
|
||||
[[QXAgoraEngine sharedEngine] muteLocalAudioStream:NO];
|
||||
self.seatContentView.myPitNumber = self.roomModel.user_info.pit_number.intValue;
|
||||
}else{
|
||||
self.seatContentView.myPitNumber = -1;
|
||||
[[QXAgoraEngine sharedEngine] setClientRoleBroadcaster:NO];
|
||||
[[QXAgoraEngine sharedEngine] enableAudio:NO];
|
||||
[[QXAgoraEngine sharedEngine] muteLocalAudioStream:YES];
|
||||
}
|
||||
}
|
||||
self.seatContentView.roomModel = self.roomModel;
|
||||
if ((self.roomModel.room_info.type_id.intValue == 1 || self.roomModel.room_info.type_id.intValue == 3 || self.roomModel.room_info.type_id.intValue == 4) && self.roomModel.room_info.label_id.intValue == 2){
|
||||
if ((self.roomModel.room_info.type_id.intValue == 1 || self.roomModel.room_info.type_id.intValue == 3 || self.roomModel.room_info.type_id.intValue == 4 || self.roomModel.room_info.type_id.intValue == 8) && self.roomModel.room_info.label_id.intValue == 2){
|
||||
/// k歌房没有背景音乐
|
||||
[QXAgoraEngine sharedEngine].isPlayBgMusic = NO;
|
||||
}else{
|
||||
@@ -448,7 +494,7 @@ QXRoomUserInfoViewDelegate
|
||||
if (isJoin) {
|
||||
MJWeakSelf
|
||||
[[QXAgoraEngine sharedEngine] joinChannel:self.roomId withRoom:self agora_token:self.roomModel.user_info.agora_token agora_rtm_token:self.roomModel.user_info.agora_rtm_token isUpSeat:self.seatContentView.myPitNumber>0 successBock:^{
|
||||
if (weakSelf.roomModel.song_user_info && (weakSelf.roomModel.room_info.type_id.intValue == 1 || weakSelf.roomModel.room_info.type_id.intValue == 3 || weakSelf.roomModel.room_info.type_id.intValue == 4) && weakSelf.roomModel.room_info.label_id.intValue == 2) {
|
||||
if (weakSelf.roomModel.song_user_info && (weakSelf.roomModel.room_info.type_id.intValue == 1 || weakSelf.roomModel.room_info.type_id.intValue == 3 || weakSelf.roomModel.room_info.type_id.intValue == 4 || weakSelf.roomModel.room_info.type_id.intValue == 8) && weakSelf.roomModel.room_info.label_id.intValue == 2) {
|
||||
if ([weakSelf.roomModel.song_user_info.user_id isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
|
||||
// [[QXAgoraEngine sharedEngine] ktv_EndSing];
|
||||
// [[QXAgoraEngine sharedEngine] ktv_StartSing:YES withSong:weakSelf.roomModel.song_user_info];
|
||||
@@ -478,12 +524,15 @@ QXRoomUserInfoViewDelegate
|
||||
//// _movieView = nil;
|
||||
//// }
|
||||
[[QXAgoraEngine sharedEngine] startPreViewWithUid:uid view:self.movieView.videoView];
|
||||
[[QXAgoraEngine sharedEngine] setClientRoleBroadcaster:YES];
|
||||
[[QXAgoraEngine sharedEngine] enableAudio:NO];
|
||||
[[QXAgoraEngine sharedEngine] muteLocalAudioStream:NO];
|
||||
}
|
||||
|
||||
}];
|
||||
|
||||
}else{
|
||||
if (self.roomModel.song_user_info && (self.roomModel.room_info.type_id.intValue == 1 || self.roomModel.room_info.type_id.intValue == 3 || self.roomModel.room_info.type_id.intValue == 4) && self.roomModel.room_info.label_id.intValue == 2) {
|
||||
if (self.roomModel.song_user_info && (self.roomModel.room_info.type_id.intValue == 1 || self.roomModel.room_info.type_id.intValue == 3 || self.roomModel.room_info.type_id.intValue == 4 || self.roomModel.room_info.type_id.intValue == 8) && self.roomModel.room_info.label_id.intValue == 2) {
|
||||
if ([self.roomModel.song_user_info.user_id isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
|
||||
self.seatContentView.songInfo = self.roomModel.song_user_info;
|
||||
self.seatContentView.nextInfo = self.roomModel.nextInfo;
|
||||
@@ -495,12 +544,9 @@ QXRoomUserInfoViewDelegate
|
||||
}
|
||||
[QXRoomMessageManager shared].delegate = self;
|
||||
[QXAgoraEngine sharedEngine].delegate = self;
|
||||
if (self.roomModel.room_info.type_id.intValue == 6) {
|
||||
self.bottomView.isCabinRoom = YES;
|
||||
[[QXAgoraEngine sharedEngine] setClientRoleBroadcaster:YES];
|
||||
}
|
||||
|
||||
|
||||
if (self.roomModel.room_info.type_id.intValue == 1 || self.roomModel.room_info.type_id.intValue == 3 || self.roomModel.room_info.type_id.intValue == 4) {
|
||||
if (self.roomModel.room_info.type_id.intValue == 1 || self.roomModel.room_info.type_id.intValue == 3 || self.roomModel.room_info.type_id.intValue == 4 || self.roomModel.room_info.type_id.intValue == 8) {
|
||||
// 点唱房
|
||||
if (self.roomModel.room_info.label_id.intValue == 1) {
|
||||
if (self.roomModel.pk_info.pk_id.intValue>0) {
|
||||
@@ -537,15 +583,23 @@ QXRoomUserInfoViewDelegate
|
||||
}
|
||||
|
||||
-(void)configBottomTools{
|
||||
if (self.roomModel.room_info.type_id.intValue == 6) {
|
||||
self.bottomView.isCabinRoom = YES;
|
||||
return;
|
||||
}
|
||||
self.bottomView.roomModel = self.roomModel;
|
||||
BOOL hasPK = NO;
|
||||
if ((self.roomModel.room_info.type_id.intValue == 1 || self.roomModel.room_info.type_id.intValue == 3 || self.roomModel.room_info.type_id.intValue == 4) && self.roomModel.room_info.label_id.intValue == 1) {
|
||||
if ((self.roomModel.room_info.type_id.intValue == 1 || self.roomModel.room_info.type_id.intValue == 3 || self.roomModel.room_info.type_id.intValue == 4 || self.roomModel.room_info.type_id.intValue == 8) && self.roomModel.room_info.label_id.intValue == 1) {
|
||||
hasPK = YES;
|
||||
}
|
||||
BOOL hasSong = YES;
|
||||
if (self.roomModel.room_info.type_id.intValue == 2){
|
||||
hasSong = NO;
|
||||
BOOL hasSong = NO;
|
||||
if (self.roomModel.room_info.type_id.intValue == 1 || self.roomModel.room_info.type_id.intValue == 3 || self.roomModel.room_info.type_id.intValue == 4 || self.roomModel.room_info.type_id.intValue == 8){
|
||||
hasSong = YES;
|
||||
}
|
||||
/// 暂时不要pk
|
||||
hasPK = NO;
|
||||
/// 暂时不要ktv
|
||||
hasSong = NO;
|
||||
/// 普通麦位
|
||||
if (self.seatContentView.myPitNumber <= 0) {
|
||||
self.bottomView.status = 1;
|
||||
@@ -637,7 +691,7 @@ QXRoomUserInfoViewDelegate
|
||||
}
|
||||
// 演唱者歌曲播放回调
|
||||
-(void)rtcEngineSongProgress:(NSUInteger)progress{
|
||||
if ((self.roomModel.room_info.type_id.intValue == 1 || self.roomModel.room_info.type_id.intValue == 3 || self.roomModel.room_info.type_id.intValue == 4) && self.roomModel.room_info.label_id.intValue == 2) {
|
||||
if ((self.roomModel.room_info.type_id.intValue == 1 || self.roomModel.room_info.type_id.intValue == 3 || self.roomModel.room_info.type_id.intValue == 4 || self.roomModel.room_info.type_id.intValue == 8) && self.roomModel.room_info.label_id.intValue == 2) {
|
||||
self.seatContentView.progress = progress;
|
||||
}else{
|
||||
self.musicView.progress = progress;
|
||||
@@ -745,6 +799,18 @@ QXRoomUserInfoViewDelegate
|
||||
}
|
||||
|
||||
}
|
||||
-(void)roomSeatExchangedWithFromPitNumber:(NSInteger)fromPitNumber toPitNumber:(NSInteger)toPitNumber userInfo:(QXUserHomeModel*)userInfo{
|
||||
[self.seatContentView roomSeatExchangedWithFromPitNumber:fromPitNumber toPitNumber:toPitNumber userInfo:userInfo];
|
||||
if ([userInfo.user_id isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
|
||||
if (toPitNumber == 9) {
|
||||
self.soundBtn.hidden = NO;
|
||||
self.titleView.isCompere = YES;
|
||||
}else{
|
||||
self.soundBtn.hidden = YES;
|
||||
self.titleView.isCompere = NO;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 踢出房间
|
||||
-(void)userDidTakeOffWithUserInfo:(QXUserHomeModel *)userInfo{
|
||||
if ([userInfo.user_id isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
|
||||
@@ -775,10 +841,16 @@ QXRoomUserInfoViewDelegate
|
||||
-(void)roomClearCharm{
|
||||
[self.seatContentView clearCharm];
|
||||
}
|
||||
-(void)roomClearUserCharmWithUserId:(NSString *)userId{
|
||||
[self.seatContentView roomClearUserCharmWithUserId:userId];
|
||||
}
|
||||
/// 收到礼物设置魅力
|
||||
-(void)didRecieveGiftWithWithUserInfo:(QXUserHomeModel *)userInfo{
|
||||
[self.seatContentView setSeatCharmWithUser:userInfo];
|
||||
}
|
||||
-(void)didRecieveGiftWithWithUserInfos:(NSArray<QXUserHomeModel *> *)userInfos{
|
||||
[self.seatContentView setSeatCharmWithUsers:userInfos];
|
||||
}
|
||||
/// 拍卖者上麦
|
||||
-(void)auctionUpSeatWithUserInfo:(QXUserHomeModel *)userInfo isUpSeat:(BOOL)isUpSeat{
|
||||
[self.seatContentView didAuctiontUpDownSeatWithUser:userInfo isUpSeat:isUpSeat];
|
||||
@@ -1062,6 +1134,7 @@ QXRoomUserInfoViewDelegate
|
||||
-(void)recieveHeadline:(QXHeadLineModel *)headline{
|
||||
if (_headlineView) {
|
||||
self.headlineView.model = headline;
|
||||
[self.view addSubview:self.headlineView];
|
||||
}else{
|
||||
self.headlineView.model = headline;
|
||||
[self.view addSubview:self.headlineView];
|
||||
@@ -1080,7 +1153,7 @@ QXRoomUserInfoViewDelegate
|
||||
case QXRoomBottomViewEventTypeMuteAudio:{
|
||||
if (!isSelected) {
|
||||
/// 静音时麦圈停止
|
||||
if ((self.roomModel.room_info.type_id.intValue == 1 || self.roomModel.room_info.type_id.intValue == 3 || self.roomModel.room_info.type_id.intValue == 4) && self.roomModel.room_info.label_id.intValue == 1) {
|
||||
if ((self.roomModel.room_info.type_id.intValue == 1 || self.roomModel.room_info.type_id.intValue == 3 || self.roomModel.room_info.type_id.intValue == 4 || self.roomModel.room_info.type_id.intValue == 8) && self.roomModel.room_info.label_id.intValue == 1) {
|
||||
// QXRoomSeatContentView *seatContentView = self.seatContentView.normalSeatView.mySeatView;
|
||||
// if (seatContentView.isSeatSpeaking) {
|
||||
// [seatContentView stopAudioAnimation];
|
||||
@@ -1112,46 +1185,6 @@ QXRoomUserInfoViewDelegate
|
||||
QXBaseNavigationController *na = [[QXBaseNavigationController alloc] initWithRootViewController:vc];
|
||||
na.modalPresentationStyle = UIModalPresentationFormSheet;
|
||||
[self presentViewController:na animated:YES completion:nil];
|
||||
// vc.isFromRoom = YES;
|
||||
// // 设置初始 frame (在屏幕下方)
|
||||
// CGRect finalFrame = CGRectMake(0, SCREEN_HEIGHT- ScaleWidth(429),
|
||||
// self.view.bounds.size.width,
|
||||
// ScaleWidth(429));
|
||||
// CGRect initialFrame = CGRectOffset(finalFrame, 0, finalFrame.size.height);
|
||||
// vc.view.frame = initialFrame;
|
||||
//
|
||||
// // 添加圆角
|
||||
// vc.view.layer.cornerRadius = 10;
|
||||
// vc.view.layer.maskedCorners = kCALayerMinXMinYCorner | kCALayerMaxXMinYCorner;
|
||||
// vc.view.clipsToBounds = YES;
|
||||
//
|
||||
// // 添加阴影
|
||||
// vc.view.layer.shadowColor = [UIColor blackColor].CGColor;
|
||||
// vc.view.layer.shadowOffset = CGSizeMake(0, -5);
|
||||
// vc.view.layer.shadowOpacity = 0.3;
|
||||
// vc.view.layer.shadowRadius = 10;
|
||||
//
|
||||
// // 添加为子视图控制器
|
||||
// [self addChildViewController:vc];
|
||||
// [self.view addSubview:vc.view];
|
||||
// [vc didMoveToParentViewController:self];
|
||||
//
|
||||
// // 创建半透明背景
|
||||
// UIView *dimmingView = [[UIView alloc] initWithFrame:self.view.bounds];
|
||||
// dimmingView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5];
|
||||
// dimmingView.alpha = 0;
|
||||
// dimmingView.tag = 212;
|
||||
// [self.view insertSubview:dimmingView belowSubview:vc.view];
|
||||
//
|
||||
// // 添加点击手势
|
||||
// UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismissHalfScreenView)];
|
||||
// [dimmingView addGestureRecognizer:tap];
|
||||
//
|
||||
// // 执行动画
|
||||
// [UIView animateWithDuration:0.3 animations:^{
|
||||
// vc.view.frame = finalFrame;
|
||||
// dimmingView.alpha = 1;
|
||||
// }];
|
||||
}
|
||||
break;
|
||||
case QXRoomBottomViewEventTypePK:{
|
||||
@@ -1161,7 +1194,7 @@ QXRoomUserInfoViewDelegate
|
||||
|
||||
break;
|
||||
case QXRoomBottomViewEventTypeMusic:{
|
||||
if ((self.roomModel.room_info.type_id.intValue == 1 || self.roomModel.room_info.type_id.intValue == 3 || self.roomModel.room_info.type_id.intValue == 4) && self.roomModel.room_info.label_id.intValue == 1){
|
||||
if ((self.roomModel.room_info.type_id.intValue == 1 || self.roomModel.room_info.type_id.intValue == 3 || self.roomModel.room_info.type_id.intValue == 4 || self.roomModel.room_info.type_id.intValue == 8) && self.roomModel.room_info.label_id.intValue == 1){
|
||||
MJWeakSelf
|
||||
QXAlertView *al = [[QXAlertView alloc] initWithFrame:CGRectMake(0, 0, ScaleWidth(300), ScaleWidth(175))];
|
||||
al.type = QXAlertViewTypeApplySong;
|
||||
@@ -1195,14 +1228,17 @@ QXRoomUserInfoViewDelegate
|
||||
if (self.roomModel.room_info.pit_list.count == 10) {
|
||||
QXRoomPitModel *md = self.roomModel.room_info.pit_list[8];
|
||||
if (md.user_id.longValue > 0 && ![QXGlobal.shareGlobal.loginModel.user_id isEqualToString:md.user_id]) {
|
||||
md.isSelected = NO;
|
||||
[pitArr addObject:md];
|
||||
QXRoomPitModel *lastMd = self.roomModel.room_info.pit_list[9];
|
||||
if (lastMd.user_id.longValue > 0) {
|
||||
if (lastMd.user_id.longValue > 0 && ![QXGlobal.shareGlobal.loginModel.user_id isEqualToString:lastMd.user_id]) {
|
||||
lastMd.isSelected = NO;
|
||||
[pitArr addObject:lastMd];
|
||||
}
|
||||
}else{
|
||||
QXRoomPitModel *lastMd = self.roomModel.room_info.pit_list[9];
|
||||
if (lastMd.user_id.longValue > 0) {
|
||||
if (lastMd.user_id.longValue > 0 && ![QXGlobal.shareGlobal.loginModel.user_id isEqualToString:lastMd.user_id]) {
|
||||
lastMd.isSelected = NO;
|
||||
[pitArr addObject:lastMd];
|
||||
}
|
||||
}
|
||||
@@ -1225,17 +1261,27 @@ QXRoomUserInfoViewDelegate
|
||||
for (int i = 0; i < self.roomModel.room_info.pit_list.count;i++) {
|
||||
QXRoomPitModel *md = self.roomModel.room_info.pit_list[i];
|
||||
md.isSelected = NO;
|
||||
if (md.user_id.longValue > 0 && ![md.user_id isEqualToString:[QXGlobal shareGlobal].loginModel.user_id]) {
|
||||
[pitArr addObject:md];
|
||||
if ([self.roomModel.room_info.type_id isEqualToString:@"2"]) {
|
||||
/// 拍卖房主持位和拍卖为可能为同一个人
|
||||
if ([md.user_id isEqualToString:self.roomModel.room_auction.auction_user.user_id]) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (md.pit_number.intValue == 9) {
|
||||
compereModel = md;
|
||||
if (md.user_id.longValue > 0 && ![md.user_id isEqualToString:[QXGlobal shareGlobal].loginModel.user_id]) {
|
||||
[pitArr insertObject:md atIndex:0];
|
||||
}
|
||||
continue;
|
||||
}else if (md.pit_number.intValue == 10) {
|
||||
guestModel = md;
|
||||
continue;
|
||||
}
|
||||
if (md.user_id.longValue > 0 && ![md.user_id isEqualToString:[QXGlobal shareGlobal].loginModel.user_id]) {
|
||||
[pitArr addObject:md];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// k歌麦位
|
||||
@@ -1248,6 +1294,7 @@ QXRoomUserInfoViewDelegate
|
||||
md.user_id = self.roomModel.song_user_info.user_id;
|
||||
md.avatar = self.roomModel.song_user_info.avatar;
|
||||
md.pit_number = @"9999";
|
||||
md.isSelected = NO;
|
||||
[pitArr addObject:md];
|
||||
}
|
||||
}
|
||||
@@ -1257,6 +1304,7 @@ QXRoomUserInfoViewDelegate
|
||||
continue;
|
||||
}
|
||||
if (md.user_id.longValue > 0 && ![QXGlobal.shareGlobal.loginModel.user_id isEqualToString:md.user_id]) {
|
||||
md.isSelected = NO;
|
||||
[pitArr addObject:md];
|
||||
}
|
||||
}
|
||||
@@ -1269,6 +1317,7 @@ QXRoomUserInfoViewDelegate
|
||||
md.user_id = self.roomModel.room_auction.auction_user.user_id;
|
||||
md.avatar = self.roomModel.room_auction.auction_user.avatar;
|
||||
md.pit_number = @"9999";
|
||||
md.isSelected = NO;
|
||||
[pitArr addObject:md];
|
||||
}
|
||||
if (self.roomModel.room_auction.auction_list.count > 0) {
|
||||
@@ -1277,6 +1326,7 @@ QXRoomUserInfoViewDelegate
|
||||
continue;
|
||||
}
|
||||
if (md.user_id.longValue > 0 && ![QXGlobal.shareGlobal.loginModel.user_id isEqualToString:md.user_id]) {
|
||||
md.isSelected = NO;
|
||||
[pitArr addObject:md];
|
||||
}
|
||||
}
|
||||
@@ -1321,20 +1371,15 @@ QXRoomUserInfoViewDelegate
|
||||
break;
|
||||
}
|
||||
}
|
||||
- (void)dismissHalfScreenView {
|
||||
UIViewController *halfScreenVC = self.childViewControllers.lastObject;
|
||||
UIView *dimmingView = [self.view viewWithTag:212];
|
||||
|
||||
[UIView animateWithDuration:0.3 animations:^{
|
||||
halfScreenVC.view.frame = CGRectOffset(halfScreenVC.view.frame, 0, halfScreenVC.view.frame.size.height);
|
||||
dimmingView.alpha = 0;
|
||||
} completion:^(BOOL finished) {
|
||||
[halfScreenVC willMoveToParentViewController:nil];
|
||||
[halfScreenVC.view removeFromSuperview];
|
||||
[halfScreenVC removeFromParentViewController];
|
||||
[dimmingView removeFromSuperview];
|
||||
}];
|
||||
-(void)didSendMessage:(NSString *)message redpacketModel:(nonnull QXRedPacketModel *)redpacketModel{
|
||||
if (redpacketModel) {
|
||||
// self.redbagDrawView.type = QXRedBagDrawTypeOpen;
|
||||
self.redbagDrawView.isFromToComment = YES;
|
||||
self.redbagDrawView.redpacketModel = redpacketModel;
|
||||
[self.redbagDrawView showInView:self.view];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - 麦位点击用户信息
|
||||
-(void)didClickUserHeaderWithPitModel:(QXRoomPitModel *)pitModel userModel:(id)userModel isPkRoom:(BOOL)isPkRoom pkRoomId:(NSString *)pkRoomId isNoTakeOff:(BOOL)isNoTakeOff{
|
||||
if (isPkRoom) {
|
||||
@@ -1448,7 +1493,12 @@ QXRoomUserInfoViewDelegate
|
||||
[self.navigationController pushViewController:reportVC animated:YES];
|
||||
}
|
||||
break;
|
||||
|
||||
case QXRoomSettingTypeSendRedBag:{
|
||||
QXRedBagSendView *redbagView = [[QXRedBagSendView alloc] init];
|
||||
redbagView.room_id = self.roomId;
|
||||
[redbagView showInView:self.view];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -1597,14 +1647,69 @@ QXRoomUserInfoViewDelegate
|
||||
_sendGiftView.roomId = self.roomId;
|
||||
// [_sendGiftView reloadData];
|
||||
MJWeakSelf
|
||||
_sendGiftView.roomSendSuccessBlock = ^(BOOL isAuction, QXGiftModel * _Nonnull giftModel, NSString * _Nonnull userId, NSString * _Nonnull auctionId) {
|
||||
if (self->_continuousView == nil) {
|
||||
_sendGiftView.roomSendSuccessBlock = ^(QXSendGiftViewType sendType, QXGiftModel * _Nonnull giftModel, NSString * _Nonnull giftCount, NSString * _Nonnull userId, NSString * _Nonnull optionId) {
|
||||
// if (self->_continuousView == nil) {
|
||||
[weakSelf.view addSubview:weakSelf.continuousView];
|
||||
}
|
||||
// }
|
||||
weakSelf.continuousView.giftModel = giftModel;
|
||||
weakSelf.continuousView.isAuction = isAuction;
|
||||
weakSelf.continuousView.sendType = sendType;
|
||||
weakSelf.continuousView.userId = userId;
|
||||
weakSelf.continuousView.auctionId = auctionId;
|
||||
weakSelf.continuousView.giftCount = giftCount;
|
||||
switch (sendType) {
|
||||
case QXSendGiftViewTypeFriend:{
|
||||
weakSelf.continuousView.heartId = optionId;
|
||||
weakSelf.continuousView.auctionId = @"";
|
||||
}
|
||||
break;
|
||||
case QXSendGiftViewTypeAuction:{
|
||||
weakSelf.continuousView.auctionId = optionId;
|
||||
weakSelf.continuousView.heartId = @"";
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
};
|
||||
_sendGiftView.jumpActivityGiftBlock = ^(QXGiftModel * _Nonnull gift, NSString * _Nonnull userIds) {
|
||||
if (gift.gift_bag.intValue == 10) {
|
||||
weakSelf.skyView.giftModel = gift;
|
||||
weakSelf.skyView.roomId = weakSelf.roomId;
|
||||
weakSelf.skyView.userIds = userIds;
|
||||
weakSelf.skyView.heartId = weakSelf.sendGiftView.heartId;
|
||||
weakSelf.skyView.auctionId = weakSelf.sendGiftView.auctionId;
|
||||
if (weakSelf.sendGiftView.type == QXSendGiftViewTypeAuction) {
|
||||
weakSelf.skyView.heartId = @"";
|
||||
weakSelf.skyView.auctionId = weakSelf.sendGiftView.auctionId;
|
||||
}
|
||||
[weakSelf.sendGiftView hide];
|
||||
[weakSelf.skyView showInView:weakSelf.view];
|
||||
}else if(gift.gift_bag.intValue == 11) {
|
||||
weakSelf.ageView.giftModel = gift;
|
||||
weakSelf.ageView.roomId = weakSelf.roomId;
|
||||
weakSelf.ageView.userIds = userIds;
|
||||
weakSelf.ageView.heartId = weakSelf.sendGiftView.heartId;
|
||||
weakSelf.ageView.auctionId = weakSelf.sendGiftView.auctionId;
|
||||
if (weakSelf.sendGiftView.type == QXSendGiftViewTypeAuction) {
|
||||
weakSelf.skyView.heartId = @"";
|
||||
weakSelf.skyView.auctionId = weakSelf.sendGiftView.auctionId;
|
||||
}
|
||||
[weakSelf.sendGiftView hide];
|
||||
[weakSelf.ageView showInView:weakSelf.view];
|
||||
}else if(gift.gift_bag.intValue == 12) {
|
||||
weakSelf.timeView.giftModel = gift;
|
||||
weakSelf.timeView.roomId = weakSelf.roomId;
|
||||
weakSelf.timeView.userIds = userIds;
|
||||
weakSelf.timeView.heartId = weakSelf.sendGiftView.heartId;
|
||||
weakSelf.timeView.auctionId = weakSelf.sendGiftView.auctionId;
|
||||
if (weakSelf.sendGiftView.type == QXSendGiftViewTypeAuction) {
|
||||
weakSelf.skyView.heartId = @"";
|
||||
weakSelf.skyView.auctionId = weakSelf.sendGiftView.auctionId;
|
||||
}
|
||||
[weakSelf.sendGiftView hide];
|
||||
[weakSelf.timeView showInView:weakSelf.view];
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
return _sendGiftView;
|
||||
@@ -1727,6 +1832,159 @@ QXRoomUserInfoViewDelegate
|
||||
}
|
||||
return _micTeamView;
|
||||
}
|
||||
//
|
||||
-(QXSkyPraizeView *)skyView{
|
||||
if (!_skyView) {
|
||||
_skyView = [[QXSkyPraizeView alloc] init];
|
||||
MJWeakSelf
|
||||
_skyView.startBlock = ^{
|
||||
[weakSelf.skyView hide];
|
||||
weakSelf.meetView.roomId = weakSelf.roomId;
|
||||
[weakSelf.meetView showInView:weakSelf.view];
|
||||
};
|
||||
}
|
||||
return _skyView;
|
||||
}
|
||||
-(QXAgePraizeView *)ageView{
|
||||
if (!_ageView) {
|
||||
_ageView = [[QXAgePraizeView alloc] init];
|
||||
MJWeakSelf
|
||||
_ageView.startBlock = ^{
|
||||
[weakSelf.ageView hide];
|
||||
weakSelf.meetView.roomId = weakSelf.roomId;
|
||||
[weakSelf.meetView showInView:weakSelf.view];
|
||||
};
|
||||
}
|
||||
return _ageView;
|
||||
}
|
||||
-(QXTimePraizeView *)timeView{
|
||||
if (!_timeView) {
|
||||
_timeView = [[QXTimePraizeView alloc] init];
|
||||
MJWeakSelf
|
||||
_timeView.startBlock = ^{
|
||||
[weakSelf.timeView hide];
|
||||
weakSelf.meetView.roomId = weakSelf.roomId;
|
||||
[weakSelf.meetView showInView:weakSelf.view];
|
||||
};
|
||||
}
|
||||
return _timeView;
|
||||
}
|
||||
-(QXActivityTagView *)acTagView{
|
||||
if (!_acTagView) {
|
||||
_acTagView = [[QXActivityTagView alloc] init];
|
||||
MJWeakSelf
|
||||
_acTagView.startBlock = ^{
|
||||
[weakSelf.skyView hide];
|
||||
weakSelf.meetView.roomId = weakSelf.roomId;
|
||||
[weakSelf.meetView showInView:weakSelf.view];
|
||||
};
|
||||
|
||||
}
|
||||
return _acTagView;
|
||||
}
|
||||
-(QXMeetActivityView *)meetView{
|
||||
if (!_meetView) {
|
||||
_meetView = [[QXMeetActivityView alloc] init];
|
||||
_meetView.roomId = self.roomId;
|
||||
}
|
||||
return _meetView;
|
||||
}
|
||||
-(void)stopHWDMP4{
|
||||
[self.seatContentView stopHWDMP4];
|
||||
}
|
||||
-(void)playHWDMP4{
|
||||
[self.seatContentView playHWDMP4];
|
||||
}
|
||||
-(void)destroyViews{
|
||||
if (_skyView) {
|
||||
[_skyView destroyViews];
|
||||
_skyView = nil;
|
||||
}
|
||||
if (_ageView) {
|
||||
[_ageView destroyViews];
|
||||
_ageView = nil;
|
||||
}
|
||||
if (_timeView) {
|
||||
[_timeView destroyViews];
|
||||
_timeView = nil;
|
||||
}
|
||||
}
|
||||
-(QXAllRoomHourRankTagView *)hourRankIconView{
|
||||
if (!_hourRankIconView) {
|
||||
_hourRankIconView = [[QXAllRoomHourRankTagView alloc] init];
|
||||
MJWeakSelf
|
||||
_hourRankIconView.startBlock = ^{
|
||||
[weakSelf.hourRankView showInView:weakSelf.view];
|
||||
};
|
||||
_hourRankIconView.hidden = YES;
|
||||
}
|
||||
return _hourRankIconView;
|
||||
}
|
||||
|
||||
-(QXAllRoomHourRankView *)hourRankView{
|
||||
if (!_hourRankView) {
|
||||
_hourRankView = [[QXAllRoomHourRankView alloc] init];
|
||||
}
|
||||
return _hourRankView;
|
||||
}
|
||||
-(QXRedBagTagView *)redBagTagView{
|
||||
if (!_redBagTagView) {
|
||||
_redBagTagView = [[QXRedBagTagView alloc] init];
|
||||
_redBagTagView.hidden = YES;
|
||||
MJWeakSelf
|
||||
_redBagTagView.startBlock = ^(BOOL isList) {
|
||||
if (isList) {
|
||||
weakSelf.redbagListView.dataArray = [QXRedPacketManager sharedManager].allRedPackets;
|
||||
[weakSelf.redbagListView showInView:weakSelf.view];
|
||||
}else{
|
||||
QXRedPacketModel *model = [QXRedPacketManager sharedManager].allRedPackets.firstObject;
|
||||
if (model.is_qiang.intValue == 1) {
|
||||
QXRedBagRecordViewController *vc = [[QXRedBagRecordViewController alloc] init];
|
||||
vc.redbagId = model.redpacket_id;
|
||||
[weakSelf.navigationController pushViewController:vc animated:YES];
|
||||
}else{
|
||||
weakSelf.redbagDrawView.isFromToComment = NO;
|
||||
weakSelf.redbagDrawView.isCollectedRoom = weakSelf.roomModel.user_info.is_collect.intValue==1;
|
||||
weakSelf.redbagDrawView.redpacketModel = model;
|
||||
[weakSelf.redbagDrawView showInView:weakSelf.view];
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
return _redBagTagView;
|
||||
}
|
||||
-(QXRedBagDrawView *)redbagDrawView{
|
||||
if (!_redbagDrawView) {
|
||||
_redbagDrawView = [[QXRedBagDrawView alloc] init];
|
||||
_redbagDrawView.room_id = self.roomId;
|
||||
MJWeakSelf
|
||||
_redbagDrawView.toInputPwdBlock = ^(NSString * _Nonnull password, QXRedPacketModel * _Nonnull redpacketModel) {
|
||||
[weakSelf.bottomView inputMessageWithName:password redpacketModel:redpacketModel];
|
||||
};
|
||||
_redbagDrawView.collectRoomBlock = ^{
|
||||
[weakSelf.titleView setRoomCollect:YES];
|
||||
};
|
||||
}
|
||||
return _redbagDrawView;
|
||||
}
|
||||
-(QXRedBagListView *)redbagListView{
|
||||
if (!_redbagListView) {
|
||||
_redbagListView = [[QXRedBagListView alloc] init];
|
||||
MJWeakSelf
|
||||
_redbagListView.didSelectedRedBlock = ^(QXRedPacketModel * _Nonnull model) {
|
||||
if (model.is_qiang.intValue == 1) {
|
||||
QXRedBagRecordViewController *vc = [[QXRedBagRecordViewController alloc] init];
|
||||
vc.redbagId = model.redpacket_id;
|
||||
[weakSelf.navigationController pushViewController:vc animated:YES];
|
||||
}else{
|
||||
weakSelf.redbagDrawView.isFromToComment = NO;
|
||||
weakSelf.redbagDrawView.isCollectedRoom = weakSelf.roomModel.user_info.is_collect.intValue==1;
|
||||
weakSelf.redbagDrawView.redpacketModel = model;
|
||||
[weakSelf.redbagDrawView showInView:weakSelf.view];
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
return _redbagListView;
|
||||
}
|
||||
@end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user