From acc4cffad29622f867b831edc33d27154b239c6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=AF=E6=98=9F?= Date: Tue, 28 Oct 2025 09:18:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=AF=8F=E6=97=A5=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E8=B7=B3=E8=BD=AC=E6=88=BF=E9=97=B4=E5=87=BA=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- QXLive.xcodeproj/project.pbxproj | 12 ++-- QXLive/Base/QXBaseViewController.m | 6 ++ QXLive/Base/QXGlobal.h | 3 +- QXLive/Base/QXGlobal.m | 38 ++++++----- QXLive/Base/QXRoomNavigationController.h | 16 +++++ QXLive/Base/QXRoomNavigationController.m | 64 +++++++++++++++++++ .../Controller/每日任务/QXTaskViewController.m | 1 + .../Mine(音域)/View/每日任务/QXDayTaskCell.m | 3 + QXLive/Other/AppDelegate.m | 3 +- QXLive/Other/PrefixHeader.pch | 2 + .../Controller/QXRoomViewController.m | 17 ++++- QXLive/Room(房间)/View/QXRoomChatListView.m | 10 ++- 12 files changed, 149 insertions(+), 26 deletions(-) create mode 100644 QXLive/Base/QXRoomNavigationController.h create mode 100644 QXLive/Base/QXRoomNavigationController.m diff --git a/QXLive.xcodeproj/project.pbxproj b/QXLive.xcodeproj/project.pbxproj index 87707c5..bdf9c02 100644 --- a/QXLive.xcodeproj/project.pbxproj +++ b/QXLive.xcodeproj/project.pbxproj @@ -748,7 +748,7 @@ CODE_SIGN_ENTITLEMENTS = QXLive/QXLive.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 2; DEVELOPMENT_TEAM = 8798G5VMH9; ENABLE_USER_SCRIPT_SANDBOXING = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -787,7 +787,7 @@ "$(inherited)", "$(SDKROOT)/usr/lib/swift", ); - MARKETING_VERSION = 1.0.0; + MARKETING_VERSION = 1.1.0; PRODUCT_BUNDLE_IDENTIFIER = com.qxcm.qxlive; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -814,7 +814,7 @@ CODE_SIGN_ENTITLEMENTS = QXLive/QXLive.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; + CURRENT_PROJECT_VERSION = 2; DEVELOPMENT_TEAM = 8798G5VMH9; ENABLE_USER_SCRIPT_SANDBOXING = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -853,7 +853,7 @@ "$(inherited)", "$(SDKROOT)/usr/lib/swift", ); - MARKETING_VERSION = 1.0.0; + MARKETING_VERSION = 1.1.0; PRODUCT_BUNDLE_IDENTIFIER = com.qxcm.qxlive; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1207,7 +1207,7 @@ "$(inherited)", "$(SDKROOT)/usr/lib/swift", ); - MARKETING_VERSION = 1.0.1; + MARKETING_VERSION = 1.0.0; PRODUCT_BUNDLE_IDENTIFIER = com.qxcm.qxlive.test; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; @@ -1271,7 +1271,7 @@ "$(inherited)", "$(SDKROOT)/usr/lib/swift", ); - MARKETING_VERSION = 1.0.1; + MARKETING_VERSION = 1.0.0; PRODUCT_BUNDLE_IDENTIFIER = com.qxcm.qxlive.test; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; diff --git a/QXLive/Base/QXBaseViewController.m b/QXLive/Base/QXBaseViewController.m index aeb004d..67b64e4 100644 --- a/QXLive/Base/QXBaseViewController.m +++ b/QXLive/Base/QXBaseViewController.m @@ -25,6 +25,12 @@ [self getData]; self.page = 1; } +-(void)viewWillDisappear:(BOOL)animated{ + [super viewWillDisappear:animated]; + if ([self.navigationController isKindOfClass:[QXRoomNavigationController class]]) { + [self.navigationController setNavigationBarHidden:YES animated:NO]; + } +} -(void)didReceiveMemoryWarning{ [super didReceiveMemoryWarning]; [[SDImageCache sharedImageCache] clearMemory]; diff --git a/QXLive/Base/QXGlobal.h b/QXLive/Base/QXGlobal.h index 3e4ea39..71d9193 100644 --- a/QXLive/Base/QXGlobal.h +++ b/QXLive/Base/QXGlobal.h @@ -96,7 +96,8 @@ typedef void (^showFinishBlock)(void); -(void)joinRoomWithRoomId:(NSString*)roomId isRejoin:(BOOL)isRejoin navagationController:(UINavigationController*)navagationController; - +/// 回到房间 +-(void)popToRoomViewController; /** 退出房间 */ diff --git a/QXLive/Base/QXGlobal.m b/QXLive/Base/QXGlobal.m index 47c097d..54b81a6 100644 --- a/QXLive/Base/QXGlobal.m +++ b/QXLive/Base/QXGlobal.m @@ -198,12 +198,26 @@ return; } - navagationController = (QXBaseNavigationController*)KEYWINDOW.rootViewController; + 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) { + /// 是计时任务 + if (_timer == nil) { + _timer = [QXTimer scheduledTimerWithTimeInterval:1 repeats:YES queue:dispatch_get_main_queue() block:^{ + QXGlobal.shareGlobal.taskTime++; + if (QXGlobal.shareGlobal.taskTime%60 == 0) { + [[QXGlobal shareGlobal] finishTask]; + } + }]; + } + } + } if ([roomId isEqualToString:self.roomId]) { if ([navagationController.viewControllers containsObject:self.roomVC]) { return; @@ -278,23 +292,17 @@ }]; } } - if (QXGlobal.shareGlobal.taskModel != nil) { - /// 是否带有每日任务 - if (QXGlobal.shareGlobal.taskModel.task_id.intValue == 9) { - /// 是计时任务 - if (_timer == nil) { - _timer = [QXTimer scheduledTimerWithTimeInterval:1 repeats:YES queue:dispatch_get_main_queue() block:^{ - QXGlobal.shareGlobal.taskTime++; - if (QXGlobal.shareGlobal.taskTime%60 == 0) { - [[QXGlobal shareGlobal] finishTask]; - } - }]; - } +} + +-(void)popToRoomViewController{ + QXRoomNavigationController *navagationController = (QXRoomNavigationController*)KEYWINDOW.rootViewController; + for (UIViewController *vc in navagationController.viewControllers) { + if ([vc isKindOfClass:[QXRoomViewController class]]) { + [navagationController popToViewController:vc animated:YES]; + break; } } } - - -(void)quitRoomWithRoomId:(NSString *)roomId{ [UIApplication sharedApplication].idleTimerDisabled = NO; /// 移除所有红包 diff --git a/QXLive/Base/QXRoomNavigationController.h b/QXLive/Base/QXRoomNavigationController.h new file mode 100644 index 0000000..5b4d626 --- /dev/null +++ b/QXLive/Base/QXRoomNavigationController.h @@ -0,0 +1,16 @@ +// +// QXRoomNavigationController.h +// QXLive +// +// Created by 启星 on 2025/10/27. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface QXRoomNavigationController : UINavigationController + +@end + +NS_ASSUME_NONNULL_END diff --git a/QXLive/Base/QXRoomNavigationController.m b/QXLive/Base/QXRoomNavigationController.m new file mode 100644 index 0000000..2efc13f --- /dev/null +++ b/QXLive/Base/QXRoomNavigationController.m @@ -0,0 +1,64 @@ +// +// QXRoomNavigationController.m +// QXLive +// +// Created by 启星 on 2025/10/27. +// + +#import "QXRoomNavigationController.h" + +@implementation QXRoomNavigationController + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. + self.interactivePopGestureRecognizer.delegate = self; + self.delegate = self; +} +-(void)viewWillAppear:(BOOL)animated{ + [super viewWillAppear:animated]; +} + +-(void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated{ + if (self.viewControllers.count == 1) { + viewController.hidesBottomBarWhenPushed = YES; + } +// if ([self respondsToSelector:@selector(interactivePopGestureRecognizer)]) { +// self.interactivePopGestureRecognizer.enabled = YES; +// } + [super pushViewController:viewController animated:animated]; +} +//-(UIViewController *)popViewControllerAnimated:(BOOL)animated{ +// if (self.childViewControllers.count == 2) { +// if ([self respondsToSelector:@selector(interactivePopGestureRecognizer)]) { +// self.interactivePopGestureRecognizer.enabled = YES; +// } +// } +// return [super popViewControllerAnimated:animated]; +//} +-(void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated{ + if (self.childViewControllers.count > 1) { + if ([self respondsToSelector:@selector(interactivePopGestureRecognizer)]) { + if ([self.visibleViewController isKindOfClass:NSClassFromString(@"QXRoomViewController")] || [self.visibleViewController isKindOfClass:NSClassFromString(@"QXChirldViewController")]) { + self.interactivePopGestureRecognizer.enabled = NO; + }else{ + self.interactivePopGestureRecognizer.enabled = YES; + } + } + }else{ + if ([self respondsToSelector:@selector(interactivePopGestureRecognizer)]) { + self.interactivePopGestureRecognizer.enabled = NO; + } + } +} +- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer { + return YES; +} + +- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer { + if (self.viewControllers.count == 1) { + return NO; + } + return YES; +} +@end diff --git a/QXLive/Mine(音域)/Controller/每日任务/QXTaskViewController.m b/QXLive/Mine(音域)/Controller/每日任务/QXTaskViewController.m index fbbcac9..6648ac8 100644 --- a/QXLive/Mine(音域)/Controller/每日任务/QXTaskViewController.m +++ b/QXLive/Mine(音域)/Controller/每日任务/QXTaskViewController.m @@ -29,6 +29,7 @@ [self.navigationController setNavigationBarHidden:NO animated:YES]; [self getDayTask]; } + -(void)setNavgationItems{ [super setNavgationItems]; self.navigationItem.title = QXText(@"每日任务"); diff --git a/QXLive/Mine(音域)/View/每日任务/QXDayTaskCell.m b/QXLive/Mine(音域)/View/每日任务/QXDayTaskCell.m index cde4290..ca37fb9 100644 --- a/QXLive/Mine(音域)/View/每日任务/QXDayTaskCell.m +++ b/QXLive/Mine(音域)/View/每日任务/QXDayTaskCell.m @@ -44,6 +44,9 @@ if (self.model.task_status.intValue == 1) { if (self.model.task_id.intValue == 9 || self.model.task_id.intValue == 10) { QXGlobal.shareGlobal.taskModel = self.model; + if ([[QXGlobal shareGlobal].roomId isEqualToString:self.model.from_id]) { + [[QXGlobal shareGlobal] popToRoomViewController]; + } [[QXGlobal shareGlobal] joinRoomWithRoomId:self.model.from_id isRejoin:NO navagationController:self.viewController.navigationController]; } }else if (self.model.task_status.intValue == 2) { diff --git a/QXLive/Other/AppDelegate.m b/QXLive/Other/AppDelegate.m index 32a4a3a..0104cf8 100644 --- a/QXLive/Other/AppDelegate.m +++ b/QXLive/Other/AppDelegate.m @@ -53,6 +53,7 @@ #import "IQKeyboardManager.h" #import "QXChirldViewController.h" #import "QXMineNetwork.h" +#import "QXRoomNavigationController.h" #if DEBUG #import #endif @@ -114,7 +115,7 @@ self.window.rootViewController = na; }else{ self.tabbarVC = [[QXTabbarController alloc] init]; - QXBaseNavigationController *na = [[QXBaseNavigationController alloc] initWithRootViewController:self.tabbarVC]; + QXRoomNavigationController *na = [[QXRoomNavigationController alloc] initWithRootViewController:self.tabbarVC]; na.navigationBarHidden = YES; self.window.rootViewController = na; } diff --git a/QXLive/Other/PrefixHeader.pch b/QXLive/Other/PrefixHeader.pch index 3454dc6..9c64e43 100644 --- a/QXLive/Other/PrefixHeader.pch +++ b/QXLive/Other/PrefixHeader.pch @@ -34,7 +34,9 @@ #import "UIControl+QX.h" #import "QXBaseWebViewController.h" #import "QXBaseNavigationController.h" +#import "QXRoomNavigationController.h" #import "QXCOSUploadManager.h" + #import "QXLive-Bridging-Header.h" #endif /* PrefixHeader_pch */ diff --git a/QXLive/Room(房间)/Controller/QXRoomViewController.m b/QXLive/Room(房间)/Controller/QXRoomViewController.m index 5ef8b0e..687d41d 100644 --- a/QXLive/Room(房间)/Controller/QXRoomViewController.m +++ b/QXLive/Room(房间)/Controller/QXRoomViewController.m @@ -113,13 +113,28 @@ QXRoomUserInfoViewDelegate // break; // } // } + NSInteger count = 0; for (int i = 0; i < marr.count; i++) { UIViewController *vc = marr[i]; + if ([vc isKindOfClass:[QXRoomViewController class]]){ + count++; + } if ([vc isKindOfClass:[QXRoomViewController class]] && (i == marr.count-2)) { [marr removeObject:vc]; - break; + self.navigationController.viewControllers = marr; } } + if (count>=2) { + for (int i = 0; i < marr.count; i++) { + UIViewController *vc = marr[i]; + if ([vc isKindOfClass:[QXRoomViewController class]]) { + [marr removeObject:vc]; + self.navigationController.viewControllers = marr; + break; + } + } + } + [self playHWDMP4]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [[QXGiftPlayerManager shareManager] startPlay]; diff --git a/QXLive/Room(房间)/View/QXRoomChatListView.m b/QXLive/Room(房间)/View/QXRoomChatListView.m index 4154f5c..738ddfe 100644 --- a/QXLive/Room(房间)/View/QXRoomChatListView.m +++ b/QXLive/Room(房间)/View/QXRoomChatListView.m @@ -923,6 +923,7 @@ NSInteger maxMessageCount = 20; } -(void)initSubviews{ self.bgView = [[UIView alloc] init]; + self.bgView.backgroundColor = UIColor.clearColor; [self.contentView addSubview:self.bgView]; [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(16); @@ -1017,10 +1018,14 @@ NSInteger maxMessageCount = 20; } } - +-(void)layoutSubviews{ + [super layoutSubviews]; + [self.bgView addRoundedCornersWithRadius:8]; +} -(void)loadBubble{ if ([self.message.FromUserInfo.chat_bubble isExist]) { self.bubbleImageView.backgroundColor = UIColor.clearColor; + self.bgView.backgroundColor = UIColor.clearColor; // self.bubbleImageView.image = [[UIImage imageNamed:@"chat_bubble2"] resizableImageWithCapInsets:UIEdgeInsetsMake(30, 40, 40, 40) resizingMode:(UIImageResizingModeStretch)];; [self.bubbleImageView sd_setImageWithURL:[NSURL URLWithString:self.message.FromUserInfo.chat_bubble] placeholderImage:nil options:SDWebImageRetryFailed completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) { image = [image resizableImageWithCapInsets:UIEdgeInsetsMake(40, 40, 40, 40) resizingMode:(UIImageResizingModeStretch)]; @@ -1048,7 +1053,8 @@ NSInteger maxMessageCount = 20; make.top.mas_equalTo(11); }]; self.bubbleImageView.image = nil; - self.bubbleImageView.backgroundColor = messageBubbleColor; + self.bubbleImageView.backgroundColor = UIColor.clearColor; + self.bgView.backgroundColor = messageBubbleColor; } } -(NSMutableArray *)iconViewArray{