修改每日任务跳转房间出错

This commit is contained in:
启星
2025-10-28 09:18:28 +08:00
parent 3f76f23cb0
commit acc4cffad2
12 changed files with 149 additions and 26 deletions

View File

@@ -748,7 +748,7 @@
CODE_SIGN_ENTITLEMENTS = QXLive/QXLive.entitlements; CODE_SIGN_ENTITLEMENTS = QXLive/QXLive.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = 8798G5VMH9; DEVELOPMENT_TEAM = 8798G5VMH9;
ENABLE_USER_SCRIPT_SANDBOXING = NO; ENABLE_USER_SCRIPT_SANDBOXING = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
@@ -787,7 +787,7 @@
"$(inherited)", "$(inherited)",
"$(SDKROOT)/usr/lib/swift", "$(SDKROOT)/usr/lib/swift",
); );
MARKETING_VERSION = 1.0.0; MARKETING_VERSION = 1.1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.qxcm.qxlive; PRODUCT_BUNDLE_IDENTIFIER = com.qxcm.qxlive;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
@@ -814,7 +814,7 @@
CODE_SIGN_ENTITLEMENTS = QXLive/QXLive.entitlements; CODE_SIGN_ENTITLEMENTS = QXLive/QXLive.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = 8798G5VMH9; DEVELOPMENT_TEAM = 8798G5VMH9;
ENABLE_USER_SCRIPT_SANDBOXING = NO; ENABLE_USER_SCRIPT_SANDBOXING = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
@@ -853,7 +853,7 @@
"$(inherited)", "$(inherited)",
"$(SDKROOT)/usr/lib/swift", "$(SDKROOT)/usr/lib/swift",
); );
MARKETING_VERSION = 1.0.0; MARKETING_VERSION = 1.1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.qxcm.qxlive; PRODUCT_BUNDLE_IDENTIFIER = com.qxcm.qxlive;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
@@ -1207,7 +1207,7 @@
"$(inherited)", "$(inherited)",
"$(SDKROOT)/usr/lib/swift", "$(SDKROOT)/usr/lib/swift",
); );
MARKETING_VERSION = 1.0.1; MARKETING_VERSION = 1.0.0;
PRODUCT_BUNDLE_IDENTIFIER = com.qxcm.qxlive.test; PRODUCT_BUNDLE_IDENTIFIER = com.qxcm.qxlive.test;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
@@ -1271,7 +1271,7 @@
"$(inherited)", "$(inherited)",
"$(SDKROOT)/usr/lib/swift", "$(SDKROOT)/usr/lib/swift",
); );
MARKETING_VERSION = 1.0.1; MARKETING_VERSION = 1.0.0;
PRODUCT_BUNDLE_IDENTIFIER = com.qxcm.qxlive.test; PRODUCT_BUNDLE_IDENTIFIER = com.qxcm.qxlive.test;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";

View File

