2025-08-08 10:49:36 +08:00
|
|
|
|
//
|
|
|
|
|
|
// QXRoomViewController.m
|
|
|
|
|
|
// QXLive
|
|
|
|
|
|
//
|
|
|
|
|
|
// Created by 启星 on 2025/6/7.
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
#import "QXRoomViewController.h"
|
|
|
|
|
|
#import "QXRoomSongListView.h"
|
|
|
|
|
|
#import "QXSoundListView.h"
|
|
|
|
|
|
#import "QXUpSeatView.h"
|
|
|
|
|
|
#import "QXMineNetwork.h"
|
|
|
|
|
|
#import "QXGiftPlayerManager.h"
|
|
|
|
|
|
#import "QXAgoraEngine.h"
|
|
|
|
|
|
#import "QXRoomSettingView.h"
|
|
|
|
|
|
#import "QXRoomSeatContentView.h"
|
|
|
|
|
|
#import "QXSongListModel.h"
|
|
|
|
|
|
#import "QXAlertView.h"
|
|
|
|
|
|
#import "QXCreateRoomViewController.h"
|
|
|
|
|
|
#import "QXRoomBgSettingView.h"
|
|
|
|
|
|
#import "QXRoomBgMusicView.h"
|
|
|
|
|
|
#import "QXRoomUserInfoView.h"
|
|
|
|
|
|
#import "QXHeadlineView.h"
|
|
|
|
|
|
#import "QXDirectSetScaleView.h"
|
|
|
|
|
|
#import "QXRoomPKSearchView.h"
|
|
|
|
|
|
#import "QXAgoraEngineEx.h"
|
|
|
|
|
|
#import "QXCabinMovieView.h"
|
|
|
|
|
|
#import "QXReportViewController.h"
|
|
|
|
|
|
#import "QXMessageViewController.h"
|
|
|
|
|
|
#import "QXRoomSubsidyViewController.h"
|
2025-10-20 09:43:10 +08:00
|
|
|
|
#import "QXRoomViewController+Friend.h"
|
|
|
|
|
|
#import "QXAllRoomHourRankView.h"
|
|
|
|
|
|
#import "QXRedBagSendView.h"
|
|
|
|
|
|
#import "QXRoomViewController+RedPacket.h"
|
|
|
|
|
|
#import "QXRoomViewController+Activity.h"
|
2025-10-20 20:05:55 +08:00
|
|
|
|
#import "QXRoomViewController+QXGiftDrift.h"
|
2025-10-20 09:43:10 +08:00
|
|
|
|
#import "QXRedBagRecordViewController.h"
|
2025-10-24 10:52:40 +08:00
|
|
|
|
#import "QXRoomEmojiView.h"
|
2025-10-25 19:38:29 +08:00
|
|
|
|
#import "QXGiftDisplayManager.h"
|
2025-10-27 17:05:46 +08:00
|
|
|
|
#import "QXRoomDayTaskTagView.h"
|
|
|
|
|
|
#import "QXTaskViewController.h"
|
2025-08-08 10:49:36 +08:00
|
|
|
|
|
|
|
|
|
|
@interface QXRoomViewController ()<
|
|
|
|
|
|
QXRoomBottomViewDelegate,
|
|
|
|
|
|
QXRoomSettingViewDelegate,
|
|
|
|
|
|
QXAgoraEngineMediaPlayerDelegate,
|
|
|
|
|
|
QXRoomUserInfoViewDelegate
|
|
|
|
|
|
>
|
|
|
|
|
|
@property (nonatomic,strong)UIImageView *roomBgImageView;
|
|
|
|
|
|
@property (nonatomic,strong)UIView *roomBgCoverView;
|
|
|
|
|
|
/// 点唱view
|
|
|
|
|
|
@property (nonatomic,strong)QXRoomSongListView *songListView;
|
|
|
|
|
|
/// 声音特效
|
|
|
|
|
|
@property (nonatomic,strong)QXSoundListView *soundListView;
|
|
|
|
|
|
/// 申请上麦
|
|
|
|
|
|
@property (nonatomic,strong)QXUpSeatView *upSeatView;
|
|
|
|
|
|
|
|
|
|
|
|
@property (nonatomic,strong)UIButton *soundBtn;
|
|
|
|
|
|
|
|
|
|
|
|
@property (nonatomic,strong)UIButton *upSeatBtn;
|
|
|
|
|
|
/// 排麦按钮
|
|
|
|
|
|
@property (nonatomic,strong)QXUpSeatCountView *micTeamView;
|
|
|
|
|
|
|
|
|
|
|
|
/// 礼物特效
|
|
|
|
|
|
@property (nonatomic,strong)UIView *bgEffectView;
|
|
|
|
|
|
/// 设置
|
|
|
|
|
|
@property (nonatomic,strong)QXRoomSettingView *settingView;
|
|
|
|
|
|
/// 房间背景
|
|
|
|
|
|
@property (nonatomic,strong)QXRoomBgSettingView *roomBgSetView;
|
|
|
|
|
|
/// 背景音乐
|
|
|
|
|
|
@property (nonatomic,strong)QXRoomBgMusicView *musicView;
|
|
|
|
|
|
// 查看用户信息
|
|
|
|
|
|
@property (nonatomic,strong)QXRoomUserInfoView *userInfoView;
|
|
|
|
|
|
///头条
|
|
|
|
|
|
@property (nonatomic,strong)QXHeadlineView *headlineView;
|
|
|
|
|
|
/// 发布头条
|
|
|
|
|
|
@property (nonatomic,strong)QXDirectSetScaleView *sendHeadLineView;
|
|
|
|
|
|
/// pk search
|
|
|
|
|
|
@property (nonatomic,strong)QXRoomPKSearchView *pkSearchView;
|
|
|
|
|
|
/// 电影房
|
|
|
|
|
|
@property (nonatomic,strong)QXCabinMovieView *movieView;
|
|
|
|
|
|
/// 连送按钮
|
|
|
|
|
|
@property (nonatomic,strong)QXContinuousGiftView *continuousView;
|
2025-10-20 09:43:10 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@property (nonatomic,strong)QXAllRoomHourRankView *hourRankView;
|
|
|
|
|
|
@property (nonatomic,strong)QXAllRoomHourRankTagView *hourRankIconView;
|
|
|
|
|
|
|
2025-10-24 10:52:40 +08:00
|
|
|
|
@property (nonatomic,strong)QXRoomEmojiView *emojiView;
|
2025-10-27 17:05:46 +08:00
|
|
|
|
@property (nonatomic,strong)QXRoomDayTaskTagView *dayTaskTagView;
|
2025-08-08 10:49:36 +08:00
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
|
|
@implementation QXRoomViewController
|
|
|
|
|
|
|
|
|
|
|
|
- (void)viewDidLoad {
|
|
|
|
|
|
[super viewDidLoad];
|
|
|
|
|
|
// Do any additional setup after loading the view.
|
2025-10-20 09:43:10 +08:00
|
|
|
|
[self initRedpacketManager];
|
2025-10-20 20:05:55 +08:00
|
|
|
|
[self initGiftDriftManager];
|
|
|
|
|
|
[self initActivityObeserver];
|
2025-08-08 10:49:36 +08:00
|
|
|
|
}
|
|
|
|
|
|
-(void)viewWillAppear:(BOOL)animated{
|
|
|
|
|
|
[super viewWillAppear:animated];
|
|
|
|
|
|
[self.navigationController setNavigationBarHidden:YES animated:YES];
|
2025-10-20 09:43:10 +08:00
|
|
|
|
|
2025-08-08 10:49:36 +08:00
|
|
|
|
}
|
|
|
|
|
|
-(void)viewDidAppear:(BOOL)animated{
|
|
|
|
|
|
[super viewDidAppear:animated];
|
|
|
|
|
|
NSMutableArray *marr = [[NSMutableArray alloc]initWithArray:self.navigationController.viewControllers];
|
|
|
|
|
|
// for (UIViewController *vc in marr) {
|
|
|
|
|
|
// if ([vc isKindOfClass:[QXRoomViewController class]]) {
|
|
|
|
|
|
// [marr removeObject:vc];
|
|
|
|
|
|
// break;
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
for (int i = 0; i < marr.count; i++) {
|
|
|
|
|
|
UIViewController *vc = marr[i];
|
|
|
|
|
|
if ([vc isKindOfClass:[QXRoomViewController class]] && (i == marr.count-2)) {
|
|
|
|
|
|
[marr removeObject:vc];
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-10-20 09:43:10 +08:00
|
|
|
|
[self playHWDMP4];
|
|
|
|
|
|
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
|
|
|
|
|
[[QXGiftPlayerManager shareManager] startPlay];
|
2025-10-25 19:38:29 +08:00
|
|
|
|
[[QXGiftDisplayManager sharedManager] becomeFront];
|
2025-10-20 09:43:10 +08:00
|
|
|
|
});
|
2025-08-08 10:49:36 +08:00
|
|
|
|
self.navigationController.viewControllers = marr;
|
2025-08-14 09:40:25 +08:00
|
|
|
|
// self.navigationController.interactivePopGestureRecognizer.enabled = NO;
|
2025-08-08 10:49:36 +08:00
|
|
|
|
}
|
|
|
|
|
|
-(void)viewDidDisappear:(BOOL)animated{
|
|
|
|
|
|
[super viewDidDisappear:animated];
|
2025-10-20 09:43:10 +08:00
|
|
|
|
// [[QXGiftPlayerManager shareManager] stopPlay];
|
2025-08-08 10:49:36 +08:00
|
|
|
|
self.continuousView.hidden = YES;
|
2025-10-20 09:43:10 +08:00
|
|
|
|
[self stopHWDMP4];
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
-(void)viewWillDisappear:(BOOL)animated{
|
|
|
|
|
|
[super viewWillDisappear:animated];
|
|
|
|
|
|
[[QXGiftPlayerManager shareManager] stopPlay];
|
2025-10-25 19:38:29 +08:00
|
|
|
|
[[QXGiftDisplayManager sharedManager] inBackGround];
|
2025-08-08 10:49:36 +08:00
|
|
|
|
}
|
|
|
|
|
|
-(void)initSubViews{
|
|
|
|
|
|
|
|
|
|
|
|
// [self updateBgImage:@"room_background"];
|
2025-10-20 20:05:55 +08:00
|
|
|
|
|
2025-08-08 10:49:36 +08:00
|
|
|
|
self.bgImageHidden = YES;
|
|
|
|
|
|
self.roomBgImageView = [[UIImageView alloc] initWithFrame:self.view.bounds];
|
|
|
|
|
|
// self.roomBgImageView.image = [UIImage imageNamed:@"room_background"];
|
|
|
|
|
|
self.roomBgImageView.contentMode = UIViewContentModeScaleAspectFill;
|
|
|
|
|
|
self.roomBgImageView.clipsToBounds = YES;
|
|
|
|
|
|
[self.view addSubview:self.roomBgImageView];
|
|
|
|
|
|
|
|
|
|
|
|
self.roomBgCoverView = [[UIView alloc] initWithFrame:self.view.bounds];
|
|
|
|
|
|
self.roomBgCoverView.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.2];
|
|
|
|
|
|
[self.view addSubview:self.roomBgCoverView];
|
|
|
|
|
|
|
|
|
|
|
|
self.view.backgroundColor = RGB16(0x333333);
|
|
|
|
|
|
self.titleView = [[QXRoomTitleView alloc] initWithFrame:CGRectMake(0, kSafeAreaTop, SCREEN_WIDTH, ScaleWidth(74))];
|
|
|
|
|
|
self.titleView.roomId = self.roomId;
|
|
|
|
|
|
self.titleView.delegate = self;
|
|
|
|
|
|
[self.view addSubview:self.titleView];
|
|
|
|
|
|
|
|
|
|
|
|
[self.view insertSubview:self.seatContentView belowSubview:self.titleView];
|
|
|
|
|
|
[self.seatContentView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
|
make.left.right.equalTo(self.view);
|
|
|
|
|
|
make.top.mas_equalTo(self.titleView.bottom+20);
|
|
|
|
|
|
make.height.mas_equalTo(ScaleWidth(60+50*2)+51*3+1+0);
|
|
|
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[self.view addSubview:self.bottomView];
|
|
|
|
|
|
[self.bottomView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
|
make.bottom.equalTo(self.view);
|
|
|
|
|
|
make.height.mas_equalTo(36+kSafeAreaBottom);
|
|
|
|
|
|
make.left.right.equalTo(self.view);
|
|
|
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
|
|
[self.view addSubview:self.upSeatBtn];
|
|
|
|
|
|
[self.upSeatBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
|
make.right.mas_equalTo(-16);
|
|
|
|
|
|
make.size.mas_equalTo(CGSizeMake(ScaleWidth(56), ScaleWidth(27)));
|
2025-10-27 17:05:46 +08:00
|
|
|
|
make.bottom.equalTo(self.bottomView.mas_top).offset(-18);
|
2025-08-08 10:49:36 +08:00
|
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
|
|
self.soundBtn.hidden = YES;
|
|
|
|
|
|
[self.view addSubview:self.soundBtn];
|
|
|
|
|
|
[self.soundBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
|
make.centerX.equalTo(self.upSeatBtn);
|
2025-10-27 17:05:46 +08:00
|
|
|
|
make.size.mas_equalTo(CGSizeMake(ScaleWidth(52), ScaleWidth(25)));
|
2025-08-08 10:49:36 +08:00
|
|
|
|
make.bottom.equalTo(self.upSeatBtn.mas_top).offset(-12);
|
|
|
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
|
|
self.micTeamView.hidden = YES;
|
|
|
|
|
|
[self.view addSubview:self.micTeamView];
|
|
|
|
|
|
[self.micTeamView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
|
make.right.equalTo(self.view);
|
|
|
|
|
|
make.size.mas_equalTo(CGSizeMake(ScaleWidth(98), ScaleWidth(43)));
|
|
|
|
|
|
make.bottom.equalTo(self.soundBtn.mas_top).offset(-12);
|
|
|
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[self.view addSubview:self.chatListView];
|
|
|
|
|
|
[self.chatListView mas_makeConstraints:^(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);
|
|
|
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
|
|
[self.sendGiftView reloadData];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (self.isReJoin) {
|
|
|
|
|
|
[self.chatListView insertNoitce];
|
|
|
|
|
|
[self getRoomInfo];
|
|
|
|
|
|
}else{
|
|
|
|
|
|
[self joinRoom];
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-10-20 09:43:10 +08:00
|
|
|
|
[self.view addSubview:self.hourRankIconView];
|
|
|
|
|
|
[self.view addSubview:self.redBagTagView];
|
2025-10-27 17:05:46 +08:00
|
|
|
|
[self.view addSubview:self.dayTaskTagView];
|
2025-08-08 10:49:36 +08:00
|
|
|
|
[self setupEffectView];
|
|
|
|
|
|
|
|
|
|
|
|
// [self.view addSubview:self.headlineView];
|
|
|
|
|
|
}
|
|
|
|
|
|
#pragma mark - 特效
|
|
|
|
|
|
- (void)setupEffectView {
|
|
|
|
|
|
if (!_bgEffectView) {
|
|
|
|
|
|
[self.view insertSubview:self.bgEffectView aboveSubview:self.seatContentView];
|
|
|
|
|
|
CGFloat padding = ScaleWidth(20);
|
|
|
|
|
|
[self.bgEffectView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
|
make.top.bottom.left.right.equalTo(self.view);
|
|
|
|
|
|
}];
|
|
|
|
|
|
QXEffectContentView *fullEffectView = [[QXGiftPlayerManager shareManager] defaultFullEffectView];
|
|
|
|
|
|
[fullEffectView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
|
make.centerX.centerY.equalTo(self.bgEffectView);
|
|
|
|
|
|
make.size.mas_equalTo(CGSizeMake(SCREEN_WIDTH, SCREEN_HEIGHT));
|
|
|
|
|
|
}];
|
|
|
|
|
|
QXEffectContentView *chatEffectView = [[QXGiftPlayerManager shareManager] defaultChatEffectView];
|
|
|
|
|
|
[chatEffectView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
|
// make.top.equalTo(self.seatContentView.mas_bottom).offset(padding);
|
|
|
|
|
|
// make.left.right.equalTo(self.bgEffectView);
|
|
|
|
|
|
make.bottom.mas_equalTo(-padding);
|
|
|
|
|
|
make.centerX.equalTo(self.bgEffectView);
|
|
|
|
|
|
make.size.mas_equalTo(CGSizeMake(SCREEN_WIDTH, SCREEN_HEIGHT));
|
|
|
|
|
|
}];
|
|
|
|
|
|
}
|
|
|
|
|
|
BOOL isClose = [[NSUserDefaults standardUserDefaults] boolForKey:kEffectsCLose];
|
|
|
|
|
|
[[QXGiftPlayerManager shareManager] openOrCloseEffectViewWith:!isClose];
|
|
|
|
|
|
}
|
2025-10-20 09:43:10 +08:00
|
|
|
|
-(void)setRoomModel:(QXRoomModel *)roomModel{
|
|
|
|
|
|
_roomModel = roomModel;
|
|
|
|
|
|
}
|
|
|
|
|
|
-(void)setRoomId:(NSString *)roomId{
|
|
|
|
|
|
_roomId = roomId;
|
2025-08-08 10:49:36 +08:00
|
|
|
|
[self.chatListView insertNoitce];
|
|
|
|
|
|
MJWeakSelf
|
|
|
|
|
|
[QXMineNetwork roomOnlineListWithRoomId:self.roomId page:1 successBlock:^(NSArray<QXRoomUserInfoModel *> * _Nonnull onPitList, NSArray<QXRoomUserInfoModel *> * _Nonnull offPitList) {
|
|
|
|
|
|
NSMutableArray *arr = [NSMutableArray arrayWithArray:onPitList];
|
|
|
|
|
|
[arr addObjectsFromArray:offPitList];
|
|
|
|
|
|
weakSelf.titleView.onlineUsers = arr;
|
|
|
|
|
|
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
|
|
|
|
|
|
|
|
|
|
|
}];
|
2025-10-20 09:43:10 +08:00
|
|
|
|
}
|
|
|
|
|
|
#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];
|
|
|
|
|
|
// });
|
|
|
|
|
|
//
|
|
|
|
|
|
// }];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-08-08 10:49:36 +08:00
|
|
|
|
}
|
|
|
|
|
|
-(void)getUserOnlineStatusWithUserIds:(NSString*)userIds{
|
|
|
|
|
|
[QXMineNetwork roomUserOnlineStatusWithUserIds:userIds roomId:self.roomId successBlock:^(NSArray<QXUserModel *> * _Nonnull list) {
|
|
|
|
|
|
for (QXUserModel *md in list) {
|
|
|
|
|
|
if (md.user_id.longLongValue > 0) {
|
|
|
|
|
|
[[NSNotificationCenter defaultCenter] postNotificationName:noticeRoomUserOnlineStatusDidChanged object:@{@"user_id":md.user_id,@"is_online":[NSNumber numberWithBool:md.is_online]}];
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
|
|
|
|
|
|
|
|
|
|
|
}];
|
|
|
|
|
|
}
|
|
|
|
|
|
-(void)getRoomInfo{
|
|
|
|
|
|
MJWeakSelf
|
|
|
|
|
|
[QXMineNetwork getRoomInfoWithRoomId:self.roomId successBlock:^(QXRoomModel * _Nonnull roomModel) {
|
|
|
|
|
|
weakSelf.roomModel = roomModel;
|
|
|
|
|
|
[weakSelf resetSubviews];
|
|
|
|
|
|
[weakSelf configRoomDataIsJoin:NO];
|
|
|
|
|
|
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
|
|
|
|
|
|
|
|
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
|
|
[QXMineNetwork roomOnlineListWithRoomId:self.roomId page:1 successBlock:^(NSArray<QXRoomUserInfoModel *> * _Nonnull onPitList, NSArray<QXRoomUserInfoModel *> * _Nonnull offPitList) {
|
|
|
|
|
|
NSMutableArray *arr = [NSMutableArray arrayWithArray:onPitList];
|
|
|
|
|
|
[arr addObjectsFromArray:offPitList];
|
|
|
|
|
|
weakSelf.titleView.onlineUsers = arr;
|
|
|
|
|
|
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
|
|
|
|
|
|
|
|
|
|
|
}];
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
-(void)resetSubviews{
|
|
|
|
|
|
if (self.roomModel.room_info.type_id.intValue != 6) {
|
|
|
|
|
|
[self.roomBgImageView sd_setImageWithURL:[NSURL URLWithString:self.roomModel.room_info.room_background]];
|
|
|
|
|
|
}else{
|
|
|
|
|
|
self.roomBgImageView.image = [UIImage imageNamed:@"cp_room_bg"];
|
|
|
|
|
|
}
|
2025-10-20 09:43:10 +08:00
|
|
|
|
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) {
|
2025-08-08 10:49:36 +08:00
|
|
|
|
// 点唱房
|
|
|
|
|
|
if (self.roomModel.room_info.label_id.intValue == 1) {
|
|
|
|
|
|
|
|
|
|
|
|
if (self.roomModel.pk_info.pk_room_id.intValue>0) {
|
|
|
|
|
|
/// 在pk状态
|
|
|
|
|
|
[self.seatContentView setType:(QXRoomSeatViewTypePK)];
|
|
|
|
|
|
[self.seatContentView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
|
make.left.right.equalTo(self.view);
|
|
|
|
|
|
make.top.mas_equalTo(self.titleView.bottom+12);
|
|
|
|
|
|
make.height.mas_equalTo(ScaleWidth(330));
|
|
|
|
|
|
}];
|
|
|
|
|
|
[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));
|
|
|
|
|
|
}];
|
|
|
|
|
|
}else{
|
|
|
|
|
|
// 聊天
|
|
|
|
|
|
[self.seatContentView setType:(QXRoomSeatViewTypeNormal)];
|
|
|
|
|
|
[self.seatContentView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
|
make.left.right.equalTo(self.view);
|
|
|
|
|
|
make.top.mas_equalTo(self.titleView.bottom+20);
|
|
|
|
|
|
make.height.mas_equalTo(ScaleWidth(60+50*2)+51*3+1+0);
|
|
|
|
|
|
}];
|
|
|
|
|
|
[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));
|
|
|
|
|
|
}];
|
|
|
|
|
|
}
|
|
|
|
|
|
}else{
|
|
|
|
|
|
if (_musicView) {
|
|
|
|
|
|
[[QXAgoraEngine sharedEngine] ktv_EndSing];
|
|
|
|
|
|
[_musicView removeFromSuperview];
|
|
|
|
|
|
_musicView = nil;
|
|
|
|
|
|
}
|
|
|
|
|
|
[self.seatContentView setType:(QXRoomSeatViewTypeSing)];
|
|
|
|
|
|
// k歌
|
|
|
|
|
|
[self.seatContentView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
|
make.left.right.equalTo(self.view);
|
|
|
|
|
|
make.top.mas_equalTo(kSafeAreaTop+44);
|
|
|
|
|
|
make.height.mas_equalTo(ScaleWidth(277)+44+ScaleWidth(50-10)+51);
|
|
|
|
|
|
}];
|
|
|
|
|
|
[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).offset(-(ScaleWidth(50-10)+51));
|
|
|
|
|
|
// make.right.equalTo(self.soundBtn.mas_left).offset(-16);
|
|
|
|
|
|
make.width.mas_equalTo(ScaleWidth(280));
|
|
|
|
|
|
}];
|
|
|
|
|
|
}
|
|
|
|
|
|
}else if (self.roomModel.room_info.type_id.intValue == 2) {
|
|
|
|
|
|
[self.seatContentView setType:(QXRoomSeatViewTypeAuction)];
|
|
|
|
|
|
[self.seatContentView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
|
make.left.right.equalTo(self.view);
|
|
|
|
|
|
make.top.mas_equalTo(kSafeAreaTop+ScaleWidth(40)+12);
|
|
|
|
|
|
make.height.mas_equalTo(ScaleWidth(328));
|
|
|
|
|
|
}];
|
|
|
|
|
|
[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));
|
|
|
|
|
|
}];
|
|
|
|
|
|
}else if (self.roomModel.room_info.type_id.intValue == 6) {
|
|
|
|
|
|
//小黑屋
|
|
|
|
|
|
[self.seatContentView setType:(QXRoomSeatViewTypeCabin)];
|
|
|
|
|
|
self.titleView.hidden = YES;
|
|
|
|
|
|
self.upSeatBtn.hidden = YES;
|
|
|
|
|
|
self.bottomView.isCabinRoom = YES;
|
|
|
|
|
|
[self.seatContentView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
|
make.left.right.equalTo(self.view);
|
|
|
|
|
|
make.top.mas_equalTo(kSafeAreaTop);
|
|
|
|
|
|
make.height.mas_equalTo(ScaleWidth(380));
|
|
|
|
|
|
}];
|
|
|
|
|
|
[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.width.mas_equalTo(ScaleWidth(280));
|
|
|
|
|
|
}];
|
|
|
|
|
|
[self.view insertSubview:self.movieView atIndex:0];
|
2025-10-20 09:43:10 +08:00
|
|
|
|
}else if (self.roomModel.room_info.type_id.intValue == 7) {
|
|
|
|
|
|
/// 交友房
|
|
|
|
|
|
[self resetFriendViews];
|
2025-08-08 10:49:36 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (self.roomModel.room_info.last_pk_room_id.isExist) {
|
|
|
|
|
|
if (![self.roomModel.room_info.last_pk_room_id isEqualToString:self.roomModel.pk_info.pk_room_id]) {
|
|
|
|
|
|
[[QXAgoraEngineEx sharedEngine] quitEXChannelWithLastPkRoomId:self.roomModel.room_info.last_pk_room_id];
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-10-20 09:43:10 +08:00
|
|
|
|
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;
|
|
|
|
|
|
}
|
2025-08-08 10:49:36 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-(void)configRoomDataIsJoin:(BOOL)isJoin{
|
|
|
|
|
|
self.seatContentView.hidden = NO;
|
|
|
|
|
|
self.bottomView.hidden = NO;
|
|
|
|
|
|
NSMutableArray *userIds = [NSMutableArray array];
|
|
|
|
|
|
for (QXRoomPitModel *md in self.roomModel.room_info.pit_list) {
|
|
|
|
|
|
if (md.user_id.longLongValue > 0) {
|
|
|
|
|
|
[userIds addObject:md.user_id];
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
[self getUserOnlineStatusWithUserIds:[userIds componentsJoinedByString:@","]];
|
|
|
|
|
|
|
|
|
|
|
|
self.micTeamView.countLabel.text = self.roomModel.room_info.queue_number;
|
|
|
|
|
|
self.titleView.roomModel = self.roomModel;
|
2025-10-20 09:43:10 +08:00
|
|
|
|
if (self.roomModel.room_info.type_id.intValue == 6) {
|
|
|
|
|
|
self.bottomView.isCabinRoom = YES;
|
2025-08-08 10:49:36 +08:00
|
|
|
|
[[QXAgoraEngine sharedEngine] setClientRoleBroadcaster:YES];
|
|
|
|
|
|
}else{
|
2025-10-20 09:43:10 +08:00
|
|
|
|
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];
|
|
|
|
|
|
}
|
2025-08-08 10:49:36 +08:00
|
|
|
|
}
|
|
|
|
|
|
self.seatContentView.roomModel = self.roomModel;
|
2025-10-20 09:43:10 +08:00
|
|
|
|
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){
|
2025-08-08 10:49:36 +08:00
|
|
|
|
/// k歌房没有背景音乐
|
|
|
|
|
|
[QXAgoraEngine sharedEngine].isPlayBgMusic = NO;
|
|
|
|
|
|
}else{
|
|
|
|
|
|
[QXAgoraEngine sharedEngine].isPlayBgMusic = YES;
|
|
|
|
|
|
}
|
|
|
|
|
|
//音效按钮
|
|
|
|
|
|
if (self.seatContentView.myPitNumber == 9) {
|
|
|
|
|
|
self.soundBtn.hidden = NO;
|
|
|
|
|
|
self.titleView.isCompere = YES;
|
|
|
|
|
|
}else{
|
|
|
|
|
|
self.soundBtn.hidden = YES;
|
|
|
|
|
|
self.titleView.isCompere = NO;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (self.roomModel.room_info.head_line != nil) {
|
|
|
|
|
|
if (_headlineView == nil) {
|
|
|
|
|
|
self.headlineView.model = self.roomModel.room_info.head_line;
|
|
|
|
|
|
[self.view addSubview:self.headlineView];
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
[self configBottomTools];
|
|
|
|
|
|
|
|
|
|
|
|
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:^{
|
2025-10-20 09:43:10 +08:00
|
|
|
|
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) {
|
2025-08-08 10:49:36 +08:00
|
|
|
|
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];
|
|
|
|
|
|
weakSelf.seatContentView.songInfo = weakSelf.roomModel.song_user_info;
|
|
|
|
|
|
weakSelf.seatContentView.nextInfo = weakSelf.roomModel.nextInfo;
|
|
|
|
|
|
/// 临时上麦
|
|
|
|
|
|
if (weakSelf.seatContentView.myPitNumber <= 0) {
|
|
|
|
|
|
/// 我不在麦上 临时拉起权限
|
|
|
|
|
|
weakSelf.bottomView.status = 2;
|
|
|
|
|
|
[weakSelf.bottomView setMuteAudioStatus:1];
|
|
|
|
|
|
}
|
|
|
|
|
|
}else{
|
|
|
|
|
|
weakSelf.seatContentView.songInfo = weakSelf.roomModel.song_user_info;
|
|
|
|
|
|
weakSelf.seatContentView.nextInfo = weakSelf.roomModel.nextInfo;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (self.roomModel.room_info.type_id.intValue == 6) {
|
|
|
|
|
|
NSInteger uid = 0;
|
|
|
|
|
|
if (![weakSelf.roomModel.cp_user.user_id isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
|
|
|
|
|
|
uid = weakSelf.roomModel.cp_user.user_id.longLongValue;
|
|
|
|
|
|
}else{
|
|
|
|
|
|
uid = weakSelf.roomModel.cp_user.user_id1.longLongValue;
|
|
|
|
|
|
}
|
|
|
|
|
|
//// if (_movieView) {
|
|
|
|
|
|
//// [_movieView removeFromSuperview];
|
|
|
|
|
|
//// _movieView = nil;
|
|
|
|
|
|
//// }
|
|
|
|
|
|
[[QXAgoraEngine sharedEngine] startPreViewWithUid:uid view:self.movieView.videoView];
|
2025-10-20 09:43:10 +08:00
|
|
|
|
[[QXAgoraEngine sharedEngine] setClientRoleBroadcaster:YES];
|
|
|
|
|
|
[[QXAgoraEngine sharedEngine] enableAudio:NO];
|
|
|
|
|
|
[[QXAgoraEngine sharedEngine] muteLocalAudioStream:NO];
|
2025-08-08 10:49:36 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
|
|
}else{
|
2025-10-20 09:43:10 +08:00
|
|
|
|
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) {
|
2025-08-08 10:49:36 +08:00
|
|
|
|
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;
|
|
|
|
|
|
}else{
|
|
|
|
|
|
self.seatContentView.songInfo = self.roomModel.song_user_info;
|
|
|
|
|
|
self.seatContentView.nextInfo = self.roomModel.nextInfo;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
[QXRoomMessageManager shared].delegate = self;
|
|
|
|
|
|
[QXAgoraEngine sharedEngine].delegate = self;
|
2025-10-20 09:43:10 +08:00
|
|
|
|
|
2025-08-08 10:49:36 +08:00
|
|
|
|
|
2025-10-20 09:43:10 +08:00
|
|
|
|
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) {
|
2025-08-08 10:49:36 +08:00
|
|
|
|
// 点唱房
|
|
|
|
|
|
if (self.roomModel.room_info.label_id.intValue == 1) {
|
|
|
|
|
|
if (self.roomModel.pk_info.pk_id.intValue>0) {
|
|
|
|
|
|
MJWeakSelf
|
|
|
|
|
|
[QXMineNetwork getRoomInfoWithRoomId:self.roomModel.pk_info.pk_room_id successBlock:^(QXRoomModel * _Nonnull roomModel) {
|
|
|
|
|
|
weakSelf.seatContentView.pkRoomModel = roomModel;
|
|
|
|
|
|
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
|
|
|
|
|
|
|
|
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
|
|
if (self.seatContentView.myPitNumber == 9) {
|
|
|
|
|
|
[QXMineNetwork updateShengWangTokenWithRoomId:weakSelf.roomModel.pk_info.pk_room_id successBlock:^(NSString * _Nonnull token) {
|
|
|
|
|
|
[[QXAgoraEngineEx sharedEngine] joinExWithAgora_token:token channel:weakSelf.roomModel.pk_info.pk_room_id];
|
|
|
|
|
|
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
|
|
|
|
|
|
|
|
|
|
|
}];
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (self.roomModel.room_info.type_id.intValue == 2) {
|
|
|
|
|
|
[self auctionListDidChanged:self.roomModel.room_auction.auction_list];
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
-(void)configMicType:(BOOL)isOnSeat{
|
|
|
|
|
|
if (self.roomModel.room_info.room_up_pit_type.intValue == 1 && self.roomModel.room_info.type_id.intValue != 6) {
|
|
|
|
|
|
self.micTeamView.hidden = NO;
|
|
|
|
|
|
}else{
|
|
|
|
|
|
self.micTeamView.hidden = YES;
|
|
|
|
|
|
}
|
|
|
|
|
|
self.upSeatBtn.selected = isOnSeat;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
-(void)configBottomTools{
|
2025-10-20 09:43:10 +08:00
|
|
|
|
if (self.roomModel.room_info.type_id.intValue == 6) {
|
|
|
|
|
|
self.bottomView.isCabinRoom = YES;
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2025-08-08 10:49:36 +08:00
|
|
|
|
self.bottomView.roomModel = self.roomModel;
|
|
|
|
|
|
BOOL hasPK = NO;
|
2025-10-20 09:43:10 +08:00
|
|
|
|
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) {
|
2025-08-08 10:49:36 +08:00
|
|
|
|
hasPK = YES;
|
|
|
|
|
|
}
|
2025-10-20 09:43:10 +08:00
|
|
|
|
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;
|
2025-08-08 10:49:36 +08:00
|
|
|
|
}
|
2025-10-20 09:43:10 +08:00
|
|
|
|
/// 暂时不要pk
|
|
|
|
|
|
hasPK = NO;
|
2025-10-25 19:38:29 +08:00
|
|
|
|
// /// 暂时不要ktv
|
|
|
|
|
|
// hasSong = NO;
|
2025-08-08 10:49:36 +08:00
|
|
|
|
/// 普通麦位
|
|
|
|
|
|
if (self.seatContentView.myPitNumber <= 0) {
|
|
|
|
|
|
self.bottomView.status = 1;
|
|
|
|
|
|
[self configMicType:NO];
|
|
|
|
|
|
[self.bottomView setRoleType:(QXRoomRoleTypeAudience) hasPK:hasPK hasSong:hasSong];
|
|
|
|
|
|
}else{
|
|
|
|
|
|
if (self.seatContentView.myPitNumber == 9) {
|
|
|
|
|
|
[self.bottomView setRoleType:(QXRoomRoleTypeCompere) hasPK:hasPK hasSong:hasSong];
|
|
|
|
|
|
}else{
|
|
|
|
|
|
[self.bottomView setRoleType:(QXRoomRoleTypeAudience) hasPK:hasPK hasSong:hasSong];
|
|
|
|
|
|
}
|
|
|
|
|
|
self.bottomView.status = 2;
|
|
|
|
|
|
[self configMicType:YES];
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// 声浪回调
|
|
|
|
|
|
-(void)onRTCEngineRoomPublishSoundLevelUpdate:(NSDictionary<NSString *,NSNumber *> *)soundLevels{
|
|
|
|
|
|
// if (self.roomModel.room_info.type_id.intValue == 1 && self.roomModel.room_info.label_id.intValue == 1) {
|
|
|
|
|
|
// for (NSString *userId in soundLevels.allKeys) {
|
|
|
|
|
|
// for (QXRoomSeatContentView *seatContentView in self.seatContentView.normalSeatView.seatArray) {
|
|
|
|
|
|
// if ([seatContentView.pitModel.user_id isEqualToString:userId]) {
|
|
|
|
|
|
// if ([soundLevels[userId] integerValue] > 0) {
|
|
|
|
|
|
// [seatContentView startAudioAnimation];
|
|
|
|
|
|
// }else {
|
|
|
|
|
|
// [seatContentView stopAudioAnimation];
|
|
|
|
|
|
// }
|
|
|
|
|
|
// break;
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
// for (AgoraRtcAudioVolumeInfo *info in soundLevels) {
|
|
|
|
|
|
// if (info.uid == 0) {
|
|
|
|
|
|
// if (info.volume > 0) {
|
|
|
|
|
|
// [seatView startAudioAnimation];
|
|
|
|
|
|
// }else {
|
|
|
|
|
|
// [seatView stopAudioAnimation];
|
|
|
|
|
|
// }
|
|
|
|
|
|
// break;
|
|
|
|
|
|
// }else{
|
|
|
|
|
|
// if (info.volume > 0) {
|
|
|
|
|
|
// [seatView startAudioAnimation];
|
|
|
|
|
|
// }else {
|
|
|
|
|
|
// [seatView stopAudioAnimation];
|
|
|
|
|
|
// }
|
|
|
|
|
|
// break;
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
// for (NSString *userId in soundLevels.allKeys) {
|
|
|
|
|
|
// QXRoomSeatContentView *seatView = self.seatContentView.seatDict[userId];
|
|
|
|
|
|
// if ([soundLevels[userId] integerValue] > 0) {
|
|
|
|
|
|
// [seatView startAudioAnimation];
|
|
|
|
|
|
// }else {
|
|
|
|
|
|
// [seatView stopAudioAnimation];
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
-(void)rtcEngineLocalAudioMixingDidFinish{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
-(void)rtcEngineVideoFirstLoadWithUid:(NSInteger)uid size:(CGSize)size{
|
|
|
|
|
|
self.movieView.hidden = NO;
|
|
|
|
|
|
[self.view bringSubviewToFront:self.movieView];
|
|
|
|
|
|
}
|
|
|
|
|
|
-(void)rtcEngineVideoDidStart:(NSInteger)uid{
|
|
|
|
|
|
self.movieView.hidden = NO;
|
|
|
|
|
|
[self.view bringSubviewToFront:self.movieView];
|
|
|
|
|
|
}
|
|
|
|
|
|
-(void)rtcEngineVideoDidStop:(NSInteger)uid{
|
|
|
|
|
|
if (self.movieView.isFullScreen) {
|
|
|
|
|
|
[self.movieView resetView];
|
|
|
|
|
|
}
|
|
|
|
|
|
self.movieView.hidden = YES;
|
|
|
|
|
|
}
|
|
|
|
|
|
#pragma mark - 推送通知
|
|
|
|
|
|
-(void)roomOnlineNumberDidChangedOnlineNumber:(NSString *)onlineNumber{
|
|
|
|
|
|
[self.titleView setOnlineNumber:onlineNumber];
|
|
|
|
|
|
}
|
|
|
|
|
|
/// 下一首歌状态发生变化
|
|
|
|
|
|
-(void)nextSongDidChangedWithNextSong:(QXSongListModel *)nextInfo{
|
|
|
|
|
|
self.seatContentView.nextInfo = nextInfo;
|
|
|
|
|
|
}
|
|
|
|
|
|
/// 演唱者歌词回调
|
|
|
|
|
|
-(void)rtcEngineSongLrc:(NSString *)lrcUrl{
|
|
|
|
|
|
self.seatContentView.lrcUrl = lrcUrl;
|
|
|
|
|
|
}
|
|
|
|
|
|
// 演唱者歌曲播放回调
|
|
|
|
|
|
-(void)rtcEngineSongProgress:(NSUInteger)progress{
|
2025-10-20 09:43:10 +08:00
|
|
|
|
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) {
|
2025-08-08 10:49:36 +08:00
|
|
|
|
self.seatContentView.progress = progress;
|
|
|
|
|
|
}else{
|
|
|
|
|
|
self.musicView.progress = progress;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
/// 观众同步歌词
|
|
|
|
|
|
-(void)roomSongLrcProgress:(NSUInteger)progress{
|
|
|
|
|
|
self.seatContentView.progress = progress;
|
|
|
|
|
|
}
|
|
|
|
|
|
// 有人发起点歌申请
|
|
|
|
|
|
-(void)applySongWaitAgreeWithUserNickname:(NSString *)nickname{
|
|
|
|
|
|
if (self.seatContentView.myPitNumber == 9) {
|
|
|
|
|
|
// 弹出是否同意
|
|
|
|
|
|
MJWeakSelf
|
|
|
|
|
|
QXAlertView *al = [[QXAlertView alloc] initWithFrame:CGRectMake(0, 0, ScaleWidth(300), ScaleWidth(175))];
|
|
|
|
|
|
al.type = QXAlertViewTypeAgreeSong;
|
|
|
|
|
|
al.message = [NSString stringWithFormat:@"%@ 正在发起点歌",nickname];
|
|
|
|
|
|
al.commitBlock = ^{
|
|
|
|
|
|
[QXMineNetwork agreeApplySongWithRoomId:weakSelf.roomId type:@"1" successBlock:^(NSDictionary * _Nonnull dict) {
|
|
|
|
|
|
|
|
|
|
|
|
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
|
|
|
|
|
showToast(msg);
|
|
|
|
|
|
}];
|
|
|
|
|
|
};
|
|
|
|
|
|
al.cancelBlock = ^{
|
|
|
|
|
|
[QXMineNetwork agreeApplySongWithRoomId:weakSelf.roomId type:@"2" successBlock:^(NSDictionary * _Nonnull dict) {
|
|
|
|
|
|
|
|
|
|
|
|
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
|
|
|
|
|
showToast(msg);
|
|
|
|
|
|
}];
|
|
|
|
|
|
};
|
|
|
|
|
|
[[QXGlobal shareGlobal] showView:al popType:(PopViewTypeTopToCenter) tapDismiss:NO finishBlock:^{
|
|
|
|
|
|
|
|
|
|
|
|
}];
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
// 主播拒绝了点歌申请
|
|
|
|
|
|
-(void)applySongNoAgreeWithUserId:(NSString *)userId{
|
|
|
|
|
|
if ([userId isEqualToString:[QXGlobal shareGlobal].loginModel.user_id]) {
|
|
|
|
|
|
showToast(@"主持拒绝了您的点歌申请");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
/// 切歌后回调
|
|
|
|
|
|
-(void)nextSongDidStartWithSongInfo:(QXSongListModel *)songInfo nextInfo:(QXSongListModel *)nextInfo{
|
|
|
|
|
|
self.seatContentView.songInfo = songInfo;
|
|
|
|
|
|
self.seatContentView.nextInfo = nextInfo;
|
|
|
|
|
|
if ([songInfo.user_id isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
|
|
|
|
|
|
// [[QXAgoraEngine sharedEngine] ktv_EndSing];
|
|
|
|
|
|
// [[QXAgoraEngine sharedEngine] ktv_StartSing:YES withSong:songInfo];
|
|
|
|
|
|
if (self.seatContentView.myPitNumber <= 0) {
|
|
|
|
|
|
/// 我不在麦上 临时拉起权限
|
|
|
|
|
|
self.bottomView.status = 2;
|
|
|
|
|
|
[self.bottomView setMuteAudioStatus:1];
|
|
|
|
|
|
}
|
|
|
|
|
|
}else{
|
|
|
|
|
|
// [[QXAgoraEngine sharedEngine] ktv_EndSing];
|
|
|
|
|
|
// [[QXAgoraEngine sharedEngine] ktv_LoadLrcWithSong:songInfo];
|
|
|
|
|
|
if (self.seatContentView.myPitNumber <= 0) {
|
|
|
|
|
|
self.bottomView.status = 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
/// 插入消息
|
|
|
|
|
|
-(void)didInsertMessge:(QXRoomChatListModel *)message{
|
|
|
|
|
|
[self.chatListView insertMessage:message];
|
|
|
|
|
|
}
|
|
|
|
|
|
-(void)didInsertMessge:(QXRoomChatListModel *)message userId:(NSString *)userId{
|
|
|
|
|
|
if ([userId isEqualToString:[QXGlobal shareGlobal].loginModel.user_id]) {
|
|
|
|
|
|
[self.chatListView insertMessage:message];
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
/// 上下麦发生变化
|
|
|
|
|
|
-(void)didUpDownSeatWithUser:(QXUserHomeModel *)user isUpSeat:(BOOL)isUpSeat pit_number:(NSInteger)pit_number{
|
|
|
|
|
|
[self.seatContentView didUpDownSeatWithUser:user isUpSeat:isUpSeat pit_number:pit_number];
|
|
|
|
|
|
|
|
|
|
|
|
if ([user.user_id isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
|
|
|
|
|
|
[[QXAgoraEngine sharedEngine] setClientRoleBroadcaster:isUpSeat];
|
|
|
|
|
|
self.bottomView.status = isUpSeat?2:1;
|
|
|
|
|
|
if (!isUpSeat) {
|
|
|
|
|
|
/// 下麦 停止音频模块
|
|
|
|
|
|
[[QXAgoraEngine sharedEngine] enableAudio:NO];
|
|
|
|
|
|
self.seatContentView.myPitNumber = -1;
|
|
|
|
|
|
if (_musicView) {
|
|
|
|
|
|
[[QXAgoraEngine sharedEngine] ktv_EndSing];
|
|
|
|
|
|
[_musicView removeFromSuperview];
|
|
|
|
|
|
_musicView = nil;
|
|
|
|
|
|
}
|
|
|
|
|
|
}else{
|
|
|
|
|
|
/// 上麦 停止音频模块 (因首次上麦 未打开麦克风 所以此处需要停止音频模块)
|
|
|
|
|
|
[[QXAgoraEngine sharedEngine] enableAudio:NO];
|
|
|
|
|
|
/// 开启本地推流 虽音频模块未打开,但本地音乐及音效需要进行推流
|
|
|
|
|
|
[[QXAgoraEngine sharedEngine] muteLocalAudioStream:NO];
|
|
|
|
|
|
self.seatContentView.myPitNumber = pit_number;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (self.seatContentView.myPitNumber == 9) {
|
|
|
|
|
|
self.soundBtn.hidden = NO;
|
|
|
|
|
|
self.titleView.isCompere = YES;
|
|
|
|
|
|
}else{
|
|
|
|
|
|
self.soundBtn.hidden = YES;
|
|
|
|
|
|
self.titleView.isCompere = NO;
|
|
|
|
|
|
}
|
|
|
|
|
|
[self configBottomTools];
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
2025-10-20 09:43:10 +08:00
|
|
|
|
-(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;
|
2025-10-27 17:05:46 +08:00
|
|
|
|
self.seatContentView.myPitNumber = toPitNumber;
|
2025-10-20 09:43:10 +08:00
|
|
|
|
}else{
|
|
|
|
|
|
self.soundBtn.hidden = YES;
|
|
|
|
|
|
self.titleView.isCompere = NO;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-08-08 10:49:36 +08:00
|
|
|
|
// 踢出房间
|
|
|
|
|
|
-(void)userDidTakeOffWithUserInfo:(QXUserHomeModel *)userInfo{
|
|
|
|
|
|
if ([userInfo.user_id isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
|
|
|
|
|
|
[[QXGlobal shareGlobal] quitRoomWithRoomId:self.roomId];
|
2025-08-14 09:40:25 +08:00
|
|
|
|
// self.navigationController.interactivePopGestureRecognizer.enabled = YES;
|
2025-08-08 10:49:36 +08:00
|
|
|
|
[self.navigationController popViewControllerAnimated:YES];
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
// 设置管理员 | 主持
|
|
|
|
|
|
-(void)roomSetManagerOrCompere:(QXUserHomeModel *)userInfo isManager:(BOOL)isManager isAdd:(BOOL)isAdd{
|
|
|
|
|
|
if ([userInfo.user_id isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
|
|
|
|
|
|
if (isManager) {
|
|
|
|
|
|
if (isAdd) {
|
|
|
|
|
|
self.roomModel.user_info.is_management = @"1";
|
|
|
|
|
|
}else{
|
|
|
|
|
|
self.roomModel.user_info.is_management = @"0";
|
|
|
|
|
|
}
|
|
|
|
|
|
}else{
|
|
|
|
|
|
if (isAdd) {
|
|
|
|
|
|
self.roomModel.user_info.is_host = @"1";
|
|
|
|
|
|
}else{
|
|
|
|
|
|
self.roomModel.user_info.is_host = @"0";
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
/// 清除魅力
|
|
|
|
|
|
-(void)roomClearCharm{
|
|
|
|
|
|
[self.seatContentView clearCharm];
|
|
|
|
|
|
}
|
2025-10-20 09:43:10 +08:00
|
|
|
|
-(void)roomClearUserCharmWithUserId:(NSString *)userId{
|
|
|
|
|
|
[self.seatContentView roomClearUserCharmWithUserId:userId];
|
|
|
|
|
|
}
|
2025-08-08 10:49:36 +08:00
|
|
|
|
/// 收到礼物设置魅力
|
|
|
|
|
|
-(void)didRecieveGiftWithWithUserInfo:(QXUserHomeModel *)userInfo{
|
|
|
|
|
|
[self.seatContentView setSeatCharmWithUser:userInfo];
|
|
|
|
|
|
}
|
2025-10-20 09:43:10 +08:00
|
|
|
|
-(void)didRecieveGiftWithWithUserInfos:(NSArray<QXUserHomeModel *> *)userInfos{
|
|
|
|
|
|
[self.seatContentView setSeatCharmWithUsers:userInfos];
|
|
|
|
|
|
}
|
2025-08-08 10:49:36 +08:00
|
|
|
|
/// 拍卖者上麦
|
|
|
|
|
|
-(void)auctionUpSeatWithUserInfo:(QXUserHomeModel *)userInfo isUpSeat:(BOOL)isUpSeat{
|
|
|
|
|
|
[self.seatContentView didAuctiontUpDownSeatWithUser:userInfo isUpSeat:isUpSeat];
|
|
|
|
|
|
if ([userInfo.user_id isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
|
|
|
|
|
|
[[QXAgoraEngine sharedEngine] setClientRoleBroadcaster:isUpSeat];
|
|
|
|
|
|
self.bottomView.status = isUpSeat?2:1;
|
|
|
|
|
|
if (!isUpSeat) {
|
|
|
|
|
|
/// 下麦 停止音频模块
|
|
|
|
|
|
[[QXAgoraEngine sharedEngine] enableAudio:NO];
|
|
|
|
|
|
self.seatContentView.myPitNumber = -1;
|
|
|
|
|
|
if (_musicView) {
|
|
|
|
|
|
[[QXAgoraEngine sharedEngine] ktv_EndSing];
|
|
|
|
|
|
[_musicView removeFromSuperview];
|
|
|
|
|
|
_musicView = nil;
|
|
|
|
|
|
}
|
|
|
|
|
|
}else{
|
|
|
|
|
|
/// 上麦 停止音频模块 (因首次上麦 未打开麦克风 所以此处需要停止音频模块)
|
|
|
|
|
|
[[QXAgoraEngine sharedEngine] enableAudio:NO];
|
|
|
|
|
|
/// 开启本地推流 虽音频模块未打开,但本地音乐及音效需要进行推流
|
|
|
|
|
|
[[QXAgoraEngine sharedEngine] muteLocalAudioStream:NO];
|
|
|
|
|
|
self.seatContentView.myPitNumber = 888;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (self.seatContentView.myPitNumber == 9) {
|
|
|
|
|
|
self.soundBtn.hidden = NO;
|
|
|
|
|
|
self.titleView.isCompere = YES;
|
|
|
|
|
|
}else{
|
|
|
|
|
|
self.soundBtn.hidden = YES;
|
|
|
|
|
|
self.titleView.isCompere = NO;
|
|
|
|
|
|
}
|
|
|
|
|
|
[self configBottomTools];
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
/// 用户 禁言|禁麦 状态 发生变化
|
|
|
|
|
|
-(void)userMuteStatusDidChanged:(QXUserHomeModel *)userInfo isMute:(NSString *)isMute isMutePit:(NSString *)isMutePit{
|
|
|
|
|
|
if ([userInfo.user_id isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
|
|
|
|
|
|
self.roomModel.user_info.is_mute = isMute;
|
|
|
|
|
|
self.roomModel.user_info.is_mute_pit = isMutePit;
|
|
|
|
|
|
if (isMutePit.intValue == 1) {
|
|
|
|
|
|
[self.bottomView setMuteAudioStatus:0];
|
|
|
|
|
|
[[QXAgoraEngine sharedEngine] enableAudio:NO];
|
|
|
|
|
|
[[QXAgoraEngine sharedEngine] muteLocalAudioStream:YES];
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
/// 二卡八麦位状态变化
|
|
|
|
|
|
-(void)roomSeatStatusDidChangedIsLock:(NSString *)is_lock pit_number:(NSString *)pit_number{
|
|
|
|
|
|
[self.seatContentView setSeatIsLock:is_lock pitNumber:pit_number];
|
|
|
|
|
|
}
|
|
|
|
|
|
-(void)aplayMicInLineNumberDidChanged:(NSString *)number{
|
|
|
|
|
|
self.micTeamView.countLabel.text = number;
|
|
|
|
|
|
}
|
|
|
|
|
|
-(void)cabinRoomValueDidChanged:(NSString *)hotValue{
|
|
|
|
|
|
[self.seatContentView cabinRoomHotValueDidChanged:hotValue];
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-(void)roomOnlineNumberDidChangedIsAdd:(BOOL)isAdd{
|
|
|
|
|
|
[self.titleView onlineNumberIsAdd:isAdd];
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
-(void)roomUserInfoDidChanged:(QXUserHomeModel *)user{
|
|
|
|
|
|
[self.seatContentView roomUserInfoDidChanged:user];
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
-(void)previewUserInfoWithUserId:(NSString *)userId{
|
|
|
|
|
|
QXRoomOwnerModel *md = [QXRoomOwnerModel new];
|
|
|
|
|
|
md.user_id = userId;
|
|
|
|
|
|
[self didClickUserHeaderWithPitModel:nil userModel:md isPkRoom:NO pkRoomId:@"" isNoTakeOff:NO];
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
-(void)auctionGiftAction:(QXRoomPitModel *)user auctionId:(NSString *)auctionId{
|
|
|
|
|
|
self.sendGiftView.type = QXSendGiftViewTypeAuction;
|
|
|
|
|
|
QXRoomPitModel *model = [[QXRoomPitModel alloc] init];
|
|
|
|
|
|
model.pit_number = @"-1";
|
|
|
|
|
|
model.user_id = user.user_id;
|
|
|
|
|
|
model.nickname = user.nickname;
|
|
|
|
|
|
model.avatar = user.avatar;
|
|
|
|
|
|
self.sendGiftView.userModel = model;
|
|
|
|
|
|
self.sendGiftView.auctionId = auctionId;
|
|
|
|
|
|
self.sendGiftView.roomId = self.roomId;
|
|
|
|
|
|
[self.sendGiftView showInView:self.view];
|
|
|
|
|
|
// [[QXGlobal shareGlobal] showView:self.sendGiftView controller:self popType:(PopViewTypeBottomToUpActionSheet) tapDismiss:YES finishBlock:^{
|
|
|
|
|
|
//
|
|
|
|
|
|
// }];
|
|
|
|
|
|
}
|
|
|
|
|
|
///修改房间类型
|
|
|
|
|
|
-(void)auctionTypeDidChanged:(NSString *)type{
|
|
|
|
|
|
[self.seatContentView auctionTypeDidChanged:type];
|
|
|
|
|
|
}
|
|
|
|
|
|
/// 开始拍卖
|
|
|
|
|
|
-(void)auctionStartOrEndIsStart:(BOOL)isStart user:(QXRoomAuctionUser *)user getUser:(QXRoomAuctionUser *)getUser{
|
|
|
|
|
|
[self.seatContentView auctionStartOrEndIsStart:isStart user:user getUser:getUser];
|
|
|
|
|
|
if (!isStart) {
|
|
|
|
|
|
[self auctionListDidChanged:@[]];
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
/// 拍卖列表发生变化
|
|
|
|
|
|
-(void)auctionListDidChanged:(NSArray<QXRoomPitModel *> *)auctionList{
|
|
|
|
|
|
BOOL haveMe = NO;
|
|
|
|
|
|
// for (QXRoomPitModel*pitModel in auctionList) {
|
|
|
|
|
|
// if ([pitModel.user_id isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
|
|
|
|
|
|
// haveMe = YES;
|
|
|
|
|
|
// break;
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
for (int i = 0; i < auctionList.count; i++) {
|
|
|
|
|
|
if (i < 3) {
|
|
|
|
|
|
QXRoomPitModel*pitModel = auctionList[i];
|
|
|
|
|
|
if ([pitModel.user_id isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
|
|
|
|
|
|
haveMe = YES;
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if ([self.roomModel.room_auction.auction_user.user_id isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
|
|
|
|
|
|
haveMe = YES;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (self.seatContentView.myPitNumber>=0) {
|
|
|
|
|
|
haveMe = YES;
|
|
|
|
|
|
}
|
|
|
|
|
|
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 auctionListDidChanged:auctionList];
|
|
|
|
|
|
}
|
|
|
|
|
|
/// 拍卖被延时
|
|
|
|
|
|
-(void)auctionTimeDelayWithEndTime:(NSString *)endTime{
|
|
|
|
|
|
[self.seatContentView auctionDelayTimeWithEndTime:endTime];
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// 清空消息
|
|
|
|
|
|
-(void)didClearAllMessage{
|
|
|
|
|
|
[self.chatListView clearMessage];
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 麦序模式发生变化
|
|
|
|
|
|
-(void)aplayPitModeDidChanged:(NSString *)upMicType{
|
|
|
|
|
|
self.roomModel.room_info.room_up_pit_type = upMicType;
|
|
|
|
|
|
if (upMicType.intValue == 1) {
|
|
|
|
|
|
self.micTeamView.hidden = NO;
|
|
|
|
|
|
}else{
|
|
|
|
|
|
// if (self.seatContentView.myPitNumber > 0) {
|
|
|
|
|
|
// self.upSeatBtn.selected = YES;
|
|
|
|
|
|
// }else{
|
|
|
|
|
|
// self.upSeatBtn.selected = NO;
|
|
|
|
|
|
// }
|
|
|
|
|
|
self.micTeamView.hidden = YES;
|
|
|
|
|
|
}
|
|
|
|
|
|
self.settingView.roomModel = self.roomModel;
|
|
|
|
|
|
}
|
|
|
|
|
|
/// 房间类型发生变化
|
|
|
|
|
|
-(void)roomTypeDidChanged{
|
|
|
|
|
|
[self getRoomInfo];
|
|
|
|
|
|
}
|
|
|
|
|
|
/// 房间信息发生变化
|
|
|
|
|
|
-(void)roomInfoDidChanged:(QXRoomInfoModel *)roomInfo{
|
|
|
|
|
|
self.roomModel.room_info.room_name = roomInfo.room_name;
|
|
|
|
|
|
self.roomModel.room_info.room_cover = roomInfo.room_cover;
|
|
|
|
|
|
self.roomModel.room_info.room_number = roomInfo.room_number;
|
|
|
|
|
|
self.roomModel.room_info.room_background = roomInfo.room_background;
|
|
|
|
|
|
self.titleView.roomModel = self.roomModel;
|
|
|
|
|
|
[self.roomBgImageView sd_setImageWithURL:[NSURL URLWithString:roomInfo.room_background]];
|
|
|
|
|
|
}
|
|
|
|
|
|
// 下一首歌
|
|
|
|
|
|
-(void)rtcEngineBackgroundMusicNextSong:(QXSongListModel *)songModel{
|
|
|
|
|
|
self.musicView.songModel = songModel;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
-(void)songRoomCharmRankListDidChanged:(NSArray<QXRoomPitModel *> *)list{
|
|
|
|
|
|
[self.seatContentView songRoomCharmRankListDidChanged:list];
|
|
|
|
|
|
}
|
|
|
|
|
|
#pragma mark - pk 相关
|
|
|
|
|
|
-(void)recievePKInviteWithSendRoomId:(NSString *)SendRoomId AcceptRoomId:(NSString *)AcceptRoomId PkId:(NSString *)PkId message:(nonnull NSString *)message{
|
|
|
|
|
|
if (self.seatContentView.myPitNumber == 9) {
|
|
|
|
|
|
/// 找主持 主持弹窗 发起者不会收到
|
|
|
|
|
|
MJWeakSelf
|
|
|
|
|
|
QXAlertView *al = [[QXAlertView alloc] initWithFrame:CGRectMake(0, 0, ScaleWidth(300), ScaleWidth(175))];
|
|
|
|
|
|
al.type = QXAlertViewTypeAgreeSong;
|
|
|
|
|
|
al.message = message;
|
|
|
|
|
|
al.commitBlock = ^{
|
|
|
|
|
|
[QXMineNetwork roomPkAgreeWithPk_id:PkId type:@"1" successBlock:^(NSDictionary * _Nonnull dict) {
|
|
|
|
|
|
|
|
|
|
|
|
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
|
|
|
|
|
showToast(msg);
|
|
|
|
|
|
}];
|
|
|
|
|
|
};
|
|
|
|
|
|
al.cancelBlock = ^{
|
|
|
|
|
|
// [QXMineNetwork roomPkAgreeWithPk_id:PkId type:@"2" successBlock:^(NSDictionary * _Nonnull dict) {
|
|
|
|
|
|
//
|
|
|
|
|
|
// } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
|
|
|
|
|
// showToast(msg);
|
|
|
|
|
|
// }];
|
|
|
|
|
|
};
|
|
|
|
|
|
[[QXGlobal shareGlobal] showView:al popType:(PopViewTypeTopToCenter) tapDismiss:NO finishBlock:^{
|
|
|
|
|
|
|
|
|
|
|
|
}];
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
/// 败方想跑路
|
|
|
|
|
|
-(void)roomPKRecieveLoserWantToRunRoadWithUserInfo:(QXUserHomeModel *)fromUserInfo{
|
|
|
|
|
|
if (self.seatContentView.myPitNumber == 9) {
|
|
|
|
|
|
/// 找主持 主持弹窗 发起者不会收到
|
|
|
|
|
|
MJWeakSelf
|
|
|
|
|
|
QXAlertView *al = [[QXAlertView alloc] initWithFrame:CGRectMake(0, 0, ScaleWidth(300), ScaleWidth(175))];
|
|
|
|
|
|
al.type = QXAlertViewTypeAgreeSong;
|
|
|
|
|
|
al.message = [NSString stringWithFormat:@"%@想结束本厂PK,您确定结束吗",fromUserInfo.nickname];
|
|
|
|
|
|
al.commitBlock = ^{
|
|
|
|
|
|
[QXMineNetwork roomPkEndWithPk_id:weakSelf.roomModel.pk_info.pk_id type:@"3" user_id:[QXGlobal shareGlobal].loginModel.user_id successBlock:^(NSDictionary * _Nonnull dict) {
|
|
|
|
|
|
|
|
|
|
|
|
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
|
|
|
|
|
|
|
|
|
|
|
}];
|
|
|
|
|
|
};
|
|
|
|
|
|
al.cancelBlock = ^{
|
|
|
|
|
|
// [QXMineNetwork roomPkAgreeWithPk_id:PkId type:@"2" successBlock:^(NSDictionary * _Nonnull dict) {
|
|
|
|
|
|
//
|
|
|
|
|
|
// } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
|
|
|
|
|
// showToast(msg);
|
|
|
|
|
|
// }];
|
|
|
|
|
|
};
|
|
|
|
|
|
[[QXGlobal shareGlobal] showView:al popType:(PopViewTypeTopToCenter) tapDismiss:NO finishBlock:^{
|
|
|
|
|
|
|
|
|
|
|
|
}];
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
-(void)agreeOrRefusePKIsAgree:(BOOL)isAgree user_id:(nonnull NSString *)user_id room_id:(nonnull NSString *)room_id pk_id:(NSString*)pk_id{
|
|
|
|
|
|
if (isAgree) {
|
|
|
|
|
|
/// 更新自己房间信息 更换界面
|
|
|
|
|
|
// [self getRoomInfo];
|
|
|
|
|
|
|
|
|
|
|
|
MJWeakSelf
|
|
|
|
|
|
[QXMineNetwork getRoomInfoWithRoomId:self.roomId successBlock:^(QXRoomModel * _Nonnull roomModel) {
|
|
|
|
|
|
weakSelf.roomModel = roomModel;
|
|
|
|
|
|
[weakSelf resetSubviews];
|
|
|
|
|
|
weakSelf.seatContentView.roomModel = roomModel;
|
|
|
|
|
|
/// 这里的roomId 是对方的roomid 获取对方房间信息 赋值给右侧视图 pk分为左右两侧 左侧为自己 右侧是对方
|
|
|
|
|
|
[QXMineNetwork getRoomInfoWithRoomId:room_id successBlock:^(QXRoomModel * _Nonnull roomModel) {
|
|
|
|
|
|
weakSelf.seatContentView.pkRoomModel = roomModel;
|
|
|
|
|
|
if (self.seatContentView.myPitNumber == 9) {
|
|
|
|
|
|
// 如果自己当前在9号麦 加入对方房间
|
|
|
|
|
|
[[QXAgoraEngineEx sharedEngine] joinExWithAgora_token:roomModel.user_info.agora_token channel:room_id];
|
|
|
|
|
|
}
|
|
|
|
|
|
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
|
|
|
|
|
|
|
|
|
|
|
}];
|
|
|
|
|
|
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
|
|
|
|
|
|
|
|
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
-(void)pkStartWithPkEndTimes:(NSString *)pk_end_times pk_id:(NSString*)pk_id{
|
|
|
|
|
|
[self.seatContentView pkStartWithPkEndTimes:pk_end_times pk_id:pk_id];
|
|
|
|
|
|
}
|
|
|
|
|
|
-(void)roomPKValueDidChangedWithRoomIdA:(NSString *)room_id_a create_value_a:(NSString *)create_value_a room_id_b:(NSString *)room_id_b receive_value_b:(NSString *)receive_value_b{
|
|
|
|
|
|
[self.seatContentView roomPKValueDidChangedWithRoomIdA:room_id_a create_value_a:create_value_a room_id_b:room_id_b receive_value_b:receive_value_b];
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
-(void)pkResultWithIsVictory:(NSInteger)isVictory end_time:(nonnull NSString *)end_time victory_name:(nonnull NSString *)victory_name victory_cover:(nonnull NSString *)victory_cover defeated_name:(nonnull NSString *)defeated_name defeated_cover:(nonnull NSString *)defeated_cover{
|
|
|
|
|
|
[self.seatContentView pkResultWithIsVictory:isVictory end_time:end_time victory_name:victory_name victory_cover:victory_cover defeated_name:defeated_name defeated_cover:defeated_cover];
|
|
|
|
|
|
}
|
|
|
|
|
|
-(void)pkDisConnect{
|
|
|
|
|
|
[[QXAgoraEngineEx sharedEngine] quitEXChannelWithLastPkRoomId:@""];
|
|
|
|
|
|
[self getRoomInfo];
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
-(void)pkMuteRemoteAudio:(BOOL)isMute fromUserInfo:(nonnull QXUserHomeModel *)fromUserInfo{
|
|
|
|
|
|
[[QXAgoraEngineEx sharedEngine] muteLocalEXAudioStream:isMute fromUserInfo:fromUserInfo];
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
-(void)recieveHeadline:(QXHeadLineModel *)headline{
|
|
|
|
|
|
if (_headlineView) {
|
|
|
|
|
|
self.headlineView.model = headline;
|
2025-10-20 09:43:10 +08:00
|
|
|
|
[self.view addSubview:self.headlineView];
|
2025-08-08 10:49:36 +08:00
|
|
|
|
}else{
|
|
|
|
|
|
self.headlineView.model = headline;
|
|
|
|
|
|
[self.view addSubview:self.headlineView];
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#pragma mark - QXRoomBottomViewDelegate
|
|
|
|
|
|
-(void)didClickEventType:(QXRoomBottomViewEventType)type isSelected:(BOOL)isSelected{
|
|
|
|
|
|
switch (type) {
|
|
|
|
|
|
case QXRoomBottomViewEventTypePlayAudio:{
|
|
|
|
|
|
|
|
|
|
|
|
[[QXAgoraEngine sharedEngine] muteAllRemoteAudioStreams:isSelected];
|
|
|
|
|
|
[[QXAgoraEngineEx sharedEngine] muteRemoteEXAudioStream:isSelected];
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case QXRoomBottomViewEventTypeMuteAudio:{
|
|
|
|
|
|
if (!isSelected) {
|
|
|
|
|
|
/// 静音时麦圈停止
|
2025-10-20 09:43:10 +08:00
|
|
|
|
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) {
|
2025-08-08 10:49:36 +08:00
|
|
|
|
// QXRoomSeatContentView *seatContentView = self.seatContentView.normalSeatView.mySeatView;
|
|
|
|
|
|
// if (seatContentView.isSeatSpeaking) {
|
|
|
|
|
|
// [seatContentView stopAudioAnimation];
|
|
|
|
|
|
// }
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
QXLOG(isSelected?@"开麦":@"闭麦");
|
|
|
|
|
|
[[QXAgoraEngine sharedEngine] enableAudio:isSelected];
|
|
|
|
|
|
if (isSelected) {
|
|
|
|
|
|
[[QXAgoraEngine sharedEngine] setClientRoleBroadcaster:YES];
|
|
|
|
|
|
[[QXAgoraEngine sharedEngine] muteLocalAudioStream:NO];
|
|
|
|
|
|
}else{
|
|
|
|
|
|
AgoraRtcAudioVolumeInfo *info = [[AgoraRtcAudioVolumeInfo alloc] init];
|
|
|
|
|
|
info.uid = [QXGlobal shareGlobal].loginModel.user_id.longLongValue;
|
|
|
|
|
|
info.volume = 0;
|
|
|
|
|
|
[[NSNotificationCenter defaultCenter] postNotificationName:noticeUserSpeak object:info];
|
|
|
|
|
|
NSDictionary *dict = @{
|
|
|
|
|
|
@"is_mute":[NSNumber numberWithInteger:0],
|
|
|
|
|
|
};
|
|
|
|
|
|
NSString *jsonStr = [dict jsonStringEncoded];
|
|
|
|
|
|
[[QXRoomMessageManager shared] sendChatMessage:jsonStr messageType:(QXRoomMessageTypeMuteLocalAudio) needInsertMessage:NO];
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// [[QXAgoraEngine sharedEngine] muteLocalAudioStream:!isSelected];
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case QXRoomBottomViewEventTypeMessage:{
|
|
|
|
|
|
QXMessageViewController *vc = [[QXMessageViewController alloc] initWithIsFromRoom:YES];
|
|
|
|
|
|
QXBaseNavigationController *na = [[QXBaseNavigationController alloc] initWithRootViewController:vc];
|
|
|
|
|
|
na.modalPresentationStyle = UIModalPresentationFormSheet;
|
|
|
|
|
|
[self presentViewController:na animated:YES completion:nil];
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case QXRoomBottomViewEventTypePK:{
|
|
|
|
|
|
self.pkSearchView.roomId = self.roomModel.room_info.room_id;
|
|
|
|
|
|
[self.pkSearchView showInView:self.view];
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
case QXRoomBottomViewEventTypeMusic:{
|
2025-10-20 09:43:10 +08:00
|
|
|
|
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){
|
2025-08-08 10:49:36 +08:00
|
|
|
|
MJWeakSelf
|
|
|
|
|
|
QXAlertView *al = [[QXAlertView alloc] initWithFrame:CGRectMake(0, 0, ScaleWidth(300), ScaleWidth(175))];
|
|
|
|
|
|
al.type = QXAlertViewTypeApplySong;
|
|
|
|
|
|
al.commitBlock = ^{
|
|
|
|
|
|
[QXMineNetwork applySongWithRoomId:weakSelf.roomId successBlock:^(NSDictionary * _Nonnull dict) {
|
|
|
|
|
|
showToast(@"已发起点歌,请等待主持同意");
|
|
|
|
|
|
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
|
|
|
|
|
showToast(msg);
|
|
|
|
|
|
}];
|
|
|
|
|
|
};
|
|
|
|
|
|
[[QXGlobal shareGlobal] showView:al popType:(PopViewTypeTopToCenter) tapDismiss:NO finishBlock:^{
|
|
|
|
|
|
|
|
|
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
self.songListView.isCompere = self.seatContentView.myPitNumber==9;
|
|
|
|
|
|
self.songListView.isBgMusic = [QXAgoraEngine sharedEngine].isPlayBgMusic;
|
|
|
|
|
|
[self.songListView showInView:self.view];
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
case QXRoomBottomViewEventTypeGift:{
|
|
|
|
|
|
self.sendGiftView.type = QXSendGiftViewTypeRoom;
|
|
|
|
|
|
if (self.sendGiftView.titles.count == 0) {
|
|
|
|
|
|
[self.sendGiftView reloadData];
|
|
|
|
|
|
}
|
|
|
|
|
|
QXRoomPitModel *compereModel = nil;
|
|
|
|
|
|
QXRoomPitModel *guestModel = nil;
|
|
|
|
|
|
NSMutableArray *pitArr = [NSMutableArray array];
|
|
|
|
|
|
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]) {
|
2025-10-20 09:43:10 +08:00
|
|
|
|
md.isSelected = NO;
|
2025-08-08 10:49:36 +08:00
|
|
|
|
[pitArr addObject:md];
|
|
|
|
|
|
QXRoomPitModel *lastMd = self.roomModel.room_info.pit_list[9];
|
2025-10-20 09:43:10 +08:00
|
|
|
|
if (lastMd.user_id.longValue > 0 && ![QXGlobal.shareGlobal.loginModel.user_id isEqualToString:lastMd.user_id]) {
|
|
|
|
|
|
lastMd.isSelected = NO;
|
2025-08-08 10:49:36 +08:00
|
|
|
|
[pitArr addObject:lastMd];
|
|
|
|
|
|
}
|
|
|
|
|
|
}else{
|
|
|
|
|
|
QXRoomPitModel *lastMd = self.roomModel.room_info.pit_list[9];
|
2025-10-20 09:43:10 +08:00
|
|
|
|
if (lastMd.user_id.longValue > 0 && ![QXGlobal.shareGlobal.loginModel.user_id isEqualToString:lastMd.user_id]) {
|
|
|
|
|
|
lastMd.isSelected = NO;
|
2025-08-08 10:49:36 +08:00
|
|
|
|
[pitArr addObject:lastMd];
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
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.pit_number.intValue == 9) {
|
|
|
|
|
|
compereModel = md;
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}else if (md.pit_number.intValue == 10) {
|
|
|
|
|
|
guestModel = md;
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}else{
|
|
|
|
|
|
if (md.user_id.longValue > 0 && ![md.user_id isEqualToString:[QXGlobal shareGlobal].loginModel.user_id]) {
|
|
|
|
|
|
[pitArr addObject:md];
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}else{
|
|
|
|
|
|
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;
|
2025-10-20 09:43:10 +08:00
|
|
|
|
if ([self.roomModel.room_info.type_id isEqualToString:@"2"]) {
|
|
|
|
|
|
/// 拍卖房主持位和拍卖为可能为同一个人
|
|
|
|
|
|
if ([md.user_id isEqualToString:self.roomModel.room_auction.auction_user.user_id]) {
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
2025-08-08 10:49:36 +08:00
|
|
|
|
}
|
|
|
|
|
|
if (md.pit_number.intValue == 9) {
|
|
|
|
|
|
compereModel = md;
|
2025-10-20 09:43:10 +08:00
|
|
|
|
if (md.user_id.longValue > 0 && ![md.user_id isEqualToString:[QXGlobal shareGlobal].loginModel.user_id]) {
|
|
|
|
|
|
[pitArr insertObject:md atIndex:0];
|
|
|
|
|
|
}
|
2025-08-08 10:49:36 +08:00
|
|
|
|
continue;
|
|
|
|
|
|
}else if (md.pit_number.intValue == 10) {
|
|
|
|
|
|
guestModel = md;
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
2025-10-20 09:43:10 +08:00
|
|
|
|
if (md.user_id.longValue > 0 && ![md.user_id isEqualToString:[QXGlobal shareGlobal].loginModel.user_id]) {
|
|
|
|
|
|
[pitArr addObject:md];
|
|
|
|
|
|
}
|
2025-08-08 10:49:36 +08:00
|
|
|
|
}
|
2025-10-20 09:43:10 +08:00
|
|
|
|
|
2025-08-08 10:49:36 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// k歌麦位
|
|
|
|
|
|
if (self.roomModel.song_user_info) {
|
|
|
|
|
|
if ([self.roomModel.song_user_info.user_id isEqualToString:compereModel.user_id] || [self.roomModel.song_user_info.user_id isEqualToString:guestModel.user_id]) {
|
|
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
QXRoomPitModel*md = [[QXRoomPitModel alloc] init];
|
|
|
|
|
|
md.nickname = self.roomModel.song_user_info.nickname;
|
|
|
|
|
|
md.user_id = self.roomModel.song_user_info.user_id;
|
|
|
|
|
|
md.avatar = self.roomModel.song_user_info.avatar;
|
|
|
|
|
|
md.pit_number = @"9999";
|
2025-10-20 09:43:10 +08:00
|
|
|
|
md.isSelected = NO;
|
2025-08-08 10:49:36 +08:00
|
|
|
|
[pitArr addObject:md];
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (self.roomModel.song_pit_list.count > 0) {
|
|
|
|
|
|
for (QXRoomPitModel*md in self.roomModel.song_pit_list) {
|
|
|
|
|
|
if ([md.user_id isEqualToString:self.roomModel.song_user_info.user_id]) {
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (md.user_id.longValue > 0 && ![QXGlobal.shareGlobal.loginModel.user_id isEqualToString:md.user_id]) {
|
2025-10-20 09:43:10 +08:00
|
|
|
|
md.isSelected = NO;
|
2025-08-08 10:49:36 +08:00
|
|
|
|
[pitArr addObject:md];
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 拍卖
|
|
|
|
|
|
if (self.roomModel.room_auction.auction_user) {
|
|
|
|
|
|
QXRoomPitModel*md = [[QXRoomPitModel alloc] init];
|
|
|
|
|
|
md.nickname = self.roomModel.room_auction.auction_user.nickname;
|
|
|
|
|
|
md.user_id = self.roomModel.room_auction.auction_user.user_id;
|
|
|
|
|
|
md.avatar = self.roomModel.room_auction.auction_user.avatar;
|
|
|
|
|
|
md.pit_number = @"9999";
|
2025-10-20 09:43:10 +08:00
|
|
|
|
md.isSelected = NO;
|
2025-08-08 10:49:36 +08:00
|
|
|
|
[pitArr addObject:md];
|
|
|
|
|
|
}
|
|
|
|
|
|
if (self.roomModel.room_auction.auction_list.count > 0) {
|
|
|
|
|
|
for (QXRoomPitModel*md in self.roomModel.room_auction.auction_list) {
|
|
|
|
|
|
if ([md.user_id isEqualToString:compereModel.user_id]) {
|
|
|
|
|
|
continue;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (md.user_id.longValue > 0 && ![QXGlobal.shareGlobal.loginModel.user_id isEqualToString:md.user_id]) {
|
2025-10-20 09:43:10 +08:00
|
|
|
|
md.isSelected = NO;
|
2025-08-08 10:49:36 +08:00
|
|
|
|
[pitArr addObject:md];
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
self.sendGiftView.pitUsers = pitArr;
|
|
|
|
|
|
self.sendGiftView.roomId = self.roomId;
|
|
|
|
|
|
[self.sendGiftView showInView:self.view];
|
|
|
|
|
|
// [[QXGlobal shareGlobal] showView:self.sendGiftView controller:self popType:(PopViewTypeBottomToUpActionSheet) tapDismiss:YES finishBlock:^{
|
|
|
|
|
|
//
|
|
|
|
|
|
// }];
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
case QXRoomBottomViewEventTypeSetting:{
|
|
|
|
|
|
if (self.roomModel.user_info.is_room_owner.intValue == 1) {
|
|
|
|
|
|
BOOL isUpSeat = self.seatContentView.myPitNumber>0;
|
|
|
|
|
|
self.settingView.roomModel = self.roomModel;
|
|
|
|
|
|
[self.settingView updateRole:(QXRoomRoleTypeOwner) isUpSeat:isUpSeat];
|
|
|
|
|
|
[self.settingView showInView:self.view];
|
|
|
|
|
|
return;
|
|
|
|
|
|
}else if (self.roomModel.user_info.is_management.intValue == 1) {
|
|
|
|
|
|
BOOL isUpSeat = self.seatContentView.myPitNumber>0;
|
|
|
|
|
|
self.settingView.roomModel = self.roomModel;
|
|
|
|
|
|
[self.settingView updateRole:(QXRoomRoleTypeManager) isUpSeat:isUpSeat];
|
|
|
|
|
|
[self.settingView showInView:self.view];
|
|
|
|
|
|
return;
|
|
|
|
|
|
}else if (self.roomModel.user_info.is_host.intValue == 1) {
|
|
|
|
|
|
self.settingView.roomModel = self.roomModel;
|
|
|
|
|
|
BOOL isUpSeat = self.seatContentView.myPitNumber==9;
|
|
|
|
|
|
[self.settingView updateRole:(QXRoomRoleTypeCompere) isUpSeat:isUpSeat];
|
|
|
|
|
|
[self.settingView showInView:self.view];
|
|
|
|
|
|
return;
|
|
|
|
|
|
}else{
|
|
|
|
|
|
self.settingView.roomModel = self.roomModel;
|
|
|
|
|
|
BOOL isUpSeat = self.seatContentView.myPitNumber>0;
|
|
|
|
|
|
[self.settingView updateRole:(QXRoomRoleTypeAudience) isUpSeat:isUpSeat];
|
|
|
|
|
|
[self.settingView showInView:self.view];
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
2025-10-24 10:52:40 +08:00
|
|
|
|
case QXRoomBottomViewEventTypeEmoji:{
|
|
|
|
|
|
[self.emojiView showInView:self.view];
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
2025-08-08 10:49:36 +08:00
|
|
|
|
default:
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-10-20 09:43:10 +08:00
|
|
|
|
-(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];
|
|
|
|
|
|
}
|
2025-08-08 10:49:36 +08:00
|
|
|
|
}
|
2025-10-20 09:43:10 +08:00
|
|
|
|
|
2025-08-08 10:49:36 +08:00
|
|
|
|
#pragma mark - 麦位点击用户信息
|
|
|
|
|
|
-(void)didClickUserHeaderWithPitModel:(QXRoomPitModel *)pitModel userModel:(id)userModel isPkRoom:(BOOL)isPkRoom pkRoomId:(NSString *)pkRoomId isNoTakeOff:(BOOL)isNoTakeOff{
|
|
|
|
|
|
if (isPkRoom) {
|
|
|
|
|
|
self.userInfoView.isCompere = NO;
|
|
|
|
|
|
self.userInfoView.isOwner = NO;
|
|
|
|
|
|
self.userInfoView.isManager = NO;
|
|
|
|
|
|
self.userInfoView.roomId = pkRoomId;
|
|
|
|
|
|
}else{
|
|
|
|
|
|
if (self.seatContentView.myPitNumber == 9 || self.roomModel.user_info.is_host.intValue == 1) {
|
|
|
|
|
|
self.userInfoView.isCompere = YES;
|
|
|
|
|
|
}else{
|
|
|
|
|
|
self.userInfoView.isCompere = NO;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (self.roomModel.user_info.is_room_owner.intValue == 1) {
|
|
|
|
|
|
self.userInfoView.isOwner = YES;
|
|
|
|
|
|
}else{
|
|
|
|
|
|
self.userInfoView.isOwner = NO;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (self.roomModel.user_info.is_management.intValue == 1) {
|
|
|
|
|
|
self.userInfoView.isManager = YES;
|
|
|
|
|
|
}else{
|
|
|
|
|
|
self.userInfoView.isManager = NO;
|
|
|
|
|
|
}
|
|
|
|
|
|
self.userInfoView.isNoTakeOff = isNoTakeOff;
|
|
|
|
|
|
self.userInfoView.roomId = self.roomModel.room_info.room_id;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (pitModel) {
|
|
|
|
|
|
// self.userInfoView.isUpSeat = YES;
|
|
|
|
|
|
self.userInfoView.pitNumber = pitModel.pit_number;
|
|
|
|
|
|
self.userInfoView.userId = pitModel.user_id;
|
|
|
|
|
|
}else{
|
|
|
|
|
|
// self.userInfoView.isUpSeat = NO;
|
|
|
|
|
|
self.userInfoView.pitNumber = @"";
|
|
|
|
|
|
if ([userModel isKindOfClass:[QXRoomOwnerModel class]]) {
|
|
|
|
|
|
QXRoomOwnerModel*md = (QXRoomOwnerModel*)userModel;
|
|
|
|
|
|
self.userInfoView.userId = md.user_id;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
[self.userInfoView showInView:self.view];
|
|
|
|
|
|
}
|
|
|
|
|
|
#pragma mark - QXRoomSettingViewDelegate
|
|
|
|
|
|
-(void)didClickSetModel:(QXRoomSettingModel *)model{
|
|
|
|
|
|
switch (model.type) {
|
|
|
|
|
|
case QXRoomSettingTypeRoomClearMessage:{
|
|
|
|
|
|
[[QXRoomMessageManager shared] sendChatMessage:@"" messageType:(QXRoomMessageTypeClearMessage) needInsertMessage:NO];
|
|
|
|
|
|
[self.chatListView clearMessage];
|
|
|
|
|
|
[self.settingView hide];
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case QXRoomSettingTypeRoomSetting:{
|
|
|
|
|
|
MJWeakSelf
|
|
|
|
|
|
QXCreateRoomViewController *vc = [[QXCreateRoomViewController alloc] init];
|
|
|
|
|
|
vc.roomModel = self.roomModel;
|
|
|
|
|
|
vc.editSucceessBlock = ^(QXRoomModel * _Nonnull roomModel) {
|
|
|
|
|
|
weakSelf.roomModel = roomModel;
|
|
|
|
|
|
};
|
|
|
|
|
|
[self.navigationController pushViewController:vc animated:YES];
|
|
|
|
|
|
[self.settingView hide];
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case QXRoomSettingTypeRoomBgImage:{
|
|
|
|
|
|
self.roomBgSetView.roomId = self.roomId;
|
|
|
|
|
|
[self.roomBgSetView showInView:self.view];
|
|
|
|
|
|
[self.settingView hide];
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case QXRoomSettingTypeRoomBgMusic:{
|
|
|
|
|
|
if (_musicView == nil) {
|
|
|
|
|
|
[self.musicView showInView:self.view];
|
|
|
|
|
|
}
|
|
|
|
|
|
MJWeakSelf
|
|
|
|
|
|
self.musicView.closeActionBlock = ^{
|
|
|
|
|
|
[weakSelf.musicView removeFromSuperview];
|
|
|
|
|
|
[[QXAgoraEngine sharedEngine] ktv_EndSing];
|
|
|
|
|
|
self->_musicView = nil;
|
|
|
|
|
|
};
|
|
|
|
|
|
self.musicView.moreActionBlock = ^{
|
|
|
|
|
|
weakSelf.songListView.isBgMusic = [QXAgoraEngine sharedEngine].isPlayBgMusic;
|
|
|
|
|
|
[weakSelf.songListView showInView:weakSelf.view];
|
|
|
|
|
|
};
|
|
|
|
|
|
self.musicView.nextActionBlock = ^{
|
|
|
|
|
|
[[QXAgoraEngine sharedEngine] nextBgMusic];
|
|
|
|
|
|
};
|
|
|
|
|
|
self.musicView.pauseActionBlock = ^(UIButton * _Nonnull playBtn) {
|
|
|
|
|
|
playBtn.selected = !playBtn.selected;
|
|
|
|
|
|
if (playBtn.isSelected) {
|
|
|
|
|
|
[[QXAgoraEngine sharedEngine] pausePlayMusic];
|
|
|
|
|
|
}else{
|
|
|
|
|
|
[[QXAgoraEngine sharedEngine] resumePlayMusic];
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
[self.settingView hide];
|
|
|
|
|
|
self.songListView.isBgMusic = [QXAgoraEngine sharedEngine].isPlayBgMusic;
|
|
|
|
|
|
[self.songListView showInView:self.view];
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case QXRoomSettingTypeRoomReport:{
|
|
|
|
|
|
QXReportViewController *reportVC = [[QXReportViewController alloc] init];
|
|
|
|
|
|
reportVC.reportType = @"2";
|
|
|
|
|
|
reportVC.fromId = self.roomId;
|
|
|
|
|
|
[self.navigationController pushViewController:reportVC animated:YES];
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case QXRoomSettingTypeRoomSubsidy:{
|
|
|
|
|
|
QXRoomSubsidyViewController *reportVC = [[QXRoomSubsidyViewController alloc] init];
|
|
|
|
|
|
reportVC.room_id = self.roomId;
|
|
|
|
|
|
[self.navigationController pushViewController:reportVC animated:YES];
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
2025-10-20 09:43:10 +08:00
|
|
|
|
case QXRoomSettingTypeSendRedBag:{
|
|
|
|
|
|
QXRedBagSendView *redbagView = [[QXRedBagSendView alloc] init];
|
|
|
|
|
|
redbagView.room_id = self.roomId;
|
|
|
|
|
|
[redbagView showInView:self.view];
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
2025-08-08 10:49:36 +08:00
|
|
|
|
default:
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
-(void)didClickHeadLine{
|
|
|
|
|
|
self.sendHeadLineView.isHeadline = YES;
|
|
|
|
|
|
MJWeakSelf
|
|
|
|
|
|
showLoadingInView(self.view);
|
|
|
|
|
|
[QXMineNetwork headlineInitSuccessBlock:^(NSDictionary * _Nonnull dict) {
|
|
|
|
|
|
hideLoadingInView(weakSelf.view);
|
|
|
|
|
|
NSString *countdown = [NSString stringWithFormat:@"%@",dict[@"countdown"]];
|
|
|
|
|
|
NSString *next_money = [NSString stringWithFormat:@"%@",dict[@"next_money"]];
|
|
|
|
|
|
NSString *now_money = [NSString stringWithFormat:@"%@",dict[@"now_money"]];
|
|
|
|
|
|
weakSelf.sendHeadLineView.coin = next_money;
|
|
|
|
|
|
weakSelf.sendHeadLineView.now_coin = now_money;
|
|
|
|
|
|
weakSelf.sendHeadLineView.minutes = countdown;
|
|
|
|
|
|
|
|
|
|
|
|
[weakSelf.sendHeadLineView showInView:weakSelf.view];
|
|
|
|
|
|
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
|
|
|
|
|
hideLoadingInView(weakSelf.view);
|
|
|
|
|
|
}];
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
-(void)soundAction{
|
|
|
|
|
|
[self.soundListView showInView:self.view];
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#pragma mark - 用户信息查看后操作
|
|
|
|
|
|
-(void)didClickEventType:(QXRoomUserInfoViewEventType)evntType userModel:(nonnull QXRoomUserInfoModel *)userModel pitNumber:(nonnull NSString *)pitNumber{
|
|
|
|
|
|
switch (evntType) {
|
|
|
|
|
|
case QXRoomUserInfoViewEventTypeAtTA:{
|
|
|
|
|
|
// @TA
|
|
|
|
|
|
[self.bottomView atUserWithName:userModel.nickname];
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case QXRoomUserInfoViewEventTypeChat:{
|
|
|
|
|
|
// 聊天
|
|
|
|
|
|
[[QXGlobal shareGlobal] chatWithUserID:userModel.user_id nickname:userModel.nickname avatar:userModel.avatar navagationController:self.navigationController];
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case QXRoomUserInfoViewEventTypeGift:{
|
|
|
|
|
|
self.sendGiftView.type = QXSendGiftViewTypeRoom;
|
|
|
|
|
|
// 送礼物
|
|
|
|
|
|
if (self.sendGiftView.titles.count == 0) {
|
|
|
|
|
|
[self.sendGiftView reloadData];
|
|
|
|
|
|
}
|
|
|
|
|
|
QXRoomPitModel *model = [[QXRoomPitModel alloc] init];
|
|
|
|
|
|
model.pit_number = pitNumber;
|
|
|
|
|
|
model.user_id = userModel.user_id;
|
|
|
|
|
|
model.nickname = userModel.nickname;
|
|
|
|
|
|
model.avatar = userModel.avatar;
|
|
|
|
|
|
self.sendGiftView.userModel = model;
|
|
|
|
|
|
self.sendGiftView.roomId = self.userInfoView.roomId;
|
|
|
|
|
|
[self.sendGiftView showInView:self.view];
|
|
|
|
|
|
// [[QXGlobal shareGlobal] showView:self.sendGiftView controller:self popType:(PopViewTypeBottomToUpActionSheet) tapDismiss:YES finishBlock:^{
|
|
|
|
|
|
//
|
|
|
|
|
|
// }];
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
default:
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
-(void)sendGiftWithUser:(QXRoomPitModel *)user{
|
|
|
|
|
|
self.sendGiftView.type = QXSendGiftViewTypeRoom;
|
|
|
|
|
|
// 送礼物
|
|
|
|
|
|
if (self.sendGiftView.titles.count == 0) {
|
|
|
|
|
|
[self.sendGiftView reloadData];
|
|
|
|
|
|
}
|
|
|
|
|
|
QXRoomPitModel *model = [[QXRoomPitModel alloc] init];
|
|
|
|
|
|
model.pit_number = @"";
|
|
|
|
|
|
model.user_id = user.user_id;
|
|
|
|
|
|
model.nickname = user.nickname;
|
|
|
|
|
|
model.avatar = user.avatar;
|
|
|
|
|
|
self.sendGiftView.userModel = model;
|
|
|
|
|
|
self.sendGiftView.roomId = self.roomId;
|
|
|
|
|
|
[self.sendGiftView showInView:self.view];
|
|
|
|
|
|
// [[QXGlobal shareGlobal] showView:self.sendGiftView controller:self popType:(PopViewTypeBottomToUpActionSheet) tapDismiss:YES finishBlock:^{
|
|
|
|
|
|
//
|
|
|
|
|
|
// }];
|
|
|
|
|
|
}
|
|
|
|
|
|
#pragma - mark 麦位操作
|
|
|
|
|
|
-(void)upSeatAction{
|
|
|
|
|
|
// if (self.roomModel.room_info.room_up_pit_type.intValue == 1) {
|
|
|
|
|
|
// self.upSeatView.isCompere = (self.seatContentView.myPitNumber == 9 || self.roomModel.user_info.is_room_owner.intValue == 1);
|
|
|
|
|
|
// self.upSeatView.roomId = self.roomId;
|
|
|
|
|
|
// [self.upSeatView showInView:self.view];
|
|
|
|
|
|
// }else{
|
|
|
|
|
|
BOOL isUpSeat = !self.upSeatBtn.selected;
|
|
|
|
|
|
[self upDownSeatNetworkWithPitNum:@"" isUpSeat:isUpSeat];
|
|
|
|
|
|
// }
|
|
|
|
|
|
}
|
|
|
|
|
|
-(void)micTeamAction{
|
|
|
|
|
|
self.upSeatView.isCompere = (self.seatContentView.myPitNumber == 9 || self.roomModel.user_info.is_room_owner.intValue == 1);
|
|
|
|
|
|
self.upSeatView.roomId = self.roomId;
|
|
|
|
|
|
[self.upSeatView showInView:self.view];
|
|
|
|
|
|
}
|
|
|
|
|
|
-(void)upDownSeatNetworkWithPitNum:(NSString*)pitNum isUpSeat:(BOOL)isUpSeat{
|
|
|
|
|
|
[QXMineNetwork roomUpSeatWithRoomId:self.roomId pit_number:pitNum isUpSeat:isUpSeat successBlock:^(NSDictionary * _Nonnull dict) {
|
|
|
|
|
|
|
|
|
|
|
|
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
|
|
|
|
|
showToast(msg);
|
|
|
|
|
|
}];
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-(QXRoomSeatView *)seatContentView{
|
|
|
|
|
|
if (!_seatContentView) {
|
|
|
|
|
|
_seatContentView = [[QXRoomSeatView alloc] initWithType:(QXRoomSeatViewTypeNone)];
|
|
|
|
|
|
_seatContentView.hidden = YES;
|
|
|
|
|
|
_seatContentView.delegate = self;
|
|
|
|
|
|
}
|
|
|
|
|
|
return _seatContentView;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
-(QXRoomBottomView *)bottomView{
|
|
|
|
|
|
if (!_bottomView) {
|
|
|
|
|
|
_bottomView = [[QXRoomBottomView alloc] init];
|
|
|
|
|
|
_bottomView.delegate = self;
|
|
|
|
|
|
_bottomView.vc = self;
|
|
|
|
|
|
_bottomView.hidden = YES;
|
|
|
|
|
|
}
|
|
|
|
|
|
return _bottomView;
|
|
|
|
|
|
}
|
|
|
|
|
|
-(QXRoomChatListView *)chatListView{
|
|
|
|
|
|
if (!_chatListView) {
|
|
|
|
|
|
_chatListView = [[QXRoomChatListView alloc] init];
|
|
|
|
|
|
_chatListView.delegate = self;
|
|
|
|
|
|
}
|
|
|
|
|
|
return _chatListView;
|
|
|
|
|
|
}
|
|
|
|
|
|
- (QXRoomSongListView *)songListView{
|
|
|
|
|
|
if (!_songListView) {
|
|
|
|
|
|
_songListView = [[QXRoomSongListView alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
|
|
|
|
|
_songListView.roomId = self.roomId;
|
|
|
|
|
|
}
|
|
|
|
|
|
return _songListView;
|
|
|
|
|
|
}
|
|
|
|
|
|
- (QXSendGiftView *)sendGiftView{
|
|
|
|
|
|
if (!_sendGiftView) {
|
|
|
|
|
|
_sendGiftView = [[QXSendGiftView alloc] initWithType:QXSendGiftViewTypeRoom];
|
|
|
|
|
|
_sendGiftView.vc = self;
|
|
|
|
|
|
_sendGiftView.roomId = self.roomId;
|
|
|
|
|
|
// [_sendGiftView reloadData];
|
|
|
|
|
|
MJWeakSelf
|
2025-10-20 09:43:10 +08:00
|
|
|
|
_sendGiftView.roomSendSuccessBlock = ^(QXSendGiftViewType sendType, QXGiftModel * _Nonnull giftModel, NSString * _Nonnull giftCount, NSString * _Nonnull userId, NSString * _Nonnull optionId) {
|
|
|
|
|
|
// if (self->_continuousView == nil) {
|
2025-08-08 10:49:36 +08:00
|
|
|
|
[weakSelf.view addSubview:weakSelf.continuousView];
|
2025-10-20 09:43:10 +08:00
|
|
|
|
// }
|
2025-08-08 10:49:36 +08:00
|
|
|
|
weakSelf.continuousView.giftModel = giftModel;
|
2025-10-20 09:43:10 +08:00
|
|
|
|
weakSelf.continuousView.sendType = sendType;
|
2025-08-08 10:49:36 +08:00
|
|
|
|
weakSelf.continuousView.userId = userId;
|
2025-10-20 09:43:10 +08:00
|
|
|
|
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];
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-08-08 10:49:36 +08:00
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
return _sendGiftView;
|
|
|
|
|
|
}
|
|
|
|
|
|
-(QXSoundListView *)soundListView{
|
|
|
|
|
|
if (!_soundListView) {
|
|
|
|
|
|
_soundListView = [[QXSoundListView alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
|
|
|
|
|
}
|
|
|
|
|
|
return _soundListView;
|
|
|
|
|
|
}
|
|
|
|
|
|
-(UIButton *)soundBtn{
|
|
|
|
|
|
if (!_soundBtn) {
|
|
|
|
|
|
_soundBtn = [[UIButton alloc] init];
|
|
|
|
|
|
[_soundBtn setImage:[UIImage imageNamed:@"room_sound"] forState:(UIControlStateNormal)];
|
|
|
|
|
|
[_soundBtn addTarget:self action:@selector(soundAction) forControlEvents:(UIControlEventTouchUpInside)];
|
|
|
|
|
|
// _soundBtn.hidden = YES;
|
|
|
|
|
|
}
|
|
|
|
|
|
return _soundBtn;
|
|
|
|
|
|
}
|
|
|
|
|
|
-(UIButton *)upSeatBtn{
|
|
|
|
|
|
if (!_upSeatBtn) {
|
|
|
|
|
|
_upSeatBtn = [[UIButton alloc] init];
|
|
|
|
|
|
_upSeatBtn.needEventInterval = 0.5;
|
|
|
|
|
|
[_upSeatBtn setImage:[UIImage imageNamed:@"room_upseat"] forState:(UIControlStateNormal)];
|
|
|
|
|
|
[_upSeatBtn setImage:[UIImage imageNamed:@"room_downseat"] forState:(UIControlStateSelected)];
|
|
|
|
|
|
[_upSeatBtn addTarget:self action:@selector(upSeatAction) forControlEvents:(UIControlEventTouchUpInside)];
|
|
|
|
|
|
}
|
|
|
|
|
|
return _upSeatBtn;
|
|
|
|
|
|
}
|
|
|
|
|
|
-(QXUpSeatView *)upSeatView{
|
|
|
|
|
|
if (!_upSeatView) {
|
|
|
|
|
|
_upSeatView = [[QXUpSeatView alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
|
|
|
|
|
}
|
|
|
|
|
|
return _upSeatView;
|
|
|
|
|
|
}
|
|
|
|
|
|
#pragma mark - 特效
|
|
|
|
|
|
- (UIView *)bgEffectView {
|
|
|
|
|
|
if (!_bgEffectView) {
|
|
|
|
|
|
_bgEffectView = [[QXGiftPlayerManager shareManager] defaultBgEffectView];
|
|
|
|
|
|
}
|
|
|
|
|
|
return _bgEffectView;
|
|
|
|
|
|
}
|
|
|
|
|
|
-(QXRoomSettingView *)settingView{
|
|
|
|
|
|
if (!_settingView) {
|
|
|
|
|
|
_settingView = [[QXRoomSettingView alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
|
|
|
|
|
_settingView.delegate = self;
|
|
|
|
|
|
}
|
|
|
|
|
|
return _settingView;
|
|
|
|
|
|
}
|
|
|
|
|
|
-(QXRoomBgSettingView *)roomBgSetView{
|
|
|
|
|
|
if (!_roomBgSetView) {
|
|
|
|
|
|
_roomBgSetView = [[QXRoomBgSettingView alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
|
|
|
|
|
}
|
|
|
|
|
|
return _roomBgSetView;
|
|
|
|
|
|
}
|
|
|
|
|
|
-(QXRoomBgMusicView *)musicView{
|
|
|
|
|
|
if (!_musicView) {
|
|
|
|
|
|
_musicView = [[QXRoomBgMusicView alloc] init];
|
|
|
|
|
|
}
|
|
|
|
|
|
return _musicView;
|
|
|
|
|
|
}
|
|
|
|
|
|
-(QXRoomUserInfoView *)userInfoView{
|
|
|
|
|
|
if (!_userInfoView) {
|
|
|
|
|
|
_userInfoView = [[QXRoomUserInfoView alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
|
|
|
|
|
_userInfoView.delegate = self;
|
|
|
|
|
|
}
|
|
|
|
|
|
return _userInfoView;
|
|
|
|
|
|
}
|
|
|
|
|
|
-(QXHeadlineView *)headlineView{
|
|
|
|
|
|
if (!_headlineView) {
|
|
|
|
|
|
MJWeakSelf
|
|
|
|
|
|
_headlineView = [[QXHeadlineView alloc] init];
|
|
|
|
|
|
_headlineView.getHeadlineBlock = ^{
|
|
|
|
|
|
[weakSelf didClickHeadLine];
|
|
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
return _headlineView;
|
|
|
|
|
|
}
|
|
|
|
|
|
-(QXDirectSetScaleView *)sendHeadLineView{
|
|
|
|
|
|
if (!_sendHeadLineView) {
|
|
|
|
|
|
_sendHeadLineView = [[QXDirectSetScaleView alloc] init];
|
|
|
|
|
|
_sendHeadLineView.roomId = self.roomId;
|
|
|
|
|
|
}
|
|
|
|
|
|
return _sendHeadLineView;
|
|
|
|
|
|
}
|
|
|
|
|
|
-(QXRoomPKSearchView *)pkSearchView{
|
|
|
|
|
|
if (!_pkSearchView) {
|
|
|
|
|
|
_pkSearchView = [[QXRoomPKSearchView alloc] init];
|
|
|
|
|
|
}
|
|
|
|
|
|
return _pkSearchView;
|
|
|
|
|
|
}
|
|
|
|
|
|
-(QXCabinMovieView *)movieView{
|
|
|
|
|
|
if (!_movieView) {
|
|
|
|
|
|
_movieView = [[QXCabinMovieView alloc] init];
|
|
|
|
|
|
}
|
|
|
|
|
|
return _movieView;
|
|
|
|
|
|
}
|
|
|
|
|
|
-(QXContinuousGiftView *)continuousView{
|
|
|
|
|
|
if (!_continuousView) {
|
|
|
|
|
|
MJWeakSelf
|
|
|
|
|
|
_continuousView = [[QXContinuousGiftView alloc] initWithFrame:CGRectMake(SCREEN_WIDTH-65-12, SCREEN_HEIGHT-70-78-52-34-20-70, 65, 65)];
|
|
|
|
|
|
_continuousView.roomId = self.roomId;
|
|
|
|
|
|
_continuousView.dissMissBlock = ^(QXGiftModel * _Nonnull gift) {
|
|
|
|
|
|
[weakSelf.continuousView removeFromSuperview];
|
|
|
|
|
|
self->_continuousView = nil;
|
|
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
return _continuousView;
|
|
|
|
|
|
}
|
|
|
|
|
|
-(QXUpSeatCountView *)micTeamView{
|
|
|
|
|
|
if (!_micTeamView) {
|
|
|
|
|
|
_micTeamView = [[QXUpSeatCountView alloc] init];
|
|
|
|
|
|
MJWeakSelf
|
|
|
|
|
|
[_micTeamView addTapBlock:^(id _Nonnull obj) {
|
|
|
|
|
|
[weakSelf micTeamAction];
|
|
|
|
|
|
}];
|
|
|
|
|
|
// _micTeamView.needEventInterval = 0.5;
|
|
|
|
|
|
// [_micTeamView setImage:[UIImage imageNamed:@"room_mic_team"] forState:(UIControlStateNormal)];
|
|
|
|
|
|
// [_micTeamView addTarget:self action:@selector(micTeamAction) forControlEvents:(UIControlEventTouchUpInside)];
|
|
|
|
|
|
}
|
|
|
|
|
|
return _micTeamView;
|
|
|
|
|
|
}
|
2025-10-20 09:43:10 +08:00
|
|
|
|
-(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;
|
|
|
|
|
|
}
|
2025-10-24 10:52:40 +08:00
|
|
|
|
|
|
|
|
|
|
-(QXRoomEmojiView *)emojiView{
|
|
|
|
|
|
if (!_emojiView) {
|
|
|
|
|
|
_emojiView = [[QXRoomEmojiView alloc] init];
|
|
|
|
|
|
}
|
|
|
|
|
|
return _emojiView;
|
|
|
|
|
|
}
|
2025-10-27 17:05:46 +08:00
|
|
|
|
-(QXRoomDayTaskTagView *)dayTaskTagView{
|
|
|
|
|
|
if (!_dayTaskTagView) {
|
|
|
|
|
|
_dayTaskTagView = [[QXRoomDayTaskTagView alloc] init];
|
|
|
|
|
|
MJWeakSelf
|
|
|
|
|
|
_dayTaskTagView.startBlock = ^{
|
|
|
|
|
|
QXTaskViewController *vc = [[QXTaskViewController alloc] init];
|
|
|
|
|
|
[weakSelf.navigationController pushViewController:vc animated:YES];
|
|
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
return _dayTaskTagView;
|
|
|
|
|
|
}
|
2025-08-08 10:49:36 +08:00
|
|
|
|
@end
|
|
|
|
|
|
|