diff --git a/Podfile b/Podfile index a19f383e..a64b5ddd 100644 --- a/Podfile +++ b/Podfile @@ -9,7 +9,7 @@ target 'YuMi' do pod 'FBSDKLoginKit' pod 'FBSDKCoreKit' pod 'FBSDKShareKit' - pod 'LineSDKSwift' +# pod 'LineSDKSwift' # 滑动标签栏 pod 'JXCategoryView' pod 'JXPagingView/Pager' diff --git a/Users/edwinqqq/Documents/文稿 b/Users/edwinqqq/Documents/文稿 deleted file mode 100644 index a67f5705..00000000 --- a/Users/edwinqqq/Documents/文稿 +++ /dev/null @@ -1,8 +0,0 @@ -// 使用UIViewPropertyAnimator优化动画 -- (void)startMatchGameSuccess { - // ... existing code ... - UIViewPropertyAnimator *animator = [[UIViewPropertyAnimator alloc] initWithDuration:0.3 curve:UIViewAnimationCurveEaseInOut animations:^{ - nav.view.alpha = 1.0; - }]; - [animator startAnimation]; -} \ No newline at end of file diff --git a/YuMi.xcodeproj/project.pbxproj b/YuMi.xcodeproj/project.pbxproj index 18a276ed..673d6479 100644 --- a/YuMi.xcodeproj/project.pbxproj +++ b/YuMi.xcodeproj/project.pbxproj @@ -204,7 +204,6 @@ 234489092AC3C5FF0070E5D5 /* SudMGP.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 234489072AC3C5DA0070E5D5 /* SudMGP.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 234D821E2AEC57CF0022EFEB /* YYTextAsyncLayer+PITextAsyncLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 234D821D2AEC57CF0022EFEB /* YYTextAsyncLayer+PITextAsyncLayer.m */; }; 234E50AF2BF7352C005CB6D5 /* NSTextAttachment+MSImage.m in Sources */ = {isa = PBXBuildFile; fileRef = 234E50AE2BF7352C005CB6D5 /* NSTextAttachment+MSImage.m */; }; - 234F44E32B3EA4F900E2B532 /* PILineManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 234F44E22B3EA4F900E2B532 /* PILineManager.swift */; }; 235714892BECC38F004C81D6 /* MessageHeadlinesTextModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 235714882BECC38F004C81D6 /* MessageHeadlinesTextModel.m */; }; 235714982BEDF54E004C81D6 /* MsRoomMessageMainView.m in Sources */ = {isa = PBXBuildFile; fileRef = 235714972BEDF54E004C81D6 /* MsRoomMessageMainView.m */; }; 235A451A2B04A352009753F5 /* PIRoomActivityWebView.m in Sources */ = {isa = PBXBuildFile; fileRef = 235A45192B04A352009753F5 /* PIRoomActivityWebView.m */; }; @@ -547,13 +546,15 @@ 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 */; }; + 4CE746D22D92A2660094E496 /* BravoGiftBannerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CE746D12D92A2660094E496 /* BravoGiftBannerView.m */; }; + 4CE746D52D92C1080094E496 /* BravoGiftWinningFlagView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CE746D42D92C1080094E496 /* BravoGiftWinningFlagView.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 */; }; 4CEB9EB02D0AF4FE00443480 /* TwentyMicStageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CEB9EAF2D0AF4FE00443480 /* TwentyMicStageView.m */; }; 4CEB9EB32D0AFCE200443480 /* NineteenMicStageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CEB9EB22D0AFCE200443480 /* NineteenMicStageView.m */; }; + 4CFBE0CA2DAD085700A923AF /* BravoGiftTabInfomationModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CFBE0C92DAD085700A923AF /* BravoGiftTabInfomationModel.m */; }; + 4CFBE0CD2DAD0FC400A923AF /* PIGiftBravoGiftBroadcastView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CFBE0CC2DAD0FC400A923AF /* PIGiftBravoGiftBroadcastView.m */; }; 4CFFEFCD2D3A4E410035D016 /* AppOfficalManagerActionsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CFFEFCC2D3A4E410035D016 /* AppOfficalManagerActionsViewController.m */; }; 4CFFEFD02D3A5E130035D016 /* Api+SuperAdmin.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CFFEFCF2D3A5E130035D016 /* Api+SuperAdmin.m */; }; 540EC1D02C89925F00F3BF0D /* GiftComboView.m in Sources */ = {isa = PBXBuildFile; fileRef = 540EC1CF2C89925F00F3BF0D /* GiftComboView.m */; }; @@ -2073,7 +2074,6 @@ 234D821D2AEC57CF0022EFEB /* YYTextAsyncLayer+PITextAsyncLayer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = "YYTextAsyncLayer+PITextAsyncLayer.m"; path = "YuMi/Appdelegate/YYTextAsyncLayer+PITextAsyncLayer.m"; sourceTree = SOURCE_ROOT; }; 234E50AD2BF7352C005CB6D5 /* NSTextAttachment+MSImage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSTextAttachment+MSImage.h"; sourceTree = ""; }; 234E50AE2BF7352C005CB6D5 /* NSTextAttachment+MSImage.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSTextAttachment+MSImage.m"; sourceTree = ""; }; - 234F44E22B3EA4F900E2B532 /* PILineManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PILineManager.swift; sourceTree = ""; }; 235714872BECC38F004C81D6 /* MessageHeadlinesTextModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MessageHeadlinesTextModel.h; sourceTree = ""; }; 235714882BECC38F004C81D6 /* MessageHeadlinesTextModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MessageHeadlinesTextModel.m; sourceTree = ""; }; 235714962BEDF54E004C81D6 /* MsRoomMessageMainView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MsRoomMessageMainView.h; sourceTree = ""; }; @@ -2723,10 +2723,10 @@ 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 = ""; }; + 4CE746D02D92A2660094E496 /* BravoGiftBannerView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BravoGiftBannerView.h; sourceTree = ""; }; + 4CE746D12D92A2660094E496 /* BravoGiftBannerView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BravoGiftBannerView.m; sourceTree = ""; }; + 4CE746D32D92C1080094E496 /* BravoGiftWinningFlagView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BravoGiftWinningFlagView.h; sourceTree = ""; }; + 4CE746D42D92C1080094E496 /* BravoGiftWinningFlagView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BravoGiftWinningFlagView.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 = ""; }; @@ -2737,6 +2737,10 @@ 4CEB9EAF2D0AF4FE00443480 /* TwentyMicStageView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TwentyMicStageView.m; sourceTree = ""; }; 4CEB9EB12D0AFCE200443480 /* NineteenMicStageView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NineteenMicStageView.h; sourceTree = ""; }; 4CEB9EB22D0AFCE200443480 /* NineteenMicStageView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NineteenMicStageView.m; sourceTree = ""; }; + 4CFBE0C82DAD085700A923AF /* BravoGiftTabInfomationModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BravoGiftTabInfomationModel.h; sourceTree = ""; }; + 4CFBE0C92DAD085700A923AF /* BravoGiftTabInfomationModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BravoGiftTabInfomationModel.m; sourceTree = ""; }; + 4CFBE0CB2DAD0FC400A923AF /* PIGiftBravoGiftBroadcastView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PIGiftBravoGiftBroadcastView.h; sourceTree = ""; }; + 4CFBE0CC2DAD0FC400A923AF /* PIGiftBravoGiftBroadcastView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PIGiftBravoGiftBroadcastView.m; sourceTree = ""; }; 4CFFEFCB2D3A4E410035D016 /* AppOfficalManagerActionsViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppOfficalManagerActionsViewController.h; sourceTree = ""; }; 4CFFEFCC2D3A4E410035D016 /* AppOfficalManagerActionsViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppOfficalManagerActionsViewController.m; sourceTree = ""; }; 4CFFEFCE2D3A5E130035D016 /* Api+SuperAdmin.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Api+SuperAdmin.h"; sourceTree = ""; }; @@ -6023,7 +6027,6 @@ 234F44E12B3EA4DC00E2B532 /* YMLine */ = { isa = PBXGroup; children = ( - 234F44E22B3EA4F900E2B532 /* PILineManager.swift */, ); path = YMLine; sourceTree = ""; @@ -6816,8 +6819,8 @@ 4CE746C92D929D500094E496 /* Common */ = { isa = PBXGroup; children = ( - 4CE746D02D92A2660094E496 /* BroveGiftBannerView.h */, - 4CE746D12D92A2660094E496 /* BroveGiftBannerView.m */, + 4CE746D02D92A2660094E496 /* BravoGiftBannerView.h */, + 4CE746D12D92A2660094E496 /* BravoGiftBannerView.m */, 4CE746C72D929D500094E496 /* BaseRoomBannerView.h */, 4CE746C82D929D500094E496 /* BaseRoomBannerView.m */, ); @@ -7732,6 +7735,8 @@ 4CA532B62D5B333200B8F59F /* RoomLuckyPackageInfoModel.m */, 4C75CEF92D6318FF009147A5 /* RoomEnterModel.h */, 4C75CEFA2D6318FF009147A5 /* RoomEnterModel.m */, + 4CFBE0C82DAD085700A923AF /* BravoGiftTabInfomationModel.h */, + 4CFBE0C92DAD085700A923AF /* BravoGiftTabInfomationModel.m */, ); path = Model; sourceTree = ""; @@ -8543,8 +8548,8 @@ 54E4D52F2C9048E1009E1FEA /* LuckyGiftWinningFlagView.m */, 54E4D5312C90658C009E1FEA /* LuckyGiftWinningBannerView.h */, 54E4D5322C90658C009E1FEA /* LuckyGiftWinningBannerView.m */, - 4CE746D32D92C1080094E496 /* BroveGiftWinningFlagView.h */, - 4CE746D42D92C1080094E496 /* BroveGiftWinningFlagView.m */, + 4CE746D32D92C1080094E496 /* BravoGiftWinningFlagView.h */, + 4CE746D42D92C1080094E496 /* BravoGiftWinningFlagView.m */, ); path = AnimationView; sourceTree = ""; @@ -9831,6 +9836,8 @@ 54F179092C8EDDF400CB5219 /* CountdownRingView.m */, 5468995B2C8AFE4C0049136A /* GiftComboFlagView.h */, 5468995C2C8AFE4C0049136A /* GiftComboFlagView.m */, + 4CFBE0CB2DAD0FC400A923AF /* PIGiftBravoGiftBroadcastView.h */, + 4CFBE0CC2DAD0FC400A923AF /* PIGiftBravoGiftBroadcastView.m */, ); path = View; sourceTree = ""; @@ -12000,6 +12007,7 @@ E80E09B32A42071D00CD2BE7 /* XPRoomStarKitchenBannerView.m in Sources */, E8B846C726FDB45000A777FE /* XPMineUserInfoAlbumProtocol.h in Sources */, 9B1EF3D527E8294B00554295 /* XPMineDressEmptyCollectionViewCell.m in Sources */, + 4CFBE0CD2DAD0FC400A923AF /* PIGiftBravoGiftBroadcastView.m in Sources */, E890BC07273CF1800007C46B /* XPGiftCountCollectionViewCell.m in Sources */, E88C72A02828FCD40047FB2B /* XPMusicLibraryPlayView.m in Sources */, E823E38E290BE8BD00EADD86 /* WishGiftInfoUpdateModel.m in Sources */, @@ -12348,6 +12356,7 @@ 23E9EAB22A84C9DE00B792F2 /* XPMineUserInfoTagViewCell.m in Sources */, 9B42869C28C1FD3D009034D2 /* XPOpenRedPacketCell.m in Sources */, 23D321D22ADD0EBC006B259C /* PIRoomPhotoAlbumItemPresenter.m in Sources */, + 4CFBE0CA2DAD085700A923AF /* BravoGiftTabInfomationModel.m in Sources */, 239D0FD22C046EAD002977CE /* MSTabbarRoomGameView.m in Sources */, 4C864A052D561E1D00191AE0 /* LuckyPackageLogicManager.m in Sources */, 9BFE992E288142FD009DA429 /* RoomClassifyModel.m in Sources */, @@ -12628,7 +12637,7 @@ E8DEC9A82764A68B0078CB70 /* Api+MoreMenu.m in Sources */, 9B86D87A2817DD8400494FCD /* XPRoomEnterHideTipView.m in Sources */, 23FE47E12BB41CF200F09D23 /* PINobleCenterListReusableView.m in Sources */, - 4CE746D52D92C1080094E496 /* BroveGiftWinningFlagView.m in Sources */, + 4CE746D52D92C1080094E496 /* BravoGiftWinningFlagView.m in Sources */, E8AC721026F43955007D6E91 /* UIImageConstant.m in Sources */, E85E7B122A4EB0D200B6D00A /* GuildIncomeRecordModel.m in Sources */, E81C27A026EEF83D0031E639 /* YUMIHtmlUrl.m in Sources */, @@ -12863,7 +12872,7 @@ E81366E726F0A49E0076364C /* NSString+Utils.m in Sources */, 23194DD22AD14BF000649F51 /* DDFileLogger.m in Sources */, E8EEB90126FC31B6007C6EBA /* XPMineUserInfoPresenter.m in Sources */, - 4CE746D22D92A2660094E496 /* BroveGiftBannerView.m in Sources */, + 4CE746D22D92A2660094E496 /* BravoGiftBannerView.m in Sources */, 4C864A022D55F4F600191AE0 /* LuckyPackagePresenter.m in Sources */, E81A65312834E53600F55894 /* XPMomentsLatestViewController.m in Sources */, 18F404BB2760982000A6C548 /* ChatLimitModel.m in Sources */, @@ -13156,7 +13165,6 @@ 238B37D62AC55A2C00BFC9D5 /* XPTreasureFairyTrialsView.m in Sources */, E82109AD26F1C8A000FC3319 /* CountDownHelper.m in Sources */, E878B8582835F0D300E22DCF /* MonentsInteractiveModel.m in Sources */, - 234F44E32B3EA4F900E2B532 /* PILineManager.swift in Sources */, E87DF4E42A42CAD2009C1185 /* XPHomeSearchNavView.m in Sources */, 9BD2ECCE288F829600F5CD9A /* XPMineFootPrintViewController.m in Sources */, 9B4E920028E57A620033419E /* XPGiftHeadTypeView.m in Sources */, @@ -13692,8 +13700,6 @@ "-framework", "\"JavaScriptCore\"", "-framework", - "\"LineSDK\"", - "-framework", "\"LocalAuthentication\"", "-framework", "\"MBProgressHUD\"", @@ -14027,8 +14033,6 @@ "-framework", "\"JavaScriptCore\"", "-framework", - "\"LineSDK\"", - "-framework", "\"LocalAuthentication\"", "-framework", "\"MBProgressHUD\"", diff --git a/YuMi/Appdelegate/AppDelegate+ThirdConfig.m b/YuMi/Appdelegate/AppDelegate+ThirdConfig.m index 8c3a2f17..c09c0a73 100644 --- a/YuMi/Appdelegate/AppDelegate+ThirdConfig.m +++ b/YuMi/Appdelegate/AppDelegate+ThirdConfig.m @@ -27,6 +27,7 @@ #import #import +#import #import "YuMi-swift.h" @@ -75,6 +76,7 @@ UIKIT_EXTERN NSString * adImageName; /** 崩溃收集 Bugly */ + - (void) configBugly { BuglyConfig *config = [[BuglyConfig alloc] init]; @@ -83,16 +85,15 @@ UIKIT_EXTERN NSString * adImageName; #ifdef DEBUG config.debugMode = NO;//YES; // debug 模式下,开启调试模式 config.channel = [YYUtility getAppSource]; -// config.blockMonitorEnable = YES; // 卡顿监控开关,默认关闭 - config.reportLogLevel = BuglyLogLevelSilent; // BuglyLogLevelVerbose; // 设置打印日志级别 + config.reportLogLevel = BuglyLogLevelWarn;// BuglyLogLevelSilent; // BuglyLogLevelVerbose; // 设置打印日志级别 [Bugly startWithAppId:@"c937fd00f7" config:config]; #else config.unexpectedTerminatingDetectionEnable = YES; // 非正常退出事件记录开关,默认关闭 config.debugMode = NO; // release 模式下,关闭调试模式 config.channel = [YYUtility getAppSource];; - config.blockMonitorEnable = NO; // 卡顿监控开关,默认关闭 + config.blockMonitorEnable = YES; // 卡顿监控开关,默认关闭 config.reportLogLevel = BuglyLogLevelWarn; // 设置自定义日志上报的级别,默认不上报自定义日志 - NSString *buylyKey = @"8627948559"; // isEnterprise == NO ? @"5334684d86" : @"d65df59a68"; + NSString *buylyKey = @"8627948559"; [Bugly startWithAppId:buylyKey config:config]; #endif } @@ -121,7 +122,7 @@ UIKIT_EXTERN NSString * adImageName; - (void)configShareSDK { - [PILineLoginManager registerLine]; +// [PILineLoginManager registerLine]; [ShareSDK registPlatforms:^(SSDKRegister *platformsRegister) { ///faceBook diff --git a/YuMi/Assets.xcassets/20.20.56/bravo_speaker.imageset/4cc1494e9e1f9153726ebc7fb2d5d12ef75635b53fe46-nx2IAX_fw480@3x.png b/YuMi/Assets.xcassets/20.20.56/bravo_speaker.imageset/4cc1494e9e1f9153726ebc7fb2d5d12ef75635b53fe46-nx2IAX_fw480@3x.png new file mode 100644 index 00000000..fb7199d6 Binary files /dev/null and b/YuMi/Assets.xcassets/20.20.56/bravo_speaker.imageset/4cc1494e9e1f9153726ebc7fb2d5d12ef75635b53fe46-nx2IAX_fw480@3x.png differ diff --git a/YuMi/Assets.xcassets/20.20.56/bravo_speaker.imageset/Contents.json b/YuMi/Assets.xcassets/20.20.56/bravo_speaker.imageset/Contents.json new file mode 100644 index 00000000..5be76fca --- /dev/null +++ b/YuMi/Assets.xcassets/20.20.56/bravo_speaker.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "4cc1494e9e1f9153726ebc7fb2d5d12ef75635b53fe46-nx2IAX_fw480@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YuMi/Assets.xcassets/Language/ar/bravo_speaker_ar.imageset/4cc1494e9e1f9153726ebc7fb2d5d12ef75635b53fe46-nx2IAX_fw480@3x.png b/YuMi/Assets.xcassets/Language/ar/bravo_speaker_ar.imageset/4cc1494e9e1f9153726ebc7fb2d5d12ef75635b53fe46-nx2IAX_fw480@3x.png new file mode 100644 index 00000000..f9ed6321 Binary files /dev/null and b/YuMi/Assets.xcassets/Language/ar/bravo_speaker_ar.imageset/4cc1494e9e1f9153726ebc7fb2d5d12ef75635b53fe46-nx2IAX_fw480@3x.png differ diff --git a/YuMi/Assets.xcassets/Language/ar/bravo_speaker_ar.imageset/Contents.json b/YuMi/Assets.xcassets/Language/ar/bravo_speaker_ar.imageset/Contents.json new file mode 100644 index 00000000..5be76fca --- /dev/null +++ b/YuMi/Assets.xcassets/Language/ar/bravo_speaker_ar.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "4cc1494e9e1f9153726ebc7fb2d5d12ef75635b53fe46-nx2IAX_fw480@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YuMi/Modules/YMLogin/Presenter/LoginPresenter.m b/YuMi/Modules/YMLogin/Presenter/LoginPresenter.m index f9b4b8db..9a429124 100644 --- a/YuMi/Modules/YMLogin/Presenter/LoginPresenter.m +++ b/YuMi/Modules/YMLogin/Presenter/LoginPresenter.m @@ -155,30 +155,7 @@ static NSString *clinet_s = @"uyzjdhds"; } -(void)thirdLoginByLine:(UIViewController *)presentingViewController { - PILineLoginManager *line = [PILineLoginManager getSharedInstance]; - [XNDJTDDLoadingTool showOnlyView:kWindow]; - @kWeakify(self); - [line loginLineFromController:presentingViewController - completeWithError:^(LineLoginResultStatus loginStatus, NSString * _Nullable token, NSString * _Nullable userId, NSString * _Nullable emali, NSError * _Nullable error) { - @kStrongify(self); - if (loginStatus == LineLoginResultStatusSuccess) { - ThirdUserInfo * userInfo = [[ThirdUserInfo alloc] init]; - NSString * openid = userId.length > 0 ? userId : @""; - NSString * access_token = token.length > 0 ? token : @""; - NSString * unionid = userId.length > 0 ? userId : @""; - userInfo.openid = openid; - userInfo.access_token = access_token; - userInfo.unionid = unionid; - [AccountInfoStorage instance].thirdUserInfo = userInfo; - [self loginWithThirdPartWithType:ThirdLoginType_Line]; - } else if (loginStatus == LineLoginResultStatusCancelled) { - [XNDJTDDLoadingTool hideOnlyView:kWindow]; - [[self getView] showErrorToast:YMLocalizedString(@"LoginPresenter0")]; - } else if (loginStatus == LineLoginResultStatusError) { - [XNDJTDDLoadingTool hideOnlyView:kWindow]; - [[self getView] showErrorToast:YMLocalizedString(@"LoginPresenter1")]; - } - }]; + } -(void)thirdLoginByFBWithPresentingViewController:(UIViewController *)presentingViewController { diff --git a/YuMi/Modules/YMMessage/View/Session/Cell/AgentMessageTableViewCell.m b/YuMi/Modules/YMMessage/View/Session/Cell/AgentMessageTableViewCell.m index de7ac104..3e6ca097 100644 --- a/YuMi/Modules/YMMessage/View/Session/Cell/AgentMessageTableViewCell.m +++ b/YuMi/Modules/YMMessage/View/Session/Cell/AgentMessageTableViewCell.m @@ -31,8 +31,7 @@ - (void)initSubViews { [super initSubViews]; - - self.backView.backgroundColor = [UIColor whiteColor]; + [self.backView addSubview:self.iconImageView]; [self.backView addSubview:self.titleLabel]; [self.backView addSubview:self.messageLabel]; @@ -114,6 +113,8 @@ endPoint:CGPointMake(0.5, 1) cornerRadius:8]; self.avatarStackView.hidden = YES; + self.agreeButton.enabled = YES; + self.rejectButton.enabled = YES; // 请求方不显示操作按钮 if (model.isSender) { @@ -129,6 +130,7 @@ self.titleLabel.text = YMLocalizedString(@"20.20.56_text_10"); self.agreeButton.enabled = NO; self.rejectButton.enabled = NO; + self.stackView.hidden = NO; [self.agreeButton addGradientBackgroundWithColors:@[ UIColorFromRGB(0xEBEBEB), UIColorFromRGB(0xEBEBEB), @@ -137,13 +139,21 @@ self.agreeButton.hidden = model.status!=1; self.rejectButton.hidden = model.status==1; } else if (model.isUserTaped == 2) { - self.agreeButton.hidden = model.status==1; - self.rejectButton.hidden = model.status!=1; + self.agreeButton.hidden = model.status==2; + self.rejectButton.hidden = model.status!=2; } + [self.messageLabel mas_remakeConstraints:^(MASConstraintMaker *make) { + make.leading.trailing.mas_equalTo(self.backView); + make.top.mas_equalTo(self.titleLabel.mas_bottom).mas_equalTo(10); + make.bottom.mas_equalTo(self.backView).offset(-40); + }]; } else { + self.agreeButton.enabled = YES; + self.rejectButton.enabled = YES; switch (model.status) { case 0: case 2: + self.stackView.hidden = NO; self.titleLabel.text = YMLocalizedString(@"20.20.56_text_10"); if (model.isSender) { [self.messageLabel mas_remakeConstraints:^(MASConstraintMaker *make) { @@ -151,6 +161,12 @@ make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(10); make.bottom.mas_equalTo(self.backView).offset(-10); }]; + } else { + [self.messageLabel mas_remakeConstraints:^(MASConstraintMaker *make) { + make.leading.trailing.mas_equalTo(self.backView); + make.top.mas_equalTo(self.titleLabel.mas_bottom).mas_equalTo(10); + make.bottom.mas_equalTo(self.backView).offset(-40); + }]; } break; case 1: { @@ -162,6 +178,7 @@ } self.avatarStackView.hidden = NO; self.stackView.hidden = YES; + self.titleLabel.text = YMLocalizedString(@"20.20.56_text_10"); [self.messageLabel mas_remakeConstraints:^(MASConstraintMaker *make) { make.leading.trailing.mas_equalTo(self.backView); make.top.mas_equalTo(self.avatarStackView.mas_bottom).offset(10); @@ -178,6 +195,11 @@ } - (void)updateMessageContent:(MessageCPNotifyModel *)model { + if (model.status == 2) { + self.messageLabel.text = YMLocalizedString(@"20.20.56_text_20"); + return; + } + NSString *part_1 = model.status == 0 ? YMLocalizedString(@"20.20.56_text_13") : YMLocalizedString(@"20.20.56_text_14"); if (model.isUserTaped > 0) { part_1 = YMLocalizedString(@"20.20.56_text_13") ; @@ -248,9 +270,6 @@ #pragma mark - - (void)didTapAgree { - // TODO: 根据model来处理点击事件 - // TODO: 保存结果到本地(?) - // TODO: 如果是发起者,不显示按钮 if (self.customMessageDelegate && [self.customMessageDelegate respondsToSelector:@selector(didTapAccept:)]) { [self.customMessageDelegate didTapAccept:self.model.message]; } @@ -295,6 +314,7 @@ UIColorFromRGB(0xFCC074), ] startPoint:CGPointMake(0, 0.5) endPoint:CGPointMake(1, 0.5) cornerRadius:15]; [_agreeButton setTitle:YMLocalizedString(@"XPAnchorPKInviteView7") forState:UIControlStateNormal]; + [_agreeButton setTitle:YMLocalizedString(@"20.20.56_text_18") forState:UIControlStateDisabled]; [_agreeButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; [_agreeButton setTitleColor:UIColorFromRGB(0x7b7b7d) forState:UIControlStateDisabled]; _agreeButton.titleLabel.font = kFontMedium(14); @@ -309,6 +329,7 @@ _rejectButton.backgroundColor = UIColorFromRGB(0xEBEBEB); [_rejectButton setCornerRadius:15]; [_rejectButton setTitle:YMLocalizedString(@"XPAnchorPKInviteView6") forState:UIControlStateNormal]; + [_rejectButton setTitle:YMLocalizedString(@"20.20.56_text_19") forState:UIControlStateDisabled]; [_rejectButton setTitleColor:UIColorFromRGB(0x7b7b7d) forState:UIControlStateNormal]; _rejectButton.titleLabel.font = kFontMedium(14); [_rejectButton addTarget:self action:@selector(didTapReject) forControlEvents:UIControlEventTouchUpInside]; @@ -343,7 +364,7 @@ - (NetImageView *)avatarMe { if (!_avatarMe) { _avatarMe = [[NetImageView alloc] init]; - [_avatarMe setCornerRadius:55/2]; + [_avatarMe setAllCornerRadius:55/2 borderWidth:1 borderColor:UIColorFromRGB(0xffe046)]; } return _avatarMe; } @@ -351,7 +372,7 @@ - (NetImageView *)avatarOther { if (!_avatarOther) { _avatarOther = [[NetImageView alloc] init]; - [_avatarOther setCornerRadius:55/2]; + [_avatarOther setAllCornerRadius:55/2 borderWidth:1 borderColor:UIColorFromRGB(0xffe046)]; } return _avatarOther; } diff --git a/YuMi/Modules/YMMessage/View/Session/Cell/MessageCell.m b/YuMi/Modules/YMMessage/View/Session/Cell/MessageCell.m index c23e4861..74cff4ec 100644 --- a/YuMi/Modules/YMMessage/View/Session/Cell/MessageCell.m +++ b/YuMi/Modules/YMMessage/View/Session/Cell/MessageCell.m @@ -56,6 +56,8 @@ @property (nonatomic, strong) UIView * messageBackground; @property (nonatomic, strong) MASConstraint * messageBackgroundLeft; @property (nonatomic, strong) MASConstraint * messageBackgroundRight; +@property (nonatomic, strong) MASConstraint * messageBackgroundLeftAvatar; +@property (nonatomic, strong) MASConstraint * messageBackgroundRightAvatar; /** 消息内容实体 */ @@ -108,6 +110,8 @@ [self.messageBackground mas_makeConstraints:^(MASConstraintMaker *make) { self.messageBackgroundLeft = make.leading.mas_equalTo(self.leftAvatar.mas_trailing).offset(15); self.messageBackgroundRight = make.trailing.mas_equalTo(self.rightAvatar.mas_leading).offset(-15); + self.messageBackgroundLeftAvatar = make.leading.mas_equalTo(self.leftAvatar.mas_leading); + self.messageBackgroundRightAvatar = make.trailing.mas_equalTo(self.rightAvatar.mas_trailing); make.top.mas_equalTo(self).offset(20); }]; @@ -205,6 +209,8 @@ - (void)renderWithMessage:(MessageBaseModel *)model { NIMMessage * message = model.message; + NSString * classStr = [model cellContent:model]; + self.currentModel = model; self.currentMessage = message; NSString * avatarUrl = [[NIMSDK sharedSDK].userManager userInfo:message.from].userInfo.avatarUrl; @@ -213,14 +219,34 @@ avatarUrl = [[[XPSkillCardPlayerManager shareInstance] userInfoModel] avatar]; self.leftAvatar.hidden = YES; self.rightAvatar.hidden = NO; - [self.messageBackgroundLeft uninstall]; - [self.messageBackgroundRight install]; + + if ([classStr isEqualToString:@"AgentMessageTableViewCell"]) { + [self.messageBackgroundLeft uninstall]; + [self.messageBackgroundLeftAvatar install]; + [self.messageBackgroundRight install]; + [self.messageBackgroundRightAvatar uninstall]; + } else { + [self.messageBackgroundLeft uninstall]; + [self.messageBackgroundRight install]; + [self.messageBackgroundLeftAvatar uninstall]; + [self.messageBackgroundRightAvatar uninstall]; + } self.rightAvatar.imageUrl = avatarUrl; } else { self.leftAvatar.hidden = NO; self.rightAvatar.hidden = YES; - [self.messageBackgroundLeft install]; - [self.messageBackgroundRight uninstall]; + + if ([classStr isEqualToString:@"AgentMessageTableViewCell"]) { + [self.messageBackgroundLeft install]; + [self.messageBackgroundLeftAvatar uninstall]; + [self.messageBackgroundRight uninstall]; + [self.messageBackgroundRightAvatar install]; + } else { + [self.messageBackgroundLeft install]; + [self.messageBackgroundRight uninstall]; + [self.messageBackgroundLeftAvatar uninstall]; + [self.messageBackgroundRightAvatar uninstall]; + } self.leftAvatar.imageUrl = avatarUrl; } @@ -229,7 +255,6 @@ [self.messageContent removeFromSuperview]; } - NSString * classStr = [model cellContent:model]; if (classStr) { if (![self.messageContent isKindOfClass:NSClassFromString(classStr)]) { self.messageContent = [[NSClassFromString(classStr) alloc] init]; @@ -256,10 +281,12 @@ }]; } else { [self.messageContent mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.top.trailing.bottom.mas_equalTo(self.messageBackground); +// make.edges.mas_equalTo(self.messageBackground); + make.top.bottom.mas_equalTo(self.messageBackground); + make.size.mas_equalTo(self.messageBackground); }]; } - [self.messageContent.superview layoutIfNeeded]; + if (model.isHiddenAvatar) { self.leftAvatar.hidden= YES; self.rightAvatar.hidden = YES; @@ -270,6 +297,7 @@ }]; } [self.messageContent render:model]; + [self.messageContent.superview layoutIfNeeded]; } - (void)handleMessageFail:(MessageBaseModel *)model { diff --git a/YuMi/Modules/YMMessage/View/Session/Content/SesssionModel/AgentMessageModel.m b/YuMi/Modules/YMMessage/View/Session/Content/SesssionModel/AgentMessageModel.m index 459f9838..50ccd0d3 100644 --- a/YuMi/Modules/YMMessage/View/Session/Content/SesssionModel/AgentMessageModel.m +++ b/YuMi/Modules/YMMessage/View/Session/Content/SesssionModel/AgentMessageModel.m @@ -50,15 +50,8 @@ CGFloat titleHeight = 30; CGFloat contentHeight = textRect.size.height; -//#if DEBUG -// contentHeight = 150; -// self.layoutType = 2; -//#endif CGFloat buttonHeight = self.layoutType == 0 ? 0 : 40; self.height = titleHeight + contentHeight + buttonHeight + 20; - - // TODO: 補充富文本格式 | 補充 API call 邏輯 - } return self; } diff --git a/YuMi/Modules/YMMessage/View/Session/Content/SesssionModel/MessageCPNotifyModel.m b/YuMi/Modules/YMMessage/View/Session/Content/SesssionModel/MessageCPNotifyModel.m index b1de524b..ac3fe2f1 100644 --- a/YuMi/Modules/YMMessage/View/Session/Content/SesssionModel/MessageCPNotifyModel.m +++ b/YuMi/Modules/YMMessage/View/Session/Content/SesssionModel/MessageCPNotifyModel.m @@ -12,8 +12,7 @@ - (instancetype)initWithMessage:(NIMMessage *)message { if (self = [super initWithMessage:message]) { - self.messageType = SessionMessageType_Custom; - +// self.messageType = SessionMessageType_Custom; NIMCustomObject *obj = (NIMCustomObject *)message.messageObject; AttachmentModel *attach = (AttachmentModel *)obj.attachment; NSDictionary * dic = attach.data; @@ -25,7 +24,7 @@ self.uid = [[dic objectForKey:@"uid"] integerValue]; self.first = attach.first; self.second = attach.second; - self.isSender = [[[AccountInfoStorage instance] getUid] integerValue] == self.uid; + self.isSender = [[[AccountInfoStorage instance] getUid] integerValue] == self.uid || self.uid == 0; self.isUserTaped = [[dic objectForKey:@"user_action"] integerValue]; if (self.isSender) { diff --git a/YuMi/Modules/YMMessage/View/Session/SessionViewController.m b/YuMi/Modules/YMMessage/View/Session/SessionViewController.m index d3db346d..c103450a 100644 --- a/YuMi/Modules/YMMessage/View/Session/SessionViewController.m +++ b/YuMi/Modules/YMMessage/View/Session/SessionViewController.m @@ -156,8 +156,10 @@ - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; - [self.presenter getFansLike:self.session.sessionId]; - [self.presenter getUserInfoWithUid:self.session.sessionId]; + if (![[[ClientConfig shareConfig].configInfo officialAccountUids] containsObject:self.session.sessionId]) { + [self.presenter getFansLike:self.session.sessionId]; + [self.presenter getUserInfoWithUid:self.session.sessionId]; + } } - (void)initHeaderAndFooterRrfresh { @@ -220,8 +222,6 @@ } [self.sessionTableView reloadData]; [self.sessionTableView nim_scrollToBottom:YES]; - -// [self updateCPMessageAccept:firstmessage]; }]; } } @@ -849,6 +849,19 @@ if (![session isEqual:self.session] ) { return; } + + // 不处理点击拒绝的显示 +// NIMCustomObject *obj = (NIMCustomObject *)message.messageObject; +// AttachmentModel *attachment = (AttachmentModel *)obj.attachment; +// if (attachment.second == Custom_Message_Sub_CP_message_result) { +// NSDictionary *data = attachment.data; +// NSNumber *status = [data objectForKey:@"status"]; +// if (status && status.integerValue == 2) { +// [[NIMSDK sharedSDK].conversationManager deleteMessage:message]; +// return; +// } +// } + for (NIMMessage *message in messages) { [self addTimeMessage:message]; if (message.isDeleted) { diff --git a/YuMi/Modules/YMMessage/View/Session/XPSessionMainViewController.m b/YuMi/Modules/YMMessage/View/Session/XPSessionMainViewController.m index a0850d7b..0af94413 100644 --- a/YuMi/Modules/YMMessage/View/Session/XPSessionMainViewController.m +++ b/YuMi/Modules/YMMessage/View/Session/XPSessionMainViewController.m @@ -19,11 +19,15 @@ #import "MessagePresenter.h" #import "MessageProtocol.h" -@interface XPSessionMainViewController () -@property (nonatomic, strong) JXCategoryTitleView *titleView; -@property (nonatomic, strong) JXCategoryIndicatorImageView *lineView; -@property (nonatomic, strong) JXPagerView *pagingView; +@interface XPSessionMainViewController () + @property (nonatomic, strong) NSArray *titles; +@property (nonatomic, strong) UIPageViewController *pageViewController; +@property (nonatomic, strong) NSArray *viewControllers; +@property (nonatomic, assign) NSInteger currentIndex; +@property (nonatomic, strong) UIStackView *buttonStackView; +@property (nonatomic, strong) NSMutableArray *segmentButtons; +@property (nonatomic, strong) UIScrollView *scrollView; // 添加 scrollView 属性 @property (nonatomic,strong) SessionListViewController *sessionListVC; ///好友 @@ -56,23 +60,6 @@ } #pragma mark - Private Method - -- (void)setupTopTheme { - __block UIImageView *theme = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, kGetScaleWidth(140))]; - theme.image = [[ClientConfig shareConfig] navigationAreaBG]; - theme.contentMode = UIViewContentModeScaleAspectFill; - [self.view addSubview:theme]; - - [[NSNotificationCenter defaultCenter] addObserverForName:[ClientConfig shareConfig].reloadNavigationAreaImageKey - object:nil - queue:[NSOperationQueue mainQueue] - usingBlock:^(NSNotification * _Nonnull notification) { - if ([notification.object isKindOfClass:[UIImage class]]) { - theme.image = (UIImage *)notification.object; - } - }]; -} - - (void)initSubViews { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(getTabBarItemBadge:) @@ -81,17 +68,27 @@ self.view.backgroundColor = [[ClientConfig shareConfig] bgColor]; -// self.headView = [UIView new]; - [self.view addSubview:self.pagingView]; + // 初始化分页控制器 + self.pageViewController = [[UIPageViewController alloc] initWithTransitionStyle:UIPageViewControllerTransitionStyleScroll + navigationOrientation:UIPageViewControllerNavigationOrientationHorizontal + options:nil]; + self.pageViewController.dataSource = self; + self.pageViewController.delegate = self; + [self addChildViewController:self.pageViewController]; + [self.view addSubview:self.pageViewController.view]; + [self.pageViewController didMoveToParentViewController:self]; + + // 初始化顶部按钮 + [self setupTopButtons]; + + // 设置初始页面 + self.viewControllers = @[self.sessionListVC, self.friendVC, self.attentionVC, self.fansVC]; + [self.pageViewController setViewControllers:@[self.viewControllers[0]] + direction:UIPageViewControllerNavigationDirectionForward + animated:NO + completion:nil]; } - (void)initSubViewConstraints { - - [self.pagingView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.trailing.equalTo(self.view); - make.bottom.mas_equalTo(-1); - make.top.equalTo(self.view);//.mas_offset(-50); - }]; - UIView *lineView = [UIView new]; lineView.backgroundColor = UIColorFromRGB(0xF5F6FA); [self.view addSubview:lineView]; @@ -99,7 +96,140 @@ make.bottom.leading.trailing.equalTo(self.view); make.height.mas_equalTo(1); }]; + + // 设置页面控制器约束 + [self.pageViewController.view mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.equalTo(self.buttonStackView.mas_bottom).offset(10); + make.left.right.bottom.equalTo(self.view); + }]; } + +- (void)setupTopButtons { + self.segmentButtons = [NSMutableArray array]; + self.buttonStackView = [[UIStackView alloc] init]; + self.buttonStackView.axis = UILayoutConstraintAxisHorizontal; + self.buttonStackView.spacing = (isMSZH() || isMSZH()) ? 16 : 4; + self.buttonStackView.distribution = UIStackViewDistributionFill;//UIStackViewDistributionFillEqually; + self.buttonStackView.semanticContentAttribute = isMSRTL() ? UISemanticContentAttributeForceRightToLeft : UISemanticContentAttributeForceLeftToRight; + + + if (isMSZH() || isMSRTL()) { + [self.view addSubview:self.buttonStackView]; + // 设置stackView约束 + [self.buttonStackView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo([UIApplication sharedApplication].keyWindow.safeAreaInsets.top); + make.leading.mas_equalTo(12); + }]; + } else { + // 创建滚动视图 + self.scrollView = [[UIScrollView alloc] init]; + self.scrollView.showsHorizontalScrollIndicator = NO; + self.scrollView.showsVerticalScrollIndicator = NO; + self.scrollView.bounces = NO; + [self.view addSubview:self.scrollView]; + // 设置scrollView约束 + [self.scrollView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo([UIApplication sharedApplication].keyWindow.safeAreaInsets.top); + make.height.mas_equalTo(44); // 设置一个固定高度 + make.leading.mas_equalTo(12); + make.trailing.mas_equalTo(-40); + }]; + [self.scrollView addSubview:self.buttonStackView]; + // 设置stackView约束 + [self.buttonStackView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.equalTo(self.scrollView); + make.height.equalTo(self.scrollView); + }]; + } + + for (NSInteger i = 0; i < self.titles.count; i++) { + UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; + [button setTitle:self.titles[i] forState:UIControlStateNormal]; + [button setTitleColor:UIColorFromRGB(0x313131) forState:UIControlStateNormal]; + [button setTitleColor:UIColorFromRGB(0x313131) forState:UIControlStateSelected]; + button.titleLabel.font = kFontRegular(16); + button.tag = i; + [button addTarget:self action:@selector(segmentButtonTapped:) forControlEvents:UIControlEventTouchUpInside]; + [self.segmentButtons addObject:button]; + [self.buttonStackView addArrangedSubview:button]; + } + + // 设置初始选中状态 + [self updateSegmentButtonSelection:0]; + + // 设置清除按钮 + [self.view addSubview:self.allCleanBtn]; + [self.allCleanBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.height.mas_equalTo(30); + make.centerY.mas_equalTo(self.buttonStackView); + make.trailing.mas_equalTo(-8); + }]; +} + +- (void)segmentButtonTapped:(UIButton *)sender { + NSInteger index = sender.tag; + if (index == self.currentIndex) return; + + UIViewController *targetVC = self.viewControllers[index]; + UIPageViewControllerNavigationDirection direction = index > self.currentIndex ? UIPageViewControllerNavigationDirectionForward : UIPageViewControllerNavigationDirectionReverse; + + [self.pageViewController setViewControllers:@[targetVC] + direction:direction + animated:YES + completion:nil]; + + [self updateSegmentButtonSelection:index]; +} + +- (void)updateSegmentButtonSelection:(NSInteger)index { + self.currentIndex = index; + [self.segmentButtons enumerateObjectsUsingBlock:^(UIButton *button, NSUInteger idx, BOOL *stop) { + button.selected = (idx == index); + button.titleLabel.font = button.selected ? kFontSemibold(20) : kFontRegular(16); + }]; + // 获取选中按钮 + UIButton *selectedButton = self.segmentButtons[index]; + CGRect buttonFrame = selectedButton.frame; + CGFloat scrollViewWidth = self.scrollView.bounds.size.width; + CGFloat currentOffset = self.scrollView.contentOffset.x; + + // 计算按钮的可见区域 + CGFloat buttonLeftEdge = buttonFrame.origin.x; + CGFloat buttonRightEdge = buttonFrame.origin.x + buttonFrame.size.width; + CGFloat visibleLeftEdge = currentOffset; + CGFloat visibleRightEdge = currentOffset + scrollViewWidth; + + // 只有当按钮不完全可见时才滚动 +// if (buttonLeftEdge < visibleLeftEdge) { +// // 如果按钮被左边遮挡,滚动到让按钮左对齐 +// [self.scrollView setContentOffset:CGPointMake(buttonLeftEdge, 0) animated:YES]; +// } else if (buttonRightEdge > visibleRightEdge) { +// // 如果按钮被右边遮挡,滚动最小距离使按钮完全可见 +// CGFloat newOffset = buttonRightEdge - scrollViewWidth; +// [self.scrollView setContentOffset:CGPointMake(newOffset, 0) animated:YES]; +// } + + + if (isMSRTL()) { + // RTL 布局时的滚动逻辑 + if (buttonRightEdge > visibleRightEdge) { + // 如果按钮被右边遮挡,滚动到让按钮右对齐 + [self.scrollView setContentOffset:CGPointMake(buttonRightEdge - scrollViewWidth, 0) animated:YES]; + } else if (buttonLeftEdge < visibleLeftEdge) { + // 如果按钮被左边遮挡,滚动最小距离使按钮完全可见 + [self.scrollView setContentOffset:CGPointMake(buttonLeftEdge, 0) animated:YES]; + } + } else { + // LTR 布局时的滚动逻辑(保持原来的逻辑) + if (buttonLeftEdge < visibleLeftEdge) { + [self.scrollView setContentOffset:CGPointMake(buttonLeftEdge, 0) animated:YES]; + } else if (buttonRightEdge > visibleRightEdge) { + CGFloat newOffset = buttonRightEdge - scrollViewWidth; + [self.scrollView setContentOffset:CGPointMake(newOffset, 0) animated:YES]; + } + } +} + #pragma mark - SessionListViewController通知 -(void)getTabBarItemBadge:(NSNotification *)not{ NSInteger badgeValue = [not.userInfo[@"BadgeValue"] integerValue]; @@ -110,46 +240,6 @@ } } -#pragma mark - JXCategoryViewDelegate -- (NSUInteger)tableHeaderViewHeightInPagerView:(JXPagerView *)pagerView { - return 44+[UIApplication sharedApplication].keyWindow.safeAreaInsets.top - 45; -} - -- (UIView *)tableHeaderViewInPagerView:(JXPagerView *)pagerView { - return [UIView new]; -} - -- (NSUInteger)heightForPinSectionHeaderInPagerView:(JXPagerView *)pagerView { - return 45; -} - -- (UIView *)viewForPinSectionHeaderInPagerView:(JXPagerView *)pagerView { - return self.titleView; -} - -- (NSInteger)numberOfListsInPagerView:(JXPagerView *)pagerView { - return self.titles.count; -} - -- (id)pagerView:(JXPagerView *)pagerView initListAtIndex:(NSInteger)index { - UIViewController *viewController; - switch (index) { - case 0: - return self.sessionListVC; - break; - case 1: - return self.friendVC; - break; - case 2: - return self.attentionVC; - break; - default: - return self.fansVC; - break; - } -// return (id )viewController; -} - - (NSArray *)titles { if (!_titles) { _titles = @[YMLocalizedString(@"XPSessionMainViewController0"), @@ -170,53 +260,35 @@ return time; } +#pragma mark - UIPageViewControllerDataSource + +- (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerBeforeViewController:(UIViewController *)viewController { + NSInteger index = [self.viewControllers indexOfObject:viewController]; + if (index == 0 || index == NSNotFound) { + return nil; + } + return self.viewControllers[index - 1]; +} + +- (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerAfterViewController:(UIViewController *)viewController { + NSInteger index = [self.viewControllers indexOfObject:viewController]; + if (index == self.viewControllers.count - 1 || index == NSNotFound) { + return nil; + } + return self.viewControllers[index + 1]; +} + +#pragma mark - UIPageViewControllerDelegate + +- (void)pageViewController:(UIPageViewController *)pageViewController didFinishAnimating:(BOOL)finished previousViewControllers:(NSArray *)previousViewControllers transitionCompleted:(BOOL)completed { + if (completed) { + UIViewController *currentVC = pageViewController.viewControllers.firstObject; + NSInteger index = [self.viewControllers indexOfObject:currentVC]; + [self updateSegmentButtonSelection:index]; + } +} + #pragma mark -懒加载 -- (JXCategoryTitleView *)titleView { - if (!_titleView) { - _titleView = [[JXCategoryTitleView alloc] init]; - _titleView.delegate = self; - _titleView.backgroundColor = [UIColor clearColor]; - _titleView.titleColor = UIColorFromRGB(0x313131); - _titleView.titleSelectedColor = UIColorFromRGB(0x313131); - _titleView.titleFont = kFontRegular(16); - _titleView.titleSelectedFont = kFontBold(20); - _titleView.titleLabelAnchorPointStyle = JXCategoryTitleLabelAnchorPointStyleBottom; - _titleView.contentScrollViewClickTransitionAnimationEnabled = NO; - _titleView.defaultSelectedIndex = 0; - _titleView.averageCellSpacingEnabled = NO; - _titleView.contentEdgeInsetLeft = 16; - _titleView.contentEdgeInsetRight = 120; - _titleView.titles = self.titles; - _titleView.cellSpacing = 20; - if (isMSEN() || isMSTR()) { - _titleView.customWidth = KScreenWidth - 40; - } - _titleView.listContainer = (id)self.pagingView.listContainerView; - - [_titleView addSubview:self.allCleanBtn]; - [self.allCleanBtn mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.height.mas_equalTo(30); - make.centerY.mas_equalTo(_titleView); - make.trailing.mas_equalTo(-8); - }]; - } - return _titleView; -} - -- (JXPagerView *)pagingView { - if (!_pagingView) { - _pagingView = [[JXPagerView alloc] initWithDelegate:self listContainerType:0]; - _pagingView.backgroundColor = [UIColor clearColor]; - _pagingView.listContainerView.backgroundColor = [UIColor clearColor]; - _pagingView.mainTableView.backgroundColor = [UIColor clearColor]; - _pagingView.listContainerView.listCellBackgroundColor = UIColor.clearColor; - _pagingView.pinSectionHeaderVerticalOffset = 57; - _pagingView.isListHorizontalScrollEnabled = NO; - _pagingView.mainTableView.gestureDelegate = self; - } - return _pagingView; -} - - (XPMineAttentionViewController *)attentionVC { if (!_attentionVC) { _attentionVC = [[XPMineAttentionViewController alloc] init]; diff --git a/YuMi/Modules/YMMine/Api/Api+Mine.h b/YuMi/Modules/YMMine/Api/Api+Mine.h index d202919b..cfb3dbfd 100644 --- a/YuMi/Modules/YMMine/Api/Api+Mine.h +++ b/YuMi/Modules/YMMine/Api/Api+Mine.h @@ -373,7 +373,7 @@ NS_ASSUME_NONNULL_BEGIN + (void)userCpNameChangeAudit:(HttpRequestHelperCompletion)completion recordId:(NSInteger)recordId status:(NSInteger)status; -+ (void)userCpNameTypeTopList:(HttpRequestHelperCompletion)completion; ++ (void)userCpNameTypeTopList:(HttpRequestHelperCompletion)completion uid:(NSInteger)uid; @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMMine/Api/Api+Mine.m b/YuMi/Modules/YMMine/Api/Api+Mine.m index dd964aae..b7b15db1 100644 --- a/YuMi/Modules/YMMine/Api/Api+Mine.m +++ b/YuMi/Modules/YMMine/Api/Api+Mine.m @@ -496,8 +496,8 @@ __FUNCTION__, @(recordId), @(status), nil]; } -+ (void)userCpNameTypeTopList:(HttpRequestHelperCompletion)completion { - [self makeRequest:@"user/cp/nameTypeTopList" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, nil]; ++ (void)userCpNameTypeTopList:(HttpRequestHelperCompletion)completion uid:(NSInteger)uid { + [self makeRequest:@"user/cp/nameTypeTopList" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, @(uid), nil]; } @end diff --git a/YuMi/Modules/YMMine/Model/RechargeUserModel.h b/YuMi/Modules/YMMine/Model/RechargeUserModel.h index 740baaaa..4afbba17 100644 --- a/YuMi/Modules/YMMine/Model/RechargeUserModel.h +++ b/YuMi/Modules/YMMine/Model/RechargeUserModel.h @@ -37,7 +37,7 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, copy) NSString *id; @property(nonatomic, assign) NSInteger uid; -@property(nonatomic, assign) NSInteger manageUid; // TODO, 有非 0 值,则表示用户为自代理,要在对应的 UI 隐藏自代理入口 +@property(nonatomic, assign) NSInteger manageUid; // 有非 0 值,则表示用户为自代理,要在对应的 UI 隐藏自代理入口 @property(nonatomic, assign) NSInteger starLevel; @property(nonatomic, assign) BOOL hasCharge; @property(nonatomic, copy) NSString *erbanNo; diff --git a/YuMi/Modules/YMMine/Presenter/XPMineUserInfoPresenter.h b/YuMi/Modules/YMMine/Presenter/XPMineUserInfoPresenter.h index 6e2dc53a..8e0a61d4 100644 --- a/YuMi/Modules/YMMine/Presenter/XPMineUserInfoPresenter.h +++ b/YuMi/Modules/YMMine/Presenter/XPMineUserInfoPresenter.h @@ -41,7 +41,7 @@ NS_ASSUME_NONNULL_BEGIN success:(void(^)(void))finishHim failure:(void(^)(NSError *error))failure; -- (void)cpTypeList; +- (void)cpTypeList:(NSInteger)uid; - (void)requestRelationship:(NSInteger)uid otherUid:(NSInteger)otherUid type:(NSInteger)type diff --git a/YuMi/Modules/YMMine/Presenter/XPMineUserInfoPresenter.m b/YuMi/Modules/YMMine/Presenter/XPMineUserInfoPresenter.m index 326e0fd7..6a768ebd 100644 --- a/YuMi/Modules/YMMine/Presenter/XPMineUserInfoPresenter.m +++ b/YuMi/Modules/YMMine/Presenter/XPMineUserInfoPresenter.m @@ -127,12 +127,14 @@ } showLoading:YES errorToast:YES] uid:@(uid) hours:@(hours) blockReason:reason]; } -- (void)cpTypeList { +- (void)cpTypeList:(NSInteger)uid { [Api userCpNameTypeTopList:[self createHttpCompletion:^(BaseModel * _Nonnull data) { - + if ([[self getView] respondsToSelector:@selector(getCPListSuccess:)]) { + [[self getView] getCPListSuccess:[RelationUserVO modelsWithArray:data.data]]; + } } fail:^(NSInteger code, NSString * _Nullable msg) { - } showLoading:NO errorToast:NO]]; + } showLoading:NO errorToast:NO] uid:uid]; } - (void)requestRelationship:(NSInteger)uid diff --git a/YuMi/Modules/YMMine/Protocol/XPMineUserInfoProtocol.h b/YuMi/Modules/YMMine/Protocol/XPMineUserInfoProtocol.h index da59d79d..c7da5a46 100644 --- a/YuMi/Modules/YMMine/Protocol/XPMineUserInfoProtocol.h +++ b/YuMi/Modules/YMMine/Protocol/XPMineUserInfoProtocol.h @@ -8,7 +8,7 @@ #import NS_ASSUME_NONNULL_BEGIN -@class UserInfoModel,XPSoundCardModel,XPMineUserInfoTagModel; +@class UserInfoModel,XPSoundCardModel,XPMineUserInfoTagModel, RelationUserVO; @protocol XPMineUserInfoProtocol @optional ///获取用户信息成功 @@ -39,6 +39,8 @@ NS_ASSUME_NONNULL_BEGIN -(void)getTagListSuccess:(XPMineUserInfoTagModel *)model; ///保存个人标签成功 -(void)saveTagListSuccess; + +-(void)getCPListSuccess:(NSArray *)array; @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMMine/View/CPListViewController.m b/YuMi/Modules/YMMine/View/CPListViewController.m index 4d0706a5..2dd77120 100644 --- a/YuMi/Modules/YMMine/View/CPListViewController.m +++ b/YuMi/Modules/YMMine/View/CPListViewController.m @@ -200,7 +200,7 @@ otherUid:vo.cpUid type:relationshipType success:^{ - + [XNDJTDDLoadingTool showSuccessWithMessage:YMLocalizedString(@"20.20.56_text_11")]; } failure:^(NSError * _Nonnull error) { }]; diff --git a/YuMi/Modules/YMMine/View/Cell/Visitor/XPMineVisitorTableViewCell.m b/YuMi/Modules/YMMine/View/Cell/Visitor/XPMineVisitorTableViewCell.m index 95fbd075..5e320962 100644 --- a/YuMi/Modules/YMMine/View/Cell/Visitor/XPMineVisitorTableViewCell.m +++ b/YuMi/Modules/YMMine/View/Cell/Visitor/XPMineVisitorTableViewCell.m @@ -143,9 +143,7 @@ self.memberIdLabel.text = [NSString stringWithFormat:@"ID:%zd", item.erbanNo]; self.timeLabel.text = [NSString stringWithFormat:YMLocalizedString(@"20.20.51_text_28"), item.visitTimeDesc]; [self.genderImageView setImage:item.gender == GenderType_Male ? kImage(@"common_male") : kImage(@"common_female")]; -#if DEBUG - item.regionIcon = @""; -#endif + self.regionImageView.imageUrl = item.regionIcon; self.regionImageView.hidden = [NSString isEmpty:item.regionIcon]; diff --git a/YuMi/Modules/YMMine/View/MineInfo/XPMineUserInfoViewController.m b/YuMi/Modules/YMMine/View/MineInfo/XPMineUserInfoViewController.m index 7ffae81d..b3915fb6 100644 --- a/YuMi/Modules/YMMine/View/MineInfo/XPMineUserInfoViewController.m +++ b/YuMi/Modules/YMMine/View/MineInfo/XPMineUserInfoViewController.m @@ -381,7 +381,6 @@ HWDMP4PlayDelegate> self.userMomentVC.dynamicInfo = userInfo.dynamicInfo; self.headView.roomUid = userInfo.roomUid; - self.headView.relationUser = userInfo.relationUserVO; self.headView.nameplateList = userInfo.userNameplateList; @@ -389,7 +388,7 @@ HWDMP4PlayDelegate> self.userInfo.relationUserVO = userInfo.relationUserVO; - self.headerHeight = [XPMineUserInfoHeaderView headerHeight:userInfo]; + self.headerHeight = [XPMineUserInfoHeaderView headerHeight:userInfo cps:0]; [self.pagingView reloadData]; ///上传访问记录 @@ -412,7 +411,14 @@ HWDMP4PlayDelegate> } [self playCPAnimation]; - [self.presenter cpTypeList]; + [self.presenter cpTypeList:userInfo.uid]; +} + +- (void)getCPListSuccess:(NSArray *)array { + self.headView.cpUsers = array; + self.headerHeight = [XPMineUserInfoHeaderView headerHeight:self.giftVC.userInfo + cps:array.count]; + [self.pagingView reloadData]; } - (void)getAttentionStateSuccess:(BOOL)status { diff --git a/YuMi/Modules/YMMine/View/SubViews/CPCard.m b/YuMi/Modules/YMMine/View/SubViews/CPCard.m index 06e7fe36..c1ae8094 100644 --- a/YuMi/Modules/YMMine/View/SubViews/CPCard.m +++ b/YuMi/Modules/YMMine/View/SubViews/CPCard.m @@ -169,8 +169,9 @@ self.bottomLabel.hidden = ![relationUser isEmptyRelation]; self.bottomImageView.hidden = [relationUser isEmptyRelation]; - self.avatarView.imageUrl = relationUser.avatar; + self.avatarView.imageUrl = [NSString isEmpty:relationUser.avatar] ? self.usersAvatar : relationUser.avatar; self.avatarView_cp.imageUrl = relationUser.cpAvatar; + self.avatarView_cp.hidden = [NSString isEmpty:relationUser.cpAvatar]; self.topLabel.text = [NSString stringWithFormat:@"%ld days", (long)relationUser.cpDay]; NSString *imagePath = [NSString stringWithFormat:@"cp_relationship_lv_%ld", self.relationUser.cpLevel]; @@ -216,16 +217,21 @@ - (void)updateCPBG { NSString *baseName = self.isListItem ? @"cp_relationship_bg" : @"cp_bg"; switch (self.relationUser.relationNameType) { + case CP_TYPE_CP: + self.progressView.progressTintColor = UIColorFromRGB(0xff7330); + break; case CP_TYPE_BRO: + self.progressView.progressTintColor = UIColorFromRGB(0x2e65ff); baseName = [baseName stringByAppendingString:@"_bro"]; break; case CP_TYPE_SISTER: + self.progressView.progressTintColor = UIColorFromRGB(0xf369b5); baseName = [baseName stringByAppendingString:@"_sister"]; break; case CP_TYPE_FRIEND: + self.progressView.progressTintColor = UIColorFromRGB(0xa353ff); baseName = [baseName stringByAppendingString:@"_friends"]; break; - case CP_TYPE_CP: default: break; } diff --git a/YuMi/Modules/YMMine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.h b/YuMi/Modules/YMMine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.h index fe49dfdd..0ed1fb43 100644 --- a/YuMi/Modules/YMMine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.h +++ b/YuMi/Modules/YMMine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.h @@ -15,15 +15,15 @@ NS_ASSUME_NONNULL_BEGIN ///去房间 - (void)xPMineUserInfoHeaderView:(XPMineUserInfoHeaderView *)view didClickGoToRoom:(NSString *)roomUid; -@optional -///播放声音,播放或关闭 -- (void)xPMineUserInfoHeaderView:(XPMineUserInfoHeaderView *)view didClickPlaySound:(BOOL)isPlay; -///去录音VC -//- (void)didClickGoToPlaySound; -///去标签页 -- (void)xPMineUserInfoHeaderView:(XPMineUserInfoHeaderView *)view didClickGotoEditView:(NSMutableArray *)itemList; -///去标签vc -- (void)xPMineUserInfoHeaderView:(XPMineUserInfoHeaderView *)view didClickGotoEditVC:(NSMutableArray *)itemList; +//@optional +/////播放声音,播放或关闭 +//- (void)xPMineUserInfoHeaderView:(XPMineUserInfoHeaderView *)view didClickPlaySound:(BOOL)isPlay; +/////去录音VC +////- (void)didClickGoToPlaySound; +/////去标签页 +//- (void)xPMineUserInfoHeaderView:(XPMineUserInfoHeaderView *)view didClickGotoEditView:(NSMutableArray *)itemList; +/////去标签vc +//- (void)xPMineUserInfoHeaderView:(XPMineUserInfoHeaderView *)view didClickGotoEditVC:(NSMutableArray *)itemList; @end @interface XPMineUserInfoHeaderView : UIView @@ -35,10 +35,11 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic,copy) NSString *roomUid; @property (nonatomic, strong) RelationUserVO *relationUser; +@property (nonatomic, copy) NSArray *cpUsers; @property (nonatomic, copy) NSArray *nameplateList; -+ (CGFloat)headerHeight:(UserInfoModel *)model; ++ (CGFloat)headerHeight:(UserInfoModel *)model cps:(NSInteger)cps; @end diff --git a/YuMi/Modules/YMMine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.m b/YuMi/Modules/YMMine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.m index 04523a94..2f8a828c 100644 --- a/YuMi/Modules/YMMine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.m +++ b/YuMi/Modules/YMMine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.m @@ -28,7 +28,6 @@ #import "CPCard.h" #import "XPBeautIDView.h" #import "CPListViewController.h" -#import "XPMineUserInfoHeaderTagView.h" ///Model #import "UserInfoModel.h" @@ -83,7 +82,6 @@ @interface XPMineUserInfoHeaderView ()< SDCycleScrollViewDelegate, SDPhotoBrowserDelegate, -XPMineUserInfoHeaderTagViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout, HWDMP4PlayDelegate> @@ -161,7 +159,10 @@ HWDMP4PlayDelegate> @property (nonatomic, strong) UILabel *fansNum; @property (nonatomic, strong) UILabel *followersNum; -@property (nonatomic, strong) CPCard *cpCard; +@property (nonatomic, strong) CPCard *cpCard_1; +@property (nonatomic, strong) CPCard *cpCard_2; +@property (nonatomic, strong) CPCard *cpCard_3; +@property (nonatomic, strong) CPCard *cpCard_4; @property (nonatomic, strong) UIButton *cpListButton; @property (nonatomic, strong) UICollectionView *nameplateCollectionView; @@ -213,7 +214,7 @@ HWDMP4PlayDelegate> return namePlateHeight; } -+ (CGFloat)headerHeight:(UserInfoModel *)model { ++ (CGFloat)headerHeight:(UserInfoModel *)model cps:(NSInteger)cps { CGFloat height = 0; NSInteger numberOfLines = 1; CGFloat lineHeight = 0; @@ -238,8 +239,14 @@ HWDMP4PlayDelegate> } // topAlbum + cp + name plate area + line contents + others - height = kGetScaleWidth(195) + 160 + [self namePlateHeight:model.userNameplateList] + (lineHeight * numberOfLines) + kGetScaleWidth(220); - + height = kGetScaleWidth(195) + 160 + [self namePlateHeight:model.userNameplateList] + (lineHeight * numberOfLines) + kGetScaleWidth(80); + if (cps == 0) { + cps = 1; + } + if (cps > 0) { + height = height + kGetScaleWidth(135) * cps + 10 * cps; + } + return height; } @@ -277,8 +284,6 @@ HWDMP4PlayDelegate> [self setupNameArea]; -// [self setupIDArea]; - [self setupNameplateArea]; [self setupLocateArea]; @@ -427,35 +432,35 @@ HWDMP4PlayDelegate> _stack = [[UIStackView alloc] init]; self.stack.axis = UILayoutConstraintAxisHorizontal; self.stack.distribution = UIStackViewDistributionFill; - self.stack.alignment = UIStackViewAlignmentCenter; + self.stack.alignment = UIStackViewAlignmentLeading; self.stack.spacing = 4; - if (self.userInfo.guildNameplateIcon.length > 0) { - scrollView.translatesAutoresizingMaskIntoConstraints = NO; - [self.userInfoView addSubview:scrollView]; - [scrollView mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.mas_equalTo(kGetScaleWidth(15)); - make.trailing.mas_equalTo(kGetScaleWidth(-15)); - make.top.mas_equalTo(self.nickStackView.mas_bottom).offset(5); - make.height.mas_equalTo(24); - }]; - [scrollView addSubview:self.stack]; - [self.stack mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.equalTo(scrollView); // 内容视图的边缘与滚动视图一致 - make.height.equalTo(scrollView); // 高度与滚动视图一致,确保仅水平滚动 - }]; - - if (isMSRTL()) { - _idEmptyView = [[UIView alloc] init]; - } - } else { +// if (self.userInfo.guildNameplateIcon.length > 0) { +// scrollView.translatesAutoresizingMaskIntoConstraints = NO; +// [self.userInfoView addSubview:scrollView]; +// [scrollView mas_makeConstraints:^(MASConstraintMaker *make) { +// make.leading.mas_equalTo(kGetScaleWidth(15)); +// make.trailing.mas_equalTo(kGetScaleWidth(-15)); +// make.top.mas_equalTo(self.nickStackView.mas_bottom).offset(5); +// make.height.mas_equalTo(24); +// }]; +// [scrollView addSubview:self.stack]; +// [self.stack mas_makeConstraints:^(MASConstraintMaker *make) { +// make.edges.equalTo(scrollView); // 内容视图的边缘与滚动视图一致 +// make.height.equalTo(scrollView); // 高度与滚动视图一致,确保仅水平滚动 +// }]; +// +//// if (isMSRTL()) { +//// _idEmptyView = [[UIView alloc] init]; +//// } +// } else { [self.userInfoView addSubview:self.stack]; [self.stack mas_makeConstraints:^(MASConstraintMaker *make) { make.leading.mas_equalTo(kGetScaleWidth(15)); make.top.mas_equalTo(self.nickStackView.mas_bottom).offset(5); make.height.mas_equalTo(24); }]; - } +// } [self.stack addArrangedSubview:self.beautIDView]; [self.stack addArrangedSubview:self.idLabel]; @@ -607,13 +612,34 @@ HWDMP4PlayDelegate> make.width.height.mas_equalTo(22); }]; self.cpListButton = cpListButton; - - [self.userInfoView addSubview:self.cpCard]; - [self.cpCard mas_makeConstraints:^(MASConstraintMaker *make) { + + [self.userInfoView addSubview:self.cpCard_1]; + [self.cpCard_1 mas_makeConstraints:^(MASConstraintMaker *make) { make.top.mas_equalTo(titleLabel.mas_bottom).offset(3); make.width.mas_equalTo(self.userInfoView); make.height.mas_equalTo(kGetScaleWidth(135)); }]; + + [self.userInfoView addSubview:self.cpCard_2]; + [self.cpCard_2 mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.cpCard_1.mas_bottom).offset(12); + make.width.mas_equalTo(self.userInfoView); + make.height.mas_equalTo(kGetScaleWidth(135)); + }]; + + [self.userInfoView addSubview:self.cpCard_3]; + [self.cpCard_3 mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.cpCard_2.mas_bottom).offset(12); + make.width.mas_equalTo(self.userInfoView); + make.height.mas_equalTo(kGetScaleWidth(135)); + }]; + + [self.userInfoView addSubview:self.cpCard_4]; + [self.cpCard_4 mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.cpCard_3.mas_bottom).offset(12); + make.width.mas_equalTo(self.userInfoView); + make.height.mas_equalTo(kGetScaleWidth(135)); + }]; } #pragma mark - UICollectionView Delegate & DataSource @@ -666,12 +692,6 @@ HWDMP4PlayDelegate> pasteboard. string = [NSString stringWithFormat:@"%ld", (long)_userInfo.erbanNo]; } -#pragma mark - XPMineUserInfoHeaderTagView -- (void)didClickGotoEditVC{ - if(self.delegate && [self.delegate respondsToSelector:@selector(xPMineUserInfoHeaderView:didClickGotoEditVC:)]){ - [self.delegate xPMineUserInfoHeaderView:self didClickGotoEditVC:@[].mutableCopy]; - } -} #pragma mark - Event Response -(void)clickAvatarAction{ SDPhotoBrowser *browser = [[SDPhotoBrowser alloc]init]; @@ -867,6 +887,38 @@ HWDMP4PlayDelegate> } } +- (void)setCpUsers:(NSArray *)cpUsers { + _cpUsers = cpUsers; + RelationUserVO *vo_1 = [cpUsers xpSafeObjectAtIndex:0]; + self.cpCard_1.usersAvatar = self.userInfo.avatar; + if (vo_1) { + [self.cpCard_1 updateForUserPage:vo_1]; + } else { + [self.cpCard_1 updateForUserPage:self.relationUser]; + } + + RelationUserVO *vo_2 = [cpUsers xpSafeObjectAtIndex:1]; + self.cpCard_2.usersAvatar = self.userInfo.avatar; + [self.cpCard_2 setHidden:!vo_2]; + if (vo_2) { + [self.cpCard_2 updateForUserPage:vo_2]; + } + + RelationUserVO *vo_3 = [cpUsers xpSafeObjectAtIndex:2]; + self.cpCard_3.usersAvatar = self.userInfo.avatar; + [self.cpCard_3 setHidden:!vo_3]; + if (vo_3) { + [self.cpCard_3 updateForUserPage:vo_3]; + } + + RelationUserVO *vo_4 = [cpUsers xpSafeObjectAtIndex:3]; + self.cpCard_4.usersAvatar = self.userInfo.avatar; + [self.cpCard_4 setHidden:!vo_4]; + if (vo_4) { + [self.cpCard_4 updateForUserPage:vo_4]; + } +} + - (void)setRelationUser:(RelationUserVO *)relationUser { _relationUser = relationUser; BOOL hideCPAvatarContent = NO; @@ -887,9 +939,6 @@ HWDMP4PlayDelegate> self.cpAvatarFlag.hidden = hideCPAvatarContent; self.headWearSvgaImageView_cp.hidden = hideCPAvatarContent; - self.cpCard.isListItem = NO; - self.cpCard.usersAvatar = self.userInfo.avatar; - [self.cpCard updateForUserPage:relationUser]; self.avatarView_cp.imageUrl = relationUser.cpAvatar; NSString *imagePath = [NSString stringWithFormat:@"cp_avatar_flag_lv_%ld", relationUser.cpLevel]; @@ -1247,8 +1296,6 @@ HWDMP4PlayDelegate> return _agentPlateImageView; } - - - (UIImageView *)newUserImageView { if (!_newUserImageView) { _newUserImageView = [[UIImageView alloc] init]; @@ -1293,6 +1340,7 @@ HWDMP4PlayDelegate> } return _avatarPhoto; } + -(NetImageView *)avatarView{ if (!_avatarView){ NetImageConfig * config = [[NetImageConfig alloc] init]; @@ -1437,11 +1485,39 @@ HWDMP4PlayDelegate> return _headWearSvgaImageView_cp; } -- (CPCard *)cpCard { - if (!_cpCard) { - _cpCard = [[CPCard alloc] init]; +- (CPCard *)cpCard_1 { + if (!_cpCard_1) { + _cpCard_1 = [[CPCard alloc] init]; + _cpCard_1.isListItem = NO; } - return _cpCard; + return _cpCard_1; +} + +- (CPCard *)cpCard_2 { + if (!_cpCard_2) { + _cpCard_2 = [[CPCard alloc] init]; + _cpCard_2.isListItem = NO; + _cpCard_2.hidden = YES; + } + return _cpCard_2; +} + +- (CPCard *)cpCard_3 { + if (!_cpCard_3) { + _cpCard_3 = [[CPCard alloc] init]; + _cpCard_3.isListItem = NO; + _cpCard_3.hidden = YES; + } + return _cpCard_3; +} + +- (CPCard *)cpCard_4 { + if (!_cpCard_4) { + _cpCard_4 = [[CPCard alloc] init]; + _cpCard_4.isListItem = NO; + _cpCard_4.hidden = YES; + } + return _cpCard_4; } - (UIImageView *)cpAvatarHeart { diff --git a/YuMi/Modules/YMNewHome/Model/HomePlayRoomModel.h b/YuMi/Modules/YMNewHome/Model/HomePlayRoomModel.h index 7cd11efd..669c757c 100644 --- a/YuMi/Modules/YMNewHome/Model/HomePlayRoomModel.h +++ b/YuMi/Modules/YMNewHome/Model/HomePlayRoomModel.h @@ -89,7 +89,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic,copy) NSString *uid; @property(nonatomic,copy) NSString *erbanNo; - +@property (nonatomic, copy) NSNumber *aiLevel; // > 0 为机器人 @end diff --git a/YuMi/Modules/YMRoom/Model/BravoGiftTabInfomationModel.h b/YuMi/Modules/YMRoom/Model/BravoGiftTabInfomationModel.h new file mode 100644 index 00000000..78a793e1 --- /dev/null +++ b/YuMi/Modules/YMRoom/Model/BravoGiftTabInfomationModel.h @@ -0,0 +1,24 @@ +// +// BravoGiftTabInfomationModel.h +// YuMi +// +// Created by P on 2025/4/14. +// + +#import "PIBaseModel.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface BravoGiftTabInfomationModel : PIBaseModel + +@property (nonatomic, copy) NSString *avatar; +@property (nonatomic, assign) NSInteger coin; +@property (nonatomic, assign) NSInteger erbainNo; +@property (nonatomic, assign) NSInteger giftId; +@property (nonatomic, copy) NSString *giftName; +@property (nonatomic, copy) NSString *nick; +@property (nonatomic, assign) NSInteger uid; + +@end + +NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/Model/BravoGiftTabInfomationModel.m b/YuMi/Modules/YMRoom/Model/BravoGiftTabInfomationModel.m new file mode 100644 index 00000000..38fad9a3 --- /dev/null +++ b/YuMi/Modules/YMRoom/Model/BravoGiftTabInfomationModel.m @@ -0,0 +1,12 @@ +// +// BravoGiftTabInfomationModel.m +// YuMi +// +// Created by P on 2025/4/14. +// + +#import "BravoGiftTabInfomationModel.h" + +@implementation BravoGiftTabInfomationModel + +@end diff --git a/YuMi/Modules/YMRoom/Model/RoomInfoModel.h b/YuMi/Modules/YMRoom/Model/RoomInfoModel.h index d25efa74..f2e9d4fb 100644 --- a/YuMi/Modules/YMRoom/Model/RoomInfoModel.h +++ b/YuMi/Modules/YMRoom/Model/RoomInfoModel.h @@ -92,11 +92,8 @@ typedef NS_ENUM(NSInteger, RoomDatingStateChangeType) { @property (nonatomic , assign) NSInteger recomSeq; @property (nonatomic , assign) BOOL redEnvelopeOpen; @property (nonatomic , assign) NSInteger roomId; -@property (nonatomic , copy) NSString * meetingName; @property (nonatomic , assign) BOOL valid; -@property (nonatomic , assign) NSInteger openTime; @property (nonatomic , copy) NSString * tagPict; -@property (nonatomic , assign) BOOL isPureMode; @property (nonatomic , assign) NSInteger count; @property (nonatomic , assign) BOOL showGiftValue; @property (nonatomic , copy) NSString * avatar; diff --git a/YuMi/Modules/YMRoom/View/AnimationView/BroveGiftWinningFlagView.h b/YuMi/Modules/YMRoom/View/AnimationView/BravoGiftWinningFlagView.h similarity index 74% rename from YuMi/Modules/YMRoom/View/AnimationView/BroveGiftWinningFlagView.h rename to YuMi/Modules/YMRoom/View/AnimationView/BravoGiftWinningFlagView.h index 669ebc78..cbfaa381 100644 --- a/YuMi/Modules/YMRoom/View/AnimationView/BroveGiftWinningFlagView.h +++ b/YuMi/Modules/YMRoom/View/AnimationView/BravoGiftWinningFlagView.h @@ -1,5 +1,5 @@ // -// BroveGiftWinningFlagView.h +// BravoGiftWinningFlagView.h // YuMi // // Created by P on 2025/3/25. @@ -9,7 +9,7 @@ @class AttachmentModel; NS_ASSUME_NONNULL_BEGIN -@interface BroveGiftWinningFlagViewModel : PIBaseModel +@interface BravoGiftWinningFlagViewModel : PIBaseModel @property (nonatomic, assign) NSInteger uid; @property (nonatomic, copy) NSArray *receiverUidList; @@ -21,9 +21,9 @@ NS_ASSUME_NONNULL_BEGIN @end -@interface BroveGiftWinningFlagView : UIView +@interface BravoGiftWinningFlagView : UIView -+ (BroveGiftWinningFlagViewModel *)display:(UIView *)superView ++ (BravoGiftWinningFlagViewModel *)display:(UIView *)superView with:(AttachmentModel *)attachment roomID:(NSInteger)roomID uID:(NSString *)UID; diff --git a/YuMi/Modules/YMRoom/View/AnimationView/BroveGiftWinningFlagView.m b/YuMi/Modules/YMRoom/View/AnimationView/BravoGiftWinningFlagView.m similarity index 92% rename from YuMi/Modules/YMRoom/View/AnimationView/BroveGiftWinningFlagView.m rename to YuMi/Modules/YMRoom/View/AnimationView/BravoGiftWinningFlagView.m index 630c5fcd..2ec781df 100644 --- a/YuMi/Modules/YMRoom/View/AnimationView/BroveGiftWinningFlagView.m +++ b/YuMi/Modules/YMRoom/View/AnimationView/BravoGiftWinningFlagView.m @@ -1,24 +1,24 @@ // -// BroveGiftWinningFlagView.m +// BravoGiftWinningFlagView.m // YuMi // // Created by P on 2025/3/25. // -#import "BroveGiftWinningFlagView.h" +#import "BravoGiftWinningFlagView.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 +@implementation BravoGiftWinningFlagViewModel @end -@interface BroveGiftWinningFlagView () +@interface BravoGiftWinningFlagView () -@property (nonatomic, strong) BroveGiftWinningFlagViewModel *model; +@property (nonatomic, strong) BravoGiftWinningFlagViewModel *model; @property (nonatomic, strong) UIImageView *backgroundImageView; //@property (nonatomic, strong) MoliMoneyLabel *moneyLabel; @property (nonatomic, strong) UILabel *moneyLabel_2; @@ -26,15 +26,15 @@ @end -@implementation BroveGiftWinningFlagView +@implementation BravoGiftWinningFlagView -+ (BroveGiftWinningFlagViewModel *)display:(UIView *)superView with:(AttachmentModel *)attachment roomID:(NSInteger)roomID uID:(NSString *)UID { - BroveGiftWinningFlagViewModel *model = [BroveGiftWinningFlagViewModel modelWithJSON:attachment.data]; ++ (BravoGiftWinningFlagViewModel *)display:(UIView *)superView with:(AttachmentModel *)attachment roomID:(NSInteger)roomID uID:(NSString *)UID { + BravoGiftWinningFlagViewModel *model = [BravoGiftWinningFlagViewModel modelWithJSON:attachment.data]; if (model.roomId != roomID || model.uid != UID.integerValue || model.tip == nil) { return model; } - BroveGiftWinningFlagView *flagView = [[BroveGiftWinningFlagView alloc] init]; + BravoGiftWinningFlagView *flagView = [[BravoGiftWinningFlagView alloc] init]; flagView.model = model; flagView.alpha = 0; flagView.frame = CGRectMake(0, 0, kGetScaleWidth(274), kGetScaleWidth(216)); @@ -106,7 +106,7 @@ }]; } -- (void)setModel:(BroveGiftWinningFlagViewModel *)model { +- (void)setModel:(BravoGiftWinningFlagViewModel *)model { NSNumber *level = [model.tip objectForKey:@"level"]; NSString *times = [model.tip objectForKey:@"times"]; NSNumber *coins = [model.tip objectForKey:@"coins"]; diff --git a/YuMi/Modules/YMRoom/View/AnimationView/RoomAnimationView.m b/YuMi/Modules/YMRoom/View/AnimationView/RoomAnimationView.m index 75208387..f15ea206 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 "BravoGiftBannerView.h" #import "XCCurrentVCStackManager.h" -#import "BroveGiftWinningFlagView.h" +#import "BravoGiftWinningFlagView.h" #import "RoomEnterModel.h" // Old Methods @@ -572,7 +572,7 @@ XPRoomGraffitiGiftAnimationViewDelegate self.isRoomBannerV2Displaying = YES; @kWeakify(self); RoomInfoModel *roomInfo = self.hostDelegate.getRoomInfo; - [BroveGiftBannerView display:self.bannerContainer + [BravoGiftBannerView display:self.bannerContainer inRoomUid:roomInfo.uid with:obj complete:^{ @@ -673,17 +673,18 @@ XPRoomGraffitiGiftAnimationViewDelegate uID:[AccountInfoStorage instance].getUid]; } -- (void)receiveBroveGiftWinning:(AttachmentModel *)attachment { +- (void)receiveBravoGiftWinning:(AttachmentModel *)attachment { RoomInfoModel *roomInfo = self.hostDelegate.getRoomInfo; - BroveGiftWinningFlagViewModel *flagModel = [BroveGiftWinningFlagView display:self.topContainer + BravoGiftWinningFlagViewModel *flagModel = [BravoGiftWinningFlagView 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; } + // 数据同步到 combo + [[NSNotificationCenter defaultCenter] postNotificationName:@"receiveLuckGiftWinning" object:[NSString stringByRemovingRedundantZeros:@(flagModel.receiverProfit).stringValue]]; + if (!self.hostDelegate.getRoomInfo.hasAnimationEffect) { return; } @@ -977,7 +978,8 @@ XPRoomGraffitiGiftAnimationViewDelegate attachment.second == Custom_Message_Sub_AllBatchMicroLuckySend || attachment.second == Custom_Message_Sub_Gift_LuckySend) { NSString * giftId = [NSString stringWithFormat:@"%ld", receiveInfo.luckyGiftList.giftList.firstObject.giftId]; - giftInfo = [[XPGiftStorage shareStorage] findGiftInfo:giftId inRoom:@(receiveInfo.roomUid).stringValue]; + NSString *roomUid = receiveInfo.roomUid == 0 ? receiveInfo.uid : @(receiveInfo.roomUid).stringValue; + giftInfo = [[XPGiftStorage shareStorage] findGiftInfo:giftId inRoom:roomUid]; } if (giftInfo == nil) { @@ -1718,7 +1720,7 @@ XPRoomGraffitiGiftAnimationViewDelegate [self handleBroveGiftBanner:attachment]; break; case Custom_Message_Sub_Super_Gift_UI_Rffect: - [self receiveBroveGiftWinning:attachment]; + [self receiveBravoGiftWinning:attachment]; default: break; } diff --git a/YuMi/Modules/YMRoom/View/BaseUIContainerView/XPRoomFunctionContainerView.m b/YuMi/Modules/YMRoom/View/BaseUIContainerView/XPRoomFunctionContainerView.m index a34ed727..284e5b5c 100644 --- a/YuMi/Modules/YMRoom/View/BaseUIContainerView/XPRoomFunctionContainerView.m +++ b/YuMi/Modules/YMRoom/View/BaseUIContainerView/XPRoomFunctionContainerView.m @@ -794,7 +794,7 @@ [[NIMSDK sharedSDK].chatroomManager fetchChatroomMembersByIds:request completion:^(NSError * _Nullable error, NSArray * _Nullable members) { if (error == nil) { NIMChatroomMember * member = [members firstObject]; - if (member.type == NIMTeamMemberTypeOwner) { + if (member.type == NIMChatroomMemberTypeCreator) { XPAnchorPKInviteView * inviteView = [[XPAnchorPKInviteView alloc] init]; inviteView.roomUid = [NSString stringWithFormat:@"%ld", self.delegate.getRoomInfo.uid]; inviteView.dataDic = attachment.data; @@ -813,7 +813,7 @@ [[NIMSDK sharedSDK].chatroomManager fetchChatroomMembersByIds:request completion:^(NSError * _Nullable error, NSArray * _Nullable members) { if (error == nil) { NIMChatroomMember * member = [members firstObject]; - if (member.type == NIMTeamMemberTypeOwner) { + if (member.type == NIMChatroomMemberTypeCreator) { AcrossRoomPKPanelModel * acrossPKPanelInfo = [AcrossRoomPKPanelModel modelWithJSON:attachment.data]; if (attachment.data[@"amicStatus"] != nil){ acrossPKPanelInfo.aMicStatus = [attachment.data[@"amicStatus"] intValue]; @@ -833,7 +833,7 @@ [[NIMSDK sharedSDK].chatroomManager fetchChatroomMembersByIds:request completion:^(NSError * _Nullable error, NSArray * _Nullable members) { if (error == nil) { NIMChatroomMember * member = [members firstObject]; - if (member.type == NIMTeamMemberTypeOwner) { + if (member.type == NIMChatroomMemberTypeCreator) { XPAcrossRoomPKInviteResultView * inviteResutView = [[XPAcrossRoomPKInviteResultView alloc] init]; inviteResutView.is_XP_Accept = NO; [self addSubview:inviteResutView]; diff --git a/YuMi/Modules/YMRoom/View/Common/BroveGiftBannerView.h b/YuMi/Modules/YMRoom/View/Common/BravoGiftBannerView.h similarity index 88% rename from YuMi/Modules/YMRoom/View/Common/BroveGiftBannerView.h rename to YuMi/Modules/YMRoom/View/Common/BravoGiftBannerView.h index d9ba2b0b..6e5b0596 100644 --- a/YuMi/Modules/YMRoom/View/Common/BroveGiftBannerView.h +++ b/YuMi/Modules/YMRoom/View/Common/BravoGiftBannerView.h @@ -4,7 +4,7 @@ NS_ASSUME_NONNULL_BEGIN -@interface BroveGiftBannerView : UIView +@interface BravoGiftBannerView : UIView + (void)display:(UIView *)superView diff --git a/YuMi/Modules/YMRoom/View/Common/BroveGiftBannerView.m b/YuMi/Modules/YMRoom/View/Common/BravoGiftBannerView.m similarity index 95% rename from YuMi/Modules/YMRoom/View/Common/BroveGiftBannerView.m rename to YuMi/Modules/YMRoom/View/Common/BravoGiftBannerView.m index 0524c4c1..93f0a45b 100644 --- a/YuMi/Modules/YMRoom/View/Common/BroveGiftBannerView.m +++ b/YuMi/Modules/YMRoom/View/Common/BravoGiftBannerView.m @@ -1,4 +1,4 @@ -#import "BroveGiftBannerView.h" +#import "BravoGiftBannerView.h" #import "UserInfoModel.h" #import "AttachmentModel.h" #import @@ -8,7 +8,7 @@ //{"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 +@interface BravoGiftBannerViewModel : PIBaseModel @property (nonatomic, assign, readonly) CGFloat times; @property (nonatomic, assign, readonly) CGFloat coins; @@ -19,13 +19,13 @@ @end -@implementation BroveGiftBannerViewModel +@implementation BravoGiftBannerViewModel @end -@interface BroveGiftBannerView () -@property (nonatomic, strong) BroveGiftBannerViewModel *model; +@interface BravoGiftBannerView () +@property (nonatomic, strong) BravoGiftBannerViewModel *model; @property (nonatomic, strong) NetImageView *sendAvatarImageView; @property (nonatomic, strong) NetImageView *giftImageView; @property (nonatomic, strong) UILabel *goldNumLabel; @@ -37,16 +37,16 @@ @property (nonatomic, copy) void(^exitCurrentRoom)(void); @end -@implementation BroveGiftBannerView +@implementation BravoGiftBannerView + (void)display:(UIView *)superView inRoomUid:(NSInteger)roomUid with:(AttachmentModel *)attachment complete:(void (^)(void))complete exitCurrentRoom:(void(^)(void))exit { - BroveGiftBannerViewModel *model = [BroveGiftBannerViewModel modelWithDictionary:attachment.data]; + BravoGiftBannerViewModel *model = [BravoGiftBannerViewModel modelWithDictionary:attachment.data]; CGRect frame = CGRectMake(KScreenWidth, 0, KScreenWidth, kGetScaleWidth(90)); - BroveGiftBannerView *banner = [[BroveGiftBannerView alloc] initWithFrame:frame]; + BravoGiftBannerView *banner = [[BravoGiftBannerView alloc] initWithFrame:frame]; banner.model = model; banner.completeDisplay = complete; banner.exitCurrentRoom = exit; @@ -78,7 +78,7 @@ exitCurrentRoom:(void(^)(void))exit { }]; } -- (void)setModel:(BroveGiftBannerViewModel *)model { +- (void)setModel:(BravoGiftBannerViewModel *)model { self.sendAvatarImageView.imageUrl = model.sender.avatar; self.giftImageView.imageUrl = model.giftPic; self.goldNumLabel.text = [NSString stringByRemovingRedundantZeros:@(model.coins).stringValue]; diff --git a/YuMi/Modules/YMRoom/View/Custom Background/CustomRoomBGContentViewController.m b/YuMi/Modules/YMRoom/View/Custom Background/CustomRoomBGContentViewController.m index 4f38cfd8..8903199f 100644 --- a/YuMi/Modules/YMRoom/View/Custom Background/CustomRoomBGContentViewController.m +++ b/YuMi/Modules/YMRoom/View/Custom Background/CustomRoomBGContentViewController.m @@ -464,7 +464,6 @@ @kWeakify(self); [self.presenter uploadRoomBG:self.roomUID photo:self.customSelectedImage complete:^{ @kStrongify(self); - // TODO: 跳转到 custom tab [self hideHUD]; [self didTapCancelPreview]; self.jumpToTab = 3; @@ -489,7 +488,6 @@ @kWeakify(self); [self.presenter deleteRoomBG:self.roomUID itemID:@(model.id).stringValue complete:^{ @kStrongify(self); - //TODO: 跳轉到 custom [self setupData]; } failure:^{ }]; } diff --git a/YuMi/Modules/YMRoom/View/MenuContainerView/MSRoomMenuGameVC.h b/YuMi/Modules/YMRoom/View/MenuContainerView/MSRoomMenuGameVC.h index e6c9aa53..a1a40c67 100644 --- a/YuMi/Modules/YMRoom/View/MenuContainerView/MSRoomMenuGameVC.h +++ b/YuMi/Modules/YMRoom/View/MenuContainerView/MSRoomMenuGameVC.h @@ -18,6 +18,7 @@ typedef NS_ENUM(NSInteger, MSRoomMenuType) { @interface MSRoomMenuGameVC : MvpViewController +@property (nonatomic, copy) void(^updatePlayListAndGameList)(NSArray *playList, NSArray *gameList); - (instancetype)initWithDelegate:(id)delegate roomMenuType:(MSRoomMenuType)type; //- (instancetype)initWithDelegate:(id)delegate; @end diff --git a/YuMi/Modules/YMRoom/View/MenuContainerView/MSRoomMenuGameVC.m b/YuMi/Modules/YMRoom/View/MenuContainerView/MSRoomMenuGameVC.m index d13bd7ca..d48d4671 100644 --- a/YuMi/Modules/YMRoom/View/MenuContainerView/MSRoomMenuGameVC.m +++ b/YuMi/Modules/YMRoom/View/MenuContainerView/MSRoomMenuGameVC.m @@ -25,12 +25,15 @@ #import "Api+LittleGame.h" #import "Api+RoomSetting.h" #import "UserInfoModel.h" +#import @interface MSRoomMenuGameVC () @property(nonatomic,strong) MSRoomMenuGameView *gameView; @property(nonatomic, assign) MSRoomMenuType type; ///host 代理 @property (nonatomic,weak) idhostDelegate; + +@property (nonatomic, assign) CGPoint startTouchPoint; @end @implementation MSRoomMenuGameVC @@ -59,11 +62,56 @@ - (BOOL)isHiddenNavBar { return YES; } + - (void)viewDidLoad { [super viewDidLoad]; [self installUI]; [self installConstraints]; [self loadMenuData]; + [self addTargetViewSwipeDownGesture]; +} + +- (void)addTargetViewSwipeDownGesture { + // 创建下滑手势识别器 + UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handlePan:)]; + + // 将手势添加到目标视图 + [self.gameView addGestureRecognizer:pan]; +} + +- (void)handlePan:(UIPanGestureRecognizer *)gesture { + // 获取触摸点 + CGPoint touchPoint = [gesture locationInView:self.gameView]; + switch (gesture.state) { + case UIGestureRecognizerStateBegan: + // 记录起始触摸点 + self.startTouchPoint = touchPoint; + break; + case UIGestureRecognizerStateChanged: { + // 计算滑动距离 + CGFloat distance = touchPoint.y - self.startTouchPoint.y; + + // 判断滑动方向是否向下 + if (distance > 0) { + // 判断滑动距离是否超过阈值 + if (distance >= 150.0) { + [self handleSwipeDown]; + } + } + } + break; + case UIGestureRecognizerStateEnded: + // 重置起始触摸点 + self.startTouchPoint = CGPointZero; + break; + default: + break; + } +} + +- (void)handleSwipeDown { + // 处理下滑手势 + [self dismissViewControllerAnimated:YES completion:nil]; } - (void)loadMenuData { @@ -72,28 +120,67 @@ [self updateGamePlayList:@[]]; break; case MSRoomMenuTypeGame: - case MSRoomMenuTypeLittleGame: + case MSRoomMenuTypeLittleGame:{ [self getGameData]; [self getLittleGameList]; + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + [self updateGameModels]; + }); + } break; default: break; } } +- (void)updateGameModels { + RACSubject* playRAC = [RACSubject subject]; + RACSubject* littleGameRAC = [RACSubject subject]; + + @kWeakify(self); + [[RACSignal combineLatest:@[playRAC, + littleGameRAC] + reduce:^id(NSArray *playModels, + NSArray *littleGameModels){ + @kStrongify(self); + [self.gameView updateDataSource:playModels gameList:littleGameModels]; + if (self.updatePlayListAndGameList) { + self.updatePlayListAndGameList(playModels, littleGameModels); + } + return nil; + }] subscribeError:^(NSError * _Nullable error) { + [XNDJTDDLoadingTool showErrorWithMessage:error.domain]; + }]; + + RoomInfoModel *roomInfo = self.hostDelegate.getRoomInfo; + NSString * roomId = [NSString stringWithFormat:@"%ld", roomInfo.uid]; + [Api getPlayList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { + if (code == 200) { + NSArray * array = [ActivityInfoModel modelsWithArray:data.data]; + [playRAC sendNext:array]; + [playRAC sendCompleted]; + } else { + [playRAC sendError:[NSError errorWithDomain:[NSString isEmpty:msg] ? @"" : msg code:code userInfo:nil]]; + } + } roomId:roomId]; + + NSString *roomUid = [NSString stringWithFormat:@"%ld", + self.hostDelegate.getRoomInfo.uid]; + [Api getLittleGameList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { + if (code == 200) { + NSArray * array = [LittleGameInfoModel modelsWithArray:data.data]; + [littleGameRAC sendNext:array]; + [littleGameRAC sendCompleted]; + } else { + [littleGameRAC sendError:[NSError errorWithDomain:[NSString isEmpty:msg] ? @"" : msg code:code userInfo:nil]]; + } + } roomUid:roomUid]; +} + -(void)getGameData{ NSMutableArray *resourceList = [self.hostDelegate getPlayList]; if(resourceList.count > 0){ self.gameView.playList = resourceList; - } else { - NSString * roomId = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.roomId]; - @kWeakify(self); - [Api getPlayList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { - if (code == 200) { - @kStrongify(self); - self.gameView.playList = [[ActivityInfoModel modelsWithArray:data.data] mutableCopy]; - } - } roomId:roomId]; } } @@ -128,16 +215,6 @@ NSMutableArray *resourceList = [self.hostDelegate getLittleGameList]; if(resourceList.count > 0){ self.gameView.littleGameList = resourceList; - } else { - @kWeakify(self); - [Api getLittleGameList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { - if (code == 200) { - @kStrongify(self); - NSArray * array = [LittleGameInfoModel modelsWithArray:data.data]; - self.gameView.littleGameList = array.mutableCopy; - } - } - roomUid:@""]; } } diff --git a/YuMi/Modules/YMRoom/View/MenuContainerView/MSRoomMenuGameView.h b/YuMi/Modules/YMRoom/View/MenuContainerView/MSRoomMenuGameView.h index fe82dcf1..085b3fcd 100644 --- a/YuMi/Modules/YMRoom/View/MenuContainerView/MSRoomMenuGameView.h +++ b/YuMi/Modules/YMRoom/View/MenuContainerView/MSRoomMenuGameView.h @@ -23,6 +23,9 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic,strong) NSMutableArray *littleGameList; @property (nonatomic, strong) NSMutableArray *dataSource; @property(nonatomic,weak) iddelegate; + +- (void)updateDataSource:(NSArray *)playList gameList:(NSArray *)littleGameList; + @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/MenuContainerView/MSRoomMenuGameView.m b/YuMi/Modules/YMRoom/View/MenuContainerView/MSRoomMenuGameView.m index 2eab2c96..ba8b1ac3 100644 --- a/YuMi/Modules/YMRoom/View/MenuContainerView/MSRoomMenuGameView.m +++ b/YuMi/Modules/YMRoom/View/MenuContainerView/MSRoomMenuGameView.m @@ -84,6 +84,18 @@ static const NSInteger kItemsPerRow = 5; }); } +- (void)updateDataSource:(NSArray *)playList gameList:(NSArray *)littleGameList { + _playList = playList.mutableCopy; + _littleGameList = littleGameList.mutableCopy; + self.dataSource = [NSMutableArray array]; + [self.dataSource addObjectsFromArray:playList]; + [self.dataSource addObjectsFromArray:littleGameList]; + [self updateViewHeightWithItemCount:self.dataSource.count]; + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + [self.collectionView reloadData]; + }); +} + - (void)updateViewHeightWithItemCount:(NSInteger)count { if (count == 0) { return; diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.h b/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.h index 5519235c..30b28788 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.h +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.h @@ -10,7 +10,7 @@ NS_ASSUME_NONNULL_BEGIN @interface XPMessageInfoModel : PIBaseModel - +@property(nonatomic,assign) BOOL isChatHall; @property(nonatomic,assign) BOOL isBoom; @property(nonatomic,strong) PIRoomPhotoAlbumItemModel *albumModel; @property(nonatomic,copy) NSString *vipIcon; diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.h b/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.h index a20bac8b..ef3de88e 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.h +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.h @@ -15,7 +15,7 @@ NS_ASSUME_NONNULL_BEGIN - (XPMessageInfoModel*)parseMessageAttribute:(NIMMessage *)message; - (NSString *)parseMessageBubble:(NIMMessage *)message; - +- (XPMessageInfoModel*)parseMessageAttributeForChatHall:(NIMMessage *)message; - (XPMessageInfoModel*)parseBroadcastMessageAttribute:(NIMBroadcastMessage *)message; ///房间的代理 diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m b/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m index 50c95c1d..a3d5ae72 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m @@ -59,6 +59,29 @@ @implementation XPRoomMessageParser +- (XPMessageInfoModel*)parseMessageAttributeForChatHall:(NIMMessage *)message{ + NIMMessageType messageType = message.messageType; + XPMessageInfoModel * messageInfo = [[XPMessageInfoModel alloc] init]; + messageInfo.isChatHall = YES; + switch (messageType) { + case NIMMessageTypeText: + { + XPMessageInfoModel *model = [self makeChatAttribute:message messageInfo:messageInfo]; + return model != nil ? model : [XPMessageInfoModel new]; + break; + } + + case NIMMessageTypeCustom: + { + XPMessageInfoModel *model = [self makeCustomAttribute:message messageInfo:messageInfo]; + return model != nil ? model : [XPMessageInfoModel new]; + break; + } + default: + return [XPMessageInfoModel new]; + } +} + - (XPMessageInfoModel*)parseBroadcastMessageAttribute:(NIMBroadcastMessage *)message { if (message.content) { NSDictionary *msgDictionary = [message.content toJSONObject]; @@ -1313,7 +1336,8 @@ GiftReceiveInfoModel *info = [GiftReceiveInfoModel modelWithJSON:attachment.data]; GiftInfoModel *giftInfo = info.gift == nil ? info.giftInfo : info.gift; if (giftInfo == nil) { - giftInfo = [[XPGiftStorage shareStorage] findGiftInfo:info.giftId inRoom:@(info.roomUid).stringValue]; + NSString *roomUid = info.roomUid == 0 ? info.uid : @(info.roomUid).stringValue; + giftInfo = [[XPGiftStorage shareStorage] findGiftInfo:info.giftId inRoom:roomUid]; } ///官方新用户 @@ -1378,8 +1402,9 @@ [attribute appendAttributedString:[self createSapceAttribute:2]]; [info.luckyGiftList.giftList enumerateObjectsUsingBlock:^(GiftListsInfo * _Nonnull giftListInfo, NSUInteger idx, BOOL * _Nonnull stop) { + NSString *roomUid = info.roomUid == 0 ? info.uid : @(info.roomUid).stringValue; GiftInfoModel *luckGiftInfo = [[XPGiftStorage shareStorage] findGiftInfo:[NSString stringWithFormat:@"%ld", giftListInfo.giftId] - inRoom:@(info.roomUid).stringValue]; + inRoom:roomUid]; // 价值 [attribute appendAttributedString:[self createTextAttribute:YMLocalizedString(@"XPRoomMessageParser104") color:[DJDKMIMOMColor messageDefaultTextColor] font:kRoomMessageDefalutFont]]; [attribute appendAttributedString:[self createSapceAttribute:2]]; diff --git a/YuMi/Modules/YMRoom/View/RoomGame/Model/MSRoomGameModel.h b/YuMi/Modules/YMRoom/View/RoomGame/Model/MSRoomGameModel.h index c86d3132..8339e05f 100644 --- a/YuMi/Modules/YMRoom/View/RoomGame/Model/MSRoomGameModel.h +++ b/YuMi/Modules/YMRoom/View/RoomGame/Model/MSRoomGameModel.h @@ -37,6 +37,8 @@ typedef enum : NSUInteger { @property(nonatomic,strong) HomePlayMicUserModel *micUser; @property(nonatomic,assign) int posState; @property(nonatomic,assign) int position; + + @end @interface MSRoomGameInfoModel : PIBaseModel @@ -50,8 +52,6 @@ typedef enum : NSUInteger { @property(nonatomic,assign) MSRoomGameInfoModelType matchStatus; @property(nonatomic,copy) NSString *matchRoundId; - - @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/RoomGame/View/MSRoomGameVC.m b/YuMi/Modules/YMRoom/View/RoomGame/View/MSRoomGameVC.m index 35f3daf5..2024291f 100644 --- a/YuMi/Modules/YMRoom/View/RoomGame/View/MSRoomGameVC.m +++ b/YuMi/Modules/YMRoom/View/RoomGame/View/MSRoomGameVC.m @@ -31,6 +31,7 @@ @property(nonatomic,strong) MSRoomGameView *roomGameView; @property(nonatomic,strong) WalletInfoModel *coinModel; @property(nonatomic,assign) BOOL isShowResults; +@property (nonatomic, strong) MSRoomGameModel *roomGameModel; @end @implementation MSRoomGameVC @@ -130,7 +131,8 @@ obj.avatar = self.headView.rivalModel.avatar; obj.nick = self.headView.rivalModel.nick; } - obj.winNum = obj.rank == 1 ? self.chooseGameModel.scores.firstObject : self.chooseGameModel.scores.lastObject; + obj.winNum = obj.rank == 1 ? self.roomGameModel.data.scores.firstObject : self.roomGameModel.data.scores.lastObject; +// obj.winNum = obj.rank == 1 ? self.chooseGameModel.scores.firstObject : self.chooseGameModel.scores.lastObject; } victoryView.delegate = self; victoryView.resultsList = list; @@ -154,7 +156,8 @@ } -(void)getRoomGameDetailsSuccessWithModel:(MSRoomGameModel *)model{ - if(model == nil && self.isShowResults == NO){ + if(model == nil && + self.isShowResults == NO){ [self quitGameActionWhenClose:YES]; return; } @@ -162,18 +165,33 @@ self.headView.userInfo = self.userinfo; self.roomId = model.roomId; [self enterNIMRoomWithRoomId:self.roomId]; -#if DEBUG - self.roomGameView.gameModel = model; - if(self.roomGameView.superview == nil){ - [self.bgImageView addSubview:self.roomGameView]; - [self.roomGameView mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.equalTo(self.bgImageView); - }]; - [self.roomGameView onRoomEntered]; - } - return; -#endif - if(model.data.matchStatus == MSRoomGameInfoModelMatchSuccessfully && model.data.roundStatus == 0){ +//#if DEBUG +// if(![self.roomId isEqualToString:model.roomId]){ +// [self.presenter exitNIMRoom:self.roomId]; +// self.roomId = model.roomId; +// [self enterNIMRoomWithRoomId:self.roomId]; +// } +// self.headView.roomGameModel = model; +// self.roomGameView.gameModel = model; +// if(self.roomGameView.superview == nil){ +// [self.bgImageView addSubview:self.roomGameView]; +// [self.roomGameView mas_makeConstraints:^(MASConstraintMaker *make) { +// make.edges.equalTo(self.bgImageView); +// }]; +// [self.roomGameView onRoomEntered]; +// } +//// self.roomGameView.gameModel = model; +//// if(self.roomGameView.superview == nil){ +//// [self.bgImageView addSubview:self.roomGameView]; +//// [self.roomGameView mas_makeConstraints:^(MASConstraintMaker *make) { +//// make.edges.equalTo(self.bgImageView); +//// }]; +//// [self.roomGameView onRoomEntered]; +//// } +// return; +//#endif + if(model.data.matchStatus == MSRoomGameInfoModelMatchSuccessfully && + model.data.roundStatus == 0){ self.roomGameView.gameModel = model; if(self.roomGameView.superview == nil){ [self.bgImageView addSubview:self.roomGameView]; @@ -274,6 +292,7 @@ #pragma mark - NIMChatManagerDelegate - (void)onRecvMessages:(NSArray *)messages { for (NIMMessage * message in messages) { + NSLog(@" --- Game Message Raw Attach Content: %@, %@, %ld", @(message.senderClientType), message.rawAttachContent, (long)message.messageType); // 非房间内消息不处理 if (message.session.sessionType != NIMSessionTypeChatroom) { continue; @@ -307,6 +326,7 @@ AttachmentModel * attachment = (AttachmentModel *)obj.attachment; if(attachment.first == CustomMessageType_Chat_Room_Game && attachment.second == Custom_Message_Sub_Room_Game_Match_Success){ MSRoomGameModel *model = [MSRoomGameModel modelWithJSON:attachment.data]; + self.roomGameModel = model; if(![self.roomId isEqualToString:model.roomId]){ [self.presenter exitNIMRoom:self.roomId]; self.roomId = model.roomId; @@ -322,9 +342,6 @@ [self.roomGameView onRoomEntered]; } }if(attachment.first == CustomMessageType_Chat_Room_Game && attachment.second == Custom_Message_Sub_Room_Game_Match_Fail){ -#if DEBUG - return; -#endif MSRoomGameQuitGameView *quitGameView = [[MSRoomGameQuitGameView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)]; quitGameView.delegate = self; quitGameView.isNormalFail = YES; diff --git a/YuMi/Modules/YMRoom/View/RoomGame/View/SubView/MSRoomGameHeadView.m b/YuMi/Modules/YMRoom/View/RoomGame/View/SubView/MSRoomGameHeadView.m index 21b10dc3..f535dbc1 100644 --- a/YuMi/Modules/YMRoom/View/RoomGame/View/SubView/MSRoomGameHeadView.m +++ b/YuMi/Modules/YMRoom/View/RoomGame/View/SubView/MSRoomGameHeadView.m @@ -133,7 +133,6 @@ _roomGameModel = roomGameModel; if(_roomGameModel == nil){ - return; } NSString *uid = [[AccountInfoStorage instance]getUid]; diff --git a/YuMi/Modules/YMRoom/View/RoomGame/View/SubView/MSRoomGameMsgView.m b/YuMi/Modules/YMRoom/View/RoomGame/View/SubView/MSRoomGameMsgView.m index 43c46723..62cec8ff 100644 --- a/YuMi/Modules/YMRoom/View/RoomGame/View/SubView/MSRoomGameMsgView.m +++ b/YuMi/Modules/YMRoom/View/RoomGame/View/SubView/MSRoomGameMsgView.m @@ -108,11 +108,12 @@ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ NSIndexPath *ip = [NSIndexPath indexPathForRow:self.datasource.count-1 inSection:0]; //取最后一行数据 [self.messageTableView scrollToRowAtIndexPath:ip atScrollPosition:UITableViewScrollPositionBottom animated:animated]; //滚动到最后一行 - }); + }); } } -(void)addRoomMessage:(NIMMessage *)msg{ + [self.datasource addObject:[self.messageParser parseMessageAttributeForChatHall:msg]]; [self.messageTableView reloadData]; [self scrollToBottom:YES]; } @@ -214,6 +215,7 @@ isHaveSave = YES; } if(isHaveSave == NO)return; + [self.datasource addObject:[self.messageParser parseMessageAttributeForChatHall:item]]; } - (void)handleNIMTextMessage:(NIMMessage *)message { [self addRoomMessage:message]; diff --git a/YuMi/Modules/YMRoom/View/RoomGame/View/SubView/MSRoomGameView.m b/YuMi/Modules/YMRoom/View/RoomGame/View/SubView/MSRoomGameView.m index 81191689..0e58080a 100644 --- a/YuMi/Modules/YMRoom/View/RoomGame/View/SubView/MSRoomGameView.m +++ b/YuMi/Modules/YMRoom/View/RoomGame/View/SubView/MSRoomGameView.m @@ -56,7 +56,9 @@ } - (void)initLittleGame { + @kWeakify(self); [Api getSudGameCode:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { + @kStrongify(self); if (code == 200) { NSString * gameCode = data.data[@"code"]; self.code = gameCode; @@ -68,13 +70,13 @@ } - (void)gameSetUp { - // NSLog(@"小游戏的版本号是:%@", [SudMGP getVersion]); + // nslog(@"小游戏的版本号是:%@", [SudMGP getVersion]); BOOL isTestEnv = NO; -//#ifdef DEBUG -// isTestEnv = YES; -//#else -// isTestEnv = NO; -//#endif +#ifdef DEBUG + isTestEnv = YES; +#else + isTestEnv = NO; +#endif if(isEnterprise == NO){ [[SudMGP getCfg]setBackgroundMode:NO]; } @@ -88,7 +90,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 +105,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 +157,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,16 +169,16 @@ * 游戏开始 */ -(void)onGameStarted { - // NSLog(@"ISudFSMMG:onGameStarted:游戏开始"); - [self notifySelfInState:YES seatIndex:-1];///加入房间 - [self handleSelfReadyEvent];///准备游戏 + // nslog(@"ISudFSMMG:onGameStarted:游戏开始"); + [self notifySelfInState:YES seatIndex:-1];///加入房间 + [self handleSelfReadyEvent];///准备游戏 } /** * 游戏销毁 */ -(void)onGameDestroyed { - // NSLog(@"ISudFSMMG:onGameDestroyed:游戏开始"); + // nslog(@"ISudFSMMG:onGameDestroyed:游戏销毁"); } /** @@ -184,14 +186,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]; @@ -239,35 +241,45 @@ dict[@"ret_msg"] = @"return form APP onGetGameCfg"; // 将 JSON 字符串转换为 NSData - NSData *jsonData = [self.gameModel.data.configJson dataUsingEncoding:NSUTF8StringEncoding]; + NSData *jsonData = [configJson dataUsingEncoding:NSUTF8StringEncoding]; // 解析 JSON 数据为字典 NSError *error; - NSDictionary *dictionary = [NSJSONSerialization JSONObjectWithData:jsonData - options:NSJSONReadingMutableContainers - error:&error]; + NSMutableDictionary *dictionary = [[NSJSONSerialization JSONObjectWithData:jsonData + options:NSJSONReadingMutableContainers + error:&error] mutableCopy]; // 检查是否解析成功 if (error) { - NSLog(@"JSON 解析失败: %@", error.localizedDescription); + // nslog(@"JSON 解析失败: %@", error.localizedDescription); } else { - NSLog(@"解析后的字典: %@", dictionary); + // nslog(@"解析后的字典: %@", dictionary); + // 禁止模式选择 + NSMutableDictionary *ui = [[NSMutableDictionary alloc] initWithDictionary:dictionary[@"ui"]]; + [ui setObject: @{@"hide" : @(YES)} + forKey:@"lobby_game_setting"]; + [dictionary setObject:ui forKey:@"ui"]; + // nslog(@"更新后的字典: %@", dictionary); } - dict[@"ui"] = @{ - @"join_btn" : @{@"custom": @(YES), @"hide": @(YES)},//加入游戏 - @"start_btn" : @{@"custom": @(YES), @"hide": @(YES)},//开始游戏 - @"ready_btn" : @{@"custom": @(YES), @"hide": @(YES)},//准备游戏 - @"lobby_players" : @{@"custom": @(YES), @"hide": @(YES)},//游戏中坑位点击 - @"level" : @{@"custom": @(YES), @"hide" : @(YES)},//段位信息 - @"cancel_join" : @{@"custom": @(YES), @"hide" : @(YES)},//退出游戏 - }; +// dict[@"ui"] = @{ +// @"join_btn" : @{@"custom": @(YES), @"hide": @(YES)},//加入游戏 +// @"start_btn" : @{@"custom": @(YES), @"hide": @(YES)},//开始游戏 +// @"ready_btn" : @{@"custom": @(YES), @"hide": @(YES)},//准备游戏 +// @"lobby_players" : @{@"custom": @(NO), @"hide": @(NO)},//游戏中坑位点击 +// @"level" : @{@"custom": @(YES), @"hide" : @(YES)},//段位信息 +// @"cancel_join" : @{@"custom": @(YES), @"hide" : @(YES)},//退出游戏 +// @"dt_custom_hide_lobby_settings" : @{@"custom":@(YES), @"hide" : @(YES)} +// }; // dict[@"ui"] = dictionary; NSString *dataJsonRet = @""; - NSData *dataJsonData = [NSJSONSerialization dataWithJSONObject:dict options:NSJSONWritingPrettyPrinted error:nil]; + NSData *dataJsonData = [NSJSONSerialization dataWithJSONObject:dictionary.copy options:NSJSONWritingPrettyPrinted error:nil]; if (dataJsonData != nil) { dataJsonRet = [[NSString alloc]initWithData:dataJsonData encoding:NSUTF8StringEncoding]; } + if ([NSString isEmpty:dataJsonRet]) { + dataJsonRet = configJson; + } [handle success:dataJsonRet]; } @@ -278,8 +290,12 @@ * @param dataJson 回调json */ -(void)onGameStateChange:(id) handle state:(NSString*) state dataJson:(NSString*) dataJson { - - if([state isEqualToString:MG_COMMON_GAME_SETTLE]){ + // nslog(@"onGameStateChange 回调: %@ \n%@", state, dataJson); + if ([state isEqualToString:MG_COMMON_SELF_CLICK_READY_BTN]) { +// [self addAI]; + } else if ([state isEqualToString:@"mg_common_game_add_ai_players"]) { + // nslog(@" ????????????????????????????????????????????? "); + } else if([state isEqualToString:MG_COMMON_GAME_SETTLE]){ NSDictionary *data = @{@"value0":self.gameModel.data.matchRoundId ?: @""}; NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:[data mj_JSONString] , @"reportGameInfoExtras",@"value0" , @"reportGameInfoKey" ,nil]; [self notifyStateChange:MG_COMMON_GAME_SETTLE dataJson:[SudCommon dictionaryToJson:dic]]; @@ -292,7 +308,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]) {//加入游戏按钮点击 @@ -302,9 +318,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]) {//开始游戏按钮点击 @@ -314,7 +330,7 @@ [self handleSelfInExitEvent]; } else { /// 其他状态 - // NSLog(@"ISudFSMMG:onGameStateChange:游戏->APP:state:%@",MG_COMMON_PUBLIC_MESSAGE); + // nslog(@"ISudFSMMG:onGameStateChange:游戏->APP:state:%@",MG_COMMON_PUBLIC_MESSAGE); } } @@ -326,7 +342,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]) { @@ -347,7 +363,6 @@ } else if ([state isEqualToString:MG_COMMON_PLAYER_CAPTAIN]) { dataStr = YMLocalizedString(@"XPRoomLittleGameContainerView2"); [self handleState_MG_COMMON_PLAYER_CAPTAIN_WithUserId:userId dataJson:dataJson]; - } else if ([state isEqualToString:MG_COMMON_PLAYER_PLAYING]) { dataStr = YMLocalizedString(@"XPRoomLittleGameContainerView3"); [self handleState_MG_COMMON_PLAYER_PLAYING_WithUserId:userId dataJson:dataJson]; @@ -367,9 +382,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]]; @@ -377,8 +392,7 @@ /// 退出游戏 - (void)handleSelfInExitEvent { - - + /// 下游戏麦 [self notifyIsPlayingState:false]; [self nofityPlayerPlaying:NO]; @@ -392,9 +406,7 @@ /// 准备游戏 - (void)handleSelfReadyEvent { [self notifySetReady:true]; -#if DEBUG [self addAI]; -#endif } /// 取消准备 @@ -408,11 +420,22 @@ } - (void)addAI { - [self.fsmAPP2MG notifyStateChange:@"app_common_game_add_ai_players" - dataJson:@"{ \"aiPlayers\": [ { \"userId\": \"123456\", \"avatar\": \"https://img.toto.im/mw600/66b3de17ly1i09jnywvp7j20go06wt9g.jpg\", \"name\": \"煎蛋\", \"gender\": \"female\", \"level\":3, } ], \"isReady\": 1 }" - listener:^(int retCode, const NSString * _Nonnull retMsg, const NSString * _Nonnull dataJson) { - - }]; + for (MSRoomGameMicModel *micModel in self.gameModel.roomMics) { + HomePlayMicUserModel *aiUser = micModel.micUser; + if (aiUser && ![aiUser.uid isEqualToString:[[AccountInfoStorage instance] getUid]] && aiUser.aiLevel) { + [self notifyStateChange:@"app_common_game_add_ai_players" + dataJson:[SudCommon dictionaryToJson:@{ + @"aiPlayers":@[@{ + @"userId": aiUser.uid, + @"avatar": aiUser.avatar, + @"name": aiUser.nick, + @"gender": aiUser.gender == GenderType_Male ? @"male" : @"female", + @"level": aiUser.aiLevel, + }], + @"isReady":@"1", + }]]; + } + } } #pragma mark =======APP->游戏状态处理======= @@ -420,8 +443,9 @@ /// @param state 状态名称 /// @param dataJson 需传递的json - (void)notifyStateChange:(NSString *) state dataJson:(NSString*) dataJson { + // nslog(@"ISudFSMMG: START notifyStateChange:state=%@ \ndataJson=%@", state, 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]) {//开始游戏 //上报游戏开始 @@ -582,11 +606,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; @@ -597,18 +621,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/RoomPK/View/XPRoomPKPanelView.m b/YuMi/Modules/YMRoom/View/RoomPK/View/XPRoomPKPanelView.m index 5f1603e4..879d2d04 100644 --- a/YuMi/Modules/YMRoom/View/RoomPK/View/XPRoomPKPanelView.m +++ b/YuMi/Modules/YMRoom/View/RoomPK/View/XPRoomPKPanelView.m @@ -1024,7 +1024,6 @@ groupType:(GroupType)groupType didChooseUserInfos:(NSArray *)userInfos { [TTPopup dismiss]; - // TODO: 应该对比队伍内容后, if (groupType == GroupType_Red) { self.redChooseArray = userInfos; } else { diff --git a/YuMi/Modules/YMRoom/View/RoomSideMenu/RoomSideMenu.m b/YuMi/Modules/YMRoom/View/RoomSideMenu/RoomSideMenu.m index aa02ed7d..b7eb77eb 100644 --- a/YuMi/Modules/YMRoom/View/RoomSideMenu/RoomSideMenu.m +++ b/YuMi/Modules/YMRoom/View/RoomSideMenu/RoomSideMenu.m @@ -520,6 +520,12 @@ static CGFloat const kNormalHeight = 160.0f; MSRoomMenuGameVC *vc = [[MSRoomMenuGameVC alloc] initWithDelegate:self.hostDelegate roomMenuType:MSRoomMenuTypeGame]; vc.modalPresentationStyle = UIModalPresentationOverFullScreen; [self.hostDelegate.getCurrentNav presentViewController:vc animated:YES completion:nil]; + @kWeakify(self); + [vc setUpdatePlayListAndGameList:^(NSArray * _Nonnull playList, NSArray * _Nonnull gameList) { + @kStrongify(self); + self.playList = playList.mutableCopy; + self.littleGameList = gameList.mutableCopy; + }]; } - (void)didTapConfigEntranceButton { diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/Api/Api+Gift.h b/YuMi/Modules/YMRoom/View/SendGiftView/Api/Api+Gift.h index 3c5bbfc1..4e1fe753 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/Api/Api+Gift.h +++ b/YuMi/Modules/YMRoom/View/SendGiftView/Api/Api+Gift.h @@ -91,6 +91,9 @@ NS_ASSUME_NONNULL_BEGIN /// 拉取房间资源 + (void)requestRoomResource:(HttpRequestHelperCompletion)complection; + +/// Bravo礼物tab滚屏内容 ++ (void)bravoGetBannerList:(HttpRequestHelperCompletion)completion; @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/Api/Api+Gift.m b/YuMi/Modules/YMRoom/View/SendGiftView/Api/Api+Gift.m index 764124ba..a362bd7f 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/Api/Api+Gift.m +++ b/YuMi/Modules/YMRoom/View/SendGiftView/Api/Api+Gift.m @@ -114,4 +114,8 @@ [HttpRequestHelper request:fang method:HttpRequestHelperMethodGET params:params completion:completion]; } ++ (void)bravoGetBannerList:(HttpRequestHelperCompletion)completion{ + [self makeRequest:@"bravo/getBannerList" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, nil]; +} + @end diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/GiftComboManager.m b/YuMi/Modules/YMRoom/View/SendGiftView/GiftComboManager.m index 38b28002..2825cee5 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/GiftComboManager.m +++ b/YuMi/Modules/YMRoom/View/SendGiftView/GiftComboManager.m @@ -8,6 +8,8 @@ #import "GiftComboManager.h" +#import + #import "Api+Gift.h" #import "UserInfoModel.h" @@ -72,8 +74,6 @@ return sharedInstance; } - - //// 添加 GiftReceiveInfoModel 和 metadata 到队列 - (void)addGiftComboWithInfo:(GiftReceiveInfoModel *)info andMetadata:(NSDictionary *)metadata { if (info && metadata) { @@ -470,7 +470,24 @@ self.actionCallback(ComboAction_Error); } [self forceRemove]; + + NSMutableDictionary *logDic = [dic mutableCopy]; + [logDic setObject:@(self.combo) forKey:@"combo_count"]; + [logDic setObject:[NSThread callStackSymbols] forKey:@"call stack symbols"]; + BLYLog(BuglyLogLevelWarn, @"%@", [logDic toJSONString]); + [Bugly reportError:[NSError errorWithDomain:[NSString stringWithFormat:@"combo 发送礼物异常-%@", + @(code)] + code:[AccountInfoStorage instance].getUid.integerValue + userInfo:logDic]]; } +// TODO: 聚合到 skill card manager +// [Bugly reportExceptionWithCategory:263059 +// name:[NSString stringWithFormat:@"combo 发送礼物异常-%@", +// @(code)] +// reason:msg +// callStack:[NSThread callStackSymbols] +// extraInfo:logDic +// terminateApp:NO]; } targetUids:allUIDs giftNum:self.giftNumPerTimes diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/Model/GiftInfoModel.h b/YuMi/Modules/YMRoom/View/SendGiftView/Model/GiftInfoModel.h index 33365bb9..195cfb75 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/Model/GiftInfoModel.h +++ b/YuMi/Modules/YMRoom/View/SendGiftView/Model/GiftInfoModel.h @@ -27,7 +27,7 @@ typedef NS_ENUM(NSUInteger, GiftType) { GiftType_Lucky24 = 18, //幸运24 GiftType_CP = 19, // CP GiftType_Custom = 20, // 定制 - GiftType_Brove = 21, // 超级礼物 + GiftType_Bravo = 21, // 超级礼物 }; //礼物类型 diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/Model/GiftInfoModel.m b/YuMi/Modules/YMRoom/View/SendGiftView/Model/GiftInfoModel.m index c7a097f0..109346de 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/Model/GiftInfoModel.m +++ b/YuMi/Modules/YMRoom/View/SendGiftView/Model/GiftInfoModel.m @@ -57,8 +57,8 @@ MJCodingImplementation return GiftType_Custom; } else if ([self.key isEqualToString:@"cpGift"]) { return GiftType_CP; - } else if ([self.key isEqualToString:@"broveGift"]) { - return GiftType_Brove; + } else if ([self.key isEqualToString:@"bravoGift"]) { + return GiftType_Bravo; } return GiftType_Game; diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/Model/GiftReceiveInfoModel.h b/YuMi/Modules/YMRoom/View/SendGiftView/Model/GiftReceiveInfoModel.h index 9dfd92d6..fdc78844 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/Model/GiftReceiveInfoModel.h +++ b/YuMi/Modules/YMRoom/View/SendGiftView/Model/GiftReceiveInfoModel.h @@ -37,6 +37,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, assign) NSInteger giftNum; @property (nonatomic, assign) NSInteger prizeLevel; @property (nonatomic, assign) NSInteger giftId; +@property (nonatomic, assign) NSInteger goldPrice; @end diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/Presenter/XPGiftPresenter.h b/YuMi/Modules/YMRoom/View/SendGiftView/Presenter/XPGiftPresenter.h index b0d92ca0..d71120e5 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/Presenter/XPGiftPresenter.h +++ b/YuMi/Modules/YMRoom/View/SendGiftView/Presenter/XPGiftPresenter.h @@ -1,5 +1,5 @@ // -// YMGiftPresenter.h +// XPGiftPresenter.h // YUMI // // Created by YUMI on 2021/11/9. @@ -7,6 +7,8 @@ #import "BaseMvpPresenter.h" #import "GiftInfoModel.h" +#import "BravoGiftTabInfomationModel.h" + NS_ASSUME_NONNULL_BEGIN @interface XPGiftPresenter : BaseMvpPresenter @@ -49,7 +51,7 @@ NS_ASSUME_NONNULL_BEGIN ///星座礼物 - (void)getTwelveStarLastRankFirst:(NSString *)roomUid; - +- (void)bravoGetBannerList:(void(^)(NSArray *array))success failure:(void(^)(NSError *error))failure; @end diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/Presenter/XPGiftPresenter.m b/YuMi/Modules/YMRoom/View/SendGiftView/Presenter/XPGiftPresenter.m index c53107e0..2a3ca978 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/Presenter/XPGiftPresenter.m +++ b/YuMi/Modules/YMRoom/View/SendGiftView/Presenter/XPGiftPresenter.m @@ -19,6 +19,7 @@ #import "GiftTwelveStarFirstModel.h" ///P #import "XPGiftProtocol.h" +#import @interface XPGiftPresenter () /// @@ -124,6 +125,30 @@ }fail:^(NSInteger code, NSString * _Nullable msg) { @kStrongify(self); [[self getView] sendGiftFailWithCode:code msg:msg]; + + NSMutableDictionary *logDic = [@{ + @"targetUids":targetUids, + @"giftNum":giftNum, + @"sendType":@(sendType), + @"giftSource":@(giftSource), + @"giftId":giftId, + @"roomSendType":@(roomSendType), + @"roomUid":roomUid, + @"msg":msg, + @"call stack symbols":[NSThread callStackSymbols] + } mutableCopy]; + BLYLog(BuglyLogLevelWarn, @"%@", [logDic toJSONString]); + [Bugly reportError:[NSError errorWithDomain:[NSString stringWithFormat:@"面版 发送礼物异常-%@", + @(code)] + code:[AccountInfoStorage instance].getUid.integerValue + userInfo:logDic]]; +// [Bugly reportExceptionWithCategory:263059 +// name:[NSString stringWithFormat:@"combo 发送礼物异常-%@", +// @(code)] +// reason:msg +// callStack:[NSThread callStackSymbols] +// extraInfo:logDic +// terminateApp:NO]; }] targetUids:targetUids giftNum:giftNum sendType:giftSendTypeStr giftId:giftId giftSource:giftSourceStr giftType:giftTypeStr roomUid:roomUid msg:msg uid:uid]; } @@ -149,4 +174,17 @@ }] roomUid:roomUid]; } +- (void)bravoGetBannerList:(void(^)(NSArray *array))success failure:(void(^)(NSError *error))failure { + [Api bravoGetBannerList:[self createHttpCompletion:^(BaseModel * _Nonnull data) { + if (success) { +// NSArray + success([BravoGiftTabInfomationModel modelsWithArray:data.data]); + } + } fail:^(NSInteger code, NSString * _Nullable msg) { + if (failure) { + failure([NSError errorWithDomain:msg code:code userInfo:nil]); + } + } showLoading:NO errorToast:NO] ]; +} + @end diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/View/GiftComboView.h b/YuMi/Modules/YMRoom/View/SendGiftView/View/GiftComboView.h index f690dd04..4c8ae400 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/View/GiftComboView.h +++ b/YuMi/Modules/YMRoom/View/SendGiftView/View/GiftComboView.h @@ -13,7 +13,7 @@ NS_ASSUME_NONNULL_BEGIN @interface GiftComboView : UIView - (void)setupCurrentGold:(double)gold; -- (void)updateCurrentGold:(double)gold giftPrice:(double)price isFromWinning:(BOOL)isFromWinning isBrove:(BOOL)isBrove; +- (void)updateCurrentGold:(double)gold giftPrice:(double)price isFromWinning:(BOOL)isFromWinning isBravo:(BOOL)isBrove; - (void)updateCount; - (void)stopTimer; - (void)endCombo; diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/View/GiftComboView.m b/YuMi/Modules/YMRoom/View/SendGiftView/View/GiftComboView.m index 2f560cfe..03ace1f9 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/View/GiftComboView.m +++ b/YuMi/Modules/YMRoom/View/SendGiftView/View/GiftComboView.m @@ -108,7 +108,7 @@ - (void)handleStringNotification:(NSString *)coin { if (![NSString isEmpty:coin]) { - [self updateCurrentGold:coin.doubleValue giftPrice:0 isFromWinning:YES isBrove:YES]; + [self updateCurrentGold:coin.doubleValue giftPrice:0 isFromWinning:YES isBravo:YES]; } } @@ -116,7 +116,7 @@ double coin = [[dic objectForKey:@"CurrentGold"] doubleValue]; double price = [[dic objectForKey:@"Price"] doubleValue]; BOOL isFromWinning = [[dic objectForKey:@"isFromWinning"] boolValue]; - [self updateCurrentGold:coin giftPrice:price isFromWinning:isFromWinning isBrove:YES]; + [self updateCurrentGold:coin giftPrice:price isFromWinning:isFromWinning isBravo:YES]; } - (void)updateCount { @@ -137,13 +137,7 @@ } - (void)endCombo { -// [[NSNotificationCenter defaultCenter] removeObserver:self]; -// [self.countdownRingView stopCountdown]; -// [self.countdownRingView removeFromSuperview]; -// self.countdownRingView = nil; -// [self.playImageView stopAnimation]; -// [self.playImageView clear]; -// self.playImageView.delegate = nil; + } - (void)setupUI { @@ -253,7 +247,6 @@ #pragma mark - - (void)setupCurrentGold:(double)gold { - NSLog(@" --- --- --- 更新总数:%f", gold); self.comboGoldNum = gold; self.comboGoldLabel.text = @(gold).stringValue; @@ -282,7 +275,7 @@ } } -- (void)updateCurrentGold:(double)gold giftPrice:(double)price isFromWinning:(BOOL)isFromWinning isBrove:(BOOL)isBrove { +- (void)updateCurrentGold:(double)gold giftPrice:(double)price isFromWinning:(BOOL)isFromWinning isBravo:(BOOL)isBrove { NSString *goldString = isFromWinning ? [NSString stringWithFormat:@"+ %@", @(gold)] : @(-price).stringValue; if (isFromWinning) { // if (!isBrove) { diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/View/PIGiftBravoGiftBroadcastView.h b/YuMi/Modules/YMRoom/View/SendGiftView/View/PIGiftBravoGiftBroadcastView.h new file mode 100644 index 00000000..bb73cf0a --- /dev/null +++ b/YuMi/Modules/YMRoom/View/SendGiftView/View/PIGiftBravoGiftBroadcastView.h @@ -0,0 +1,18 @@ +// +// PIGiftBravoGiftBroadcastView.h +// YuMi +// +// Created by P on 2025/4/14. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface PIGiftBravoGiftBroadcastView : UIView + +- (void)endloop; + +@end + +NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/View/PIGiftBravoGiftBroadcastView.m b/YuMi/Modules/YMRoom/View/SendGiftView/View/PIGiftBravoGiftBroadcastView.m new file mode 100644 index 00000000..36bc895d --- /dev/null +++ b/YuMi/Modules/YMRoom/View/SendGiftView/View/PIGiftBravoGiftBroadcastView.m @@ -0,0 +1,240 @@ +// +// PIGiftBravoGiftBroadcastView.m +// YuMi +// +// Created by P on 2025/4/14. +// + +#import "PIGiftBravoGiftBroadcastView.h" +#import "XPSkillCardPlayerManager.h" +#import "BravoGiftTabInfomationModel.h" +@interface PIGiftBravoGiftBroadcastView() + +@property (nonatomic, strong) UIImageView *speaker; +@property (nonatomic, strong) MarqueeLabel *label; +@property (nonatomic, strong) UIView *container; +@property (nonatomic, copy) NSArray * source; +@property (nonatomic, strong) NSMutableArray *labels; +@property (nonatomic, assign) NSInteger index; +@property (nonatomic, assign) NSInteger loopStatus; // -1: 頁面回收,0:未啟動,1:啟動中 +@property (nonatomic, strong) NSMutableArray *imageLoaders; +@property (nonatomic, strong) UIButton *tipsButton; + +@end + +@implementation PIGiftBravoGiftBroadcastView + +- (void)dealloc { + +} + +- (instancetype)initWithFrame:(CGRect)frame { + if (self = [super initWithFrame:frame]) { + self.source = [[XPSkillCardPlayerManager shareInstance] loadBravoGiftTabInfomation]; + [self setupUI]; + } + return self; +} + +- (void)setupUI { + [self addSubview:self.container]; + [self.container mas_makeConstraints:^(MASConstraintMaker *make) { + make.leading.trailing.mas_equalTo(self).inset(10); + make.bottom.mas_equalTo(self).offset(-4); + make.height.mas_equalTo(34); + }]; + + [self addSubview:self.tipsButton]; + [self.tipsButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.trailing.mas_equalTo(-10); + make.bottom.mas_equalTo(self.container.mas_top).offset(-9); + make.height.mas_equalTo(24); + make.width.mas_greaterThanOrEqualTo(60); + }]; + + [self addSubview:self.speaker]; + [self.speaker mas_makeConstraints:^(MASConstraintMaker *make) { + make.leading.bottom.mas_equalTo(self); + make.size.mas_equalTo(CGSizeMake(29, 29)); + }]; + + self.labels = [[NSMutableArray alloc] init]; + self.imageLoaders = [[NSMutableArray alloc] init]; + @kWeakify(self); + [self.source enumerateObjectsUsingBlock:^(BravoGiftTabInfomationModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { + @kStrongify(self); + NetImageView *avatar = [[NetImageView alloc] init]; + [avatar loadImageWithUrl:obj.avatar completion:^(UIImage * _Nullable image, NSURL * _Nonnull url) { + NSTextAttachment *avatarAttachment = [[NSTextAttachment alloc] init]; + avatarAttachment.image = [image roundedImageWithCornerRadius:12*3 size:CGSizeMake(24*3, 24*3)]; + avatarAttachment.bounds = CGRectMake(0, -5, 24, 24); + NSTextAttachment *coinAttachment = [[NSTextAttachment alloc] init]; + coinAttachment.image = kImage(@"moli_money_icon"); + coinAttachment.bounds = CGRectMake(0, -3, 18, 18); + NSAttributedString *avatarString = [NSAttributedString attributedStringWithAttachment:avatarAttachment]; + NSAttributedString *coinString = [NSAttributedString attributedStringWithAttachment:coinAttachment]; + NSString *giftName = obj.giftName; + NSString *coin = @(obj.coin).stringValue; + NSString *oringinalString = [NSString stringWithFormat:@" %@ %@ %@ %@ %@ ", + [NSString trimString:obj.nick lengthLimit:4], + YMLocalizedString(@"Combo_7"), + giftName, YMLocalizedString(@"Combo_4"), coin]; + + NSMutableAttributedString *string = [[NSMutableAttributedString alloc] init]; + [string appendAttributedString:[[NSAttributedString alloc] initWithString:oringinalString attributes:@{ + NSFontAttributeName: kFontRegular(13), + NSForegroundColorAttributeName: [UIColor whiteColor] + }]]; + + // 找到 giftName 和 coin 在字符串中的位置 + NSRange giftNameRange = [oringinalString rangeOfString:giftName]; + NSRange coinRange = [oringinalString rangeOfString:coin]; + + // 创建黄色文本的属性 + NSDictionary *yellowAttributes_name = @{ + NSFontAttributeName: kFontRegular(13), + NSForegroundColorAttributeName: UIColorFromRGB(0xffec6f) + }; + NSDictionary *yellowAttributes_coin = @{ + NSFontAttributeName: kFontSemibold(16), + NSForegroundColorAttributeName: UIColorFromRGB(0xffec6f) + }; + // 创建包含黄色文本的可变字符串 + NSMutableAttributedString *yellowGiftName = [[NSMutableAttributedString alloc] initWithString:giftName attributes:yellowAttributes_name]; + NSMutableAttributedString *yellowCoin = [[NSMutableAttributedString alloc] initWithString:coin attributes:yellowAttributes_coin]; + + // 替换原始字符串中的 giftName 和 coin 为黄色文本 + [string replaceCharactersInRange:giftNameRange withAttributedString:yellowGiftName]; + [string replaceCharactersInRange:coinRange withAttributedString:yellowCoin]; + + [string insertAttributedString:avatarString atIndex:0]; + [string appendAttributedString:coinString]; + + UILabel *label = [[UILabel alloc] init]; + label.attributedText = string.copy; + [self.labels addObject:label]; + if (self.loopStatus>-1) { + [self startLoop]; + } + }]; + [self.imageLoaders addObject:avatar]; + }]; +} + +- (void)startLoop { + if (self.loopStatus > 0 || self.labels.count == 0) { + return; + } + self.loopStatus = 1; + + // 获取当前索引的标签 + UILabel *label = [self.labels xpSafeObjectAtIndex:self.index]; + if (label) { + // 设置标签的初始位置(屏幕右侧) + label.frame = CGRectMake(KScreenWidth, 2, KScreenWidth - 25 - 42, 26); + // 将标签添加到容器视图 + [self.container addSubview:label]; + + // 动画:标签从屏幕右侧移动到左侧 + [UIView animateWithDuration:0.5 animations:^{ + label.frame = CGRectMake(25, 2, KScreenWidth - 25 - 42, 26); + } completion:^(BOOL finished) { + // 延迟动画:标签从左侧移出屏幕 + [UIView animateWithDuration:0.5 delay:2 options:UIViewAnimationOptionCurveEaseIn animations:^{ + label.frame = CGRectMake(-KScreenWidth, 2, KScreenWidth - 25 - 42, 26); + } completion:^(BOOL finished) { + // 移除标签 + [label removeFromSuperview]; + // 索引递增 + self.index += 1; + + // 检查是否到达最后一个标签 + if (self.index >= self.labels.count) { + // 重置索引为0 + self.index = 0; + } + + // 设置循环标志为NO + self.loopStatus = 0; + // 递归调用startLoop继续循环 + [self startLoop]; + }]; + }]; + } +} + +- (void)endloop { + self.loopStatus = -1; + + // 取消所有动画 + [self.container.layer removeAllAnimations]; + + // 清理图片加载器 + [self.imageLoaders removeAllObjects]; + + // 清理标签 + for (UILabel *label in self.labels) { + [label removeFromSuperview]; + } + [self.labels removeAllObjects]; +} + +- (void)didTapTips { + TTAlertConfig *config = [[TTAlertConfig alloc] init]; + config.title = YMLocalizedString(@"20.20.56_text_15"); + config.message = YMLocalizedString(@"20.20.56_text_16"); + config.actionStyle = 0; + [TTPopup alertWithConfig:config + confirmHandler:^{} + cancelHandler:^{}]; +} + +#pragma mark - +- (UIImageView *)speaker { + if (!_speaker) { + _speaker = [[UIImageView alloc] initWithImage:isMSRTL() ? kImage(@"bravo_speaker_ar") : kImage(@"bravo_speaker")]; + } + return _speaker; +} + +- (UIView *)container { + if (!_container) { + + NSArray *colors; + if (isMSRTL()) { + colors = @[ + [UIColor colorWithWhite:0 alpha:0], + [UIColor colorWithWhite:0 alpha:0.9]]; + } else { + colors = @[ + [UIColor colorWithWhite:0 alpha:0.9], + [UIColor colorWithWhite:0 alpha:0]]; + } + _container = [[UIView alloc] init]; + [_container addGradientBackgroundWithColors:colors startPoint:CGPointMake(0, 0.5) endPoint:CGPointMake(0.95, 0.5) cornerRadius:17]; + + } + return _container; +} + +- (UIButton *)tipsButton { + if (!_tipsButton) { + _tipsButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_tipsButton setBackgroundColor:[UIColor colorWithWhite:0 alpha:0.5]]; + [_tipsButton setCornerRadius:12]; + [_tipsButton addTarget:self action:@selector(didTapTips) forControlEvents:UIControlEventTouchUpInside]; + NSTextAttachment *attachment = [[NSTextAttachment alloc] init]; + attachment.image = kImage(@"question_mark"); + attachment.bounds = CGRectMake(0, -4, 18, 18); + NSMutableAttributedString *string = [[NSMutableAttributedString alloc] initWithAttributedString:[NSAttributedString attributedStringWithAttachment:attachment]]; + [string appendAttributedString:[[NSAttributedString alloc] initWithString:YMLocalizedString(@"20.20.56_text_17") attributes:@{ + NSFontAttributeName: kFontRegular(12), + NSForegroundColorAttributeName: [UIColor whiteColor] + }]]; + [_tipsButton setAttributedTitle:string forState:UIControlStateNormal]; + + } + return _tipsButton; +} + +@end diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/View/PIGiftInfoSegmentedView.m b/YuMi/Modules/YMRoom/View/SendGiftView/View/PIGiftInfoSegmentedView.m index 7233196f..7ab34fbc 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/View/PIGiftInfoSegmentedView.m +++ b/YuMi/Modules/YMRoom/View/SendGiftView/View/PIGiftInfoSegmentedView.m @@ -54,7 +54,7 @@ /// 定制 @property (nonatomic,strong)XPGiftInfoView *customVC; -@property (nonatomic,strong)XPGiftInfoView *broveVC; +@property (nonatomic,strong)XPGiftInfoView *bravoVC; @property (nonatomic, strong) UIActivityIndicatorView *loadingView; @@ -213,8 +213,8 @@ return self.customVC; } break; - case GiftType_Brove: { - return self.broveVC; + case GiftType_Bravo: { + return self.bravoVC; } break; default: @@ -245,7 +245,7 @@ return i; } else if (tabGiftType == GiftType_Custom && self.segmentType == GiftSegmentType_Custom) { return i; - } else if (tabGiftType == GiftType_Brove && self.segmentType == GiftSegmentType_Brove) { + } else if (tabGiftType == GiftType_Bravo && self.segmentType == GiftSegmentType_Bravo) { return i; } } @@ -549,13 +549,13 @@ } return _cpVC; } --(XPGiftInfoView *)broveVC{ - if(!_broveVC){ - _broveVC = [[XPGiftInfoView alloc]init]; - _broveVC.delegate = self; - _broveVC.segmentType = GiftSegmentType_Brove; +-(XPGiftInfoView *)bravoVC{ + if(!_bravoVC){ + _bravoVC = [[XPGiftInfoView alloc]init]; + _bravoVC.delegate = self; + _bravoVC.segmentType = GiftSegmentType_Bravo; } - return _broveVC; + return _bravoVC; } -(XPGiftInfoView *)customVC{ if(!_customVC){ diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/View/XPGiftInfoView.h b/YuMi/Modules/YMRoom/View/SendGiftView/View/XPGiftInfoView.h index ce14ea93..c6645fd2 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/View/XPGiftInfoView.h +++ b/YuMi/Modules/YMRoom/View/SendGiftView/View/XPGiftInfoView.h @@ -25,7 +25,7 @@ typedef NS_ENUM(NSInteger, GiftSegmentType) { GiftSegmentType_Country,///国家礼物 GiftSegmentType_CP,///cp礼物 GiftSegmentType_Custom,///cp礼物 - GiftSegmentType_Brove,///超级礼物 + GiftSegmentType_Bravo,///超级礼物 }; diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/View/XPSendGiftView.m b/YuMi/Modules/YMRoom/View/SendGiftView/View/XPSendGiftView.m index 96f7b846..4151e719 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/View/XPSendGiftView.m +++ b/YuMi/Modules/YMRoom/View/SendGiftView/View/XPSendGiftView.m @@ -39,6 +39,7 @@ #import "XPGiftLuckyGiftBroadcastView.h" #import "XPGiftTwelveStarBroadcastView.h" #import "VIPCenterViewController.h" +#import "PIGiftBravoGiftBroadcastView.h" ///P #import "XPGiftProtocol.h" ///VC @@ -68,6 +69,7 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; ///星座礼物广播 @property (nonatomic, strong) XPGiftTwelveStarBroadcastView *constellationBanner; +@property (nonatomic, strong) PIGiftBravoGiftBroadcastView *bravoGiftView; ///超级礼物 @property(nonatomic,strong) PIGiftSuperGiftBroadcastView *superGiftView; ///礼物类型(普通/互动) @@ -120,6 +122,10 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; [[NSNotificationCenter defaultCenter] removeObserver:self]; [[GiftComboManager sharedManager] registerActions:nil]; + + if (_bravoGiftView) { + [self.bravoGiftView endloop]; + } } - (instancetype)initWithType:(SendGiftType)type uid:(NSString * __nullable)uid{ @@ -593,7 +599,7 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; if (giftInfo.giftType != GiftType_Game && giftInfo.giftType != GiftType_super && giftInfo.giftType != GiftType_Lucky24 && - giftInfo.giftType != GiftType_Brove) { + giftInfo.giftType != GiftType_Bravo) { [[GiftComboManager sharedManager] enableToCombo:NO]; return; } @@ -619,8 +625,6 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; GiftInfoModel *giftInfo = self.giftInfoView.lastSelectGift; if (self.usingplaceType == SendGiftType_Room) { if (uids.count > 0) { - - [self readyForCombo:giftCount gift:giftInfo]; @@ -745,6 +749,7 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; - (void)xPGiftHeadTypeViewDidClickGift:(XPGiftHeadTypeView *)view { [self.luckyBroadcastView removeFromSuperview]; [self.superGiftView removeFromSuperview]; + [self.bravoGiftView removeFromSuperview]; // [self.giftInfoView giftHeadTypeHadChange:1]; if (!self.graffitiView.hidden) {//清空涂鸦礼物 [self.graffitiView clearData]; @@ -759,6 +764,7 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; - (void)xPGiftHeadTypeViewDidClickInteraction:(XPGiftHeadTypeView *)view { [self.luckyBroadcastView removeFromSuperview]; [self.superGiftView removeFromSuperview]; + [self.bravoGiftView removeFromSuperview]; // [self.giftInfoView giftHeadTypeHadChange:2]; } @@ -771,9 +777,21 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; self.giftBarView.drawGiftCount = 10; [self.superGiftView removeFromSuperview]; [self.luckyBroadcastView removeFromSuperview]; - [self.constellationBanner removeFromSuperview]; + [self.bravoGiftView removeFromSuperview]; + [self.constellationBanner removeFromSuperview]; switch (type) { + case GiftSegmentType_Bravo: { + if (!self.bravoGiftView.superview) { + [self.view addSubview:self.bravoGiftView]; + [self.bravoGiftView mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.mas_equalTo(self.contentView.mas_top); + make.leading.trailing.mas_equalTo(0); + make.height.mas_equalTo(kGetScaleWidth(80)); + }]; + } + } + break; case GiftSegmentType_Lucky: { if (!self.luckyBroadcastView.superview) { [self.view addSubview:self.luckyBroadcastView]; @@ -826,7 +844,21 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; ///点击了某个item - (void)pIGiftInfoSegmentedView:(PIGiftInfoSegmentedView *)view didClickItem:(GiftInfoModel *)info type:(GiftSegmentType)type{ switch (type) { + case GiftSegmentType_Bravo: + [self.constellationBanner removeFromSuperview]; + [self.superGiftView removeFromSuperview]; + [self.luckyBroadcastView removeFromSuperview]; + if (!self.bravoGiftView.superview) { + [self.view addSubview:self.bravoGiftView]; + [self.bravoGiftView mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.mas_equalTo(self.contentView.mas_top); + make.leading.trailing.mas_equalTo(0); + make.height.mas_equalTo(kGetScaleWidth(80)); + }]; + } + break; case GiftSegmentType_Lucky:{ + [self.bravoGiftView removeFromSuperview]; [self.constellationBanner removeFromSuperview]; [self.superGiftView removeFromSuperview]; if (!self.luckyBroadcastView.superview) { @@ -840,6 +872,7 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; } break; case GiftSegmentType_SuperLucky: { + [self.bravoGiftView removeFromSuperview]; [self.constellationBanner removeFromSuperview]; [self.luckyBroadcastView removeFromSuperview]; self.superGiftView.giftModel = info; @@ -1210,4 +1243,11 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; } return _superGiftView; } + +- (PIGiftBravoGiftBroadcastView *)bravoGiftView { + if (!_bravoGiftView) { + _bravoGiftView = [[PIGiftBravoGiftBroadcastView alloc] initWithFrame:CGRectZero]; + } + return _bravoGiftView; +} @end diff --git a/YuMi/Modules/YMRoom/View/Setting/View/XPRoomSettingViewController.m b/YuMi/Modules/YMRoom/View/Setting/View/XPRoomSettingViewController.m index d92f73d9..f7343622 100644 --- a/YuMi/Modules/YMRoom/View/Setting/View/XPRoomSettingViewController.m +++ b/YuMi/Modules/YMRoom/View/Setting/View/XPRoomSettingViewController.m @@ -338,9 +338,9 @@ XPRoomSettingItemModel * itemModel = [[self.datasource xpSafeObjectAtIndex:index } - (void)didClickCancel:(RoomSettingInputType)type { - if (type == RoomSettingItemType_Pwd) { - // TODO: 狀態復位 - } +// if (type == RoomSettingItemType_Pwd) { +// // TODO: 狀態復位 +// } } #pragma mark - XPRoomSettingTableViewCellDelegate diff --git a/YuMi/Modules/YMTabbar/View/TabbarViewController.m b/YuMi/Modules/YMTabbar/View/TabbarViewController.m index 02a92013..7bace4a4 100644 --- a/YuMi/Modules/YMTabbar/View/TabbarViewController.m +++ b/YuMi/Modules/YMTabbar/View/TabbarViewController.m @@ -361,6 +361,7 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey; } self.userInfo = userInfo; [[XPSkillCardPlayerManager shareInstance] setUserInfoModel:userInfo]; + [[XPSkillCardPlayerManager shareInstance] requestBravoGiftTabInfomation]; [[RoomBoomManager sharedManager] saveUserInfo:userInfo]; [self getRoomGameInfo]; [AccountInfoStorage instance].name = self.userInfo.nick; diff --git a/YuMi/Network/HttpRequestHelper.m b/YuMi/Network/HttpRequestHelper.m index c94cd363..61064402 100644 --- a/YuMi/Network/HttpRequestHelper.m +++ b/YuMi/Network/HttpRequestHelper.m @@ -109,10 +109,144 @@ }]; } +//+ (void)POST:(NSString *)method +// params:(NSDictionary *)params +// success:(void (^)(BaseModel *data))success +// failure:(void (^)(NSInteger resCode, NSString *message))failure +//{ +// if ([self checkNetworkStatusWithFailure:^{ +// failure(-1, YMLocalizedString(@"HttpRequestHelper0")); +// }]) { +// return; +// } +// +// [self configHeaders]; +// AFHTTPSessionManager *manager = [HttpRequestHelper requestManager]; +// params = [MSParamsDecode msDecodeParams:[params mutableCopy]]; +// params = [self configBaseParmars:params]; +// +//#ifdef DEBUG +// NSLog(@"\nmethod:\n%@\nparameter:\n%@\n 超時:%@", +// method, +// params, +// @(manager.session.configuration.timeoutIntervalForRequest)); +//#else +//#endif +// +// // 将 NSDictionary 转换为 JSON +// NSError *jsonError; +// NSData *jsonData = [NSJSONSerialization dataWithJSONObject:params options:0 error:&jsonError]; +// if (jsonError) { +// NSLog(@"Error serializing JSON: %@", jsonError); +// if (failure) { +// failure(jsonError.code, @"Error creating JSON data"); +// } +// return; +// } +// +// // Gzip 压缩数据 +// NSData *gzipData = [jsonData gzippedData]; +// +// // 创建请求 +// NSString *urlString = [[NSURL URLWithString:method relativeToURL:manager.baseURL] absoluteString]; +// NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:urlString]]; +// [request setHTTPMethod:@"POST"]; +// +// // 设置请求头 (合并 manager 的通用头和特定头) +// [manager.requestSerializer.HTTPRequestHeaders enumerateKeysAndObjectsUsingBlock:^(id field, id value, BOOL * __unused stop) { +// [request setValue:value forHTTPHeaderField:field]; +// }]; +// [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; +// [request setValue:@"gzip" forHTTPHeaderField:@"Content-Encoding"]; +// [request setValue:[NSString stringWithFormat:@"%lu", (unsigned long)gzipData.length] forHTTPHeaderField:@"Content-Length"]; // AFNetworking 通常会自动处理 Content-Length,但手动设置以确保 +// +// // !!! 添加认证头 !!! +// if ([[AccountInfoStorage instance] getUid].length > 0) { +// [request setValue:[[AccountInfoStorage instance] getUid] forHTTPHeaderField:@"pub_uid"]; +// } else { +// [request setValue:nil forHTTPHeaderField:@"pub_uid"]; +// } +// if ([[AccountInfoStorage instance] getTicket].length > 0) { +// [request setValue:[[AccountInfoStorage instance] getTicket] forHTTPHeaderField:@"pub_ticket"]; +// }else { +// [request setValue:nil forHTTPHeaderField:@"pub_ticket"]; +// } +// // !!! 添加其他在 configHeaders 中设置的头 !!! +// [request setValue:[NSBundle uploadLanguageText] forHTTPHeaderField:@"Accept-Language"]; +// [request setValue:PI_App_Version forHTTPHeaderField:@"App-Version"]; +// +// // 设置请求体 +// [request setHTTPBody:gzipData]; +// +// // 设置超时 +// request.timeoutInterval = manager.requestSerializer.timeoutInterval; +// +// @kWeakify(self); +// NSURLSessionDataTask *dataTask = [manager dataTaskWithRequest:request +// uploadProgress:nil +// downloadProgress:nil +// completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) { +// if (error) { +//#ifdef DEBUG +// NSLog(@"%@ - \n%@\n", method, error); +//#else +//#endif +// @kStrongify(self); +// [self handleNetError:error method:method failure:failure]; +// } else { +// BaseModel *baseModel = [BaseModel modelWithDictionary:responseObject]; +//#ifdef DEBUG +// NSLog(@"%@ - \n%@\n", method, [baseModel toJSONString]); +//#else +//#endif +// success(baseModel); +// } +// }]; +// +// [dataTask resume]; +//} + + (void)POST:(NSString *)method params:(NSDictionary *)params success:(void (^)(BaseModel *data))success failure:(void (^)(NSInteger resCode, NSString *message))failure +{ + if ([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == 0) { + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + failure(-1, YMLocalizedString(@"HttpRequestHelper0")); + }); + return; + } + + [self configHeaders]; + AFHTTPSessionManager *manager = [HttpRequestHelper requestManager]; + params = [MSParamsDecode msDecodeParams:[params mutableCopy] ]; + + + params = [self configBaseParmars:params]; + +#ifdef DEBUG + NSLog(@"\nmethod:\n%@\nparameter:\n%@", method, params); +#else +#endif + + [manager POST:method parameters:params headers:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { + BaseModel *baseModel = [BaseModel modelWithDictionary:responseObject]; +#ifdef DEBUG + NSLog(@"\n%@", [baseModel toJSONString]); +#else +#endif + + success(baseModel); + } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) { + [self handleNetError:error method:method failure:failure]; + }]; +} + ++ (void)__POST:(NSString *)method + params:(NSDictionary *)params + success:(void (^)(BaseModel *data))success + failure:(void (^)(NSInteger resCode, NSString *message))failure { if ([self checkNetworkStatusWithFailure:^{ failure(-1, YMLocalizedString(@"HttpRequestHelper0")); diff --git a/YuMi/Structure/MVP/Model/UserVipInfoVo.h b/YuMi/Structure/MVP/Model/UserVipInfoVo.h index 5ce3c0ce..db5bf7f5 100644 --- a/YuMi/Structure/MVP/Model/UserVipInfoVo.h +++ b/YuMi/Structure/MVP/Model/UserVipInfoVo.h @@ -37,7 +37,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, assign) BOOL preventTrace; /// 是否防关注 @property (nonatomic, assign) BOOL preventFollow; - +/// 查看访客 @property(nonatomic, assign) BOOL visitHide; /// 是否無痕瀏覽 @property(nonatomic, assign) BOOL visitListView; diff --git a/YuMi/Tools/CardManager/XPSkillCardPlayerManager.h b/YuMi/Tools/CardManager/XPSkillCardPlayerManager.h index 202c8d93..97aed321 100644 --- a/YuMi/Tools/CardManager/XPSkillCardPlayerManager.h +++ b/YuMi/Tools/CardManager/XPSkillCardPlayerManager.h @@ -8,6 +8,7 @@ #import #import #import "UserInfoModel.h" +@class BravoGiftTabInfomationModel; typedef enum : NSUInteger { MICState_None = 0, @@ -46,6 +47,9 @@ typedef enum : NSUInteger { + (instancetype)shareInstance; +- (void)requestBravoGiftTabInfomation; +- (NSArray *)loadBravoGiftTabInfomation; + /** 播放一次音频 diff --git a/YuMi/Tools/CardManager/XPSkillCardPlayerManager.m b/YuMi/Tools/CardManager/XPSkillCardPlayerManager.m index 3585964d..424d3311 100644 --- a/YuMi/Tools/CardManager/XPSkillCardPlayerManager.m +++ b/YuMi/Tools/CardManager/XPSkillCardPlayerManager.m @@ -8,6 +8,7 @@ #import "XPSkillCardPlayerManager.h" #import "XPRoomMiniManager.h" #import "RtcManager.h" +#import "XPGiftPresenter.h" @interface XPSkillCardPlayerManager() @@ -23,6 +24,9 @@ ///播放完成回调 @property (nonatomic, copy) void (^playerCompletionBlock)(void); +@property (nonatomic, + copy) NSArray *bravoGiftInfomations; + @end @implementation XPSkillCardPlayerManager @@ -40,6 +44,21 @@ return sharedInstance; } +- (void)requestBravoGiftTabInfomation { + @kWeakify(self); + XPGiftPresenter *presenter = [[XPGiftPresenter alloc] init]; + [presenter bravoGetBannerList:^(NSArray * _Nonnull array) { + @kStrongify(self); + self.bravoGiftInfomations = array; + } failure:^(NSError * _Nonnull error) { + + }]; +} + +- (NSArray *)loadBravoGiftTabInfomation { + return self.bravoGiftInfomations; +} + - (void)setMicState:(MICState)micState { _micState = micState; } @@ -83,8 +102,6 @@ [self.player prepareToPlay]; [self.player play]; self.playerCompletionBlock = completionBlock; - - } /** diff --git a/YuMi/Tools/NSString/NSString+Utils.h b/YuMi/Tools/NSString/NSString+Utils.h index b0416bea..e24dd862 100644 --- a/YuMi/Tools/NSString/NSString+Utils.h +++ b/YuMi/Tools/NSString/NSString+Utils.h @@ -51,6 +51,8 @@ NS_ASSUME_NONNULL_BEGIN + (NSString *)stringByRemovingRedundantZeros:(NSString *)string; ++ (NSString *)trimString:(NSString *)input lengthLimit:(NSInteger)limit; + @end diff --git a/YuMi/Tools/NSString/NSString+Utils.m b/YuMi/Tools/NSString/NSString+Utils.m index 875e3506..ffe9d190 100644 --- a/YuMi/Tools/NSString/NSString+Utils.m +++ b/YuMi/Tools/NSString/NSString+Utils.m @@ -507,4 +507,13 @@ // } //} ++ (NSString *)trimString:(NSString *)input lengthLimit:(NSInteger)limit { + if (input.length <= limit) { + return input; + } else { + NSString *trimmedString = [input substringToIndex:limit]; + return [trimmedString stringByAppendingString:@"..."]; + } +} + @end diff --git a/YuMi/Tools/YMLine/PILineManager.swift b/YuMi/Tools/YMLine/PILineManager.swift deleted file mode 100644 index faaccf4d..00000000 --- a/YuMi/Tools/YMLine/PILineManager.swift +++ /dev/null @@ -1,66 +0,0 @@ -// -// YMLineManager.swift -// YuMi -// -// Created by duoban on 2023/12/29. -// - -import Foundation -import LineSDK - -@objc public enum LineLoginResultStatus: NSInteger { - case error - case cancelled - case success -} - -public class PILineLoginManager: NSObject { - private static var manager: PILineLoginManager? - @objc public class func getSharedInstance() -> PILineLoginManager { - guard let instance = manager else { - manager = PILineLoginManager() - return manager! - } - return instance - } - - @objc public class func registerLine() { - LoginManager.shared.setup(channelID: "1657475529", universalLinkURL: nil) - } - - @objc public class func applicationOpenurl(_ app: UIApplication, - open url: URL?) -> Bool { - return LoginManager.shared.application(app, open: url) - } - - @objc public class func application( - _ application: UIApplication, - continueWithUserActivity: NSUserActivity, - restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool { - return LoginManager.shared.application(application, open: continueWithUserActivity.webpageURL) - } - - @objc public func loginLine(fromController: UIViewController, completeWithError: @escaping (_ loginStatus: LineLoginResultStatus, _ token: String?, _ userId:String?, _ email: String? , _ error: Error?) -> Void) { - var param = LoginManager.Parameters.init() - param.allowRecreatingLoginProcess = true - LoginManager.shared.login(permissions: [.openID, .profile], in: fromController, parameters: param) { (result) in - switch result { - case .success(let loginResult): - if let _ = loginResult.accessToken.IDTokenRaw { - completeWithError(.success, loginResult.accessToken.value, loginResult.userProfile?.userID ?? "", nil, nil) - } else { - completeWithError(.success, "","", nil, nil) - } - case .failure(let error): - print(error) - completeWithError(.cancelled, "","", nil, nil) - } - } - - } - - @objc public class func destroyLine() { - PILineLoginManager.manager = nil - } - -} diff --git a/YuMi/ar.lproj/Localizable.strings b/YuMi/ar.lproj/Localizable.strings index f411b609..acf4f99e 100644 --- a/YuMi/ar.lproj/Localizable.strings +++ b/YuMi/ar.lproj/Localizable.strings @@ -4149,17 +4149,23 @@ ineHeadView12" = "الحمل"; "20.20.51_text_28" = "عرض الوقت:%@"; "20.20.51_text_29" = "يجب أن يكون عدد الماس مضاعفات 1000"; -"20.20.56_text_1" = "当前匹配人数不足,匹配失败。是否重新匹配"; -"20.20.56_text_2" = "匹配失败,您消耗的金币已经退回你的钱包"; -"20.20.56_text_3" = "Change Relationship"; -"20.20.56_text_4" = "Select the Relationship you want to change"; -"20.20.56_text_5" = "After confirming the change, the original CP value and CP level will remain unchanged. Each relationship can only be changed once within 30 days"; +"20.20.56_text_1" = "عدد المباريات الحالي غير كافٍ، فشلت المباراة. إعادة المباراة مرة أخرى؟"; +"20.20.56_text_2" = "فشلت المطابقة، تم إرجاع العملات التي استهلكتها إلى محفظتك"; +"20.20.56_text_3" = "تغيير العلاقة"; +"20.20.56_text_4" = "اختر العلاقة التي تريد تغييرها"; +"20.20.56_text_5" = "بعد تأكيد التغيير، ستبقى قيمة سي بي الأصلية ومستواها كما هي. لا يمكن تغيير أي علاقة إلا مرة واحدة خلال 30 يومًا"; "20.20.56_text_6" = "CP"; -"20.20.56_text_7" = "Brother"; -"20.20.56_text_8" = "Sister"; -"20.20.56_text_9" = "Parner"; -"20.20.56_text_10" = "Application for Relationship Change"; -"20.20.56_text_11" = "您已经提交更换申请,请耐心等待。"; -"20.20.56_text_12" = "你需要30天才能更换状态。"; -"20.20.56_text_13" = "The other invites you to change the relationship to %@"; -"20.20.56_text_14" = "Your relationship has been changed to %@"; +"20.20.56_text_7" = "الأخ"; +"20.20.56_text_8" = "الأخت"; +"20.20.56_text_9" = "الشريك"; +"20.20.56_text_10" = "طلب تغيير العلاقة"; +"20.20.56_text_11" = "لقد قدمت طلب تغيير العلاقة، يرجى التحلي بالصبر."; +"20.20.56_text_12" = "تحتاج إلى 30 يوماً لتغيير علاقتك."; +"20.20.56_text_13" = "يدعوك الطرف الآخر لتغيير العلاقة إلى %@"; +"20.20.56_text_14" = "تم تغيير علاقتكم إلى %@"; +"20.20.56_text_15" = "نصائح للدخل"; +"20.20.56_text_16" = "استلم برافو، ستحصل على ٢٪ من دخل الكونزات\nسيتم توزيع العملات مباشرةً على محفظة عملاتك\nملاحظة: هذا الدخل غير مشمول في دخلك من الماس"; +"20.20.56_text_17" = "دخل"; +"20.20.56_text_18" = "مقبول"; +"20.20.56_text_19" = "مرفوض"; +"20.20.56_text_20" = "والآخر يرفض دعوتك لتغيير العلاقات."; diff --git a/YuMi/en.lproj/Localizable.strings b/YuMi/en.lproj/Localizable.strings index 4cc4b14d..fa0ea7c4 100644 --- a/YuMi/en.lproj/Localizable.strings +++ b/YuMi/en.lproj/Localizable.strings @@ -1036,7 +1036,8 @@ "XPMineVerifIdentityViewController8" = "Please enter the verification code you received"; "XPMineCollectRoomListViewController0" = "Unfavorited successfully"; -"XPMineCollectRoomListViewController1" = "Favorited rooms"; +"XPMineCollectRoomListViewController1" = "Favorite Rooms"; +"XPMineCollectRoomListViewController1" = "Favorite Rooms"; "XPMineCollectRoomListViewController2" = "Please select a room"; "XPMineCollectRoomListViewController3" = "Please select a room"; "XPMineCollectRoomListViewController4" = "Select All"; @@ -2878,7 +2879,7 @@ "XPMineTheGuildCell0" = "Agnecy · Room"; "XPMineTheGuildCell1" = "Join Agency"; "XPMineTheGuildCell2" = "Join VIP"; -"XPMineTheGuildCell3" = "My agent"; +"XPMineTheGuildCell3" = "My agency"; ///XPMineGiveDiamondVC "XPMineGiveDiamondVC0" = "Coins Gifting"; @@ -3926,15 +3927,15 @@ "20.20.51_text_21" = "Dynamic Avatar"; "20.20.51_text_22" = "It costs %@ coins to upload a dynamic avatar. "; "20.20.51_text_23" = "Friends"; -"20.20.51_text_24" = "Visitor"; +"20.20.51_text_24" = "Visitors"; "20.20.51_text_25" = "Be VIP%@ to view visitors!"; "20.20.51_text_26" = "Be VIP%@"; "20.20.51_text_27" = "1 Each time you upload a dynamic avatar, the system will deduct %@ coins from your account. Please make sure that your account balance is sufficient.\n2 Review process: After the upload is completed, the system will automatically enter the review process. During this period, please do not upload a new avatar again to avoid affecting the review progress.\n3 Review results: \nReview passed: Your new dynamic avatar will take effect immediately and be displayed to other users.\nReview failed: The system will automatically refund the %@ coins you spent after the review is completed. At the same time, you will receive a system notification.\n4 Irreversible operation: Please note that once the dynamic avatar is reviewed and takes effect, you will not be able to restore it to the previous avatar.\n"; "20.20.51_text_28" = "View Time: %@"; "20.20.51_text_29" = "Number of diamonds needs to be multiples of 1000"; -"20.20.56_text_1" = "当前匹配人数不足,匹配失败。是否重新匹配"; -"20.20.56_text_2" = "匹配失败,您消耗的金币已经退回你的钱包"; +"20.20.56_text_1" = "The current number of matches is not enough, the match failed. Re-match again?"; +"20.20.56_text_2" = "Match failed, the coins you consumed has been returned to your wallet"; "20.20.56_text_3" = "Change Relationship"; "20.20.56_text_4" = "Select the Relationship you want to change"; "20.20.56_text_5" = "After confirming the change, the original CP value and CP level will remain unchanged. Each relationship can only be changed once within 30 days"; @@ -3943,7 +3944,13 @@ "20.20.56_text_8" = "Sister"; "20.20.56_text_9" = "Parner"; "20.20.56_text_10" = "Application for Relationship Change"; -"20.20.56_text_11" = "您已经提交更换申请,请耐心等待。"; -"20.20.56_text_12" = "你需要30天才能更换状态。"; +"20.20.56_text_11" = "You have submitted a relationship change request, please be patient."; +"20.20.56_text_12" = "You need 30 days to change your relationship."; "20.20.56_text_13" = "The other invites you to change the relationship to %@"; "20.20.56_text_14" = "Your relationship has been changed to %@"; +"20.20.56_text_15" = "Income Tips"; +"20.20.56_text_16" = "Receive Bravo, you will get 2% of the coin income./nThe coins will be directly distributed to your coin wallet./nNote: This income is not included in diamond turnover."; +"20.20.56_text_17" = "Income"; +"20.20.56_text_18" = "Accepted"; +"20.20.56_text_19" = "Rejected"; +"20.20.56_text_20" = "The other rejects your invitation to change relationships."; diff --git a/YuMi/tr.lproj/Localizable.strings b/YuMi/tr.lproj/Localizable.strings index 0045db5f..4c3a947a 100644 --- a/YuMi/tr.lproj/Localizable.strings +++ b/YuMi/tr.lproj/Localizable.strings @@ -3727,17 +3727,23 @@ "20.20.51_text_28" = "Görüntüleme Süresi: %@"; "20.20.51_text_29" = "Elmas sayısının 1000 katları olması gerekir"; -"20.20.56_text_1" = "当前匹配人数不足,匹配失败。是否重新匹配"; -"20.20.56_text_2" = "匹配失败,您消耗的金币已经退回你的钱包"; -"20.20.56_text_3" = "Change Relationship"; -"20.20.56_text_4" = "Select the Relationship you want to change"; -"20.20.56_text_5" = "After confirming the change, the original CP value and CP level will remain unchanged. Each relationship can only be changed once within 30 days"; +"20.20.56_text_1" = "Mevcut eşleşme sayısı yeterli değil, eşleşme başarısız oldu. Tekrar eşleşelim mi?"; +"20.20.56_text_2" = "Eşleşme başarısız oldu, harcadığınız jetonlar cüzdanınıza iade edildi"; +"20.20.56_text_3" = "İlişkiyi Değiştir"; +"20.20.56_text_4" = "Değiştirmek istediğiniz İlişkiyi seçin"; +"20.20.56_text_5" = "Değişikliği onayladıktan sonra, orijinal CP değeri ve CP seviyesi değişmeden kalacaktır. Her ilişki 30 gün içinde yalnızca bir kez değiştirilebilir"; "20.20.56_text_6" = "CP"; -"20.20.56_text_7" = "Brother"; -"20.20.56_text_8" = "Sister"; -"20.20.56_text_9" = "Parner"; -"20.20.56_text_10" = "Application for Relationship Change"; -"20.20.56_text_11" = "您已经提交更换申请,请耐心等待。"; -"20.20.56_text_12" = "你需要30天才能更换状态。"; -"20.20.56_text_13" = "The other invites you to change the relationship to %@"; -"20.20.56_text_14" = "Your relationship has been changed to %@"; +"20.20.56_text_7" = "Kardeş"; +"20.20.56_text_8" = "Kız Kardeş"; +"20.20.56_text_9" = "Partner"; +"20.20.56_text_10" = "İlişki Değişikliği Başvurusu"; +"20.20.56_text_11" = "Bir ilişki değişikliği talebinde bulundunuz, lütfen sabırlı olun."; +"20.20.56_text_12" = "İlişkinizi değiştirmek için 30 güne ihtiyacınız var."; +"20.20.56_text_13" = "Diğeri, ilişkiyi %@ olarak değiştirmenizi ister"; +"20.20.56_text_14" = "İlişkiniz %@ olarak değiştirildi"; +"20.20.56_text_15" = "Gelir İpuçları"; +"20.20.56_text_16" = "Bravo alın, jeton gelirinin %2'sini alacaksınız.\nJetonlar doğrudan jeton cüzdanınıza dağıtılacak.\nNot: Bu gelir elmas cirosuna dahil değildir."; +"20.20.56_text_17" = "Gelir"; +"20.20.56_text_18" = "Kabul Edildi"; +"20.20.56_text_19" = "Reddedildi"; +"20.20.56_text_20" = "Diğeri sizin ilişkileri değiştirme davetinizi reddeder."; diff --git a/YuMi/zh-Hant.lproj/Localizable.strings b/YuMi/zh-Hant.lproj/Localizable.strings index 453fdae8..d8700dc3 100644 --- a/YuMi/zh-Hant.lproj/Localizable.strings +++ b/YuMi/zh-Hant.lproj/Localizable.strings @@ -3599,17 +3599,23 @@ "20.20.51_text_28" = "访客時間:%@"; "20.20.51_text_29" = "鑽石數量需要是1000的倍數"; -"20.20.56_text_1" = "当前匹配人数不足,匹配失败。是否重新匹配"; -"20.20.56_text_2" = "匹配失败,您消耗的金币已经退回你的钱包"; -"20.20.56_text_3" = "Change Relationship"; -"20.20.56_text_4" = "Select the Relationship you want to change"; -"20.20.56_text_5" = "After confirming the change, the original CP value and CP level will remain unchanged. Each relationship can only be changed once within 30 days"; +"20.20.56_text_1" = "目前的匹配次數不足,匹配失敗。再次匹配?"; +"20.20.56_text_2" = "匹配失敗,您消耗的硬幣已返回您的錢包"; +"20.20.56_text_3" = "改變關係"; +"20.20.56_text_4" = "選擇要變更的關係"; +"20.20.56_text_5" = "確認變更後,原CP值及CP等級維持不變。每個關係30天內只能更改一次"; "20.20.56_text_6" = "CP"; -"20.20.56_text_7" = "Brother"; -"20.20.56_text_8" = "Sister"; -"20.20.56_text_9" = "Parner"; -"20.20.56_text_10" = "Application for Relationship Change"; -"20.20.56_text_11" = "您已经提交更换申请,请耐心等待。"; -"20.20.56_text_12" = "你需要30天才能更换状态。"; -"20.20.56_text_13" = "The other invites you to change the relationship to %@"; -"20.20.56_text_14" = "Your relationship has been changed to %@"; +"20.20.56_text_7" = "兄弟"; +"20.20.56_text_8" = "姊姊"; +"20.20.56_text_9" = "合夥人"; +"20.20.56_text_10" = "關係變更申請"; +"20.20.56_text_11" = "您已提交變更關係的請求,請耐心等候。"; +"20.20.56_text_12" = "您需要 30 天才能變更關係。"; +"20.20.56_text_13" = "另一方邀請您將關係更改為 %@"; +"20.20.56_text_14" = "您的關係已變更為 %@"; +"20.20.56_text_15" = "收益提示"; +"20.20.56_text_16" = "收到Bravo,您將獲得2%的金幣收入。\n金幣將直接分發到您的硬幣錢包中。\n注意:此收入不包含在鑽石流水中。"; +"20.20.56_text_17" = "收益"; +"20.20.56_text_18" = "已接受"; +"20.20.56_text_19" = "已拒絕"; +"20.20.56_text_20" = "拒绝改变关系的邀请。";