This commit is contained in:
启星
2025-12-22 10:16:05 +08:00
parent ba4fd658a9
commit 0fcff85625
205 changed files with 26298 additions and 13203 deletions

View File

@@ -39,6 +39,8 @@
@property (nonatomic,strong)NSTimer *keepTimer;
@property (nonatomic,assign)NSInteger taskTime;
@property (nonatomic,assign)BOOL isAlert;
@end
@implementation QXGlobal
+ (instancetype)shareGlobal {
@@ -214,7 +216,10 @@
[navagationController pushViewController:vc animated:YES];
}
-(void)joinRoomWithRoomId:(NSString *)roomId isRejoin:(BOOL)isRejoin navagationController:(UINavigationController *)navagationController{
-(void)joinRoomWithRoomId:(NSString *)roomId isRejoin:(BOOL)isRejoin navagationController:(UINavigationController *)navagationController {
if ([KEYWINDOW.rootViewController isKindOfClass:[NSClassFromString(@"QXAppStartViewController") class]]) {
return;
}
if (!QXGlobal.shareGlobal.isLogin) {
[[QXGlobal shareGlobal] logOut];
return;
@@ -222,10 +227,7 @@
navagationController = (QXRoomNavigationController*)KEYWINDOW.rootViewController;
// navagationController.interactivePopGestureRecognizer.enabled = NO;
if (_miniView) {
[_miniView removeFromSuperview];
_miniView = nil;
}
if (QXGlobal.shareGlobal.taskModel != nil) {
///
if (QXGlobal.shareGlobal.taskModel.task_id.intValue == 9) {
@@ -241,6 +243,10 @@
}
}
if ([roomId isEqualToString:self.roomId]) {
if (_miniView) {
[_miniView removeFromSuperview];
_miniView = nil;
}
if ([navagationController.viewControllers containsObject:self.roomVC]) {
if (![navagationController.visibleViewController isEqual:self.roomVC]) {
[navagationController popToViewController:self.roomVC animated:YES];
@@ -296,31 +302,43 @@
return;
}
weakSelf.isClickJoinRoom = YES;
[[QXRoomMessageManager shared] joinGroupWithRoomId:roomId];
[QXMineNetwork joinRoomWithRoomId:roomId successBlock:^(QXRoomModel * _Nonnull roomModel) {
if (weakSelf.roomId && ![weakSelf.roomId isEqualToString:roomId]) {
[weakSelf quitRoomWithRoomId:weakSelf.roomId removeListener:NO];
}
// hideLoadingInView(KEYWINDOW)
// roomModel.room_info.pk_room_id = @"33";
[UIApplication sharedApplication].idleTimerDisabled = YES;
[QXMineNetwork beforeJoinRoomWithRoomId:roomId successBlock:^(NSDictionary * _Nonnull dict) {
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;
if (self != nil) {
if (self->_miniView) {
[self->_miniView removeFromSuperview];
self->_miniView = nil;
}
}
[[QXRoomMessageManager shared] joinGroupWithRoomId:roomId];
[QXMineNetwork joinRoomWithRoomId:roomId successBlock:^(QXRoomModel * _Nonnull roomModel) {
if (weakSelf.roomId && ![weakSelf.roomId isEqualToString:roomId]) {
[weakSelf quitRoomWithRoomId:weakSelf.roomId removeListener:NO];
}
[[QXRoomMessageManager shared] joinGroupWithRoomId:roomId];
[UIApplication sharedApplication].idleTimerDisabled = YES;
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;
} roomErrorBlock:^(NSString * _Nonnull roomId, NSString * _Nonnull msg) {
[weakSelf showAlertWithMessage:msg roomId:roomId];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
// hideLoadingInView(KEYWINDOW)
}];
} roomErrorBlock:^(NSString * _Nonnull roomId, NSString * _Nonnull msg) {
weakSelf.isClickJoinRoom = NO;
[weakSelf showAlertWithMessage:msg roomId:roomId];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
weakSelf.isClickJoinRoom = NO;
showToast(msg);
// hideLoadingInView(KEYWINDOW)
}];
}
}
}