From cd4710ecf6e029fbd0d64713a3ff6d143983ab8b Mon Sep 17 00:00:00 2001 From: edwinQQQ Date: Thu, 14 Aug 2025 18:36:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=85=AC=E5=85=B1=E6=88=BF?= =?UTF-8?q?=E9=97=B4=E7=AE=A1=E7=90=86=E5=99=A8=E7=9A=84=E8=BF=9B=E5=85=A5?= =?UTF-8?q?=E9=80=BB=E8=BE=91=EF=BC=8C=E6=96=B0=E5=A2=9E=E5=BB=B6=E8=BF=9F?= =?UTF-8?q?=E8=BF=9B=E5=85=A5=E5=85=AC=E5=85=B1=E6=88=BF=E9=97=B4=E7=9A=84?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E4=BB=A5=E6=94=B9=E5=96=84=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E4=BD=93=E9=AA=8C=E3=80=82=E5=90=8C=E6=97=B6=EF=BC=8C=E7=A7=BB?= =?UTF-8?q?=E9=99=A4=20RoomAnimationView=20=E4=B8=AD=E7=9A=84=E8=B0=83?= =?UTF-8?q?=E8=AF=95=E8=A7=86=E5=9B=BE=E7=9B=B8=E5=85=B3=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=EF=BC=8C=E6=8F=90=E5=8D=87=E4=BB=A3=E7=A0=81=E6=95=B4=E6=B4=81?= =?UTF-8?q?=E6=80=A7=E5=92=8C=E5=8F=AF=E7=BB=B4=E6=8A=A4=E6=80=A7=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../YMRoom/Manager/PublicRoomManager.m | 6 +- .../View/AnimationView/RoomAnimationView.m | 97 +------------------ .../YMRoom/View/Common/BravoGiftBannerView.m | 12 +-- .../YMTabbar/View/TabbarViewController.m | 21 ++-- 4 files changed, 19 insertions(+), 117 deletions(-) diff --git a/YuMi/Modules/YMRoom/Manager/PublicRoomManager.m b/YuMi/Modules/YMRoom/Manager/PublicRoomManager.m index 231172ee..2847974b 100644 --- a/YuMi/Modules/YMRoom/Manager/PublicRoomManager.m +++ b/YuMi/Modules/YMRoom/Manager/PublicRoomManager.m @@ -102,10 +102,8 @@ } // 重置状态 - self.isInitialized = NO; self.isInPublicRoom = NO; self.currentPublicRoomId = nil; - } #pragma mark - 状态查询 @@ -263,7 +261,9 @@ return; } - [self tryEnterPublicRoom]; + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + [self tryEnterPublicRoom]; + }); } - (void)exitPublicRoomWithCompletion:(void(^)(NSError * _Nullable error))completion { diff --git a/YuMi/Modules/YMRoom/View/AnimationView/RoomAnimationView.m b/YuMi/Modules/YMRoom/View/AnimationView/RoomAnimationView.m index 67ce9ad1..d94d07fa 100644 --- a/YuMi/Modules/YMRoom/View/AnimationView/RoomAnimationView.m +++ b/YuMi/Modules/YMRoom/View/AnimationView/RoomAnimationView.m @@ -322,9 +322,6 @@ XPRoomGraffitiGiftAnimationViewDelegate NSLog(@" - 手势: %@ (delegate: %@)", NSStringFromClass([gesture class]), gesture.delegate ? @"已设置" : @"未设置"); } - // 添加调试视图(仅在测试环境) - [self addZoneDebugViews]; - // 确保bannerContainer可以接收用户交互 self.bannerContainer.userInteractionEnabled = YES; NSLog(@"🔧 bannerContainer用户交互已启用: %@", self.bannerContainer.userInteractionEnabled ? @"是" : @"否"); @@ -403,75 +400,6 @@ XPRoomGraffitiGiftAnimationViewDelegate return BannerZoneNone; } -#pragma mark - Visual Debug (Test Environment) - -- (void)addZoneDebugViews { - // 仅在测试环境添加 - #ifdef DEBUG - NSLog(@"🎨 开始添加区域调试视图"); - NSLog(@" - bannerContainer: %@ (frame: %.1f,%.1f,%.1f,%.1f)", - self.bannerContainer ? @"存在" : @"nil", - self.bannerContainer.frame.origin.x, self.bannerContainer.frame.origin.y, - self.bannerContainer.frame.size.width, self.bannerContainer.frame.size.height); - - // 延迟添加,确保布局完成 - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - // 中央区域 - 半透明蓝色 - UIView *centerDebugView = [[UIView alloc] init]; - centerDebugView.backgroundColor = [[UIColor blueColor] colorWithAlphaComponent:0.3]; - centerDebugView.frame = [self getCenterZone]; - centerDebugView.userInteractionEnabled = NO; - centerDebugView.tag = 999; // 设置debug视图tag - [self.bannerContainer addSubview:centerDebugView]; - - // 左侧区域 - 半透明红色 - UIView *leftDebugView = [[UIView alloc] init]; - leftDebugView.backgroundColor = [[UIColor redColor] colorWithAlphaComponent:0.3]; - leftDebugView.frame = [self getLeftZone]; - leftDebugView.userInteractionEnabled = NO; - leftDebugView.tag = 999; // 设置debug视图tag - [self.bannerContainer addSubview:leftDebugView]; - - // 右侧区域 - 半透明绿色 - UIView *rightDebugView = [[UIView alloc] init]; - rightDebugView.backgroundColor = [[UIColor greenColor] colorWithAlphaComponent:0.3]; - rightDebugView.frame = [self getRightZone]; - rightDebugView.userInteractionEnabled = NO; - rightDebugView.tag = 999; // 设置debug视图tag - [self.bannerContainer addSubview:rightDebugView]; - - NSLog(@"🎨 区域调试视图已添加"); - NSLog(@" - 中央区域: 蓝色 (%.1f, %.1f, %.1f, %.1f)", - centerDebugView.frame.origin.x, centerDebugView.frame.origin.y, - centerDebugView.frame.size.width, centerDebugView.frame.size.height); - NSLog(@" - 左侧区域: 红色 (%.1f, %.1f, %.1f, %.1f)", - leftDebugView.frame.origin.x, leftDebugView.frame.origin.y, - leftDebugView.frame.size.width, leftDebugView.frame.size.height); - NSLog(@" - 右侧区域: 绿色 (%.1f, %.1f, %.1f, %.1f)", - rightDebugView.frame.origin.x, rightDebugView.frame.origin.y, - rightDebugView.frame.size.width, rightDebugView.frame.size.height); - }); - #endif -} - -- (void)ensureDebugViewsExist { - #ifdef DEBUG - // 检查是否已经有debug视图 - BOOL hasDebugViews = NO; - for (UIView *subview in self.bannerContainer.subviews) { - if (subview.tag == 999) { - hasDebugViews = YES; - break; - } - } - - if (!hasDebugViews) { - NSLog(@"🎨 重新添加debug视图"); - [self addZoneDebugViews]; - } - #endif -} - #pragma mark - UIGestureRecognizerDelegate - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch { @@ -1227,7 +1155,7 @@ shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherG return; } - #ifdef DEBUG + #if 0 // DEBUG环境:复制banner数据用于测试 BOOL enableBannerCopy = YES; // 设置为NO可以禁用复制功能 NSInteger copyCount = 10; // 可以调整这个数字来改变复制数量 @@ -1371,7 +1299,7 @@ shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherG NSLog(@"🔄 清理了 %ld 个banner视图,保留debug视图", (long)viewsToRemove.count); // 确保debug视图存在 - [self ensureDebugViewsExist]; +// [self ensureDebugViewsExist]; switch (nextAttachment.second) { case Custom_Message_Sub_General_Floating_Screen_One_Room: @@ -1435,9 +1363,6 @@ shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherG break; } } - - // 确保debug视图存在 - [self ensureDebugViewsExist]; }); } @@ -1471,9 +1396,6 @@ shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherG break; } } - - // 确保debug视图存在 - [self ensureDebugViewsExist]; }); } @@ -1506,9 +1428,6 @@ shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherG break; } } - - // 确保debug视图存在 - [self ensureDebugViewsExist]; }); } @@ -1546,9 +1465,6 @@ shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherG break; } } - - // 确保debug视图存在 - [self ensureDebugViewsExist]; }); } @@ -1730,9 +1646,6 @@ shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherG break; } } - - // 确保debug视图存在 - [self ensureDebugViewsExist]; }); } @@ -1811,9 +1724,6 @@ shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherG break; } } - - // 确保debug视图存在 - [self ensureDebugViewsExist]; }); } @@ -3165,9 +3075,6 @@ shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherG - (XPRoomAnimationHitView *)bannerContainer { if (!_bannerContainer) { _bannerContainer = [[XPRoomAnimationHitView alloc] init]; -#if DEBUG - _bannerContainer.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5]; -#endif } return _bannerContainer; } diff --git a/YuMi/Modules/YMRoom/View/Common/BravoGiftBannerView.m b/YuMi/Modules/YMRoom/View/Common/BravoGiftBannerView.m index 50e2eb4a..68b7781d 100644 --- a/YuMi/Modules/YMRoom/View/Common/BravoGiftBannerView.m +++ b/YuMi/Modules/YMRoom/View/Common/BravoGiftBannerView.m @@ -130,12 +130,12 @@ exitCurrentRoom:(void(^)(void))exit { if (self) { [self setupUI]; self.userInteractionEnabled = NO; -// UIButton *b = [UIButton buttonWithType:UIButtonTypeCustom]; -// [self addSubview:b]; -// [b mas_remakeConstraints:^(MASConstraintMaker *make) { -// make.edges.mas_equalTo(self); -// }]; -// [b addTarget:self action:@selector(handelTap) forControlEvents:UIControlEventTouchUpInside]; + UIButton *b = [UIButton buttonWithType:UIButtonTypeCustom]; + [self addSubview:b]; + [b mas_remakeConstraints:^(MASConstraintMaker *make) { + make.edges.mas_equalTo(self); + }]; + [b addTarget:self action:@selector(handelTap) forControlEvents:UIControlEventTouchUpInside]; } return self; } diff --git a/YuMi/Modules/YMTabbar/View/TabbarViewController.m b/YuMi/Modules/YMTabbar/View/TabbarViewController.m index a513444d..5a74b495 100644 --- a/YuMi/Modules/YMTabbar/View/TabbarViewController.m +++ b/YuMi/Modules/YMTabbar/View/TabbarViewController.m @@ -340,19 +340,14 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey; [[IAPManager sharedManager] handleLogin]; [[IAPManager sharedManager] retryCheckAllReceipt]; - // 统一入口:1秒后进入公共房间 -// @kWeakify(self); - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ -// @kStrongify(self); - NSLog(@"TabbarViewController: 统一入口 - 开始进入公共房间"); - [[PublicRoomManager sharedManager] enterPublicRoomWithCompletion:^(NSError * _Nullable error) { - if (error) { - NSLog(@"TabbarViewController: 进入公共房间失败: %@", error); - } else { - NSLog(@"TabbarViewController: 进入公共房间成功"); - } - }]; - }); + NSLog(@"TabbarViewController: 统一入口 - 开始进入公共房间"); + [[PublicRoomManager sharedManager] enterPublicRoomWithCompletion:^(NSError * _Nullable error) { + if (error) { + NSLog(@"TabbarViewController: 进入公共房间失败: %@", error); + } else { + NSLog(@"TabbarViewController: 进入公共房间成功"); + } + }]; } -(void)getRoomGameInfo{