From 95e3e2601fe05432ba5a09bd51ba42d14975f68a Mon Sep 17 00:00:00 2001 From: edwinQQQ Date: Thu, 22 May 2025 18:04:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E9=BA=A6=E4=BD=8D=E5=B8=83=E5=B1=80=E5=92=8C=E6=88=BF=E9=97=B4?= =?UTF-8?q?=E9=BA=A6=E4=BD=8D=E9=80=89=E6=8B=A9=E8=A7=86=E5=9B=BE=EF=BC=8C?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=88=BF=E9=97=B4=E7=94=A8=E6=88=B7=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=EF=BC=8C=E6=9B=B4=E6=96=B0=E6=9C=AC=E5=9C=B0=E5=8C=96?= =?UTF-8?q?=E5=AD=97=E7=AC=A6=E4=B8=B2=EF=BC=8C=E8=B0=83=E6=95=B4=E9=83=A8?= =?UTF-8?q?=E5=88=86UI=E7=BB=84=E4=BB=B6=E7=BA=A6=E6=9D=9F=E3=80=82?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7=E6=9B=B4=E6=96=B0=E8=87=B320.20.65?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- YuMi.xcodeproj/project.pbxproj | 24 ++ .../event_review.imageset/Contents.json | 21 + .../event_review.imageset/容器@3x (3).png | Bin 0 -> 774 bytes .../event_staring.imageset/Contents.json | 21 + .../event_staring.imageset/容器@3x (4).png | Bin 0 -> 1120 bytes .../Modules/YMMine/View/Recharge/IAPManager.m | 2 +- YuMi/Modules/YMNewHome/Model/EventItemModel.h | 3 +- .../Presenter/CreateEventPresenter.m | 34 +- .../View/Cell/EventCenterEventCell.m | 31 +- .../View/CreateEventViewControllerV2.m | 57 ++- .../View/EventCenterViewController.m | 22 +- .../YMNewHome/View/MyEventsViewController.m | 5 +- .../YMRoom/Presenter/XPRoomPresenter.h | 2 - .../XPRoomMenuContainerView.m | 34 +- .../MessageContainerView/View/RoomCahtCell.m | 5 - .../SendGiftView/View/CountdownRingView.m | 3 - .../View/UserCard/View/Custom19MicLayout.h | 19 + .../View/UserCard/View/Custom19MicLayout.m | 77 ++++ .../View/UserCard/View/Custom9MicLayout.h | 19 + .../View/UserCard/View/Custom9MicLayout.m | 59 +++ .../View/UserRoomCardViewController.m | 384 +----------------- .../UserCard/View/UserRoomMicPositionCell.h | 23 ++ .../UserCard/View/UserRoomMicPositionCell.m | 51 +++ .../UserCard/View/UserRoomMicPositionView.h | 25 ++ .../UserCard/View/UserRoomMicPositionView.m | 189 +++++++++ YuMi/Modules/YMRoom/View/XPMiniRoomView.m | 2 +- .../YMRoom/View/XPRoomViewController.m | 2 +- YuMi/ar.lproj/Localizable.strings | 2 +- YuMi/en.lproj/Localizable.strings | 2 +- YuMi/tr.lproj/Localizable.strings | 2 +- YuMi/zh-Hant.lproj/Localizable.strings | 2 +- 31 files changed, 670 insertions(+), 452 deletions(-) create mode 100644 YuMi/Assets.xcassets/20.20.59/event_review.imageset/Contents.json create mode 100644 YuMi/Assets.xcassets/20.20.59/event_review.imageset/容器@3x (3).png create mode 100644 YuMi/Assets.xcassets/20.20.59/event_staring.imageset/Contents.json create mode 100644 YuMi/Assets.xcassets/20.20.59/event_staring.imageset/容器@3x (4).png create mode 100644 YuMi/Modules/YMRoom/View/UserCard/View/Custom19MicLayout.h create mode 100644 YuMi/Modules/YMRoom/View/UserCard/View/Custom19MicLayout.m create mode 100644 YuMi/Modules/YMRoom/View/UserCard/View/Custom9MicLayout.h create mode 100644 YuMi/Modules/YMRoom/View/UserCard/View/Custom9MicLayout.m create mode 100644 YuMi/Modules/YMRoom/View/UserCard/View/UserRoomMicPositionCell.h create mode 100644 YuMi/Modules/YMRoom/View/UserCard/View/UserRoomMicPositionCell.m create mode 100644 YuMi/Modules/YMRoom/View/UserCard/View/UserRoomMicPositionView.h create mode 100644 YuMi/Modules/YMRoom/View/UserCard/View/UserRoomMicPositionView.m diff --git a/YuMi.xcodeproj/project.pbxproj b/YuMi.xcodeproj/project.pbxproj index ca3e3d55..84e65dd0 100644 --- a/YuMi.xcodeproj/project.pbxproj +++ b/YuMi.xcodeproj/project.pbxproj @@ -550,6 +550,10 @@ 4CC312272D79A10100F57A07 /* ShareProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CC312262D79A10100F57A07 /* ShareProvider.m */; }; 4CC6195A2CEC7770008C1EE8 /* MyDressingDataPresent.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CC619592CEC7770008C1EE8 /* MyDressingDataPresent.m */; }; 4CC6195D2CEC996E008C1EE8 /* MyDressingDataModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CC6195C2CEC996E008C1EE8 /* MyDressingDataModel.m */; }; + 4CCA0C6E2DDED89F00E30513 /* Custom9MicLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CCA0C672DDED89F00E30513 /* Custom9MicLayout.m */; }; + 4CCA0C6F2DDED89F00E30513 /* UserRoomMicPositionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CCA0C6D2DDED89F00E30513 /* UserRoomMicPositionView.m */; }; + 4CCA0C702DDED89F00E30513 /* UserRoomMicPositionCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CCA0C6B2DDED89F00E30513 /* UserRoomMicPositionCell.m */; }; + 4CCA0C712DDED89F00E30513 /* Custom19MicLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CCA0C692DDED89F00E30513 /* Custom19MicLayout.m */; }; 4CCB809F2DD5DFDF00C756D3 /* EventRoomModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CCB809E2DD5DFDF00C756D3 /* EventRoomModel.m */; }; 4CCFDA002DD59038009BD2FD /* EventCenterEmptyCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CCFD9FF2DD59038009BD2FD /* EventCenterEmptyCell.m */; }; 4CCFDA032DD59211009BD2FD /* Api+EventCenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CCFDA022DD59211009BD2FD /* Api+EventCenter.m */; }; @@ -2750,6 +2754,14 @@ 4CC619592CEC7770008C1EE8 /* MyDressingDataPresent.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MyDressingDataPresent.m; sourceTree = ""; }; 4CC6195B2CEC996E008C1EE8 /* MyDressingDataModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MyDressingDataModel.h; sourceTree = ""; }; 4CC6195C2CEC996E008C1EE8 /* MyDressingDataModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MyDressingDataModel.m; sourceTree = ""; }; + 4CCA0C662DDED89F00E30513 /* Custom9MicLayout.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Custom9MicLayout.h; sourceTree = ""; }; + 4CCA0C672DDED89F00E30513 /* Custom9MicLayout.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Custom9MicLayout.m; sourceTree = ""; }; + 4CCA0C682DDED89F00E30513 /* Custom19MicLayout.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Custom19MicLayout.h; sourceTree = ""; }; + 4CCA0C692DDED89F00E30513 /* Custom19MicLayout.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Custom19MicLayout.m; sourceTree = ""; }; + 4CCA0C6A2DDED89F00E30513 /* UserRoomMicPositionCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UserRoomMicPositionCell.h; sourceTree = ""; }; + 4CCA0C6B2DDED89F00E30513 /* UserRoomMicPositionCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UserRoomMicPositionCell.m; sourceTree = ""; }; + 4CCA0C6C2DDED89F00E30513 /* UserRoomMicPositionView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UserRoomMicPositionView.h; sourceTree = ""; }; + 4CCA0C6D2DDED89F00E30513 /* UserRoomMicPositionView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UserRoomMicPositionView.m; sourceTree = ""; }; 4CCB809D2DD5DFDF00C756D3 /* EventRoomModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = EventRoomModel.h; sourceTree = ""; }; 4CCB809E2DD5DFDF00C756D3 /* EventRoomModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = EventRoomModel.m; sourceTree = ""; }; 4CCFD9FE2DD59038009BD2FD /* EventCenterEmptyCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = EventCenterEmptyCell.h; sourceTree = ""; }; @@ -8462,6 +8474,14 @@ E82325ED274E2D8E003A3332 /* View */ = { isa = PBXGroup; children = ( + 4CCA0C662DDED89F00E30513 /* Custom9MicLayout.h */, + 4CCA0C672DDED89F00E30513 /* Custom9MicLayout.m */, + 4CCA0C682DDED89F00E30513 /* Custom19MicLayout.h */, + 4CCA0C692DDED89F00E30513 /* Custom19MicLayout.m */, + 4CCA0C6A2DDED89F00E30513 /* UserRoomMicPositionCell.h */, + 4CCA0C6B2DDED89F00E30513 /* UserRoomMicPositionCell.m */, + 4CCA0C6C2DDED89F00E30513 /* UserRoomMicPositionView.h */, + 4CCA0C6D2DDED89F00E30513 /* UserRoomMicPositionView.m */, 9B85B6D4279FDAA900A0A1AC /* SubViews */, E82325FD274E48D0003A3332 /* Cell */, E82325F0274E2DE6003A3332 /* XPUserCardViewController.h */, @@ -12968,6 +12988,10 @@ E81366E726F0A49E0076364C /* NSString+Utils.m in Sources */, 23194DD22AD14BF000649F51 /* DDFileLogger.m in Sources */, E8EEB90126FC31B6007C6EBA /* XPMineUserInfoPresenter.m in Sources */, + 4CCA0C6E2DDED89F00E30513 /* Custom9MicLayout.m in Sources */, + 4CCA0C6F2DDED89F00E30513 /* UserRoomMicPositionView.m in Sources */, + 4CCA0C702DDED89F00E30513 /* UserRoomMicPositionCell.m in Sources */, + 4CCA0C712DDED89F00E30513 /* Custom19MicLayout.m in Sources */, 4CE746D22D92A2660094E496 /* BravoGiftBannerView.m in Sources */, 4C864A022D55F4F600191AE0 /* LuckyPackagePresenter.m in Sources */, E81A65312834E53600F55894 /* XPMomentsLatestViewController.m in Sources */, diff --git a/YuMi/Assets.xcassets/20.20.59/event_review.imageset/Contents.json b/YuMi/Assets.xcassets/20.20.59/event_review.imageset/Contents.json new file mode 100644 index 00000000..ab2a85b9 --- /dev/null +++ b/YuMi/Assets.xcassets/20.20.59/event_review.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "容器@3x (3).png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YuMi/Assets.xcassets/20.20.59/event_review.imageset/容器@3x (3).png b/YuMi/Assets.xcassets/20.20.59/event_review.imageset/容器@3x (3).png new file mode 100644 index 0000000000000000000000000000000000000000..428eee49cb4af8b618da55a7f04e4251fc54418e GIT binary patch literal 774 zcmV+h1Nr=kP)Px%z)3_wR9Hvtm`#X|Q5462e;@h&SotVoL6pcwWUa_fk(31+vaqo8k+KjANn)oY zvYXZHP!{YhkWd=JhG>NGF*xRoJ2K;ap1B|Iyl=yt&HFCSz32D*@4e@qbHykzjS^1& zPf#-(2TTC`w^!2lX02FL6g9KSzzSdiFgw7$1D*g~lDbQQi$Tq7F|Zw&4@?SbI+p>T zfLFj3NiRxZi$Kk69AgN%posHx|0K0q-X%02>2G*2>Aa-=7q^kpi|P z^kz0EB>ri`0C?U!E9r5&KsNx}B7;8w&gWMB*-IY^=6#`}k74!l&X@mwjPp>RO3+Xt z`I36w`KOHsmI9kI?)o>tb>J@WW5~R|Jw8?)xQ3viDE5@ID(CA9#&q@Fbf+ctMk#7$ z-lQEZ2v{=Iix%$&23eJ&-UA&fiB>Rn475PJhC}~NMZI$O3cek7LejI?!!$kg>#FD_VVW*udd!VnyC)dtETngfwmP(??v_P zss?blJ?gODUA6+$pVBK|P(~V{cs~qGFb3K*DZ@lR0R&pqE4jrd-v9sr07*qoM6N<$ Ef`Hg?I{*Lx literal 0 HcmV?d00001 diff --git a/YuMi/Assets.xcassets/20.20.59/event_staring.imageset/Contents.json b/YuMi/Assets.xcassets/20.20.59/event_staring.imageset/Contents.json new file mode 100644 index 00000000..1c263a79 --- /dev/null +++ b/YuMi/Assets.xcassets/20.20.59/event_staring.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "容器@3x (4).png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YuMi/Assets.xcassets/20.20.59/event_staring.imageset/容器@3x (4).png b/YuMi/Assets.xcassets/20.20.59/event_staring.imageset/容器@3x (4).png new file mode 100644 index 0000000000000000000000000000000000000000..716fb7159e83c0242fb7104d6c0dca81507698aa GIT binary patch literal 1120 zcmV-m1fTnfP)Px(8c9S!R9Hvlm|uugWfZ`F=iWQB=I)wn5JXTt1TF<(Bq|a}P`>nsLMhlFs9-a~ z%$;FVabaYoKilkTMN~!!L6V>^{duuogz!O>Bq$7e=phMw$Z~hHow@g(_-1y&ow;}J zckf)WrGa_+zH`p+p7VX*`6DcmpDYnh{-2;)!2^mw2>4RL&nseGc~n27z+Z*C@xr?Z z<~-}#9f>p#j1)U$$T0@aV{=aM&!@F=Qx0xN)Cz-a+7o}C3Q zqw+hV2Pp=}zbvP*sG<;%W#+ zfvrHlt$~<*b126Vcbrn~XAv|>pB?B_VJ)E^0=)-tlayMn2OvLyKO|+&C&_dKZF-W` z;GP6-PEt0%eg)`>IInTy7jc}2*;zl^$+Mk7tHnVGkAU852Px-3J_5ZRbQoA^Dfc}% zLsG8AdNvkR53my7eGlO&%W#{EvX2>mKdZQjntK#@zz&oE_>>^nA+ItWB@+)i;cdpz zFXqE&W3P@lqf)9LY3669It$KSv$5Woq z{6gQX2gaoAzZMJHs3-fq*HJB}4Etixx9CN@?TD`Lpl2D%hRCEKQf1oTeRVy%DD+xk z8NKcl!i!yjn$%lmIUa>rJy&q)@pgdjLfiIz!c4GTD*U}5-wL{%KKEVVxeTBtWN&br zzfYc|mL#tg9QvGXAXVUoMf;WanGHsy!as4K-Gtug{0))MK`tbLqH2omCqUPP_xW`k8XEwIeVx$(N}Cn*Di70<&GWe4esD__iQP`z#-PlR{^_Z&2No zr16@ptDIqlzcDd|&Y#ngIjz?Oq_a|UzMqkD@LB7&=<2E24xi50X?F2_@*PG0!KijR zzHpu_Zb5^?8FGGB&^bbROh)|^Q3~QgO%Lz7Z<|n9wjx;pja-0o6fbxwuGi1Gxy#Bb z*_*q@r7}7DK;b^Z@aq)qa$4Gp5Nx7E$3cYM0HVquc&2U6e*odgu#D8tBz>J7=)y=x zgE53HDLT_Q`=%v62JS?zBb^0njW)RMt;1mqbYq6%y4h)pvlqX1BCdx|b?ZBYqS;Qn zTTyuh(Oay>jv~LHe93@+D5@RKCG>GhA_uvl_9FBk^2c=_(GN8{#i%D38oW;C7@ mt~}SRZhf8xv+7zhp#K6{+^RY-{Ab4i0000 *)officialDatasource { _officialDatasource = officialDatasource; -//#if DEBUG -//#else -// NSPredicate *predicate = [NSPredicate predicateWithFormat:@"activityShow == %@", @(1)]; -// [_officialDatasource filterUsingPredicate:predicate]; -//#endif - // 处理空数据状态 if (_officialDatasource.count == 0) { self.officialTableView.mj_header.hidden = NO; @@ -553,13 +547,6 @@ static UIEdgeInsets kOfficialTableViewContentInset(void) { NSInteger index = [self.contentViewControllers indexOfObject:pageViewController.viewControllers.firstObject]; if (index != NSNotFound) { [self switchToIndex:index animated:YES]; - - // 首次切换到活动广场,加载数据 - if (index == 1 && self.eventSquareDatasource.count == 0) { - [self.presenter loadEventSquare:self.eventSquareTableViewPage]; - } else if (index == 2 && self.myCreateEventDatasource == 0 && self.mySubEventDatasource == 0) { - [self.presenter loadMyEvents]; - } } } @@ -641,6 +628,13 @@ static UIEdgeInsets kOfficialTableViewContentInset(void) { [self.myEventTableView.mj_footer setHidden:YES]; } +- (void)myEventListFailure:(NSString *)msg { + [self.myEventTableView.mj_header endRefreshing]; + if (self.myEventTableViewPage == 1) { + [self.myEventTableView.mj_footer setHidden:YES]; + } +} + - (void)eventSubActionSuccess:(BOOL)isSub eventId:(NSInteger)eventId { NSInteger count = 0; if (isSub) { diff --git a/YuMi/Modules/YMNewHome/View/MyEventsViewController.m b/YuMi/Modules/YMNewHome/View/MyEventsViewController.m index 3a3facbf..8d763f58 100644 --- a/YuMi/Modules/YMNewHome/View/MyEventsViewController.m +++ b/YuMi/Modules/YMNewHome/View/MyEventsViewController.m @@ -125,7 +125,10 @@ } - (void)myCreateEventListFailure:(NSString *)msg { - + [self.myEventTableView.mj_header endRefreshing]; + if (self.page > 1) { + [self.myEventTableView.mj_footer endRefreshing]; + } } - (void)eventSubActionSuccess:(BOOL)isSub eventId:(NSInteger)eventId { diff --git a/YuMi/Modules/YMRoom/Presenter/XPRoomPresenter.h b/YuMi/Modules/YMRoom/Presenter/XPRoomPresenter.h index e57d1a67..d7d3007c 100644 --- a/YuMi/Modules/YMRoom/Presenter/XPRoomPresenter.h +++ b/YuMi/Modules/YMRoom/Presenter/XPRoomPresenter.h @@ -79,8 +79,6 @@ NS_ASSUME_NONNULL_BEGIN /// @param roomUid 房间id -(void)getKickUserListWithRoomUid:(NSString *)roomUid; - -// TODO: 转移到 Manager 管理逻辑 - (void)getBoomRocketAnimationInfo:(NSString *)roomUid; - (void)getBoomDetail:(NSString *)roomUid; diff --git a/YuMi/Modules/YMRoom/View/MenuContainerView/XPRoomMenuContainerView.m b/YuMi/Modules/YMRoom/View/MenuContainerView/XPRoomMenuContainerView.m index ba527f79..c8ede431 100644 --- a/YuMi/Modules/YMRoom/View/MenuContainerView/XPRoomMenuContainerView.m +++ b/YuMi/Modules/YMRoom/View/MenuContainerView/XPRoomMenuContainerView.m @@ -45,6 +45,7 @@ UIKIT_EXTERN NSString * kRoomBackMusicCaptureVolumeKey; ///输入框 @property (nonatomic,strong) UIButton *inputButton; +@property (nonatomic,strong) UILabel *inputLabel; ///麦 @property (nonatomic,strong) UIButton *micButton; @property (nonatomic,strong) UIButton *micButton_open; @@ -399,7 +400,8 @@ UIKIT_EXTERN NSString * kRoomBackMusicCaptureVolumeKey; [self.stackView addArrangedSubview:self.moreButton]; [self.stackView addArrangedSubview:self.giftButton]; - [self.stackView addSubview:self.faceButton]; + [self.stackView addSubview:self.inputLabel]; + [self.stackView addSubview:self.faceButton]; [self.stackView addSubview:self.micButton_open]; [self.stackView addSubview:self.micButton_close_all]; @@ -434,10 +436,16 @@ UIKIT_EXTERN NSString * kRoomBackMusicCaptureVolumeKey; }]; [self.faceButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerY.mas_equalTo(self.inputButton); - make.trailing.mas_equalTo(self.inputButton).offset(-4); + make.centerY.mas_equalTo(self.inputButton); + make.trailing.mas_equalTo(self.inputButton).offset(-4); make.width.height.mas_equalTo(36); }]; + + [self.inputLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerY.mas_equalTo(self.inputButton); + make.leading.mas_equalTo(self.inputButton).offset(8); + make.trailing.mas_equalTo(self.faceButton.mas_leading).offset(-4); + }]; [self.micButton mas_makeConstraints:^(MASConstraintMaker *make) { make.width.height.mas_equalTo(36); @@ -730,10 +738,10 @@ UIKIT_EXTERN NSString * kRoomBackMusicCaptureVolumeKey; - (UIButton *)inputButton { if (!_inputButton) { _inputButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_inputButton setTitle:YMLocalizedString(@"XPRoomMenuContainerView2") forState:UIControlStateNormal]; - [_inputButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; - _inputButton.titleLabel.font = [UIFont systemFontOfSize:13 weight:UIFontWeightMedium]; - _inputButton.titleLabel.numberOfLines = 2; +// [_inputButton setTitle:YMLocalizedString(@"XPRoomMenuContainerView2") forState:UIControlStateNormal]; +// [_inputButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; +// _inputButton.titleLabel.font = [UIFont systemFontOfSize:13 weight:UIFontWeightMedium]; +// _inputButton.titleLabel.numberOfLines = 2; _inputButton.layer.masksToBounds = YES; _inputButton.layer.cornerRadius = 18; if (isMSRTL()) { @@ -750,6 +758,18 @@ UIKIT_EXTERN NSString * kRoomBackMusicCaptureVolumeKey; return _inputButton; } +- (UILabel *)inputLabel { + if (!_inputLabel) { + _inputLabel = [UILabel labelInitWithText:YMLocalizedString(@"XPRoomMenuContainerView2") + font:kFontMedium(13) + textColor:[UIColor whiteColor]]; + _inputLabel.adjustsFontSizeToFitWidth = YES; + _inputLabel.minimumScaleFactor = 0.7; + _inputLabel.numberOfLines = 2; + } + return _inputLabel; +} + - (UIButton *)micButton { if (!_micButton) { _micButton = [UIButton buttonWithType:UIButtonTypeCustom]; diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/View/RoomCahtCell.m b/YuMi/Modules/YMRoom/View/MessageContainerView/View/RoomCahtCell.m index dca96ddb..4bd74856 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/View/RoomCahtCell.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/View/RoomCahtCell.m @@ -42,11 +42,6 @@ static NSString *MessageCellID = @"MessageCell"; return self; } -//TODO: -//修改 messageInfo 的组装流程,获取到消息后,先放入处理队列-1。 -// 队列-1 会按顺序处理消息,并预下载图片,所有图片下载完成后,用 cache 图片生成富文本,并放入队列-2 -// 队列-2 会按顺序计算富文本的 size,并插入到需要显示的消息队列中,并将 size 传递到外部 - #pragma mark - 配置数据 - (void)setMessageInfo:(XPMessageInfoModel *)messageInfo { _messageInfo = messageInfo; diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/View/CountdownRingView.m b/YuMi/Modules/YMRoom/View/SendGiftView/View/CountdownRingView.m index e8a6c7d8..d991e01d 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/View/CountdownRingView.m +++ b/YuMi/Modules/YMRoom/View/SendGiftView/View/CountdownRingView.m @@ -109,9 +109,6 @@ self.remainingTime -= 0.1; if (self.remainingTime <= 0) { - - // TODO: 这里的timer 只负责动画,manager 处增加处理逻辑的 timer - [self.timer invalidate]; self.timer = nil; diff --git a/YuMi/Modules/YMRoom/View/UserCard/View/Custom19MicLayout.h b/YuMi/Modules/YMRoom/View/UserCard/View/Custom19MicLayout.h new file mode 100644 index 00000000..8822a177 --- /dev/null +++ b/YuMi/Modules/YMRoom/View/UserCard/View/Custom19MicLayout.h @@ -0,0 +1,19 @@ +// +// Custom19MicLayout.h +// YuMi +// +// Created by P on 2024/12/11. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +/// 19麦位自定义布局 +@interface Custom19MicLayout : UICollectionViewLayout + +@property (nonatomic, strong) NSMutableArray *attributesArray; + +@end + +NS_ASSUME_NONNULL_END \ No newline at end of file diff --git a/YuMi/Modules/YMRoom/View/UserCard/View/Custom19MicLayout.m b/YuMi/Modules/YMRoom/View/UserCard/View/Custom19MicLayout.m new file mode 100644 index 00000000..d8490b1d --- /dev/null +++ b/YuMi/Modules/YMRoom/View/UserCard/View/Custom19MicLayout.m @@ -0,0 +1,77 @@ +// +// Custom19MicLayout.m +// YuMi +// +// Created by P on 2024/12/11. +// + +#import "Custom19MicLayout.h" + +@implementation Custom19MicLayout + +- (void)prepareLayout { + [super prepareLayout]; + + self.attributesArray = [NSMutableArray array]; + + CGFloat collectionWidth = self.collectionView.bounds.size.width; + CGFloat itemWidth = 50.0; // 每个 item 的宽度 + CGFloat itemHeight = 50.0 + 4 + 17; // 每个 item 的高度 + CGFloat spacing = 20.0; // 每个 item 之间的水平间距 + CGFloat rowSpacing = 20.0; // 每行之间的垂直间距 + CGFloat yOffset = 0; + + // 预定义每行的元素布局规则 + NSArray *> *layoutRows = @[ + @[@1, @1, @1, @1, @1], // 第 1 行: 居中排列 5 个元素 + @[@1, @1, @1, @1, @1], // 第 2 行: 两边元素对称排列 +// @[@0, @0, @1], // 第 3 行: 居中 1 个元素 + @[@1, @1, @0, @1, @1], // 第 4 行: 两边对称排列 + @[@1, @1, @1, @1, @1] // 第 5 行: 居中排列 5 个元素 + ]; + + NSInteger itemIndex = 0; // 当前 item 索引 + + for (NSArray *row in layoutRows) { + // 计算当前行的总宽度 + NSInteger itemCount = row.count; + CGFloat totalItemWidth = itemCount * itemWidth + (itemCount - 1) * spacing; + + // 计算行的 xOffset 让内容整体居中 + CGFloat xOffset = (collectionWidth - totalItemWidth) / 2.0; + + for (NSNumber *isItem in row) { + if ([isItem boolValue]) { // 如果该位置有 item + NSIndexPath *indexPath = [NSIndexPath indexPathForItem:itemIndex inSection:0]; + UICollectionViewLayoutAttributes *attributes = [UICollectionViewLayoutAttributes layoutAttributesForCellWithIndexPath:indexPath]; + if (itemIndex == 7) { + // 中央特殊处理 + attributes.frame = CGRectMake(xOffset-(itemWidth * 0.1), yOffset+itemWidth*2/3, itemWidth*1.2, itemHeight*1.2); + [self.attributesArray addObject:attributes]; + } else { + // 设置每个 item 的位置 + attributes.frame = CGRectMake(xOffset, yOffset, itemWidth, itemHeight); + [self.attributesArray addObject:attributes]; + } + // 更新 item 索引 + itemIndex++; + } + + // 更新 xOffset,无论是否有 item 都需要移动 + xOffset += itemWidth + spacing; + } + + // 每一行的 yOffset 往下移动 + yOffset += itemHeight + rowSpacing; + } +} + +- (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect { + return self.attributesArray; +} + +- (CGSize)collectionViewContentSize { + return CGSizeMake(self.collectionView.bounds.size.width, 400); // 设置总内容高度 +} + +@end \ No newline at end of file diff --git a/YuMi/Modules/YMRoom/View/UserCard/View/Custom9MicLayout.h b/YuMi/Modules/YMRoom/View/UserCard/View/Custom9MicLayout.h new file mode 100644 index 00000000..514159a8 --- /dev/null +++ b/YuMi/Modules/YMRoom/View/UserCard/View/Custom9MicLayout.h @@ -0,0 +1,19 @@ +// +// Custom9MicLayout.h +// YuMi +// +// Created by P on 2024/12/11. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +/// 9麦位自定义布局 +@interface Custom9MicLayout : UICollectionViewLayout + +@property (nonatomic, strong) NSMutableArray *attributesArray; + +@end + +NS_ASSUME_NONNULL_END \ No newline at end of file diff --git a/YuMi/Modules/YMRoom/View/UserCard/View/Custom9MicLayout.m b/YuMi/Modules/YMRoom/View/UserCard/View/Custom9MicLayout.m new file mode 100644 index 00000000..37d857fb --- /dev/null +++ b/YuMi/Modules/YMRoom/View/UserCard/View/Custom9MicLayout.m @@ -0,0 +1,59 @@ +// +// Custom9MicLayout.m +// YuMi +// +// Created by P on 2024/12/11. +// + +#import "Custom9MicLayout.h" + +@implementation Custom9MicLayout + +- (void)prepareLayout { + [super prepareLayout]; + + self.attributesArray = [NSMutableArray array]; + + NSInteger sectionCount = [self.collectionView numberOfSections]; + CGFloat collectionWidth = self.collectionView.bounds.size.width; + CGFloat itemWidth = 50.0; // 每个 item 的宽度 + CGFloat itemHeight = 50.0 + 4 + 17; // 每个 item 的高度 + CGFloat spacing = 48.0; // 每个 item 之间的间距 + + CGFloat yOffset = 0; + + for (NSInteger section = 0; section < sectionCount; section++) { + NSInteger itemCount = [self.collectionView numberOfItemsInSection:section]; + + // 计算当前行的总宽度 = 所有 items 宽度 + 间距 + CGFloat totalItemWidth = itemCount * itemWidth + (itemCount - 1) * spacing; + + // 计算这一行的起始 xOffset,让内容整体居中 + CGFloat xOffset = (collectionWidth - totalItemWidth) / 2.0; + + for (NSInteger item = 0; item < itemCount; item++) { + NSIndexPath *indexPath = [NSIndexPath indexPathForItem:item inSection:section]; + UICollectionViewLayoutAttributes *attributes = [UICollectionViewLayoutAttributes layoutAttributesForCellWithIndexPath:indexPath]; + + // 设置每个 item 的位置 + attributes.frame = CGRectMake(xOffset, yOffset, itemWidth, itemHeight); + [self.attributesArray addObject:attributes]; + + // 更新 xOffset,给下一个 item 使用 + xOffset += itemWidth + spacing; + } + + // 每一行的 yOffset 往下移动 + yOffset += itemHeight + 20; // 每行之间的间距为 20 + } +} + +- (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect { + return self.attributesArray; +} + +- (CGSize)collectionViewContentSize { + return CGSizeMake(self.collectionView.bounds.size.width, 400); // 设置总内容高度 +} + +@end \ No newline at end of file diff --git a/YuMi/Modules/YMRoom/View/UserCard/View/UserRoomCardViewController.m b/YuMi/Modules/YMRoom/View/UserCard/View/UserRoomCardViewController.m index 5dfbc2d2..d8bf8969 100644 --- a/YuMi/Modules/YMRoom/View/UserCard/View/UserRoomCardViewController.m +++ b/YuMi/Modules/YMRoom/View/UserCard/View/UserRoomCardViewController.m @@ -29,380 +29,10 @@ #import "SuperBlockViewController.h" #import "XPSkillCardPlayerManager.h" -@interface Custom19MicLayout : UICollectionViewLayout - -@property (nonatomic, strong) NSMutableArray *attributesArray; - -@end - -@implementation Custom19MicLayout - -- (void)prepareLayout { - [super prepareLayout]; - - self.attributesArray = [NSMutableArray array]; - - CGFloat collectionWidth = self.collectionView.bounds.size.width; - CGFloat itemWidth = 50.0; // 每个 item 的宽度 - CGFloat itemHeight = 50.0 + 4 + 17; // 每个 item 的高度 - CGFloat spacing = 20.0; // 每个 item 之间的水平间距 - CGFloat rowSpacing = 20.0; // 每行之间的垂直间距 - CGFloat yOffset = 0; - - // 预定义每行的元素布局规则 - NSArray *> *layoutRows = @[ - @[@1, @1, @1, @1, @1], // 第 1 行: 居中排列 5 个元素 - @[@1, @1, @1, @1, @1], // 第 2 行: 两边元素对称排列 -// @[@0, @0, @1], // 第 3 行: 居中 1 个元素 - @[@1, @1, @0, @1, @1], // 第 4 行: 两边对称排列 - @[@1, @1, @1, @1, @1] // 第 5 行: 居中排列 5 个元素 - ]; - - NSInteger itemIndex = 0; // 当前 item 索引 - - for (NSArray *row in layoutRows) { - // 计算当前行的总宽度 - NSInteger itemCount = row.count; - CGFloat totalItemWidth = itemCount * itemWidth + (itemCount - 1) * spacing; - - // 计算行的 xOffset 让内容整体居中 - CGFloat xOffset = (collectionWidth - totalItemWidth) / 2.0; - - for (NSNumber *isItem in row) { - if ([isItem boolValue]) { // 如果该位置有 item - NSIndexPath *indexPath = [NSIndexPath indexPathForItem:itemIndex inSection:0]; - UICollectionViewLayoutAttributes *attributes = [UICollectionViewLayoutAttributes layoutAttributesForCellWithIndexPath:indexPath]; - if (itemIndex == 7) { - // 中央特殊处理 - attributes.frame = CGRectMake(xOffset-(itemWidth * 0.1), yOffset+itemWidth*2/3, itemWidth*1.2, itemHeight*1.2); - [self.attributesArray addObject:attributes]; - } else { - // 设置每个 item 的位置 - attributes.frame = CGRectMake(xOffset, yOffset, itemWidth, itemHeight); - [self.attributesArray addObject:attributes]; - } - // 更新 item 索引 - itemIndex++; - } - - // 更新 xOffset,无论是否有 item 都需要移动 - xOffset += itemWidth + spacing; - } - - // 每一行的 yOffset 往下移动 - yOffset += itemHeight + rowSpacing; - } -} - -- (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect { - return self.attributesArray; -} - -- (CGSize)collectionViewContentSize { - return CGSizeMake(self.collectionView.bounds.size.width, 400); // 设置总内容高度 -} - -@end - - -@interface Custom9MicLayout : UICollectionViewLayout - -@property (nonatomic, strong) NSMutableArray *attributesArray; - -@end - -@implementation Custom9MicLayout - -- (void)prepareLayout { - [super prepareLayout]; - - self.attributesArray = [NSMutableArray array]; - - NSInteger sectionCount = [self.collectionView numberOfSections]; - CGFloat collectionWidth = self.collectionView.bounds.size.width; - CGFloat itemWidth = 50.0; // 每个 item 的宽度 - CGFloat itemHeight = 50.0 + 4 + 17; // 每个 item 的高度 - CGFloat spacing = 48.0; // 每个 item 之间的间距 - -// CGFloat xOffset = 0; - CGFloat yOffset = 0; - - for (NSInteger section = 0; section < sectionCount; section++) { - NSInteger itemCount = [self.collectionView numberOfItemsInSection:section]; - - // 计算当前行的总宽度 = 所有 items 宽度 + 间距 - CGFloat totalItemWidth = itemCount * itemWidth + (itemCount - 1) * spacing; - - // 计算这一行的起始 xOffset,让内容整体居中 - CGFloat xOffset = (collectionWidth - totalItemWidth) / 2.0; - - for (NSInteger item = 0; item < itemCount; item++) { - NSIndexPath *indexPath = [NSIndexPath indexPathForItem:item inSection:section]; - UICollectionViewLayoutAttributes *attributes = [UICollectionViewLayoutAttributes layoutAttributesForCellWithIndexPath:indexPath]; - - // 设置每个 item 的位置 - attributes.frame = CGRectMake(xOffset, yOffset, itemWidth, itemHeight); - [self.attributesArray addObject:attributes]; - - // 更新 xOffset,给下一个 item 使用 - xOffset += itemWidth + spacing; - } - - // 每一行的 yOffset 往下移动 - yOffset += itemHeight + 20; // 每行之间的间距为 20 - - } -} - -- (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect { - return self.attributesArray; -} - -- (CGSize)collectionViewContentSize { - return CGSizeMake(self.collectionView.bounds.size.width, 400); // 设置总内容高度 -} - -@end - -@interface UserRoomMicPositionCell : UICollectionViewCell - -@property(nonatomic, strong) UIImageView *iconImageView; -@property(nonatomic, strong) UILabel *contentLabel; -@property(nonatomic, assign) BOOL isUsed; -@property(nonatomic, strong) XPUserCardItemModel *cellModel; - -@end - -@implementation UserRoomMicPositionCell - -- (instancetype)initWithFrame:(CGRect)frame{ - if (self = [super initWithFrame:frame]) { - [self.contentView addSubview:self.iconImageView]; - [self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.leading.trailing.mas_equalTo(self.contentView); - make.height.mas_equalTo(self.iconImageView.mas_width); - }]; - - [self.contentView addSubview:self.contentLabel]; - [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(self.iconImageView.mas_bottom).offset(4); - make.bottom.mas_equalTo(self.contentView); - make.centerX.mas_equalTo(self.contentView); - }]; - } - return self; -} - -- (void)setCellModel:(XPUserCardItemModel *)cellModel { - _cellModel = cellModel; - self.iconImageView.image = kImage(cellModel.imageName); - self.contentLabel.text = cellModel.title; -} - -#pragma mark - -- (UIImageView *)iconImageView { - if (!_iconImageView) { - _iconImageView = [[UIImageView alloc] initWithImage:kImage(@"room_user_position_empty")]; - } - return _iconImageView; -} - -- (UILabel *)contentLabel { - if (!_contentLabel) { - _contentLabel = [UILabel labelInitWithText:@"" font:kFontRegular(12) textColor:[UIColor whiteColor]]; - } - return _contentLabel; -} - -@end - -@interface UserRoomMicPositionView : UIView - -@property(nonatomic, strong) UILabel *titleLabel; -@property(nonatomic, strong) UIButton *comfirmButton; -@property(nonatomic, copy) NSArray *dataSource; -@property(nonatomic, strong) UICollectionView *collectionView; -@property(nonatomic, copy) void(^handleTapPosition)(XPUserCardItemModel *model); -@property(nonatomic, copy) void(^handleDismiss)(void); - -@end - -@implementation UserRoomMicPositionView - -- (void)dealloc -{ - if (self.handleDismiss) { - self.handleDismiss(); - } -} - -- (instancetype)initWithFrame:(CGRect)frame { - if (self = [super initWithFrame:frame]) { - self.backgroundColor = [UIColor blackColor]; - [self setCornerRadius:16 cornerMask:kCALayerMinXMinYCorner | kCALayerMaxXMinYCorner]; - - [self addSubview:self.titleLabel]; - [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerX.mas_equalTo(self); - make.top.mas_equalTo(15); - make.height.mas_equalTo(22); - }]; - - [self addSubview:self.comfirmButton]; - [self.comfirmButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerY.mas_equalTo(self.titleLabel); - make.trailing.mas_equalTo(-15); - make.size.mas_equalTo(CGSizeMake(48, 44)); - }]; - - [self addSubview:self.collectionView]; - [self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(20); - make.leading.bottom.trailing.mas_equalTo(self); - }]; - } - return self; -} - -- (void)setDataSource:(NSArray *)dataSource { - _dataSource = dataSource; - if (dataSource.count == 9) { - Custom9MicLayout *customLayout = [[Custom9MicLayout alloc] init]; - self.collectionView.collectionViewLayout = customLayout; - } else if (dataSource.count == 19) { - Custom19MicLayout *customLayout = [[Custom19MicLayout alloc] init]; - self.collectionView.collectionViewLayout = customLayout; - } - [self.collectionView reloadData]; -} - -#pragma mark - -- (void)didTapComfirm { - CGRect r = CGRectMake(0, KScreenHeight, self.frame.size.width, self.frame.size.height); - [UIView animateWithDuration:0.25 animations:^{ - self.frame = r; - } completion:^(BOOL finished) { - [self removeFromSuperview]; - if (self.handleDismiss) { - self.handleDismiss(); - } - }]; -} - -#pragma mark - -- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView { - if (self.dataSource.count == 9) { - return 3; - } - return 1; -} -- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { - if (self.dataSource.count == 9) { - switch (section) { - case 0: - return 1; - break; - case 1: - return 4; - break; - case 2: - return 4; - break; - default: - break; - } - } - return self.dataSource.count; -} - -- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { - UserRoomMicPositionCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"UserRoomMicPositionCell" - forIndexPath:indexPath]; - if (self.dataSource.count == 9) { - switch (indexPath.section) { - case 0: - cell.cellModel = [self.dataSource xpSafeObjectAtIndex:indexPath.row]; - break; - case 1: - cell.cellModel = [self.dataSource xpSafeObjectAtIndex:indexPath.row+1]; - break; - case 2: - cell.cellModel = [self.dataSource xpSafeObjectAtIndex:indexPath.row+5]; - break; - default: - break; - } - } else { - cell.cellModel = [self.dataSource xpSafeObjectAtIndex:indexPath.row]; - } - - return cell; -} - -- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { - if (_handleTapPosition) { - if (self.dataSource.count == 9) { - switch (indexPath.section) { - case 0: - self.handleTapPosition([self.dataSource xpSafeObjectAtIndex:indexPath.row]); - break; - case 1: - self.handleTapPosition([self.dataSource xpSafeObjectAtIndex:indexPath.row+1]); - break; - case 2: - self.handleTapPosition([self.dataSource xpSafeObjectAtIndex:indexPath.row+5]); - break; - default: - break; - } - } else if (self.dataSource.count == 19) { - self.handleTapPosition([self.dataSource xpSafeObjectAtIndex:indexPath.row]); - } else { - self.handleTapPosition([self.dataSource xpSafeObjectAtIndex:indexPath.row]); - } - } - [self removeFromSuperview]; -} - -#pragma mark - -- (UICollectionView *)collectionView { - if (!_collectionView) { - UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; - layout.itemSize = CGSizeMake(50, 50 + 4 + 17); - layout.minimumLineSpacing = 14; - layout.minimumInteritemSpacing = 23; - layout.sectionInset = UIEdgeInsetsMake(0, 15, kSafeAreaBottomHeight, 15); - _collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout]; - _collectionView.delegate = self; - _collectionView.dataSource = self; - _collectionView.backgroundColor = [UIColor clearColor]; - [_collectionView registerClass:[UserRoomMicPositionCell class] forCellWithReuseIdentifier:@"UserRoomMicPositionCell"]; - } - return _collectionView; -} - -- (UILabel *)titleLabel { - if (!_titleLabel) { - _titleLabel = [UILabel labelInitWithText:YMLocalizedString(@"1.0.31_text_4") - font:kFontSemibold(16) - textColor:[UIColor whiteColor]]; - } - return _titleLabel; -} - -- (UIButton *)comfirmButton { - if (!_comfirmButton) { - _comfirmButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_comfirmButton setTitleColor:UIColorFromRGB(0xFF8C03) forState:UIControlStateNormal]; - [_comfirmButton setTitle:YMLocalizedString(@"TTAlertConfig0") forState:UIControlStateNormal]; - [_comfirmButton addTarget:self - action:@selector(didTapComfirm) - forControlEvents:UIControlEventTouchUpInside]; - } - return _comfirmButton; -} - -@end +// 导入自定义布局和视图 +#import "Custom19MicLayout.h" +#import "Custom9MicLayout.h" +#import "UserRoomMicPositionView.h" @interface UserRoomCardInfoCell : UICollectionViewCell @property(nonatomic, copy) void(^tapReport)(void); @@ -1071,6 +701,12 @@ - (void)dealloc { [XNDJTDDLoadingTool hideHUD]; + + // 停止并清理 topMP4View 资源 + if (_topMP4View) { + [_topMP4View stopHWDMP4]; + _topMP4View = nil; + } } - (instancetype)initWithUser:(XPUserCardInfoModel *)cardInfo controlUser:(nonnull UserInfoModel *)meInfo { diff --git a/YuMi/Modules/YMRoom/View/UserCard/View/UserRoomMicPositionCell.h b/YuMi/Modules/YMRoom/View/UserCard/View/UserRoomMicPositionCell.h new file mode 100644 index 00000000..eb0a14a9 --- /dev/null +++ b/YuMi/Modules/YMRoom/View/UserCard/View/UserRoomMicPositionCell.h @@ -0,0 +1,23 @@ +// +// UserRoomMicPositionCell.h +// YuMi +// +// Created by P on 2024/12/11. +// + +#import +#import "XPUserCardItemModel.h" + +NS_ASSUME_NONNULL_BEGIN + +/// 房间麦位选择 Cell +@interface UserRoomMicPositionCell : UICollectionViewCell + +@property(nonatomic, strong) UIImageView *iconImageView; +@property(nonatomic, strong) UILabel *contentLabel; +@property(nonatomic, assign) BOOL isUsed; +@property(nonatomic, strong) XPUserCardItemModel *cellModel; + +@end + +NS_ASSUME_NONNULL_END \ No newline at end of file diff --git a/YuMi/Modules/YMRoom/View/UserCard/View/UserRoomMicPositionCell.m b/YuMi/Modules/YMRoom/View/UserCard/View/UserRoomMicPositionCell.m new file mode 100644 index 00000000..2e431566 --- /dev/null +++ b/YuMi/Modules/YMRoom/View/UserCard/View/UserRoomMicPositionCell.m @@ -0,0 +1,51 @@ +// +// UserRoomMicPositionCell.m +// YuMi +// +// Created by P on 2024/12/11. +// + +#import "UserRoomMicPositionCell.h" + +@implementation UserRoomMicPositionCell + +- (instancetype)initWithFrame:(CGRect)frame{ + if (self = [super initWithFrame:frame]) { + [self.contentView addSubview:self.iconImageView]; + [self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.leading.trailing.mas_equalTo(self.contentView); + make.height.mas_equalTo(self.iconImageView.mas_width); + }]; + + [self.contentView addSubview:self.contentLabel]; + [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.iconImageView.mas_bottom).offset(4); + make.bottom.mas_equalTo(self.contentView); + make.centerX.mas_equalTo(self.contentView); + }]; + } + return self; +} + +- (void)setCellModel:(XPUserCardItemModel *)cellModel { + _cellModel = cellModel; + self.iconImageView.image = kImage(cellModel.imageName); + self.contentLabel.text = cellModel.title; +} + +#pragma mark - +- (UIImageView *)iconImageView { + if (!_iconImageView) { + _iconImageView = [[UIImageView alloc] initWithImage:kImage(@"room_user_position_empty")]; + } + return _iconImageView; +} + +- (UILabel *)contentLabel { + if (!_contentLabel) { + _contentLabel = [UILabel labelInitWithText:@"" font:kFontRegular(12) textColor:[UIColor whiteColor]]; + } + return _contentLabel; +} + +@end diff --git a/YuMi/Modules/YMRoom/View/UserCard/View/UserRoomMicPositionView.h b/YuMi/Modules/YMRoom/View/UserCard/View/UserRoomMicPositionView.h new file mode 100644 index 00000000..25d52d11 --- /dev/null +++ b/YuMi/Modules/YMRoom/View/UserCard/View/UserRoomMicPositionView.h @@ -0,0 +1,25 @@ +// +// UserRoomMicPositionView.h +// YuMi +// +// Created by P on 2024/12/11. +// + +#import +#import "XPUserCardItemModel.h" + +NS_ASSUME_NONNULL_BEGIN + +/// 房间麦位选择视图 +@interface UserRoomMicPositionView : UIView + +@property(nonatomic, strong) UILabel *titleLabel; +@property(nonatomic, strong) UIButton *comfirmButton; +@property(nonatomic, copy) NSArray *dataSource; +@property(nonatomic, strong) UICollectionView *collectionView; +@property(nonatomic, copy) void(^handleTapPosition)(XPUserCardItemModel *model); +@property(nonatomic, copy) void(^handleDismiss)(void); + +@end + +NS_ASSUME_NONNULL_END \ No newline at end of file diff --git a/YuMi/Modules/YMRoom/View/UserCard/View/UserRoomMicPositionView.m b/YuMi/Modules/YMRoom/View/UserCard/View/UserRoomMicPositionView.m new file mode 100644 index 00000000..a5dd8599 --- /dev/null +++ b/YuMi/Modules/YMRoom/View/UserCard/View/UserRoomMicPositionView.m @@ -0,0 +1,189 @@ +// +// UserRoomMicPositionView.m +// YuMi +// +// Created by P on 2024/12/11. +// + +#import "UserRoomMicPositionView.h" +#import "UserRoomMicPositionCell.h" +#import "Custom9MicLayout.h" +#import "Custom19MicLayout.h" + +@implementation UserRoomMicPositionView + +- (void)dealloc +{ + if (self.handleDismiss) { + self.handleDismiss(); + } +} + +- (instancetype)initWithFrame:(CGRect)frame { + if (self = [super initWithFrame:frame]) { + self.backgroundColor = [UIColor blackColor]; + [self setCornerRadius:16 cornerMask:kCALayerMinXMinYCorner | kCALayerMaxXMinYCorner]; + + [self addSubview:self.titleLabel]; + [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.mas_equalTo(self); + make.top.mas_equalTo(15); + make.height.mas_equalTo(22); + }]; + + [self addSubview:self.comfirmButton]; + [self.comfirmButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerY.mas_equalTo(self.titleLabel); + make.trailing.mas_equalTo(-15); + make.size.mas_equalTo(CGSizeMake(48, 44)); + }]; + + [self addSubview:self.collectionView]; + [self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(20); + make.leading.bottom.trailing.mas_equalTo(self); + }]; + } + return self; +} + +- (void)setDataSource:(NSArray *)dataSource { + _dataSource = dataSource; + if (dataSource.count == 9) { + Custom9MicLayout *customLayout = [[Custom9MicLayout alloc] init]; + self.collectionView.collectionViewLayout = customLayout; + } else if (dataSource.count == 19) { + Custom19MicLayout *customLayout = [[Custom19MicLayout alloc] init]; + self.collectionView.collectionViewLayout = customLayout; + } + [self.collectionView reloadData]; +} + +#pragma mark - +- (void)didTapComfirm { + CGRect r = CGRectMake(0, KScreenHeight, self.frame.size.width, self.frame.size.height); + [UIView animateWithDuration:0.25 animations:^{ + self.frame = r; + } completion:^(BOOL finished) { + [self removeFromSuperview]; + if (self.handleDismiss) { + self.handleDismiss(); + } + }]; +} + +#pragma mark - UICollectionViewDataSource +- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView { + if (self.dataSource.count == 9) { + return 3; + } + return 1; +} + +- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { + if (self.dataSource.count == 9) { + switch (section) { + case 0: + return 1; + break; + case 1: + return 4; + break; + case 2: + return 4; + break; + default: + break; + } + } + return self.dataSource.count; +} + +- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { + UserRoomMicPositionCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"UserRoomMicPositionCell" + forIndexPath:indexPath]; + if (self.dataSource.count == 9) { + switch (indexPath.section) { + case 0: + cell.cellModel = [self.dataSource xpSafeObjectAtIndex:indexPath.row]; + break; + case 1: + cell.cellModel = [self.dataSource xpSafeObjectAtIndex:indexPath.row+1]; + break; + case 2: + cell.cellModel = [self.dataSource xpSafeObjectAtIndex:indexPath.row+5]; + break; + default: + break; + } + } else { + cell.cellModel = [self.dataSource xpSafeObjectAtIndex:indexPath.row]; + } + + return cell; +} + +- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { + if (_handleTapPosition) { + if (self.dataSource.count == 9) { + switch (indexPath.section) { + case 0: + self.handleTapPosition([self.dataSource xpSafeObjectAtIndex:indexPath.row]); + break; + case 1: + self.handleTapPosition([self.dataSource xpSafeObjectAtIndex:indexPath.row+1]); + break; + case 2: + self.handleTapPosition([self.dataSource xpSafeObjectAtIndex:indexPath.row+5]); + break; + default: + break; + } + } else if (self.dataSource.count == 19) { + self.handleTapPosition([self.dataSource xpSafeObjectAtIndex:indexPath.row]); + } else { + self.handleTapPosition([self.dataSource xpSafeObjectAtIndex:indexPath.row]); + } + } + [self removeFromSuperview]; +} + +#pragma mark - Getters +- (UICollectionView *)collectionView { + if (!_collectionView) { + UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; + layout.itemSize = CGSizeMake(50, 50 + 4 + 17); + layout.minimumLineSpacing = 14; + layout.minimumInteritemSpacing = 23; + layout.sectionInset = UIEdgeInsetsMake(0, 15, kSafeAreaBottomHeight, 15); + _collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout]; + _collectionView.delegate = self; + _collectionView.dataSource = self; + _collectionView.backgroundColor = [UIColor clearColor]; + [_collectionView registerClass:[UserRoomMicPositionCell class] forCellWithReuseIdentifier:@"UserRoomMicPositionCell"]; + } + return _collectionView; +} + +- (UILabel *)titleLabel { + if (!_titleLabel) { + _titleLabel = [UILabel labelInitWithText:YMLocalizedString(@"1.0.31_text_4") + font:kFontSemibold(16) + textColor:[UIColor whiteColor]]; + } + return _titleLabel; +} + +- (UIButton *)comfirmButton { + if (!_comfirmButton) { + _comfirmButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_comfirmButton setTitleColor:UIColorFromRGB(0xFF8C03) forState:UIControlStateNormal]; + [_comfirmButton setTitle:YMLocalizedString(@"TTAlertConfig0") forState:UIControlStateNormal]; + [_comfirmButton addTarget:self + action:@selector(didTapComfirm) + forControlEvents:UIControlEventTouchUpInside]; + } + return _comfirmButton; +} + +@end diff --git a/YuMi/Modules/YMRoom/View/XPMiniRoomView.m b/YuMi/Modules/YMRoom/View/XPMiniRoomView.m index 579c3f84..5571fa5b 100644 --- a/YuMi/Modules/YMRoom/View/XPMiniRoomView.m +++ b/YuMi/Modules/YMRoom/View/XPMiniRoomView.m @@ -484,7 +484,7 @@ UIKIT_EXTERN NSString *kRoomKickoutTime; NSMutableDictionary *lastRoomInfoDic = [NSMutableDictionary dictionaryWithDictionary:[self.roomInfo model2dictionary]]; [lastRoomInfoDic addEntriesFromDictionary: ((NSString *)data[@"roomInfo"]).toJSONObject]; RoomInfoModel *newRoomInfo = [RoomInfoModel modelWithJSON:lastRoomInfoDic]; - //TODO: 从小游戏房间切换到普通房间的话 mgid不会被清除掉 + if (newRoomInfo.type != RoomType_MiniGame) { newRoomInfo.mgId = 0; } diff --git a/YuMi/Modules/YMRoom/View/XPRoomViewController.m b/YuMi/Modules/YMRoom/View/XPRoomViewController.m index 355e0098..fe32692f 100644 --- a/YuMi/Modules/YMRoom/View/XPRoomViewController.m +++ b/YuMi/Modules/YMRoom/View/XPRoomViewController.m @@ -1881,7 +1881,7 @@ XPCandyTreeInsufficientBalanceViewDelegate> NSMutableDictionary *lastRoomInfoDic = [NSMutableDictionary dictionaryWithDictionary:[self.roomInfo model2dictionary]]; [lastRoomInfoDic addEntriesFromDictionary: ((NSString *)data[@"roomInfo"]).toJSONObject]; RoomInfoModel *newRoomInfo = [RoomInfoModel modelWithJSON:lastRoomInfoDic]; - //TODO: 从小游戏房间切换到普通房间的话 mgid不会被清除掉 + if (newRoomInfo.type != RoomType_MiniGame) { newRoomInfo.mgId = 0; } diff --git a/YuMi/ar.lproj/Localizable.strings b/YuMi/ar.lproj/Localizable.strings index fff7d5b2..0fdf0a19 100644 --- a/YuMi/ar.lproj/Localizable.strings +++ b/YuMi/ar.lproj/Localizable.strings @@ -4178,7 +4178,7 @@ ineHeadView12" = "الحمل"; "20.20.59_text_7" = " شارك"; "20.20.59_text_8" = "إنشاء الحدث"; "20.20.59_text_9" = "عنوان الحدث"; -"20.20.59_text_10" = "بنر الفعالية(Best size:690*236)"; +"20.20.59_text_10" = "بنر الفعاليةلافتة الحدث (الحجم الأمثل: 690*236)"; "20.20.59_text_11" = "رفع بنر إلى الصفحة الرئيسية(%@التكاليف )"; "20.20.59_text_12" = "نعم"; "20.20.59_text_13" = "لا "; diff --git a/YuMi/en.lproj/Localizable.strings b/YuMi/en.lproj/Localizable.strings index 72603dce..9c5305d6 100644 --- a/YuMi/en.lproj/Localizable.strings +++ b/YuMi/en.lproj/Localizable.strings @@ -3963,7 +3963,7 @@ "20.20.59_text_7" = " Participate"; "20.20.59_text_8" = "Create Event"; "20.20.59_text_9" = "Event Title"; -"20.20.59_text_10" = "Event Banner(Best size:690*236)"; +"20.20.59_text_10" = "Event Banner(Best size:690*236) "; "20.20.59_text_11" = "Upload Banner to Homepage(Costs %@)"; "20.20.59_text_12" = "YES"; "20.20.59_text_13" = "NO"; diff --git a/YuMi/tr.lproj/Localizable.strings b/YuMi/tr.lproj/Localizable.strings index 8c3ec017..979b46e5 100644 --- a/YuMi/tr.lproj/Localizable.strings +++ b/YuMi/tr.lproj/Localizable.strings @@ -3756,7 +3756,7 @@ "20.20.59_text_7" = " Katılmak"; "20.20.59_text_8" = "Etkinlik Oluştur"; "20.20.59_text_9" = "Etkinlik Başlığı"; -"20.20.59_text_10" = "Etkinlik Afişi(Best size:690*236)"; +"20.20.59_text_10" = "Etkinlik Banner'ı (En iyi boyut: 690*236)"; "20.20.59_text_11" = "Ana Sayfaya Banner Yükleyin(Maliyet %@)"; "20.20.59_text_12" = "Evet"; "20.20.59_text_13" = "Hayır"; diff --git a/YuMi/zh-Hant.lproj/Localizable.strings b/YuMi/zh-Hant.lproj/Localizable.strings index 180168c0..8a93b88b 100644 --- a/YuMi/zh-Hant.lproj/Localizable.strings +++ b/YuMi/zh-Hant.lproj/Localizable.strings @@ -3628,7 +3628,7 @@ "20.20.59_text_7" = " 參與活動"; "20.20.59_text_8" = "建立活動"; "20.20.59_text_9" = "活動標題"; -"20.20.59_text_10" = "活動橫幅(Best size:690*236)"; +"20.20.59_text_10" = "活動橫幅(最佳尺寸:690*236)"; "20.20.59_text_11" = "上傳橫幅至首頁(成本 %@)"; "20.20.59_text_12" = "有"; "20.20.59_text_13" = "無";