@@ -25,6 +25,12 @@
[self getData]; [self getData];
self.page = 1; self.page = 1;
} }
-(void)viewWillDisappear:(BOOL)animated{
[super viewWillDisappear:animated];
if ([self.navigationController isKindOfClass:[QXRoomNavigationController class]]) {
[self.navigationController setNavigationBarHidden:YES animated:NO];
}
}
-(void)didReceiveMemoryWarning{ -(void)didReceiveMemoryWarning{
[super didReceiveMemoryWarning]; [super didReceiveMemoryWarning];
[[SDImageCache sharedImageCache] clearMemory]; [[SDImageCache sharedImageCache] clearMemory];

View File

@@ -96,7 +96,8 @@ typedef void (^showFinishBlock)(void);
-(void)joinRoomWithRoomId:(NSString*)roomId -(void)joinRoomWithRoomId:(NSString*)roomId
isRejoin:(BOOL)isRejoin isRejoin:(BOOL)isRejoin
navagationController:(UINavigationController*)navagationController; navagationController:(UINavigationController*)navagationController;
/// 回到房间
-(void)popToRoomViewController;
/** /**
退出房间 退出房间
*/ */

View File

@@ -198,12 +198,26 @@
return; return;
} }
navagationController = (QXBaseNavigationController*)KEYWINDOW.rootViewController; navagationController = (QXRoomNavigationController*)KEYWINDOW.rootViewController;
// navagationController.interactivePopGestureRecognizer.enabled = NO; // navagationController.interactivePopGestureRecognizer.enabled = NO;
if (_miniView) { if (_miniView) {
[_miniView removeFromSuperview]; [_miniView removeFromSuperview];
_miniView = nil; _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 ([roomId isEqualToString:self.roomId]) {
if ([navagationController.viewControllers containsObject:self.roomVC]) { if ([navagationController.viewControllers containsObject:self.roomVC]) {
return; 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{ -(void)quitRoomWithRoomId:(NSString *)roomId{
[UIApplication sharedApplication].idleTimerDisabled = NO; [UIApplication sharedApplication].idleTimerDisabled = NO;
/// ///

View File

@@ -0,0 +1,16 @@
//
// QXRoomNavigationController.h
// QXLive
//
// Created by 启星 on 2025/10/27.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface QXRoomNavigationController : UINavigationController
@end
NS_ASSUME_NONNULL_END

View File

@@ -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

View File

@@ -29,6 +29,7 @@
[self.navigationController setNavigationBarHidden:NO animated:YES]; [self.navigationController setNavigationBarHidden:NO animated:YES];
[self getDayTask]; [self getDayTask];
} }
-(void)setNavgationItems{ -(void)setNavgationItems{
[super setNavgationItems]; [super setNavgationItems];
self.navigationItem.title = QXText(@"每日任务"); self.navigationItem.title = QXText(@"每日任务");

View File

@@ -44,6 +44,9 @@
if (self.model.task_status.intValue == 1) { if (self.model.task_status.intValue == 1) {
if (self.model.task_id.intValue == 9 || self.model.task_id.intValue == 10) { if (self.model.task_id.intValue == 9 || self.model.task_id.intValue == 10) {
QXGlobal.shareGlobal.taskModel = self.model; 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]; [[QXGlobal shareGlobal] joinRoomWithRoomId:self.model.from_id isRejoin:NO navagationController:self.viewController.navigationController];
} }
}else if (self.model.task_status.intValue == 2) { }else if (self.model.task_status.intValue == 2) {

View File

@@ -53,6 +53,7 @@
#import "IQKeyboardManager.h" #import "IQKeyboardManager.h"
#import "QXChirldViewController.h" #import "QXChirldViewController.h"
#import "QXMineNetwork.h" #import "QXMineNetwork.h"
#import "QXRoomNavigationController.h"
#if DEBUG #if DEBUG
#import <LLDebugTool.h> #import <LLDebugTool.h>
#endif #endif
@@ -114,7 +115,7 @@
self.window.rootViewController = na; self.window.rootViewController = na;
}else{ }else{
self.tabbarVC = [[QXTabbarController alloc] init]; self.tabbarVC = [[QXTabbarController alloc] init];
QXBaseNavigationController *na = [[QXBaseNavigationController alloc] initWithRootViewController:self.tabbarVC]; QXRoomNavigationController *na = [[QXRoomNavigationController alloc] initWithRootViewController:self.tabbarVC];
na.navigationBarHidden = YES; na.navigationBarHidden = YES;
self.window.rootViewController = na; self.window.rootViewController = na;
} }

View File

@@ -34,7 +34,9 @@
#import "UIControl+QX.h" #import "UIControl+QX.h"
#import "QXBaseWebViewController.h" #import "QXBaseWebViewController.h"
#import "QXBaseNavigationController.h" #import "QXBaseNavigationController.h"
#import "QXRoomNavigationController.h"
#import "QXCOSUploadManager.h" #import "QXCOSUploadManager.h"
#import "QXLive-Bridging-Header.h" #import "QXLive-Bridging-Header.h"
#endif /* PrefixHeader_pch */ #endif /* PrefixHeader_pch */

View File

@@ -113,13 +113,28 @@ QXRoomUserInfoViewDelegate
// break; // break;
// } // }
// } // }
NSInteger count = 0;
for (int i = 0; i < marr.count; i++) { for (int i = 0; i < marr.count; i++) {
UIViewController *vc = marr[i]; UIViewController *vc = marr[i];
if ([vc isKindOfClass:[QXRoomViewController class]]){
count++;
}
if ([vc isKindOfClass:[QXRoomViewController class]] && (i == marr.count-2)) { if ([vc isKindOfClass:[QXRoomViewController class]] && (i == marr.count-2)) {
[marr removeObject:vc]; [marr removeObject:vc];
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; break;
} }
} }
}
[self playHWDMP4]; [self playHWDMP4];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[[QXGiftPlayerManager shareManager] startPlay]; [[QXGiftPlayerManager shareManager] startPlay];

View File

@@ -923,6 +923,7 @@ NSInteger maxMessageCount = 20;
} }
-(void)initSubviews{ -(void)initSubviews{
self.bgView = [[UIView alloc] init]; self.bgView = [[UIView alloc] init];
self.bgView.backgroundColor = UIColor.clearColor;
[self.contentView addSubview:self.bgView]; [self.contentView addSubview:self.bgView];
[self.bgView mas_makeConstraints:^(MASConstraintMaker *make) { [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(16); make.left.mas_equalTo(16);
@@ -1017,10 +1018,14 @@ NSInteger maxMessageCount = 20;
} }
} }
-(void)layoutSubviews{
[super layoutSubviews];
[self.bgView addRoundedCornersWithRadius:8];
}
-(void)loadBubble{ -(void)loadBubble{
if ([self.message.FromUserInfo.chat_bubble isExist]) { if ([self.message.FromUserInfo.chat_bubble isExist]) {
self.bubbleImageView.backgroundColor = UIColor.clearColor; 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.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) { [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)]; image = [image resizableImageWithCapInsets:UIEdgeInsetsMake(40, 40, 40, 40) resizingMode:(UIImageResizingModeStretch)];
@@ -1048,7 +1053,8 @@ NSInteger maxMessageCount = 20;
make.top.mas_equalTo(11); make.top.mas_equalTo(11);
}]; }];
self.bubbleImageView.image = nil; self.bubbleImageView.image = nil;
self.bubbleImageView.backgroundColor = messageBubbleColor; self.bubbleImageView.backgroundColor = UIColor.clearColor;
self.bgView.backgroundColor = messageBubbleColor;
} }
} }
-(NSMutableArray *)iconViewArray{ -(NSMutableArray *)iconViewArray{