优化提交
This commit is contained in:
@@ -25,6 +25,8 @@
|
||||
@property (nonatomic,assign)BOOL isLogin;
|
||||
@property (nonatomic,strong)NSString *roomId;
|
||||
|
||||
@property (nonatomic,assign)BOOL isClickJoinRoom;
|
||||
|
||||
@property (nonatomic,strong)QXTimer *timer;
|
||||
@property (nonatomic,assign)NSInteger taskTime;
|
||||
@end
|
||||
@@ -193,10 +195,11 @@
|
||||
[[QXGlobal shareGlobal] logOut];
|
||||
return;
|
||||
}
|
||||
[UIApplication sharedApplication].idleTimerDisabled = YES;
|
||||
|
||||
navagationController = (QXBaseNavigationController*)KEYWINDOW.rootViewController;
|
||||
// navagationController.interactivePopGestureRecognizer.enabled = NO;
|
||||
if (_miniView) {
|
||||
[[QXGiftPlayerManager shareManager] startPlay];
|
||||
[_miniView removeFromSuperview];
|
||||
_miniView = nil;
|
||||
}
|
||||
@@ -204,6 +207,7 @@
|
||||
if ([navagationController.viewControllers containsObject:self.roomVC]) {
|
||||
return;
|
||||
}else{
|
||||
[UIApplication sharedApplication].idleTimerDisabled = YES;
|
||||
self.roomVC.hidesBottomBarWhenPushed = YES;
|
||||
[navagationController pushViewController:self.roomVC animated:YES];
|
||||
}
|
||||
@@ -212,29 +216,62 @@
|
||||
if (self.roomId && ![self.roomId isEqualToString:roomId]) {
|
||||
[self quitRoomWithRoomId:self.roomId];
|
||||
}
|
||||
[UIApplication sharedApplication].idleTimerDisabled = YES;
|
||||
MJWeakSelf
|
||||
if (isRejoin) {
|
||||
if (self.roomVC!=nil) {
|
||||
self.roomVC.hidesBottomBarWhenPushed = YES;
|
||||
[navagationController pushViewController:self.roomVC animated:YES];
|
||||
}else{
|
||||
self.roomVC = [[QXRoomViewController alloc] init];
|
||||
self.roomVC.roomId = roomId;
|
||||
self.roomVC.isReJoin = isRejoin;
|
||||
self.roomId = roomId;
|
||||
self.roomVC.hidesBottomBarWhenPushed = YES;
|
||||
[navagationController pushViewController:self.roomVC animated:YES];
|
||||
if (weakSelf.isClickJoinRoom) {
|
||||
return;
|
||||
}
|
||||
// showLoadingInView(KEYWINDOW)
|
||||
weakSelf.isClickJoinRoom = YES;
|
||||
[QXMineNetwork joinRoomWithRoomId:roomId successBlock:^(QXRoomModel * _Nonnull roomModel) {
|
||||
// hideLoadingInView(KEYWINDOW)
|
||||
// roomModel.room_info.pk_room_id = @"33";
|
||||
weakSelf.isClickJoinRoom = NO;
|
||||
weakSelf.roomVC = [[QXRoomViewController alloc] init];
|
||||
weakSelf.roomVC.roomId = roomId;
|
||||
weakSelf.roomVC.isReJoin = isRejoin;
|
||||
weakSelf.roomId = roomId;
|
||||
weakSelf.roomVC.roomModel = roomModel;
|
||||
weakSelf.roomVC.hidesBottomBarWhenPushed = YES;
|
||||
[navagationController pushViewController:weakSelf.roomVC animated:YES];
|
||||
weakSelf.roomId = roomId;
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
showToast(msg);
|
||||
// hideLoadingInView(KEYWINDOW)
|
||||
weakSelf.isClickJoinRoom = NO;
|
||||
}];
|
||||
}
|
||||
}else{
|
||||
if ([roomId isEqualToString:self.roomVC.roomId]) {
|
||||
[navagationController pushViewController:self.roomVC animated:YES];
|
||||
}else{
|
||||
self.roomVC = [[QXRoomViewController alloc] init];
|
||||
self.roomVC.roomId = roomId;
|
||||
self.roomVC.isReJoin = isRejoin;
|
||||
self.roomId = roomId;
|
||||
self.roomVC.hidesBottomBarWhenPushed = YES;
|
||||
|
||||
[navagationController pushViewController:self.roomVC animated:YES];
|
||||
// showLoadingInView(KEYWINDOW)
|
||||
if (weakSelf.isClickJoinRoom) {
|
||||
return;
|
||||
}
|
||||
weakSelf.isClickJoinRoom = YES;
|
||||
[QXMineNetwork joinRoomWithRoomId:roomId successBlock:^(QXRoomModel * _Nonnull roomModel) {
|
||||
// hideLoadingInView(KEYWINDOW)
|
||||
// roomModel.room_info.pk_room_id = @"33";
|
||||
weakSelf.isClickJoinRoom = NO;
|
||||
weakSelf.roomVC = [[QXRoomViewController alloc] init];
|
||||
weakSelf.roomVC.roomId = roomId;
|
||||
weakSelf.roomVC.isReJoin = isRejoin;
|
||||
weakSelf.roomId = roomId;
|
||||
weakSelf.roomVC.roomModel = roomModel;
|
||||
weakSelf.roomVC.hidesBottomBarWhenPushed = YES;
|
||||
[navagationController pushViewController:weakSelf.roomVC animated:YES];
|
||||
weakSelf.roomId = roomId;
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
weakSelf.isClickJoinRoom = NO;
|
||||
showToast(msg);
|
||||
// hideLoadingInView(KEYWINDOW)
|
||||
}];
|
||||
}
|
||||
}
|
||||
if (QXGlobal.shareGlobal.taskModel != nil) {
|
||||
@@ -255,18 +292,21 @@
|
||||
|
||||
|
||||
-(void)quitRoomWithRoomId:(NSString *)roomId{
|
||||
[UIApplication sharedApplication].idleTimerDisabled = NO;
|
||||
/// 移除特效
|
||||
[[QXGiftPlayerManager shareManager] destroyEffectSvga];
|
||||
/// 退出声网
|
||||
[[QXAgoraEngine sharedEngine] leaveChannel];
|
||||
|
||||
/// 销毁播放器
|
||||
[[QXAgoraEngine sharedEngine] ktv_DestoryKtvPlayer];
|
||||
|
||||
/// 销毁整个声网示例
|
||||
[[QXAgoraEngine sharedEngine] destroyEngine];
|
||||
/// 退出直播群
|
||||
[[QXRoomMessageManager shared] quitGroupWithRoomId:roomId];
|
||||
if (_roomVC) {
|
||||
/// 回收麦位视图内存
|
||||
[_roomVC.seatContentView destroyViews];
|
||||
/// 回收控制器内存
|
||||
[_roomVC destroyViews];
|
||||
}
|
||||
self.roomId = nil;
|
||||
@@ -287,6 +327,7 @@
|
||||
self.miniView.roomId = self.roomId;
|
||||
self.miniView.roomCoverImage = roomCover;
|
||||
[self.miniView show];
|
||||
[[QXGiftPlayerManager shareManager] stopPlay];
|
||||
}
|
||||
|
||||
-(QXMiniRoomView *)miniView{
|
||||
|
||||
Reference in New Issue
Block a user