From b657f3856b35d6766650cfc4b8f6b9d9a45eba18 Mon Sep 17 00:00:00 2001 From: edwinQQQ Date: Mon, 1 Sep 2025 18:55:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=A4=9A=E4=B8=AA=E6=88=BF?= =?UTF-8?q?=E9=97=B4=E5=8A=9F=E8=83=BD=E7=9B=B8=E5=85=B3=E7=9A=84=20Action?= =?UTF-8?q?=20=E7=B1=BB=EF=BC=8C=E5=8C=85=E6=8B=AC=20XPRoomAppManagerActio?= =?UTF-8?q?n=E3=80=81XPRoomCleanMessagesAction=E3=80=81XPRoomBackGroundSet?= =?UTF-8?q?tingAction=E3=80=81XPRoomMusicPanelAction=20=E5=92=8C=20XPRoomR?= =?UTF-8?q?oomPhotoAction=EF=BC=8C=E4=BC=98=E5=8C=96=E6=88=BF=E9=97=B4?= =?UTF-8?q?=E6=9B=B4=E5=A4=9A=E8=8F=9C=E5=8D=95=E7=9A=84=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E6=89=A9=E5=B1=95=E6=80=A7=E3=80=82=E5=90=8C=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=20XPRoomMoreMenuActionFactory=20=E4=BB=A5?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=96=B0=E5=8A=9F=E8=83=BD=EF=BC=8C=E6=8F=90?= =?UTF-8?q?=E5=8D=87=E4=BB=A3=E7=A0=81=E5=8F=AF=E7=BB=B4=E6=8A=A4=E6=80=A7?= =?UTF-8?q?=E5=92=8C=E7=BB=93=E6=9E=84=E6=B8=85=E6=99=B0=E5=BA=A6=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- YuMi.xcodeproj/project.pbxproj | 42 ++++++ .../View/MoreView/Action/XPGiftEffectAction.m | 4 - .../YMRoom/View/MoreView/Action/XPPKAction.h | 1 + .../YMRoom/View/MoreView/Action/XPPKAction.m | 26 +++- .../MoreView/Action/XPRoomAppManagerAction.h | 16 +++ .../MoreView/Action/XPRoomAppManagerAction.m | 19 +++ .../Action/XPRoomBackCleanMessagesAction.h | 16 +++ .../Action/XPRoomBackGroundSettingAction.h | 18 +++ .../Action/XPRoomBackGroundSettingAction.m | 41 ++++++ .../Action/XPRoomCleanMessagesAction.h | 16 +++ .../Action/XPRoomCleanMessagesAction.m | 36 ++++++ .../MoreView/Action/XPRoomMusicPanelAction.h | 16 +++ .../MoreView/Action/XPRoomMusicPanelAction.m | 19 +++ .../MoreView/Action/XPRoomRedPacketAction.h | 16 +++ .../MoreView/Action/XPRoomRedPacketAction.m | 19 +++ .../MoreView/Action/XPRoomRoomPhotoAction.h | 16 +++ .../MoreView/Action/XPRoomRoomPhotoAction.m | 19 +++ .../MoreView/Action/XPRoomSettingAction.h | 2 +- .../MoreView/Action/XPRoomSettingAction.m | 10 +- .../MoreView/Action/XPRoomTypeSettingAction.h | 18 +++ .../MoreView/Action/XPRoomTypeSettingAction.m | 37 ++++++ .../View/MoreView/Action/XPSocialAction.m | 12 +- .../Factory/XPRoomMoreMenuActionFactory.h | 7 + .../Factory/XPRoomMoreMenuActionFactory.m | 121 +++++++++++++++++- .../View/MoreView/Model/XPRoomMoreItemModel.h | 2 +- .../MoreView/Model/XPRoomMoreMenuAction.h | 3 + .../MoreView/Presenter/XPMoreMenuPresenter.m | 81 ++++-------- .../View/XPRoomMoreMenuViewController.m | 39 +++--- 28 files changed, 571 insertions(+), 101 deletions(-) create mode 100644 YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomAppManagerAction.h create mode 100644 YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomAppManagerAction.m create mode 100644 YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomBackCleanMessagesAction.h create mode 100644 YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomBackGroundSettingAction.h create mode 100644 YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomBackGroundSettingAction.m create mode 100644 YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomCleanMessagesAction.h create mode 100644 YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomCleanMessagesAction.m create mode 100644 YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomMusicPanelAction.h create mode 100644 YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomMusicPanelAction.m create mode 100644 YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomRedPacketAction.h create mode 100644 YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomRedPacketAction.m create mode 100644 YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomRoomPhotoAction.h create mode 100644 YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomRoomPhotoAction.m create mode 100644 YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomTypeSettingAction.h create mode 100644 YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomTypeSettingAction.m diff --git a/YuMi.xcodeproj/project.pbxproj b/YuMi.xcodeproj/project.pbxproj index 9940f05d..3f65e12d 100644 --- a/YuMi.xcodeproj/project.pbxproj +++ b/YuMi.xcodeproj/project.pbxproj @@ -486,6 +486,13 @@ 4C0A5B8A2E02BC3900955219 /* MedalsDetailView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C0A5B892E02BC3900955219 /* MedalsDetailView.m */; }; 4C0A5B902E03EF4B00955219 /* MedalsWearingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C0A5B8F2E03EF4B00955219 /* MedalsWearingViewController.m */; }; 4C0B4A3A2E6579C700D67F73 /* XPPKAction.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C0B4A392E6579C700D67F73 /* XPPKAction.m */; }; + 4C0B4A3E2E659A2C00D67F73 /* XPRoomTypeSettingAction.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C0B4A3D2E659A2C00D67F73 /* XPRoomTypeSettingAction.m */; }; + 4C0B4A412E659DC100D67F73 /* XPRoomBackGroundSettingAction.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C0B4A402E659DC100D67F73 /* XPRoomBackGroundSettingAction.m */; }; + 4C0B4A442E65A0D300D67F73 /* XPRoomCleanMessagesAction.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C0B4A432E65A0D300D67F73 /* XPRoomCleanMessagesAction.m */; }; + 4C0B4A472E65A51600D67F73 /* XPRoomRedPacketAction.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C0B4A462E65A51600D67F73 /* XPRoomRedPacketAction.m */; }; + 4C0B4A4A2E65A5D500D67F73 /* XPRoomMusicPanelAction.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C0B4A492E65A5D500D67F73 /* XPRoomMusicPanelAction.m */; }; + 4C0B4A4D2E65A63400D67F73 /* XPRoomRoomPhotoAction.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C0B4A4C2E65A63400D67F73 /* XPRoomRoomPhotoAction.m */; }; + 4C0B4A502E65A68800D67F73 /* XPRoomAppManagerAction.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C0B4A4F2E65A68800D67F73 /* XPRoomAppManagerAction.m */; }; 4C1064882E0014CF007E1586 /* NSMutableArray+Safe.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C1064872E0014CF007E1586 /* NSMutableArray+Safe.m */; }; 4C1119722DD7218300C18416 /* MyEventsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C1119712DD7218300C18416 /* MyEventsViewController.m */; }; 4C1392932D6D963700A6DFB5 /* SubRechargersViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C1392922D6D963600A6DFB5 /* SubRechargersViewController.m */; }; @@ -2631,6 +2638,20 @@ 4C0A5B8F2E03EF4B00955219 /* MedalsWearingViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MedalsWearingViewController.m; sourceTree = ""; }; 4C0B4A382E6579C700D67F73 /* XPPKAction.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPPKAction.h; sourceTree = ""; }; 4C0B4A392E6579C700D67F73 /* XPPKAction.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPPKAction.m; sourceTree = ""; }; + 4C0B4A3C2E659A2C00D67F73 /* XPRoomTypeSettingAction.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomTypeSettingAction.h; sourceTree = ""; }; + 4C0B4A3D2E659A2C00D67F73 /* XPRoomTypeSettingAction.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomTypeSettingAction.m; sourceTree = ""; }; + 4C0B4A3F2E659DC100D67F73 /* XPRoomBackGroundSettingAction.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomBackGroundSettingAction.h; sourceTree = ""; }; + 4C0B4A402E659DC100D67F73 /* XPRoomBackGroundSettingAction.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomBackGroundSettingAction.m; sourceTree = ""; }; + 4C0B4A422E65A0D300D67F73 /* XPRoomCleanMessagesAction.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomCleanMessagesAction.h; sourceTree = ""; }; + 4C0B4A432E65A0D300D67F73 /* XPRoomCleanMessagesAction.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomCleanMessagesAction.m; sourceTree = ""; }; + 4C0B4A452E65A51600D67F73 /* XPRoomRedPacketAction.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomRedPacketAction.h; sourceTree = ""; }; + 4C0B4A462E65A51600D67F73 /* XPRoomRedPacketAction.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomRedPacketAction.m; sourceTree = ""; }; + 4C0B4A482E65A5D500D67F73 /* XPRoomMusicPanelAction.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomMusicPanelAction.h; sourceTree = ""; }; + 4C0B4A492E65A5D500D67F73 /* XPRoomMusicPanelAction.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomMusicPanelAction.m; sourceTree = ""; }; + 4C0B4A4B2E65A63400D67F73 /* XPRoomRoomPhotoAction.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomRoomPhotoAction.h; sourceTree = ""; }; + 4C0B4A4C2E65A63400D67F73 /* XPRoomRoomPhotoAction.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomRoomPhotoAction.m; sourceTree = ""; }; + 4C0B4A4E2E65A68800D67F73 /* XPRoomAppManagerAction.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomAppManagerAction.h; sourceTree = ""; }; + 4C0B4A4F2E65A68800D67F73 /* XPRoomAppManagerAction.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomAppManagerAction.m; sourceTree = ""; }; 4C1064862E0014CF007E1586 /* NSMutableArray+Safe.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSMutableArray+Safe.h"; sourceTree = ""; }; 4C1064872E0014CF007E1586 /* NSMutableArray+Safe.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSMutableArray+Safe.m"; sourceTree = ""; }; 4C1119702DD7218300C18416 /* MyEventsViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MyEventsViewController.h; sourceTree = ""; }; @@ -6899,6 +6920,20 @@ 4CD47BC32E61A4E000BCDA46 /* XPGiftEffectAction.m */, 4CD47BC72E61A78D00BCDA46 /* XPRoomSettingAction.h */, 4CD47BC82E61A78D00BCDA46 /* XPRoomSettingAction.m */, + 4C0B4A3C2E659A2C00D67F73 /* XPRoomTypeSettingAction.h */, + 4C0B4A3D2E659A2C00D67F73 /* XPRoomTypeSettingAction.m */, + 4C0B4A3F2E659DC100D67F73 /* XPRoomBackGroundSettingAction.h */, + 4C0B4A402E659DC100D67F73 /* XPRoomBackGroundSettingAction.m */, + 4C0B4A422E65A0D300D67F73 /* XPRoomCleanMessagesAction.h */, + 4C0B4A432E65A0D300D67F73 /* XPRoomCleanMessagesAction.m */, + 4C0B4A452E65A51600D67F73 /* XPRoomRedPacketAction.h */, + 4C0B4A462E65A51600D67F73 /* XPRoomRedPacketAction.m */, + 4C0B4A482E65A5D500D67F73 /* XPRoomMusicPanelAction.h */, + 4C0B4A492E65A5D500D67F73 /* XPRoomMusicPanelAction.m */, + 4C0B4A4B2E65A63400D67F73 /* XPRoomRoomPhotoAction.h */, + 4C0B4A4C2E65A63400D67F73 /* XPRoomRoomPhotoAction.m */, + 4C0B4A4E2E65A68800D67F73 /* XPRoomAppManagerAction.h */, + 4C0B4A4F2E65A68800D67F73 /* XPRoomAppManagerAction.m */, ); path = Action; sourceTree = ""; @@ -12149,6 +12184,7 @@ 9BCB99A628F582EC00466D64 /* XPMineCollectRoomEditCell.m in Sources */, E8E70D7E26F2F19D00F03460 /* Api+Mine.m in Sources */, E85E7B3B2A4EB0D300B6D00A /* XPGuildSearchSuperAdminTableViewCell.m in Sources */, + 4C0B4A4D2E65A63400D67F73 /* XPRoomRoomPhotoAction.m in Sources */, 54C3895F2C2189DD00FD47B1 /* XPHomeMinePresenter.m in Sources */, E8751E6E28A64F990056EF44 /* XPSailingEmptyTableViewCell.m in Sources */, E8950189282CFFB1007E459A /* XPMomentsLayoutConfig.m in Sources */, @@ -12196,7 +12232,9 @@ 23E9EAAE2A84C9B800B792F2 /* XPMineUserInfoTagView.m in Sources */, 236B2E4E2AA07D06003967A8 /* Api+LittleGame.m in Sources */, 237700E02BC7D78600D661F1 /* MSBaseRTLFlowLayout.m in Sources */, + 4C0B4A412E659DC100D67F73 /* XPRoomBackGroundSettingAction.m in Sources */, 4CEB9EB32D0AFCE200443480 /* NineteenMicStageView.m in Sources */, + 4C0B4A3E2E659A2C00D67F73 /* XPRoomTypeSettingAction.m in Sources */, 2331C1B32A60F32D00E1D940 /* XPCandyTreeMoreRuleCell.m in Sources */, 4C0B4A3A2E6579C700D67F73 /* XPPKAction.m in Sources */, 14A6034C29A35EE600D2A6A5 /* XPMineItemTableViewCell.m in Sources */, @@ -12582,6 +12620,7 @@ 4CEB9EAD2D09AA0400443480 /* SexAgeLabel.m in Sources */, 23FF42762AA6E1480055733C /* XPHomeRecommendOtherRoomView.m in Sources */, 142721B229A7647F00C7C423 /* XPBlankViewController.m in Sources */, + 4C0B4A442E65A0D300D67F73 /* XPRoomCleanMessagesAction.m in Sources */, E85E7B6B2A4EC39400B6D00A /* XPMineExchangeAuthorityModel.m in Sources */, E836456B2A40A33300E0DBE4 /* MineSkillCardListInfoModel.m in Sources */, 236B2E482AA07D06003967A8 /* XPLittleGameMiniStageView.m in Sources */, @@ -12614,6 +12653,7 @@ 2331C1AD2A60F32D00E1D940 /* XPCandyTreeAnimationModel.m in Sources */, E816C11527608A7500C84014 /* XPRoomMiniManager.m in Sources */, E81060EB2987BE8300B772F0 /* MessageGiftModel.m in Sources */, + 4C0B4A472E65A51600D67F73 /* XPRoomRedPacketAction.m in Sources */, E8EEB91726FC7B35007C6EBA /* XPMineUserInfoDesViewController.m in Sources */, 544A36352C94160F00CA7858 /* RoomMenuBar.m in Sources */, 9B1B72AC280031DB003FACE9 /* XPAnchorPKViewController.m in Sources */, @@ -12975,6 +13015,7 @@ E81C1B29277069DD0020D1E4 /* XPArrangeMicEmptyTableViewCell.m in Sources */, E8AC721C26F4720B007D6E91 /* XPMineSettingPresent.m in Sources */, 2305EF102AD8006900AD403C /* PIRoomMessagePhotoAlbumCell.m in Sources */, + 4C0B4A502E65A68800D67F73 /* XPRoomAppManagerAction.m in Sources */, 238B37BA2AC55A2C00BFC9D5 /* XPTreasureFairyFriendView.m in Sources */, E81060EE2987C35700B772F0 /* MessageTextClickModel.m in Sources */, E87AE8C5284E1A8400CAFBB3 /* XPRoomNewUserGreetView.m in Sources */, @@ -13266,6 +13307,7 @@ 236B2E422AA07D06003967A8 /* SudCommon.m in Sources */, E88749B6282B8FC600C3C7DB /* MomentsInfoModel.m in Sources */, E89D60BA271D643A001F8895 /* Api+Room.m in Sources */, + 4C0B4A4A2E65A5D500D67F73 /* XPRoomMusicPanelAction.m in Sources */, E84843B227F5A0740050D365 /* XPRomPKResultTitleLabel.m in Sources */, E80EC80F28ACD84000D133C5 /* QEmotion.m in Sources */, E877A7EB2783E24700EFACED /* DatingStageView.m in Sources */, diff --git a/YuMi/Modules/YMRoom/View/MoreView/Action/XPGiftEffectAction.m b/YuMi/Modules/YMRoom/View/MoreView/Action/XPGiftEffectAction.m index 6ad9a8d9..b465e3a6 100644 --- a/YuMi/Modules/YMRoom/View/MoreView/Action/XPGiftEffectAction.m +++ b/YuMi/Modules/YMRoom/View/MoreView/Action/XPGiftEffectAction.m @@ -7,11 +7,7 @@ #import "XPGiftEffectAction.h" #import "XPRoomMoreMenuActionContext.h" -#import "YUMIConstant.h" -#import "YUMIMacroUitls.h" -#import "DJDKMIMOMColor.h" #import "RoomInfoModel.h" -#import #import "BaseViewController.h" UIKIT_EXTERN NSString * const kRoomGiftEffectUpdateNotificationKey; diff --git a/YuMi/Modules/YMRoom/View/MoreView/Action/XPPKAction.h b/YuMi/Modules/YMRoom/View/MoreView/Action/XPPKAction.h index bb1f479b..d3dd5ef7 100644 --- a/YuMi/Modules/YMRoom/View/MoreView/Action/XPPKAction.h +++ b/YuMi/Modules/YMRoom/View/MoreView/Action/XPPKAction.h @@ -46,6 +46,7 @@ NS_ASSUME_NONNULL_BEGIN /// @param roomInfo 房间信息 + (instancetype)roomPKActionWithRoomInfo:(RoomInfoModel *)roomInfo; + (instancetype)corssPKActionWithRoomInfo:(RoomInfoModel *)roomInfo; ++ (instancetype)anchorPKActionWithRoomInfo:(RoomInfoModel *)roomInfo; + (instancetype)blindActionWithRoomInfo:(RoomInfoModel *)roomInfo; @end diff --git a/YuMi/Modules/YMRoom/View/MoreView/Action/XPPKAction.m b/YuMi/Modules/YMRoom/View/MoreView/Action/XPPKAction.m index 28ad1e36..f141ebed 100644 --- a/YuMi/Modules/YMRoom/View/MoreView/Action/XPPKAction.m +++ b/YuMi/Modules/YMRoom/View/MoreView/Action/XPPKAction.m @@ -8,13 +8,10 @@ #import "XPPKAction.h" #import "XPRoomMoreMenuActionContext.h" #import "RoomInfoModel.h" -#import "DJDKMIMOMColor.h" -#import "TTPopup.h" #import "BaseViewController.h" #import "XPRoomPKViewController.h" #import "XPAcrossRoomPKViewController.h" #import "XPAnchorPKViewController.h" -#import "AccountInfoStorage.h" @implementation XPPKAction @@ -100,13 +97,34 @@ #pragma mark - 根据房间信息创建Action + (instancetype)roomPKActionWithRoomInfo:(RoomInfoModel *)roomInfo { - return roomInfo.roomModeType == RoomModeType_Open_PK_Mode ? [self roomPKOpenAction] : [self roomPKCloseAction]; + return roomInfo.roomModeType == RoomModeType_Open_PK_Mode ? [self roomPKCloseAction] : [self roomPKOpenAction]; } + (instancetype)corssPKActionWithRoomInfo:(RoomInfoModel *)roomInfo { return roomInfo.roomModeType == RoomModeType_Open_AcrossRoomPK_mode ? [self acrossRoomPKCloseAction] : [self acrossRoomPKOpenAction]; } ++ (instancetype)anchorPKActionWithRoomInfo:(RoomInfoModel *)roomInfo { + XPPKAction *action = roomInfo.roomModeType == RoomModeType_Open_AcrossRoomPK_mode ? [self anchorPKCloseAction] : [self anchorPKOpenAction]; + + if (roomInfo.pkState == AcrossRoomPkStateTypePenalty) { + if ([roomInfo.winUid isEqualToString:[AccountInfoStorage instance].getUid]) { + action.title = YMLocalizedString(@"XPMoreMenuPresenter15"); + } else if ([roomInfo.winUid isEqualToString:roomInfo.pkUid]) { + action.title = YMLocalizedString(@"XPMoreMenuPresenter14"); + } else { + action.title = YMLocalizedString(@"XPMoreMenuPresenter15"); + } + } else if (roomInfo.pkState == AcrossRoomPkStateTypePenaltyEnd) { + action.title = YMLocalizedString(@"XPMoreMenuPresenter15"); + } + if (roomInfo.pkMatchStartTime) { + action.title = YMLocalizedString(@"XPMoreMenuPresenter17"); + } + + return action; +} + + (instancetype)blindActionWithRoomInfo:(RoomInfoModel *)roomInfo { return roomInfo.roomModeType == RoomModeType_Open_Blind ? [self datingCloseAction] : [self datingOpenAction]; } diff --git a/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomAppManagerAction.h b/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomAppManagerAction.h new file mode 100644 index 00000000..f895a1e4 --- /dev/null +++ b/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomAppManagerAction.h @@ -0,0 +1,16 @@ +// +// XPRoomAppManagerAction.h +// YuMi +// +// Created by P on 2025/9/1. +// + +#import "XPRoomMoreMenuAction.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XPRoomAppManagerAction : XPRoomMoreMenuAction ++ (instancetype)action; +@end + +NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomAppManagerAction.m b/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomAppManagerAction.m new file mode 100644 index 00000000..000269da --- /dev/null +++ b/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomAppManagerAction.m @@ -0,0 +1,19 @@ +// +// XPRoomAppManagerAction.m +// YuMi +// +// Created by P on 2025/9/1. +// + +#import "XPRoomAppManagerAction.h" + +@implementation XPRoomAppManagerAction ++ (instancetype)action { + XPRoomAppManagerAction *action = [[XPRoomAppManagerAction alloc] init]; + action.title = YMLocalizedString(@"34_text_1"); + action.imageName = @"app_admin_icon"; + action.type = RoomMoreMenuType_App_Manager; + action.titleColor = [UIColor orangeColor]; + return action; +} +@end diff --git a/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomBackCleanMessagesAction.h b/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomBackCleanMessagesAction.h new file mode 100644 index 00000000..7b889a7d --- /dev/null +++ b/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomBackCleanMessagesAction.h @@ -0,0 +1,16 @@ +// +// XPRoomBackCleanMessagesAction.h +// YuMi +// +// Created by P on 2025/9/1. +// + +#import "XPRoomMoreMenuAction.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XPRoomCleanMessagesAction : XPRoomMoreMenuAction ++ (instancetype)action; +@end + +NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomBackGroundSettingAction.h b/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomBackGroundSettingAction.h new file mode 100644 index 00000000..e5d3d4eb --- /dev/null +++ b/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomBackGroundSettingAction.h @@ -0,0 +1,18 @@ +// +// XPRoomBackGroundSettingAction.h +// YuMi +// +// Created by P on 2025/9/1. +// + +#import "XPRoomMoreMenuAction.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XPRoomBackGroundSettingAction : XPRoomMoreMenuAction + ++ (instancetype)action; + +@end + +NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomBackGroundSettingAction.m b/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomBackGroundSettingAction.m new file mode 100644 index 00000000..6f353f0c --- /dev/null +++ b/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomBackGroundSettingAction.m @@ -0,0 +1,41 @@ +// +// XPRoomBackGroundSettingAction.m +// YuMi +// +// Created by P on 2025/9/1. +// + +#import "XPRoomBackGroundSettingAction.h" +#import "CustomRoomBGContentViewController.h" +#import "RoomInfoModel.h" + +@implementation XPRoomBackGroundSettingAction + ++ (instancetype)action { + XPRoomBackGroundSettingAction *action = [[XPRoomBackGroundSettingAction alloc] init]; + action.title = YMLocalizedString(@"1.0.18_0"); + action.imageName = @"room_menu_background"; + action.type = RoomMoreMenuType_Room_Type_Background; + action.isEnabled = YES; + action.titleColor = [DJDKMIMOMColor roomMoreMenuTextColor]; + return action; +} + + +- (void)executeWithContext:(XPRoomMoreMenuActionContext *)context { + [context.presentingViewController dismissViewControllerAnimated:YES completion:nil]; + + +// XPRoomSettingViewController *roomSettingVC = [[XPRoomSettingViewController alloc] initWithDelegate:context.hostDelegate]; +// [context.hostDelegate.getCurrentNav pushViewController:roomSettingVC animated:YES]; +// + CustomRoomBGContentViewController *vc = [[CustomRoomBGContentViewController alloc] init]; + vc.roomInfo = context.roomInfo; + vc.roomUID = [NSString stringWithFormat:@"%ld", vc.roomInfo.uid]; + vc.modalPresentationStyle = UIModalPresentationOverFullScreen; + [context.hostDelegate.getCurrentNav presentViewController:vc + animated:YES + completion:nil]; +} + +@end diff --git a/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomCleanMessagesAction.h b/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomCleanMessagesAction.h new file mode 100644 index 00000000..7b889a7d --- /dev/null +++ b/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomCleanMessagesAction.h @@ -0,0 +1,16 @@ +// +// XPRoomBackCleanMessagesAction.h +// YuMi +// +// Created by P on 2025/9/1. +// + +#import "XPRoomMoreMenuAction.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XPRoomCleanMessagesAction : XPRoomMoreMenuAction ++ (instancetype)action; +@end + +NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomCleanMessagesAction.m b/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomCleanMessagesAction.m new file mode 100644 index 00000000..3c78e5fe --- /dev/null +++ b/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomCleanMessagesAction.m @@ -0,0 +1,36 @@ +// +// XPRoomBackCleanMessagesAction.m +// YuMi +// +// Created by P on 2025/9/1. +// + +#import "XPRoomCleanMessagesAction.h" + +@implementation XPRoomCleanMessagesAction + ++ (instancetype)action { + XPRoomCleanMessagesAction *action = [[XPRoomCleanMessagesAction alloc] init]; + action.title = YMLocalizedString(@"XPMoreMenuPresenter20"); + action.imageName = @"room_more_menu_message_clean"; + action.type = RoomMoreMenuType_Message_Screen_Clear; + action.titleColor = [DJDKMIMOMColor roomMoreMenuTextColor]; + return action; +} + +- (void)executeWithContext:(XPRoomMoreMenuActionContext *)context { + [context.presentingViewController dismissViewControllerAnimated:YES completion:nil]; + + TTAlertConfig * config = [[TTAlertConfig alloc] init]; + config.title = YMLocalizedString(@"XPRoomMoreMenuViewController17"); + config.message = YMLocalizedString(@"XPRoomMoreMenuViewController18"); + config.confirmButtonConfig.title = YMLocalizedString(@"TTAlertConfig0"); + [TTPopup alertWithConfig:config confirmHandler:^{ +// [self.presenter cleanScreen:roomUid uid:[AccountInfoStorage instance].getUid]; + + // TODO: 如何传递出去? + } cancelHandler:^{ + }]; +} + +@end diff --git a/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomMusicPanelAction.h b/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomMusicPanelAction.h new file mode 100644 index 00000000..f013c2e0 --- /dev/null +++ b/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomMusicPanelAction.h @@ -0,0 +1,16 @@ +// +// XPRoomMusicPanelAction.h +// YuMi +// +// Created by P on 2025/9/1. +// + +#import "XPRoomMoreMenuAction.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XPRoomMusicPanelAction : XPRoomMoreMenuAction ++ (instancetype)action; +@end + +NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomMusicPanelAction.m b/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomMusicPanelAction.m new file mode 100644 index 00000000..1a03b939 --- /dev/null +++ b/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomMusicPanelAction.m @@ -0,0 +1,19 @@ +// +// XPRoomMusicPanelAction.m +// YuMi +// +// Created by P on 2025/9/1. +// + +#import "XPRoomMusicPanelAction.h" + +@implementation XPRoomMusicPanelAction ++ (instancetype)action { + XPRoomMusicPanelAction *action = [[XPRoomMusicPanelAction alloc] init]; + action.title = YMLocalizedString(@"XPRoomMusicVoiceSettingView1"); + action.imageName = @"menu_music"; + action.type = RoomMoreMenuType_Room_Music_Panel; + action.titleColor = [DJDKMIMOMColor roomMoreMenuTextColor]; + return action; +} +@end diff --git a/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomRedPacketAction.h b/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomRedPacketAction.h new file mode 100644 index 00000000..773845ea --- /dev/null +++ b/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomRedPacketAction.h @@ -0,0 +1,16 @@ +// +// XPRoomRedPacketAction.h +// YuMi +// +// Created by P on 2025/9/1. +// + +#import "XPRoomMoreMenuAction.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XPRoomRedPacketAction : XPRoomMoreMenuAction ++ (instancetype)action; +@end + +NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomRedPacketAction.m b/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomRedPacketAction.m new file mode 100644 index 00000000..26b78985 --- /dev/null +++ b/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomRedPacketAction.m @@ -0,0 +1,19 @@ +// +// XPRoomRedPacketAction.m +// YuMi +// +// Created by P on 2025/9/1. +// + +#import "XPRoomRedPacketAction.h" + +@implementation XPRoomRedPacketAction ++ (instancetype)action { + XPRoomRedPacketAction *action = [[XPRoomRedPacketAction alloc] init]; + action.title = YMLocalizedString(@"XPMoreMenuPresenter24"); + action.imageName = @"pi_red_packet_entrance"; + action.type = RoomMoreMenuType_Room_redPacket; + action.titleColor = [DJDKMIMOMColor roomMoreMenuTextColor]; + return action; +} +@end diff --git a/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomRoomPhotoAction.h b/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomRoomPhotoAction.h new file mode 100644 index 00000000..2b649d46 --- /dev/null +++ b/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomRoomPhotoAction.h @@ -0,0 +1,16 @@ +// +// XPRoomRoomPhotoAction.h +// YuMi +// +// Created by P on 2025/9/1. +// + +#import "XPRoomMoreMenuAction.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XPRoomRoomPhotoAction : XPRoomMoreMenuAction ++ (instancetype)action; +@end + +NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomRoomPhotoAction.m b/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomRoomPhotoAction.m new file mode 100644 index 00000000..a7acd21a --- /dev/null +++ b/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomRoomPhotoAction.m @@ -0,0 +1,19 @@ +// +// XPRoomRoomPhotoAction.m +// YuMi +// +// Created by P on 2025/9/1. +// + +#import "XPRoomRoomPhotoAction.h" + +@implementation XPRoomRoomPhotoAction ++ (instancetype)action { + XPRoomRoomPhotoAction *action = [[XPRoomRoomPhotoAction alloc] init]; + action.title = YMLocalizedString(@"XPMoreMenuPresenter37"); + action.imageName = @"room_info_photo_album"; + action.type = RoomMoreMenuType_Room_Room_Photo_Album; + action.titleColor = [DJDKMIMOMColor roomMoreMenuTextColor]; + return action; +} +@end diff --git a/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomSettingAction.h b/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomSettingAction.h index fe4fab9d..5de19c9d 100644 --- a/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomSettingAction.h +++ b/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomSettingAction.h @@ -5,7 +5,7 @@ // Created by Linus on 2025/1/13. // -#import "../Model/XPRoomMoreMenuAction.h" +#import "XPRoomMoreMenuAction.h" NS_ASSUME_NONNULL_BEGIN diff --git a/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomSettingAction.m b/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomSettingAction.m index b7a10c86..94baf58a 100644 --- a/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomSettingAction.m +++ b/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomSettingAction.m @@ -6,20 +6,18 @@ // #import "XPRoomSettingAction.h" -#import "../Model/XPRoomMoreMenuActionContext.h" -#import "YUMIMacroUitls.h" +#import "XPRoomMoreMenuActionContext.h" #import "XPRoomSettingViewController.h" -#import "DJDKMIMOMColor.h" @implementation XPRoomSettingAction + (instancetype)action { XPRoomSettingAction *action = [[XPRoomSettingAction alloc] init]; - action.title = @"房间设置"; // 暂时使用硬编码,后续改为本地化 - action.imageName = @"room_more_menu_setting"; // 使用正确的图片名称 + action.title = YMLocalizedString(@"XPMoreMenuPresenter21"); + action.imageName = @"room_more_menu_setting"; action.type = RoomMoreMenuType_Room_Setting; action.isEnabled = YES; - action.titleColor = [DJDKMIMOMColor appCellBackgroundColor]; // 使用正确的标题颜色 + action.titleColor = [DJDKMIMOMColor roomMoreMenuTextColor]; return action; } diff --git a/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomTypeSettingAction.h b/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomTypeSettingAction.h new file mode 100644 index 00000000..ac043396 --- /dev/null +++ b/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomTypeSettingAction.h @@ -0,0 +1,18 @@ +// +// XPRoomTypeSettingAction.h +// YuMi +// +// Created by P on 2025/9/1. +// + +#import "XPRoomMoreMenuAction.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XPRoomTypeSettingAction : XPRoomMoreMenuAction + ++ (instancetype)action; + +@end + +NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomTypeSettingAction.m b/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomTypeSettingAction.m new file mode 100644 index 00000000..95c53381 --- /dev/null +++ b/YuMi/Modules/YMRoom/View/MoreView/Action/XPRoomTypeSettingAction.m @@ -0,0 +1,37 @@ +// +// XPRoomTypeSettingAction.m +// YuMi +// +// Created by P on 2025/9/1. +// + +#import "XPRoomTypeSettingAction.h" +#import "XPRoomMoreMenuActionContext.h" +#import "RoomModeViewController.h" + +@implementation XPRoomTypeSettingAction + ++ (instancetype)action { + XPRoomTypeSettingAction *action = [[XPRoomTypeSettingAction alloc] init]; + action.title = YMLocalizedString(@"XPMoreMenuPresenter25"); + action.imageName = @"room_type_selection_icon"; + action.type = RoomMoreMenuType_Room_Type_Setting; + action.isEnabled = YES; + action.titleColor = [DJDKMIMOMColor roomMoreMenuTextColor]; + return action; +} + +- (BOOL)canExecuteWithContext:(XPRoomMoreMenuActionContext *)context { + return self.isEnabled; +} + +- (void)executeWithContext:(XPRoomMoreMenuActionContext *)context { + // 关闭当前页面 + [context.presentingViewController dismissViewControllerAnimated:YES completion:nil]; + + RoomModeViewController *vc = [[RoomModeViewController alloc] init]; + vc.roomInfo = context.hostDelegate.getRoomInfo; + [context.hostDelegate.getCurrentNav pushViewController:vc animated:YES]; +} + +@end diff --git a/YuMi/Modules/YMRoom/View/MoreView/Action/XPSocialAction.m b/YuMi/Modules/YMRoom/View/MoreView/Action/XPSocialAction.m index f99fbe4e..94e69556 100644 --- a/YuMi/Modules/YMRoom/View/MoreView/Action/XPSocialAction.m +++ b/YuMi/Modules/YMRoom/View/MoreView/Action/XPSocialAction.m @@ -26,7 +26,7 @@ action.imageName = @"room_more_menu_invite_friend"; // 使用正确的图片名称 action.type = RoomMoreMenuType_Invite_Fans; action.isEnabled = YES; - action.titleColor = [DJDKMIMOMColor appCellBackgroundColor]; // 使用正确的标题颜色 + action.titleColor = [DJDKMIMOMColor roomMoreMenuTextColor]; // 使用正确的标题颜色 return action; } @@ -36,7 +36,7 @@ action.imageName = @"room_more_menu_release_radio"; // 使用正确的图片名称 action.type = RoomMoreMenuType_Release_Radio; action.isEnabled = YES; - action.titleColor = [DJDKMIMOMColor appCellBackgroundColor]; // 使用正确的标题颜色 + action.titleColor = [DJDKMIMOMColor roomMoreMenuTextColor]; // 使用正确的标题颜色 return action; } @@ -46,17 +46,17 @@ action.imageName = @"room_more_menu_trumpet"; // 使用正确的图片名称 action.type = RoomMoreMenuType_Room_trumpet; action.isEnabled = YES; - action.titleColor = [DJDKMIMOMColor appCellBackgroundColor]; // 使用正确的标题颜色 + action.titleColor = [DJDKMIMOMColor roomMoreMenuTextColor]; // 使用正确的标题颜色 return action; } + (instancetype)reportAction { XPSocialAction *action = [[XPSocialAction alloc] init]; - action.title = @"举报房间"; // 暂时使用硬编码,后续改为本地化 - action.imageName = @"room_more_menu_message"; // 暂时使用消息图标,后续添加举报图标 + action.title = YMLocalizedString(@"XPMoreMenuPresenter36"); + action.imageName = @"room_info_report"; action.type = RoomMoreMenuType_Room_report; action.isEnabled = YES; - action.titleColor = [DJDKMIMOMColor appCellBackgroundColor]; // 使用正确的标题颜色 + action.titleColor = [DJDKMIMOMColor roomMoreMenuTextColor]; // 使用正确的标题颜色 return action; } diff --git a/YuMi/Modules/YMRoom/View/MoreView/Factory/XPRoomMoreMenuActionFactory.h b/YuMi/Modules/YMRoom/View/MoreView/Factory/XPRoomMoreMenuActionFactory.h index 37092d04..0da2b97b 100644 --- a/YuMi/Modules/YMRoom/View/MoreView/Factory/XPRoomMoreMenuActionFactory.h +++ b/YuMi/Modules/YMRoom/View/MoreView/Factory/XPRoomMoreMenuActionFactory.h @@ -25,6 +25,13 @@ NS_ASSUME_NONNULL_BEGIN */ + (NSArray *)createActionsWithContext:(XPRoomMoreMenuActionContext *)context; +/// 超管直接回使用固定组合 models (trumpet, giftEffect, appManager, report) ++ (NSArray *)createSuperAdminActionsWithContext:(XPRoomMoreMenuActionContext *)context; + ++ (NSArray *)createPanelActionsWithContext:(XPRoomMoreMenuActionContext *)context isCreator:(BOOL)isCreator isManager:(BOOL)isManager isSuperAdmin:(BOOL)isSuperAdmin isOnMic:(BOOL)isOnMic; + ++ (NSArray *)createPanelActionsForNoCharRoomMembersWithContext:(XPRoomMoreMenuActionContext *)context; + @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/MoreView/Factory/XPRoomMoreMenuActionFactory.m b/YuMi/Modules/YMRoom/View/MoreView/Factory/XPRoomMoreMenuActionFactory.m index 80e103bd..e4f4fae3 100644 --- a/YuMi/Modules/YMRoom/View/MoreView/Factory/XPRoomMoreMenuActionFactory.m +++ b/YuMi/Modules/YMRoom/View/MoreView/Factory/XPRoomMoreMenuActionFactory.m @@ -10,15 +10,124 @@ #import "XPRoomMoreMenuAction.h" #import "XPGiftEffectAction.h" #import "XPRoomSettingAction.h" +#import "XPRoomBackGroundSettingAction.h" #import "XPSocialAction.h" #import "XPPKAction.h" +#import "XPRoomTypeSettingAction.h" +#import "XPRoomRedPacketAction.h" +#import "XPRoomMusicPanelAction.h" +#import "XPRoomRoomPhotoAction.h" +#import "XPRoomAppManagerAction.h" +#import "XPRoomCleanMessagesAction.h" #import "RoomInfoModel.h" +#import "ClientConfig.h" @implementation XPRoomMoreMenuActionFactory + (NSArray *)createActionsWithContext:(XPRoomMoreMenuActionContext *)context { NSMutableArray *actions = [NSMutableArray array]; + [actions addObject:[XPSocialAction trumpetAction]]; + [actions addObject:[XPGiftEffectAction actionWithRoomInfo:context.roomInfo]]; + [actions addObject:[XPRoomAppManagerAction action]]; + [actions addObject:[XPSocialAction reportAction]]; + + return actions; +} + ++ (NSArray *)createPanelActionsWithContext:(XPRoomMoreMenuActionContext *)context + isCreator:(BOOL)isCreator + isManager:(BOOL)isManager + isSuperAdmin:(BOOL)isSuperAdmin + isOnMic:(BOOL)isOnMic { + NSMutableArray *actions = [NSMutableArray array]; + RoomInfoModel *roomInfo = context.roomInfo; + RoomType type = roomInfo.type; + + NSInteger indexOfRoomAlbum = 0; + + // MARK: 一定要按顺序 + + if ((isCreator || isManager || isSuperAdmin) && + type != RoomType_MiniGame && + type != RoomType_Anchor) { + [actions addObject:[XPPKAction roomPKActionWithRoomInfo:context.roomInfo]]; + indexOfRoomAlbum += 1; + } + + if (isCreator && type != RoomType_MiniGame && type != RoomType_Anchor) { + [actions addObject:[XPPKAction corssPKActionWithRoomInfo:context.roomInfo]]; + indexOfRoomAlbum += 1; + } + + if (isOnMic) { + [actions addObject:[XPRoomMusicPanelAction action]]; + indexOfRoomAlbum += 1; + } + + if (isCreator && type == RoomType_Anchor) { + [actions addObject:[XPPKAction anchorPKActionWithRoomInfo:context.roomInfo]]; + indexOfRoomAlbum += 1; + } + + if (isCreator || isManager || isSuperAdmin) { + if (roomInfo.canOpenBlindDate && type != RoomType_Anchor && type != RoomType_MiniGame) { + [actions insertObject:[XPPKAction blindActionWithRoomInfo:context.roomInfo] atIndex:0]; + indexOfRoomAlbum += 1; + } + [actions addObject:[XPSocialAction trumpetAction]]; + [actions addObject:[XPGiftEffectAction actionWithRoomInfo:context.roomInfo]]; + [actions addObject:[XPRoomSettingAction action]]; + [actions addObject:[XPRoomBackGroundSettingAction action]]; + + [actions addObject:[XPRoomCleanMessagesAction action]]; + indexOfRoomAlbum += 1; + } else { + [actions addObject:[XPSocialAction trumpetAction]]; + [actions addObject:[XPGiftEffectAction actionWithRoomInfo:context.roomInfo]]; + } + + [actions addObject:[XPSocialAction reportAction]]; + + if ((isCreator || isManager || isSuperAdmin) && // 房主 & 管理 + roomInfo.isPermitRoom != PermitRoomType_License && // 非牌照 + roomInfo.roomModeType != RoomModeType_Open_Blind && // 非相亲 + type != RoomType_MiniGame && // 非 10/15 麦 + type != RoomType_Anchor) { + [actions addObject:[XPRoomTypeSettingAction action]]; + } + + if(roomInfo.hasRoomAlbum == YES){ + [actions insertObject:[XPRoomRoomPhotoAction action] atIndex:indexOfRoomAlbum]; + } + + if ([ClientConfig shareConfig].configInfo.redEnvelopeConfig.open && roomInfo.redEnvelopeOpen) { + [actions insertObject:[XPRoomRedPacketAction action] atIndex:1]; + } + + return actions; +} + ++ (NSArray *)createPanelActionsForNoCharRoomMembersWithContext:(XPRoomMoreMenuActionContext *)context { + NSMutableArray *actions = [NSMutableArray array]; + RoomInfoModel *roomInfo = context.roomInfo; + + if(roomInfo.hasRoomAlbum == YES){ + [actions addObject:[XPRoomRoomPhotoAction action]]; + } + + if ([ClientConfig shareConfig].configInfo.redEnvelopeConfig.open && roomInfo.redEnvelopeOpen) { + [actions addObject:[XPRoomRedPacketAction action]]; + } + + [actions addObject:[XPSocialAction reportAction]]; + + return actions; +} + ++ (NSArray *)createSuperAdminActionsWithContext:(XPRoomMoreMenuActionContext *)context { + NSMutableArray *actions = [NSMutableArray array]; + // 根据原有逻辑创建 Action 列表 // 1. 礼物特效 - 根据房间状态只显示一个 @@ -27,13 +136,18 @@ // 2. 房间设置 - 只有房主或管理员可以操作 // 这里暂时添加,后续需要根据用户身份判断 [actions addObject:[XPRoomSettingAction action]]; + [actions addObject:[XPRoomTypeSettingAction action]]; + [actions addObject:[XPRoomBackGroundSettingAction action]]; // 3. 社交功能 - 所有用户都可以使用 -// [actions addObject:[XPSocialAction inviteFansAction]]; -// [actions addObject:[XPSocialAction releaseRadioAction]]; + [actions addObject:[XPSocialAction inviteFansAction]]; + [actions addObject:[XPSocialAction releaseRadioAction]]; [actions addObject:[XPSocialAction trumpetAction]]; [actions addObject:[XPSocialAction reportAction]]; + [actions addObject:[XPRoomRedPacketAction action]]; + [actions addObject:[XPRoomMusicPanelAction action]]; + // 4. PK相关功能 - 根据房间状态显示对应的Action [actions addObject:[XPPKAction roomPKActionWithRoomInfo:context.roomInfo]]; XPPKAction *crossAction = [XPPKAction corssPKActionWithRoomInfo:context.roomInfo]; @@ -45,8 +159,7 @@ [actions addObject:blindAction]; } - // TODO: 后续添加更多操作 - // 等等... + // TODO: 增加固定返回的方法 return actions; } diff --git a/YuMi/Modules/YMRoom/View/MoreView/Model/XPRoomMoreItemModel.h b/YuMi/Modules/YMRoom/View/MoreView/Model/XPRoomMoreItemModel.h index 4ac6fd37..f5133eb7 100644 --- a/YuMi/Modules/YMRoom/View/MoreView/Model/XPRoomMoreItemModel.h +++ b/YuMi/Modules/YMRoom/View/MoreView/Model/XPRoomMoreItemModel.h @@ -51,7 +51,7 @@ typedef NS_ENUM(NSInteger, RoomMoreMenuType) { ///发红包 RoomMoreMenuType_Room_redPacket = 20, ///扬声器 - RoomMoreMenuType_Room_Voice = 21, +// RoomMoreMenuType_Room_Voice = 21, ///心愿礼物 // RoomMoreMenuType_Room_Wish_Gift = 22, ///举报 diff --git a/YuMi/Modules/YMRoom/View/MoreView/Model/XPRoomMoreMenuAction.h b/YuMi/Modules/YMRoom/View/MoreView/Model/XPRoomMoreMenuAction.h index 1547137d..c4e2784c 100644 --- a/YuMi/Modules/YMRoom/View/MoreView/Model/XPRoomMoreMenuAction.h +++ b/YuMi/Modules/YMRoom/View/MoreView/Model/XPRoomMoreMenuAction.h @@ -7,6 +7,9 @@ #import #import "XPRoomMoreItemModel.h" +#import "ThemeColor+Room.h" +#import "RoomHostDelegate.h" +#import "XPRoomMoreMenuActionContext.h" @class XPRoomMoreMenuActionContext; diff --git a/YuMi/Modules/YMRoom/View/MoreView/Presenter/XPMoreMenuPresenter.m b/YuMi/Modules/YMRoom/View/MoreView/Presenter/XPMoreMenuPresenter.m index 418de269..9e61f7a0 100644 --- a/YuMi/Modules/YMRoom/View/MoreView/Presenter/XPMoreMenuPresenter.m +++ b/YuMi/Modules/YMRoom/View/MoreView/Presenter/XPMoreMenuPresenter.m @@ -24,7 +24,6 @@ ///P #import "XPMoreMenuProtocol.h" #import "DJDKMIMOMColor.h" -#import @implementation XPMoreMenuPresenter @@ -67,73 +66,45 @@ isAppSuperAdmin:isAppSuperAdmin]; // 使用工厂创建 Action 列表 - NSArray *actions = [XPRoomMoreMenuActionFactory - createActionsWithContext:context]; // 转换为数据模型 - NSMutableArray *models = [NSMutableArray array]; + +//#ifdef DEBUG +// // MARK: 测试全部重构的 actions // for (XPRoomMoreMenuAction *action in actions) { // [models addObject:[action toItemModel]]; // } +// [[self getView] getMoreMenuDataSuccess:models]; +// return; +//#endif if (isAppSuperAdmin) { - // TODO: 超管直接回使用固定组合 models (trumpet, giftEffect, appManager, report) - // 调用原有的成功回调 + NSArray *actions = [XPRoomMoreMenuActionFactory createSuperAdminActionsWithContext:context]; + NSMutableArray *models = [NSMutableArray array]; + for (XPRoomMoreMenuAction *action in actions) { + [models addObject:[action toItemModel]]; + } [[self getView] getMoreMenuDataSuccess:models]; } else { + @kWeakify(self); [self loadNIMMemberData:^(NSArray * _Nullable members) { - BOOL isCreator = NO; - BOOL isManager = NO; - if (members) { + @kStrongify(self); + NSArray *actions; + NSMutableArray *models = [NSMutableArray array]; + if (members && members.count > 0) { NIMChatroomMember * member = members.firstObject; - if (member) { - isCreator = member.type == NIMChatroomMemberTypeCreator; - isManager = member.type == NIMChatroomMemberTypeManager; - - if ((isCreator || isManager || isSuperAdmin) && roomInfo.type != RoomType_MiniGame && roomInfo.type != RoomType_Anchor) { - // TODO: models 增加 roomPK - } - if (isCreator && roomInfo.type != RoomType_MiniGame) { - if(roomInfo.type != RoomType_Anchor){ - // TODO: models 增加 acrossRoomPK - } - } - if (isOnMic) { - // TODO: models 增加 musicPanel - } - if (isCreator && roomInfo.type == RoomType_Anchor) { - // TODO: models 增加 anchorRoomPK - } - if (isCreator || isManager || isSuperAdmin) { - if (roomInfo.canOpenBlindDate && roomInfo.type != RoomType_Anchor && roomInfo.type != RoomType_MiniGame) { - // TODO: models 增加 dating,并指定插入到 index = 1 的位置 - } - // TODO: models 增加 trumpet、giftEffect、roomSetting、bgValue、clearScreen - } else { - // TODO: models 增加 trumpet、giftEffect - } - } else { - // TODO: models 只有 report 和 giftEffect - } + actions = [XPRoomMoreMenuActionFactory + createPanelActionsWithContext:context + isCreator:member.type == NIMChatroomMemberTypeCreator + isManager:member.type == NIMChatroomMemberTypeManager + isSuperAdmin:isSuperAdmin + isOnMic:isOnMic]; } else { - // TODO: models 只有 report 和 giftEffect + actions = [XPRoomMoreMenuActionFactory + createPanelActionsForNoCharRoomMembersWithContext:context]; } - - if ((isCreator || isManager || isSuperAdmin) && // 房主 & 管理 - roomInfo.isPermitRoom != PermitRoomType_License && // 非牌照 - roomInfo.roomModeType != RoomModeType_Open_Blind && // 非相亲 - roomInfo.type != RoomType_MiniGame && // 非 10/15 麦 - roomInfo.type != RoomType_Anchor) { - // TODO: models 增加 roomTypeSetting + for (XPRoomMoreMenuAction *action in actions) { + [models addObject:[action toItemModel]]; } - - if(roomInfo.hasRoomAlbum == YES){ - // TODO: models 增加 roomPhotoAlbum - } - if ([ClientConfig shareConfig].configInfo.redEnvelopeConfig.open && - roomInfo.redEnvelopeOpen) { - // TODO: models 增加 redPacket,并指定位置为 index = 1 - } - [[self getView] getMoreMenuDataSuccess:models]; } withRoomInfo:roomInfo]; } diff --git a/YuMi/Modules/YMRoom/View/MoreView/View/XPRoomMoreMenuViewController.m b/YuMi/Modules/YMRoom/View/MoreView/View/XPRoomMoreMenuViewController.m index 6b3cadc9..dd3f76cc 100644 --- a/YuMi/Modules/YMRoom/View/MoreView/View/XPRoomMoreMenuViewController.m +++ b/YuMi/Modules/YMRoom/View/MoreView/View/XPRoomMoreMenuViewController.m @@ -315,7 +315,9 @@ UIKIT_EXTERN NSString * const kRoomGiftEffectUpdateNotificationKey; NSLog(@"=== 点击菜单项 ==="); NSLog(@"点击的菜单项: 标题=%@, 类型=%ld", item.title, (long)item.type); - + [self handleItemWithLegacyLogic:item]; + return; + // 创建上下文 XPRoomMoreMenuActionContext *context = [XPRoomMoreMenuActionContext contextWithRoomInfo:self.roomInfo @@ -332,18 +334,22 @@ UIKIT_EXTERN NSString * const kRoomGiftEffectUpdateNotificationKey; NSLog(@"找到的 Action: %@", action ? @"是" : @"否"); if (action) { NSLog(@"Action 标题: %@, 类型: %ld", action.title, (long)action.type); - NSLog(@"准备调用 canExecuteWithContext..."); - BOOL canExecute = [action canExecuteWithContext:context]; - NSLog(@"Action 可以执行: %@", canExecute ? @"是" : @"否"); - - if (canExecute) { - NSLog(@"开始执行 Action..."); - [action executeWithContext:context]; - NSLog(@"Action 执行完成"); - } else { - NSLog(@"Action 无法执行,使用 fallback 逻辑"); - [self handleItemWithLegacyLogic:item]; - } + + [self handleItemWithLegacyLogic:[action toItemModel]]; + +// NSLog(@"准备调用 canExecuteWithContext..."); +// BOOL canExecute = [action canExecuteWithContext:context]; +// NSLog(@"Action 可以执行: %@", canExecute ? @"是" : @"否"); +// +// if (canExecute) { +// NSLog(@"开始执行 Action..."); +// // TODO: action 直接传递 type 到 VC +// [action executeWithContext:context]; +// NSLog(@"Action 执行完成"); +// } else { +// NSLog(@"Action 无法执行,使用 fallback 逻辑"); +// [self handleItemWithLegacyLogic:item]; +// } } else { NSLog(@"未找到 Action,使用 fallback 逻辑"); // 如果找不到对应的 Action,使用原有的 switch 逻辑作为 fallback @@ -573,13 +579,6 @@ UIKIT_EXTERN NSString * const kRoomGiftEffectUpdateNotificationKey; [self.hostDelegate.getCurrentNav presentViewController:nav animated:YES completion:nil]; } break; - case RoomMoreMenuType_Room_Voice: - { - [self dismissViewControllerAnimated:YES completion:nil]; - [RtcManager instance].remoteMuted = !item.isSelected; - item.isSelected = [RtcManager instance].isRemoteMuted; - } - break; case RoomMoreMenuType_Room_report: { [self dismissViewControllerAnimated:YES completion:nil];