新增多个房间功能相关的 Action 类,包括 XPRoomAppManagerAction、XPRoomCleanMessagesAction、XPRoomBackGroundSettingAction、XPRoomMusicPanelAction 和 XPRoomRoomPhotoAction,优化房间更多菜单的功能扩展性。同时,更新 XPRoomMoreMenuActionFactory 以支持新功能,提升代码可维护性和结构清晰度。
This commit is contained in:
@@ -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 = "<group>"; };
|
||||
4C0B4A382E6579C700D67F73 /* XPPKAction.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPPKAction.h; sourceTree = "<group>"; };
|
||||
4C0B4A392E6579C700D67F73 /* XPPKAction.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPPKAction.m; sourceTree = "<group>"; };
|
||||
4C0B4A3C2E659A2C00D67F73 /* XPRoomTypeSettingAction.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomTypeSettingAction.h; sourceTree = "<group>"; };
|
||||
4C0B4A3D2E659A2C00D67F73 /* XPRoomTypeSettingAction.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomTypeSettingAction.m; sourceTree = "<group>"; };
|
||||
4C0B4A3F2E659DC100D67F73 /* XPRoomBackGroundSettingAction.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomBackGroundSettingAction.h; sourceTree = "<group>"; };
|
||||
4C0B4A402E659DC100D67F73 /* XPRoomBackGroundSettingAction.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomBackGroundSettingAction.m; sourceTree = "<group>"; };
|
||||
4C0B4A422E65A0D300D67F73 /* XPRoomCleanMessagesAction.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomCleanMessagesAction.h; sourceTree = "<group>"; };
|
||||
4C0B4A432E65A0D300D67F73 /* XPRoomCleanMessagesAction.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomCleanMessagesAction.m; sourceTree = "<group>"; };
|
||||
4C0B4A452E65A51600D67F73 /* XPRoomRedPacketAction.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomRedPacketAction.h; sourceTree = "<group>"; };
|
||||
4C0B4A462E65A51600D67F73 /* XPRoomRedPacketAction.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomRedPacketAction.m; sourceTree = "<group>"; };
|
||||
4C0B4A482E65A5D500D67F73 /* XPRoomMusicPanelAction.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomMusicPanelAction.h; sourceTree = "<group>"; };
|
||||
4C0B4A492E65A5D500D67F73 /* XPRoomMusicPanelAction.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomMusicPanelAction.m; sourceTree = "<group>"; };
|
||||
4C0B4A4B2E65A63400D67F73 /* XPRoomRoomPhotoAction.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomRoomPhotoAction.h; sourceTree = "<group>"; };
|
||||
4C0B4A4C2E65A63400D67F73 /* XPRoomRoomPhotoAction.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomRoomPhotoAction.m; sourceTree = "<group>"; };
|
||||
4C0B4A4E2E65A68800D67F73 /* XPRoomAppManagerAction.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomAppManagerAction.h; sourceTree = "<group>"; };
|
||||
4C0B4A4F2E65A68800D67F73 /* XPRoomAppManagerAction.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomAppManagerAction.m; sourceTree = "<group>"; };
|
||||
4C1064862E0014CF007E1586 /* NSMutableArray+Safe.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSMutableArray+Safe.h"; sourceTree = "<group>"; };
|
||||
4C1064872E0014CF007E1586 /* NSMutableArray+Safe.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSMutableArray+Safe.m"; sourceTree = "<group>"; };
|
||||
4C1119702DD7218300C18416 /* MyEventsViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MyEventsViewController.h; sourceTree = "<group>"; };
|
||||
@@ -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 = "<group>";
|
||||
@@ -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 */,
|
||||
|
@@ -7,11 +7,7 @@
|
||||
|
||||
#import "XPGiftEffectAction.h"
|
||||
#import "XPRoomMoreMenuActionContext.h"
|
||||
#import "YUMIConstant.h"
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import "DJDKMIMOMColor.h"
|
||||
#import "RoomInfoModel.h"
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "BaseViewController.h"
|
||||
|
||||
UIKIT_EXTERN NSString * const kRoomGiftEffectUpdateNotificationKey;
|
||||
|
@@ -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
|
||||
|
@@ -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];
|
||||
}
|
||||
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -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
|
@@ -5,7 +5,7 @@
|
||||
// Created by Linus on 2025/1/13.
|
||||
//
|
||||
|
||||
#import "../Model/XPRoomMoreMenuAction.h"
|
||||
#import "XPRoomMoreMenuAction.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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
|
@@ -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
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -25,6 +25,13 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
*/
|
||||
+ (NSArray<XPRoomMoreMenuAction *> *)createActionsWithContext:(XPRoomMoreMenuActionContext *)context;
|
||||
|
||||
/// 超管直接回使用固定组合 models (trumpet, giftEffect, appManager, report)
|
||||
+ (NSArray<XPRoomMoreMenuAction *> *)createSuperAdminActionsWithContext:(XPRoomMoreMenuActionContext *)context;
|
||||
|
||||
+ (NSArray<XPRoomMoreMenuAction *> *)createPanelActionsWithContext:(XPRoomMoreMenuActionContext *)context isCreator:(BOOL)isCreator isManager:(BOOL)isManager isSuperAdmin:(BOOL)isSuperAdmin isOnMic:(BOOL)isOnMic;
|
||||
|
||||
+ (NSArray<XPRoomMoreMenuAction *> *)createPanelActionsForNoCharRoomMembersWithContext:(XPRoomMoreMenuActionContext *)context;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -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<XPRoomMoreMenuAction *> *)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<XPRoomMoreMenuAction *> *)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<XPRoomMoreMenuAction *> *)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<XPRoomMoreMenuAction *> *)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;
|
||||
}
|
||||
|
@@ -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,
|
||||
///举报
|
||||
|
@@ -7,6 +7,9 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "XPRoomMoreItemModel.h"
|
||||
#import "ThemeColor+Room.h"
|
||||
#import "RoomHostDelegate.h"
|
||||
#import "XPRoomMoreMenuActionContext.h"
|
||||
|
||||
@class XPRoomMoreMenuActionContext;
|
||||
|
||||
|
@@ -24,7 +24,6 @@
|
||||
///P
|
||||
#import "XPMoreMenuProtocol.h"
|
||||
#import "DJDKMIMOMColor.h"
|
||||
#import <NIMSDK/NIMSDK.h>
|
||||
|
||||
@implementation XPMoreMenuPresenter
|
||||
|
||||
@@ -67,73 +66,45 @@
|
||||
isAppSuperAdmin:isAppSuperAdmin];
|
||||
|
||||
// 使用工厂创建 Action 列表
|
||||
NSArray<XPRoomMoreMenuAction *> *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<XPRoomMoreMenuAction *> *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<NIMChatroomMember *> * _Nullable members) {
|
||||
BOOL isCreator = NO;
|
||||
BOOL isManager = NO;
|
||||
if (members) {
|
||||
@kStrongify(self);
|
||||
NSArray<XPRoomMoreMenuAction *> *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];
|
||||
}
|
||||
|
@@ -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];
|
||||
|
Reference in New Issue
Block a user