diff --git a/YuMi/Global/YUMIMacroUitls.h b/YuMi/Global/YUMIMacroUitls.h index 593e2197..7d77f6e5 100644 --- a/YuMi/Global/YUMIMacroUitls.h +++ b/YuMi/Global/YUMIMacroUitls.h @@ -20,12 +20,64 @@ isPhoneXSeries = [[UIApplication sharedApplication] delegate].window.safeAreaIns #define KScreenWidth [[UIScreen mainScreen] bounds].size.width #define KScreenHeight [[UIScreen mainScreen] bounds].size.height -#define statusbarHeight [[UIApplication sharedApplication] statusBarFrame].size.height +// 状态栏高度 +#define statusbarHeight \ +({\ + CGFloat height = 0.0;\ + if (@available(iOS 11.0, *)) {\ + UIEdgeInsets insets = [UIApplication sharedApplication].delegate.window.safeAreaInsets;\ + height = insets.top;\ + } else {\ + height = 20.0;\ + }\ + height;\ +}) #define kStatusBarHeight statusbarHeight -#define kSafeAreaBottomHeight (iPhoneXSeries ? 34 : 0) -#define kSafeAreaTopHeight (iPhoneXSeries ? 24 : 0) -#define kNavigationHeight (kStatusBarHeight + 44) -#define kTabBarHeight (iPhoneXSeries ? 49.0+34.0 : 49.0) +// 安全区域底部高度 +#define kSafeAreaBottomHeight \ +({\ + CGFloat height = 0.0;\ + if (@available(iOS 11.0, *)) {\ + UIEdgeInsets insets = [UIApplication sharedApplication].delegate.window.safeAreaInsets;\ + height = insets.bottom;\ + }\ + height;\ +}) +// 安全区域顶部高度 +#define kSafeAreaTopHeight \ +({\ + CGFloat height = 0.0;\ + if (@available(iOS 11.0, *)) {\ + UIEdgeInsets insets = [UIApplication sharedApplication].delegate.window.safeAreaInsets;\ + height = insets.top;\ + }\ + height;\ +}) + +// 导航栏高度 +#define kNavigationHeight \ +({\ + CGFloat height = 0.0;\ + if (@available(iOS 11.0, *)) {\ + UIEdgeInsets insets = [UIApplication sharedApplication].delegate.window.safeAreaInsets;\ + height = insets.top > 0 ? 44.0 + insets.top : 44.0;\ + } else {\ + height = 64.0;\ + }\ + height;\ +}) +// 标签栏高度 +#define kTabBarHeight \ +({\ + CGFloat height = 0.0;\ + if (@available(iOS 11.0, *)) {\ + UIEdgeInsets insets = [UIApplication sharedApplication].delegate.window.safeAreaInsets;\ + height = insets.bottom > 0 ? 49.0 + insets.bottom : 49.0;\ + } else {\ + height = 49.0;\ + }\ + height;\ +}) #define kScreenScale ((CGFloat)KScreenWidth / (CGFloat)375) #define kScreenHeightScale ((CGFloat)KScreenHeight / (CGFloat)812) #define kHalfScreenHeight KScreenHeight * 0.65 diff --git a/YuMi/Modules/YMRoom/View/AnimationView/XPRoomGiftBroadcastView.m b/YuMi/Modules/YMRoom/View/AnimationView/XPRoomGiftBroadcastView.m index a069fe50..91f93fed 100644 --- a/YuMi/Modules/YMRoom/View/AnimationView/XPRoomGiftBroadcastView.m +++ b/YuMi/Modules/YMRoom/View/AnimationView/XPRoomGiftBroadcastView.m @@ -57,6 +57,7 @@ - (void)didClickEnterRoom { + if(self.broadcastModel.roomTitle == nil)return; if (self.delegate && [self.delegate respondsToSelector:@selector(xPRoomGiftBroadcastView:enterRoom:roomName:)]) { [self.delegate xPRoomGiftBroadcastView:self enterRoom:[NSString stringWithFormat:@"%ld", self.broadcastModel.roomUid] roomName:self.broadcastModel.roomTitle]; } diff --git a/YuMi/Modules/YMRoom/View/XPRoomViewController.m b/YuMi/Modules/YMRoom/View/XPRoomViewController.m index 56c3611a..a8b0baf2 100644 --- a/YuMi/Modules/YMRoom/View/XPRoomViewController.m +++ b/YuMi/Modules/YMRoom/View/XPRoomViewController.m @@ -996,8 +996,14 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 self.hasAnimationEffect = roomInfo.hasAnimationEffect; self.roomInfo = roomInfo; self.userInfo = userInfo; - //获取一下红包信息 - [self.presenter getRedPacket:[NSString stringWithFormat:@"%ld", self.roomInfo.uid]]; + + + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + //获取一下红包信息 + [self.presenter getRedPacket:[NSString stringWithFormat:@"%ld", self.roomInfo.uid]]; + }); + + //判断5分钟内是否被踢出过房间 if ([self isKictOutLatest:roomInfo]) { return; diff --git a/YuMi/Modules/YMTabbar/View/TabbarViewController.m b/YuMi/Modules/YMTabbar/View/TabbarViewController.m index 3b92cf3d..82a11b6f 100644 --- a/YuMi/Modules/YMTabbar/View/TabbarViewController.m +++ b/YuMi/Modules/YMTabbar/View/TabbarViewController.m @@ -175,9 +175,7 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey; - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - - }); + }