diff --git a/YuMi.xcodeproj/project.pbxproj b/YuMi.xcodeproj/project.pbxproj index a8781953..c8a78491 100644 --- a/YuMi.xcodeproj/project.pbxproj +++ b/YuMi.xcodeproj/project.pbxproj @@ -529,6 +529,10 @@ 4CA532BD2D5CA49A00B8F59F /* OpenLuckyPackageEntranceView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CA532BC2D5CA49A00B8F59F /* OpenLuckyPackageEntranceView.m */; }; 4CA532C02D5CA4D300B8F59F /* LuckyPackageStatusView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CA532BF2D5CA4D300B8F59F /* LuckyPackageStatusView.m */; }; 4CA532C32D5F37DC00B8F59F /* LuckyPackageMessageTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CA532C22D5F37DC00B8F59F /* LuckyPackageMessageTableViewCell.m */; }; + 4CA5A3312D93D4A500CE41D6 /* 中.svga in Resources */ = {isa = PBXBuildFile; fileRef = 4CA5A3302D93D4A500CE41D6 /* 中.svga */; }; + 4CA5A3322D93D4A500CE41D6 /* 小.svga in Resources */ = {isa = PBXBuildFile; fileRef = 4CA5A32F2D93D4A500CE41D6 /* 小.svga */; }; + 4CA5A3342D93D4AB00CE41D6 /* 大.svga in Resources */ = {isa = PBXBuildFile; fileRef = 4CA5A3332D93D4AB00CE41D6 /* 大.svga */; }; + 4CACCCE42D9A695000CCB135 /* brove_gift.svga in Resources */ = {isa = PBXBuildFile; fileRef = 4CACCCE32D9A695000CCB135 /* brove_gift.svga */; }; 4CB753D22D30F10900B13DF5 /* LuckyPackageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CB753D12D30F10900B13DF5 /* LuckyPackageViewController.m */; }; 4CC312242D7987A200F57A07 /* ShareHelder.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CC312232D7987A200F57A07 /* ShareHelder.m */; }; 4CC312272D79A10100F57A07 /* ShareProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CC312262D79A10100F57A07 /* ShareProvider.m */; }; @@ -541,6 +545,10 @@ 4CD6FF692D673F7F00262AB7 /* AgentMessageTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CD6FF682D673F7F00262AB7 /* AgentMessageTableViewCell.m */; }; 4CE3A9462D22754C003F0796 /* RechargeUserModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CE3A9452D22754C003F0796 /* RechargeUserModel.m */; }; 4CE746C32D9290430094E496 /* RoomBoomManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CE746C22D9290430094E496 /* RoomBoomManager.m */; }; + 4CE746C62D9297C30094E496 /* BravoGiftTipModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CE746C52D9297C30094E496 /* BravoGiftTipModel.m */; }; + 4CE746CA2D929D500094E496 /* BaseRoomBannerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CE746C82D929D500094E496 /* BaseRoomBannerView.m */; }; + 4CE746D22D92A2660094E496 /* BroveGiftBannerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CE746D12D92A2660094E496 /* BroveGiftBannerView.m */; }; + 4CE746D52D92C1080094E496 /* BroveGiftWinningFlagView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CE746D42D92C1080094E496 /* BroveGiftWinningFlagView.m */; }; 4CEB9EA72D09643E00443480 /* UserRoomCardViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CEB9EA62D09643E00443480 /* UserRoomCardViewController.m */; }; 4CEB9EAA2D097E8400443480 /* MoliAvatar.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CEB9EA92D097E8400443480 /* MoliAvatar.m */; }; 4CEB9EAD2D09AA0400443480 /* SexAgeLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CEB9EAC2D09AA0400443480 /* SexAgeLabel.m */; }; @@ -2683,6 +2691,10 @@ 4CA532BF2D5CA4D300B8F59F /* LuckyPackageStatusView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LuckyPackageStatusView.m; sourceTree = ""; }; 4CA532C12D5F37DC00B8F59F /* LuckyPackageMessageTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LuckyPackageMessageTableViewCell.h; sourceTree = ""; }; 4CA532C22D5F37DC00B8F59F /* LuckyPackageMessageTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LuckyPackageMessageTableViewCell.m; sourceTree = ""; }; + 4CA5A32F2D93D4A500CE41D6 /* 小.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = "小.svga"; sourceTree = ""; }; + 4CA5A3302D93D4A500CE41D6 /* 中.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = "中.svga"; sourceTree = ""; }; + 4CA5A3332D93D4AB00CE41D6 /* 大.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = "大.svga"; sourceTree = ""; }; + 4CACCCE32D9A695000CCB135 /* brove_gift.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = brove_gift.svga; sourceTree = ""; }; 4CB753D02D30F10900B13DF5 /* LuckyPackageViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LuckyPackageViewController.h; sourceTree = ""; }; 4CB753D12D30F10900B13DF5 /* LuckyPackageViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LuckyPackageViewController.m; sourceTree = ""; }; 4CC312222D7987A200F57A07 /* ShareHelder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ShareHelder.h; sourceTree = ""; }; @@ -2705,6 +2717,14 @@ 4CE3A9452D22754C003F0796 /* RechargeUserModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RechargeUserModel.m; sourceTree = ""; }; 4CE746C12D9290430094E496 /* RoomBoomManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RoomBoomManager.h; sourceTree = ""; }; 4CE746C22D9290430094E496 /* RoomBoomManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RoomBoomManager.m; sourceTree = ""; }; + 4CE746C42D9297C30094E496 /* BravoGiftTipModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BravoGiftTipModel.h; sourceTree = ""; }; + 4CE746C52D9297C30094E496 /* BravoGiftTipModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BravoGiftTipModel.m; sourceTree = ""; }; + 4CE746C72D929D500094E496 /* BaseRoomBannerView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BaseRoomBannerView.h; sourceTree = ""; }; + 4CE746C82D929D500094E496 /* BaseRoomBannerView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BaseRoomBannerView.m; sourceTree = ""; }; + 4CE746D02D92A2660094E496 /* BroveGiftBannerView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BroveGiftBannerView.h; sourceTree = ""; }; + 4CE746D12D92A2660094E496 /* BroveGiftBannerView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BroveGiftBannerView.m; sourceTree = ""; }; + 4CE746D32D92C1080094E496 /* BroveGiftWinningFlagView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BroveGiftWinningFlagView.h; sourceTree = ""; }; + 4CE746D42D92C1080094E496 /* BroveGiftWinningFlagView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BroveGiftWinningFlagView.m; sourceTree = ""; }; 4CEB9EA52D09643E00443480 /* UserRoomCardViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UserRoomCardViewController.h; sourceTree = ""; }; 4CEB9EA62D09643E00443480 /* UserRoomCardViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UserRoomCardViewController.m; sourceTree = ""; }; 4CEB9EA82D097E8400443480 /* MoliAvatar.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MoliAvatar.h; sourceTree = ""; }; @@ -6789,6 +6809,27 @@ path = Share; sourceTree = ""; }; + 4CE746C92D929D500094E496 /* Common */ = { + isa = PBXGroup; + children = ( + 4CE746D02D92A2660094E496 /* BroveGiftBannerView.h */, + 4CE746D12D92A2660094E496 /* BroveGiftBannerView.m */, + 4CE746C72D929D500094E496 /* BaseRoomBannerView.h */, + 4CE746C82D929D500094E496 /* BaseRoomBannerView.m */, + ); + path = Common; + sourceTree = ""; + }; + 4CE746D62D92C5B60094E496 /* gift */ = { + isa = PBXGroup; + children = ( + 4CA5A3332D93D4AB00CE41D6 /* 大.svga */, + 4CA5A32F2D93D4A500CE41D6 /* 小.svga */, + 4CA5A3302D93D4A500CE41D6 /* 中.svga */, + ); + path = gift; + sourceTree = ""; + }; 54283CE22CE48884009729B5 /* ShoppingMall */ = { isa = PBXGroup; children = ( @@ -6815,6 +6856,7 @@ 5461040A2CD4B3CB00066B21 /* banner */ = { isa = PBXGroup; children = ( + 4CACCCE32D9A695000CCB135 /* brove_gift.svga */, 5461040B2CD4B46F00066B21 /* gift_normal_1.svga */, 5461040C2CD4B46F00066B21 /* gift_normal_2.svga */, 5461040D2CD4B46F00066B21 /* gift_normal_3.svga */, @@ -7666,6 +7708,8 @@ E804875F2717DD70008595F2 /* Model */ = { isa = PBXGroup; children = ( + 4CE746C42D9297C30094E496 /* BravoGiftTipModel.h */, + 4CE746C52D9297C30094E496 /* BravoGiftTipModel.m */, E89D60BF271D64B9001F8895 /* RoomInfoModel.h */, E89D60C0271D64B9001F8895 /* RoomInfoModel.m */, E8252FEC27687DF1002B3164 /* ActivityInfoModel.h */, @@ -8495,6 +8539,8 @@ 54E4D52F2C9048E1009E1FEA /* LuckyGiftWinningFlagView.m */, 54E4D5312C90658C009E1FEA /* LuckyGiftWinningBannerView.h */, 54E4D5322C90658C009E1FEA /* LuckyGiftWinningBannerView.m */, + 4CE746D32D92C1080094E496 /* BroveGiftWinningFlagView.h */, + 4CE746D42D92C1080094E496 /* BroveGiftWinningFlagView.m */, ); path = AnimationView; sourceTree = ""; @@ -10402,6 +10448,7 @@ E8A1E45C276220B100B294CA /* Resources */ = { isa = PBXGroup; children = ( + 4CE746D62D92C5B60094E496 /* gift */, 5461040A2CD4B3CB00066B21 /* banner */, 54C608512CBE0BEB003DD5D2 /* game */, 54FFD3802C9BD12600DE61E5 /* cp */, @@ -10641,6 +10688,7 @@ E8AEAED8271413530017FCE0 /* View */ = { isa = PBXGroup; children = ( + 4CE746C92D929D500094E496 /* Common */, 4CB753CF2D30F08E00B13DF5 /* LuckyPackage */, 4CB753CE2D2FE80100B13DF5 /* RoomSideMenu */, 547080D82CD0EE7A009879E5 /* Custom Background */, @@ -11675,6 +11723,8 @@ E80EC85128ACD84000D133C5 /* emoji_88@2x.png in Resources */, E80EC83E28ACD84000D133C5 /* emoji_79@2x.png in Resources */, E80EC83228ACD84000D133C5 /* emoji_00@2x.png in Resources */, + 4CA5A3312D93D4A500CE41D6 /* 中.svga in Resources */, + 4CA5A3322D93D4A500CE41D6 /* 小.svga in Resources */, E80EC89C28ACD84000D133C5 /* emoji_50@2x.png in Resources */, E80EC87A28ACD84000D133C5 /* emoji_113@2x.png in Resources */, 548E01C52C3F78360071C83D /* FeedBackViewController.xib in Resources */, @@ -11690,6 +11740,7 @@ E80E09A92A40B70100CD2BE7 /* Localizable.strings in Resources */, E80EC84828ACD84000D133C5 /* emoji_86@2x.png in Resources */, E80EC87728ACD84000D133C5 /* emoji_148@2x.png in Resources */, + 4CACCCE42D9A695000CCB135 /* brove_gift.svga in Resources */, E80EC81928ACD84000D133C5 /* emoji_80@2x.png in Resources */, 237701192BD6143700D661F1 /* pi_happy_egg_smash.svga in Resources */, 544B19BC2CA169BE00885BEB /* level up 3.svga in Resources */, @@ -11834,6 +11885,7 @@ E80EC83628ACD84000D133C5 /* emoji_147@2x.png in Resources */, 2368ECEC2BC5280300EDF4C9 /* local in Resources */, 23E9EB242A84E98300B792F2 /* pi_new_mine_info_sound_play.svga in Resources */, + 4CA5A3342D93D4AB00CE41D6 /* 大.svga in Resources */, 23CEFC552AFB8FC100576D89 /* pay_off@3x.png in Resources */, E80EC86B28ACD84000D133C5 /* emoji_200@2x.png in Resources */, E80EC88F28ACD84000D133C5 /* emoji_121@2x.png in Resources */, @@ -12566,6 +12618,7 @@ E8DEC9A82764A68B0078CB70 /* Api+MoreMenu.m in Sources */, 9B86D87A2817DD8400494FCD /* XPRoomEnterHideTipView.m in Sources */, 23FE47E12BB41CF200F09D23 /* PINobleCenterListReusableView.m in Sources */, + 4CE746D52D92C1080094E496 /* BroveGiftWinningFlagView.m in Sources */, E8AC721026F43955007D6E91 /* UIImageConstant.m in Sources */, E85E7B122A4EB0D200B6D00A /* GuildIncomeRecordModel.m in Sources */, E81C27A026EEF83D0031E639 /* YUMIHtmlUrl.m in Sources */, @@ -12698,6 +12751,7 @@ 541DD9552C1EDEFB00B616C4 /* XPHomePagingViewController.m in Sources */, E82D5C70276AE60000858D6D /* HeadwearModel.m in Sources */, 4C5C37232D0C1C7900BA9AB8 /* RegionListViewController.m in Sources */, + 4CE746C62D9297C30094E496 /* BravoGiftTipModel.m in Sources */, 238B37CC2AC55A2C00BFC9D5 /* XPTreasureFairyPrizeSubView.m in Sources */, E81125C4296E57B7000D9804 /* QinputPhotoView.m in Sources */, E880B3A1278BD60C00A83B0D /* XPAcrossRoomPKSelectRoomView.m in Sources */, @@ -12799,6 +12853,7 @@ E81366E726F0A49E0076364C /* NSString+Utils.m in Sources */, 23194DD22AD14BF000649F51 /* DDFileLogger.m in Sources */, E8EEB90126FC31B6007C6EBA /* XPMineUserInfoPresenter.m in Sources */, + 4CE746D22D92A2660094E496 /* BroveGiftBannerView.m in Sources */, 4C864A022D55F4F600191AE0 /* LuckyPackagePresenter.m in Sources */, E81A65312834E53600F55894 /* XPMomentsLatestViewController.m in Sources */, 18F404BB2760982000A6C548 /* ChatLimitModel.m in Sources */, @@ -13173,6 +13228,7 @@ 4C815A172CFEB758002A46A6 /* SuperBlockViewController.m in Sources */, E8A3539728FE7C250014A784 /* XPWishGiftPresenter.m in Sources */, E85E7B142A4EB0D200B6D00A /* GuildAuthModel.m in Sources */, + 4CE746CA2D929D500094E496 /* BaseRoomBannerView.m in Sources */, 9BE01ADE2892A66D00B50299 /* DressUpShopModel.m in Sources */, 236B2E472AA07D06003967A8 /* LittleGameInfoModel.m in Sources */, E884C36C2743951B00E1EBED /* GiftReceiveInfoModel.m in Sources */, @@ -13492,7 +13548,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 20.20.54; + MARKETING_VERSION = 20.20.56; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", @@ -13826,7 +13882,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 20.20.54; + MARKETING_VERSION = 20.20.56; OTHER_LDFLAGS = ( "$(inherited)", "-ObjC", diff --git a/YuMi/Appdelegate/AppDelegate.m b/YuMi/Appdelegate/AppDelegate.m index 9f9045b8..6dd78e53 100644 --- a/YuMi/Appdelegate/AppDelegate.m +++ b/YuMi/Appdelegate/AppDelegate.m @@ -144,16 +144,16 @@ void qg_VAP_Logger_handler(VAPLogLevel level, const char* file, int line, const ATTrackingManagerAuthorizationStatus status = ATTrackingManager.trackingAuthorizationStatus; switch (status) { case ATTrackingManagerAuthorizationStatusDenied: - NSLog(@"用户拒绝IDFA"); +// NSLog(@"用户拒绝IDFA"); break; case ATTrackingManagerAuthorizationStatusAuthorized: - NSLog(@"用户允许IDFA"); +// NSLog(@"用户允许IDFA"); break; case ATTrackingManagerAuthorizationStatusNotDetermined: { - NSLog(@"用户未做选择或未弹窗IDFA"); +// NSLog(@"用户未做选择或未弹窗IDFA"); //请求弹出用户授权框,只会在程序运行是弹框1次,除非卸载app重装,通地图、相机等权限弹框一样 [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) { - NSLog(@"app追踪IDFA权限:%lu",(unsigned long)status); +// NSLog(@"app追踪IDFA权限:%lu",(unsigned long)status); }]; } break; @@ -280,7 +280,7 @@ void qg_VAP_Logger_handler(VAPLogLevel level, const char* file, int line, const error = [NSError errorWithDomain:@"YOUR_ERROR_DOMAIN" code:9999 userInfo:dict]; // Replace this with code to handle the error appropriately. // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. - NSLog(@"Unresolved error %@, %@", error, [error userInfo]); +// NSLog(@"Unresolved error %@, %@", error, [error userInfo]); abort(); } @@ -312,7 +312,7 @@ void qg_VAP_Logger_handler(VAPLogLevel level, const char* file, int line, const if ([managedObjectContext hasChanges] && ![managedObjectContext save:&error]) { // Replace this implementation with code to handle the error appropriately. // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. - NSLog(@"Unresolved error %@, %@", error, [error userInfo]); +// NSLog(@"Unresolved error %@, %@", error, [error userInfo]); abort(); } } diff --git a/YuMi/Assets.xcassets/1.0.15/luck_gift_flag.imageset/1@3x.png b/YuMi/Assets.xcassets/1.0.15/luck_gift_flag.imageset/1@3x.png new file mode 100644 index 00000000..8c6e0bca Binary files /dev/null and b/YuMi/Assets.xcassets/1.0.15/luck_gift_flag.imageset/1@3x.png differ diff --git a/YuMi/Assets.xcassets/1.0.15/luck_gift_flag.imageset/Contents.json b/YuMi/Assets.xcassets/1.0.15/luck_gift_flag.imageset/Contents.json index 2831cec3..6e1d814b 100644 --- a/YuMi/Assets.xcassets/1.0.15/luck_gift_flag.imageset/Contents.json +++ b/YuMi/Assets.xcassets/1.0.15/luck_gift_flag.imageset/Contents.json @@ -9,7 +9,7 @@ "scale" : "2x" }, { - "filename" : "椭圆 5@3x.png", + "filename" : "1@3x.png", "idiom" : "universal", "scale" : "3x" } diff --git a/YuMi/Assets.xcassets/1.0.15/luck_gift_flag.imageset/椭圆 5@3x.png b/YuMi/Assets.xcassets/1.0.15/luck_gift_flag.imageset/椭圆 5@3x.png deleted file mode 100644 index bcb6e70e..00000000 Binary files a/YuMi/Assets.xcassets/1.0.15/luck_gift_flag.imageset/椭圆 5@3x.png and /dev/null differ diff --git a/YuMi/Assets.xcassets/1.0.15/luck_gift_flag_ball.imageset/Contents.json b/YuMi/Assets.xcassets/1.0.15/luck_gift_flag_ball.imageset/Contents.json index 67669cb5..6f0746d0 100644 --- a/YuMi/Assets.xcassets/1.0.15/luck_gift_flag_ball.imageset/Contents.json +++ b/YuMi/Assets.xcassets/1.0.15/luck_gift_flag_ball.imageset/Contents.json @@ -9,7 +9,7 @@ "scale" : "2x" }, { - "filename" : "容器 8156@3x.png", + "filename" : "椭圆 6@3x.png", "idiom" : "universal", "scale" : "3x" } diff --git a/YuMi/Assets.xcassets/1.0.15/luck_gift_flag_ball.imageset/容器 8156@3x.png b/YuMi/Assets.xcassets/1.0.15/luck_gift_flag_ball.imageset/容器 8156@3x.png deleted file mode 100644 index 868fd5e2..00000000 Binary files a/YuMi/Assets.xcassets/1.0.15/luck_gift_flag_ball.imageset/容器 8156@3x.png and /dev/null differ diff --git a/YuMi/Assets.xcassets/1.0.15/luck_gift_flag_ball.imageset/椭圆 6@3x.png b/YuMi/Assets.xcassets/1.0.15/luck_gift_flag_ball.imageset/椭圆 6@3x.png new file mode 100644 index 00000000..345577c4 Binary files /dev/null and b/YuMi/Assets.xcassets/1.0.15/luck_gift_flag_ball.imageset/椭圆 6@3x.png differ diff --git a/YuMi/Assets.xcassets/20.20.54/Contents.json b/YuMi/Assets.xcassets/20.20.54/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/YuMi/Assets.xcassets/20.20.54/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YuMi/Assets.xcassets/20.20.54/brove_gift_banner.imageset/1@3x.png b/YuMi/Assets.xcassets/20.20.54/brove_gift_banner.imageset/1@3x.png new file mode 100644 index 00000000..e4ffac16 Binary files /dev/null and b/YuMi/Assets.xcassets/20.20.54/brove_gift_banner.imageset/1@3x.png differ diff --git a/YuMi/Assets.xcassets/20.20.54/brove_gift_banner.imageset/Contents.json b/YuMi/Assets.xcassets/20.20.54/brove_gift_banner.imageset/Contents.json new file mode 100644 index 00000000..6e1d814b --- /dev/null +++ b/YuMi/Assets.xcassets/20.20.54/brove_gift_banner.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "1@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YuMi/Assets.xcassets/20.20.54/brove_tips_high.imageset/1@3x (2).png b/YuMi/Assets.xcassets/20.20.54/brove_tips_high.imageset/1@3x (2).png new file mode 100644 index 00000000..78807a78 Binary files /dev/null and b/YuMi/Assets.xcassets/20.20.54/brove_tips_high.imageset/1@3x (2).png differ diff --git a/YuMi/Assets.xcassets/20.20.54/brove_tips_high.imageset/Contents.json b/YuMi/Assets.xcassets/20.20.54/brove_tips_high.imageset/Contents.json new file mode 100644 index 00000000..8f10bc0c --- /dev/null +++ b/YuMi/Assets.xcassets/20.20.54/brove_tips_high.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "1@3x (2).png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YuMi/Assets.xcassets/20.20.54/brove_tips_low.imageset/1@3x (1).png b/YuMi/Assets.xcassets/20.20.54/brove_tips_low.imageset/1@3x (1).png new file mode 100644 index 00000000..40675411 Binary files /dev/null and b/YuMi/Assets.xcassets/20.20.54/brove_tips_low.imageset/1@3x (1).png differ diff --git a/YuMi/Assets.xcassets/20.20.54/brove_tips_low.imageset/Contents.json b/YuMi/Assets.xcassets/20.20.54/brove_tips_low.imageset/Contents.json new file mode 100644 index 00000000..89d6af5f --- /dev/null +++ b/YuMi/Assets.xcassets/20.20.54/brove_tips_low.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "1@3x (1).png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YuMi/CustomUI/MoliMoneyLabel.h b/YuMi/CustomUI/MoliMoneyLabel.h index 927b00a3..06410008 100644 --- a/YuMi/CustomUI/MoliMoneyLabel.h +++ b/YuMi/CustomUI/MoliMoneyLabel.h @@ -23,6 +23,8 @@ NS_ASSUME_NONNULL_BEGIN - (void)updateFont:(UIFont *)font size:(CGSize)size; - (void)displayIcon:(BOOL)displayOrNot; - (void)updateSpacing:(NSInteger)space; +- (void)updateLabelAlignment:(NSTextAlignment)alignment; +- (void)insertSpaceAtLeast; - (void)hideAll; - (void)removeSpace; diff --git a/YuMi/CustomUI/MoliMoneyLabel.m b/YuMi/CustomUI/MoliMoneyLabel.m index 69c9c5aa..a379654e 100644 --- a/YuMi/CustomUI/MoliMoneyLabel.m +++ b/YuMi/CustomUI/MoliMoneyLabel.m @@ -78,4 +78,13 @@ }]; } +- (void)updateLabelAlignment:(NSTextAlignment)alignment { + self.label.textAlignment = alignment; +} + +- (void)insertSpaceAtLeast { + UIView *space = [[UIView alloc] init]; + [self.stackView addArrangedSubview:space]; +} + @end diff --git a/YuMi/CustomUI/SVGA/XPSVGAPlayer.m b/YuMi/CustomUI/SVGA/XPSVGAPlayer.m index ebc30111..a7ba3013 100644 --- a/YuMi/CustomUI/SVGA/XPSVGAPlayer.m +++ b/YuMi/CustomUI/SVGA/XPSVGAPlayer.m @@ -76,7 +76,7 @@ - (void)startAnimation { if (self.videoItem == nil) { - NSLog(@"videoItem could not be nil!"); +// NSLog(@"videoItem could not be nil!"); return; } else if (self.drawLayer == nil) { self.videoItem = _videoItem; @@ -140,7 +140,7 @@ - (void)stepToFrame:(NSInteger)frame andPlay:(BOOL)andPlay { if (self.videoItem == nil) { - NSLog(@"videoItem could not be nil!"); +// NSLog(@"videoItem could not be nil!"); return; } else if (self.drawLayer == nil) { self.videoItem = _videoItem; diff --git a/YuMi/CustomUI/VagueImageView/UIImage+ImageEffects.m b/YuMi/CustomUI/VagueImageView/UIImage+ImageEffects.m index 68be7d2c..606bffd9 100755 --- a/YuMi/CustomUI/VagueImageView/UIImage+ImageEffects.m +++ b/YuMi/CustomUI/VagueImageView/UIImage+ImageEffects.m @@ -148,15 +148,15 @@ { // Check pre-conditions. if (self.size.width < 1 || self.size.height < 1) { - NSLog (@"*** error: invalid size: (%.2f x %.2f). Both dimensions must be >= 1: %@", self.size.width, self.size.height, self); +// NSLog (@"*** error: invalid size: (%.2f x %.2f). Both dimensions must be >= 1: %@", self.size.width, self.size.height, self); return nil; } if (!self.CGImage) { - NSLog (@"*** error: image must be backed by a CGImage: %@", self); +// NSLog (@"*** error: image must be backed by a CGImage: %@", self); return nil; } if (maskImage && !maskImage.CGImage) { - NSLog (@"*** error: maskImage must be backed by a CGImage: %@", maskImage); +// NSLog (@"*** error: maskImage must be backed by a CGImage: %@", maskImage); return nil; } diff --git a/YuMi/Global/YUMIMacroUitls.h b/YuMi/Global/YUMIMacroUitls.h index 45220b80..b254a697 100644 --- a/YuMi/Global/YUMIMacroUitls.h +++ b/YuMi/Global/YUMIMacroUitls.h @@ -46,7 +46,7 @@ isPhoneXSeries = [[UIApplication sharedApplication] delegate].window.safeAreaIns #define kFontHeavy(font) [UIFont systemFontOfSize:kGetScaleWidth(font) weight:UIFontWeightHeavy] ///内置版本号 -#define PI_App_Version @"1.0.39" +#define PI_App_Version @"1.0.40" ///渠道 #define PI_App_Source @"appstore" #define PI_Test_Flight @"TestFlight" diff --git a/YuMi/Modules/ShoppingMall/MyDressingViewController.m b/YuMi/Modules/ShoppingMall/MyDressingViewController.m index 69db2703..cbb1bd4e 100644 --- a/YuMi/Modules/ShoppingMall/MyDressingViewController.m +++ b/YuMi/Modules/ShoppingMall/MyDressingViewController.m @@ -340,7 +340,7 @@ static NSArray *> *MyDressUpOptions(void) { } [self.listView updateSelectedItem:indexPath]; } failure:^(NSError * _Nonnull error) { - NSLog(@"%@", error); +// NSLog(@"%@", error); }]; } } diff --git a/YuMi/Modules/YMLogin/View/CustomView/LoginInputItemView.m b/YuMi/Modules/YMLogin/View/CustomView/LoginInputItemView.m index df4cdb38..4ccd4912 100644 --- a/YuMi/Modules/YMLogin/View/CustomView/LoginInputItemView.m +++ b/YuMi/Modules/YMLogin/View/CustomView/LoginInputItemView.m @@ -276,7 +276,6 @@ static NSString *const kAreaCodePrefix = @"+"; #pragma mark - UITextFieldDelegate - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string { NSString *updatedText = [textField.text stringByReplacingCharactersInRange:range withString:string]; - NSLog(@"当前文本:%@", updatedText); switch (self.inputType) { case LoginInputType_id: case LoginInputType_email: diff --git a/YuMi/Modules/YMLogin/View/NewLogin/XPLoginAraeViewController.m b/YuMi/Modules/YMLogin/View/NewLogin/XPLoginAraeViewController.m index f113c104..f314a1eb 100644 --- a/YuMi/Modules/YMLogin/View/NewLogin/XPLoginAraeViewController.m +++ b/YuMi/Modules/YMLogin/View/NewLogin/XPLoginAraeViewController.m @@ -41,7 +41,7 @@ options:NSJSONReadingMutableLeaves error:&error]; if (error) { - NSLog(@"JSON Parsing Error: %@", error.localizedDescription); +// NSLog(@"JSON Parsing Error: %@", error.localizedDescription); } NSArray *codeList = [LoginAreaModel modelsWithArray:codeData[@"RECORDS"]]; [self getLocalPlistWithList:codeList]; diff --git a/YuMi/Modules/YMMessage/Model/AttachmentModel.h b/YuMi/Modules/YMMessage/Model/AttachmentModel.h index 77b9158a..b3bf9f4f 100644 --- a/YuMi/Modules/YMMessage/Model/AttachmentModel.h +++ b/YuMi/Modules/YMMessage/Model/AttachmentModel.h @@ -26,7 +26,7 @@ typedef NS_ENUM(NSUInteger, CustomMessageType) { CustomMessageType_Tweet = 10, ///全麦送 CustomMessageType_AllMicroSend = 12, - ///座驾进房动画 + ///座驾相關通知 CustomMessageType_Car_Notify = 15, ///踢出房间 CustomMessageType_Kick_User = 18, @@ -150,7 +150,6 @@ typedef NS_ENUM(NSUInteger, CustomMessageType) { CustomMessageType_System_message = 116, }; - /// first = CustomMessageType_System_message typedef NS_ENUM(NSUInteger, CustomMessageTypeSystemmessage) { Custom_Message_Sub_System_message = 1160, @@ -230,6 +229,7 @@ typedef NS_ENUM(NSUInteger, CustomMessageSubAllMicroSend) { ///first == CustomMessageType_Car_Notify typedef NS_ENUM(NSUInteger, CustomMessageSubCar) { + Custom_Message_Sub_Car_OutDate = 151, Custom_Message_Sub_Car_EnterRoom = 159, //进房动画 }; @@ -702,6 +702,10 @@ typedef NS_ENUM(NSUInteger, CustomMessageTypeSuperGift) { Custom_Message_Sub_Super_Gift_Winning_Coins = 1062, // 全服显示中奖内容 Custom_Message_Sub_Super_Gift_Winning_Coins_ALL_Room = 1063, + + Custom_Message_Sub_Super_Gift_Room_Message = 1064, // 公屏消息 + Custom_Message_Sub_Super_Gift_UI_Rffect = 1065, // 金币动效 & 大奖提示 + Custom_Message_Sub_Super_Gift_Banner = 1066, // 飘屏 }; ///通用飘屏 //CustomMessageType_General_Floating_Screen = 105, diff --git a/YuMi/Modules/YMMessage/Tool/CustomAttachmentDecoder.m b/YuMi/Modules/YMMessage/Tool/CustomAttachmentDecoder.m index 663ef062..72ffd93d 100644 --- a/YuMi/Modules/YMMessage/Tool/CustomAttachmentDecoder.m +++ b/YuMi/Modules/YMMessage/Tool/CustomAttachmentDecoder.m @@ -53,7 +53,7 @@ options:NSJSONReadingMutableContainers error:&err]; if(err) { - NSLog(@"json解析失败:%@",err); +// NSLog(@"json解析失败:%@",err); return nil; } return dic; diff --git a/YuMi/Modules/YMMessage/View/Session/Content/MessageContentOpenLiveView.m b/YuMi/Modules/YMMessage/View/Session/Content/MessageContentOpenLiveView.m index 08264348..ac0111d7 100644 --- a/YuMi/Modules/YMMessage/View/Session/Content/MessageContentOpenLiveView.m +++ b/YuMi/Modules/YMMessage/View/Session/Content/MessageContentOpenLiveView.m @@ -26,7 +26,7 @@ ///显示标题 @property (nonatomic,strong) UILabel *titleLabel; ///显示id -@property (nonatomic,strong) UILabel *idLabel; +//@property (nonatomic,strong) UILabel *idLabel; @property (nonatomic,strong) ContentOpenLiveInfoModel *userInfo; @end @@ -38,7 +38,7 @@ self.userInfo = obj.userInfo; if (obj.avatar.length > 0 && obj.nick.length > 0) { self.avatarImageView.imageUrl = obj.avatar; - self.idLabel.text = obj.nick; + self.titleLabel.text = obj.nick; } else { if (obj.uid.integerValue > 0) { NSArray *uids = @[obj.uid]; @@ -46,7 +46,8 @@ if (error == nil) { NIMUser *user = users[0]; self.avatarImageView.imageUrl = user.userInfo.avatarUrl; - self.idLabel.text = [NSString stringWithFormat:YMLocalizedString(@"MessageContentOpenLiveView0"), user.userInfo.nickName]; + self.titleLabel.text = [NSString stringWithFormat:YMLocalizedString(@"MessageContentOpenLiveView0"), + user.userInfo.nickName]; } }]; } @@ -60,7 +61,7 @@ [self.backView addSubview:self.avatarImageView]; [self.backView addSubview:self.titleLabel]; - [self.backView addSubview:self.idLabel]; +// [self.backView addSubview:self.idLabel]; UITapGestureRecognizer * tap= [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(backViewTapRecognozer)]; [self.backView addGestureRecognizer:tap]; } @@ -81,14 +82,14 @@ [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.leading.mas_equalTo(self.avatarImageView.mas_trailing).offset(10); - make.bottom.mas_equalTo(self.avatarImageView.mas_centerY).offset(-2); + make.top.mas_equalTo(self.avatarImageView).offset(-2); make.trailing.mas_lessThanOrEqualTo(self.backView); }]; - [self.idLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.mas_equalTo(self.titleLabel); - make.top.mas_equalTo(self.avatarImageView.mas_centerY).offset(2); - }]; +// [self.idLabel mas_makeConstraints:^(MASConstraintMaker *make) { +// make.leading.trailing.mas_equalTo(self.titleLabel); +// make.top.mas_equalTo(self.avatarImageView.mas_centerY).offset(2); +// }]; } #pragma mark - Event Response @@ -132,20 +133,21 @@ - (UILabel *)titleLabel { if (!_titleLabel) { _titleLabel = [[UILabel alloc] init]; + _titleLabel.numberOfLines = 0; _titleLabel.font = [UIFont systemFontOfSize:17]; - _titleLabel.text = YMLocalizedString(@"MessageContentOpenLiveView1"); +// _titleLabel.text = YMLocalizedString(@"MessageContentOpenLiveView1"); _titleLabel.textColor = [DJDKMIMOMColor mainTextColor]; } return _titleLabel; } -- (UILabel *)idLabel { - if (!_idLabel) { - _idLabel = [[UILabel alloc] init]; - _idLabel.font = [UIFont systemFontOfSize:13]; - _idLabel.textColor = [DJDKMIMOMColor secondTextColor]; - } - return _idLabel; -} +//- (UILabel *)idLabel { +// if (!_idLabel) { +// _idLabel = [[UILabel alloc] init]; +// _idLabel.font = [UIFont systemFontOfSize:13]; +// _idLabel.textColor = [DJDKMIMOMColor secondTextColor]; +// } +// return _idLabel; +//} @end diff --git a/YuMi/Modules/YMMessage/View/Session/Content/MessageContentUnSupportView.m b/YuMi/Modules/YMMessage/View/Session/Content/MessageContentUnSupportView.m index a8e4bcf5..9d55e5f1 100644 --- a/YuMi/Modules/YMMessage/View/Session/Content/MessageContentUnSupportView.m +++ b/YuMi/Modules/YMMessage/View/Session/Content/MessageContentUnSupportView.m @@ -22,8 +22,8 @@ @implementation MessageContentUnSupportView - (void)render:(MessageBaseModel *)message { - NIMCustomObject *obj = (NIMCustomObject *)message.message.messageObject; - NSLog(@"%@", obj); +// NIMCustomObject *obj = (NIMCustomObject *)message.message.messageObject; +// NSLog(@"%@", obj); } - (instancetype)initWithFrame:(CGRect)frame { diff --git a/YuMi/Modules/YMMessage/View/Session/Content/SesssionModel/MessageTextClickModel.m b/YuMi/Modules/YMMessage/View/Session/Content/SesssionModel/MessageTextClickModel.m index b9bfdcd3..d26b8b06 100644 --- a/YuMi/Modules/YMMessage/View/Session/Content/SesssionModel/MessageTextClickModel.m +++ b/YuMi/Modules/YMMessage/View/Session/Content/SesssionModel/MessageTextClickModel.m @@ -22,7 +22,13 @@ messageText = attachment.data[@"msg"]; self.contentInfo = [ContentSecretaryModel modelWithJSON:attachment.data]; } - } + } else if (attachment.first == CustomMessageType_Car_Notify) { + if (attachment.second == Custom_Message_Sub_Car_OutDate) { + messageText = attachment.data[@"msg"]; + self.contentInfo = [ContentSecretaryModel modelWithJSON:attachment.data]; + self.contentInfo.routerType = SecretaryRouterType_Car; + } + } } if (!messageText) { // messageText = YMLocalizedString(@"MessageContentText0"); diff --git a/YuMi/Modules/YMMessage/View/Session/Content/SesssionModel/MessageTextModel.m b/YuMi/Modules/YMMessage/View/Session/Content/SesssionModel/MessageTextModel.m index 11c267dd..049bd079 100644 --- a/YuMi/Modules/YMMessage/View/Session/Content/SesssionModel/MessageTextModel.m +++ b/YuMi/Modules/YMMessage/View/Session/Content/SesssionModel/MessageTextModel.m @@ -7,6 +7,7 @@ #import "MessageTextModel.h" #import "QEmotionHelper.h" +#import "AttachmentModel.h" @implementation MessageTextModel @@ -14,6 +15,17 @@ if (self = [super initWithMessage:message]) { self.messageType = SessionMessageType_Text; NSString * messageText = message.text; + if (!messageText) { + if (message.messageType == NIMMessageTypeCustom) { + NIMCustomObject *obj = (NIMCustomObject *) message.messageObject; + AttachmentModel *attachment = (AttachmentModel *) obj.attachment; + if (attachment.first == CustomMessageType_Car_Notify) { + if (attachment.second == Custom_Message_Sub_Car_OutDate) { + messageText = attachment.data[@"msg"]; + } + } + } + } if (!messageText) { // messageText = YMLocalizedString(@"MessageContentText0"); messageText = [NSString stringWithFormat:@"%@\n%@", diff --git a/YuMi/Modules/YMMessage/View/Session/SessionViewController.m b/YuMi/Modules/YMMessage/View/Session/SessionViewController.m index 51ad4b69..43c3849d 100644 --- a/YuMi/Modules/YMMessage/View/Session/SessionViewController.m +++ b/YuMi/Modules/YMMessage/View/Session/SessionViewController.m @@ -302,7 +302,10 @@ }else if(attachment.first == CustomMessageType_Game_Order && attachment.second == Custom_Message_Sub_Game_order){ model = [[MessageGameOrderModel alloc] initWithMessage:message]; - }else { + } else if (attachment.first == CustomMessageType_Car_Notify && + attachment.second == Custom_Message_Sub_Car_OutDate) { + model = [[MessageTextClickModel alloc] initWithMessage:message]; + } else { model = [[MessageUnSupportModel alloc] initWithMessage:message]; } return model; diff --git a/YuMi/Modules/YMMessage/View/Session/XPSessionMainViewController.m b/YuMi/Modules/YMMessage/View/Session/XPSessionMainViewController.m index 5e262332..a0850d7b 100644 --- a/YuMi/Modules/YMMessage/View/Session/XPSessionMainViewController.m +++ b/YuMi/Modules/YMMessage/View/Session/XPSessionMainViewController.m @@ -24,7 +24,6 @@ @property (nonatomic, strong) JXCategoryIndicatorImageView *lineView; @property (nonatomic, strong) JXPagerView *pagingView; @property (nonatomic, strong) NSArray *titles; -@property (nonatomic,strong) UIView *headView; @property (nonatomic,strong) SessionListViewController *sessionListVC; ///好友 @@ -82,7 +81,7 @@ self.view.backgroundColor = [[ClientConfig shareConfig] bgColor]; - self.headView = [UIView new]; +// self.headView = [UIView new]; [self.view addSubview:self.pagingView]; } - (void)initSubViewConstraints { @@ -113,15 +112,15 @@ #pragma mark - JXCategoryViewDelegate - (NSUInteger)tableHeaderViewHeightInPagerView:(JXPagerView *)pagerView { - return 57; + return 44+[UIApplication sharedApplication].keyWindow.safeAreaInsets.top - 45; } - (UIView *)tableHeaderViewInPagerView:(JXPagerView *)pagerView { - return self.headView; + return [UIView new]; } - (NSUInteger)heightForPinSectionHeaderInPagerView:(JXPagerView *)pagerView { - return 50; + return 45; } - (UIView *)viewForPinSectionHeaderInPagerView:(JXPagerView *)pagerView { @@ -180,12 +179,12 @@ _titleView.titleColor = UIColorFromRGB(0x313131); _titleView.titleSelectedColor = UIColorFromRGB(0x313131); _titleView.titleFont = kFontRegular(16); - _titleView.titleSelectedFont = kFontSemibold(20); + _titleView.titleSelectedFont = kFontBold(20); _titleView.titleLabelAnchorPointStyle = JXCategoryTitleLabelAnchorPointStyleBottom; _titleView.contentScrollViewClickTransitionAnimationEnabled = NO; _titleView.defaultSelectedIndex = 0; _titleView.averageCellSpacingEnabled = NO; - _titleView.contentEdgeInsetLeft = 20; + _titleView.contentEdgeInsetLeft = 16; _titleView.contentEdgeInsetRight = 120; _titleView.titles = self.titles; _titleView.cellSpacing = 20; diff --git a/YuMi/Modules/YMMessage/View/SessionList/SessionListViewController.m b/YuMi/Modules/YMMessage/View/SessionList/SessionListViewController.m index d5969693..9b288a7b 100644 --- a/YuMi/Modules/YMMessage/View/SessionList/SessionListViewController.m +++ b/YuMi/Modules/YMMessage/View/SessionList/SessionListViewController.m @@ -91,7 +91,9 @@ NSString * const kMessageShowReadDotKey = @"kMessageShowReadDotKey"; - (void)getUserInfo { NSString * uid = [AccountInfoStorage instance].getUid; + @kWeakify(self); [Api getUserInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { + @kStrongify(self); if (code == 200) { UserInfoModel * userInfo = [UserInfoModel modelWithDictionary:data.data]; self.userInfo = userInfo; diff --git a/YuMi/Modules/YMMine/Model/XPMineItemModel.h b/YuMi/Modules/YMMine/Model/XPMineItemModel.h index 84fc7504..7cea511d 100644 --- a/YuMi/Modules/YMMine/Model/XPMineItemModel.h +++ b/YuMi/Modules/YMMine/Model/XPMineItemModel.h @@ -36,7 +36,7 @@ typedef NS_ENUM(NSInteger, XPMineItemType) { XPMineItemType_My_Gift = 77,///我的转赠 XPMineItemType_My_Game_Order = 78,///我的陪玩點單 XPMineItemType_My_Item = 79,///我的已购装扮 - XPMineItemType_VIP_Switch = 80,///VIP 开关 + XPMineItemType_My_Agent = 80,///我的工会 }; diff --git a/YuMi/Modules/YMMine/Presenter/XPMinePresent.m b/YuMi/Modules/YMMine/Presenter/XPMinePresent.m index 758d877a..a97f82cf 100644 --- a/YuMi/Modules/YMMine/Presenter/XPMinePresent.m +++ b/YuMi/Modules/YMMine/Presenter/XPMinePresent.m @@ -78,7 +78,7 @@ }fail:^(NSInteger code, NSString * _Nullable msg) { // @kStrongify(self); // [[self getView]onGetClanDetailInfoFail]; - NSLog(@"%@", msg); +// NSLog(@"%@", msg); }] uid:uid]; } diff --git a/YuMi/Modules/YMMine/View/Cell/XPMineListCell.m b/YuMi/Modules/YMMine/View/Cell/XPMineListCell.m index 1441db21..b34f2e9a 100644 --- a/YuMi/Modules/YMMine/View/Cell/XPMineListCell.m +++ b/YuMi/Modules/YMMine/View/Cell/XPMineListCell.m @@ -87,7 +87,7 @@ if([_itemModel.centerPic isEqualToString:@"mineview_set"]){ self.iconView.image = [UIImage imageNamed:@"mineview_set"]; }else{ - self.iconView.imageUrl = _itemModel.centerPic; + self.iconView.imageUrl = [_itemModel.centerPic stringByReplacingOccurrencesOfString:@"\n" withString:@""]; } self.badgeImageView.imageUrl = itemModel.centerBadge ? itemModel.centerBadge : nil; diff --git a/YuMi/Modules/YMMine/View/GiveDiamond/View/XPMineChooseGiveDiamondVC.m b/YuMi/Modules/YMMine/View/GiveDiamond/View/XPMineChooseGiveDiamondVC.m index 94f0b589..264fec24 100644 --- a/YuMi/Modules/YMMine/View/GiveDiamond/View/XPMineChooseGiveDiamondVC.m +++ b/YuMi/Modules/YMMine/View/GiveDiamond/View/XPMineChooseGiveDiamondVC.m @@ -51,7 +51,7 @@ UIKIT_EXTERN NSString * const kGiveDiamondDailyNum; } -(void)dealloc{ - NSLog(@"内存释放了"); +// NSLog(@"内存释放了"); } #pragma mark -XPMineConfirmGiveDiamondViewDelegate diff --git a/YuMi/Modules/YMMine/View/MineInfo/XPMineUserDataViewController.m b/YuMi/Modules/YMMine/View/MineInfo/XPMineUserDataViewController.m index 23317cef..96a621b2 100644 --- a/YuMi/Modules/YMMine/View/MineInfo/XPMineUserDataViewController.m +++ b/YuMi/Modules/YMMine/View/MineInfo/XPMineUserDataViewController.m @@ -547,7 +547,7 @@ typedef enum : NSUInteger { }]; if (monentsInfos) { NSInteger section = [self.datasource indexOfObject:monentsInfo]; - [self.tableView reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:section inSection:1]] withRowAnimation:UITableViewRowAnimationNone]; + [self.tableView reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:section inSection:1]] withRowAnimation:UITableViewRowAnimationFade]; } } diff --git a/YuMi/Modules/YMMine/View/MineInfo/XPMineUserInfoEditViewController.m b/YuMi/Modules/YMMine/View/MineInfo/XPMineUserInfoEditViewController.m index 73725b7b..8e1ddc7b 100644 --- a/YuMi/Modules/YMMine/View/MineInfo/XPMineUserInfoEditViewController.m +++ b/YuMi/Modules/YMMine/View/MineInfo/XPMineUserInfoEditViewController.m @@ -136,7 +136,7 @@ TZImagePickerControllerDelegate> }]; // if (self.userInfo.userVipInfoVO.uploadGifAvatar) { - if (![self.userInfo isEnglish]) { +// if (![self.userInfo isEnglish]) { TTActionSheetConfig *gifLibraryConfig = [TTActionSheetConfig normalTitle:YMLocalizedString(@"UserInfoEdit_1.0.17_0") clickAction:^{ if (self.userInfo.uploadGifAvatarPrice == 0) { [self displayGifPhotoBroswer]; @@ -167,9 +167,9 @@ TZImagePickerControllerDelegate> }]; gifLibraryConfig.displayMoliCoin = self.userInfo.uploadGifAvatarPrice > 0; [TTPopup actionSheetWithItems:@[cameraConfig, photoLibraryConfig, gifLibraryConfig]]; - } else { - [TTPopup actionSheetWithItems:@[cameraConfig, photoLibraryConfig]]; - } +// } else { +// [TTPopup actionSheetWithItems:@[cameraConfig, photoLibraryConfig]]; +// } } - (void)displayGifPhotoBroswer { diff --git a/YuMi/Modules/YMMine/View/Noble/View/SubViews/PINobleCenterListView.m b/YuMi/Modules/YMMine/View/Noble/View/SubViews/PINobleCenterListView.m index 527593d3..324fed22 100644 --- a/YuMi/Modules/YMMine/View/Noble/View/SubViews/PINobleCenterListView.m +++ b/YuMi/Modules/YMMine/View/Noble/View/SubViews/PINobleCenterListView.m @@ -130,10 +130,10 @@ } } -- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{ - PINobleCenterListCell *cell = [collectionView cellForItemAtIndexPath:indexPath]; - NSLog(@"%@",cell); -} +//- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{ +// PINobleCenterListCell *cell = [collectionView cellForItemAtIndexPath:indexPath]; +// NSLog(@"%@",cell); +//} #pragma mark - 懒加载 diff --git a/YuMi/Modules/YMMine/View/Noble/View/VIPCenterViewController.m b/YuMi/Modules/YMMine/View/Noble/View/VIPCenterViewController.m index 6f726522..de81c05a 100644 --- a/YuMi/Modules/YMMine/View/Noble/View/VIPCenterViewController.m +++ b/YuMi/Modules/YMMine/View/Noble/View/VIPCenterViewController.m @@ -763,7 +763,7 @@ UICollectionViewDataSource> - (void)setupData { [self showLoading]; [self loadUserInfo]; - [self loadWalletInfo]; +// [self loadWalletInfo]; } - (void)loadUserInfo { @@ -858,7 +858,7 @@ UICollectionViewDataSource> @kStrongify(self); XPNobleCenterPayView *payView = [[XPNobleCenterPayView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)]; payView.money = @(self.currentVIPInfo.buyAmount); - payView.diamonds = self.walletInfo.diamonds; +// payView.diamonds = self.walletInfo.diamonds; payView.vipLevel = @(self.currentVIPInfo.vipLevel).stringValue; payView.delegate = self; [self.view addSubview:payView]; diff --git a/YuMi/Modules/YMMine/View/Recharge/IAPManager.m b/YuMi/Modules/YMMine/View/Recharge/IAPManager.m index c8e976a0..8635f537 100644 --- a/YuMi/Modules/YMMine/View/Recharge/IAPManager.m +++ b/YuMi/Modules/YMMine/View/Recharge/IAPManager.m @@ -94,7 +94,7 @@ // 验单逻辑 - (void)handleRetryCheckReceipt { NSArray *array = [RechargeStorage getAllReceiptsWithUid:[AccountInfoStorage instance].getUid]; - NSLog(@" ------------.------------ 尝试:%@", array); + // NSLog(@" ------------.------------ 尝试:%@", array); @synchronized (array) { if (array.count == 0 || self.isProcessing) { return; @@ -211,29 +211,29 @@ @kStrongify(self); switch (state) { case StoreConditionResultStart: - NSLog(@"~~~```~~~ Purchase started"); + // NSLog(@"~~~```~~~ Purchase started"); break; case StoreConditionResultPay: - NSLog(@"~~~```~~~ Processing payment"); + // NSLog(@"~~~```~~~ Processing payment"); break; case StoreConditionResultVerifiedServer: - NSLog(@"~~~```~~~ Verified by server"); + // NSLog(@"~~~```~~~ Verified by server"); [self handleIAPSuccess:param]; break; case StoreConditionResultUserCancelled: - NSLog(@"~~~```~~~ User cancelled purchase"); + // NSLog(@"~~~```~~~ User cancelled purchase"); [self handleFailurePurchase:@""]; break; case StoreConditionResultNoProduct: - NSLog(@"~~~```~~~ No product found"); + // NSLog(@"~~~```~~~ No product found"); [self handleFailurePurchase:[NSString stringWithFormat:@"%@ No product found", YMLocalizedString(@"XPIAPRechargeViewController1")]]; break; case StoreConditionResultFailedVerification: - NSLog(@"~~~```~~~ Verification failed"); + // NSLog(@"~~~```~~~ Verification failed"); [self handleFailurePurchase:YMLocalizedString(@"XPIAPRechargeViewController1")]; break; case StoreConditionResultUnowned: - NSLog(@"~~~```~~~ Result Unowned"); + // NSLog(@"~~~```~~~ Result Unowned"); [self handleFailurePurchase:YMLocalizedString(@"XPIAPRechargeViewController1")]; break; default: @@ -332,7 +332,7 @@ uid:[AccountInfoStorage instance].getUid]; } - NSLog(@" ------------.------------ 保存账单内容:%@ ", receiptInfo); + // NSLog(@" ------------.------------ 保存账单内容:%@ ", receiptInfo); } // 通过苹果收据与后端订单进行验单与发货 @@ -340,7 +340,7 @@ - (void)checkReceiptWithTransactionID:(NSString *)tID orderID:(NSString *)orderID { - NSLog(@" ------------.------------ 后端验单:%@ | %@", tID, orderID); + // NSLog(@" ------------.------------ 后端验单:%@ | %@", tID, orderID); @kWeakify(self); [Api checkReceipt:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { @@ -354,7 +354,7 @@ // 参数异常,暂不处理 } } - NSLog(@" ------------.------------ 后端验单结果:%@ ",msg); + // NSLog(@" ------------.------------ 后端验单结果:%@ ",msg); } chooseEnv:@"true" chargeRecordId:orderID @@ -368,7 +368,7 @@ orderID:(NSString *)orderID next:(void(^)(BOOL isSuccess))next { - NSLog(@" ------------.------------ 尝试后端验单:%@ | %@", tID, orderID); + // NSLog(@" ------------.------------ 尝试后端验单:%@ | %@", tID, orderID); if (![self isValidTransactionID:tID orderID:orderID]) { // 本地数据异常,不重试 @@ -388,7 +388,7 @@ [self handleCheckReceiptSuccess:tID isFromRecheck:YES]; } - NSLog(@" ------------.------------ 尝试后端验单结果:%ld, %@ ", (long)code, msg); + // NSLog(@" ------------.------------ 尝试后端验单结果:%ld, %@ ", (long)code, msg); if (next) { next(code == 200 || code == 1701); @@ -410,13 +410,13 @@ completionHandler:^(BOOL success, NSError * _Nullable error) { @kStrongify(self); if (success) { - NSLog(@" ------------.------------ apple 验单成功"); + // NSLog(@" ------------.------------ apple 验单成功"); // 流程完成,移除本地缓存账单 [RechargeStorage delegateTransactionId:tID uid:[AccountInfoStorage instance].getUid]; } else { // 出现异常 - NSLog(@" ------------.------------ apple 验单成功:%@ ",error); + // NSLog(@" ------------.------------ apple 验单成功:%@ ",error); if (error == nil) { // 该订单在 appstore 已无法找到,不必再重试 [RechargeStorage delegateTransactionId:tID diff --git a/YuMi/Modules/YMMine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.m b/YuMi/Modules/YMMine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.m index 4ecf81f4..04523a94 100644 --- a/YuMi/Modules/YMMine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.m +++ b/YuMi/Modules/YMMine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.m @@ -415,7 +415,7 @@ HWDMP4PlayDelegate> } - (void)scrollViewDidScroll:(UIScrollView *)scrollView { - NSLog(@"%@", [NSValue valueWithCGPoint:scrollView.contentOffset]); +// NSLog(@"%@", [NSValue valueWithCGPoint:scrollView.contentOffset]); } - (void)setupIDArea { @@ -732,7 +732,7 @@ HWDMP4PlayDelegate> [self.personalBGMP4 playHWDMP4:videoUrl repeatCount:-1 delegate:self]; } } failureBlock:^(NSError * _Nullable error) { - NSLog(@"%@", error); +// NSLog(@"%@", error); }]; } break; diff --git a/YuMi/Modules/YMMine/View/SubViews/MineInfo/XPMineUserInfoVoiceCardView.m b/YuMi/Modules/YMMine/View/SubViews/MineInfo/XPMineUserInfoVoiceCardView.m index 9cc2b27c..5c7fdafd 100644 --- a/YuMi/Modules/YMMine/View/SubViews/MineInfo/XPMineUserInfoVoiceCardView.m +++ b/YuMi/Modules/YMMine/View/SubViews/MineInfo/XPMineUserInfoVoiceCardView.m @@ -85,7 +85,7 @@ NSString *filePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0] stringByAppendingPathComponent:@"mineSkillCardVoice"]; NSString *fullPath = [filePath stringByAppendingPathComponent:fileName]; - NSLog(@"下载的路径:%@", fullPath); +// NSLog(@"下载的路径:%@", fullPath); if ([[NSFileManager defaultManager] fileExistsAtPath:fullPath]) { self.isPlaying = YES; sender.selected = YES; @@ -102,7 +102,7 @@ NSFileManager *fileMgr = [[NSFileManager alloc] init]; NSError * error; [fileMgr createDirectoryAtPath:filePath withIntermediateDirectories:YES attributes:nil error:&error]; - NSLog(@"%@", error.description); +// NSLog(@"%@", error.description); } [self downloadAudioWithFileName:fileName musicUrl:url completion:^(BOOL isSuccess, NSString *editAudioPath) { self.isPlaying = YES; diff --git a/YuMi/Modules/YMMine/View/XPMineViewController.m b/YuMi/Modules/YMMine/View/XPMineViewController.m index 0874621b..9dc17eef 100644 --- a/YuMi/Modules/YMMine/View/XPMineViewController.m +++ b/YuMi/Modules/YMMine/View/XPMineViewController.m @@ -228,6 +228,9 @@ UIKIT_EXTERN NSString *kRequestTicket; } switch (type) { + case XPMineItemType_My_Agent: + [self clickHallAction]; + break; case XPMineItemType_My_Setting:{ [self settingButtonAction]; break; @@ -341,10 +344,6 @@ UIKIT_EXTERN NSString *kRequestTicket; [self toMineItems]; } break; - case XPMineItemType_VIP_Switch: { - VipSettingViewController *vc = [[VipSettingViewController alloc] init]; - [self.navigationController pushViewController:vc animated:YES]; - } break; default: break; diff --git a/YuMi/Modules/YMMine/View/XPMomentUserDataViewController.m b/YuMi/Modules/YMMine/View/XPMomentUserDataViewController.m index e6d181a3..2f1f9e33 100644 --- a/YuMi/Modules/YMMine/View/XPMomentUserDataViewController.m +++ b/YuMi/Modules/YMMine/View/XPMomentUserDataViewController.m @@ -168,7 +168,7 @@ }]; if (monentsInfos) { NSInteger section = [self.datasource indexOfObject:monentsInfo]; - [self.tableView reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:section inSection:1]] withRowAnimation:UITableViewRowAnimationNone]; + [self.tableView reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:section inSection:1]] withRowAnimation:UITableViewRowAnimationFade]; } } diff --git a/YuMi/Modules/YMMonents/View/SubViews/XPMomentsUserInfoView.m b/YuMi/Modules/YMMonents/View/SubViews/XPMomentsUserInfoView.m index 0f81ac0f..68de8367 100644 --- a/YuMi/Modules/YMMonents/View/SubViews/XPMomentsUserInfoView.m +++ b/YuMi/Modules/YMMonents/View/SubViews/XPMomentsUserInfoView.m @@ -289,7 +289,7 @@ self.headWearImageView.hidden = NO; self.headWearImageView.image = sprit; } failureBlock:^(NSError * _Nullable error) { - NSLog(@"%@", error); +// NSLog(@"%@", error); }]; } } diff --git a/YuMi/Modules/YMMonents/View/XPMomentsAttentionViewController.m b/YuMi/Modules/YMMonents/View/XPMomentsAttentionViewController.m index 164644c8..9a3893b5 100644 --- a/YuMi/Modules/YMMonents/View/XPMomentsAttentionViewController.m +++ b/YuMi/Modules/YMMonents/View/XPMomentsAttentionViewController.m @@ -189,7 +189,7 @@ UIKIT_EXTERN NSString *kRequestTicket; }]; if (monentsInfos) { NSInteger row = [self.datasource indexOfObject:monentsInfo]; - [self.tableView reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:row inSection:0]] withRowAnimation:UITableViewRowAnimationNone]; + [self.tableView reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:row inSection:0]] withRowAnimation:UITableViewRowAnimationFade]; } } diff --git a/YuMi/Modules/YMMonents/View/XPMomentsDetailViewController.m b/YuMi/Modules/YMMonents/View/XPMomentsDetailViewController.m index 021953df..4a26e60f 100644 --- a/YuMi/Modules/YMMonents/View/XPMomentsDetailViewController.m +++ b/YuMi/Modules/YMMonents/View/XPMomentsDetailViewController.m @@ -327,7 +327,7 @@ - (void)XPMomentsTableViewCell:(XPMomentsTableViewCell *)view didClicFold:(MomentsInfoModel *)monentsInfo { self.momentsInfo = monentsInfo; - [self.tableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationNone]; + [self.tableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationFade]; } #pragma mark - InputBoardDataSource diff --git a/YuMi/Modules/YMMonents/View/XPMomentsMineViewController.m b/YuMi/Modules/YMMonents/View/XPMomentsMineViewController.m index b86008e6..e6faa6ec 100644 --- a/YuMi/Modules/YMMonents/View/XPMomentsMineViewController.m +++ b/YuMi/Modules/YMMonents/View/XPMomentsMineViewController.m @@ -145,7 +145,7 @@ }]; if (momentsInfos) { NSInteger row = [self.datasource indexOfObject:momentsInfos]; - [self.tableView reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:row inSection:0]] withRowAnimation:UITableViewRowAnimationNone]; + [self.tableView reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:row inSection:0]] withRowAnimation:UITableViewRowAnimationFade]; } } diff --git a/YuMi/Modules/YMMonents/View/XPMomentsRecommendViewController.m b/YuMi/Modules/YMMonents/View/XPMomentsRecommendViewController.m index be006fda..1f53fa46 100644 --- a/YuMi/Modules/YMMonents/View/XPMomentsRecommendViewController.m +++ b/YuMi/Modules/YMMonents/View/XPMomentsRecommendViewController.m @@ -200,7 +200,7 @@ UIKIT_EXTERN NSString *kRequestTicket; }]; if (momentsInfos) { NSInteger row = [self.datasource indexOfObject:momentsInfo]; - [self.tableView reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:row inSection:0]] withRowAnimation:UITableViewRowAnimationNone]; + [self.tableView reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:row inSection:0]] withRowAnimation:UITableViewRowAnimationFade]; } } diff --git a/YuMi/Modules/YMMonents/View/XPMomentsSimpleDetailViewController.m b/YuMi/Modules/YMMonents/View/XPMomentsSimpleDetailViewController.m index 2e685715..019bc167 100644 --- a/YuMi/Modules/YMMonents/View/XPMomentsSimpleDetailViewController.m +++ b/YuMi/Modules/YMMonents/View/XPMomentsSimpleDetailViewController.m @@ -348,7 +348,7 @@ - (void)XPMomentsTableViewCell:(XPMomentsTableViewCell *)view didClicFold:(MomentsInfoModel *)monentsInfo { self.momentsInfo = monentsInfo; - [self.tableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationNone]; + [self.tableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationFade]; } #pragma mark - InputBoardDataSource diff --git a/YuMi/Modules/YMMonents/View/XPMomentsViewController.m b/YuMi/Modules/YMMonents/View/XPMomentsViewController.m index 455804af..f3d1cedc 100644 --- a/YuMi/Modules/YMMonents/View/XPMomentsViewController.m +++ b/YuMi/Modules/YMMonents/View/XPMomentsViewController.m @@ -97,13 +97,13 @@ - (void)initSubViewConstraints { [self.navView mas_makeConstraints:^(MASConstraintMaker *make) { make.leading.trailing.top.mas_equalTo(self.view); - make.height.mas_equalTo(kNavigationHeight); + make.height.mas_equalTo(44+[UIApplication sharedApplication].keyWindow.safeAreaInsets.top); }]; [self.titleView mas_makeConstraints:^(MASConstraintMaker *make) { make.leading.trailing.mas_equalTo(self.navView); make.height.mas_equalTo(45); - make.top.mas_equalTo(self.navView).offset(kSafeAreaTopHeight + 20); + make.bottom.mas_equalTo(self.navView);//.offset(kSafeAreaTopHeight + 20); }]; [self.messageButton mas_makeConstraints:^(MASConstraintMaker *make) { @@ -212,7 +212,7 @@ _titleView.titleColor = UIColorFromRGB(0x313131); _titleView.titleSelectedColor = UIColorFromRGB(0x313131); _titleView.titleFont = kFontRegular(16); - _titleView.titleSelectedFont = kFontSemibold(20); + _titleView.titleSelectedFont = kFontBold(20); _titleView.titleLabelAnchorPointStyle = JXCategoryTitleLabelAnchorPointStyleBottom; _titleView.contentScrollViewClickTransitionAnimationEnabled = NO; _titleView.averageCellSpacingEnabled = NO; @@ -221,7 +221,7 @@ _titleView.titles = self.titles; _titleView.listContainer = self.listContainerView; _titleView.defaultSelectedIndex = 2; - _titleView.contentEdgeInsetLeft = 15; + _titleView.contentEdgeInsetLeft = 16; } return _titleView; } diff --git a/YuMi/Modules/YMMonents/View/XPMonentsTopicLatestViewController.m b/YuMi/Modules/YMMonents/View/XPMonentsTopicLatestViewController.m index e70f9ecb..3e078a2b 100644 --- a/YuMi/Modules/YMMonents/View/XPMonentsTopicLatestViewController.m +++ b/YuMi/Modules/YMMonents/View/XPMonentsTopicLatestViewController.m @@ -240,7 +240,7 @@ }]; if (monentsInfos) { NSInteger row = [self.datasource indexOfObject:monentsInfo]; - [self.tableView reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:row inSection:0]] withRowAnimation:UITableViewRowAnimationNone]; + [self.tableView reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:row inSection:0]] withRowAnimation:UITableViewRowAnimationFade]; } } diff --git a/YuMi/Modules/YMMonents/View/XPMonentsTopicRecommondViewController.m b/YuMi/Modules/YMMonents/View/XPMonentsTopicRecommondViewController.m index 964a54ff..309355bc 100644 --- a/YuMi/Modules/YMMonents/View/XPMonentsTopicRecommondViewController.m +++ b/YuMi/Modules/YMMonents/View/XPMonentsTopicRecommondViewController.m @@ -178,7 +178,7 @@ }]; if (monentsInfos) { NSInteger row = [self.datasource indexOfObject:monentsInfo]; - [self.tableView reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:row inSection:0]] withRowAnimation:UITableViewRowAnimationNone]; + [self.tableView reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:row inSection:0]] withRowAnimation:UITableViewRowAnimationFade]; } } diff --git a/YuMi/Modules/YMNewHome/Presenter/XPHomeContainerPresenter.m b/YuMi/Modules/YMNewHome/Presenter/XPHomeContainerPresenter.m index 918618fa..67c44c1b 100644 --- a/YuMi/Modules/YMNewHome/Presenter/XPHomeContainerPresenter.m +++ b/YuMi/Modules/YMNewHome/Presenter/XPHomeContainerPresenter.m @@ -83,7 +83,7 @@ banners:[combinedValues xpSafeObjectAtIndex:1] rankAvatars:[combinedValues xpSafeObjectAtIndex:2]]; } error:^(NSError * _Nullable error) { - NSLog(@""); + }]; NSString * uid = [AccountInfoStorage instance].getUid; diff --git a/YuMi/Modules/YMNewHome/Presenter/XPHomePresenter.m b/YuMi/Modules/YMNewHome/Presenter/XPHomePresenter.m index 28f94649..13589f9e 100644 --- a/YuMi/Modules/YMNewHome/Presenter/XPHomePresenter.m +++ b/YuMi/Modules/YMNewHome/Presenter/XPHomePresenter.m @@ -44,6 +44,7 @@ [[self getView] getHomeSecondBannerSuccess:array]; } fail:^(NSInteger code, NSString * _Nullable msg) { [XNDJTDDLoadingTool hideHUD]; + [[self getView] getHomeSecondBannerSuccess:@[]]; } showLoading:NO] uid:[AccountInfoStorage instance].getUid type:@"1"]; } diff --git a/YuMi/Modules/YMNewHome/View/Cell/XPNewHomeRecommendTableViewCell.m b/YuMi/Modules/YMNewHome/View/Cell/XPNewHomeRecommendTableViewCell.m index 9dcdfca6..6f2fbe4a 100644 --- a/YuMi/Modules/YMNewHome/View/Cell/XPNewHomeRecommendTableViewCell.m +++ b/YuMi/Modules/YMNewHome/View/Cell/XPNewHomeRecommendTableViewCell.m @@ -220,11 +220,8 @@ cell.isCenterView = index == self.pi_scrollView.currentSelectIndex; return cell; } -- (void)cycleScrollView:(GKCycleScrollView *)cycleScrollView didScrollCellToIndex:(NSInteger)index{ - +- (void)cycleScrollView:(GKCycleScrollView *)cycleScrollView didScrollCellToIndex:(NSInteger)index { HomeRecommendRoomModel * info = [self.recommends xpSafeObjectAtIndex:index]; - NSLog(@"%@",info.title); - UIView *view = cycleScrollView.subviews[0]; for (XPCycleScrollViewCell * cell in view.subviews) { cell.isCenterView = [cell.recommendRoomInfo.title isEqual:info.title]; diff --git a/YuMi/Modules/YMNewHome/View/XPHomePagingViewController.m b/YuMi/Modules/YMNewHome/View/XPHomePagingViewController.m index 3c928639..80e96a3b 100644 --- a/YuMi/Modules/YMNewHome/View/XPHomePagingViewController.m +++ b/YuMi/Modules/YMNewHome/View/XPHomePagingViewController.m @@ -104,9 +104,9 @@ forControlEvents:UIControlEventTouchUpInside]; [_topControlView addSubview:_recommendButton]; [_recommendButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.bottom.mas_equalTo(self.topControlView);//.offset(-8); + make.bottom.mas_equalTo(self.topControlView).offset(-6); make.width.mas_greaterThanOrEqualTo(40); - make.leading.mas_equalTo(self.topControlView).offset(16); + make.leading.mas_equalTo(self.topControlView).offset(12); }]; _mineButton = [UIButton buttonWithType:UIButtonTypeCustom]; @@ -116,7 +116,7 @@ forControlEvents:UIControlEventTouchUpInside]; [_topControlView addSubview:_mineButton]; [_mineButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.bottom.mas_equalTo(self.topControlView);//.offset(-8); + make.bottom.mas_equalTo(self.topControlView).offset(-6); make.width.mas_greaterThanOrEqualTo(40); make.leading.mas_equalTo(_recommendButton.mas_trailing).offset(32); }]; @@ -176,18 +176,10 @@ #pragma mark - UIPageViewController Delegate & DataSource - (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerBeforeViewController:(UIViewController *)viewController { -// NSUInteger index = [self.viewControllers indexOfObject:viewController]; -// if (index > 0) { -// return self.viewControllers[index - 1]; -// } return nil; } - (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerAfterViewController:(UIViewController *)viewController { -// NSUInteger index = [self.viewControllers indexOfObject:viewController]; -// if (index < self.viewControllers.count - 1) { -// return self.viewControllers[index + 1]; -// } return nil; } diff --git a/YuMi/Modules/YMRTC/RtcImpl/TRTCRtcImpl.m b/YuMi/Modules/YMRTC/RtcImpl/TRTCRtcImpl.m index 5ea18947..d1715215 100644 --- a/YuMi/Modules/YMRTC/RtcImpl/TRTCRtcImpl.m +++ b/YuMi/Modules/YMRTC/RtcImpl/TRTCRtcImpl.m @@ -94,7 +94,7 @@ } - (void)onUserAudioAvailable:(NSString *)userId available:(BOOL)available { - NSLog(@"成功userid:%@", userId); +// NSLog(@"成功userid:%@", userId); if (available) { } diff --git a/YuMi/Modules/YMRoom/Features/Boom/BoomInfoViewController.m b/YuMi/Modules/YMRoom/Features/Boom/BoomInfoViewController.m index 62cca94e..1a6bdc6d 100644 --- a/YuMi/Modules/YMRoom/Features/Boom/BoomInfoViewController.m +++ b/YuMi/Modules/YMRoom/Features/Boom/BoomInfoViewController.m @@ -771,7 +771,7 @@ [self.vapView playHWDMP4:videoUrl repeatCount:-1 delegate:self]; } } failureBlock:^(NSError * _Nullable error) { - NSLog(@"%@", error); +// NSLog(@"%@", error); }]; } diff --git a/YuMi/Modules/YMRoom/Model/BravoGiftTipModel.h b/YuMi/Modules/YMRoom/Model/BravoGiftTipModel.h new file mode 100644 index 00000000..b3d43bf0 --- /dev/null +++ b/YuMi/Modules/YMRoom/Model/BravoGiftTipModel.h @@ -0,0 +1,26 @@ +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface BravoGiftTipInfoModel : NSObject + +@property (nonatomic, copy) NSString *times; +@property (nonatomic, copy) NSString *coins; +@property (nonatomic, assign) NSInteger level; + +@end + +@interface BravoGiftTipModel : NSObject + +@property (nonatomic, assign) NSInteger roomUid; +@property (nonatomic, assign) NSInteger roomId; +@property (nonatomic, assign) NSInteger uid; +@property (nonatomic, strong) NSArray *receiverUidList; +@property (nonatomic, copy) NSString *receiverProfit; +@property (nonatomic, strong) BravoGiftTipInfoModel *tip; + +@end + + + +NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/Model/BravoGiftTipModel.m b/YuMi/Modules/YMRoom/Model/BravoGiftTipModel.m new file mode 100644 index 00000000..b16e4940 --- /dev/null +++ b/YuMi/Modules/YMRoom/Model/BravoGiftTipModel.m @@ -0,0 +1,16 @@ +#import "BravoGiftTipModel.h" + +@implementation BravoGiftTipModel + ++ (NSDictionary *)modelContainerPropertyGenericClass { + return @{ + @"receiverUidList": [NSNumber class], + @"tip": [BravoGiftTipInfoModel class] + }; +} + +@end + +@implementation BravoGiftTipInfoModel + +@end \ No newline at end of file diff --git a/YuMi/Modules/YMRoom/View/AcrossRoomPK/Model/AcrossRoomPKPanelModel.h b/YuMi/Modules/YMRoom/View/AcrossRoomPK/Model/AcrossRoomPKPanelModel.h index b76b1cb2..d21c18b8 100644 --- a/YuMi/Modules/YMRoom/View/AcrossRoomPK/Model/AcrossRoomPKPanelModel.h +++ b/YuMi/Modules/YMRoom/View/AcrossRoomPK/Model/AcrossRoomPKPanelModel.h @@ -18,6 +18,7 @@ typedef NS_ENUM(NSUInteger, AcrossRoomPkStateType) { AcrossRoomPkStateTypePking = 1,//PK中 AcrossRoomPkStateTypePenalty, //惩罚阶段 AcrossRoomPkStateTypePenaltyEnd,//惩罚结束 + AcrossRoomPkStateTypePkEnd, }; ///个播PK对方麦克风状态 diff --git a/YuMi/Modules/YMRoom/View/AcrossRoomPK/View/SubViews/XPAcrossRoomPKPanelView.m b/YuMi/Modules/YMRoom/View/AcrossRoomPK/View/SubViews/XPAcrossRoomPKPanelView.m index 66c93bdb..5bf41d57 100644 --- a/YuMi/Modules/YMRoom/View/AcrossRoomPK/View/SubViews/XPAcrossRoomPKPanelView.m +++ b/YuMi/Modules/YMRoom/View/AcrossRoomPK/View/SubViews/XPAcrossRoomPKPanelView.m @@ -104,7 +104,7 @@ static CGFloat MiniHeight = 130.5; #pragma mark - life cycle - (void)dealloc { - NSLog(@"销毁了"); + } - (instancetype)initWithFrame:(CGRect)frame { diff --git a/YuMi/Modules/YMRoom/View/AnchorPK/View/SubViews/XPAnchorPKResultView.m b/YuMi/Modules/YMRoom/View/AnchorPK/View/SubViews/XPAnchorPKResultView.m index ed8a09c3..643cdd51 100644 --- a/YuMi/Modules/YMRoom/View/AnchorPK/View/SubViews/XPAnchorPKResultView.m +++ b/YuMi/Modules/YMRoom/View/AnchorPK/View/SubViews/XPAnchorPKResultView.m @@ -179,7 +179,7 @@ @implementation XPAnchorPKResultView - (void)dealloc { - NSLog(@"销毁了"); + if (self.timer) { dispatch_source_cancel(self.timer); self.timer = nil; diff --git a/YuMi/Modules/YMRoom/View/AnchorPK/View/SubViews/XPAnchorPkPanelView.m b/YuMi/Modules/YMRoom/View/AnchorPK/View/SubViews/XPAnchorPkPanelView.m index 94231af6..a2a4db75 100644 --- a/YuMi/Modules/YMRoom/View/AnchorPK/View/SubViews/XPAnchorPkPanelView.m +++ b/YuMi/Modules/YMRoom/View/AnchorPK/View/SubViews/XPAnchorPkPanelView.m @@ -99,7 +99,7 @@ #pragma mark - life cycle - (void)dealloc { - NSLog(@"销毁了"); + [self resetAcrossPKViewData]; } diff --git a/YuMi/Modules/YMRoom/View/AnimationView/BroveGiftWinningFlagView.h b/YuMi/Modules/YMRoom/View/AnimationView/BroveGiftWinningFlagView.h new file mode 100644 index 00000000..669ebc78 --- /dev/null +++ b/YuMi/Modules/YMRoom/View/AnimationView/BroveGiftWinningFlagView.h @@ -0,0 +1,32 @@ +// +// BroveGiftWinningFlagView.h +// YuMi +// +// Created by P on 2025/3/25. +// + +#import +@class AttachmentModel; +NS_ASSUME_NONNULL_BEGIN + +@interface BroveGiftWinningFlagViewModel : PIBaseModel + +@property (nonatomic, assign) NSInteger uid; +@property (nonatomic, copy) NSArray *receiverUidList; +@property (nonatomic, assign) NSInteger roomUid; +@property (nonatomic, assign) NSInteger roomId; +@property (nonatomic, assign) CGFloat receiverProfit; +@property (nonatomic, copy) NSDictionary *tip; + +@end + + +@interface BroveGiftWinningFlagView : UIView + ++ (BroveGiftWinningFlagViewModel *)display:(UIView *)superView + with:(AttachmentModel *)attachment + roomID:(NSInteger)roomID + uID:(NSString *)UID; +@end + +NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/AnimationView/BroveGiftWinningFlagView.m b/YuMi/Modules/YMRoom/View/AnimationView/BroveGiftWinningFlagView.m new file mode 100644 index 00000000..630c5fcd --- /dev/null +++ b/YuMi/Modules/YMRoom/View/AnimationView/BroveGiftWinningFlagView.m @@ -0,0 +1,172 @@ +// +// BroveGiftWinningFlagView.m +// YuMi +// +// Created by P on 2025/3/25. +// + +#import "BroveGiftWinningFlagView.h" +#import "MoliMoneyLabel.h" +#import "AttachmentModel.h" + +//{"data":"{\"uid\":3224,\"receiverUidList\":[3224],\"roomUid\":3184,\"tip\":{\"times\":\"0.70\",\"coins\":\"700.0\",\"level\":1},\"receiverProfit\":\"50.00\",\"roomId\":6076861580}","first":106,"second":1065} + + +@implementation BroveGiftWinningFlagViewModel + +@end + +@interface BroveGiftWinningFlagView () + +@property (nonatomic, strong) BroveGiftWinningFlagViewModel *model; +@property (nonatomic, strong) UIImageView *backgroundImageView; +//@property (nonatomic, strong) MoliMoneyLabel *moneyLabel; +@property (nonatomic, strong) UILabel *moneyLabel_2; +@property (nonatomic, strong) UILabel *timesLabel; + +@end + +@implementation BroveGiftWinningFlagView + ++ (BroveGiftWinningFlagViewModel *)display:(UIView *)superView with:(AttachmentModel *)attachment roomID:(NSInteger)roomID uID:(NSString *)UID { + BroveGiftWinningFlagViewModel *model = [BroveGiftWinningFlagViewModel modelWithJSON:attachment.data]; + if (model.roomId != roomID || model.uid != UID.integerValue || model.tip == nil) { + return model; + } + + BroveGiftWinningFlagView *flagView = [[BroveGiftWinningFlagView alloc] init]; + flagView.model = model; + flagView.alpha = 0; + flagView.frame = CGRectMake(0, 0, kGetScaleWidth(274), kGetScaleWidth(216)); + flagView.center = CGPointMake(superView.center.x, kGetScaleWidth(216) + kGetScaleWidth(216)/2 - 40); + flagView.transform = CGAffineTransformMakeScale(0.1, 0.1); + [superView addSubview:flagView]; + + // 使用弹簧动画执行放大动画,alpha从0变为1,带有弹性效果 + [UIView animateWithDuration:0.8 + delay:0 + usingSpringWithDamping:0.3 // 弹性系数,数值越小弹性越强 + initialSpringVelocity:0.5 // 初始速度 + options:UIViewAnimationOptionCurveEaseInOut + animations:^{ + flagView.alpha = 1.0; + flagView.transform = CGAffineTransformMakeScale(1.0, 1.0); // 还原为正常大小 + } completion:^(BOOL finished) { + // 动画完成后,等待2秒再执行反向动画 + [UIView animateWithDuration:0.5 + delay:2.0 // 延迟2秒执行反向动画 + options:UIViewAnimationOptionCurveEaseInOut + animations:^{ + flagView.alpha = 0.0; + flagView.transform = CGAffineTransformMakeScale(0.1, 0.1); // 缩小回原始大小 + } completion:^(BOOL finished) { + // 动画完成后移除 view + [flagView removeFromSuperview]; + }]; + }]; + + return model; +} + +- (instancetype)init +{ + self = [super init]; + if (self) { + [self setupUI]; + } + return self; +} + +- (void)setupUI { + [self addSubview:self.backgroundImageView]; + [self.backgroundImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.mas_equalTo(self); + }]; + + [self addSubview:self.moneyLabel_2]; + [self.moneyLabel_2 mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.mas_equalTo(self); + make.bottom.mas_equalTo(-70); + make.height.mas_equalTo(24); + }]; + + UIStackView *stackView = [[UIStackView alloc] initWithArrangedSubviews:@[ + [self winLabel], + self.timesLabel + ]]; + stackView.spacing = 4; + stackView.alignment = UIStackViewAlignmentCenter; + [self addSubview:stackView]; + [stackView mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.mas_equalTo(self); + make.bottom.mas_equalTo(-48); + }]; + [self.timesLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.height.mas_equalTo(10); + }]; +} + +- (void)setModel:(BroveGiftWinningFlagViewModel *)model { + NSNumber *level = [model.tip objectForKey:@"level"]; + NSString *times = [model.tip objectForKey:@"times"]; + NSNumber *coins = [model.tip objectForKey:@"coins"]; +// [self.moneyLabel updateContent:coins.stringValue]; + self.backgroundImageView.image = level.integerValue >= 3 ? kImage(@"brove_tips_high") : kImage(@"brove_tips_low"); + self.timesLabel.text = [NSString stringWithFormat:@"%@ %@", [NSString stringByRemovingRedundantZeros:times], YMLocalizedString(@"Combo_9")]; + + NSTextAttachment *moneyIcon = [[NSTextAttachment alloc] init]; + moneyIcon.image = kImage(@"moli_money_icon"); + NSMutableAttributedString *money = [[NSMutableAttributedString alloc] initWithString:[NSString stringByRemovingRedundantZeros:coins.stringValue] attributes:@{ + NSFontAttributeName: kFontMedium(26), + NSForegroundColorAttributeName: UIColorFromRGB(0xffe169) + }]; + [money appendAttributedString:[NSAttributedString attributedStringWithAttachment:moneyIcon]]; + self.moneyLabel_2.attributedText = money.copy; +} + +- (UIImageView *)backgroundImageView { + if (!_backgroundImageView) { + _backgroundImageView = [[UIImageView alloc] init];//WithImage:kImage(@"brove_tips_high")]; + _backgroundImageView.contentMode = UIViewContentModeScaleAspectFit; + } + return _backgroundImageView; +} + +//- (MoliMoneyLabel *)moneyLabel { +// if (!_moneyLabel) { +// _moneyLabel = [MoliMoneyLabel moneyLabelWithTextColot:UIColorFromRGB(0xFFE169) +// font:kFontMedium(26) +// moneyPostion:2 +// moneySize:CGSizeMake(24, 24)]; +// [_moneyLabel removeSpace]; +// [_moneyLabel updateSpacing:0]; +// [_moneyLabel updateLabelAlignment:NSTextAlignmentRight]; +// [_moneyLabel insertSpaceAtLeast]; +// +// } +// return _moneyLabel; +//} + +- (UILabel *)moneyLabel_2 { + if (!_moneyLabel_2) { + _moneyLabel_2 = [[UILabel alloc] init]; + } + return _moneyLabel_2; +} + +- (UILabel *)winLabel { + return [UILabel labelInitWithText:YMLocalizedString(@"Combo_4") + font:kFontRegular(13) + textColor:[UIColor whiteColor]]; +} + +- (UILabel *)timesLabel { + if (!_timesLabel) { + _timesLabel = [UILabel labelInitWithText:@"" + font:kFontMedium(13) + textColor:UIColorFromRGB(0xFFE169)]; + } + return _timesLabel; +} + +@end diff --git a/YuMi/Modules/YMRoom/View/AnimationView/GiftAnimationHelper.m b/YuMi/Modules/YMRoom/View/AnimationView/GiftAnimationHelper.m index 6c7fc106..47b35988 100644 --- a/YuMi/Modules/YMRoom/View/AnimationView/GiftAnimationHelper.m +++ b/YuMi/Modules/YMRoom/View/AnimationView/GiftAnimationHelper.m @@ -14,7 +14,7 @@ static const CGFloat kComboAnimationDuration = 1.0f; static const CGFloat kCleanupDelay = 0.25f; static const CGFloat kComboInitialScale = 0.4f; -static const CGFloat kComboFinalScale = 2.0f; +static const CGFloat kComboFinalScale = 1.5; //2.0f; static const CGFloat kComboScaleDuration = 0.1f; static const CGFloat kComboMoveDuration = 0.5f; static const CGFloat kComboTotalDuration = 0.6f; @@ -47,8 +47,8 @@ static const CGFloat kStandardFinalPhaseDelay = 2.6f; isGiftCombing:(BOOL)isGiftCombing toTargetView:(UIView *)targetView { // Input validation - if (!giftUrl.length || CGPointEqualToPoint(startPoint, endPoint)) { - NSLog(@"Invalid input parameters for gift animation"); + if ([NSString isEmpty:giftUrl] ){//|| CGPointEqualToPoint(startPoint, endPoint)) { +// NSLog(@"Invalid input parameters for gift animation"); return; } @@ -169,7 +169,8 @@ static const CGFloat kStandardFinalPhaseDelay = 2.6f; CAKeyframeAnimation *initialScale = [CAKeyframeAnimation animation]; initialScale.duration = kStandardScaleDuration; initialScale.keyPath = @"transform.scale"; - initialScale.values = @[@1.0, @1.5, @2.0, @1.5]; +// initialScale.values = @[@1.0, @1.5, @2.0, @1.5]; + initialScale.values = @[@1.0, @1.2, @1.5, @1.2]; initialScale.repeatCount = 1; initialScale.calculationMode = kCAAnimationCubic; initialScale.removedOnCompletion = NO; @@ -180,7 +181,8 @@ static const CGFloat kStandardFinalPhaseDelay = 2.6f; secondScale.duration = kStandardScaleDuration; secondScale.beginTime = kStandardSecondPhaseDelay; secondScale.keyPath = @"transform.scale"; - secondScale.values = @[@1.5, @2.0, @2.5, @3.0]; +// secondScale.values = @[@1.5, @2.0, @2.5, @3.0]; + secondScale.values = @[@1.2, @1.5, @2.0, @2.5]; secondScale.repeatCount = 1; secondScale.calculationMode = kCAAnimationCubic; secondScale.removedOnCompletion = NO; @@ -205,7 +207,8 @@ static const CGFloat kStandardFinalPhaseDelay = 2.6f; finalScale.duration = kStandardScaleDuration; finalScale.beginTime = kStandardFinalPhaseDelay; finalScale.keyPath = @"transform.scale"; - finalScale.values = @[@3.0, @2.5, @2.0, @1.5, @1.0]; +// finalScale.values = @[@3.0, @2.5, @2.0, @1.5, @1.0]; + finalScale.values = @[@2.5, @2.0, @1.5, @1.2, @1.0]; finalScale.repeatCount = 1; // Move to final position animation diff --git a/YuMi/Modules/YMRoom/View/AnimationView/GiftAnimationManager.m b/YuMi/Modules/YMRoom/View/AnimationView/GiftAnimationManager.m index 8f0e23c2..cb2d36ef 100644 --- a/YuMi/Modules/YMRoom/View/AnimationView/GiftAnimationManager.m +++ b/YuMi/Modules/YMRoom/View/AnimationView/GiftAnimationManager.m @@ -157,7 +157,7 @@ [resultArray addObject:[item stringValue]]; } else { // 对于非 NSString 或 NSNumber 的类型,可以选择忽略或者抛出异常 - NSLog(@"Warning: Unsupported item type: %@", [item class]); +// NSLog(@"Warning: Unsupported item type: %@", [item class]); } } diff --git a/YuMi/Modules/YMRoom/View/AnimationView/LuckyGiftWinningBannerView.m b/YuMi/Modules/YMRoom/View/AnimationView/LuckyGiftWinningBannerView.m index 3fbf389c..3a09b7dc 100644 --- a/YuMi/Modules/YMRoom/View/AnimationView/LuckyGiftWinningBannerView.m +++ b/YuMi/Modules/YMRoom/View/AnimationView/LuckyGiftWinningBannerView.m @@ -17,12 +17,12 @@ // Constants static const CGFloat kBannerWidth = 346.5f; -static const CGFloat kBannerHeight = 82.5f; +static const CGFloat kBannerHeight = 55.0; static const CGFloat kBannerTopMargin = 0;// 80.0f; -static const CGFloat kAvatarSize = 43.0f; -static const CGFloat kAnimationDuration = 0.25f; -static const CGFloat kDisplayDuration = 2.0f; -static const CGFloat kRoomTransitionDelay = 2.0f; +//static const CGFloat kAvatarSize = 43.0f; +//static const CGFloat kAnimationDuration = 0.25f; +//static const CGFloat kDisplayDuration = 2.0f; +//static const CGFloat kRoomTransitionDelay = 2.0f; @interface LuckyGiftWinningBannerViewModel : PIBaseModel @@ -91,8 +91,8 @@ exitCurrentRoom:(void(^)(void))exit { #endif LuckyGiftWinningBannerViewModel *model = [LuckyGiftWinningBannerViewModel modelWithDictionary:attachment.data]; - CGFloat width = kGetScaleWidth(kBannerWidth); - CGFloat height = kGetScaleWidth(kBannerHeight); + CGFloat width = KScreenWidth;//kGetScaleWidth(kBannerWidth); + CGFloat height = kBannerHeight;// kGetScaleWidth(kBannerHeight); CGRect frame = CGRectMake(KScreenWidth, kBannerTopMargin, width, height); LuckyGiftWinningBannerView *bannerView = [[LuckyGiftWinningBannerView alloc] initWithFrame:frame]; @@ -173,23 +173,23 @@ exitCurrentRoom:(void(^)(void))exit { self.timesLabel.text = model.times; self.coinsLabel.text = model.coins; - if (self.coinsLabel.text.integerValue > 9999) { - self.bigBallImageView.hidden = NO; - } else { - self.ballImageView.hidden = NO; - } +// if (self.coinsLabel.text.integerValue > 9999) { +// self.bigBallImageView.hidden = NO; +// } else { +// self.ballImageView.hidden = NO; +// } - [self.coinsLabel mas_remakeConstraints:^(MASConstraintMaker *make) { - if (self.bigBallImageView.hidden == NO) { - make.centerX.mas_equalTo(self.bigBallImageView); - make.width.mas_lessThanOrEqualTo(self.bigBallImageView).multipliedBy(0.8); - } else { - make.centerX.mas_equalTo(self.ballImageView); - make.width.mas_lessThanOrEqualTo(self.ballImageView).multipliedBy(0.8); - } - make.top.mas_equalTo(self).offset(kGetScaleWidth(18)); - make.height.mas_equalTo(kGetScaleWidth(28)); - }]; +// [self.coinsLabel mas_remakeConstraints:^(MASConstraintMaker *make) { +// if (self.bigBallImageView.hidden == NO) { +// make.centerX.mas_equalTo(self.bigBallImageView); +// make.width.mas_lessThanOrEqualTo(self.bigBallImageView).multipliedBy(0.8); +// } else { +// make.centerX.mas_equalTo(self.ballImageView); +// make.width.mas_lessThanOrEqualTo(self.ballImageView).multipliedBy(0.8); +// } +// make.top.mas_equalTo(self).offset(kGetScaleWidth(18)); +// make.height.mas_equalTo(kGetScaleWidth(28)); +// }]; } - (instancetype)initWithFrame:(CGRect)frame { @@ -230,30 +230,36 @@ exitCurrentRoom:(void(^)(void))exit { make.edges.mas_equalTo(self); }]; - [self addSubview:self.bigBallImageView]; - [self.bigBallImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerY.trailing.mas_equalTo(self); - make.width.height.mas_equalTo(kGetScaleWidth(91)); - }]; +// [self addSubview:self.bigBallImageView]; +// [self.bigBallImageView mas_makeConstraints:^(MASConstraintMaker *make) { +// make.centerY.trailing.mas_equalTo(self); +// make.width.height.mas_equalTo(kGetScaleWidth(91)); +// }]; [self addSubview:self.ballImageView]; [self.ballImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.trailing.bottom.top.mas_equalTo(self); - make.width.mas_equalTo(self.ballImageView.mas_height); + make.centerY.mas_equalTo(self); + make.trailing.mas_equalTo(self).offset(-30); + make.width.height.mas_equalTo(59); }]; [self addSubview:self.avatarImageView]; [self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.mas_equalTo(kGetScaleWidth(8)); - make.top.mas_equalTo(kGetScaleWidth(24)); - make.width.height.mas_equalTo(kGetScaleWidth(43)); + make.centerY.mas_equalTo(self); + make.leading.mas_equalTo(kGetScaleWidth(36)); + if (iPhoneXSeries) { + make.width.height.mas_equalTo(34); + } else { + make.width.height.mas_equalTo(29); + } + }]; UILabel *titleLabel_1 = [UILabel labelInitWithText:YMLocalizedString(@"Combo_0") font:kFontSemibold(14) textColor:[UIColor whiteColor]]; [self addSubview:titleLabel_1]; [titleLabel_1 mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(self.avatarImageView).offset(2); - make.leading.mas_equalTo(self.avatarImageView.mas_trailing).offset(10); + make.top.mas_equalTo(self.avatarImageView).offset(-3); + make.leading.mas_equalTo(self.avatarImageView.mas_trailing).offset(5); }]; [self addSubview:self.giftNameLabel]; @@ -265,8 +271,8 @@ exitCurrentRoom:(void(^)(void))exit { UILabel *titleLabel_2 = [UILabel labelInitWithText:YMLocalizedString(@"Combo_4") font:kFontSemibold(14) textColor:[UIColor whiteColor]]; [self addSubview:titleLabel_2]; [titleLabel_2 mas_makeConstraints:^(MASConstraintMaker *make) { - make.bottom.mas_equalTo(self.avatarImageView.mas_bottom).offset(-2); - make.leading.mas_equalTo(self.avatarImageView.mas_trailing).offset(10); + make.bottom.mas_equalTo(self.avatarImageView.mas_bottom).offset(3); + make.leading.mas_equalTo(self.avatarImageView.mas_trailing).offset(5); }]; [self addSubview:self.timesLabel]; @@ -285,16 +291,16 @@ exitCurrentRoom:(void(^)(void))exit { [self addSubview:self.coinsLabel]; [self.coinsLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.centerX.mas_equalTo(self.ballImageView); - make.top.mas_equalTo(self).offset(kGetScaleWidth(18)); - make.height.mas_equalTo(kGetScaleWidth(28)); + make.top.mas_equalTo(self).offset(14); + make.height.mas_equalTo(22); make.width.mas_lessThanOrEqualTo(self.ballImageView).multipliedBy(0.8); }]; - UILabel *titleLabel_4 = [UILabel labelInitWithText:YMLocalizedString(@"Combo_5") font:kFontSemibold(14) textColor:[UIColor whiteColor]]; + UILabel *titleLabel_4 = [UILabel labelInitWithText:YMLocalizedString(@"Combo_5") font:kFontMedium(12) textColor:[UIColor whiteColor]]; [self addSubview:titleLabel_4]; [titleLabel_4 mas_makeConstraints:^(MASConstraintMaker *make) { make.centerX.mas_equalTo(self.coinsLabel); - make.top.mas_equalTo(self.coinsLabel.mas_bottom); + make.top.mas_equalTo(self.coinsLabel.mas_bottom).offset(-2); }]; } @@ -302,7 +308,7 @@ exitCurrentRoom:(void(^)(void))exit { - (UIImageView *)backgroundImageView { if (!_backgroundImageView) { _backgroundImageView = [[UIImageView alloc] initWithImage:[kImage(@"luck_gift_flag") ms_SetImageForRTL]]; - _backgroundImageView.contentMode = UIViewContentModeScaleAspectFill; + _backgroundImageView.contentMode = UIViewContentModeScaleAspectFit; } return _backgroundImageView; } @@ -311,7 +317,7 @@ exitCurrentRoom:(void(^)(void))exit { if (!_ballImageView) { _ballImageView = [[UIImageView alloc] initWithImage:kImage(@"luck_gift_flag_ball")]; _ballImageView.contentMode = UIViewContentModeScaleAspectFill; - _ballImageView.hidden = YES; +// _ballImageView.hidden = YES; } return _ballImageView; } @@ -333,7 +339,10 @@ exitCurrentRoom:(void(^)(void))exit { _avatarImageView = [[NetImageView alloc] initWithConfig:config]; _avatarImageView.backgroundColor = [UIColor clearColor]; _avatarImageView.contentMode = UIViewContentModeScaleAspectFill; - [_avatarImageView setCornerRadius:kGetScaleWidth(43/2)]; + [_avatarImageView setCornerRadius: iPhoneXSeries ? 34/2 : 29/2 + corners:kCALayerMaxXMaxYCorner | kCALayerMaxXMinYCorner | kCALayerMinXMaxYCorner | kCALayerMinXMinYCorner + borderWidth:1 + borderColor:[UIColor whiteColor]]; } return _avatarImageView; } @@ -347,7 +356,7 @@ exitCurrentRoom:(void(^)(void))exit { - (UILabel *)coinsLabel { if (!_coinsLabel) { - _coinsLabel = [UILabel labelInitWithText:@"" font:kFontSemibold(20) textColor:UIColorFromRGB(0xffe375)]; + _coinsLabel = [UILabel labelInitWithText:@"" font:kFontSemibold(15) textColor:UIColorFromRGB(0xffe375)]; _coinsLabel.adjustsFontSizeToFitWidth = YES; _coinsLabel.minimumScaleFactor = 0.5; _coinsLabel.textAlignment = NSTextAlignmentCenter; diff --git a/YuMi/Modules/YMRoom/View/AnimationView/RoomAnimationView.m b/YuMi/Modules/YMRoom/View/AnimationView/RoomAnimationView.m index b1413cea..56a98f88 100644 --- a/YuMi/Modules/YMRoom/View/AnimationView/RoomAnimationView.m +++ b/YuMi/Modules/YMRoom/View/AnimationView/RoomAnimationView.m @@ -45,9 +45,9 @@ #import "LuckyGiftWinningBannerView.h" #import "RoomHighValueGiftBannerAnimation.h" #import "LuckyPackageBannerView.h" - +#import "BroveGiftBannerView.h" #import "XCCurrentVCStackManager.h" - +#import "BroveGiftWinningFlagView.h" #import "RoomEnterModel.h" // Old Methods @@ -125,6 +125,14 @@ XPRoomGraffitiGiftAnimationViewDelegate @property (nonatomic, strong) NSMutableArray *roomBannertModelsQueueV2; // 特效播放队列,包括幸运礼物 banner, CP banner 和 CP 特效 @property (nonatomic, assign) BOOL isRoomBannerV2Displaying; +// --- Brove 金币动画 +@property (nonatomic, strong) SVGAVideoEntity *broveSVGAEntity_lv_1; +@property (nonatomic, strong) SVGAVideoEntity *broveSVGAEntity_lv_2; +@property (nonatomic, strong) SVGAVideoEntity *broveSVGAEntity_lv_3; +@property (nonatomic, strong) NSMutableArray *broveSVGAQueue; +@property (nonatomic, assign) BOOL isBroveSVGAPlaying; +@property (nonatomic, assign) NSInteger viewIndex; + /// --- 座驾 ///座驾pag动效 @property(nonatomic, strong) PAGView *carPagEffectView; @@ -547,17 +555,30 @@ XPRoomGraffitiGiftAnimationViewDelegate case Custom_Message_Sub_LuckyPackage: [self playLuckyPackageBanner:nextAttachment]; break; + case Custom_Message_Sub_Super_Gift_Banner: + [self playBroveBanner:nextAttachment]; + break; default: break; } } -//- (void)receiveLuckyPackageBanner:(AttachmentModel *)obj { -// [self.roomBannertModelsQueueV2 addObject:obj]; -// if (!self.isRoomBannerV2Displaying) { -// [self processNextRoomEffectAttachment]; -// } -//} +- (void)playBroveBanner:(AttachmentModel *)obj { + if (!obj.data) { + self.isRoomBannerV2Displaying = NO; + [self processNextRoomEffectAttachment]; + return; + } + self.isRoomBannerV2Displaying = YES; + @kWeakify(self); + [BroveGiftBannerView display:self.bannerContainer + with:obj + complete:^{ + @kStrongify(self); + self.isRoomBannerV2Displaying = NO; + [self processNextRoomEffectAttachment]; + }]; +} - (void)playLuckyPackageBanner:(AttachmentModel *)obj { if (!obj.data) { @@ -565,6 +586,7 @@ XPRoomGraffitiGiftAnimationViewDelegate [self processNextRoomEffectAttachment]; return; } + self.isRoomBannerV2Displaying = YES; @kWeakify(self); RoomInfoModel *roomInfo = self.hostDelegate.getRoomInfo; [LuckyPackageBannerView display:self.bannerContainer @@ -590,7 +612,7 @@ XPRoomGraffitiGiftAnimationViewDelegate [self processNextRoomEffectAttachment]; return; } - + self.isRoomBannerV2Displaying = YES; @kWeakify(self); [RoomHighValueGiftBannerAnimation display:self.bannerContainer with:obj @@ -646,6 +668,131 @@ XPRoomGraffitiGiftAnimationViewDelegate uID:[AccountInfoStorage instance].getUid]; } +- (void)receiveBroveGiftWinning:(AttachmentModel *)attachment { + RoomInfoModel *roomInfo = self.hostDelegate.getRoomInfo; + BroveGiftWinningFlagViewModel *flagModel = [BroveGiftWinningFlagView display:self.topContainer + with:attachment + roomID:roomInfo.roomId + uID:[AccountInfoStorage instance].getUid]; + // 数据同步到 combo + [[NSNotificationCenter defaultCenter] postNotificationName:@"receiveLuckGiftWinning" object:[NSString stringByRemovingRedundantZeros:@(flagModel.receiverProfit).stringValue]]; + if (flagModel.roomId != roomInfo.roomId || flagModel.uid != [AccountInfoStorage instance].getUid.integerValue) { + return; + } + if (!self.hostDelegate.getRoomInfo.hasAnimationEffect) { + return; + } + NSDictionary *tip = [attachment.data objectForKey:@"tip"]; + if (tip) { + NSNumber *level = [tip objectForKey:@"level"]; + NSNumber *coins = [tip objectForKey:@"coins"]; + if (level) { + [self loadBroveSVGAVideoItem:level.integerValue]; + } + if (coins) { + [[NSNotificationCenter defaultCenter] postNotificationName:@"receiveLuckGiftWinning" object:[NSString stringByRemovingRedundantZeros:coins.stringValue]]; + } + } +} + +- (void)loadBroveSVGAVideoItem:(NSInteger)level { + NSString *svgaItemName = @""; + SVGAVideoEntity *entity; + switch (level) { + case 1: + svgaItemName = @"小"; + entity = self.broveSVGAEntity_lv_1; + break; + case 2: + svgaItemName = @"中"; + entity = self.broveSVGAEntity_lv_2; + break; + case 3: + svgaItemName = @"大"; + entity = self.broveSVGAEntity_lv_3; + break; + + default: + break; + } + + if ([NSString isEmpty:svgaItemName]) { + return; + } + + if (self.broveSVGAQueue.count >=3) { + return; + } + + SVGAImageView *svgaView = [[SVGAImageView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)]; + svgaView.backgroundColor = [UIColor clearColor]; + svgaView.contentMode = UIViewContentModeScaleAspectFill; + svgaView.userInteractionEnabled = NO; + if (!entity) { + @kWeakify(self); + SVGAParser *parser = [[SVGAParser alloc] init]; + [parser parseWithNamed:svgaItemName + inBundle:[NSBundle mainBundle] + completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) { + @kStrongify(self); + switch (level) { + case 1: + self.broveSVGAEntity_lv_1 = videoItem; + break; + case 2: + self.broveSVGAEntity_lv_2 = videoItem; + break; + case 3: + self.broveSVGAEntity_lv_3 = videoItem; + break; + + default: + break; + } + [self startPlayBroveSVGA:svgaView level:level]; + } failureBlock:^(NSError * _Nonnull error) { + + }]; + } else { + [self startPlayBroveSVGA:svgaView level:level]; + } +} + +- (void)startPlayBroveSVGA:(SVGAImageView *)svgaView level:(NSInteger)level { + if (!_broveSVGAQueue) { + _broveSVGAQueue = [[NSMutableArray alloc] init]; + self.viewIndex = 0; + } + if (![self.broveSVGAQueue containsObject:svgaView]) { + [self.broveSVGAQueue addObject:svgaView]; + } + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)((0.3 + (self.viewIndex * 0.1)) * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + SVGAVideoEntity *entity; + switch (level) { + case 1: + entity = self.broveSVGAEntity_lv_1; + break; + case 2: + entity = self.broveSVGAEntity_lv_2; + break; + case 3: + entity = self.broveSVGAEntity_lv_3; + break; + + default: + break; + } +// [self insertSubview:svgaView atIndex:self.viewIndex]; + [self _addSubviewToMiddleContainer:svgaView]; + svgaView.tag = 913; + svgaView.delegate = self; + svgaView.videoItem = entity; + svgaView.loops = 1; + [svgaView startAnimation]; + self.viewIndex += 1; + }); +} + - (void)receiveLuckGiftBanner:(AttachmentModel *)attachment { [self inserBannerModelToQueue:attachment]; } @@ -922,7 +1069,7 @@ XPRoomGraffitiGiftAnimationViewDelegate return; } dispatch_async(self.giftEffectsQueue, ^{ - NSLog(@"******************* 当前队列个数: %@,image loader 个数: %@", @(self.svgaQueue.count), @(self.mp4AvatarLoaders.count)); + // NSLog(@"******************* 当前队列个数: %@,image loader 个数: %@", @(self.svgaQueue.count), @(self.mp4AvatarLoaders.count)); if (self.svgaQueue.count == 0) { dispatch_source_cancel(timer); dispatch_async(dispatch_get_main_queue(), ^{ @@ -988,7 +1135,7 @@ XPRoomGraffitiGiftAnimationViewDelegate } } - NSLog(@"******************* 执行播放, 是否MP4:%@,URL: %@, self.svgaQueue num: %@", @(giftInfo.otherViewType), targetURL, @(self.svgaQueue.count)); + // NSLog(@"******************* 执行播放, 是否MP4:%@,URL: %@, self.svgaQueue num: %@", @(giftInfo.otherViewType), targetURL, @(self.svgaQueue.count)); [[NSNotificationCenter defaultCenter] postNotificationName:@"kExchangeRoomAnimationViewAndGameViewIndex" object:nil]; @@ -1053,7 +1200,7 @@ XPRoomGraffitiGiftAnimationViewDelegate - (void)playGiftEffectWithVggUrl:(NSString *)vggUrl { NSString *encodingUrl = [vggUrl pureURLString]; NSString *fullPath = [self _findFullPath:vggUrl]; - NSLog(@"******************* 解释 SVGA : %@ | %@", encodingUrl, fullPath); + // NSLog(@"******************* 解释 SVGA : %@ | %@", encodingUrl, fullPath); if (![NSString isEmpty:fullPath] && [[NSFileManager defaultManager] fileExistsAtPath:fullPath]) { NSData *data = [NSData dataWithContentsOfFile:fullPath options:0 error:NULL]; NSString *fileName = [[encodingUrl componentsSeparatedByString:@"/"] lastObject]; @@ -1076,7 +1223,7 @@ XPRoomGraffitiGiftAnimationViewDelegate [self.vggParser parseWithURL:[NSURL URLWithString:encodingUrl] completionBlock:^(SVGAVideoEntity * _Nullable videoItem) { @kStrongify(self); - NSLog(@"******************* 解释 SVGA 成功"); + // NSLog(@"******************* 解释 SVGA 成功"); if (videoItem) { [self playVGG:videoItem]; } else { @@ -1084,7 +1231,7 @@ XPRoomGraffitiGiftAnimationViewDelegate } } failureBlock:^(NSError * _Nullable error) { @kStrongify(self); - NSLog(@"******************* 解释 SVGA 失败:%@", error); + // NSLog(@"******************* 解释 SVGA 失败:%@", error); [self playVGGFailure]; }]; } @@ -1141,6 +1288,16 @@ XPRoomGraffitiGiftAnimationViewDelegate #pragma mark - Delegates #pragma mark - SVGA delegate - (void)svgaPlayerDidFinishedAnimation:(SVGAPlayer *)player { + if (player.tag == 913) { + [player clear]; + player.delegate = nil; + [player removeFromSuperview]; + self.viewIndex -= 1; + if ([self.broveSVGAQueue containsObject:player]) { + [self.broveSVGAQueue removeObject:player]; + } + return; + } if (player == self.enterEffectView && player.loops == 1) { [self endAnimationEnterEffect]; } @@ -1213,7 +1370,7 @@ XPRoomGraffitiGiftAnimationViewDelegate dispatch_async(dispatch_get_main_queue(), ^{ QGVAPSourceInfo *info = (QGVAPSourceInfo *)context[@"resource"]; - NSLog(@" MP4 的 key - info.contentTag : %@", info.contentTag); + // NSLog(@" MP4 的 key - info.contentTag : %@", info.contentTag); [self _loadMP4AvatarURL:urlStr info:info completion:completionBlock]; @@ -1549,6 +1706,11 @@ XPRoomGraffitiGiftAnimationViewDelegate case Custom_Message_Sub_Super_Gift_Winning_Coins_ALL_Room: [self receiveLuckGiftBanner:attachment]; break; + case Custom_Message_Sub_Super_Gift_Banner: + [self handleBroveGiftBanner:attachment]; + break; + case Custom_Message_Sub_Super_Gift_UI_Rffect: + [self receiveBroveGiftWinning:attachment]; default: break; } @@ -1800,6 +1962,11 @@ XPRoomGraffitiGiftAnimationViewDelegate } } +- (void)handleBroveGiftBanner:(AttachmentModel *)attachment { + [self inserBannerModelToQueue:attachment]; +} + + #pragma mark - RoomGuestDelegate: NIMNotificationMessageDelegate - (void)handleNIMNotificationMessage:(NIMMessage *)message { return; diff --git a/YuMi/Modules/YMRoom/View/AnimationView/XPRoomLuckyBigPrizeView.m b/YuMi/Modules/YMRoom/View/AnimationView/XPRoomLuckyBigPrizeView.m index bccb24d0..ae021bde 100644 --- a/YuMi/Modules/YMRoom/View/AnimationView/XPRoomLuckyBigPrizeView.m +++ b/YuMi/Modules/YMRoom/View/AnimationView/XPRoomLuckyBigPrizeView.m @@ -132,7 +132,7 @@ } } - (void)svgaPlayerDidFinishedAnimation:(SVGAPlayer *)player{ - NSLog(@"11111"); + } - (XPSVGAPlayer *)giftSvgaView { if (!_giftSvgaView) { diff --git a/YuMi/Modules/YMRoom/View/AnimationView/XPRoomTarrowBannerView.m b/YuMi/Modules/YMRoom/View/AnimationView/XPRoomTarrowBannerView.m index 2a512ea6..ff45041e 100644 --- a/YuMi/Modules/YMRoom/View/AnimationView/XPRoomTarrowBannerView.m +++ b/YuMi/Modules/YMRoom/View/AnimationView/XPRoomTarrowBannerView.m @@ -127,7 +127,7 @@ } #pragma mark - 懒加载 - (void)svgaPlayerDidFinishedAnimation:(SVGAPlayer *)player{ - NSLog(@"11111"); + } - (XPSVGAPlayer *)giftImageView { if (!_giftImageView) { diff --git a/YuMi/Modules/YMRoom/View/BackMusic/View/SubViews/XPRoomBackMusicPlayerView.m b/YuMi/Modules/YMRoom/View/BackMusic/View/SubViews/XPRoomBackMusicPlayerView.m index 495a5182..f261292f 100644 --- a/YuMi/Modules/YMRoom/View/BackMusic/View/SubViews/XPRoomBackMusicPlayerView.m +++ b/YuMi/Modules/YMRoom/View/BackMusic/View/SubViews/XPRoomBackMusicPlayerView.m @@ -187,7 +187,7 @@ UIKIT_EXTERN NSString * kRoomBackMusicPlayMusicOrderKey; } self.isPlaying =[[RtcManager instance] playBackMusic:musicPath musicId:0 completion:^(NSString * filePath) { NSInteger order = [[NSUserDefaults standardUserDefaults] integerForKey:kRoomBackMusicPlayMusicOrderKey]; - NSLog(@"当前的顺序%ld", order); +// NSLog(@"当前的顺序%ld", order); if (order == 0) { NSInteger index = self.currentIndex + 1; [self playNextMusic:index]; diff --git a/YuMi/Modules/YMRoom/View/BaseUIContainerView/XPRoomFunctionContainerView.m b/YuMi/Modules/YMRoom/View/BaseUIContainerView/XPRoomFunctionContainerView.m index 5392ade8..a34ed727 100644 --- a/YuMi/Modules/YMRoom/View/BaseUIContainerView/XPRoomFunctionContainerView.m +++ b/YuMi/Modules/YMRoom/View/BaseUIContainerView/XPRoomFunctionContainerView.m @@ -99,7 +99,7 @@ #import "XPRoomPKPanelView.h" -@interface XPRoomFunctionContainerView () +@interface XPRoomFunctionContainerView () ///host 代理 @property (nonatomic,weak) iddelegate; ///榜单容器 @@ -144,10 +144,7 @@ @property (nonatomic,assign) BOOL isLoadGreet; ///获取新用户礼物倒计时3s @property (nonatomic, strong) dispatch_source_t userGiftTimer; -///许愿礼物 -@property (nonatomic,strong) XPWishGiftEnterView *wishGiftView; -///心愿礼物面板 更新进度 -@property (nonatomic,weak) XPWishGiftViewController* wishGiftVC ; + ///在线人数 @property(nonatomic,strong) MSRoomOnLineView *onlineView; // 房间PK面板 @@ -251,9 +248,6 @@ #pragma mark - Private Method - (void)initSubViews { [self addSubview:self.rankStackView]; -// [self addSubview:self.topicStackView]; -// [self.topicStackView addArrangedSubview:self.topicLabel]; -// [self.topicStackView addArrangedSubview:self.editButton]; [self addSubview:self.onlineView]; [self.rankStackView addArrangedSubview:self.hourRankEntranceView]; @@ -286,11 +280,6 @@ make.width.mas_greaterThanOrEqualTo(50); }]; -// [self.topicStackView mas_makeConstraints:^(MASConstraintMaker *make) { -// make.centerX.mas_equalTo(self); -// make.height.mas_equalTo(15); -// make.top.mas_equalTo(50 + 5 + 6 + 12 + 3 + kNavigationHeight); -// }]; [self.onlineView mas_makeConstraints:^(MASConstraintMaker *make) { make.trailing.mas_equalTo(-6); make.height.mas_equalTo(24); @@ -396,61 +385,13 @@ }]; } -#pragma mark - 新用户房间礼物 -- (void)handleNewUserRoomGift { - NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; - BOOL hadShow = [defaults boolForKey:kHadShowNewUserGiftKey]; - if (!hadShow && self.delegate.getUserInfo.uid != self.delegate.getRoomInfo.uid) { - if (self.userGiftTimer != nil) { - dispatch_source_cancel(self.userGiftTimer); - } - NSInteger totalTime = 3; - dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); - self.userGiftTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, queue); - dispatch_source_set_timer(self.userGiftTimer,dispatch_walltime(NULL, totalTime*NSEC_PER_SEC), totalTime*NSEC_PER_SEC, 0); //每秒执行 - @weakify(self); - dispatch_source_set_event_handler(self.userGiftTimer, ^{ - dispatch_async(dispatch_get_main_queue(), ^{ - @strongify(self); - if (self.userGiftTimer != nil) { - dispatch_source_cancel(self.userGiftTimer); - self.userGiftTimer = nil; - } - [Api requestNewUserInRoomGift:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { - if (code == 200) { - if (data.data != nil) { - GiftInfoModel *giftInfo = [GiftInfoModel modelWithJSON:data.data]; - XPNewUserRoomGiftView *view = [[XPNewUserRoomGiftView alloc] init]; - view.giftInfo = giftInfo; - [TTPopup popupView:view style:TTPopupStyleAlert]; - } - [defaults setBool:YES forKey:kHadShowNewUserGiftKey]; - [defaults synchronize]; - } - } roomUid:[NSString stringWithFormat:@"%zd", self.delegate.getRoomInfo.uid]]; - }); - }); - dispatch_resume(self.userGiftTimer); - } -} - #pragma mark - DJ 抓个Beat - (void)showMusicPanel { [self addSubview:self.musicPlayView]; [self bringSubviewToFront:self.musicPlayView]; self.musicPlayView.frame = CGRectMake(0, KScreenHeight, KScreenWidth, 200); - -// POPBasicAnimation *moveAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewCenter]; -// moveAnimation.fromValue = [NSValue valueWithCGPoint:CGPointMake(-KScreenWidth, self.musicPlayView.center.y)]; -// moveAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(KScreenWidth/ 2, self.musicPlayView.center.y)]; -// moveAnimation.beginTime = CACurrentMediaTime(); -// moveAnimation.duration = 0.5; -// moveAnimation.repeatCount = 1; -// moveAnimation.removedOnCompletion = YES; -// [self.musicPlayView pop_addAnimation:moveAnimation forKey:@"moveOutAnimation"]; -// + [UIView animateWithDuration:0.25 animations:^{ -// self.musicEnterButton.hidden = YES; self.musicPlayView.frame = CGRectMake(0, 0, KScreenWidth, KScreenHeight); } completion:nil]; } @@ -461,9 +402,6 @@ [self showPKPanel_]; } - (void)showPKPanel_ { -// if (NO == [TTPopup hasShowPopup]) { -// [TTPopup popupView:self.pkPanelView style:TTPopupStyleAlert]; -// } if (self.pkPanelView.superview) { return; } @@ -604,7 +542,7 @@ [self configPlayMusicRoomTypeChange]; [self configRoomPKPanelView:NO]; ///相亲模式下 隐藏许愿礼物 和vip坑位重叠了 - [self roomInfoUpdateConfigWishGift]; +// [self roomInfoUpdateConfigWishGift]; } - (void)onRoomEntered { @@ -677,10 +615,7 @@ [self configLittleGameState]; [self configRoomPKPanelView:YES]; [self handleNewUserGreet]; - ///新用户房间礼物 - [self handleNewUserRoomGift]; - ///房间心愿礼物 - [self configWishGiftEnter]; + ///随机PK匹配 [self handleMatchAnchorPK]; } @@ -918,7 +853,7 @@ case Custom_Message_Sub_AnchorPK_Panel://个播PK面板消息 { [self.anchorPKMatchView removeFromSuperview]; - self.delegate.getRoomInfo.pkMatchStartTime = nil; + self.delegate.getRoomInfo.pkMatchStartTime = 0; if (!self.anchorPKPanelView.superview) { [self addSubview:self.anchorPKPanelView]; [self.anchorPKPanelView mas_makeConstraints:^(MASConstraintMaker *make) { @@ -976,7 +911,7 @@ break; case Custom_Message_Sub_AnchorPK_Match_TimeOut: {///PK匹配超时 - self.delegate.getRoomInfo.pkMatchStartTime = nil; + self.delegate.getRoomInfo.pkMatchStartTime = 0; self.anchorPKMatchView.roomUid = [NSString stringWithFormat:@"%ld", [self.delegate getRoomInfo].uid]; [self.anchorPKMatchView handleMatchTimeOutMessage]; } @@ -1472,12 +1407,12 @@ } - (void)resetAnchorPkInfo { - self.delegate.getRoomInfo.roundId = nil; - self.delegate.getRoomInfo.pkUid = nil; - self.delegate.getRoomInfo.pkRoomId = nil; - self.delegate.getRoomInfo.pkState = nil; - self.delegate.getRoomInfo.winUid = nil; - self.delegate.getRoomInfo.pkMatchStartTime = nil; + self.delegate.getRoomInfo.roundId = 0; + self.delegate.getRoomInfo.pkUid = @""; + self.delegate.getRoomInfo.pkRoomId = @""; + self.delegate.getRoomInfo.pkState = AcrossRoomPkStateTypePkEnd; + self.delegate.getRoomInfo.winUid = @""; + self.delegate.getRoomInfo.pkMatchStartTime = 0; } #pragma mark - 房间VIP小喇叭 - (void)handleTrumpet:(AttachmentModel *)attachment { @@ -1699,72 +1634,6 @@ } } -#pragma mark - 心愿礼物 -- (void)tapWishGift { - NSString * roomUid = [NSString stringWithFormat:@"%ld", self.delegate.getRoomInfo.uid]; - XPWishGiftViewController * vc = [[XPWishGiftViewController alloc] initWithRoomUid:roomUid]; - self.wishGiftVC = vc; - vc.delegate = self; - vc.modalPresentationStyle = UIModalPresentationOverFullScreen; - [self.delegate.getCurrentNav presentViewController:vc animated:YES completion:nil]; -} - -- (void)configWishGiftEnter { - RoomInfoModel * roomInfo = self.delegate.getRoomInfo; - NSString * roomUid = [NSString stringWithFormat:@"%ld", roomInfo.uid]; - if (roomInfo.hasOpenWishGift) { - [Api wishGiftList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { - if (code == 200) { - NSArray * array = [WishGiftInfoModel modelsWithArray:data.data]; - self.wishGiftView.giftList = array; - self.wishGiftView.hidden = NO; - } else { - self.wishGiftView.hidden = YES; - } - - if (!self.wishGiftView.superview) { - [self addSubview:self.wishGiftView]; - [self.wishGiftView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(self).offset(kNavigationHeight + 47); - make.trailing.mas_equalTo(self.mas_trailing).offset(0); - make.size.mas_equalTo(CGSizeMake(81, 30)); - }]; - } - - if (self.delegate.getRoomInfo.roomModeType == RoomModeType_Open_Blind) { - self.wishGiftView.hidden = YES; - } - - } roomUid:roomUid]; - } else { - if (self.wishGiftView.superview) { - [self.wishGiftView removeFromSuperview]; - } - } -} - -- (void)roomInfoUpdateConfigWishGift { - RoomInfoModel * roomInfo = self.delegate.getRoomInfo; - if (roomInfo.datingState == RoomDatingStateChangeType_Close) { - if (self.wishGiftView.superview) { - self.wishGiftView.hidden = NO; - } - } else if(roomInfo.datingState == RoomDatingStateChangeType_Open){ - if (self.wishGiftView.superview) { - self.wishGiftView.hidden = YES; - } - } -} - -- (void)xPWishGiftViewControllerSendClick:(NSString *)giftId { - NSString * roomUid = [NSString stringWithFormat:@"%ld", [self.delegate getRoomInfo].uid]; - XPSendGiftView * giftView = [[XPSendGiftView alloc] initWithType:SendGiftType_Room uid:roomUid]; - giftView.delegate = self.delegate; - NSArray * giftUses = [self configGiftUsers:[self.delegate getMicroQueue]]; - [giftView configGiftUsers:giftUses]; - giftView.selectGiftId = giftId; - [self.delegate.getCurrentNav presentViewController:giftView animated:YES completion:nil]; -} #pragma mark - 随机PK匹配 - (void)handleMatchAnchorPK { @@ -1822,19 +1691,6 @@ return _fansTeamEntranceView; } -//- (UIStackView *)topicStackView { -// if (!_topicStackView) { -// _topicStackView = [[UIStackView alloc] init]; -// _topicStackView.axis = UILayoutConstraintAxisHorizontal; -// _topicStackView.distribution = UIStackViewDistributionFill; -// _topicStackView.alignment = UIStackViewAlignmentFill; -// _topicStackView.spacing = 3; -// UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(topicGestureRecognizer:)]; -// [_topicStackView addGestureRecognizer:tap]; -// _topicStackView.hidden = YES; -// } -// return _topicStackView; -//} - (UIStackView *)rankStackView{ if(!_rankStackView){ _rankStackView = [[UIStackView alloc] init]; @@ -1845,24 +1701,6 @@ } return _rankStackView; } -//- (UILabel *)topicLabel { -// if (!_topicLabel) { -// _topicLabel = [[UILabel alloc] init]; -// _topicLabel.font = [UIFont systemFontOfSize:12]; -// _topicLabel.textColor = [UIColor whiteColor]; -// } -// return _topicLabel; -//} -// -//- (UIButton *)editButton { -// if (!_editButton) { -// _editButton = [UIButton buttonWithType:UIButtonTypeCustom]; -// [_editButton setImage:[UIImage imageNamed:@"room_postion_topic_edit"] forState:UIControlStateNormal]; -// [_editButton setImage:[UIImage imageNamed:@"room_postion_topic_edit"] forState:UIControlStateSelected]; -// _editButton.hidden = YES; -// } -// return _editButton; -//} - (XPAcrossRoomPKPanelView *)acrossPKPanelView { if (!_acrossPKPanelView) { @@ -1943,14 +1781,6 @@ return _anchorPKMatchView; } -- (XPWishGiftEnterView *)wishGiftView { - if (!_wishGiftView) { - _wishGiftView = [[XPWishGiftEnterView alloc] init]; - UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapWishGift)]; - [_wishGiftView addGestureRecognizer:tap]; - } - return _wishGiftView; -} - (XPRoomTrumpetView *)trumpetView { if (!_trumpetView) { _trumpetView = [[XPRoomTrumpetView alloc] init]; diff --git a/YuMi/Modules/YMRoom/View/BaseUIContainerView/XPRoomRankEntranceView.m b/YuMi/Modules/YMRoom/View/BaseUIContainerView/XPRoomRankEntranceView.m index 6a9533ba..7407d7ed 100644 --- a/YuMi/Modules/YMRoom/View/BaseUIContainerView/XPRoomRankEntranceView.m +++ b/YuMi/Modules/YMRoom/View/BaseUIContainerView/XPRoomRankEntranceView.m @@ -62,7 +62,7 @@ BOOL isNumeric(NSString *string) { NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"^[0-9]*\\.?[0-9]+$" options:0 error:&error]; if (error) { - NSLog(@"Error creating regex: %@", error.localizedDescription); +// NSLog(@"Error creating regex: %@", error.localizedDescription); return NO; } diff --git a/YuMi/Modules/YMRoom/View/Common/BaseRoomBannerView.h b/YuMi/Modules/YMRoom/View/Common/BaseRoomBannerView.h new file mode 100644 index 00000000..58c8022b --- /dev/null +++ b/YuMi/Modules/YMRoom/View/Common/BaseRoomBannerView.h @@ -0,0 +1,36 @@ +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface BaseRoomBannerView : UIView + +// 基础属性 +@property (nonatomic, strong) UIView *containerView; +@property (nonatomic, strong) UIImageView *backgroundImageView; + +// 动画相关 +@property (nonatomic, assign) CGFloat showDuration; +@property (nonatomic, assign) CGFloat hideDuration; +@property (nonatomic, assign) CGFloat stayDuration; + +// 显示状态 +@property (nonatomic, assign, readonly) BOOL isShowing; + +// 初始化方法 +- (instancetype)initWithFrame:(CGRect)frame; + +// 显示方法 +- (void)show; +- (void)showWithCompletion:(void(^)(void))completion; + +// 隐藏方法 +- (void)hide; +- (void)hideWithCompletion:(void(^)(void))completion; + +// 子类需要实现的方法 +- (void)setupUI; +- (void)setupAnimation; + +@end + +NS_ASSUME_NONNULL_END \ No newline at end of file diff --git a/YuMi/Modules/YMRoom/View/Common/BaseRoomBannerView.m b/YuMi/Modules/YMRoom/View/Common/BaseRoomBannerView.m new file mode 100644 index 00000000..f6393242 --- /dev/null +++ b/YuMi/Modules/YMRoom/View/Common/BaseRoomBannerView.m @@ -0,0 +1,119 @@ +#import "BaseRoomBannerView.h" + +@interface BaseRoomBannerView () + +@property (nonatomic, assign) BOOL isShowing; + +@end + +@implementation BaseRoomBannerView + +- (instancetype)initWithFrame:(CGRect)frame { + self = [super initWithFrame:frame]; + if (self) { + [self setupDefaultValues]; + [self setupUI]; + [self setupAnimation]; + } + return self; +} + +- (void)setupDefaultValues { + self.showDuration = 0.3; + self.hideDuration = 0.3; + self.stayDuration = 2.0; + self.isShowing = NO; +} + +- (void)setupUI { + // 容器视图 + self.containerView = [[UIView alloc] init]; + [self addSubview:self.containerView]; + + // 背景图 + self.backgroundImageView = [[UIImageView alloc] init]; + self.backgroundImageView.contentMode = UIViewContentModeScaleAspectFill; + [self.containerView addSubview:self.backgroundImageView]; + + // 设置初始状态 + self.alpha = 0; + self.hidden = YES; + self.transform = CGAffineTransformMakeScale(0.8, 0.8); +} + +- (void)setupAnimation { + // 子类可以重写此方法设置特定的动画参数 +} + +- (void)show { + [self showWithCompletion:nil]; +} + +- (void)showWithCompletion:(void(^)(void))completion { + if (self.isShowing) { + return; + } + + self.isShowing = YES; + self.hidden = NO; + + // 显示动画 + [UIView animateWithDuration:self.showDuration + delay:0 + usingSpringWithDamping:0.6 + initialSpringVelocity:0.5 + options:UIViewAnimationOptionCurveEaseOut + animations:^{ + self.alpha = 1; + self.transform = CGAffineTransformMakeScale(1.2, 1.2); + } completion:^(BOOL finished) { +// if (finished) { +// // 恢复原始大小 +// [UIView animateWithDuration:0.2 animations:^{ +// self.transform = CGAffineTransformIdentity; +// } completion:^(BOOL finished) { +// if (finished) { +// // 延迟隐藏 +// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(self.stayDuration * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ +// [self hideWithCompletion:completion]; +// }); +// } +// }]; +// } + }]; +} + +- (void)hide { + [self hideWithCompletion:nil]; +} + +- (void)hideWithCompletion:(void(^)(void))completion { + if (!self.isShowing) { + return; + } + + // 隐藏动画 + [UIView animateWithDuration:self.hideDuration + delay:0 + usingSpringWithDamping:0.6 + initialSpringVelocity:0.5 + options:UIViewAnimationOptionCurveEaseIn + animations:^{ + self.alpha = 0; + self.transform = CGAffineTransformMakeScale(0.8, 0.8); + } completion:^(BOOL finished) { + if (finished) { + self.hidden = YES; + self.isShowing = NO; + if (completion) { + completion(); + } + } + }]; +} + +- (void)updateContent:(NSDictionary *)content { + // 子类实现具体内容更新 +} + +@end diff --git a/YuMi/Modules/YMRoom/View/Common/BroveGiftBannerView.h b/YuMi/Modules/YMRoom/View/Common/BroveGiftBannerView.h new file mode 100644 index 00000000..98758ced --- /dev/null +++ b/YuMi/Modules/YMRoom/View/Common/BroveGiftBannerView.h @@ -0,0 +1,16 @@ +#import + +@class AttachmentModel; + +NS_ASSUME_NONNULL_BEGIN + +@interface BroveGiftBannerView : UIView + + ++ (void)display:(UIView *)superView + with:(AttachmentModel *)attachment + complete:(void(^)(void))complete; + +@end + +NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/Common/BroveGiftBannerView.m b/YuMi/Modules/YMRoom/View/Common/BroveGiftBannerView.m new file mode 100644 index 00000000..11689eaa --- /dev/null +++ b/YuMi/Modules/YMRoom/View/Common/BroveGiftBannerView.m @@ -0,0 +1,217 @@ +#import "BroveGiftBannerView.h" +#import "UserInfoModel.h" +#import "AttachmentModel.h" +#import +#import + +//{"data":"{\"times\":\"1.65\",\"sender\":{\"avatar\":\"https://image.pekolive.com/14a8039a-df7f-4a4b-a6b9-99c6d3f9918e.gif\",\"erbanNo\":6228657,\"gender\":1,\"nick\":\"Molistar\",\"uid\":3224},\"coins\":\"1650.0\",\"giftPic\":\"https://image.pekolive.com/1000.png\",\"giftNameMap\":{\"ar\":\"lucky1000\",\"en\":\"lucky1000\",\"zh\":\"lucky1000\",\"tr\":\"lucky1000\"},\"roomUid\":3224}","first":106,"second":1066} + +@interface BroveGiftBannerViewModel : PIBaseModel + +@property (nonatomic, assign, readonly) CGFloat times; +@property (nonatomic, assign, readonly) CGFloat coins; +@property (nonatomic, copy, readonly) NSString *giftPic; +@property (nonatomic, copy, readonly) NSDictionary *giftNameMap; +@property (nonatomic, strong, readonly) UserInfoModel *sender; + +@end + +@implementation BroveGiftBannerViewModel + +@end + + +@interface BroveGiftBannerView () +@property (nonatomic, strong) BroveGiftBannerViewModel *model; +@property (nonatomic, strong) NetImageView *sendAvatarImageView; +@property (nonatomic, strong) NetImageView *giftImageView; +@property (nonatomic, strong) UILabel *goldNumLabel; +//@property (nonatomic, strong) UIImageView *backgroundImageView; +@property (nonatomic, strong) UIImageView *moneyIconImageView; +@property(nonatomic, strong) SVGAImageView *svgaView; +@property (nonatomic, copy) void(^completeDisplay)(void); +@end + +@implementation BroveGiftBannerView + ++ (void)display:(UIView *)superView with:(AttachmentModel *)attachment complete:(void (^)(void))complete { + BroveGiftBannerViewModel *model = [BroveGiftBannerViewModel modelWithDictionary:attachment.data]; + CGRect frame = CGRectMake(KScreenWidth, 0, KScreenWidth, kGetScaleWidth(90)); + BroveGiftBannerView *banner = [[BroveGiftBannerView alloc] initWithFrame:frame]; + banner.model = model; + banner.completeDisplay = complete; + [banner addNotification]; + [superView addSubview:banner]; + + @kWeakify(banner); + [banner popEnterAnimation:^(BOOL finished) { + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + @kStrongify(banner); + [banner popLeaveAnimation:^(bool finished) { + if (banner.completeDisplay) { + banner.completeDisplay(); + } + [banner removeFromSuperview]; + }]; + }); + }]; +} + +- (void)addNotification { + @kWeakify(self); + [[NSNotificationCenter defaultCenter] addObserverForName:@"SwipeOutBanner" + object:nil + queue:[NSOperationQueue mainQueue] + usingBlock:^(NSNotification * _Nonnull notification) { + @kStrongify(self); + [self dismissBanner]; + }]; +} + +- (void)setModel:(BroveGiftBannerViewModel *)model { + self.sendAvatarImageView.imageUrl = model.sender.avatar; + self.giftImageView.imageUrl = model.giftPic; + self.goldNumLabel.text = [NSString stringByRemovingRedundantZeros:@(model.coins).stringValue]; +} + +- (void)dismissBanner { + [self pop_removeAllAnimations]; // 停止所有动画 + + [self popLeaveAnimation:^(bool finished) { + if (self.completeDisplay) { + self.completeDisplay(); + } + [self removeFromSuperview]; + }]; +} + +- (void)popEnterAnimation:(void(^)(BOOL finished))finish { + POPSpringAnimation *enterAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPViewFrame]; + enterAnimation.toValue = [NSValue valueWithCGRect:CGRectMake(0, 0, KScreenWidth, kGetScaleWidth(100))]; + enterAnimation.springBounciness = 10; // 弹性系数 + enterAnimation.springSpeed = 12; // 动画速度 + enterAnimation.completionBlock = ^(POPAnimation *anim, BOOL finished) { + if (finish) { + finish(finished); + } + }; + [self pop_addAnimation:enterAnimation forKey:@"enterAnimation"]; +} + +- (void)popLeaveAnimation:(void(^)(bool finished))finish { + POPBasicAnimation *exitAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewFrame]; + exitAnimation.toValue = [NSValue valueWithCGRect:CGRectMake(-KScreenWidth, 0, KScreenWidth, kGetScaleWidth(100))]; + exitAnimation.duration = 0.25; // 动画持续时间 + exitAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; + exitAnimation.completionBlock = ^(POPAnimation *anim, BOOL finished) { + if (finish) { + finish(finished); + } + }; + [self pop_addAnimation:exitAnimation forKey:@"exitAnimation"]; +} + +- (instancetype)initWithFrame:(CGRect)frame { + self = [super initWithFrame:frame]; + if (self) { + [self setupUI]; + } + return self; +} + +- (void)setupUI { + // 设置背景图 + self.svgaView = [[SVGAImageView alloc] init]; + self.svgaView.loops = 0; + self.svgaView.clearsAfterStop = YES; + [self addSubview:self.svgaView]; + [self.svgaView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.equalTo(self); + }]; + SVGAParser *p = [[SVGAParser alloc] init]; + @kWeakify(self); + [p parseWithNamed:@"brove_gift" inBundle:[NSBundle mainBundle] completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) { + @kStrongify(self); + if (videoItem) { + self.svgaView.videoItem = videoItem; + [self.svgaView startAnimation]; + } + } failureBlock:^(NSError * _Nonnull error) { + @kStrongify(self); + if (self.completeDisplay) { + self.completeDisplay(); + } + }]; + + UILabel *sendLabel = [self sendLabel]; + UILabel *winLabel = [self winLabel]; + + // 发送者头像 + NetImageConfig * config = [[NetImageConfig alloc]init]; + config.imageType = ImageTypeUserIcon; + config.placeHolder = [UIImageConstant defaultAvatarPlaceholder]; + self.sendAvatarImageView = [[NetImageView alloc] initWithConfig:config]; + [self.sendAvatarImageView setCornerRadius:kGetScaleWidth(15)]; + + // 礼物头像 + self.giftImageView = [[NetImageView alloc] initWithConfig:config]; + [self.giftImageView setCornerRadius:2]; + + // 金币数量 + self.goldNumLabel = [[UILabel alloc] init]; + self.goldNumLabel.font = kFontSemibold(18); + self.goldNumLabel.textColor = UIColorFromRGB(0xffec6f); + + // 金币图标 + self.moneyIconImageView = [[UIImageView alloc] init]; + self.moneyIconImageView.image = kImage(@"moli_money_icon"); + + UIStackView *stackView = [[UIStackView alloc] initWithArrangedSubviews:@[ + self.sendAvatarImageView, + sendLabel, + self.giftImageView, + winLabel, + self.goldNumLabel, + self.moneyIconImageView + ]]; + stackView.spacing = 4; + stackView.alignment = UIStackViewAlignmentCenter; + [self addSubview:stackView]; + [stackView mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.mas_equalTo(self); + make.top.mas_equalTo(self).offset(kGetScaleWidth(28)); + }]; + + [sendLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.height.mas_equalTo(24); + }]; + [winLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.height.mas_equalTo(24); + }]; + + [self.sendAvatarImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.height.mas_equalTo(kGetScaleWidth(30)); + }]; + + [self.giftImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.height.mas_equalTo(kGetScaleWidth(32)); + }]; + + [self.moneyIconImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.height.mas_equalTo(kGetScaleWidth(24)); + }]; +} + +- (UILabel *)sendLabel { + return [UILabel labelInitWithText:YMLocalizedString(@"Combo_0") + font:kFontRegular(14) + textColor:[UIColor whiteColor]]; +} + +- (UILabel *)winLabel { + return [UILabel labelInitWithText:YMLocalizedString(@"Combo_4") + font:kFontRegular(14) + textColor:[UIColor whiteColor]]; +} + +@end diff --git a/YuMi/Modules/YMRoom/View/Custom Background/CustomRoomBGCell.m b/YuMi/Modules/YMRoom/View/Custom Background/CustomRoomBGCell.m index 4d40c5bb..9b82776d 100644 --- a/YuMi/Modules/YMRoom/View/Custom Background/CustomRoomBGCell.m +++ b/YuMi/Modules/YMRoom/View/Custom Background/CustomRoomBGCell.m @@ -79,7 +79,6 @@ if (self.svgaImageView.videoItem) { [self.svgaImageView startAnimation]; } else { - NSLog(@"%@", self.cellModel.url); @kWeakify(self); [self.parser parseWithURL:[NSURL URLWithString:[self.cellModel.url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]]] completionBlock:^(SVGAVideoEntity * _Nullable videoItem) { @@ -87,7 +86,7 @@ self.svgaImageView.videoItem = videoItem; [self.svgaImageView startAnimation]; } failureBlock:^(NSError * _Nullable error) { - NSLog(@"%@", error); +// NSLog(@"%@", error); }]; } } else { diff --git a/YuMi/Modules/YMRoom/View/Custom Background/CustomRoomBGContentViewController.m b/YuMi/Modules/YMRoom/View/Custom Background/CustomRoomBGContentViewController.m index 2af8e9d3..4f38cfd8 100644 --- a/YuMi/Modules/YMRoom/View/Custom Background/CustomRoomBGContentViewController.m +++ b/YuMi/Modules/YMRoom/View/Custom Background/CustomRoomBGContentViewController.m @@ -347,7 +347,7 @@ self.previewBackSvgaView.videoItem = videoItem; [self.previewBackSvgaView startAnimation]; } failureBlock:^(NSError * _Nullable error) { - NSLog(@"%@", error); +// NSLog(@"%@", error); }]; } else { self.previewBackImageView.imageUrl = model.url; diff --git a/YuMi/Modules/YMRoom/View/FaceView/Presenter/XPRoomFaceTool.m b/YuMi/Modules/YMRoom/View/FaceView/Presenter/XPRoomFaceTool.m index c4bbb297..1afde907 100644 --- a/YuMi/Modules/YMRoom/View/FaceView/Presenter/XPRoomFaceTool.m +++ b/YuMi/Modules/YMRoom/View/FaceView/Presenter/XPRoomFaceTool.m @@ -73,13 +73,13 @@ NSString * const kRoomFaceVersion = @"kRoomFaceVersion"; }else { // filePath就是你下载文件的位置,你可以解压,也可以直接拿来使用 NSString *imgFilePath = [filePath path]; - NSLog(@"img == %@", imgFilePath); +// NSLog(@"img == %@", imgFilePath); NSString *zipPath = imgFilePath; NSFileManager *fileManager = [NSFileManager defaultManager]; //删除老的数据 [[NSFileManager defaultManager] removeItemAtPath:faceDirectory error:nil]; [fileManager createDirectoryAtPath:faceDirectory withIntermediateDirectories:YES attributes:nil error:nil]; - NSLog(@"test == %@",faceDirectory); //解压后的路径 +// NSLog(@"test == %@",faceDirectory); //解压后的路径 dispatch_async(dispatch_get_global_queue(0, 0), ^{ //解压 [SSZipArchive unzipFileAtPath:zipPath toDestination:faceDirectory overwrite:YES password:nil progressHandler:^(NSString * _Nonnull entry, unz_file_info zipInfo, long entryNumber, long total) { diff --git a/YuMi/Modules/YMRoom/View/LittleGame/Presenter/Category/NSData+RW.m b/YuMi/Modules/YMRoom/View/LittleGame/Presenter/Category/NSData+RW.m index 1772b0a3..e4113f09 100644 --- a/YuMi/Modules/YMRoom/View/LittleGame/Presenter/Category/NSData+RW.m +++ b/YuMi/Modules/YMRoom/View/LittleGame/Presenter/Category/NSData+RW.m @@ -164,9 +164,9 @@ static const short base64DecodingTable[256] = { - (id)jsonValueDecoded { NSError *error = nil; id value = [NSJSONSerialization JSONObjectWithData:self options:kNilOptions error:&error]; - if (error) { - NSLog(@"jsonValueDecoded error:%@", error); - } +// if (error) { +// NSLog(@"jsonValueDecoded error:%@", error); +// } return value; } diff --git a/YuMi/Modules/YMRoom/View/LittleGame/Presenter/Category/NSString+RW.m b/YuMi/Modules/YMRoom/View/LittleGame/Presenter/Category/NSString+RW.m index 6339cce8..62f427fb 100644 --- a/YuMi/Modules/YMRoom/View/LittleGame/Presenter/Category/NSString+RW.m +++ b/YuMi/Modules/YMRoom/View/LittleGame/Presenter/Category/NSString+RW.m @@ -460,7 +460,7 @@ usingBlock:^(NSString * _Nullable substring, NSRange substringRange, NSRange enclosingRange, BOOL * _Nonnull stop) { const unichar hs = [substring characterAtIndex:0]; - NSLog(@"hs:%c",hs); +// NSLog(@"hs:%c",hs); if (0xd800 <= hs && hs <= 0xdbff){ if (substring.length > 1){ diff --git a/YuMi/Modules/YMRoom/View/LittleGame/Presenter/Category/UIImage+RW.m b/YuMi/Modules/YMRoom/View/LittleGame/Presenter/Category/UIImage+RW.m index b96a1407..3fd0383c 100644 --- a/YuMi/Modules/YMRoom/View/LittleGame/Presenter/Category/UIImage+RW.m +++ b/YuMi/Modules/YMRoom/View/LittleGame/Presenter/Category/UIImage+RW.m @@ -640,15 +640,15 @@ static void _yy_cleanupBuffer(void *userData, void *buf_data) { saturation:(CGFloat)saturation maskImage:(UIImage *)maskImage { if (self.size.width < 1 || self.size.height < 1) { - NSLog(@"UIImage+XHAdd error: invalid size: (%.2f x %.2f). Both dimensions must be >= 1: %@", self.size.width, self.size.height, self); + // NSLog(@"UIImage+XHAdd error: invalid size: (%.2f x %.2f). Both dimensions must be >= 1: %@", self.size.width, self.size.height, self); return nil; } if (!self.CGImage) { - NSLog(@"UIImage+XHAdd error: inputImage must be backed by a CGImage: %@", self); + // NSLog(@"UIImage+XHAdd error: inputImage must be backed by a CGImage: %@", self); return nil; } if (maskImage && !maskImage.CGImage) { - NSLog(@"UIImage+XHAdd error: effectMaskImage must be backed by a CGImage: %@", maskImage); + // NSLog(@"UIImage+XHAdd error: effectMaskImage must be backed by a CGImage: %@", maskImage); return nil; } @@ -684,12 +684,12 @@ static void _yy_cleanupBuffer(void *userData, void *buf_data) { vImage_Error err; err = vImageBuffer_InitWithCGImage(&effect, &format, NULL, imageRef, kvImagePrintDiagnosticsToConsole); if (err != kvImageNoError) { - NSLog(@"UIImage+XHAdd error: vImageBuffer_InitWithCGImage returned error code %zi for inputImage: %@", err, self); + // NSLog(@"UIImage+XHAdd error: vImageBuffer_InitWithCGImage returned error code %zi for inputImage: %@", err, self); return nil; } err = vImageBuffer_Init(&scratch, effect.height, effect.width, format.bitsPerPixel, kvImageNoFlags); if (err != kvImageNoError) { - NSLog(@"UIImage+XHAdd error: vImageBuffer_Init returned error code %zi for inputImage: %@", err, self); + // NSLog(@"UIImage+XHAdd error: vImageBuffer_Init returned error code %zi for inputImage: %@", err, self); return nil; } } else { @@ -889,7 +889,7 @@ static void _yy_cleanupBuffer(void *userData, void *buf_data) { CGImageGetHeight(img)); if(pixelBuffer == NULL) - NSLog(@"No pixelbuffer"); + // NSLog(@"No pixelbuffer"); outBuffer.data = pixelBuffer; outBuffer.width = CGImageGetWidth(img); @@ -908,7 +908,7 @@ static void _yy_cleanupBuffer(void *userData, void *buf_data) { if (error) { - NSLog(@"error from convolution %ld", error); + // NSLog(@"error from convolution %ld", error); } CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); diff --git a/YuMi/Modules/YMRoom/View/LittleGame/View/XPRoomLittleGameContainerView.m b/YuMi/Modules/YMRoom/View/LittleGame/View/XPRoomLittleGameContainerView.m index 705d1997..983c048b 100644 --- a/YuMi/Modules/YMRoom/View/LittleGame/View/XPRoomLittleGameContainerView.m +++ b/YuMi/Modules/YMRoom/View/LittleGame/View/XPRoomLittleGameContainerView.m @@ -66,14 +66,14 @@ if (self.currentmgId == 0) {//第一次加载游戏 self.currentmgId = roomInfo.mgId; if (self.currentmgId != 0) {//房间信息已加载 - NSLog(@"initLittleGame---%lld", self.currentmgId); + // NSLog(@"initLittleGame---%lld", self.currentmgId); [self initLittleGame]; } } else { if (self.currentmgId != roomInfo.mgId) { //切换游戏玩法 self.currentmgId = roomInfo.mgId; - NSLog(@"updateLittleGame---%lld", self.currentmgId); + // NSLog(@"updateLittleGame---%lld", self.currentmgId); if (self.currentmgId != 0) { [self.fsmAPP2MG destroyMG]; [self updateMicInfoWithGameStatus:LittleGamePlayStatus_NoIn]; @@ -97,7 +97,7 @@ } - (void)gameSetUp { - NSLog(@"小游戏的版本号是:%@", [SudMGP getVersion]); + // NSLog(@"小游戏的版本号是:%@", [SudMGP getVersion]); BOOL isTestEnv = NO; #ifdef DEBUG isTestEnv = YES; @@ -117,7 +117,7 @@ } NSString * userId = [AccountInfoStorage instance].getUid; NSString * roomId = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.uid]; - NSLog(@"用户ID:%@,房间ID:%@, 游戏ID:%lld, code:%@", userId, roomId, self.currentmgId, self.code); + // NSLog(@"用户ID:%@,房间ID:%@, 游戏ID:%lld, code:%@", userId, roomId, self.currentmgId, self.code); // NSString *language = [NSBundle getLanguageText]; @@ -133,7 +133,7 @@ self.fsmAPP2MG = [SudMGP loadMG:userId roomId:roomId code:self.code mgId:self.currentmgId language:language fsmMG:self rootView:self]; } else { /// 初始化失败, 可根据业务重试 - NSLog(@"ISudFSMMG:initGameSDKWithAppID:初始化sdk失败 :%@",retMsg); + // NSLog(@"ISudFSMMG:initGameSDKWithAppID:初始化sdk失败 :%@",retMsg); } }]; } @@ -314,7 +314,7 @@ * 游戏日志 */ -(void)onGameLog:(NSString*)dataJson { - NSLog(@"ISudFSMMG:onGameLog:%@", dataJson); + // NSLog(@"ISudFSMMG:onGameLog:%@", dataJson); NSDictionary * dic = [SudCommon turnStringToDictionary:dataJson]; NSString * msg_string = [dic objectForKey:@"msg"]; if (!msg_string) { @@ -326,14 +326,14 @@ * 游戏开始 */ -(void)onGameStarted { - NSLog(@"ISudFSMMG:onGameStarted:游戏开始"); + // NSLog(@"ISudFSMMG:onGameStarted:游戏开始"); } /** * 游戏销毁 */ -(void)onGameDestroyed { - NSLog(@"ISudFSMMG:onGameDestroyed:游戏开始"); + // NSLog(@"ISudFSMMG:onGameDestroyed:游戏开始"); } /** @@ -341,14 +341,14 @@ * @param dataJson {"code":"value"} */ -(void)onExpireCode:(id)handle dataJson:(NSString*)dataJson { - NSLog(@"ISudFSMMG:onExpireCode:Code过期"); + // NSLog(@"ISudFSMMG:onExpireCode:Code过期"); // 请求业务服务器刷新令牌 [Api getSudGameCode:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { if (code == 200) { NSString * gameCode = data.data[@"code"]; self.code = gameCode; [self.fsmAPP2MG updateCode:gameCode listener:^(int retCode, const NSString *retMsg, const NSString *dataJson) { - NSLog(@"ISudFSMMG:updateGameCode retCode=%@ retMsg=%@ dataJson=%@", @(retCode), retMsg, dataJson); + // NSLog(@"ISudFSMMG:updateGameCode retCode=%@ retMsg=%@ dataJson=%@", @(retCode), retMsg, dataJson); }]; // 回调结果 NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:@(0), @"ret_code", @"return form APP onExpireCode", @"ret_msg", nil]; @@ -416,11 +416,11 @@ */ -(void)onGameStateChange:(id) handle state:(NSString*) state dataJson:(NSString*) dataJson { if ([state isEqualToString:MG_COMMON_PUBLIC_MESSAGE]) { - NSLog(@"ISudFSMMG:onGameStateChange:游戏->APP:公屏消息"); + // NSLog(@"ISudFSMMG:onGameStateChange:游戏->APP:公屏消息"); } else if ([state isEqualToString:MG_COMMON_KEY_WORD_TO_HIT]) { NSDictionary *dic = [SudCommon turnStringToDictionary:dataJson]; NSString *word = [dic objectForKey:@"word"]; - NSLog(@"ISudFSMMG:onGameStateChange:游戏->APP:你画我猜关键词获取:%@",word); + // NSLog(@"ISudFSMMG:onGameStateChange:游戏->APP:你画我猜关键词获取:%@",word); /// 记录你画我猜关键字 self.DrawSomethingKeyWord = word; if (word == (id) [NSNull null] || [word isEqualToString:@""]) { @@ -437,9 +437,9 @@ seatIndex = [[dic objectForKey:@"seatIndex"] intValue]; } if (seatIndex == -1) { - NSLog(@"来自加入按钮%d",seatIndex); + // NSLog(@"来自加入按钮%d",seatIndex); }else { - NSLog(@"来自麦位+入%d",seatIndex); + // NSLog(@"来自麦位+入%d",seatIndex); } if ([self isOnMicro:[AccountInfoStorage instance].getUid.integerValue]) {//判断是否在麦上 [self notifySelfInState:YES seatIndex:seatIndex]; @@ -454,7 +454,7 @@ [self handleSelfInExitEvent]; } else { /// 其他状态 - NSLog(@"ISudFSMMG:onGameStateChange:游戏->APP:state:%@",MG_COMMON_PUBLIC_MESSAGE); + // NSLog(@"ISudFSMMG:onGameStateChange:游戏->APP:state:%@",MG_COMMON_PUBLIC_MESSAGE); } } @@ -466,7 +466,7 @@ * @param dataJson 回调JSON */ -(void)onPlayerStateChange:(nullable id) handle userId:(NSString*) userId state:(NSString*) state dataJson:(NSString*) dataJson { - NSLog(@"ISudFSMMG:onPlayerStateChange:游戏->APP:游戏玩家状态变化:userId: %@ --state: %@ --dataJson: %@", userId, state, dataJson); + // NSLog(@"ISudFSMMG:onPlayerStateChange:游戏->APP:游戏玩家状态变化:userId: %@ --state: %@ --dataJson: %@", userId, state, dataJson); /// 状态解析 NSString *dataStr = @""; if ([state isEqualToString:MG_COMMON_PLAYER_IN]) { @@ -497,9 +497,9 @@ dataStr = YMLocalizedString(@"XPRoomLittleGameContainerView8"); [self handleState_MG_DG_SCORE_WithUserId:userId dataJson:dataJson]; }else { - NSLog(@"ISudFSMMG:onPlayerStateChange:未做解析状态:%@", MG_DG_SCORE); + // NSLog(@"ISudFSMMG:onPlayerStateChange:未做解析状态:%@", MG_DG_SCORE); } - NSLog(@"ISudFSMMG:onPlayerStateChange:dataStr:%@", dataStr); + // NSLog(@"ISudFSMMG:onPlayerStateChange:dataStr:%@", dataStr); /// 回调 NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:@(0), @"ret_code", @"return form APP onPlayerStateChange", @"ret_msg", nil]; [handle success:[SudCommon dictionaryToJson:dict]]; @@ -548,7 +548,7 @@ /// @param dataJson 需传递的json - (void)notifyStateChange:(NSString *) state dataJson:(NSString*) dataJson { [self.fsmAPP2MG notifyStateChange:state dataJson:dataJson listener:^(int retCode, const NSString *retMsg, const NSString *dataJson) { - NSLog(@"ISudFSMMG:notifyStateChange:retCode=%@ retMsg=%@ dataJson=%@", @(retCode), retMsg, dataJson); + // NSLog(@"ISudFSMMG:notifyStateChange:retCode=%@ retMsg=%@ dataJson=%@", @(retCode), retMsg, dataJson); RoomInfoModel * roomInfo = self.hostDelegate.getRoomInfo; if (retCode == 0 && [state isEqualToString:APP_COMMON_SELF_PLAYING]) {//开始游戏 //上报游戏开始 @@ -766,11 +766,11 @@ } - (void)handleState_MG_DG_SELECTING_WithUserId:(NSString *)userId dataJson:(NSString *)dataJson { - NSLog(@"handleState_MG_DG_SELECTING_WithUserId%@",dataJson); + // NSLog(@"handleState_MG_DG_SELECTING_WithUserId%@",dataJson); } - (void)handleState_MG_DG_PAINTING_WithUserId:(NSString *)userId dataJson:(NSString *)dataJson { - NSLog(@"handleState_MG_DG_PAINTING_WithUserId%@",dataJson); + // NSLog(@"handleState_MG_DG_PAINTING_WithUserId%@",dataJson); /// 设置麦位状态为作画中 NSDictionary * dic = [SudCommon turnStringToDictionary:dataJson]; bool isPainting = NO; @@ -781,18 +781,18 @@ - (void)handleState_MG_DG_ERRORANSWER_WithUserId:(NSString *)userId dataJson:(NSString *)dataJson { /// 错误答案 - NSLog(@"handleState_MG_DG_ERRORANSWER_WithUserId%@",dataJson); + // NSLog(@"handleState_MG_DG_ERRORANSWER_WithUserId%@",dataJson); } - (void)handleState_MG_DG_TOTALSCORE_WithUserId:(NSString *)userId dataJson:(NSString *)dataJson { /// 总积分 - NSLog(@"handleState_MG_DG_TOTALSCORE_WithUserId%@",dataJson); + // NSLog(@"handleState_MG_DG_TOTALSCORE_WithUserId%@",dataJson); } - (void)handleState_MG_DG_SCORE_WithUserId:(NSString *)userId dataJson:(NSString *)dataJson { /// 本次积分 - NSLog(@"handleState_MG_DG_SCORE_WithUserId%@",dataJson); + // NSLog(@"handleState_MG_DG_SCORE_WithUserId%@",dataJson); } /// 销毁MG diff --git a/YuMi/Modules/YMRoom/View/LuckyPackage/LuckyPackageStatusView.m b/YuMi/Modules/YMRoom/View/LuckyPackage/LuckyPackageStatusView.m index 24b58bef..eda1fc7c 100644 --- a/YuMi/Modules/YMRoom/View/LuckyPackage/LuckyPackageStatusView.m +++ b/YuMi/Modules/YMRoom/View/LuckyPackage/LuckyPackageStatusView.m @@ -671,7 +671,7 @@ } - (void)viewDidFailPlayMP4:(NSError *)error { - NSLog(@"%@", error); +// NSLog(@"%@", error); } #pragma mark - diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m b/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m index 50bdccbe..50c95c1d 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m @@ -323,6 +323,16 @@ break; } } +// else if(first == 106){ +// switch (second) { +// case Custom_Message_Sub_Super_Gift_Room_Message: +// return [self createGeneralPublicScreenAttribute:attachment messageInfo:messageInfo]; +// break; +// +// default: +// break; +// } +// } return nil; } diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPNetImageYYLabel.m b/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPNetImageYYLabel.m index ba23530f..7f4bc93a 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPNetImageYYLabel.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPNetImageYYLabel.m @@ -15,6 +15,40 @@ @implementation XPNetImageYYLabel +//- (void)drawRect:(CGRect)rect { +// [super drawRect:rect]; +// if (!self.asyncDraw) return; +// +// CGContextRef context = UIGraphicsGetCurrentContext(); +// dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ +// // 在后台线程创建绘制内容 +// UIImage *image = [self createOffscreenImage]; +// dispatch_async(dispatch_get_main_queue(), ^{ +// CGContextDrawImage(context, rect, image.CGImage); +// }); +// }); +// } +// +//// 建议2:优化图片缓存 +//- (void)setAttributedText:(NSAttributedString *)attributedText { +// [self.previousAttributedText release]; // 需要管理内存 +// _previousAttributedText = [attributedText copy]; +// +// if ([self hasImageAttachments]) { +// [self preloadImages]; // 需要实现图片预加载 +// } +//} + +- (instancetype)init +{ + self = [super init]; + if (self) { + self.layer.shouldRasterize = YES; + self.layer.rasterizationScale = [UIScreen mainScreen].scale; + } + return self; +} + - (void)setAttributedText:(NSAttributedString *)attributedText { if (!attributedText) return; diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPRoomMessageTableViewCell.m b/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPRoomMessageTableViewCell.m index d5312a68..bade6428 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPRoomMessageTableViewCell.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPRoomMessageTableViewCell.m @@ -55,6 +55,10 @@ } - (void)setIsLeftBigImage:(BOOL)isLeftBigImage { + if (_isLeftBigImage == isLeftBigImage) { + return; + } + _isLeftBigImage = isLeftBigImage; if (isLeftBigImage) { [self.contentView addSubview:self.leftBigImageView]; @@ -76,9 +80,26 @@ make.leading.mas_equalTo(self.leftBigImageView.mas_trailing); make.trailing.mas_equalTo(self.bubbleImageView).offset(-8); }]; + } else { + // 需要添加移除大图的逻辑 + [_leftBigImageView removeFromSuperview]; + [self rebuildNormalConstraints]; } } +// 新增方法优化约束更新 +- (void)rebuildNormalConstraints { + [self.bubbleImageView mas_remakeConstraints:^(MASConstraintMaker *make) { + make.leading.mas_equalTo(8); + make.top.bottom.mas_equalTo(0); + make.trailing.mas_equalTo(-8); + }]; + + [self.contentLabel mas_remakeConstraints:^(MASConstraintMaker *make) { + make.edges.mas_equalTo(UIEdgeInsetsMake(4, 12, 4, 12)); + }]; +} + #pragma mark - tool - (UIImage*)resizableImage:(UIImage *)image { //图片拉伸区域 diff --git a/YuMi/Modules/YMRoom/View/MoreView/Presenter/XPMoreMenuPresenter.m b/YuMi/Modules/YMRoom/View/MoreView/Presenter/XPMoreMenuPresenter.m index 0f84b28d..95a519d8 100644 --- a/YuMi/Modules/YMRoom/View/MoreView/Presenter/XPMoreMenuPresenter.m +++ b/YuMi/Modules/YMRoom/View/MoreView/Presenter/XPMoreMenuPresenter.m @@ -260,7 +260,7 @@ [Api closeRoomGiftValue:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [[self getView] closeRoomGiftValueSuccess]; }fail:^(NSInteger code, NSString * _Nullable msg) { - NSLog(@"%@",msg); +// NSLog(@"%@",msg); }] uid:uid roomUid:roomUid]; } diff --git a/YuMi/Modules/YMRoom/View/RoomGame/Presenter/MSRoomGamePresenter.m b/YuMi/Modules/YMRoom/View/RoomGame/Presenter/MSRoomGamePresenter.m index 67765de0..4e78e4e7 100644 --- a/YuMi/Modules/YMRoom/View/RoomGame/Presenter/MSRoomGamePresenter.m +++ b/YuMi/Modules/YMRoom/View/RoomGame/Presenter/MSRoomGamePresenter.m @@ -132,7 +132,7 @@ ///退出房间 -(void)closeRoomGameWithRoomId:(NSString *)roomId{ [Api closeRoomGame:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { - NSLog(@"111"); +// NSLog(@"111"); } roomId:roomId]; } @end diff --git a/YuMi/Modules/YMRoom/View/RoomGame/View/SubView/MSRoomGameView.m b/YuMi/Modules/YMRoom/View/RoomGame/View/SubView/MSRoomGameView.m index 2063e150..6a8bbfd6 100644 --- a/YuMi/Modules/YMRoom/View/RoomGame/View/SubView/MSRoomGameView.m +++ b/YuMi/Modules/YMRoom/View/RoomGame/View/SubView/MSRoomGameView.m @@ -68,7 +68,7 @@ } - (void)gameSetUp { - NSLog(@"小游戏的版本号是:%@", [SudMGP getVersion]); + // NSLog(@"小游戏的版本号是:%@", [SudMGP getVersion]); BOOL isTestEnv = NO; #ifdef DEBUG isTestEnv = YES; @@ -88,7 +88,7 @@ } NSString * userId = [AccountInfoStorage instance].getUid; NSString * roomId = self.gameModel.roomId; - NSLog(@"用户ID:%@,房间ID:%@, 游戏ID:%lld, code:%@", userId, roomId, self.currentmgId, self.code); + // NSLog(@"用户ID:%@,房间ID:%@, 游戏ID:%lld, code:%@", userId, roomId, self.currentmgId, self.code); NSString *language = [NSBundle getLanguageText]; if ([language hasPrefix:@"zh"]) { @@ -103,7 +103,7 @@ self.fsmAPP2MG = [SudMGP loadMG:userId roomId:roomId code:self.code mgId:self.currentmgId language:language fsmMG:self rootView:self]; } else { /// 初始化失败, 可根据业务重试 - NSLog(@"ISudFSMMG:initGameSDKWithAppID:初始化sdk失败 :%@",retMsg); + // NSLog(@"ISudFSMMG:initGameSDKWithAppID:初始化sdk失败 :%@",retMsg); } }]; } @@ -155,7 +155,7 @@ * 游戏日志 */ -(void)onGameLog:(NSString*)dataJson { - NSLog(@"ISudFSMMG:onGameLog:%@", dataJson); + // NSLog(@"ISudFSMMG:onGameLog:%@", dataJson); NSDictionary * dic = [SudCommon turnStringToDictionary:dataJson]; NSString * msg_string = [dic objectForKey:@"msg"]; if (!msg_string) { @@ -167,7 +167,7 @@ * 游戏开始 */ -(void)onGameStarted { - NSLog(@"ISudFSMMG:onGameStarted:游戏开始"); + // NSLog(@"ISudFSMMG:onGameStarted:游戏开始"); [self notifySelfInState:YES seatIndex:-1];///加入房间 [self handleSelfReadyEvent];///准备游戏 } @@ -176,7 +176,7 @@ * 游戏销毁 */ -(void)onGameDestroyed { - NSLog(@"ISudFSMMG:onGameDestroyed:游戏开始"); + // NSLog(@"ISudFSMMG:onGameDestroyed:游戏开始"); } /** @@ -184,14 +184,14 @@ * @param dataJson {"code":"value"} */ -(void)onExpireCode:(id)handle dataJson:(NSString*)dataJson { - NSLog(@"ISudFSMMG:onExpireCode:Code过期"); + // NSLog(@"ISudFSMMG:onExpireCode:Code过期"); // 请求业务服务器刷新令牌 [Api getSudGameCode:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { if (code == 200) { NSString * gameCode = data.data[@"code"]; self.code = gameCode; [self.fsmAPP2MG updateCode:gameCode listener:^(int retCode, const NSString *retMsg, const NSString *dataJson) { - NSLog(@"ISudFSMMG:updateGameCode retCode=%@ retMsg=%@ dataJson=%@", @(retCode), retMsg, dataJson); + // NSLog(@"ISudFSMMG:updateGameCode retCode=%@ retMsg=%@ dataJson=%@", @(retCode), retMsg, dataJson); }]; // 回调结果 NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:@(0), @"ret_code", @"return form APP onExpireCode", @"ret_msg", nil]; @@ -275,7 +275,7 @@ [self.delegate getGameRsultsWithList:list]; } }else if ([state isEqualToString:MG_COMMON_PUBLIC_MESSAGE]) { - NSLog(@"ISudFSMMG:onGameStateChange:游戏->APP:公屏消息"); + // NSLog(@"ISudFSMMG:onGameStateChange:游戏->APP:公屏消息"); } else if ([state isEqualToString:MG_COMMON_KEY_WORD_TO_HIT]) { }else if ([state isEqualToString:MG_COMMON_SELF_CLICK_JOIN_BTN]) {//加入游戏按钮点击 @@ -285,9 +285,9 @@ seatIndex = [[dic objectForKey:@"seatIndex"] intValue]; } if (seatIndex == -1) { - NSLog(@"来自加入按钮%d",seatIndex); + // NSLog(@"来自加入按钮%d",seatIndex); }else { - NSLog(@"来自麦位+入%d",seatIndex); + // NSLog(@"来自麦位+入%d",seatIndex); } [self notifySelfInState:YES seatIndex:-1]; } else if([state isEqualToString:MG_COMMON_SELF_CLICK_START_BTN]) {//开始游戏按钮点击 @@ -297,7 +297,7 @@ [self handleSelfInExitEvent]; } else { /// 其他状态 - NSLog(@"ISudFSMMG:onGameStateChange:游戏->APP:state:%@",MG_COMMON_PUBLIC_MESSAGE); + // NSLog(@"ISudFSMMG:onGameStateChange:游戏->APP:state:%@",MG_COMMON_PUBLIC_MESSAGE); } } @@ -309,7 +309,7 @@ * @param dataJson 回调JSON */ -(void)onPlayerStateChange:(nullable id) handle userId:(NSString*) userId state:(NSString*) state dataJson:(NSString*) dataJson { - NSLog(@"ISudFSMMG:onPlayerStateChange:游戏->APP:游戏玩家状态变化:userId: %@ --state: %@ --dataJson: %@", userId, state, dataJson); + // NSLog(@"ISudFSMMG:onPlayerStateChange:游戏->APP:游戏玩家状态变化:userId: %@ --state: %@ --dataJson: %@", userId, state, dataJson); /// 状态解析 NSString *dataStr = @""; if ([state isEqualToString:MG_COMMON_PLAYER_IN]) { @@ -350,9 +350,9 @@ dataStr = YMLocalizedString(@"XPRoomLittleGameContainerView8"); [self handleState_MG_DG_SCORE_WithUserId:userId dataJson:dataJson]; }else { - NSLog(@"ISudFSMMG:onPlayerStateChange:未做解析状态:%@", MG_DG_SCORE); + // NSLog(@"ISudFSMMG:onPlayerStateChange:未做解析状态:%@", MG_DG_SCORE); } - NSLog(@"ISudFSMMG:onPlayerStateChange:dataStr:%@", dataStr); + // NSLog(@"ISudFSMMG:onPlayerStateChange:dataStr:%@", dataStr); /// 回调 NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:@(0), @"ret_code", @"return form APP onPlayerStateChange", @"ret_msg", nil]; [handle success:[SudCommon dictionaryToJson:dict]]; @@ -393,7 +393,7 @@ /// @param dataJson 需传递的json - (void)notifyStateChange:(NSString *) state dataJson:(NSString*) dataJson { [self.fsmAPP2MG notifyStateChange:state dataJson:dataJson listener:^(int retCode, const NSString *retMsg, const NSString *dataJson) { - NSLog(@"ISudFSMMG:notifyStateChange:retCode=%@ retMsg=%@ dataJson=%@", @(retCode), retMsg, dataJson); + // NSLog(@"ISudFSMMG:notifyStateChange:retCode=%@ retMsg=%@ dataJson=%@", @(retCode), retMsg, dataJson); if (retCode == 0 && [state isEqualToString:APP_COMMON_SELF_PLAYING]) {//开始游戏 //上报游戏开始 @@ -563,11 +563,11 @@ } - (void)handleState_MG_DG_SELECTING_WithUserId:(NSString *)userId dataJson:(NSString *)dataJson { - NSLog(@"handleState_MG_DG_SELECTING_WithUserId%@",dataJson); + // NSLog(@"handleState_MG_DG_SELECTING_WithUserId%@",dataJson); } - (void)handleState_MG_DG_PAINTING_WithUserId:(NSString *)userId dataJson:(NSString *)dataJson { - NSLog(@"handleState_MG_DG_PAINTING_WithUserId%@",dataJson); + // NSLog(@"handleState_MG_DG_PAINTING_WithUserId%@",dataJson); /// 设置麦位状态为作画中 NSDictionary * dic = [SudCommon turnStringToDictionary:dataJson]; bool isPainting = NO; @@ -578,18 +578,18 @@ - (void)handleState_MG_DG_ERRORANSWER_WithUserId:(NSString *)userId dataJson:(NSString *)dataJson { /// 错误答案 - NSLog(@"handleState_MG_DG_ERRORANSWER_WithUserId%@",dataJson); + // NSLog(@"handleState_MG_DG_ERRORANSWER_WithUserId%@",dataJson); } - (void)handleState_MG_DG_TOTALSCORE_WithUserId:(NSString *)userId dataJson:(NSString *)dataJson { /// 总积分 - NSLog(@"handleState_MG_DG_TOTALSCORE_WithUserId%@",dataJson); + // NSLog(@"handleState_MG_DG_TOTALSCORE_WithUserId%@",dataJson); } - (void)handleState_MG_DG_SCORE_WithUserId:(NSString *)userId dataJson:(NSString *)dataJson { /// 本次积分 - NSLog(@"handleState_MG_DG_SCORE_WithUserId%@",dataJson); + // NSLog(@"handleState_MG_DG_SCORE_WithUserId%@",dataJson); } /// 销毁MG diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/Model/GiftInfoModel.h b/YuMi/Modules/YMRoom/View/SendGiftView/Model/GiftInfoModel.h index 1cb6c014..33365bb9 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/Model/GiftInfoModel.h +++ b/YuMi/Modules/YMRoom/View/SendGiftView/Model/GiftInfoModel.h @@ -27,6 +27,7 @@ typedef NS_ENUM(NSUInteger, GiftType) { GiftType_Lucky24 = 18, //幸运24 GiftType_CP = 19, // CP GiftType_Custom = 20, // 定制 + GiftType_Brove = 21, // 超级礼物 }; //礼物类型 diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/Model/GiftInfoModel.m b/YuMi/Modules/YMRoom/View/SendGiftView/Model/GiftInfoModel.m index 7abe40c9..c7a097f0 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/Model/GiftInfoModel.m +++ b/YuMi/Modules/YMRoom/View/SendGiftView/Model/GiftInfoModel.m @@ -55,8 +55,10 @@ MJCodingImplementation return GiftType_Anchor; } else if ([self.key isEqualToString:@"customGift"]) { return GiftType_Custom; - } else if ([self.key isEqualToString:@"cpGift"]) { + } else if ([self.key isEqualToString:@"cpGift"]) { return GiftType_CP; + } else if ([self.key isEqualToString:@"broveGift"]) { + return GiftType_Brove; } return GiftType_Game; diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/View/Cell/XPGiftItemCollectionViewCell.m b/YuMi/Modules/YMRoom/View/SendGiftView/View/Cell/XPGiftItemCollectionViewCell.m index 16d573f4..35b3373e 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/View/Cell/XPGiftItemCollectionViewCell.m +++ b/YuMi/Modules/YMRoom/View/SendGiftView/View/Cell/XPGiftItemCollectionViewCell.m @@ -195,9 +195,6 @@ self.lockImageView.hidden = YES; } _superGiftView.hidden = YES; -// if (giftInfo.giftType == GiftType_super){ -// _superGiftView.hidden = NO; -// } } } diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/View/GiftComboFlagView.m b/YuMi/Modules/YMRoom/View/SendGiftView/View/GiftComboFlagView.m index e3a47a42..36d1dc90 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/View/GiftComboFlagView.m +++ b/YuMi/Modules/YMRoom/View/SendGiftView/View/GiftComboFlagView.m @@ -78,31 +78,6 @@ NSInteger total = model.comboCount * model.giftNum * model.receiveUserCount; NSString *countStr = [NSString stringWithFormat:@"x%ld", (long)total]; self.giftCountLabel.attributedText = [self generateAttributedStringForCount:countStr]; - -// if ([NSString isEmpty:self.cacheIcon]) { -// self.cacheIcon = model.gift.giftUrl; -// } else { -// if (![self.cacheIcon isEqualToString:model.gift.giftUrl]) { -// self.cacheIcon = model.gift.giftUrl; -// self.giftIcon.imageUrl = model.gift.giftUrl; -// } -// } -// if ([NSString isEmpty:self.cacheAvatar]) { -// self.cacheAvatar = model.avatar; -// self.giftGiverAvatar.imageUrl = model.avatar; -// } else { -// if (![self.cacheAvatar isEqualToString:model.avatar]) { -// self.cacheIcon = model.avatar; -// self.giftGiverAvatar.imageUrl = model.avatar; -// } -// } -// self.giftGiverNameLabel.text = model.nick; -// -// self.giftReceiverNameLabel.text = [self receiverNameForModel:model]; -// -// NSInteger total = model.comboCount * model.giftNum * model.receiveUserCount; -// NSString *countStr = [NSString stringWithFormat:@"x%ld", (long)total]; -// self.giftCountLabel.attributedText = [self generateAttributedStringForCount:countStr]; } - (void)updateCacheForProperty:(NSString *)cacheProperty newValue:(NSString *)newValue updateBlock:(void (^)(NSString *value))updateBlock { @@ -251,10 +226,10 @@ if (!_giftGiverAvatar) { NetImageConfig * config = [[NetImageConfig alloc]init]; config.placeHolder = [UIImageConstant defaultAvatarPlaceholder]; - config.imageType = ImageTypeCornerAvatar; +// config.imageType = ImageTypeCornerAvatar; _giftGiverAvatar = [[NetImageView alloc] initWithConfig:config]; _giftGiverAvatar.backgroundColor = [UIColor clearColor]; - _giftGiverAvatar.contentMode = UIViewContentModeScaleAspectFit; + _giftGiverAvatar.contentMode = UIViewContentModeScaleAspectFill; _giftGiverAvatar.layer.cornerRadius = kGetScaleWidth(15); _giftGiverAvatar.layer.masksToBounds = YES; _giftGiverAvatar.clipsToBounds = YES; diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/View/GiftComboView.m b/YuMi/Modules/YMRoom/View/SendGiftView/View/GiftComboView.m index 638175ef..73ca4f64 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/View/GiftComboView.m +++ b/YuMi/Modules/YMRoom/View/SendGiftView/View/GiftComboView.m @@ -16,7 +16,9 @@ @property (nonatomic, strong) UIView *container; @property (nonatomic, strong) UILabel *comboCountLabel; +@property (nonatomic, assign) double comboGoldNum; @property(nonatomic, strong) UILabel *comboGoldLabel; +@property (nonatomic, strong) UILabel *lastWinningLabel; @property (nonatomic, strong) SVGAImageView *playImageView; @property (nonatomic, strong) SVGAVideoEntity *svgaVideoEntity; @property (nonatomic, strong) CountdownRingView *countdownRingView; @@ -26,7 +28,7 @@ @property(nonatomic, strong) UIImpactFeedbackGenerator *feedbackGenerator; -@property (nonatomic, strong) dispatch_queue_t animationQueue; // 串行队列,确保线程安全 +//@property (nonatomic, strong) dispatch_queue_t animationQueue; // 串行队列,确保线程安全 @end @@ -38,6 +40,9 @@ [self.countdownRingView stopCountdown]; [self.countdownRingView removeFromSuperview]; self.countdownRingView = nil; + [self.playImageView stopAnimation]; + [self.playImageView clear]; + self.playImageView.delegate = nil; [[NSNotificationCenter defaultCenter] removeObserver:self]; } @@ -64,19 +69,24 @@ } - (void)setupSVGAParser { + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ SVGAParser *parser = [SVGAParser new]; - @kWeakify(self); - [parser parseWithNamed:@"Combo_Boom" - inBundle:nil - completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) { - @kStrongify(self); - self.svgaVideoEntity = videoItem; - self.playImageView.loops = 1; - self.playImageView.clearsAfterStop = NO; - self.playImageView.videoItem = videoItem; - } failureBlock:^(NSError * _Nullable error) { - NSLog(@"%@", error); - }]; + @kWeakify(self); + [parser parseWithNamed:@"Combo_Boom" + inBundle:nil + completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) { + @kStrongify(self); + dispatch_async(dispatch_get_main_queue(), ^{ + self.svgaVideoEntity = videoItem; + self.svgaVideoEntity = videoItem; + self.playImageView.loops = 1; + self.playImageView.clearsAfterStop = NO; + self.playImageView.videoItem = videoItem; + }); + } failureBlock:^(NSError * _Nullable error) { +// NSLog(@"%@", error); + }]; + }); } - (void)setupNotification { @@ -194,14 +204,14 @@ static BOOL isHandlingTap = NO; if (isHandlingTap) { - NSLog(@"点击间隔过短,忽略此次点击"); +// NSLog(@"点击间隔过短,忽略此次点击"); return; } isHandlingTap = YES; // 处理点击事件 - NSLog(@"有效点击处理"); +// NSLog(@"有效点击处理"); @kWeakify(self); // 延迟重置标志位 dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ @@ -229,6 +239,7 @@ #pragma mark - - (void)setupCurrentGold:(double)gold { + self.comboGoldNum = gold; self.comboGoldLabel.text = @(gold).stringValue; } @@ -258,15 +269,16 @@ - (void)updateCurrentGold:(double)gold giftPrice:(double)price isFromWinning:(BOOL)isFromWinning { NSString *goldString = isFromWinning ? [NSString stringWithFormat:@"+ %@", @(gold)] : @(-price).stringValue; if (isFromWinning) { - [self insertToGoldQueue:goldString]; - [self processNextUpdateGold]; + double updateGold = self.comboGoldNum + gold; + [self setupCurrentGold:updateGold]; } else { - [self addToGoldQueue:goldString]; - self.comboGoldLabel.text = @(gold).stringValue; - - if (!self.isAnimatingUpdateGold) { - [self processNextUpdateGold]; - } +// double updateGold = self.comboGoldNum + gold; + [self setupCurrentGold:gold]; +// self.comboGoldLabel.text = @(gold).stringValue; + } + [self insertToGoldQueue:goldString]; + if (!self.isAnimatingUpdateGold) { + [self processNextUpdateGold]; } } @@ -306,12 +318,21 @@ label.transform = CGAffineTransformTranslate(CGAffineTransformIdentity, 0, offset); label.alpha = 1; } completion:^(BOOL finished) { - [UIView animateWithDuration:0.2 delay:isForWin ? 1.5 : 0.4 options:UIViewAnimationOptionCurveLinear animations:^{ -// label.transform = CGAffineTransformIdentity; - label.alpha = 0; - } completion:^(BOOL finished) { + if (isForWin) { + [UIView animateWithDuration:0.2 delay:0.2 options:UIViewAnimationOptionCurveEaseInOut animations:^{ + label.transform = CGAffineTransformTranslate(CGAffineTransformIdentity, 0, offset*2); + label.alpha = 0; + } completion:^(BOOL finished) { + [label removeFromSuperview]; + }]; + } else { + [UIView animateWithDuration:0.2 delay:0.3 options:UIViewAnimationOptionCurveLinear animations:^{ +// label.transform = CGAffineTransformIdentity; + label.alpha = 0; + } completion:^(BOOL finished) { - }]; + }]; + } self.isAnimatingUpdateGold = NO; [self processNextUpdateGold]; }]; diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/View/PIGiftInfoSegmentedView.m b/YuMi/Modules/YMRoom/View/SendGiftView/View/PIGiftInfoSegmentedView.m index 01391d2c..7233196f 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/View/PIGiftInfoSegmentedView.m +++ b/YuMi/Modules/YMRoom/View/SendGiftView/View/PIGiftInfoSegmentedView.m @@ -54,6 +54,8 @@ /// 定制 @property (nonatomic,strong)XPGiftInfoView *customVC; +@property (nonatomic,strong)XPGiftInfoView *broveVC; + @property (nonatomic, strong) UIActivityIndicatorView *loadingView; @end @@ -211,7 +213,10 @@ return self.customVC; } break; - + case GiftType_Brove: { + return self.broveVC; + } + break; default: return self.normalVC; break; @@ -240,6 +245,8 @@ return i; } else if (tabGiftType == GiftType_Custom && self.segmentType == GiftSegmentType_Custom) { return i; + } else if (tabGiftType == GiftType_Brove && self.segmentType == GiftSegmentType_Brove) { + return i; } } @@ -542,6 +549,14 @@ } return _cpVC; } +-(XPGiftInfoView *)broveVC{ + if(!_broveVC){ + _broveVC = [[XPGiftInfoView alloc]init]; + _broveVC.delegate = self; + _broveVC.segmentType = GiftSegmentType_Brove; + } + return _broveVC; +} -(XPGiftInfoView *)customVC{ if(!_customVC){ _customVC = [[XPGiftInfoView alloc]init]; diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/View/XPGiftBarView.m b/YuMi/Modules/YMRoom/View/SendGiftView/View/XPGiftBarView.m index e8156c32..517ee4bb 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/View/XPGiftBarView.m +++ b/YuMi/Modules/YMRoom/View/SendGiftView/View/XPGiftBarView.m @@ -339,7 +339,7 @@ - (void)setWalletInfoModel:(WalletInfoModel *)walletInfoModel { _walletInfoModel = walletInfoModel; if (_walletInfoModel) { - NSString * diamonds = _walletInfoModel.diamonds; + NSString * diamonds = [NSString stringByRemovingRedundantZeros:_walletInfoModel.diamonds]; UIColor * normaleColor = [DJDKMIMOMColor giftBalanceColor]; UIColor * highlightColor =[DJDKMIMOMColor giftCountTitleColor]; if (_usingplaceType == SendGiftType_User) { diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/View/XPGiftInfoView.h b/YuMi/Modules/YMRoom/View/SendGiftView/View/XPGiftInfoView.h index 20658742..ce14ea93 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/View/XPGiftInfoView.h +++ b/YuMi/Modules/YMRoom/View/SendGiftView/View/XPGiftInfoView.h @@ -25,6 +25,7 @@ typedef NS_ENUM(NSInteger, GiftSegmentType) { GiftSegmentType_Country,///国家礼物 GiftSegmentType_CP,///cp礼物 GiftSegmentType_Custom,///cp礼物 + GiftSegmentType_Brove,///超级礼物 }; diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/View/XPGiftInfoView.m b/YuMi/Modules/YMRoom/View/SendGiftView/View/XPGiftInfoView.m index 03848075..efdd91e9 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/View/XPGiftInfoView.m +++ b/YuMi/Modules/YMRoom/View/SendGiftView/View/XPGiftInfoView.m @@ -236,14 +236,15 @@ #pragma mark - Getters And Setters - (void)setNormalOriginArray:(NSArray *)normalOriginArray { _normalOriginArray = normalOriginArray; - if(_normalOriginArray.count > 0 && self.lastSelectGift == nil){ + if(_normalOriginArray.count > 0 && (self.lastSelectGift == nil || ![normalOriginArray containsObject:self.lastSelectGift])){ GiftInfoModel *giftModel = _normalOriginArray.firstObject; [self dealSelectGift:giftModel]; - if (giftModel.giftType == GiftType_super){ +// if (giftModel.giftType == GiftType_super){ if (self.delegate && [self.delegate respondsToSelector:@selector(xPGiftInfoView:didClickItem:type:)]) { [self.delegate xPGiftInfoView:self didClickItem:giftModel type:self.segmentType]; } - } +// } else if (giftModel.giftType == GiftType_Brove) { +// } } self.datasource = _normalOriginArray.mutableCopy; NSInteger currentPage = 0; diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/View/XPSendGiftView.m b/YuMi/Modules/YMRoom/View/SendGiftView/View/XPSendGiftView.m index a2b92db8..7b4defd6 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/View/XPSendGiftView.m +++ b/YuMi/Modules/YMRoom/View/SendGiftView/View/XPSendGiftView.m @@ -49,6 +49,8 @@ #import "GiftComboManager.h" +static NSString * const kTargetUidKey = @"targetUid"; + UIKIT_EXTERN NSString * const kFreeGiftCountdownNotification; UIKIT_EXTERN NSString * kShowFirstRechargeView; @@ -104,6 +106,8 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; @property (nonatomic, strong) GiftComboView *comboView; +@property (strong, nonatomic) NSOperationQueue *messageQueue; + @end @implementation XPSendGiftView @@ -176,6 +180,7 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; [self.comboView stopTimer]; [self.comboView removeFromSuperview]; self.comboView = nil; + [self.presenter getUserWalletInfo]; } break; case ComboAction_Combo_Count_Update: { @@ -206,6 +211,13 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; }]; } +- (void)setupMessageQueue { + if (!_messageQueue) { + _messageQueue = [[NSOperationQueue alloc] init]; + _messageQueue.maxConcurrentOperationCount = 1; // 串行队列 + } +} + - (GiftComboView *)comboView { if (!_comboView) { _comboView = [[GiftComboView alloc] init]; @@ -354,23 +366,22 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; oringinDic:(NSMutableDictionary *)data isToOne:(BOOL)isToOne { // 需要显示嵌入内容的动画,都发 second = 31,如果是送多人,则遍历发送 + [self setupMessageQueue]; @kWeakify(self); NSArray *targetUsers = [data objectForKey:@"targetUsers"]; - __block NSTimeInterval delay = 0.0; for (NSDictionary *obj in targetUsers) { - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delay * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + AttachmentModel *attachment = [[AttachmentModel alloc] init]; + attachment.first = CustomMessageType_Gift; + attachment.second = Custom_Message_Sub_Gift_Send; + [data setObject:[[obj objectForKey:@"uid"] stringValue] forKey:kTargetUidKey]; + [data setObject:[obj objectForKey:@"nick"] forKey:@"targetNick"]; + [data setObject:[obj objectForKey:@"avatar"] forKey:@"targetAvatar"]; + attachment.data = data; + NSBlockOperation *operation = [NSBlockOperation blockOperationWithBlock:^{ @kStrongify(self); - AttachmentModel *attachment = [[AttachmentModel alloc] init]; - attachment.first = CustomMessageType_Gift; - attachment.second = Custom_Message_Sub_Gift_Send; - [data setObject:[[obj objectForKey:@"uid"] stringValue] forKey:@"targetUid"]; - [data setObject:[obj objectForKey:@"nick"] forKey:@"targetNick"]; - [data setObject:[obj objectForKey:@"avatar"] forKey:@"targetAvatar"]; -// [data removeObjectForKey:@"targetUsers"]; - attachment.data = data; [self sendCustomMessage:attachment]; - }); - delay += 0.1; + }]; + [self.messageQueue addOperation:operation]; } } @@ -379,7 +390,10 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; attachment.first = CustomMessageType_Gift; attachment.second = Custom_Message_Sub_Gift_Send; NSDictionary *targetUsers = ((NSArray *)[data objectForKey:@"targetUsers"]).firstObject; - [data setObject:[targetUsers valueForKeyPath:@"uid"] forKey:@"targetUid"]; + if (targetUsers.count == 0) { + return; + } + [data setObject:[targetUsers valueForKeyPath:@"uid"] forKey:kTargetUidKey]; [data setObject:[targetUsers valueForKeyPath:@"nick"] forKey:@"targetNick"]; [data setObject:[targetUsers valueForKeyPath:@"avatar"] forKey:@"targetAvatar"]; attachment.data = data; @@ -395,15 +409,6 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; [self sendCustomMessage:attachment]; } -//- (void)sendGiftToAllMessage:(NSMutableDictionary *)data { -// AttachmentModel * attachment = [[AttachmentModel alloc] init]; -// attachment.first = CustomMessageType_AllMicroSend; -// attachment.second = Custom_Message_Sub_AllMicroSend; -// [data setObject:[data valueForKeyPath:@"targetUsers.uid"] forKey:@"targetUids"]; -// attachment.data = data; -// [self sendCustomMessage:attachment]; -//} - - (void)sendLuckyBagGifts:(GiftReceiveInfoModel *)receiveModel data:(NSMutableDictionary *)data firstType:(NSUInteger)first @@ -422,7 +427,7 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; [tempData setObject:idx == 0 ? @(YES):@(NO) forKey:@"isShowAnimation"]; [tempData setObject:obj forKey:@"luckyGiftList"]; [tempData setObject:receiveModel.gift.giftName forKey:@"giftName"]; - [tempData setObject:[obj valueForKeyPath:@"user.uid"] forKey:@"targetUid"]; + [tempData setObject:[obj valueForKeyPath:@"user.uid"] forKey:kTargetUidKey]; if (isToOne) { [tempData setObject:[obj valueForKeyPath:@"user.nick"] forKey:@"targetNick"]; } @@ -460,45 +465,52 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; //构造会话 NIMSession *session = [NIMSession session:sessionID type:sessionType]; [[NIMSDK sharedSDK].chatManager sendMessage:message toSession:session completion:^(NSError * _Nullable error) { - if (error) { - NSLog(@"%@",error); - } +// if (error) { +// NSLog(@"%@",error); +// } }]; } - (id)removeNSNullValuesAndEmptyStringsRecursively:(id)object { + // 处理字典 if ([object isKindOfClass:[NSDictionary class]]) { - NSMutableDictionary *cleanedDictionary = [NSMutableDictionary dictionary]; - [(NSDictionary *)object enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, id _Nonnull obj, BOOL * _Nonnull stop) { - // 检查是否需要移除当前键 - if ([key isKindOfClass:[NSString class]] && - ([key isEqualToString:@"userPurse"] || [key isEqualToString:@"hasSvga"] || [key isEqualToString:@"currentTime"])) { - return; // 跳过 key 为 "userPurse" 或 "hasSvga" 或 "currentTime" 的键值对 - } - - // 递归清理子对象 - id cleanedValue = [self removeNSNullValuesAndEmptyStringsRecursively:obj]; - if (cleanedValue) { - cleanedDictionary[key] = cleanedValue; - } - }]; - return [cleanedDictionary copy]; - } else if ([object isKindOfClass:[NSArray class]]) { - NSMutableArray *cleanedArray = [NSMutableArray array]; - for (id obj in (NSArray *)object) { - id cleanedValue = [self removeNSNullValuesAndEmptyStringsRecursively:obj]; - if (cleanedValue) { - [cleanedArray addObject:cleanedValue]; - } + NSMutableDictionary *cleanedDictionary = [NSMutableDictionary dictionary]; + [(NSDictionary *)object enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { + // 检查是否需要跳过特定键 + if ([key isKindOfClass:[NSString class]] && + ([key isEqualToString:@"userPurse"] || [key isEqualToString:@"hasSvga"])) { + return; // 跳过这些键 + } + + // 递归清理子对象 + id cleanedValue = [self removeNSNullValuesAndEmptyStringsRecursively:obj]; + if (cleanedValue) { + cleanedDictionary[key] = cleanedValue; + } + }]; + return [cleanedDictionary copy]; + } + + // 处理数组 + else if ([object isKindOfClass:[NSArray class]]) { + NSMutableArray *cleanedArray = [NSMutableArray array]; + for (id obj in (NSArray *)object) { + id cleanedValue = [self removeNSNullValuesAndEmptyStringsRecursively:obj]; + if (cleanedValue) { + [cleanedArray addObject:cleanedValue]; } - return [cleanedArray copy]; - } else if ([object isKindOfClass:[NSNull class]] || ([object isKindOfClass:[NSString class]] && [(NSString *)object length] == 0)) { - // 移除 NSNull 和空字符串 - return nil; - } else { - // 保留其他类型 - return object; } + return [cleanedArray copy]; + } + + // 检查是否是 NSNull 或空字符串 + else if ([object isKindOfClass:[NSNull class]] || + ([object isKindOfClass:[NSString class]] && [(NSString *)object length] == 0)) { + return nil; + } + + // 保留其他类型 + return object; } #pragma mark - Deal Send Gift Data @@ -575,7 +587,10 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; return; } - if (giftInfo.giftType != GiftType_Game && giftInfo.giftType != GiftType_super && giftInfo.giftType != GiftType_Lucky24) { + if (giftInfo.giftType != GiftType_Game && + giftInfo.giftType != GiftType_super && + giftInfo.giftType != GiftType_Lucky24 && + giftInfo.giftType != GiftType_Brove) { [[GiftComboManager sharedManager] enableToCombo:NO]; return; } @@ -983,10 +998,10 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; self.giftBarView.walletInfoModel = receiveInfo.userPurse; } - @kWeakify(self); - dispatch_time_t delayTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)); - dispatch_after(delayTime, dispatch_get_main_queue(), ^{ - @kStrongify(self); +// @kWeakify(self); +// dispatch_time_t delayTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)); +// dispatch_after(delayTime, dispatch_get_main_queue(), ^{ +// @kStrongify(self); if (self) { if ([GiftComboManager sharedManager].enableCombo) { [[GiftComboManager sharedManager] resetCombo]; @@ -1001,10 +1016,10 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; [self sendCustomMessage:receiveInfo oringinDic:originDic]; } } - }); +// }); ///发送涂鸦礼物消息 - [self sendGraffitiGiftMessage]; +// [self sendGraffitiGiftMessage]; } ///送礼物失败 diff --git a/YuMi/Modules/YMRoom/View/StageView/MicroView/MicroView.m b/YuMi/Modules/YMRoom/View/StageView/MicroView/MicroView.m index fc4b50f9..061e8eef 100644 --- a/YuMi/Modules/YMRoom/View/StageView/MicroView/MicroView.m +++ b/YuMi/Modules/YMRoom/View/StageView/MicroView/MicroView.m @@ -7,6 +7,7 @@ #import "MicroView.h" ///Third +#import #import #import ///View @@ -71,6 +72,9 @@ @property (nonatomic, strong) SpriteSheetImageManager *manager; ///当前的麦序 @property (nonatomic,strong) NSMutableDictionary *micQueue; + +@property(nonatomic, strong) UILabel *goldLabel; + @end @@ -117,6 +121,8 @@ [self addSubview:self.faceImageView]; [self addSubview:self.groupTypeButton]; + [self addSubview:self.goldLabel]; + [self addSubview:self.stackView]; [self.stackView addArrangedSubview:self.nickLabel]; @@ -191,6 +197,12 @@ make.width.mas_equalTo(28); make.height.mas_equalTo(14); }]; + + [self.goldLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.mas_equalTo(self); + make.bottom.mas_equalTo(self.avatarImageView); + make.height.mas_equalTo(18); + }]; } - (UIView *)getAvatarView { @@ -427,7 +439,7 @@ CGSize scaledToSize = CGSizeMake(self.frame.size.width, self.frame.size.width); if (scaledToSize.width > 0 && scaledToSize.height > 0 ) { UIGraphicsBeginImageContextWithOptions(scaledToSize, false, 0.0); - // 缩小 “1” 点儿,防止默认背景的边缘被裁减。 + // 缩小 "1" 点儿,防止默认背景的边缘被裁减。 [image drawInRect:CGRectMake(1, 1, scaledToSize.width - 2, scaledToSize.height - 2)]; UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); @@ -537,6 +549,11 @@ } } } + +- (void)receiveGold:(NSString *)gold { + [self showGoldAnimation:gold]; +} + - (void)configGiftValue:(long long)giftValue { self.giftValueView.giftValue = giftValue; } @@ -764,6 +781,123 @@ return _positionCharmImgView; } +- (UILabel *)goldLabel { + if (!_goldLabel) { + _goldLabel = [UILabel labelInitWithText:@"" font:kFontMedium(11) textColor:[UIColor blackColor]]; + _goldLabel.textAlignment = NSTextAlignmentCenter; + _goldLabel.backgroundColor = UIColorFromRGB(0xffc506); + [_goldLabel setCornerRadius:9 + corners:kCALayerMaxXMaxYCorner|kCALayerMaxXMinYCorner|kCALayerMinXMaxYCorner|kCALayerMinXMinYCorner + borderWidth:1 + borderColor:[UIColor whiteColor]]; + } + return _goldLabel; +} +- (void)showGoldAnimation:(NSString *)goldValue { + // 创建新的 UILabel + if ([NSString isEmpty:goldValue]) { + return; + } + NSString *displayValue = [NSString stringByRemovingRedundantZeros:goldValue]; + UILabel *newGoldLabel = [UILabel labelInitWithText:[NSString stringWithFormat:@"+%@ ", displayValue] font:kFontMedium(11) textColor:[UIColor blackColor]]; + newGoldLabel.textAlignment = NSTextAlignmentCenter; + newGoldLabel.backgroundColor = UIColorFromRGB(0xffc506); + [newGoldLabel setCornerRadius:9 + corners:kCALayerMaxXMaxYCorner|kCALayerMaxXMinYCorner|kCALayerMinXMaxYCorner|kCALayerMinXMinYCorner + borderWidth:1 + borderColor:[UIColor whiteColor]]; + [self addSubview:newGoldLabel]; + [newGoldLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.mas_equalTo(self); + make.bottom.mas_equalTo(self.avatarImageView); + make.height.mas_equalTo(18); + }]; + + // 设置初始状态 + newGoldLabel.alpha = 0; + newGoldLabel.transform = CGAffineTransformMakeScale(0.8, 0.8); + newGoldLabel.hidden = NO; + + // 使用 POP 框架实现动画 + POPBasicAnimation *scaleInAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewScaleXY]; + scaleInAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(1.4, 1.4)]; + scaleInAnimation.duration = 0.3; + scaleInAnimation.completionBlock = ^(POPAnimation *anim, BOOL finished) { + if (finished) { + POPBasicAnimation *scaleOutAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewScaleXY]; + scaleOutAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(1.0, 1.0)]; + scaleOutAnimation.duration = 0.2; + scaleOutAnimation.completionBlock = ^(POPAnimation *anim, BOOL finished) { + if (finished) { + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + POPBasicAnimation *moveUpAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewCenter]; + CGPoint newCenter = CGPointMake(newGoldLabel.center.x, newGoldLabel.center.y - 40); + moveUpAnimation.toValue = [NSValue valueWithCGPoint:newCenter]; + moveUpAnimation.duration = 0.2; + moveUpAnimation.completionBlock = ^(POPAnimation *anim, BOOL finished) { + if (finished) { + POPBasicAnimation *fadeOutAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewAlpha]; + fadeOutAnimation.toValue = @(0); + fadeOutAnimation.duration = 0.2; + fadeOutAnimation.completionBlock = ^(POPAnimation *anim, BOOL finished) { + if (finished) { + newGoldLabel.hidden = YES; + [newGoldLabel removeFromSuperview]; + } + }; + [newGoldLabel pop_addAnimation:fadeOutAnimation forKey:@"fadeOut"]; + } + }; + [newGoldLabel pop_addAnimation:moveUpAnimation forKey:@"moveUp"]; + }); + } + }; + [newGoldLabel pop_addAnimation:scaleOutAnimation forKey:@"scaleOut"]; + } + }; + POPBasicAnimation *fadeInAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewAlpha]; + fadeInAnimation.toValue = @(1); + fadeInAnimation.duration = 0.3; + [newGoldLabel pop_addAnimation:fadeInAnimation forKey:@"fadeIn"]; + [newGoldLabel pop_addAnimation:scaleInAnimation forKey:@"scaleIn"]; +} + + +- (void)__showGoldAnimation:(NSInteger)goldValue { + // 设置文本内容 + self.goldLabel.text = [NSString stringWithFormat:@"+%ld", (long)goldValue]; + + // 设置初始状态 + self.goldLabel.alpha = 0; + self.goldLabel.transform = CGAffineTransformMakeScale(0.8, 0.8); + self.goldLabel.hidden = NO; + + // 执行动画 + [UIView animateWithDuration:0.3 animations:^{ + self.goldLabel.alpha = 1; + self.goldLabel.transform = CGAffineTransformMakeScale(1.2, 1.2); + } completion:^(BOOL finished) { + if (finished) { + // 恢复原始大小 + [UIView animateWithDuration:0.2 animations:^{ + self.goldLabel.transform = CGAffineTransformIdentity; + } completion:^(BOOL finished) { + if (finished) { + // 延迟1秒后隐藏 + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + [UIView animateWithDuration:0.2 animations:^{ + self.goldLabel.alpha = 0; + } completion:^(BOOL finished) { + if (finished) { + self.goldLabel.hidden = YES; + } + }]; + }); + } + }]; + } + }]; +} @end diff --git a/YuMi/Modules/YMRoom/View/StageView/MicroView/MicroViewProtocol.h b/YuMi/Modules/YMRoom/View/StageView/MicroView/MicroViewProtocol.h index a696e41b..e52f8f09 100644 --- a/YuMi/Modules/YMRoom/View/StageView/MicroView/MicroViewProtocol.h +++ b/YuMi/Modules/YMRoom/View/StageView/MicroView/MicroViewProtocol.h @@ -92,6 +92,8 @@ NS_ASSUME_NONNULL_BEGIN * 获取当前的麦序 */ - (NSMutableDictionary*)getMicroQueue; + +- (void)receiveGold:(NSString *)gold; @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/StageView/SocialStageView.m b/YuMi/Modules/YMRoom/View/StageView/SocialStageView.m index 6cff0ed3..586a3510 100644 --- a/YuMi/Modules/YMRoom/View/StageView/SocialStageView.m +++ b/YuMi/Modules/YMRoom/View/StageView/SocialStageView.m @@ -12,7 +12,8 @@ #import "RoomInfoModel.h" #import "ClientConfig.h" //房主距离顶部间距 -#define ownerTopMargin 100//35 +#define ownerTopMargin 100 +#define ownerTopMargin_little_screen 35 // 房主头像宽 58 + 光圈 5 #define ownerWidth (45 + 5) * kScreenScale // 昵称高12,距离头像间距 10 @@ -56,43 +57,51 @@ * * 昵称高12,距离头像间距 6 */ - (CGRect)rectForViewAtIndex:(NSInteger)index { + CGFloat top = iPhoneXSeries ? ownerTopMargin : ownerTopMargin_little_screen; + CGFloat f_top = iPhoneXSeries ? firstRowTop : ownerHeight + marginV1 + ownerTopMargin_little_screen; + CGFloat s_top = iPhoneXSeries ? secondRowTop : mcHeight + marginV2 + f_top; if (index == 0) { - return CGRectMake(KScreenWidth / 2 - ownerWidth / 2, ownerTopMargin, ownerWidth, ownerHeight); + return CGRectMake(KScreenWidth / 2 - ownerWidth / 2, top, ownerWidth, ownerHeight); } if (index >= 1 && index <= 4) { - return CGRectMake(paddingH + (mcWidth + marginH) * (index - 1), firstRowTop, mcWidth, mcHeight); + return CGRectMake(paddingH + (mcWidth + marginH) * (index - 1), f_top, mcWidth, mcHeight); } if (index >= 5 && index < 9) { - return CGRectMake(paddingH + (mcWidth + marginH) * (index - 4 - 1), secondRowTop, mcWidth, mcHeight); + return CGRectMake(paddingH + (mcWidth + marginH) * (index - 4 - 1), s_top, mcWidth, mcHeight); } return [super rectForViewAtIndex:index]; } - (CGFloat)hightForStageView { - return ownerTopMargin + ownerHeight + marginV1 + mcHeight + marginV2 + mcHeight + marginV2; + CGFloat top = iPhoneXSeries ? ownerTopMargin : ownerTopMargin_little_screen; + return top + ownerHeight + marginV1 + mcHeight + marginV2 + mcHeight + marginV2; } - (CGPoint)animationPointAtStageViewByUid:(NSString *)uid { + CGFloat top = iPhoneXSeries ? ownerTopMargin : ownerTopMargin_little_screen; + CGFloat f_top = iPhoneXSeries ? firstRowTop : ownerHeight + marginV1 + ownerTopMargin_little_screen; + CGFloat s_top = iPhoneXSeries ? secondRowTop : mcHeight + marginV2 + f_top; + NSInteger index = [self getIndexByUid:uid]; CGPoint point = CGPointZero; if (index == -1 && self.hostDelegate.getRoomInfo.leaveMode && self.hostDelegate.getRoomInfo.uid == uid.integerValue) { - point = CGPointMake(KScreenWidth / 2, ownerWidth / 2 - 10 + ownerTopMargin); + point = CGPointMake(KScreenWidth / 2, ownerWidth / 2 - 10 + top); } if (index == 0) { - point = CGPointMake(KScreenWidth / 2, ownerWidth / 2 - 10 + ownerTopMargin); + point = CGPointMake(KScreenWidth / 2, ownerWidth / 2 - 10 + top); } if (index >= 1 && index <= 4) { - point = CGPointMake(paddingH + (mcWidth + marginH) * (index - 1) + mcWidth / 2, firstRowTop + mcWidth / 2- 10); + point = CGPointMake(paddingH + (mcWidth + marginH) * (index - 1) + mcWidth / 2, f_top + mcWidth / 2- 10); } if (index >= 5 && index <= 9) { - point = CGPointMake(paddingH + (mcWidth + marginH) * (index - 4 - 1) + mcWidth / 2, secondRowTop + mcWidth / 2 - 10); + point = CGPointMake(paddingH + (mcWidth + marginH) * (index - 4 - 1) + mcWidth / 2, s_top + mcWidth / 2 - 10); } point = [self convertPoint:point toView:nil]; return point; diff --git a/YuMi/Modules/YMRoom/View/StageView/StageView.m b/YuMi/Modules/YMRoom/View/StageView/StageView.m index 2dd1d304..d2f352c6 100644 --- a/YuMi/Modules/YMRoom/View/StageView/StageView.m +++ b/YuMi/Modules/YMRoom/View/StageView/StageView.m @@ -654,7 +654,9 @@ NIMChatroomQueueRemoveRequest *request = [[NIMChatroomQueueRemoveRequest alloc]init]; request.key = @(sequence.microState.position).stringValue; request.roomId = roomId; - [[NIMSDK sharedSDK].chatroomManager removeChatroomQueueObject:request completion:^(NSError * _Nullable error, NSDictionary * _Nullable element) { + [[NIMSDK sharedSDK].chatroomManager + removeChatroomQueueObject:request + completion:^(NSError * _Nullable error, NSDictionary * _Nullable element) { }]; } @@ -665,103 +667,132 @@ NIMCustomObject *obj = (NIMCustomObject *)message.messageObject; if (obj.attachment != nil && [obj.attachment isKindOfClass:[AttachmentModel class]]) { AttachmentModel *attachment = (AttachmentModel *)obj.attachment; - if(attachment.first == CustomMessageType_Queue && attachment.second == Custom_Message_Sub_Queue_Invite) { - NSDictionary *dic = attachment.data; - MicroInviteExtModel *inviteModel = [MicroInviteExtModel modelWithDictionary:dic]; - if (inviteModel.uid.integerValue == self.hostDelegate.getUserInfo.uid) { - NSString *position = inviteModel.micPosition; - - MicroQueueModel *micro = [self.micQueue objectForKey:position]; - if (!micro || micro.userInfo) return; // 当前麦位有人,什么都不做。 - - RoomInfoModel* roomInfo = self.hostDelegate.getRoomInfo; - NSString* roomId = [NSString stringWithFormat:@"%ld", roomInfo.roomId]; - UserInfoModel* userInfo = self.hostDelegate.getUserInfo; - - NIMChatroomQueueUpdateRequest *request = [[NIMChatroomQueueUpdateRequest alloc]init]; - request.key = position; - request.value = [[self userInfoToQueueExt:userInfo] toJSONString]; - request.roomId = roomId; - request.transient = YES; - - [[NIMSDK sharedSDK].chatroomManager updateChatroomQueueObject:request completion:^(NSError * _Nullable error) { - if (error) return; - [RtcManager instance].localMuted = YES; - TTAlertConfig *config = [[TTAlertConfig alloc] init]; - config.title = YMLocalizedString(@"StageView0"); - config.message = YMLocalizedString(@"XPMiniRoomView3"); - [TTPopup alertWithConfig:config confirmHandler:^{ - - } cancelHandler:^{ - - }]; - }]; - } - } else if(attachment.first == CustomMessageType_Room_GiftValue && attachment.second == Custom_Message_Sub_Room_GiftValue_Sync) { - [self giftValueUpdate:attachment.data]; - } else if(attachment.first == CustomMessageType_Gift && (attachment.second == Custom_Message_Sub_Gift_Send || attachment.second == Custom_Message_Sub_Gift_LuckySend || attachment.second == Custom_Message_Sub_Gift_ChannelNotify)) { - [self giftValueUpdate:attachment.data]; - } else if(attachment.first == CustomMessageType_AllMicroSend && (attachment.second == Custom_Message_Sub_AllMicroSend || attachment.second == Custom_Message_Sub_AllBatchSend || attachment.second == Custom_Message_Sub_AllMicroLuckySend || attachment.second == Custom_Message_Sub_AllBatchMicroLuckySend)) { - [self giftValueUpdate:attachment.data]; - } else if (attachment.first == CustomMessageType_Face && attachment.second == Custom_Message_Sub_Face_Send) { - [self showUserFace:attachment.data]; - }else if (attachment.first == CustomMessageType_Room_PK && attachment.second == Custom_Message_Sub_Room_PK_Manager_Up_Mic) { - NSDictionary * dic = attachment.data; - ///更新麦序 - NSString * uid = [AccountInfoStorage instance].getUid; - if (dic.allKeys.count > 0 && [dic.allKeys containsObject:uid] && [dic objectForKey:uid]) { - RoomPKChooseUserModel * pkUserInfo = [RoomPKChooseUserModel modelWithDictionary:[dic objectForKey:uid]]; - NSString * position = [NSString stringWithFormat:@"%d", pkUserInfo.position]; - NSString* roomId = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.roomId]; - MicroQueueModel *micro = [self.micQueue objectForKey:position]; - if (micro && micro.userInfo && micro.userInfo.uid != pkUserInfo.uid.integerValue){ return; } - UserInfoModel * userInfo = self.hostDelegate.getUserInfo; - userInfo.groupType = pkUserInfo.groupType; - NIMChatroomQueueUpdateRequest *request = [[NIMChatroomQueueUpdateRequest alloc]init]; - request.key = position; - NSMutableDictionary *curUserInfo = [[NSMutableDictionary alloc]initWithDictionary:[self userInfoToQueueExt:userInfo]]; - [curUserInfo setValue:@(YES) forKey:@"isNoProhibitMic"]; - request.value = [curUserInfo toJSONString]; - request.roomId = roomId; - request.transient = YES; - [[NIMSDK sharedSDK].chatroomManager updateChatroomQueueObject:request completion:^(NSError * _Nullable error) { - if (error) return; - }]; - } - } else if (attachment.first == CustomMessageType_Room_PK && attachment.second == Custom_Message_Sub_Room_PK_Mode_Close) { - NSDictionary * dic = attachment.data; - ///更新麦序 - NSString * uid = [AccountInfoStorage instance].getUid; - if (dic.allKeys.count > 0 && [[[dic objectForKey:@"operatorUid"] stringValue] isEqualToString:uid]) { - NSInteger micIndex = -1; - MicroQueueModel *micro; - for (MicroQueueModel *model in self.micQueue.allValues) { - if (model.userInfo) { - if (model.userInfo.uid == uid.integerValue) { - micro = model; - micIndex = [[[self __keysForValue:model inDictionary:self.micQueue] xpSafeObjectAtIndex:0] integerValue]; - break; - } + NSDictionary *dic = attachment.data; + NSString *uid = [AccountInfoStorage instance].getUid; + + switch (attachment.first) { + case CustomMessageType_Super_Gift: + if (attachment.second == Custom_Message_Sub_Super_Gift_UI_Rffect) { + NSDictionary *data = attachment.data; + NSArray *receiverUidList = [data objectForKey:@"receiverUidList"]; + NSString *receiverProfit = [data objectForKey:@"receiverProfit"]; + for (NSNumber *uid in receiverUidList) { + UIView * view = [self findMicroViewByUid:[NSString stringWithFormat:@"%ld", uid.integerValue]]; + if (view == nil && ![NSString isEmpty:receiverProfit]) continue; + [view receiveGold:receiverProfit]; } } - if (micro == nil) { - return; + break; + case CustomMessageType_Queue: + if (attachment.second == Custom_Message_Sub_Queue_Invite) { + MicroInviteExtModel *inviteModel = [MicroInviteExtModel modelWithDictionary:dic]; + if (inviteModel.uid.integerValue == self.hostDelegate.getUserInfo.uid) { + NSString *position = inviteModel.micPosition; + + MicroQueueModel *micro = [self.micQueue objectForKey:position]; + if (!micro || micro.userInfo) return; // 当前麦位有人,什么都不做。 + + RoomInfoModel* roomInfo = self.hostDelegate.getRoomInfo; + NSString* roomId = [NSString stringWithFormat:@"%ld", roomInfo.roomId]; + UserInfoModel* userInfo = self.hostDelegate.getUserInfo; + + NIMChatroomQueueUpdateRequest *request = [[NIMChatroomQueueUpdateRequest alloc]init]; + request.key = position; + request.value = [[self userInfoToQueueExt:userInfo] toJSONString]; + request.roomId = roomId; + request.transient = YES; + + [[NIMSDK sharedSDK].chatroomManager updateChatroomQueueObject:request completion:^(NSError * _Nullable error) { + if (error) return; + [RtcManager instance].localMuted = YES; + TTAlertConfig *config = [[TTAlertConfig alloc] init]; + config.title = YMLocalizedString(@"StageView0"); + config.message = YMLocalizedString(@"XPMiniRoomView3"); + [TTPopup alertWithConfig:config confirmHandler:^{ + + } cancelHandler:^{ + + }]; + }]; + } } - NSString *position = [NSString stringWithFormat:@"%ld", (long)micIndex]; - NSString *roomId = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.roomId]; - UserInfoModel * userInfo = self.hostDelegate.getUserInfo; - userInfo.groupType = GroupType_default; - NIMChatroomQueueUpdateRequest *request = [[NIMChatroomQueueUpdateRequest alloc]init]; - request.key = position; - NSMutableDictionary *curUserInfo = [[NSMutableDictionary alloc]initWithDictionary:[self userInfoToQueueExt:userInfo]]; - [curUserInfo setValue:@(YES) forKey:@"isNoProhibitMic"]; - request.value = [curUserInfo toJSONString]; - request.roomId = roomId; - request.transient = YES; - [[NIMSDK sharedSDK].chatroomManager updateChatroomQueueObject:request completion:^(NSError * _Nullable error) { - if (error) return; - }]; - } + break; + case CustomMessageType_Room_GiftValue: + if (attachment.second == Custom_Message_Sub_Room_GiftValue_Sync) { + [self giftValueUpdate:attachment.data]; + } + break; + case CustomMessageType_Gift: + if (attachment.second == Custom_Message_Sub_Gift_Send || attachment.second == Custom_Message_Sub_Gift_LuckySend || attachment.second == Custom_Message_Sub_Gift_ChannelNotify) { + [self giftValueUpdate:attachment.data]; + } + break; + case CustomMessageType_AllMicroSend: + if (attachment.second == Custom_Message_Sub_AllMicroSend || attachment.second == Custom_Message_Sub_AllBatchSend || attachment.second == Custom_Message_Sub_AllMicroLuckySend || attachment.second == Custom_Message_Sub_AllBatchMicroLuckySend) { + [self giftValueUpdate:attachment.data]; + } + break; + case CustomMessageType_Face: + if (attachment.second == Custom_Message_Sub_Face_Send) { + [self showUserFace:attachment.data]; + } + break; + case CustomMessageType_Room_PK: + if (attachment.second == Custom_Message_Sub_Room_PK_Manager_Up_Mic) { + if (dic.allKeys.count > 0 && [dic.allKeys containsObject:uid] && [dic objectForKey:uid]) { + RoomPKChooseUserModel *pkUserInfo = [RoomPKChooseUserModel modelWithDictionary:[dic objectForKey:uid]]; + NSString *position = [NSString stringWithFormat:@"%d", pkUserInfo.position]; + NSString* roomId = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.roomId]; + MicroQueueModel *micro = [self.micQueue objectForKey:position]; + if (micro && micro.userInfo && micro.userInfo.uid != pkUserInfo.uid.integerValue) { return; } + UserInfoModel *userInfo = self.hostDelegate.getUserInfo; + userInfo.groupType = pkUserInfo.groupType; + NIMChatroomQueueUpdateRequest *request = [[NIMChatroomQueueUpdateRequest alloc]init]; + request.key = position; + NSMutableDictionary *curUserInfo = [[NSMutableDictionary alloc]initWithDictionary:[self userInfoToQueueExt:userInfo]]; + [curUserInfo setValue:@(YES) forKey:@"isNoProhibitMic"]; + request.value = [curUserInfo toJSONString]; + request.roomId = roomId; + request.transient = YES; + [[NIMSDK sharedSDK].chatroomManager updateChatroomQueueObject:request completion:^(NSError * _Nullable error) { + if (error) return; + }]; + } + } else if (attachment.second == Custom_Message_Sub_Room_PK_Mode_Close) { + if (dic.allKeys.count > 0 && [[[dic objectForKey:@"operatorUid"] stringValue] isEqualToString:uid]) { + NSInteger micIndex = -1; + MicroQueueModel *micro; + for (MicroQueueModel *model in self.micQueue.allValues) { + if (model.userInfo) { + if (model.userInfo.uid == uid.integerValue) { + micro = model; + micIndex = [[[self __keysForValue:model inDictionary:self.micQueue] xpSafeObjectAtIndex:0] integerValue]; + break; + } + } + } + if (micro == nil) { + return; + } + NSString *position = [NSString stringWithFormat:@"%ld", (long)micIndex]; + NSString *roomId = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.roomId]; + UserInfoModel *userInfo = self.hostDelegate.getUserInfo; + userInfo.groupType = GroupType_default; + NIMChatroomQueueUpdateRequest *request = [[NIMChatroomQueueUpdateRequest alloc]init]; + request.key = position; + NSMutableDictionary *curUserInfo = [[NSMutableDictionary alloc]initWithDictionary:[self userInfoToQueueExt:userInfo]]; + [curUserInfo setValue:@(YES) forKey:@"isNoProhibitMic"]; + request.value = [curUserInfo toJSONString]; + request.roomId = roomId; + request.transient = YES; + [[NIMSDK sharedSDK].chatroomManager updateChatroomQueueObject:request completion:^(NSError * _Nullable error) { + if (error) return; + }]; + } + } + break; + default: + break; } } } @@ -1001,8 +1032,21 @@ // 抱Ta上麦 TTActionSheetConfig *inviteMic = [self inviteMicAction:position room:roomInfo mic:micModel]; + NSMutableArray *items = [[NSMutableArray alloc] init]; + if (upMic) { + [items addObject:upMic]; + } + if (lockMic) { + [items addObject:lockMic]; + } + if (muteMic) { + [items addObject:muteMic]; + } + if (inviteMic) { + [items addObject:inviteMic]; + } @kWeakify(self); - [TTPopup actionSheetWithItems:@[upMic, inviteMic, lockMic, muteMic] cancelHandler:^{ + [TTPopup actionSheetWithItems:items.copy cancelHandler:^{ @kStrongify(self); self.isUpingMic = NO; }]; diff --git a/YuMi/Modules/YMRoom/View/StageView/TwentyMicStageView.m b/YuMi/Modules/YMRoom/View/StageView/TwentyMicStageView.m index 50b4434d..f269db83 100644 --- a/YuMi/Modules/YMRoom/View/StageView/TwentyMicStageView.m +++ b/YuMi/Modules/YMRoom/View/StageView/TwentyMicStageView.m @@ -67,7 +67,7 @@ static const NSInteger kMicCountPerRow = 5; - (CGPoint)animationPointAtStageViewByIndex:(NSInteger)index { if (index < 0 || index >= [self countOfMicroView]) { - return CGPointZero; + return CGPointMake(KScreenWidth/2 - mcWidth/2, mcHeight); } CGPoint position = [self positionForIndex:index rowHeight:mcHeight]; return [self convertPoint:position toView:nil]; diff --git a/YuMi/Modules/YMRoom/View/XPRoomViewController.m b/YuMi/Modules/YMRoom/View/XPRoomViewController.m index 6c9d132f..a1c4e5c8 100644 --- a/YuMi/Modules/YMRoom/View/XPRoomViewController.m +++ b/YuMi/Modules/YMRoom/View/XPRoomViewController.m @@ -288,7 +288,7 @@ XPCandyTreeInsufficientBalanceViewDelegate> - (void)dealloc { - NSLog(@"房间销毁了"); +// NSLog(@"房间销毁了"); [[RoomBoomManager sharedManager] leaveRoom]; @@ -1854,7 +1854,7 @@ XPCandyTreeInsufficientBalanceViewDelegate> continue; } - NSLog(@" --- Message Raw Attach Content: %@, %@, %ld", @(message.senderClientType), message.rawAttachContent, (long)message.messageType); +// NSLog(@" --- Message Raw Attach Content: %@, %@, %ld", @(message.senderClientType), message.rawAttachContent, (long)message.messageType); if (message.messageType == NIMMessageTypeNotification) { NIMNotificationObject *notiMsg = (NIMNotificationObject *)message.messageObject; @@ -2194,7 +2194,8 @@ XPCandyTreeInsufficientBalanceViewDelegate> isHave = YES; }else if(attachment.first == CustomMessageType_Guardian_Planet && attachment.second == Custom_Message_Sub_Guardian_Planet_All_Room){ isHave = YES; - }else if(attachment.first == CustomMessageType_Super_Gift && attachment.second == Custom_Message_Sub_Super_Gift){ + }else if(attachment.first == CustomMessageType_Super_Gift && + (attachment.second == Custom_Message_Sub_Super_Gift || attachment.second == Custom_Message_Sub_Super_Gift_Room_Message)){ isHave = YES; }else if(attachment.first == CustomMessageType_General_Public_Screen && attachment.second == Custom_Message_Sub_General_Public_Screen_All_Room){ isHave = YES; diff --git a/YuMi/Modules/YMTabbar/Presenter/MainPresenter.m b/YuMi/Modules/YMTabbar/Presenter/MainPresenter.m index 7505c0e5..26b34954 100644 --- a/YuMi/Modules/YMTabbar/Presenter/MainPresenter.m +++ b/YuMi/Modules/YMTabbar/Presenter/MainPresenter.m @@ -112,7 +112,7 @@ static NSString * kUpdateVersionNum = @"kUpdateVersionNum"; XPTabAnchorCardModel *model = [XPTabAnchorCardModel modelWithDictionary:data.data]; [[self getView] getAnchorCardInfoSuccess:model]; } fail:^(NSInteger code, NSString * _Nullable msg) { - NSLog(@"%@", msg); +// NSLog(@"%@", msg); } errorToast:NO]]; } @@ -138,7 +138,7 @@ static NSString * kUpdateVersionNum = @"kUpdateVersionNum"; if([MainPresenter isUpdateVersion:model] == NO) return; [[self getView] getVersionUpdate:model]; } fail:^(NSInteger code, NSString * _Nullable msg) { - NSLog(@"%@", msg); +// NSLog(@"%@", msg); } errorToast:NO] appVersion:appVersion os:os channel:channel]; } diff --git a/YuMi/Modules/YMTabbar/View/TabbarViewController.m b/YuMi/Modules/YMTabbar/View/TabbarViewController.m index 490d4ebb..fa9eb6f4 100644 --- a/YuMi/Modules/YMTabbar/View/TabbarViewController.m +++ b/YuMi/Modules/YMTabbar/View/TabbarViewController.m @@ -645,7 +645,7 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey; return; } - NSLog(@" --- Broadcast Message Raw Attach Content: %@", msgDictionary); +// NSLog(@" --- Broadcast Message Raw Attach Content: %@", msgDictionary); // MARK: 要复查这里的 if else 嵌套 if (attachment.first == CustomMessageType_RedPacket) { @@ -910,7 +910,7 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey; NSError *err; NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableContainers error:&err]; if(err) { - NSLog(@"json解析失败:%@",err); +// NSLog(@"json解析失败:%@",err); return; } if ([dic[@"first"] integerValue] == CustomMessageType_First_VisitorRecord){//访客记录数量更新提示 diff --git a/YuMi/Modules/YMWeb/MSRoomGameWebVC.m b/YuMi/Modules/YMWeb/MSRoomGameWebVC.m index ab0ea924..bd3e5741 100644 --- a/YuMi/Modules/YMWeb/MSRoomGameWebVC.m +++ b/YuMi/Modules/YMWeb/MSRoomGameWebVC.m @@ -237,7 +237,7 @@ NSString * const kMSGameLoaded = @"gameLoaded"; [self.webView evaluateJavaScript:jsMethods completionHandler:^(id _Nullable resp, NSError * _Nullable error) { @kStrongify(self); - NSLog(@"error = %@ , response = %@",error, resp); + // NSLog(@"error = %@ , response = %@",error, resp); [self.backBtn removeFromSuperview]; }]; } else { @@ -245,7 +245,7 @@ NSString * const kMSGameLoaded = @"gameLoaded"; [self.webView evaluateJavaScript:jsMethods completionHandler:^(id _Nullable resp, NSError * _Nullable error) { @kStrongify(self); - NSLog(@"error = %@ , response = %@",error, resp); + // NSLog(@"error = %@ , response = %@",error, resp); [self.backBtn removeFromSuperview]; }]; } @@ -264,7 +264,7 @@ NSString * const kMSGameLoaded = @"gameLoaded"; error:&err]; if(err) { - NSLog(@"json解析失败:%@",err); + // NSLog(@"json解析失败:%@",err); return nil; } return dic; @@ -285,7 +285,7 @@ NSString * const kMSGameLoaded = @"gameLoaded"; } else if ([message.name isEqualToString:kMSGameRecharge]) { [self gameRecharge:dicBody]; } else { - NSLog(@"未实现⽅法 : %@ --> %@", message.name, message.body); + // NSLog(@"未实现⽅法 : %@ --> %@", message.name, message.body); } } else { /// LeaderCC @@ -294,7 +294,7 @@ NSString * const kMSGameLoaded = @"gameLoaded"; if([self respondsToSelector:selector]){ [self performSelector:selector withObject:message.body]; }else{ - NSLog(@"未實現方法 : %@ --> %@", message.name, message.body); + // NSLog(@"未實現方法 : %@ --> %@", message.name, message.body); } } } @@ -327,9 +327,9 @@ NSString * const kMSGameLoaded = @"gameLoaded"; // 平时游戏币更新不需要调用该方法,以防止影响游戏开奖动画。 [self.webView evaluateJavaScript:@"updateCoin()" completionHandler:^(id _Nullable result, NSError * _Nullable error) { if (error) { - NSLog(@"Error calling JS function: %@", error.localizedDescription); + // NSLog(@"Error calling JS function: %@", error.localizedDescription); } else { - NSLog(@"JS function called successfully, result: %@", result); + // NSLog(@"JS function called successfully, result: %@", result); } }]; } @@ -338,7 +338,7 @@ NSString * const kMSGameLoaded = @"gameLoaded"; // 获取信息配置 - (void) getConfig:(NSDictionary*)args { - NSLog(@"BSGAME %s","游戏调⽤getConfig"); + // NSLog(@"BSGAME %s","游戏调⽤getConfig"); NSString* method = [args objectForKey:@"jsCallback"]; RoomInfoModel *roomInfo = self.hostDelegate.getRoomInfo; ActivityInfoItemModel *gameModel = self.gameModel.gameModel; @@ -382,7 +382,7 @@ NSString * const kMSGameLoaded = @"gameLoaded"; // 销毁游戏 - (void) destroy:(NSDictionary*)args { - NSLog(@"BSGAME %s","游戏调⽤destroy"); + // NSLog(@"BSGAME %s","游戏调⽤destroy"); //关闭游戏 TODO 客⼾端 [self willMoveToParentViewController:nil]; //1 [self.view removeFromSuperview]; //2 @@ -402,7 +402,7 @@ NSString * const kMSGameLoaded = @"gameLoaded"; // 提⽰余额不⾜ - (void) gameRecharge:(NSDictionary*)args { - NSLog(@"BSGAME %s","游戏调⽤gameRecharge"); + // NSLog(@"BSGAME %s","游戏调⽤gameRecharge"); //拉起充值商城 TODO 客⼾端 TTAlertConfig *config = [[TTAlertConfig alloc]init]; config.message = YMLocalizedString(@"XPNobleCenterViewController3"); diff --git a/YuMi/Modules/YMWeb/XPWebViewController.m b/YuMi/Modules/YMWeb/XPWebViewController.m index 11fa6dc8..c7bf9d4c 100644 --- a/YuMi/Modules/YMWeb/XPWebViewController.m +++ b/YuMi/Modules/YMWeb/XPWebViewController.m @@ -317,13 +317,13 @@ NSString * const kJSVerifyCaptchaCallBack = @"closeToVerify"; NSHTTPURLResponse *response = (NSHTTPURLResponse *)navigationResponse.response; NSDictionary *headers = response.allHeaderFields; - NSLog(@"Response Headers: %@", headers); + // NSLog(@"Response Headers: %@", headers); NSString *contentEncoding = headers[@"Content-Encoding"]; if ([contentEncoding isEqualToString:@"gzip"]) { - NSLog(@"✅ Gzip 响应已启用"); + // NSLog(@"✅ Gzip 响应已启用"); } else { - NSLog(@"❌ Gzip 响应未启用"); + // NSLog(@"❌ Gzip 响应未启用"); } decisionHandler(WKNavigationResponsePolicyAllow); @@ -373,8 +373,8 @@ NSString * const kJSVerifyCaptchaCallBack = @"closeToVerify"; ///测试环境只要有host就执行,方便h5连接本地调试 BOOL condition = currentUrl != nil && [currentUrl containsString:API_HOST_URL]; #ifdef DEBUG - NSLog(@"-- -- - -- - - | -- -- - -- - -%@", response); - NSLog(@"-- -- - -- - -%@: %@", message.name, message.body); + // NSLog(@"-- -- - -- - - | -- -- - -- - -%@", response); + // NSLog(@"-- -- - -- - -%@: %@", message.name, message.body); condition = currentUrl != nil; #endif if(condition) { @@ -394,25 +394,25 @@ NSString * const kJSVerifyCaptchaCallBack = @"closeToVerify"; NSString *uid = [[AccountInfoStorage instance] getUid]; NSString *js = [NSString stringWithFormat:@"getMessage(\"uid\",%@)", uid]; [self.webview evaluateJavaScript:js completionHandler:^(id _Nullable other, NSError * _Nullable error) { - NSLog(@"%@",error); + // NSLog(@"%@",error); }]; } else if ([message.name isEqualToString:kJSGetTicket]) { NSString *ticket = [[AccountInfoStorage instance] getTicket]; NSString *js = [NSString stringWithFormat:@"getMessage(\"ticket\",\"%@\")",ticket]; [self.webview evaluateJavaScript:js completionHandler:^(id _Nullable other, NSError * _Nullable error) { - NSLog(@"%@",error); + // NSLog(@"%@",error); }]; } else if ([message.name isEqualToString:kJSGetDeviceId]) { NSString *js = [NSString stringWithFormat:@"getMessage(\"deviceId\",\"%@\")",[YYUtility deviceUniqueIdentification]]; [self.webview evaluateJavaScript:js completionHandler:^(id _Nullable other, NSError * _Nullable error) { - NSLog(@"%@",error); + // NSLog(@"%@",error); }]; } else if ([message.name isEqualToString:kJSGetDeviceInfo]) { NSDictionary *basicParmars = [HttpRequestHelper configBaseParmars:[[NSDictionary alloc] init]]; NSString *json = [basicParmars mj_JSONString]; NSString *js = [NSString stringWithFormat:@"getMessage(\"deviceInfo\",%@)", json]; [self.webview evaluateJavaScript:js completionHandler:^(id _Nullable ohter, NSError * _Nullable error) { - NSLog(@"%@", error); + // NSLog(@"%@", error); }]; } else if ([message.name isEqualToString:kJSOpenPurse]) { @@ -462,7 +462,7 @@ NSString * const kJSVerifyCaptchaCallBack = @"closeToVerify"; } else if([message.name isEqualToString:kJSGetRoomUid]) { NSString *js = [NSString stringWithFormat:@"getMessage(\"roomUid\",\"%@\")",self.roomUid]; [self.webview evaluateJavaScript:js completionHandler:^(id _Nullable other, NSError * _Nullable error) { - NSLog(@"%@",error); + // NSLog(@"%@",error); }]; } else if([message.name isEqualToString:kInitShowNav]) { if (((NSNumber *)message.body).intValue == 0) { @@ -528,7 +528,7 @@ NSString * const kJSVerifyCaptchaCallBack = @"closeToVerify"; }); } } else if([message.name isEqualToString:kJSOpenRoomForGiftId]) { - NSLog(@"%@", message.body); + // NSLog(@"%@", message.body); NSDictionary *bodyDict; if ([message.body isKindOfClass:[NSDictionary class]]) { bodyDict = message.body; diff --git a/YuMi/Network/HttpRequestHelper.m b/YuMi/Network/HttpRequestHelper.m index 3057f570..c94cd363 100644 --- a/YuMi/Network/HttpRequestHelper.m +++ b/YuMi/Network/HttpRequestHelper.m @@ -126,7 +126,10 @@ params = [self configBaseParmars:params]; #ifdef DEBUG - NSLog(@"\nmethod:\n%@\nparameter:\n%@\n", method, params); + NSLog(@"\nmethod:\n%@\nparameter:\n%@\n 超時:%@", + method, + params, + @(manager.session.configuration.timeoutIntervalForRequest)); #else #endif @@ -146,11 +149,15 @@ constructingBodyWithBlock:^(id _Nonnull formData) { success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { BaseModel *baseModel = [BaseModel modelWithDictionary:responseObject]; #ifdef DEBUG - NSLog(@"\n%@\n", [baseModel toJSONString]); + NSLog(@"%@ - \n%@\n", method, [baseModel toJSONString]); #else #endif success(baseModel); } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { +#ifdef DEBUG + NSLog(@"%@ - \n%@\n", method, error); +#else +#endif @kStrongify(self); [self handleNetError:error method:method failure:failure]; }]; diff --git a/YuMi/Resources/banner/brove_gift.svga b/YuMi/Resources/banner/brove_gift.svga new file mode 100644 index 00000000..3f9be6b3 Binary files /dev/null and b/YuMi/Resources/banner/brove_gift.svga differ diff --git a/YuMi/Resources/gift/中.svga b/YuMi/Resources/gift/中.svga new file mode 100644 index 00000000..06aadc9c Binary files /dev/null and b/YuMi/Resources/gift/中.svga differ diff --git a/YuMi/Resources/gift/大.svga b/YuMi/Resources/gift/大.svga new file mode 100644 index 00000000..cecf33ee Binary files /dev/null and b/YuMi/Resources/gift/大.svga differ diff --git a/YuMi/Resources/gift/小.svga b/YuMi/Resources/gift/小.svga new file mode 100644 index 00000000..25bceccb Binary files /dev/null and b/YuMi/Resources/gift/小.svga differ diff --git a/YuMi/Tools/Date/NSDate+DateUtils.m b/YuMi/Tools/Date/NSDate+DateUtils.m index 12846187..e24d4da7 100644 --- a/YuMi/Tools/Date/NSDate+DateUtils.m +++ b/YuMi/Tools/Date/NSDate+DateUtils.m @@ -151,7 +151,6 @@ NSString * const kDateFormatYYMMDDTHHmmss = @"yyyy-MM-dd'T'HH:mm:ss"; NSDate *confromTimesp = [NSDate dateWithTimeIntervalSince1970:timestamp]; /// 在当前时间,后退30分钟 = 1800 // confromTimesp = [confromTimesp dateByAddingTimeInterval:-1800]; - NSLog(@"1296035591 = %@",confromTimesp); NSString *confromTimespStr = [formatter stringFromDate:confromTimesp]; return confromTimespStr; } @@ -168,7 +167,7 @@ NSString * const kDateFormatYYMMDDTHHmmss = @"yyyy-MM-dd'T'HH:mm:ss"; // 3.利用日历对象比较两个时间的差值 NSDateComponents *cmps = [calendar components:type fromDate:date1 toDate:date2 options:0]; // 4.输出结果 - NSLog(@"两个时间相差%ld年%ld月%ld日%ld小时%ld分钟%ld秒", cmps.year, cmps.month, cmps.day, cmps.hour, cmps.minute, cmps.second); +// NSLog(@"两个时间相差%ld年%ld月%ld日%ld小时%ld分钟%ld秒", cmps.year, cmps.month, cmps.day, cmps.hour, cmps.minute, cmps.second); return cmps.second; } + (NSString *)getCurrentTimeWithFormat:(NSString *)format{ diff --git a/YuMi/Tools/File/AlbumResourcePickerViewController.m b/YuMi/Tools/File/AlbumResourcePickerViewController.m index f97b079b..85028127 100644 --- a/YuMi/Tools/File/AlbumResourcePickerViewController.m +++ b/YuMi/Tools/File/AlbumResourcePickerViewController.m @@ -164,7 +164,7 @@ - (void)handleAsset:(PHAsset *)asset { // 使用 PHImageManager 来请求图像数据 [[PHImageManager defaultManager] requestImageDataForAsset:asset options:nil resultHandler:^(NSData * _Nullable imageData, NSString * _Nullable dataUTI, UIImageOrientation orientation, NSDictionary * _Nullable info) { - NSLog(@"%@", info); +// NSLog(@"%@", info); if ([dataUTI isEqualToString:@"com.compuserve.gif"]) { // 是 GIF 文件,处理 GIF 数据 FLAnimatedImage *animatedImage = [FLAnimatedImage animatedImageWithGIFData:imageData]; diff --git a/YuMi/Tools/File/UploadFile.m b/YuMi/Tools/File/UploadFile.m index 7e76de65..69a52936 100644 --- a/YuMi/Tools/File/UploadFile.m +++ b/YuMi/Tools/File/UploadFile.m @@ -250,7 +250,7 @@ static UploadFile* manager; [request setFinishBlock:^(id outputObject, NSError *error) { // outputObject 包含所有的响应 http 头部 NSDictionary* info = (NSDictionary *) outputObject; - NSLog(@"%@",info); +// NSLog(@"%@",info); }]; @@ -359,9 +359,9 @@ static UploadFile* manager; NSFileManager *fileMgr = [[NSFileManager alloc] init]; BOOL success = [fileMgr createDirectoryAtPath:filePath withIntermediateDirectories:YES attributes:nil error:&error]; if (success) { - NSLog(@"Folder created successfully."); +// NSLog(@"Folder created successfully."); } else { - NSLog(@"Could not create folder: %@", [error localizedDescription]); +// NSLog(@"Could not create folder: %@", [error localizedDescription]); } } } diff --git a/YuMi/Tools/NSString/NSString+Utils.h b/YuMi/Tools/NSString/NSString+Utils.h index 68aebcdc..b0416bea 100644 --- a/YuMi/Tools/NSString/NSString+Utils.h +++ b/YuMi/Tools/NSString/NSString+Utils.h @@ -49,6 +49,8 @@ NS_ASSUME_NONNULL_BEGIN + (NSString *)formatNumberToKOrM_NoRounding:(NSString *)string; ++ (NSString *)stringByRemovingRedundantZeros:(NSString *)string; + @end diff --git a/YuMi/Tools/NSString/NSString+Utils.m b/YuMi/Tools/NSString/NSString+Utils.m index 0d82408b..950a99d4 100644 --- a/YuMi/Tools/NSString/NSString+Utils.m +++ b/YuMi/Tools/NSString/NSString+Utils.m @@ -353,7 +353,7 @@ options:NSJSONReadingMutableLeaves error:&error]; if (error) { - NSLog(@"JSON Parsing Error: %@", error.localizedDescription); +// NSLog(@"JSON Parsing Error: %@", error.localizedDescription); } NSArray *codeList = [LoginAreaModel modelsWithArray:codeData[@"RECORDS"]]; NSString *mccCode = [YYUtility getMobileCountryCode]; @@ -404,4 +404,40 @@ // return components.string; } ++ (NSString *)stringByRemovingRedundantZeros:(NSString *)string { + if (![string containsString:@"."]) { + return string; // 不包含小數點,直接返回 + } + + // 將字串分割成整數部分和小數部分 + NSArray *components = [string componentsSeparatedByString:@"."]; + if (components.count > 2) { + return string; // 包含多個小數點,不處理直接返回 (或者您可以考慮拋出錯誤) + } + + NSString *integerPart = components[0]; + NSString *fractionalPart = components.count > 1 ? components[1] : @""; + + if (fractionalPart.length == 0) { + return integerPart; // 沒有小數部分,直接返回整數部分 + } + + // 從後向前移除小數部分末尾的 0 + NSInteger lastNonZeroIndex = -1; + for (NSInteger i = fractionalPart.length - 1; i >= 0; i--) { + if ([fractionalPart characterAtIndex:i] != '0') { + lastNonZeroIndex = i; + break; + } + } + + if (lastNonZeroIndex == -1) { + return integerPart; // 小數部分全是 0,返回整數部分 + } else { + // 截取到最後一個非零數字 + NSString *trimmedFractionalPart = [fractionalPart substringToIndex:lastNonZeroIndex + 1]; + return [NSString stringWithFormat:@"%@.%@", integerPart, trimmedFractionalPart]; + } +} + @end diff --git a/YuMi/Tools/Share/ShareHelder.m b/YuMi/Tools/Share/ShareHelder.m index 38b8e9c6..c4865517 100644 --- a/YuMi/Tools/Share/ShareHelder.m +++ b/YuMi/Tools/Share/ShareHelder.m @@ -19,7 +19,7 @@ options:NSRegularExpressionCaseInsensitive error:&error]; if (error) { - NSLog(@"Error creating regex: %@", error); +// NSLog(@"Error creating regex: %@", error); return @{@"url": @"", @"remainingString": inputString}; } @@ -54,7 +54,7 @@ options:NSRegularExpressionCaseInsensitive error:&error]; if (error) { - NSLog(@"Error creating regex: %@", error); +// NSLog(@"Error creating regex: %@", error); return @""; } diff --git a/YuMi/Tools/sdkContent/catagory/Util/BSNSDictionary.m b/YuMi/Tools/sdkContent/catagory/Util/BSNSDictionary.m index 60e55ef4..5ca96f50 100644 --- a/YuMi/Tools/sdkContent/catagory/Util/BSNSDictionary.m +++ b/YuMi/Tools/sdkContent/catagory/Util/BSNSDictionary.m @@ -24,7 +24,7 @@ options:NSJSONReadingMutableContainers error:&err]; if(err) { - NSLog(@"json解析失败:%@",err); +// NSLog(@"json解析失败:%@",err); return nil; } return dic; diff --git a/YuMi/ar.lproj/Localizable.strings b/YuMi/ar.lproj/Localizable.strings index 8c0b5f74..67b034ff 100644 --- a/YuMi/ar.lproj/Localizable.strings +++ b/YuMi/ar.lproj/Localizable.strings @@ -491,7 +491,6 @@ "MessageContentTextClickable0" = "يرجى ربط رقم هاتفك أولاً!"; "MessageContentOpenLiveView0" = "الآن %@ متصل"; -"MessageContentOpenLiveView1" = "الشخص الذي تتابعه"; "MessageContentRedPacketView0" = "انتهت صلاحية الظرف الأحمر"; "MessageContentRedPacketView1" = "كن أسرع في المرة القادمة~"; "MessageContentRedPacketView2" = "تم استلام الظرف الأحمر"; @@ -1043,7 +1042,7 @@ ineHeadView12" = "الحمل"; "XPMineFansTableViewCell2" = "متابعة متبادلة"; "XPMineAttentionTableViewCell0" = "هذا الشخص كسول جدًا لدرجة أنه لم يضع توقيعًا بعد"; -"XPMineAttentionTableViewCell1" = "العثور على هذا المستخدم"; +"XPMineAttentionTableViewCell1" = "يجد"; "XPMineFriendEmptyTableViewCell0" = "لا توجد بيانات متاحة"; diff --git a/YuMi/en.lproj/Localizable.strings b/YuMi/en.lproj/Localizable.strings index e1eaa278..11665af2 100644 --- a/YuMi/en.lproj/Localizable.strings +++ b/YuMi/en.lproj/Localizable.strings @@ -181,7 +181,6 @@ "MessageContentTextClickable0" = "Please bind your phone number first!"; "MessageContentOpenLiveView0" = "%@ is online now"; -"MessageContentOpenLiveView1" = "The TA you follow"; "MessageContentRedPacketView0" = "Red packet has expired"; "MessageContentRedPacketView1" = "Be quicker next time~"; @@ -791,7 +790,7 @@ "XPMineFansTableViewCell2" = "Mutual Follow"; "XPMineAttentionTableViewCell0" = "This person hasn't set a signature yet"; -"XPMineAttentionTableViewCell1" = "Find Ta"; +"XPMineAttentionTableViewCell1" = "Find"; "XPMineFriendEmptyTableViewCell0" = "No data"; @@ -3689,9 +3688,9 @@ "Combo_9" = "times"; "Combo_10" = "Are you sure you want to go to this room?"; -"UserDetail_0" = "Guild"; -"UserDetail_1" = "Guild Nick:"; -"UserDetail_2" = "Guild ID:"; +"UserDetail_0" = "Agency"; +"UserDetail_1" = "Agency Name:"; +"UserDetail_2" = "Agency ID:"; "UserDetail_3" = "Agent ID:"; "UserDetail_4" = "CP"; "UserDetail_5" = "Living"; diff --git a/YuMi/tr.lproj/Localizable.strings b/YuMi/tr.lproj/Localizable.strings index b8296e01..1da9841f 100644 --- a/YuMi/tr.lproj/Localizable.strings +++ b/YuMi/tr.lproj/Localizable.strings @@ -387,7 +387,7 @@ "XPMineFansTableViewCell2" = "Karşılıklı Takip"; "XPMineAttentionTableViewCell0" = "Bu kişi tembel ve henüz bir imza koymadı"; -"XPMineAttentionTableViewCell1" = "Onu Bul"; +"XPMineAttentionTableViewCell1" = "Bulmak"; "XPMineFriendEmptyTableViewCell0" = "Veri yok"; @@ -1946,7 +1946,6 @@ "MessageContentTextClickable0" = "Lütfen önce telefon numaranızı bağlayın!"; "MessageContentOpenLiveView0" = "%@ yayında"; -"MessageContentOpenLiveView1" = "Takip ettiğiniz kişi"; "MessageContentRedPacketView0" = "Kırmızı paket geçersiz"; "MessageContentRedPacketView1" = "Bir sonraki sefere daha hızlı gelin~"; diff --git a/YuMi/zh-Hant.lproj/Localizable.strings b/YuMi/zh-Hant.lproj/Localizable.strings index 2e85671a..b731b96b 100644 --- a/YuMi/zh-Hant.lproj/Localizable.strings +++ b/YuMi/zh-Hant.lproj/Localizable.strings @@ -1990,7 +1990,6 @@ "MessageContentTextClickable0" = "請先綁定手機號!"; "MessageContentOpenLiveView0" = "%@ 上線了"; -"MessageContentOpenLiveView1" = "你關註的TA"; "MessageContentRedPacketView0" = "紅包已失效"; "MessageContentRedPacketView1" = "下次要快點來哦~"; diff --git a/yum/Class/YUMIUrl.m b/yum/Class/YUMIUrl.m index a61b8bf0..7fa7c427 100644 --- a/yum/Class/YUMIUrl.m +++ b/yum/Class/YUMIUrl.m @@ -18,7 +18,7 @@ - (NSString *)base64String { NSData *data= [self dataUsingEncoding:NSUTF8StringEncoding]; - NSString *n = [data base64EncodedDataWithOptions:0]; + NSString *n = [data base64EncodedStringWithOptions:0]; return n; }