|
|
|
|
@@ -51,7 +51,6 @@ QXRoomUserInfoViewDelegate
|
|
|
|
|
/// 排麦按钮
|
|
|
|
|
@property (nonatomic,strong)QXUpSeatCountView *micTeamView;
|
|
|
|
|
|
|
|
|
|
@property (nonatomic,strong)QXRoomModel* roomModel;
|
|
|
|
|
/// 礼物特效
|
|
|
|
|
@property (nonatomic,strong)UIView *bgEffectView;
|
|
|
|
|
/// 设置
|
|
|
|
|
@@ -84,7 +83,6 @@ QXRoomUserInfoViewDelegate
|
|
|
|
|
-(void)viewWillAppear:(BOOL)animated{
|
|
|
|
|
[super viewWillAppear:animated];
|
|
|
|
|
[self.navigationController setNavigationBarHidden:YES animated:YES];
|
|
|
|
|
[UIApplication sharedApplication].idleTimerDisabled = YES;
|
|
|
|
|
}
|
|
|
|
|
-(void)viewDidAppear:(BOOL)animated{
|
|
|
|
|
[super viewDidAppear:animated];
|
|
|
|
|
@@ -107,8 +105,7 @@ QXRoomUserInfoViewDelegate
|
|
|
|
|
}
|
|
|
|
|
-(void)viewDidDisappear:(BOOL)animated{
|
|
|
|
|
[super viewDidDisappear:animated];
|
|
|
|
|
[UIApplication sharedApplication].idleTimerDisabled = NO;
|
|
|
|
|
[[QXGiftPlayerManager shareManager] stopPlay];
|
|
|
|
|
// [[QXGiftPlayerManager shareManager] stopPlay];
|
|
|
|
|
self.continuousView.hidden = YES;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -218,27 +215,14 @@ QXRoomUserInfoViewDelegate
|
|
|
|
|
BOOL isClose = [[NSUserDefaults standardUserDefaults] boolForKey:kEffectsCLose];
|
|
|
|
|
[[QXGiftPlayerManager shareManager] openOrCloseEffectViewWith:!isClose];
|
|
|
|
|
}
|
|
|
|
|
#pragma mark - 获取房间信息
|
|
|
|
|
-(void)joinRoom{
|
|
|
|
|
-(void)setRoomModel:(QXRoomModel *)roomModel{
|
|
|
|
|
_roomModel = roomModel;
|
|
|
|
|
}
|
|
|
|
|
-(void)setRoomId:(NSString *)roomId{
|
|
|
|
|
_roomId = roomId;
|
|
|
|
|
[self.chatListView insertNoitce];
|
|
|
|
|
[[QXRoomMessageManager shared] joinGroupWithRoomId:self.roomId];
|
|
|
|
|
MJWeakSelf
|
|
|
|
|
[QXMineNetwork joinRoomWithRoomId:self.roomId successBlock:^(QXRoomModel * _Nonnull roomModel) {
|
|
|
|
|
// roomModel.room_info.pk_room_id = @"33";
|
|
|
|
|
weakSelf.roomModel = roomModel;
|
|
|
|
|
[weakSelf resetSubviews];
|
|
|
|
|
[weakSelf configRoomDataIsJoin:YES];
|
|
|
|
|
|
|
|
|
|
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
|
|
|
|
showToast(msg);
|
|
|
|
|
[[QXGlobal shareGlobal] quitRoomWithRoomId:self.roomId];
|
|
|
|
|
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
|
|
|
|
[weakSelf.navigationController popViewControllerAnimated:YES];
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[QXMineNetwork roomOnlineListWithRoomId:self.roomId page:1 successBlock:^(NSArray<QXRoomUserInfoModel *> * _Nonnull onPitList, NSArray<QXRoomUserInfoModel *> * _Nonnull offPitList) {
|
|
|
|
|
NSMutableArray *arr = [NSMutableArray arrayWithArray:onPitList];
|
|
|
|
|
[arr addObjectsFromArray:offPitList];
|
|
|
|
|
@@ -246,6 +230,27 @@ QXRoomUserInfoViewDelegate
|
|
|
|
|
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
|
|
|
|
|
|
|
|
|
}];
|
|
|
|
|
}
|
|
|
|
|
#pragma mark - 获取房间信息
|
|
|
|
|
-(void)joinRoom{
|
|
|
|
|
|
|
|
|
|
[self resetSubviews];
|
|
|
|
|
[self configRoomDataIsJoin:YES];
|
|
|
|
|
// [QXMineNetwork joinRoomWithRoomId:self.roomId successBlock:^(QXRoomModel * _Nonnull roomModel) {
|
|
|
|
|
//// roomModel.room_info.pk_room_id = @"33";
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
|
|
|
|
// showToast(msg);
|
|
|
|
|
// [[QXGlobal shareGlobal] quitRoomWithRoomId:self.roomId];
|
|
|
|
|
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
|
|
|
|
// [weakSelf.navigationController popViewControllerAnimated:YES];
|
|
|
|
|
// });
|
|
|
|
|
//
|
|
|
|
|
// }];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
-(void)getUserOnlineStatusWithUserIds:(NSString*)userIds{
|
|
|
|
|
[QXMineNetwork roomUserOnlineStatusWithUserIds:userIds roomId:self.roomId successBlock:^(NSArray<QXUserModel *> * _Nonnull list) {
|
|
|
|
|
@@ -283,7 +288,7 @@ QXRoomUserInfoViewDelegate
|
|
|
|
|
}else{
|
|
|
|
|
self.roomBgImageView.image = [UIImage imageNamed:@"cp_room_bg"];
|
|
|
|
|
}
|
|
|
|
|
if (self.roomModel.room_info.type_id.intValue == 1 || self.roomModel.room_info.type_id.intValue == 3 || self.roomModel.room_info.type_id.intValue == 4) {
|
|
|
|
|
if (self.roomModel.room_info.type_id.intValue == 1 || self.roomModel.room_info.type_id.intValue == 3 || self.roomModel.room_info.type_id.intValue == 4 || self.roomModel.room_info.type_id.intValue == 8) {
|
|
|
|
|
// 点唱房
|
|
|
|
|
if (self.roomModel.room_info.label_id.intValue == 1) {
|
|
|
|
|
|
|
|
|
|
@@ -414,7 +419,7 @@ QXRoomUserInfoViewDelegate
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
self.seatContentView.roomModel = self.roomModel;
|
|
|
|
|
if ((self.roomModel.room_info.type_id.intValue == 1 || self.roomModel.room_info.type_id.intValue == 3 || self.roomModel.room_info.type_id.intValue == 4) && self.roomModel.room_info.label_id.intValue == 2){
|
|
|
|
|
if ((self.roomModel.room_info.type_id.intValue == 1 || self.roomModel.room_info.type_id.intValue == 3 || self.roomModel.room_info.type_id.intValue == 4 || self.roomModel.room_info.type_id.intValue == 8) && self.roomModel.room_info.label_id.intValue == 2){
|
|
|
|
|
/// k歌房没有背景音乐
|
|
|
|
|
[QXAgoraEngine sharedEngine].isPlayBgMusic = NO;
|
|
|
|
|
}else{
|
|
|
|
|
@@ -439,7 +444,7 @@ QXRoomUserInfoViewDelegate
|
|
|
|
|
if (isJoin) {
|
|
|
|
|
MJWeakSelf
|
|
|
|
|
[[QXAgoraEngine sharedEngine] joinChannel:self.roomId withRoom:self agora_token:self.roomModel.user_info.agora_token agora_rtm_token:self.roomModel.user_info.agora_rtm_token isUpSeat:self.seatContentView.myPitNumber>0 successBock:^{
|
|
|
|
|
if (weakSelf.roomModel.song_user_info && (weakSelf.roomModel.room_info.type_id.intValue == 1 || weakSelf.roomModel.room_info.type_id.intValue == 3 || weakSelf.roomModel.room_info.type_id.intValue == 4) && weakSelf.roomModel.room_info.label_id.intValue == 2) {
|
|
|
|
|
if (weakSelf.roomModel.song_user_info && (weakSelf.roomModel.room_info.type_id.intValue == 1 || weakSelf.roomModel.room_info.type_id.intValue == 3 || weakSelf.roomModel.room_info.type_id.intValue == 4 || weakSelf.roomModel.room_info.type_id.intValue == 8) && weakSelf.roomModel.room_info.label_id.intValue == 2) {
|
|
|
|
|
if ([weakSelf.roomModel.song_user_info.user_id isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
|
|
|
|
|
// [[QXAgoraEngine sharedEngine] ktv_EndSing];
|
|
|
|
|
// [[QXAgoraEngine sharedEngine] ktv_StartSing:YES withSong:weakSelf.roomModel.song_user_info];
|
|
|
|
|
@@ -477,7 +482,7 @@ QXRoomUserInfoViewDelegate
|
|
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
if (self.roomModel.song_user_info && (self.roomModel.room_info.type_id.intValue == 1 || self.roomModel.room_info.type_id.intValue == 3 || self.roomModel.room_info.type_id.intValue == 4) && self.roomModel.room_info.label_id.intValue == 2) {
|
|
|
|
|
if (self.roomModel.song_user_info && (self.roomModel.room_info.type_id.intValue == 1 || self.roomModel.room_info.type_id.intValue == 3 || self.roomModel.room_info.type_id.intValue == 4 || self.roomModel.room_info.type_id.intValue == 8) && self.roomModel.room_info.label_id.intValue == 2) {
|
|
|
|
|
if ([self.roomModel.song_user_info.user_id isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
|
|
|
|
|
self.seatContentView.songInfo = self.roomModel.song_user_info;
|
|
|
|
|
self.seatContentView.nextInfo = self.roomModel.nextInfo;
|
|
|
|
|
@@ -491,7 +496,7 @@ QXRoomUserInfoViewDelegate
|
|
|
|
|
[QXAgoraEngine sharedEngine].delegate = self;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (self.roomModel.room_info.type_id.intValue == 1 || self.roomModel.room_info.type_id.intValue == 3 || self.roomModel.room_info.type_id.intValue == 4) {
|
|
|
|
|
if (self.roomModel.room_info.type_id.intValue == 1 || self.roomModel.room_info.type_id.intValue == 3 || self.roomModel.room_info.type_id.intValue == 4 || self.roomModel.room_info.type_id.intValue == 8) {
|
|
|
|
|
// 点唱房
|
|
|
|
|
if (self.roomModel.room_info.label_id.intValue == 1) {
|
|
|
|
|
if (self.roomModel.pk_info.pk_id.intValue>0) {
|
|
|
|
|
@@ -534,11 +539,11 @@ QXRoomUserInfoViewDelegate
|
|
|
|
|
}
|
|
|
|
|
self.bottomView.roomModel = self.roomModel;
|
|
|
|
|
BOOL hasPK = NO;
|
|
|
|
|
if ((self.roomModel.room_info.type_id.intValue == 1 || self.roomModel.room_info.type_id.intValue == 3 || self.roomModel.room_info.type_id.intValue == 4) && self.roomModel.room_info.label_id.intValue == 1) {
|
|
|
|
|
if ((self.roomModel.room_info.type_id.intValue == 1 || self.roomModel.room_info.type_id.intValue == 3 || self.roomModel.room_info.type_id.intValue == 4 || self.roomModel.room_info.type_id.intValue == 8) && self.roomModel.room_info.label_id.intValue == 1) {
|
|
|
|
|
hasPK = YES;
|
|
|
|
|
}
|
|
|
|
|
BOOL hasSong = 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){
|
|
|
|
|
if (self.roomModel.room_info.type_id.intValue == 1 || self.roomModel.room_info.type_id.intValue == 3 || self.roomModel.room_info.type_id.intValue == 4 || self.roomModel.room_info.type_id.intValue == 8){
|
|
|
|
|
hasSong = YES;
|
|
|
|
|
}
|
|
|
|
|
/// 暂时不要pk
|
|
|
|
|
@@ -634,7 +639,7 @@ QXRoomUserInfoViewDelegate
|
|
|
|
|
}
|
|
|
|
|
// 演唱者歌曲播放回调
|
|
|
|
|
-(void)rtcEngineSongProgress:(NSUInteger)progress{
|
|
|
|
|
if ((self.roomModel.room_info.type_id.intValue == 1 || self.roomModel.room_info.type_id.intValue == 3 || self.roomModel.room_info.type_id.intValue == 4) && self.roomModel.room_info.label_id.intValue == 2) {
|
|
|
|
|
if ((self.roomModel.room_info.type_id.intValue == 1 || self.roomModel.room_info.type_id.intValue == 3 || self.roomModel.room_info.type_id.intValue == 4 || self.roomModel.room_info.type_id.intValue == 8) && self.roomModel.room_info.label_id.intValue == 2) {
|
|
|
|
|
self.seatContentView.progress = progress;
|
|
|
|
|
}else{
|
|
|
|
|
self.musicView.progress = progress;
|
|
|
|
|
@@ -782,6 +787,9 @@ QXRoomUserInfoViewDelegate
|
|
|
|
|
-(void)didRecieveGiftWithWithUserInfo:(QXUserHomeModel *)userInfo{
|
|
|
|
|
[self.seatContentView setSeatCharmWithUser:userInfo];
|
|
|
|
|
}
|
|
|
|
|
-(void)didRecieveGiftWithWithUserInfos:(NSArray<QXUserHomeModel *> *)userInfos{
|
|
|
|
|
[self.seatContentView setSeatCharmWithUsers:userInfos];
|
|
|
|
|
}
|
|
|
|
|
/// 拍卖者上麦
|
|
|
|
|
-(void)auctionUpSeatWithUserInfo:(QXUserHomeModel *)userInfo isUpSeat:(BOOL)isUpSeat{
|
|
|
|
|
[self.seatContentView didAuctiontUpDownSeatWithUser:userInfo isUpSeat:isUpSeat];
|
|
|
|
|
@@ -1065,6 +1073,7 @@ QXRoomUserInfoViewDelegate
|
|
|
|
|
-(void)recieveHeadline:(QXHeadLineModel *)headline{
|
|
|
|
|
if (_headlineView) {
|
|
|
|
|
self.headlineView.model = headline;
|
|
|
|
|
[self.view addSubview:self.headlineView];
|
|
|
|
|
}else{
|
|
|
|
|
self.headlineView.model = headline;
|
|
|
|
|
[self.view addSubview:self.headlineView];
|
|
|
|
|
@@ -1083,7 +1092,7 @@ QXRoomUserInfoViewDelegate
|
|
|
|
|
case QXRoomBottomViewEventTypeMuteAudio:{
|
|
|
|
|
if (!isSelected) {
|
|
|
|
|
/// 静音时麦圈停止
|
|
|
|
|
if ((self.roomModel.room_info.type_id.intValue == 1 || self.roomModel.room_info.type_id.intValue == 3 || self.roomModel.room_info.type_id.intValue == 4) && self.roomModel.room_info.label_id.intValue == 1) {
|
|
|
|
|
if ((self.roomModel.room_info.type_id.intValue == 1 || self.roomModel.room_info.type_id.intValue == 3 || self.roomModel.room_info.type_id.intValue == 4 || self.roomModel.room_info.type_id.intValue == 8) && self.roomModel.room_info.label_id.intValue == 1) {
|
|
|
|
|
// QXRoomSeatContentView *seatContentView = self.seatContentView.normalSeatView.mySeatView;
|
|
|
|
|
// if (seatContentView.isSeatSpeaking) {
|
|
|
|
|
// [seatContentView stopAudioAnimation];
|
|
|
|
|
@@ -1164,7 +1173,7 @@ QXRoomUserInfoViewDelegate
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
case QXRoomBottomViewEventTypeMusic:{
|
|
|
|
|
if ((self.roomModel.room_info.type_id.intValue == 1 || self.roomModel.room_info.type_id.intValue == 3 || self.roomModel.room_info.type_id.intValue == 4) && self.roomModel.room_info.label_id.intValue == 1){
|
|
|
|
|
if ((self.roomModel.room_info.type_id.intValue == 1 || self.roomModel.room_info.type_id.intValue == 3 || self.roomModel.room_info.type_id.intValue == 4 || self.roomModel.room_info.type_id.intValue == 8) && self.roomModel.room_info.label_id.intValue == 1){
|
|
|
|
|
MJWeakSelf
|
|
|
|
|
QXAlertView *al = [[QXAlertView alloc] initWithFrame:CGRectMake(0, 0, ScaleWidth(300), ScaleWidth(175))];
|
|
|
|
|
al.type = QXAlertViewTypeApplySong;
|
|
|
|
|
@@ -1198,14 +1207,17 @@ QXRoomUserInfoViewDelegate
|
|
|
|
|
if (self.roomModel.room_info.pit_list.count == 10) {
|
|
|
|
|
QXRoomPitModel *md = self.roomModel.room_info.pit_list[8];
|
|
|
|
|
if (md.user_id.longValue > 0 && ![QXGlobal.shareGlobal.loginModel.user_id isEqualToString:md.user_id]) {
|
|
|
|
|
md.isSelected = NO;
|
|
|
|
|
[pitArr addObject:md];
|
|
|
|
|
QXRoomPitModel *lastMd = self.roomModel.room_info.pit_list[9];
|
|
|
|
|
if (lastMd.user_id.longValue > 0 && ![QXGlobal.shareGlobal.loginModel.user_id isEqualToString:lastMd.user_id]) {
|
|
|
|
|
lastMd.isSelected = NO;
|
|
|
|
|
[pitArr addObject:lastMd];
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
QXRoomPitModel *lastMd = self.roomModel.room_info.pit_list[9];
|
|
|
|
|
if (lastMd.user_id.longValue > 0 && ![QXGlobal.shareGlobal.loginModel.user_id isEqualToString:lastMd.user_id]) {
|
|
|
|
|
lastMd.isSelected = NO;
|
|
|
|
|
[pitArr addObject:lastMd];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -1261,6 +1273,7 @@ QXRoomUserInfoViewDelegate
|
|
|
|
|
md.user_id = self.roomModel.song_user_info.user_id;
|
|
|
|
|
md.avatar = self.roomModel.song_user_info.avatar;
|
|
|
|
|
md.pit_number = @"9999";
|
|
|
|
|
md.isSelected = NO;
|
|
|
|
|
[pitArr addObject:md];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -1270,6 +1283,7 @@ QXRoomUserInfoViewDelegate
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if (md.user_id.longValue > 0 && ![QXGlobal.shareGlobal.loginModel.user_id isEqualToString:md.user_id]) {
|
|
|
|
|
md.isSelected = NO;
|
|
|
|
|
[pitArr addObject:md];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -1282,6 +1296,7 @@ QXRoomUserInfoViewDelegate
|
|
|
|
|
md.user_id = self.roomModel.room_auction.auction_user.user_id;
|
|
|
|
|
md.avatar = self.roomModel.room_auction.auction_user.avatar;
|
|
|
|
|
md.pit_number = @"9999";
|
|
|
|
|
md.isSelected = NO;
|
|
|
|
|
[pitArr addObject:md];
|
|
|
|
|
}
|
|
|
|
|
if (self.roomModel.room_auction.auction_list.count > 0) {
|
|
|
|
|
@@ -1290,6 +1305,7 @@ QXRoomUserInfoViewDelegate
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if (md.user_id.longValue > 0 && ![QXGlobal.shareGlobal.loginModel.user_id isEqualToString:md.user_id]) {
|
|
|
|
|
md.isSelected = NO;
|
|
|
|
|
[pitArr addObject:md];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|