diff --git a/xplan-ios.xcodeproj/project.pbxproj b/xplan-ios.xcodeproj/project.pbxproj index a917f67a..36ede9e5 100644 --- a/xplan-ios.xcodeproj/project.pbxproj +++ b/xplan-ios.xcodeproj/project.pbxproj @@ -7,6 +7,9 @@ objects = { /* Begin PBXBuildFile section */ + 180806D827293794001FD836 /* NSObject+MJExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = 180806D727293794001FD836 /* NSObject+MJExtension.m */; }; + 181D7F1B2726CE2A00B7C059 /* StageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 181D7F1A2726CE2A00B7C059 /* StageView.m */; }; + 181D7F212727D9DB00B7C059 /* SocialStageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 181D7F202727D9DB00B7C059 /* SocialStageView.m */; }; 18486213271EA9DA005FC5DC /* RtcManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 18486212271EA9DA005FC5DC /* RtcManager.m */; }; 18486217271EAB8C005FC5DC /* BaseRtcImpl.m in Sources */ = {isa = PBXBuildFile; fileRef = 18486216271EAB8C005FC5DC /* BaseRtcImpl.m */; }; 18486235271EB794005FC5DC /* AgoraRtcImpl.m in Sources */ = {isa = PBXBuildFile; fileRef = 18486234271EB794005FC5DC /* AgoraRtcImpl.m */; }; @@ -107,7 +110,7 @@ E81C27A226EF23490031E639 /* XPEnum.h in Sources */ = {isa = PBXBuildFile; fileRef = E81C27A126EF23370031E639 /* XPEnum.h */; }; E81C27AB26EF2D920031E639 /* ThirdUserInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = E81C27AA26EF2D920031E639 /* ThirdUserInfo.m */; }; E81C27AE26EF39AB0031E639 /* AppDelegate+ThirdConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = E81C27AD26EF39AB0031E639 /* AppDelegate+ThirdConfig.m */; }; - E81D58822720082A003063FE /* XPRoomPositionItemSpeakingView.m in Sources */ = {isa = PBXBuildFile; fileRef = E81D58812720082A003063FE /* XPRoomPositionItemSpeakingView.m */; }; + E81D58822720082A003063FE /* MicroWaveView.m in Sources */ = {isa = PBXBuildFile; fileRef = E81D58812720082A003063FE /* MicroWaveView.m */; }; E82109AD26F1C8A000FC3319 /* CountDownHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = E82109AC26F1C8A000FC3319 /* CountDownHelper.m */; }; E82109B026F1D83500FC3319 /* LoginBindPhonePresent.m in Sources */ = {isa = PBXBuildFile; fileRef = E82109AF26F1D83500FC3319 /* LoginBindPhonePresent.m */; }; E824543526F57D6E00BE8163 /* XPLoginVerifBindPhoneViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E824543426F57D6E00BE8163 /* XPLoginVerifBindPhoneViewController.m */; }; @@ -139,11 +142,7 @@ E86596462701612D00846EBD /* UIImageView+Vague.m in Sources */ = {isa = PBXBuildFile; fileRef = E86596452701612D00846EBD /* UIImageView+Vague.m */; }; E86596512701A1C000846EBD /* StatisticsService.m in Sources */ = {isa = PBXBuildFile; fileRef = E86596502701A1C000846EBD /* StatisticsService.m */; }; E86596542701A55500846EBD /* StatisticsServiceHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = E86596532701A55500846EBD /* StatisticsServiceHelper.m */; }; - E868070A271959DB0024F48F /* XPRoomPositionView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8680709271959DB0024F48F /* XPRoomPositionView.m */; }; - E868070F27195DD30024F48F /* XPRoomPositionLayoutImpl.m in Sources */ = {isa = PBXBuildFile; fileRef = E868070E27195DD30024F48F /* XPRoomPositionLayoutImpl.m */; }; - E868071327195E1A0024F48F /* XPRoomPositionDelegateImpl.m in Sources */ = {isa = PBXBuildFile; fileRef = E868071227195E1A0024F48F /* XPRoomPositionDelegateImpl.m */; }; - E8680718271967B00024F48F /* XPRoomPostionBaseItemView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8680717271967B00024F48F /* XPRoomPostionBaseItemView.m */; }; - E868071B271969A50024F48F /* XCRoomPostionNickView.m in Sources */ = {isa = PBXBuildFile; fileRef = E868071A271969A50024F48F /* XCRoomPostionNickView.m */; }; + E8680718271967B00024F48F /* MicroView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8680717271967B00024F48F /* MicroView.m */; }; E872308926E89BE000B90D4F /* LoginPhoneViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E872308826E89BE000B90D4F /* LoginPhoneViewController.m */; }; E872308D26E89DAA00B90D4F /* LoginInputView.m in Sources */ = {isa = PBXBuildFile; fileRef = E872308C26E89DAA00B90D4F /* LoginInputView.m */; }; E872309326E8D31500B90D4F /* LoginVerifCodeView.m in Sources */ = {isa = PBXBuildFile; fileRef = E872309226E8D31500B90D4F /* LoginVerifCodeView.m */; }; @@ -151,11 +150,8 @@ E874B8782721438E003954B9 /* XPImRoomImpl.m in Sources */ = {isa = PBXBuildFile; fileRef = E874B8772721438E003954B9 /* XPImRoomImpl.m */; }; E874B87B27214882003954B9 /* XPIMRoomInterface.h in Sources */ = {isa = PBXBuildFile; fileRef = E874B879272143AD003954B9 /* XPIMRoomInterface.h */; }; E874B87C27214888003954B9 /* XPIMRoomDelegate.h in Sources */ = {isa = PBXBuildFile; fileRef = E874B87A272143C7003954B9 /* XPIMRoomDelegate.h */; }; - E874B880272158E7003954B9 /* XPIMRoomMicQueueImpl.m in Sources */ = {isa = PBXBuildFile; fileRef = E874B87F272158E7003954B9 /* XPIMRoomMicQueueImpl.m */; }; - E874B88327215B06003954B9 /* XPIMRoomMicQueueInterface.h in Sources */ = {isa = PBXBuildFile; fileRef = E874B881272158FA003954B9 /* XPIMRoomMicQueueInterface.h */; }; - E874B88427215B0E003954B9 /* XPIMRoomMicQueueDelegate.h in Sources */ = {isa = PBXBuildFile; fileRef = E874B8822721590D003954B9 /* XPIMRoomMicQueueDelegate.h */; }; - E874B88827215D39003954B9 /* MicroModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E874B88727215D39003954B9 /* MicroModel.m */; }; - E874B88B27215EAF003954B9 /* MicroQueueItemModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E874B88A27215EAF003954B9 /* MicroQueueItemModel.m */; }; + E874B88827215D39003954B9 /* MicroStateModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E874B88727215D39003954B9 /* MicroStateModel.m */; }; + E874B88B27215EAF003954B9 /* MicroQueueModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E874B88A27215EAF003954B9 /* MicroQueueModel.m */; }; E874B88F27216FFE003954B9 /* XPIMChatRoomMemberImpl.m in Sources */ = {isa = PBXBuildFile; fileRef = E874B88E27216FFE003954B9 /* XPIMChatRoomMemberImpl.m */; }; E874B8912721712B003954B9 /* XPIMChatRoomMemberInterface.h in Sources */ = {isa = PBXBuildFile; fileRef = E874B890272170A6003954B9 /* XPIMChatRoomMemberInterface.h */; }; E874B89527217DA6003954B9 /* XPIMChatRoomMessageImpl.m in Sources */ = {isa = PBXBuildFile; fileRef = E874B89427217DA6003954B9 /* XPIMChatRoomMessageImpl.m */; }; @@ -181,7 +177,6 @@ E89DA66727006443008483C1 /* RechargeStorage.m in Sources */ = {isa = PBXBuildFile; fileRef = E89DA66627006443008483C1 /* RechargeStorage.m */; }; E89DA67227008D59008483C1 /* WalletInfoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E89DA67127008D59008483C1 /* WalletInfoModel.m */; }; E89DA67527009ACD008483C1 /* XPMineRechargeNavView.m in Sources */ = {isa = PBXBuildFile; fileRef = E89DA67427009ACD008483C1 /* XPMineRechargeNavView.m */; }; - E89DA67827009F16008483C1 /* NSObject+JSONString.m in Sources */ = {isa = PBXBuildFile; fileRef = E89DA67727009F16008483C1 /* NSObject+JSONString.m */; }; E8AC720D26F435F5007D6E91 /* UIImageView+LoadImage.m in Sources */ = {isa = PBXBuildFile; fileRef = E8AC720C26F435F5007D6E91 /* UIImageView+LoadImage.m */; }; E8AC721026F43955007D6E91 /* UIImageConstant.m in Sources */ = {isa = PBXBuildFile; fileRef = E8AC720F26F43955007D6E91 /* UIImageConstant.m */; }; E8AC721326F46ADD007D6E91 /* XPMineSettingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8AC721226F46ADD007D6E91 /* XPMineSettingViewController.m */; }; @@ -205,9 +200,7 @@ E8AEAEED27141AE20017FCE0 /* XPRoomBackContainerView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8AEAEEC27141AE20017FCE0 /* XPRoomBackContainerView.m */; }; E8AEAEF027141C430017FCE0 /* XPRoomMenuContainerView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8AEAEEF27141C430017FCE0 /* XPRoomMenuContainerView.m */; }; E8AEAEF327141C7C0017FCE0 /* XPRoomMessageContainerView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8AEAEF227141C7C0017FCE0 /* XPRoomMessageContainerView.m */; }; - E8AEAEF627141C910017FCE0 /* XPRoomPositionContainView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8AEAEF527141C910017FCE0 /* XPRoomPositionContainView.m */; }; E8AEAEF927141CA30017FCE0 /* XPRoomInfoContainerView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8AEAEF827141CA30017FCE0 /* XPRoomInfoContainerView.m */; }; - E8B825B726E9A7D8009E8E9F /* BaseObject.m in Sources */ = {isa = PBXBuildFile; fileRef = E8B825B626E9A7D8009E8E9F /* BaseObject.m */; }; E8B825BF26E9E57D009E8E9F /* LoginTicketInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = E8B825BE26E9E57D009E8E9F /* LoginTicketInfo.m */; }; E8B825C226EA00DF009E8E9F /* LoginVerifCodePresent.m in Sources */ = {isa = PBXBuildFile; fileRef = E8B825C126EA00DF009E8E9F /* LoginVerifCodePresent.m */; }; E8B825C726EA0D9A009E8E9F /* LoginVerifCodeProtocol.h in Sources */ = {isa = PBXBuildFile; fileRef = E8B825C626EA0995009E8E9F /* LoginVerifCodeProtocol.h */; }; @@ -276,6 +269,14 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 180806D627293794001FD836 /* NSObject+MJExtension.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSObject+MJExtension.h"; sourceTree = ""; }; + 180806D727293794001FD836 /* NSObject+MJExtension.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSObject+MJExtension.m"; sourceTree = ""; }; + 180806DA27297269001FD836 /* MicroViewProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MicroViewProtocol.h; sourceTree = ""; }; + 181D7F192726CE2A00B7C059 /* StageView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = StageView.h; sourceTree = ""; }; + 181D7F1A2726CE2A00B7C059 /* StageView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = StageView.m; sourceTree = ""; }; + 181D7F1F2727D9DB00B7C059 /* SocialStageView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SocialStageView.h; sourceTree = ""; }; + 181D7F202727D9DB00B7C059 /* SocialStageView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SocialStageView.m; sourceTree = ""; }; + 181D7F222727DB1E00B7C059 /* RoomDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RoomDelegate.h; sourceTree = ""; }; 18486211271EA9DA005FC5DC /* RtcManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RtcManager.h; sourceTree = ""; }; 18486212271EA9DA005FC5DC /* RtcManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RtcManager.m; sourceTree = ""; }; 18486214271EAA03005FC5DC /* RtcDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RtcDelegate.h; sourceTree = ""; }; @@ -448,8 +449,8 @@ E81C27AC26EF39AB0031E639 /* AppDelegate+ThirdConfig.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "AppDelegate+ThirdConfig.h"; sourceTree = ""; }; E81C27AD26EF39AB0031E639 /* AppDelegate+ThirdConfig.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "AppDelegate+ThirdConfig.m"; sourceTree = ""; }; E81D587B271FBC3B003063FE /* RtcInterface.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RtcInterface.h; sourceTree = ""; }; - E81D58802720082A003063FE /* XPRoomPositionItemSpeakingView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomPositionItemSpeakingView.h; sourceTree = ""; }; - E81D58812720082A003063FE /* XPRoomPositionItemSpeakingView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomPositionItemSpeakingView.m; sourceTree = ""; }; + E81D58802720082A003063FE /* MicroWaveView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MicroWaveView.h; sourceTree = ""; }; + E81D58812720082A003063FE /* MicroWaveView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MicroWaveView.m; sourceTree = ""; }; E82109AB26F1C8A000FC3319 /* CountDownHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CountDownHelper.h; sourceTree = ""; }; E82109AC26F1C8A000FC3319 /* CountDownHelper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CountDownHelper.m; sourceTree = ""; }; E82109AE26F1D83500FC3319 /* LoginBindPhonePresent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LoginBindPhonePresent.h; sourceTree = ""; }; @@ -507,18 +508,8 @@ E86596502701A1C000846EBD /* StatisticsService.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = StatisticsService.m; sourceTree = ""; }; E86596522701A55500846EBD /* StatisticsServiceHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = StatisticsServiceHelper.h; sourceTree = ""; }; E86596532701A55500846EBD /* StatisticsServiceHelper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = StatisticsServiceHelper.m; sourceTree = ""; }; - E8680708271959DB0024F48F /* XPRoomPositionView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomPositionView.h; sourceTree = ""; }; - E8680709271959DB0024F48F /* XPRoomPositionView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomPositionView.m; sourceTree = ""; }; - E868070D27195DD30024F48F /* XPRoomPositionLayoutImpl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomPositionLayoutImpl.h; sourceTree = ""; }; - E868070E27195DD30024F48F /* XPRoomPositionLayoutImpl.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomPositionLayoutImpl.m; sourceTree = ""; }; - E868071027195DF00024F48F /* XPRoomPositionLayoutProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomPositionLayoutProtocol.h; sourceTree = ""; }; - E868071127195E1A0024F48F /* XPRoomPositionDelegateImpl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomPositionDelegateImpl.h; sourceTree = ""; }; - E868071227195E1A0024F48F /* XPRoomPositionDelegateImpl.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomPositionDelegateImpl.m; sourceTree = ""; }; - E868071427195E340024F48F /* XPRoomPositionDataSourceProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomPositionDataSourceProtocol.h; sourceTree = ""; }; - E8680716271967B00024F48F /* XPRoomPostionBaseItemView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomPostionBaseItemView.h; sourceTree = ""; }; - E8680717271967B00024F48F /* XPRoomPostionBaseItemView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomPostionBaseItemView.m; sourceTree = ""; }; - E8680719271969A50024F48F /* XCRoomPostionNickView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XCRoomPostionNickView.h; sourceTree = ""; }; - E868071A271969A50024F48F /* XCRoomPostionNickView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XCRoomPostionNickView.m; sourceTree = ""; }; + E8680716271967B00024F48F /* MicroView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MicroView.h; sourceTree = ""; }; + E8680717271967B00024F48F /* MicroView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MicroView.m; sourceTree = ""; }; E872308726E89BE000B90D4F /* LoginPhoneViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LoginPhoneViewController.h; sourceTree = ""; }; E872308826E89BE000B90D4F /* LoginPhoneViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LoginPhoneViewController.m; sourceTree = ""; }; E872308B26E89DAA00B90D4F /* LoginInputView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LoginInputView.h; sourceTree = ""; }; @@ -531,14 +522,10 @@ E874B8772721438E003954B9 /* XPImRoomImpl.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPImRoomImpl.m; sourceTree = ""; }; E874B879272143AD003954B9 /* XPIMRoomInterface.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPIMRoomInterface.h; sourceTree = ""; }; E874B87A272143C7003954B9 /* XPIMRoomDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPIMRoomDelegate.h; sourceTree = ""; }; - E874B87E272158E7003954B9 /* XPIMRoomMicQueueImpl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPIMRoomMicQueueImpl.h; sourceTree = ""; }; - E874B87F272158E7003954B9 /* XPIMRoomMicQueueImpl.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPIMRoomMicQueueImpl.m; sourceTree = ""; }; - E874B881272158FA003954B9 /* XPIMRoomMicQueueInterface.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPIMRoomMicQueueInterface.h; sourceTree = ""; }; - E874B8822721590D003954B9 /* XPIMRoomMicQueueDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPIMRoomMicQueueDelegate.h; sourceTree = ""; }; - E874B88627215D39003954B9 /* MicroModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MicroModel.h; sourceTree = ""; }; - E874B88727215D39003954B9 /* MicroModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MicroModel.m; sourceTree = ""; }; - E874B88927215EAF003954B9 /* MicroQueueItemModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MicroQueueItemModel.h; sourceTree = ""; }; - E874B88A27215EAF003954B9 /* MicroQueueItemModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MicroQueueItemModel.m; sourceTree = ""; }; + E874B88627215D39003954B9 /* MicroStateModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MicroStateModel.h; sourceTree = ""; }; + E874B88727215D39003954B9 /* MicroStateModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MicroStateModel.m; sourceTree = ""; }; + E874B88927215EAF003954B9 /* MicroQueueModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MicroQueueModel.h; sourceTree = ""; }; + E874B88A27215EAF003954B9 /* MicroQueueModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MicroQueueModel.m; sourceTree = ""; }; E874B88D27216FFE003954B9 /* XPIMChatRoomMemberImpl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPIMChatRoomMemberImpl.h; sourceTree = ""; }; E874B88E27216FFE003954B9 /* XPIMChatRoomMemberImpl.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPIMChatRoomMemberImpl.m; sourceTree = ""; }; E874B890272170A6003954B9 /* XPIMChatRoomMemberInterface.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPIMChatRoomMemberInterface.h; sourceTree = ""; }; @@ -585,8 +572,6 @@ E89DA67127008D59008483C1 /* WalletInfoModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = WalletInfoModel.m; sourceTree = ""; }; E89DA67327009ACD008483C1 /* XPMineRechargeNavView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineRechargeNavView.h; sourceTree = ""; }; E89DA67427009ACD008483C1 /* XPMineRechargeNavView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineRechargeNavView.m; sourceTree = ""; }; - E89DA67627009F16008483C1 /* NSObject+JSONString.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSObject+JSONString.h"; sourceTree = ""; }; - E89DA67727009F16008483C1 /* NSObject+JSONString.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSObject+JSONString.m"; sourceTree = ""; }; E8AC720B26F435F5007D6E91 /* UIImageView+LoadImage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIImageView+LoadImage.h"; sourceTree = ""; }; E8AC720C26F435F5007D6E91 /* UIImageView+LoadImage.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIImageView+LoadImage.m"; sourceTree = ""; }; E8AC720E26F43955007D6E91 /* UIImageConstant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UIImageConstant.h; sourceTree = ""; }; @@ -630,12 +615,8 @@ E8AEAEEF27141C430017FCE0 /* XPRoomMenuContainerView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomMenuContainerView.m; sourceTree = ""; }; E8AEAEF127141C7C0017FCE0 /* XPRoomMessageContainerView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomMessageContainerView.h; sourceTree = ""; }; E8AEAEF227141C7C0017FCE0 /* XPRoomMessageContainerView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomMessageContainerView.m; sourceTree = ""; }; - E8AEAEF427141C910017FCE0 /* XPRoomPositionContainView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomPositionContainView.h; sourceTree = ""; }; - E8AEAEF527141C910017FCE0 /* XPRoomPositionContainView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomPositionContainView.m; sourceTree = ""; }; E8AEAEF727141CA30017FCE0 /* XPRoomInfoContainerView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomInfoContainerView.h; sourceTree = ""; }; E8AEAEF827141CA30017FCE0 /* XPRoomInfoContainerView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomInfoContainerView.m; sourceTree = ""; }; - E8B825B526E9A7D8009E8E9F /* BaseObject.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BaseObject.h; sourceTree = ""; }; - E8B825B626E9A7D8009E8E9F /* BaseObject.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BaseObject.m; sourceTree = ""; }; E8B825BD26E9E57D009E8E9F /* LoginTicketInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LoginTicketInfo.h; sourceTree = ""; }; E8B825BE26E9E57D009E8E9F /* LoginTicketInfo.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LoginTicketInfo.m; sourceTree = ""; }; E8B825C026EA00DF009E8E9F /* LoginVerifCodePresent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LoginVerifCodePresent.h; sourceTree = ""; }; @@ -988,8 +969,6 @@ 189DD56026DE456100AB55B1 /* Model */ = { isa = PBXGroup; children = ( - E8B825B526E9A7D8009E8E9F /* BaseObject.h */, - E8B825B626E9A7D8009E8E9F /* BaseObject.m */, 187EEEDA26E89B32002833B2 /* BaseModel.h */, 187EEEDB26E89B32002833B2 /* BaseModel.m */, 187EEEDF26E89BFB002833B2 /* AccountModel.h */, @@ -1141,7 +1120,6 @@ isa = PBXGroup; children = ( E865964E2701A1A900846EBD /* StatisticsService */, - E89DA66C2700873B008483C1 /* NSObject */, E89DA6612700590A008483C1 /* IAPHelper */, E8B846B926FD7BE600A777FE /* UploadImage */, E8EEB8EA26FC2050007C6EBA /* SDPhotoBrowser */, @@ -1152,6 +1130,8 @@ 189DD74726E21D8400AB55B1 /* KeyChain */, 189DD74226E21CCC00AB55B1 /* Reachability */, 189DD73626E21C3F00AB55B1 /* YYUtility */, + 180806D627293794001FD836 /* NSObject+MJExtension.h */, + 180806D727293794001FD836 /* NSObject+MJExtension.m */, ); path = Tool; sourceTree = ""; @@ -1366,15 +1346,6 @@ path = AppDelegate; sourceTree = ""; }; - E81D587F27200804003063FE /* SeapkingView */ = { - isa = PBXGroup; - children = ( - E81D58802720082A003063FE /* XPRoomPositionItemSpeakingView.h */, - E81D58812720082A003063FE /* XPRoomPositionItemSpeakingView.m */, - ); - path = SeapkingView; - sourceTree = ""; - }; E82109AA26F1C86E00FC3319 /* CountDown */ = { isa = PBXGroup; children = ( @@ -1447,41 +1418,16 @@ path = StatisticsService; sourceTree = ""; }; - E8680707271959090024F48F /* PositionView */ = { + E8680707271959090024F48F /* MicroView */ = { isa = PBXGroup; children = ( - E86807152719678B0024F48F /* View */, - E868070C27195D4C0024F48F /* Object */, - E8680708271959DB0024F48F /* XPRoomPositionView.h */, - E8680709271959DB0024F48F /* XPRoomPositionView.m */, + 180806DA27297269001FD836 /* MicroViewProtocol.h */, + E8680716271967B00024F48F /* MicroView.h */, + E8680717271967B00024F48F /* MicroView.m */, + E81D58802720082A003063FE /* MicroWaveView.h */, + E81D58812720082A003063FE /* MicroWaveView.m */, ); - path = PositionView; - sourceTree = ""; - }; - E868070C27195D4C0024F48F /* Object */ = { - isa = PBXGroup; - children = ( - E868070D27195DD30024F48F /* XPRoomPositionLayoutImpl.h */, - E868070E27195DD30024F48F /* XPRoomPositionLayoutImpl.m */, - E868071027195DF00024F48F /* XPRoomPositionLayoutProtocol.h */, - E868071427195E340024F48F /* XPRoomPositionDataSourceProtocol.h */, - E868071127195E1A0024F48F /* XPRoomPositionDelegateImpl.h */, - E868071227195E1A0024F48F /* XPRoomPositionDelegateImpl.m */, - E85B02212722A3C600298C52 /* XPRoomPositionDelgate.h */, - ); - path = Object; - sourceTree = ""; - }; - E86807152719678B0024F48F /* View */ = { - isa = PBXGroup; - children = ( - E81D587F27200804003063FE /* SeapkingView */, - E8680716271967B00024F48F /* XPRoomPostionBaseItemView.h */, - E8680717271967B00024F48F /* XPRoomPostionBaseItemView.m */, - E8680719271969A50024F48F /* XCRoomPostionNickView.h */, - E868071A271969A50024F48F /* XCRoomPostionNickView.m */, - ); - path = View; + path = MicroView; sourceTree = ""; }; E872308A26E89D5100B90D4F /* CustomView */ = { @@ -1504,7 +1450,6 @@ children = ( E874B89227217D64003954B9 /* RoomMessage */, E874B88C27216FB6003954B9 /* ChatRoomMember */, - E874B87D272158B9003954B9 /* MicroQueue */, E874B8752721436F003954B9 /* Room */, E874B86A272105DD003954B9 /* XPIMManager.h */, E874B86B272105DD003954B9 /* XPIMManager.m */, @@ -1523,25 +1468,13 @@ path = Room; sourceTree = ""; }; - E874B87D272158B9003954B9 /* MicroQueue */ = { - isa = PBXGroup; - children = ( - E874B88527215CFF003954B9 /* Model */, - E874B87E272158E7003954B9 /* XPIMRoomMicQueueImpl.h */, - E874B87F272158E7003954B9 /* XPIMRoomMicQueueImpl.m */, - E874B881272158FA003954B9 /* XPIMRoomMicQueueInterface.h */, - E874B8822721590D003954B9 /* XPIMRoomMicQueueDelegate.h */, - ); - path = MicroQueue; - sourceTree = ""; - }; E874B88527215CFF003954B9 /* Model */ = { isa = PBXGroup; children = ( - E874B88627215D39003954B9 /* MicroModel.h */, - E874B88727215D39003954B9 /* MicroModel.m */, - E874B88927215EAF003954B9 /* MicroQueueItemModel.h */, - E874B88A27215EAF003954B9 /* MicroQueueItemModel.m */, + E874B88627215D39003954B9 /* MicroStateModel.h */, + E874B88727215D39003954B9 /* MicroStateModel.m */, + E874B88927215EAF003954B9 /* MicroQueueModel.h */, + E874B88A27215EAF003954B9 /* MicroQueueModel.m */, ); path = Model; sourceTree = ""; @@ -1652,15 +1585,6 @@ path = IAPHelper; sourceTree = ""; }; - E89DA66C2700873B008483C1 /* NSObject */ = { - isa = PBXGroup; - children = ( - E89DA67627009F16008483C1 /* NSObject+JSONString.h */, - E89DA67727009F16008483C1 /* NSObject+JSONString.m */, - ); - path = NSObject; - sourceTree = ""; - }; E8AC720A26F435AF007D6E91 /* UIImageView */ = { isa = PBXGroup; children = ( @@ -1690,11 +1614,12 @@ E88F5EAA271ECCDC00FF9B33 /* Category */, E8AEAED4271412EC0017FCE0 /* XPRoomViewController.h */, E8AEAED5271412EC0017FCE0 /* XPRoomViewController.m */, + 181D7F222727DB1E00B7C059 /* RoomDelegate.h */, E8AEAEE527141ACC0017FCE0 /* ActivityContainerView */, E8AEAEE727141ACC0017FCE0 /* BaseUIContainerView */, E8AEAEE927141ACC0017FCE0 /* MenuContainerView */, E8AEAEE627141ACC0017FCE0 /* MessageContainerView */, - E8AEAEEA27141ACC0017FCE0 /* PositionContainerView */, + E8AEAEEA27141ACC0017FCE0 /* StageView */, E8AEAEE827141ACC0017FCE0 /* RoomInfoContainerView */, ); path = View; @@ -1749,14 +1674,17 @@ path = MenuContainerView; sourceTree = ""; }; - E8AEAEEA27141ACC0017FCE0 /* PositionContainerView */ = { + E8AEAEEA27141ACC0017FCE0 /* StageView */ = { isa = PBXGroup; children = ( - E8680707271959090024F48F /* PositionView */, - E8AEAEF427141C910017FCE0 /* XPRoomPositionContainView.h */, - E8AEAEF527141C910017FCE0 /* XPRoomPositionContainView.m */, + E874B88527215CFF003954B9 /* Model */, + E8680707271959090024F48F /* MicroView */, + 181D7F192726CE2A00B7C059 /* StageView.h */, + 181D7F1A2726CE2A00B7C059 /* StageView.m */, + 181D7F1F2727D9DB00B7C059 /* SocialStageView.h */, + 181D7F202727D9DB00B7C059 /* SocialStageView.m */, ); - path = PositionContainerView; + path = StageView; sourceTree = ""; }; E8B825BC26E9E520009E8E9F /* Model */ = { @@ -2141,13 +2069,11 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - E85B02222722A3D900298C52 /* XPRoomPositionDelgate.h in Sources */, E874B89B27218ABC003954B9 /* XPIMChatRoomMessageInterface.h in Sources */, E874B89A27218AAF003954B9 /* XPIMChatRoomMessageDelegate.h in Sources */, E874B8912721712B003954B9 /* XPIMChatRoomMemberInterface.h in Sources */, - E874B88427215B0E003954B9 /* XPIMRoomMicQueueDelegate.h in Sources */, - E874B88327215B06003954B9 /* XPIMRoomMicQueueInterface.h in Sources */, E874B87C27214888003954B9 /* XPIMRoomDelegate.h in Sources */, + 181D7F1B2726CE2A00B7C059 /* StageView.m in Sources */, E874B87B27214882003954B9 /* XPIMRoomInterface.h in Sources */, E8B846D826FDE17300A777FE /* XPMineRechargeProtocol.h in Sources */, E8B846C726FDB45000A777FE /* XPMineUserInfoAlbumProtocol.h in Sources */, @@ -2183,7 +2109,6 @@ E8B825C726EA0D9A009E8E9F /* LoginVerifCodeProtocol.h in Sources */, E824544E26F5BC1A00BE8163 /* XPMineModifPayPwdView.m in Sources */, E8B825CA26EA1231009E8E9F /* LoginVerifCodeViewController.m in Sources */, - E874B880272158E7003954B9 /* XPIMRoomMicQueueImpl.m in Sources */, 189DD76226E60DDC00AB55B1 /* Api+Login.m in Sources */, 18E7B22626E8CDCF0064BC9B /* XplanFlutterBoostDelegate.m in Sources */, E8EEB8F326FC2050007C6EBA /* SDWaitingView.m in Sources */, @@ -2195,7 +2120,6 @@ E8E70D8926F2F58F00F03460 /* XPMineMatchTableViewCell.m in Sources */, E88B5CA826FB089C00DA9178 /* XPMineTeenagePwdViewController.m in Sources */, E81C279626EB39CC0031E639 /* LoginForgetPasswordPresent.m in Sources */, - E8B825B726E9A7D8009E8E9F /* BaseObject.m in Sources */, E8AC723526F49939007D6E91 /* XPMineNotificaPresenter.m in Sources */, 189DD53426DE255300AB55B1 /* TabbarViewController.m in Sources */, E8EEB91D26FC9D58007C6EBA /* XPMineUserInfoDateView.m in Sources */, @@ -2203,7 +2127,6 @@ E8E70D7A26F2F16600F03460 /* XPMinePresent.m in Sources */, E84B0E3F2727EDF6008818C6 /* XPRoomMessageTableViewCell.m in Sources */, E8EEB8F226FC2050007C6EBA /* SDPhotoBrowser.m in Sources */, - E89DA67827009F16008483C1 /* NSObject+JSONString.m in Sources */, E874B89527217DA6003954B9 /* XPIMChatRoomMessageImpl.m in Sources */, E81C27AB26EF2D920031E639 /* ThirdUserInfo.m in Sources */, E874B86C272105DD003954B9 /* XPIMManager.m in Sources */, @@ -2211,12 +2134,12 @@ 187EEEFE26E8A82C002833B2 /* NSObject+AutoCoding.m in Sources */, E8AC721926F46E0B007D6E91 /* XPMineSettingItemModel.m in Sources */, 189DD55A26DE39D200AB55B1 /* BaseMvpPresenter.m in Sources */, + 180806D827293794001FD836 /* NSObject+MJExtension.m in Sources */, 189DD6FF26E20E5900AB55B1 /* HttpRequestHelper.m in Sources */, E8AEAED6271412EC0017FCE0 /* XPRoomViewController.m in Sources */, E8E70D9226F2F60C00F03460 /* XPMineItemModel.m in Sources */, 189DD74A26E21D8400AB55B1 /* SSKeychain.m in Sources */, E8B846CF26FDD96100A777FE /* XPMineRechageHeadView.m in Sources */, - E868070F27195DD30024F48F /* XPRoomPositionLayoutImpl.m in Sources */, 186A534926FC6ED900D67B2C /* TTAlertMessageAttributedConfig.m in Sources */, E81C27AE26EF39AB0031E639 /* AppDelegate+ThirdConfig.m in Sources */, E8E70D8326F2F51A00F03460 /* XPMineHeadView.m in Sources */, @@ -2249,7 +2172,7 @@ 18E7B1B726E8B2D10064BC9B /* Api+Main.m in Sources */, E8B846D326FDDBE600A777FE /* XPMineRechargeTableViewCell.m in Sources */, E824546126F5F4E400BE8163 /* XPMineResetPayPwdViewController.m in Sources */, - E81D58822720082A003063FE /* XPRoomPositionItemSpeakingView.m in Sources */, + E81D58822720082A003063FE /* MicroWaveView.m in Sources */, E8B825C226EA00DF009E8E9F /* LoginVerifCodePresent.m in Sources */, E88B5CB026FB1C6500DA9178 /* XPMineTeenagerPresenter.m in Sources */, 186A534B26FC6ED900D67B2C /* TTPopupManagerService.m in Sources */, @@ -2260,13 +2183,13 @@ E824545626F5E51900BE8163 /* XPMineVerifIdentityViewController.m in Sources */, 186A534726FC6ED900D67B2C /* TTAlertConfig.m in Sources */, 18E7B31E26F0984C0064BC9B /* UserLevelVo.m in Sources */, - E874B88B27215EAF003954B9 /* MicroQueueItemModel.m in Sources */, + E874B88B27215EAF003954B9 /* MicroQueueModel.m in Sources */, E8EEB90626FC5772007C6EBA /* XPMineUserInfoEditViewController.m in Sources */, E8B846D626FDE01B00A777FE /* XPMineRechargePresenter.m in Sources */, E8EEB91426FC7786007C6EBA /* XPMineUserInfoNickViewController.m in Sources */, 18E7B31B26F0982E0064BC9B /* UserExpand.m in Sources */, E824543526F57D6E00BE8163 /* XPLoginVerifBindPhoneViewController.m in Sources */, - E8680718271967B00024F48F /* XPRoomPostionBaseItemView.m in Sources */, + E8680718271967B00024F48F /* MicroView.m in Sources */, E8B825CD26EA18C8009E8E9F /* ThemeColor.m in Sources */, E8AC720D26F435F5007D6E91 /* UIImageView+LoadImage.m in Sources */, E88B5CBD26FB3BDF00DA9178 /* XPTeenagerAlertView.m in Sources */, @@ -2306,12 +2229,11 @@ 18486213271EA9DA005FC5DC /* RtcManager.m in Sources */, 186A536926FC6F2E00D67B2C /* XCShareView.m in Sources */, 186A534C26FC6ED900D67B2C /* TTAlertView.m in Sources */, - E868070A271959DB0024F48F /* XPRoomPositionView.m in Sources */, E8B825BF26E9E57D009E8E9F /* LoginTicketInfo.m in Sources */, + 181D7F212727D9DB00B7C059 /* SocialStageView.m in Sources */, 187EEEF026E89FE8002833B2 /* AccountInfoStorage.m in Sources */, 186A536B26FC6F2E00D67B2C /* XCShareItemCell.m in Sources */, E8B846C526FDB41A00A777FE /* XPMineUserInfolbumPresenter.m in Sources */, - E868071327195E1A0024F48F /* XPRoomPositionDelegateImpl.m in Sources */, E872309326E8D31500B90D4F /* LoginVerifCodeView.m in Sources */, 186A534626FC6ED900D67B2C /* TTPopup.m in Sources */, E81C278C26EAFAF60031E639 /* Base64.m in Sources */, @@ -2338,15 +2260,13 @@ E84B0E422727EE0A008818C6 /* XPRoomMessageHeaderView.m in Sources */, 186A534826FC6ED900D67B2C /* TTAlertButtonConfig.m in Sources */, E89D60BA271D643A001F8895 /* Api+Room.m in Sources */, - E8AEAEF627141C910017FCE0 /* XPRoomPositionContainView.m in Sources */, E872308926E89BE000B90D4F /* LoginPhoneViewController.m in Sources */, 18E7B29026EA0E6B0064BC9B /* FlutterBoost+Xplan.m in Sources */, E8B846DC26FDE24300A777FE /* RechargeListModel.m in Sources */, 189DD75926E6003C00AB55B1 /* Api.m in Sources */, E88B5CB826FB325200DA9178 /* XPMineTeenagerPwdPresenter.m in Sources */, - E874B88827215D39003954B9 /* MicroModel.m in Sources */, - E868071B271969A50024F48F /* XCRoomPostionNickView.m in Sources */, E84B0E462727EF9D008818C6 /* XPRoomMessageDisplayModel.m in Sources */, + E874B88827215D39003954B9 /* MicroStateModel.m in Sources */, E89D60C1271D64B9001F8895 /* RoomInfoModel.m in Sources */, E89DA66727006443008483C1 /* RechargeStorage.m in Sources */, 189DD53F26DE255600AB55B1 /* main.m in Sources */, diff --git a/xplan-ios/Base/MVP/Model/AccountModel.h b/xplan-ios/Base/MVP/Model/AccountModel.h index 29e1e147..ef26f35a 100644 --- a/xplan-ios/Base/MVP/Model/AccountModel.h +++ b/xplan-ios/Base/MVP/Model/AccountModel.h @@ -5,11 +5,11 @@ // Created by zu on 2021/9/8. // -#import "BaseObject.h" +#import "NSObject+MJExtension.h" NS_ASSUME_NONNULL_BEGIN -@interface AccountModel : BaseObject +@interface AccountModel : NSObject @property (nonatomic , assign) NSString *uid; @property (nonatomic , copy) NSString *jti; diff --git a/xplan-ios/Base/MVP/Model/BaseModel.h b/xplan-ios/Base/MVP/Model/BaseModel.h index 9f0d400f..30a0b4c0 100644 --- a/xplan-ios/Base/MVP/Model/BaseModel.h +++ b/xplan-ios/Base/MVP/Model/BaseModel.h @@ -5,11 +5,11 @@ // Created by zu on 2021/9/8. // -#import "BaseObject.h" +#import "NSObject+MJExtension.h" NS_ASSUME_NONNULL_BEGIN -@interface BaseModel : BaseObject +@interface BaseModel : NSObject @property (nonatomic , strong) id data; @property (nonatomic , assign) NSInteger code; diff --git a/xplan-ios/Base/MVP/Model/LoginTicketInfo.h b/xplan-ios/Base/MVP/Model/LoginTicketInfo.h index 9820515a..1c5f2fc0 100644 --- a/xplan-ios/Base/MVP/Model/LoginTicketInfo.h +++ b/xplan-ios/Base/MVP/Model/LoginTicketInfo.h @@ -5,11 +5,11 @@ // Created by 冯硕 on 2021/9/9. // -#import "BaseObject.h" +#import "NSObject+MJExtension.h" NS_ASSUME_NONNULL_BEGIN -@interface LoginTicketInfo : BaseObject +@interface LoginTicketInfo : NSObject @property(nonatomic, strong) NSString *issue_type; ///数组中的第一个 就是ticket 历史遗留问题 diff --git a/xplan-ios/Base/MVP/Model/UserExpand.h b/xplan-ios/Base/MVP/Model/UserExpand.h index 6586b7bd..84e8b5e6 100644 --- a/xplan-ios/Base/MVP/Model/UserExpand.h +++ b/xplan-ios/Base/MVP/Model/UserExpand.h @@ -5,11 +5,11 @@ // Created by zu on 2021/9/14. // -#import "BaseObject.h" +#import "NSObject+MJExtension.h" NS_ASSUME_NONNULL_BEGIN -@interface UserExpand : BaseObject +@interface UserExpand : NSObject @property (nonatomic , assign) NSInteger id; @property (nonatomic , assign) BOOL showLocation; @property (nonatomic , assign) NSInteger uid; diff --git a/xplan-ios/Base/MVP/Model/UserInfoModel.h b/xplan-ios/Base/MVP/Model/UserInfoModel.h index d8fb28c7..5a9663b7 100644 --- a/xplan-ios/Base/MVP/Model/UserInfoModel.h +++ b/xplan-ios/Base/MVP/Model/UserInfoModel.h @@ -5,7 +5,7 @@ // Created by zu on 2021/9/14. // -#import "BaseObject.h" +#import "NSObject+MJExtension.h" #import "UserExpand.h" #import "UserLevelVo.h" #import "UserInfoSkillVo.h" @@ -14,7 +14,7 @@ NS_ASSUME_NONNULL_BEGIN -@interface UserInfoModel : BaseObject +@interface UserInfoModel : NSObject @property (nonatomic , assign) NSInteger bindType; @property (nonatomic , assign) NSInteger createTime; @property (nonatomic , assign) BOOL parentMode; diff --git a/xplan-ios/Base/MVP/Model/UserInfoSkillVo.h b/xplan-ios/Base/MVP/Model/UserInfoSkillVo.h index e3ec6f89..fe8a3820 100644 --- a/xplan-ios/Base/MVP/Model/UserInfoSkillVo.h +++ b/xplan-ios/Base/MVP/Model/UserInfoSkillVo.h @@ -5,11 +5,11 @@ // Created by zu on 2021/9/14. // -#import "BaseObject.h" +#import "NSObject+MJExtension.h" NS_ASSUME_NONNULL_BEGIN -@interface UserInfoSkillVo : BaseObject +@interface UserInfoSkillVo : NSObject @property (nonatomic , assign) BOOL liveTag; @end diff --git a/xplan-ios/Base/MVP/Model/UserLevelVo.h b/xplan-ios/Base/MVP/Model/UserLevelVo.h index 315204bc..1b03ca49 100644 --- a/xplan-ios/Base/MVP/Model/UserLevelVo.h +++ b/xplan-ios/Base/MVP/Model/UserLevelVo.h @@ -5,7 +5,7 @@ // Created by zu on 2021/9/14. // -#import "BaseObject.h" +#import "NSObject+MJExtension.h" NS_ASSUME_NONNULL_BEGIN typedef NS_ENUM(NSInteger, UserLevelType) { @@ -14,7 +14,7 @@ typedef NS_ENUM(NSInteger, UserLevelType) { UserLevelType_Robot = 3, ///机器人 }; -@interface UserLevelVo : BaseObject +@interface UserLevelVo : NSObject @property (nonatomic , copy) NSString * experUrl; @property (nonatomic , assign) NSInteger charmLevelSeq; @property (nonatomic , copy) NSString * experLevelName; diff --git a/xplan-ios/Base/MVP/Model/UserPhoto.h b/xplan-ios/Base/MVP/Model/UserPhoto.h index 840d5483..8c5edd61 100644 --- a/xplan-ios/Base/MVP/Model/UserPhoto.h +++ b/xplan-ios/Base/MVP/Model/UserPhoto.h @@ -5,11 +5,11 @@ // Created by 冯硕 on 2021/9/23. // -#import "BaseObject.h" +#import "NSObject+MJExtension.h" NS_ASSUME_NONNULL_BEGIN -@interface UserPhoto : BaseObject +@interface UserPhoto : NSObject @property (copy, nonatomic) NSString *photoUrl; @property (copy, nonatomic) NSString *pid; @end diff --git a/xplan-ios/Base/Net/HttpRequestHelper.m b/xplan-ios/Base/Net/HttpRequestHelper.m index 59e91d51..ef5b20e3 100644 --- a/xplan-ios/Base/Net/HttpRequestHelper.m +++ b/xplan-ios/Base/Net/HttpRequestHelper.m @@ -56,7 +56,7 @@ [manager GET:method parameters:params headers:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { BaseModel *baseModel = [BaseModel modelWithDictionary:responseObject]; #ifdef DEBUG - NSLog(@"\n%@", [baseModel model2json]); + NSLog(@"\n%@", [baseModel toJSONString]); #endif if (baseModel.code == 200) { success(baseModel); @@ -90,7 +90,7 @@ [manager POST:method parameters:params headers:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { BaseModel *baseModel = [BaseModel modelWithDictionary:responseObject]; #ifdef DEBUG - NSLog(@"\n%@", [baseModel model2json]); + NSLog(@"\n%@", [baseModel toJSONString]); #endif if (baseModel.code == 200) { success(baseModel); diff --git a/xplan-ios/Base/MVP/Model/BaseObject.h b/xplan-ios/Base/Tool/NSObject+MJExtension.h similarity index 81% rename from xplan-ios/Base/MVP/Model/BaseObject.h rename to xplan-ios/Base/Tool/NSObject+MJExtension.h index 55ae2e7c..55af929e 100644 --- a/xplan-ios/Base/MVP/Model/BaseObject.h +++ b/xplan-ios/Base/Tool/NSObject+MJExtension.h @@ -1,14 +1,16 @@ // -// BaseObject.h +// NSObject+MJExtension.h // xplan-ios // -// Created by 冯硕 on 2021/9/9. +// Created by zu on 2021/10/27. // #import NS_ASSUME_NONNULL_BEGIN -@interface BaseObject : NSObject + +@interface NSObject (MJExtension) + /// 依据数组初始化一个实例数组 /// @param json json 数据 + (NSArray *)modelsWithArray:(id)json; @@ -24,8 +26,11 @@ NS_ASSUME_NONNULL_BEGIN ///model 转字典 - (NSDictionary *)model2dictionary; -///model 转 json -- (NSString *)model2json; +///转 json string +- (NSString *)toJSONString; + +///转 json object +- (id)toJSONObject; ///扩展方法 按需索取 重写即可 ///如果一个模型中 包含一个数组 数组中是另一个模型 diff --git a/xplan-ios/Base/MVP/Model/BaseObject.m b/xplan-ios/Base/Tool/NSObject+MJExtension.m similarity index 65% rename from xplan-ios/Base/MVP/Model/BaseObject.m rename to xplan-ios/Base/Tool/NSObject+MJExtension.m index da5b79f4..217a26b3 100644 --- a/xplan-ios/Base/MVP/Model/BaseObject.m +++ b/xplan-ios/Base/Tool/NSObject+MJExtension.m @@ -1,59 +1,64 @@ // -// BaseObject.m +// NSObject+MJExtension.m // xplan-ios // -// Created by 冯硕 on 2021/9/9. +// Created by zu on 2021/10/27. // -#import "BaseObject.h" +#import "NSObject+MJExtension.h" #import -@implementation BaseObject +@implementation NSObject (MJExtension) /// 依据数组初始化一个实例数组 /// @param json json 数据 + (NSArray *)modelsWithArray:(id)json { - return [self mj_objectArrayWithKeyValuesArray:json]; + return [self mj_objectArrayWithKeyValuesArray:json]; } /// 依据字典初始化一个实例 /// @param dictionary 字典 + (instancetype)modelWithDictionary:(NSDictionary *)dictionary { - return [self mj_objectWithKeyValues:dictionary]; + return [self mj_objectWithKeyValues:dictionary]; } /// 依据JSON对象初始化一个实例 /// @param json json 数据 + (instancetype)modelWithJSON:(id)json { - return [self mj_objectWithKeyValues:json]; + return [self mj_objectWithKeyValues:json]; } ///model 转字典 - (NSDictionary *)model2dictionary { - return [[self mj_keyValues] copy]; + return [[self mj_keyValues] copy]; } -- (NSString *)model2json { +- (NSString *)toJSONString { return [self mj_JSONString]; } +- (id)toJSONObject { + return [self mj_JSONObject]; +} + ///如果模型中包含数组的话 + (NSDictionary *)mj_objectClassInArray { - return [self objectClassInArray]; + return [self objectClassInArray]; } ///模型中需要映射 重写整个方法 + (NSDictionary *)mj_replacedKeyFromPropertyName { - return [self replacedKeyFromPropertyName]; + return [self replacedKeyFromPropertyName]; } ///扩展方法 按需索取 重写即可 ///如果一个模型中 包含一个数组 数组中是另一个模型 + (NSDictionary *)objectClassInArray { - return @{}; + return @{}; } ///如果一个模型中需要字段映射的话 比如id -> ID name -> other.name + (NSDictionary *)replacedKeyFromPropertyName { - return @{}; + return @{}; } + @end diff --git a/xplan-ios/Base/Tool/NSObject/NSObject+JSONString.h b/xplan-ios/Base/Tool/NSObject/NSObject+JSONString.h deleted file mode 100644 index 9d8274dc..00000000 --- a/xplan-ios/Base/Tool/NSObject/NSObject+JSONString.h +++ /dev/null @@ -1,18 +0,0 @@ -// -// NSObject+JSONString.h -// xplan-ios -// -// Created by 冯硕 on 2021/9/26. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@interface NSObject (JSONString) -- (NSString *)objectToJSONString; - -- (id)JSONObject; -@end - -NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Base/Tool/NSObject/NSObject+JSONString.m b/xplan-ios/Base/Tool/NSObject/NSObject+JSONString.m deleted file mode 100644 index ca65456c..00000000 --- a/xplan-ios/Base/Tool/NSObject/NSObject+JSONString.m +++ /dev/null @@ -1,21 +0,0 @@ -// -// NSObject+JSONString.m -// xplan-ios -// -// Created by 冯硕 on 2021/9/26. -// - -#import "NSObject+JSONString.h" -#import -@implementation NSObject (JSONString) - -- (NSString *)objectToJSONString { - return [self mj_JSONString]; -} - -///转成字典或者数组 -- (id)JSONObject { - return [self mj_JSONObject]; -} - -@end diff --git a/xplan-ios/Main/IM/MicroQueue/Model/MicroModel.m b/xplan-ios/Main/IM/MicroQueue/Model/MicroModel.m deleted file mode 100644 index 6e7566a8..00000000 --- a/xplan-ios/Main/IM/MicroQueue/Model/MicroModel.m +++ /dev/null @@ -1,12 +0,0 @@ -// -// MicroModel.m -// xplan-ios -// -// Created by 冯硕 on 2021/10/21. -// - -#import "MicroModel.h" - -@implementation MicroModel - -@end diff --git a/xplan-ios/Main/IM/MicroQueue/Model/MicroQueueItemModel.m b/xplan-ios/Main/IM/MicroQueue/Model/MicroQueueItemModel.m deleted file mode 100644 index 817e90aa..00000000 --- a/xplan-ios/Main/IM/MicroQueue/Model/MicroQueueItemModel.m +++ /dev/null @@ -1,12 +0,0 @@ -// -// MicroQueueItemModel.m -// xplan-ios -// -// Created by 冯硕 on 2021/10/21. -// - -#import "MicroQueueItemModel.h" - -@implementation MicroQueueItemModel - -@end diff --git a/xplan-ios/Main/IM/MicroQueue/XPIMRoomMicQueueDelegate.h b/xplan-ios/Main/IM/MicroQueue/XPIMRoomMicQueueDelegate.h deleted file mode 100644 index 1521f3b0..00000000 --- a/xplan-ios/Main/IM/MicroQueue/XPIMRoomMicQueueDelegate.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// XPIMRoomMicQueueDelegate.h -// xplan-ios -// -// Created by 冯硕 on 2021/10/21. -// - -#import - -NS_ASSUME_NONNULL_BEGIN -@class MicroQueueItemModel; -@protocol XPIMRoomMicQueueDelegate - -///获取房间队列成功 -- (void)onGetRoomMicroQueueSuccess:(NSDictionary*)microQueue; - -@end - -NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/IM/MicroQueue/XPIMRoomMicQueueImpl.h b/xplan-ios/Main/IM/MicroQueue/XPIMRoomMicQueueImpl.h deleted file mode 100644 index 73788afb..00000000 --- a/xplan-ios/Main/IM/MicroQueue/XPIMRoomMicQueueImpl.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// XPIMRoomMicQueueImpl.h -// xplan-ios -// -// Created by 冯硕 on 2021/10/21. -// - -#import -#import "XPIMRoomMicQueueInterface.h" -NS_ASSUME_NONNULL_BEGIN - -@interface XPIMRoomMicQueueImpl : NSObject - -@end - -NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/IM/MicroQueue/XPIMRoomMicQueueImpl.m b/xplan-ios/Main/IM/MicroQueue/XPIMRoomMicQueueImpl.m deleted file mode 100644 index f1a8f8e8..00000000 --- a/xplan-ios/Main/IM/MicroQueue/XPIMRoomMicQueueImpl.m +++ /dev/null @@ -1,285 +0,0 @@ -// -// XPIMRoomMicQueueImpl.m -// xplan-ios -// -// Created by 冯硕 on 2021/10/21. -// - -#import "XPIMRoomMicQueueImpl.h" -///Third -#import -///Tool -#import "XPIMManager.h" -#import "RtcManager.h" -#import "AccountInfoStorage.h" -#import "NSObject+JSONString.h" -///Model -#import "MicroModel.h" -#import "MicroQueueItemModel.h" -#import "RoomInfoModel.h" -#import "UserInfoModel.h" -///P -#import "XPIMRoomMicQueueDelegate.h" - -#define MIC_COUNT(Type) [self roomTypecpORnormal:Type] - -@interface XPIMRoomMicQueueImpl () -///麦序的状态 <麦序 麦序上的内容> -@property (nonatomic,strong) NSMutableDictionary *queue; -///代理数组 -@property (nonatomic,strong) NSMutableArray *delegateArray; - -///用户信息 -@property (nonatomic,strong) UserInfoModel *userInfo; -@end - -@implementation XPIMRoomMicQueueImpl - -#pragma mark - Private Method -// 给宏定义赋值 --(NSInteger )roomTypecpORnormal:(RoomType )type{ - if (type == RoomType_Game){ - return 9; - }else{ - return 9; - } -} - -///提前绑定一下麦序 -- (void)configDefaultMicQueue { - RoomInfoModel * roomfInfo = [XPIMManager shareManager].chatRoomManager.getCurrentRoomInfo; - for (int i = 0 ; i < MIC_COUNT(roomfInfo.type); i++) { - MicroModel *state = [[MicroModel alloc]init]; - state.posState = MicroPosStateType_Free; - state.micState = MicroMicStateType_Open; - MicroQueueItemModel *micSequence = [[MicroQueueItemModel alloc]init]; - micSequence.microState = state; - micSequence.userInfo = nil; - [self.queue setObject:micSequence forKey:[NSString stringWithFormat:@"%d",i-1]]; - } -} - -///根据uid 看用户是否在麦上 返回麦上的信息 -- (MicroQueueItemModel *)findUserMicroModel:(NSInteger)uid { - NSArray * users = self.microQueue.allValues; - for (int i = 0; i < users.count; i++) { - MicroQueueItemModel * model = [users objectAtIndex:i]; - if (model.userInfo && model.userInfo.uid == uid) { - return model; - } - } - return nil; -} - - -/// 移除队列 -/// @param position 坑位 -- (void)removeChatRoomQueue:(NSString *)position success:(void(^)(BOOL success))success{ - if (position) { - NIMChatroomQueueRemoveRequest *request = [[NIMChatroomQueueRemoveRequest alloc]init]; - request.key = position; - request.roomId = [NSString stringWithFormat:@"%ld", [XPIMManager shareManager].chatRoomManager.getCurrentRoomInfo.roomId]; - [[NIMSDK sharedSDK].chatroomManager removeChatroomQueueObject:request completion:^(NSError * _Nullable error, NSDictionary * _Nullable element) { - if (error == nil ) { - ///成功 - if (success) { - success(YES); - } - }else { - ///失败 - [self fetchRoomQueue:[NSString stringWithFormat:@"%ld", [XPIMManager shareManager].chatRoomManager.getCurrentRoomInfo.roomId]]; - } - }]; - } -} - -///更新队列 -- (void)updateChatroomQueueObject:(NSString *)position userInfo:(UserInfoModel *)userInfo { - NSDictionary * dic = @{@"uid":@(userInfo.uid), @"nick":userInfo.nick, @"gender":@(userInfo.gender), @"avatar":userInfo.avatar}; - NIMChatroomQueueUpdateRequest *request = [[NIMChatroomQueueUpdateRequest alloc]init]; - request.key = position; - request.value = [dic objectToJSONString]; - request.roomId = [NSString stringWithFormat:@"%ld",[XPIMManager shareManager].chatRoomManager.getCurrentRoomInfo.roomId]; - request.transient = YES; - [[NIMSDK sharedSDK].chatroomManager updateChatroomQueueObject:request completion:^(NSError * _Nullable error) { - if (error == nil ) { - - }else { - - } - }]; -} - -- (void)updateChatRoomQueue:(NSString *)position{ - ///TODO 需要获取用户信息 - UserInfoModel * userInfo = self.userInfo; - MicroQueueItemModel * model = [self findUserMicroModel:userInfo.uid]; - if (model) {///用户在坑位上的话 - if (position.intValue != model.microState.position) { - [self removeChatRoomQueue:[NSString stringWithFormat:@"%d", model.microState.position] success:^(BOOL success) { - [self updateChatroomQueueObject:position userInfo:userInfo]; - }]; - } else { - [self updateChatroomQueueObject:position userInfo:userInfo]; - } - - } else { - [self updateChatroomQueueObject:position userInfo:userInfo]; - } -} - - -#pragma mark - XPIMRoomMicQueueInterface -///进入房间成功之后根据扩展字段整理麦序 -- (void)enterRoomRepairMicQueue:(NSDictionary *)micDictionary { - [self configDefaultMicQueue]; - for (NSString *position in micDictionary.allKeys) { - MicroModel *state = [MicroModel modelWithJSON:micDictionary[position]]; - MicroQueueItemModel *sequence = [self.queue objectForKey:position]; - sequence.microState = state; - } - -} -///获取房间队列 -- (void)fetchRoomQueue:(NSString *)roomid { - [[NIMSDK sharedSDK].chatroomManager fetchChatroomQueue:roomid completion:^(NSError * _Nullable error, NSArray *> * _Nullable info) { - if (error == nil && info!= nil) { - for (NSDictionary *item in info) { - UserInfoModel *userInfo = [UserInfoModel modelWithJSON:item.allValues.firstObject]; - NSString *position = item.allKeys.firstObject; - MicroQueueItemModel *sequence = [self.queue objectForKey:position]; - sequence.userInfo = userInfo; - } - - for (id delegate in self.delegateArray) { - if ([delegate respondsToSelector:@selector(onGetRoomMicroQueueSuccess:)]) { - [delegate onGetRoomMicroQueueSuccess:self.queue]; - } - } - } else { - NSLog(@"获取队列失败"); - } - }]; -} -///麦序的队列 -- (NSDictionary *)microQueue { - return [self.queue copy]; -} - -- (void)upMic:(NSString *)position { - ///这个坑位 有没有人 - UserInfoModel *userInfo = [[self.queue objectForKey:position] userInfo]; - MicroModel *micState = [[self.queue objectForKey:position] microState]; - if (userInfo) { - return; - } else { - NSString * uid = [[AccountInfoStorage instance] getUid]; - if (micState.posState == MicroPosStateType_Free) { - [self updateChatRoomQueue:position]; - } else { - [[[XPIMManager shareManager].chatRoomMemberManager rac_queryChatRoomMember:uid] subscribeNext:^(id _Nullable x) { - NIMChatroomMember * member = x; - if (member.type == NIMChatroomMemberTypeCreator || member.type == NIMTeamMemberTypeManager) {///房主或者管理员的话 - [self updateChatRoomQueue:position]; - } - }]; - } - } -} - -- (void)downMic:(NSString *)position { - [self removeChatRoomQueue:position success:nil]; -} - -///更新坑位的状态 -- (void)updateMicroStatus:(NSArray *)microStatus { - for (MicroModel * microState in microStatus) { - MicroQueueItemModel *micSequence = [self.queue objectForKey:[NSString stringWithFormat:@"%d",microState.position]]; - if (micSequence != nil) { - micSequence.microState = microState; - } - } - - for (id delegate in self.delegateArray) { - if ([delegate respondsToSelector:@selector(onGetRoomMicroQueueSuccess:)]) { - [delegate onGetRoomMicroQueueSuccess:self.queue]; - } - } -} - -- (void)onReceiveRoomQueueUpdate:(NIMChatroomNotificationContent *)content { - NSDictionary *temp = (NSDictionary *)content.ext; - UserInfoModel *userInfo = [UserInfoModel modelWithJSON:[temp objectForKey:NIMChatroomEventInfoQueueChangeItemValueKey]]; - //用户所在旧麦位,为空表示上麦,有值表示换麦或更新麦位信息 - NSString *oldPosition; - //去重复 如果该uid在房间先清空 - for (MicroQueueItemModel *sequence in self.queue.allValues) { - if (userInfo.uid == sequence.userInfo.uid) { - oldPosition = @(sequence.microState.position).stringValue; - sequence.userInfo = nil; - } - } - - if ([temp[NIMChatroomEventInfoQueueChangeTypeKey] intValue] == 1) {//上麦 - MicroQueueItemModel *sequence = [self.queue objectForKey:[temp objectForKey:NIMChatroomEventInfoQueueChangeItemKey]]; - sequence.userInfo = userInfo; - ///声网服务 - MicroModel * micState = sequence.microState; - if (micState.micState == MicroMicStateType_Open) { - [[RtcManager instance] broadcast:YES]; - } else { - [[RtcManager instance] broadcast:NO]; - } - for (id delegate in self.delegateArray) { - if ([delegate respondsToSelector:@selector(onGetRoomMicroQueueSuccess:)]) { - [delegate onGetRoomMicroQueueSuccess:self.queue]; - } - } - }else{//下麦 - [[RtcManager instance] broadcast:NO]; - for (id delegate in self.delegateArray) { - if ([delegate respondsToSelector:@selector(onGetRoomMicroQueueSuccess:)]) { - [delegate onGetRoomMicroQueueSuccess:self.queue]; - } - } - } -} - -- (void)resetMicroQueue { - self.queue = nil; -} - -///添加代理 -- (void)addDelegate:(id)delegate { - if (delegate) { - [self.delegateArray addObject:delegate]; - } -} -///移除代理 -- (void)removeDelegate:(id)delegate { - if (delegate && [self.delegateArray containsObject:delegate]) { - [self.delegateArray removeObject:delegate]; - delegate = nil; - } -} - -#warning to do 该结构的时候 调整这个吧 上麦需要用户信息 -- (void)setCurrentUserInfo:(UserInfoModel * _Nullable)userInfo { - self.userInfo = userInfo; -} - -#pragma mark - Getters And Setters -- (NSMutableDictionary *)queue { - if (!_queue) { - _queue= [NSMutableDictionary dictionary]; - } - return _queue; -} -- (NSMutableArray *)delegateArray { - if (!_delegateArray) { - _delegateArray = [NSMutableArray array]; - } - return _delegateArray; -} - -@end diff --git a/xplan-ios/Main/IM/MicroQueue/XPIMRoomMicQueueInterface.h b/xplan-ios/Main/IM/MicroQueue/XPIMRoomMicQueueInterface.h deleted file mode 100644 index b65e8041..00000000 --- a/xplan-ios/Main/IM/MicroQueue/XPIMRoomMicQueueInterface.h +++ /dev/null @@ -1,47 +0,0 @@ -// -// XPIMRoomMicQueueInterface.h -// xplan-ios -// -// Created by 冯硕 on 2021/10/21. -// - -#import -///Third -#import -#import "XPIMRoomMicQueueDelegate.h" -NS_ASSUME_NONNULL_BEGIN -@class UserInfoModel; -@protocol XPIMRoomMicQueueInterface - -///进入房间成功之后根据扩展字段整理麦序 -- (void)enterRoomRepairMicQueue:(NSDictionary *)micDictory; -///获取房间队列 -- (void)fetchRoomQueue:(NSString *)roomid; -///麦序的队列 -- (NSDictionary *)microQueue; - -///重置队列信息 -- (void)resetMicroQueue; - -///上麦 -1 到 7 -- (void)upMic:(NSString *)position; -///下麦 -1 到 7 -- (void)downMic:(NSString *)position; - -///更新坑位的状态 -- (void)updateMicroStatus:(NSArray *)microStatus; - -///收到了上下麦的消息 -- (void)onReceiveRoomQueueUpdate:(NIMChatroomNotificationContent *)content; - -///添加代理 -- (void)addDelegate:(id)delegate; -///移除代理 -- (void)removeDelegate:(id)delegate; - -///TODO 先这样用着 上麦需要用户信息 -- (void)setCurrentUserInfo:(UserInfoModel * _Nullable)userInfo; - -@end - -NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/IM/Room/XPImRoomImpl.m b/xplan-ios/Main/IM/Room/XPImRoomImpl.m index daa8dc07..94f7c5bc 100644 --- a/xplan-ios/Main/IM/Room/XPImRoomImpl.m +++ b/xplan-ios/Main/IM/Room/XPImRoomImpl.m @@ -9,13 +9,13 @@ ///Third #import ///Tool -#import "NSObject+JSONString.h" +#import "NSObject+MJExtension.h" #import "XPIMManager.h" #import "RtcManager.h" ///Model #import "UserInfoModel.h" #import "RoomInfoModel.h" -#import "MicroModel.h" +#import "MicroStateModel.h" ///P #import "XPIMRoomDelegate.h" @@ -45,7 +45,7 @@ #pragma mark - Private Method ///房间信息更新 - (void)onRoomInfoUpdated:(NIMChatroomNotificationContent *)content { - NSDictionary *roomInfoDictionary = [content.notifyExt JSONObject]; + NSDictionary *roomInfoDictionary = [content.notifyExt toJSONObject]; int type = [roomInfoDictionary[@"type"] intValue]; switch (type) { case 1:{ @@ -60,8 +60,8 @@ break; case 2:{///更新了某一个麦序信息 /// - MicroModel *microState = [MicroModel modelWithJSON:roomInfoDictionary[@"micInfo"]]; - [[XPIMManager shareManager].microQueueManager updateMicroStatus:@[microState]]; + MicroStateModel *microState = [MicroStateModel modelWithJSON:roomInfoDictionary[@"micInfo"]]; +// [[XPIMManager shareManager].microQueueManager updateMicroStatus:@[microState]]; } break; //更新了房间信息 也更新了麦序的信息 @@ -73,15 +73,15 @@ [delegate onChatRoomInfoUpdated:self.roomInfo]; } } - NSArray * array = [MicroModel modelsWithArray:roomInfoDictionary[@"micInfo"]]; - [[XPIMManager shareManager].microQueueManager updateMicroStatus:array]; + NSArray * array = [MicroStateModel modelsWithArray:roomInfoDictionary[@"micInfo"]]; +// [[XPIMManager shareManager].microQueueManager updateMicroStatus:array]; } break; } } - (void)onRoomQueueUpdate:(NIMChatroomNotificationContent *)content { - [[XPIMManager shareManager].microQueueManager onReceiveRoomQueueUpdate:content]; +// [[XPIMManager shareManager].microQueueManager onReceiveRoomQueueUpdate:content]; if (content.eventType == NIMChatroomEventTypeQueueChange) { } @@ -165,7 +165,7 @@ #pragma mark - XPIMRoomInterface - (void)enterRoomWithRoomId:(NSString *)roomId userInfo:(UserInfoModel *)userInfo { ///TODO 先保存一下用户信息 先调试代码 - [[XPIMManager shareManager].microQueueManager setCurrentUserInfo:userInfo]; +// [[XPIMManager shareManager].microQueueManager setCurrentUserInfo:userInfo]; NIMChatroomEnterRequest *request = [[NIMChatroomEnterRequest alloc] init]; @@ -178,16 +178,16 @@ [extSource setObject:@(userInfo.erbanNo) forKey:@"erbanNo"]; } NSMutableDictionary *ext = [NSMutableDictionary dictionaryWithObject:extSource forKey:[NSString stringWithFormat:@"%ld", userInfo.uid]]; - request.roomExt = [ext objectToJSONString]; + request.roomExt = [ext toJSONString]; [[NIMSDK sharedSDK].chatroomManager enterChatroom:request completion:^(NSError * _Nullable error, NIMChatroom * _Nullable chatroom, NIMChatroomMember * _Nullable me) { - NSDictionary *info = (NSDictionary *)[chatroom.ext JSONObject]; - NSDictionary *micDictionary = [info[@"micQueue"] JSONObject]; + NSDictionary *info = (NSDictionary *)[chatroom.ext toJSONObject]; + NSDictionary *micDictionary = [info[@"micQueue"] toJSONString]; ///加入声网的频道 [[RtcManager instance] enterRoom:roomId]; ///初始化房间队列 - [[XPIMManager shareManager].microQueueManager enterRoomRepairMicQueue:micDictionary]; - [[XPIMManager shareManager].microQueueManager fetchRoomQueue:roomId]; +// [[XPIMManager shareManager].microQueueManager enterRoomRepairMicQueue:micDictionary]; +// [[XPIMManager shareManager].microQueueManager fetchRoomQueue:roomId]; }]; } diff --git a/xplan-ios/Main/IM/XPIMManager.h b/xplan-ios/Main/IM/XPIMManager.h index 9896bfee..bd061798 100644 --- a/xplan-ios/Main/IM/XPIMManager.h +++ b/xplan-ios/Main/IM/XPIMManager.h @@ -7,7 +7,6 @@ #import #import "XPIMRoomInterface.h" -#import "XPIMRoomMicQueueInterface.h" #import "XPIMChatRoomMemberInterface.h" NS_ASSUME_NONNULL_BEGIN @@ -15,8 +14,6 @@ NS_ASSUME_NONNULL_BEGIN + (instancetype)shareManager; ///聊天室的管理类 @property (nonatomic,strong, readonly) id chatRoomManager; -///麦序的管理类 -@property (nonatomic,strong, readonly) id microQueueManager; ///房间成员管理类 @property (nonatomic,strong, readonly) id chatRoomMemberManager; @end diff --git a/xplan-ios/Main/IM/XPIMManager.m b/xplan-ios/Main/IM/XPIMManager.m index 6042ea16..461da0d5 100644 --- a/xplan-ios/Main/IM/XPIMManager.m +++ b/xplan-ios/Main/IM/XPIMManager.m @@ -7,13 +7,10 @@ #import "XPIMManager.h" #import "XPImRoomImpl.h" -#import "XPIMRoomMicQueueImpl.h" #import "XPIMChatRoomMemberImpl.h" @interface XPIMManager () ///聊天室的管理类 @property (nonatomic,strong) id chatRoomManager; -///麦序的管理类 -@property (nonatomic,strong) id microQueueManager; ///房间成员管理类 @property (nonatomic,strong) id chatRoomMemberManager; @end @@ -36,14 +33,6 @@ return _chatRoomManager; } - -- (id)microQueueManager { - if (!_microQueueManager) { - _microQueueManager = [[XPIMRoomMicQueueImpl alloc] init]; - } - return _microQueueManager; -} - - (id)chatRoomMemberManager { if (!_chatRoomMemberManager) { _chatRoomMemberManager = [[XPIMChatRoomMemberImpl alloc] init]; diff --git a/xplan-ios/Main/Login/Model/ThirdUserInfo.h b/xplan-ios/Main/Login/Model/ThirdUserInfo.h index 7bc96da8..50c65f0a 100644 --- a/xplan-ios/Main/Login/Model/ThirdUserInfo.h +++ b/xplan-ios/Main/Login/Model/ThirdUserInfo.h @@ -5,11 +5,11 @@ // Created by 冯硕 on 2021/9/13. // -#import "BaseObject.h" +#import "NSObject+MJExtension.h" NS_ASSUME_NONNULL_BEGIN -@interface ThirdUserInfo : BaseObject +@interface ThirdUserInfo : NSObject ///用户名 @property (nonatomic,copy) NSString *userName; ///头像的地址 diff --git a/xplan-ios/Main/Match/XCFlutterKeyConst.h b/xplan-ios/Main/Match/XCFlutterKeyConst.h index 103bfdd8..6ea5a85d 100644 --- a/xplan-ios/Main/Match/XCFlutterKeyConst.h +++ b/xplan-ios/Main/Match/XCFlutterKeyConst.h @@ -34,6 +34,8 @@ static NSString *const YYFlutterPushNavitePagePaymentPwd = @"paymentPwd"; static NSString *const YYFlutterPushNavitePageBindPaymentPwd = @"bindPaymentPwd"; ///跳转Webview static NSString *const YYFlutterPushNavitePageWebview = @"openWebview"; +///跳转房间 +static NSString *const YYFlutterPushNavitePageChatRoom = @"chatRoom"; #pragma mark - navite跳转flutter页面 #endif /* XCFlutterKeyConst_h */ diff --git a/xplan-ios/Main/Match/XplanFlutterBoostDelegate.m b/xplan-ios/Main/Match/XplanFlutterBoostDelegate.m index a7b878c1..b2cb47b4 100644 --- a/xplan-ios/Main/Match/XplanFlutterBoostDelegate.m +++ b/xplan-ios/Main/Match/XplanFlutterBoostDelegate.m @@ -12,6 +12,7 @@ #import "XplanFlutterBoostDelegate.h" #import "XCFlutterKeyConst.h" #import "XPWebViewController.h" +#import "XPRoomViewController.h" #import "XPHtmlUrl.h" #import "XplanFBFlutterViewContainer.h" @@ -72,7 +73,12 @@ - (UIViewController *)getNaviteClassNameWithPageName:(NSString *)pageName arguments:(NSDictionary *)arguments { if ([pageName isEqualToString:YYFlutterPushNavitePageCharge]) { return [[NSClassFromString(@"XPMineRechargeViewController") alloc] init]; - } else + } else if ([pageName isEqualToString:YYFlutterPushNavitePageChatRoom]) { + XPRoomViewController* room = [[XPRoomViewController alloc]init]; + room.roomUid = arguments[@"chatRoomID"]; + room.roomUid = @"1004699"; + return room; + } // if([pageName isEqualToString:YYFlutterPushNavitePageBindPaymentPwd]){ // return [[NSClassFromString(@"TTPayPwdViewController") alloc] init];; // } else if([pageName isEqualToString:YYFlutterPushNavitePageBindGameAccount]){ diff --git a/xplan-ios/Main/Mine/Model/Recharge/RechargeListModel.h b/xplan-ios/Main/Mine/Model/Recharge/RechargeListModel.h index 49b2b579..e7a05f3a 100644 --- a/xplan-ios/Main/Mine/Model/Recharge/RechargeListModel.h +++ b/xplan-ios/Main/Mine/Model/Recharge/RechargeListModel.h @@ -5,11 +5,11 @@ // Created by 冯硕 on 2021/9/24. // -#import "BaseObject.h" +#import "NSObject+MJExtension.h" NS_ASSUME_NONNULL_BEGIN -@interface RechargeListModel : BaseObject +@interface RechargeListModel : NSObject ///充值的id @property(nonatomic, strong) NSString *chargeProdId; @property(nonatomic, strong) NSString *prodName; diff --git a/xplan-ios/Main/Mine/Model/Recharge/WalletInfoModel.h b/xplan-ios/Main/Mine/Model/Recharge/WalletInfoModel.h index ab95e095..7272924a 100644 --- a/xplan-ios/Main/Mine/Model/Recharge/WalletInfoModel.h +++ b/xplan-ios/Main/Mine/Model/Recharge/WalletInfoModel.h @@ -5,11 +5,11 @@ // Created by 冯硕 on 2021/9/26. // -#import "BaseObject.h" +#import "NSObject+MJExtension.h" NS_ASSUME_NONNULL_BEGIN -@interface WalletInfoModel : BaseObject +@interface WalletInfoModel : NSObject /// 用户 uid @property(nonatomic, assign) NSInteger uid; /// 钻石数量 diff --git a/xplan-ios/Main/Mine/Model/XPMineNotificationItemModel.h b/xplan-ios/Main/Mine/Model/XPMineNotificationItemModel.h index bd247975..7b195ba2 100644 --- a/xplan-ios/Main/Mine/Model/XPMineNotificationItemModel.h +++ b/xplan-ios/Main/Mine/Model/XPMineNotificationItemModel.h @@ -5,11 +5,11 @@ // Created by 冯硕 on 2021/9/17. // -#import "BaseObject.h" +#import "NSObject+MJExtension.h" NS_ASSUME_NONNULL_BEGIN -@interface XPMineNotificationItemModel : BaseObject +@interface XPMineNotificationItemModel : NSObject /// 标题 @property (nonatomic, copy) NSString *title; /// 描述 diff --git a/xplan-ios/Main/Mine/Model/XPMineNotifyStatus.h b/xplan-ios/Main/Mine/Model/XPMineNotifyStatus.h index 4d8aff40..a29d7a62 100644 --- a/xplan-ios/Main/Mine/Model/XPMineNotifyStatus.h +++ b/xplan-ios/Main/Mine/Model/XPMineNotifyStatus.h @@ -5,11 +5,11 @@ // Created by 冯硕 on 2021/9/17. // -#import "BaseObject.h" +#import "NSObject+MJExtension.h" NS_ASSUME_NONNULL_BEGIN -@interface XPMineNotifyStatus : BaseObject +@interface XPMineNotifyStatus : NSObject ///系统消息通知 @property (nonatomic, assign) BOOL sysMsgNotify; @end diff --git a/xplan-ios/Main/Mine/Presenter/XPMineRechargePresenter.m b/xplan-ios/Main/Mine/Presenter/XPMineRechargePresenter.m index 41997d61..79b87752 100644 --- a/xplan-ios/Main/Mine/Presenter/XPMineRechargePresenter.m +++ b/xplan-ios/Main/Mine/Presenter/XPMineRechargePresenter.m @@ -11,7 +11,7 @@ ///Tool #import "AccountInfoStorage.h" #import "YYUtility.h" -#import "NSObject+JSONString.h" +#import "NSObject+MJExtension.h" ///P #import "XPMineRechargeProtocol.h" ///Model @@ -73,7 +73,7 @@ /// 批量验证内购掉单 /// @param transcations 凭据的数组 - (void)checkTranscationIds:(NSArray *)transcations { - NSString * transcationIdStr = [transcations objectToJSONString]; + NSString * transcationIdStr = [transcations toJSONString]; [Api requestCheckTranscationIds:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [[self getView] checkTranscationIdsSuccess]; }] transcationIdStr:transcationIdStr]; diff --git a/xplan-ios/Main/Mine/View/Recharge/XPMineRechargeViewController.m b/xplan-ios/Main/Mine/View/Recharge/XPMineRechargeViewController.m index 8cb2b72d..2b13296a 100644 --- a/xplan-ios/Main/Mine/View/Recharge/XPMineRechargeViewController.m +++ b/xplan-ios/Main/Mine/View/Recharge/XPMineRechargeViewController.m @@ -16,7 +16,7 @@ #import "XPIAPHelper.h" #import "RechargeStorage.h" #import "AccountInfoStorage.h" -#import "NSObject+JSONString.h" +#import "NSObject+MJExtension.h" ///Model #import "RechargeListModel.h" ///View @@ -135,7 +135,7 @@ [dictionary setObject:transactionIdentifier forKey:@"transcationId"]; [dictionary setObject:encodeStr forKey:@"recipt"]; [dictionary setObject:self.orderId forKey:@"orderId"]; - NSString *reciptJson = [dictionary objectToJSONString]; + NSString *reciptJson = [dictionary toJSONString]; NSString * uid = [AccountInfoStorage instance].getUid; BOOL saveSuccess = [RechargeStorage saveTranscationId:transactionIdentifier recipt:reciptJson uid:uid]; if (!saveSuccess) { diff --git a/xplan-ios/Main/Room/Model/RoomInfoModel.h b/xplan-ios/Main/Room/Model/RoomInfoModel.h index ce129d16..c61dd2f7 100644 --- a/xplan-ios/Main/Room/Model/RoomInfoModel.h +++ b/xplan-ios/Main/Room/Model/RoomInfoModel.h @@ -5,7 +5,7 @@ // Created by 冯硕 on 2021/10/18. // -#import "BaseObject.h" +#import "NSObject+MJExtension.h" #import "XPEnum.h" NS_ASSUME_NONNULL_BEGIN @@ -14,7 +14,7 @@ typedef NS_ENUM(NSInteger, RoomType) { }; -@interface RoomInfoModel : BaseObject +@interface RoomInfoModel : NSObject @property (nonatomic , copy) NSString * nick; @property (nonatomic , assign) NSInteger uid; @property (nonatomic , assign) NSInteger isRecom; diff --git a/xplan-ios/Main/Room/Presenter/XPRoomPresenter.h b/xplan-ios/Main/Room/Presenter/XPRoomPresenter.h index 2dc71ea6..49ca0712 100644 --- a/xplan-ios/Main/Room/Presenter/XPRoomPresenter.h +++ b/xplan-ios/Main/Room/Presenter/XPRoomPresenter.h @@ -9,8 +9,9 @@ #import "RoomInfoModel.h" NS_ASSUME_NONNULL_BEGIN -@interface XPRoomPresenter : BaseMvpPresenter +@class UserInfoModel; +@interface XPRoomPresenter : BaseMvpPresenter /// 获取用户信息 - (void)getUserInfoWithUid:(NSString *)uid; @@ -19,6 +20,8 @@ NS_ASSUME_NONNULL_BEGIN /// @param uid 进入的房间的uid - (void)getRoomInfoWithUid:(NSString *)uid; +- (void)enterNIMRoom:(NSString *)roomId user:(UserInfoModel*)userInfo; + /// 开启用户自己的房间 /// @param title 房间标题 /// @param type 房间类型 diff --git a/xplan-ios/Main/Room/Presenter/XPRoomPresenter.m b/xplan-ios/Main/Room/Presenter/XPRoomPresenter.m index 604742c6..34d00d5e 100644 --- a/xplan-ios/Main/Room/Presenter/XPRoomPresenter.m +++ b/xplan-ios/Main/Room/Presenter/XPRoomPresenter.m @@ -11,9 +11,12 @@ #import "UserInfoModel.h" ///Tool #import "AccountInfoStorage.h" +#import "NSObject+MJExtension.h" ///P #import "XPRoomProtocol.h" +#import + @implementation XPRoomPresenter @@ -40,6 +43,28 @@ } showLoading:YES errorToast:NO] uid:uid intoUid:intoUid]; } +- (void)enterNIMRoom:(NSString *)roomId user:(UserInfoModel *)userInfo { + NIMChatroomEnterRequest *request = [[NIMChatroomEnterRequest alloc] init]; + request.roomId = roomId; + //设置ext + NSMutableDictionary *extSource = [NSMutableDictionary dictionary]; + //defUser + if (userInfo) { + [extSource setObject:@(userInfo.defUser) forKey:@"defUser"]; + [extSource setObject:@(userInfo.erbanNo) forKey:@"erbanNo"]; + } + + NSMutableDictionary *ext = [NSMutableDictionary dictionaryWithObject:extSource forKey:[NSString stringWithFormat:@"%ld", userInfo.uid]]; + request.roomExt = [ext toJSONString]; + + [[NIMSDK sharedSDK].chatroomManager enterChatroom:request completion:^(NSError * _Nullable error, NIMChatroom * _Nullable chatroom, NIMChatroomMember * _Nullable me) { + if (error) { + [[self getView] enterRoomFail]; + } else { + [[self getView] enterRoomSuccess]; + } + }]; +} /// 开启用户自己的房间 /// @param title 房间标题 diff --git a/xplan-ios/Main/Room/Protocol/XPRoomProtocol.h b/xplan-ios/Main/Room/Protocol/XPRoomProtocol.h index 2e6fe538..1c1300b9 100644 --- a/xplan-ios/Main/Room/Protocol/XPRoomProtocol.h +++ b/xplan-ios/Main/Room/Protocol/XPRoomProtocol.h @@ -17,7 +17,9 @@ NS_ASSUME_NONNULL_BEGIN - (void)getRoomInfoSuccess:(RoomInfoModel *)roomInfo; ///开启房间成功 - (void)openRoomSuccess:(RoomInfoModel *)roomInfo; -///进入房间失败(当前获取用户信息、获取房间信息、开启房间失败,均会导致进房失败) +///进入房间成功 +- (void)enterRoomSuccess; +///进入房间失败(当前获取用户信息、获取房间信息、开启房间、进入云信房间失败,均会导致进房失败) - (void)enterRoomFail; @end diff --git a/xplan-ios/Main/Room/View/MessageContainerView/Model/XPMessageRemoteExtModel.h b/xplan-ios/Main/Room/View/MessageContainerView/Model/XPMessageRemoteExtModel.h index 10985dce..73fa3baa 100644 --- a/xplan-ios/Main/Room/View/MessageContainerView/Model/XPMessageRemoteExtModel.h +++ b/xplan-ios/Main/Room/View/MessageContainerView/Model/XPMessageRemoteExtModel.h @@ -5,11 +5,11 @@ // Created by 冯硕 on 2021/10/27. // 解析message 的扩展的模型 -#import "BaseObject.h" +#import "NSObject+MJExtension.h" #import "UserLevelVo.h" NS_ASSUME_NONNULL_BEGIN -@interface XPMessageRemoteExtModel : BaseObject +@interface XPMessageRemoteExtModel : NSObject ///魅力等级 @property (nonatomic,copy) NSString *charmUrl; /// diff --git a/xplan-ios/Main/Room/View/PositionContainerView/PositionView/Object/XPRoomPositionDataSourceProtocol.h b/xplan-ios/Main/Room/View/PositionContainerView/PositionView/Object/XPRoomPositionDataSourceProtocol.h deleted file mode 100644 index 9e500d00..00000000 --- a/xplan-ios/Main/Room/View/PositionContainerView/PositionView/Object/XPRoomPositionDataSourceProtocol.h +++ /dev/null @@ -1,25 +0,0 @@ -// -// XPRoomPositionDataSourceProtocol.h -// xplan-ios -// -// Created by 冯硕 on 2021/10/15. -// - -#import - -NS_ASSUME_NONNULL_BEGIN -@class MicroQueueItemModel; -@protocol XPRoomPositionDataSourceProtocol -@optional; -///为坑位的昵称赋值 -- (void)configNormalPositionItem:(int)position; -///赋值给item -- (void)configPositionItem:(MicroQueueItemModel *)model; -///坑位用户正在说话 -- (void)itemUserSpeaking; -///获取当前的item的坑位数 -- (int)getItemPosition; - -@end - -NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Room/View/PositionContainerView/PositionView/Object/XPRoomPositionDelegateImpl.h b/xplan-ios/Main/Room/View/PositionContainerView/PositionView/Object/XPRoomPositionDelegateImpl.h deleted file mode 100644 index 112578e8..00000000 --- a/xplan-ios/Main/Room/View/PositionContainerView/PositionView/Object/XPRoomPositionDelegateImpl.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// XPRoomPositionDataSourceImpl.h -// xplan-ios -// -// Created by 冯硕 on 2021/10/15. -// - -#import -#import "XPRoomPositionDelgate.h" -NS_ASSUME_NONNULL_BEGIN - -@interface XPRoomPositionDelegateImpl : NSObject - -@end - -NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Room/View/PositionContainerView/PositionView/Object/XPRoomPositionDelegateImpl.m b/xplan-ios/Main/Room/View/PositionContainerView/PositionView/Object/XPRoomPositionDelegateImpl.m deleted file mode 100644 index 4323a73a..00000000 --- a/xplan-ios/Main/Room/View/PositionContainerView/PositionView/Object/XPRoomPositionDelegateImpl.m +++ /dev/null @@ -1,44 +0,0 @@ -// -// XPRoomPositionDataSourceImpl.m -// xplan-ios -// -// Created by 冯硕 on 2021/10/15. -// - -#import "XPRoomPositionDelegateImpl.h" -#import "TTPopup.h" -#import "XPIMManager.h" -#import "AccountInfoStorage.h" -///Model -#import "UserInfoModel.h" -#import "MicroQueueItemModel.h" -#import "AccountInfoStorage.h" - - -@implementation XPRoomPositionDelegateImpl - -- (void)showManagerMicroSheet:(NSString *)postion { - TTActionSheetConfig *upMic = [TTActionSheetConfig normalTitle:@"上麦" clickAction:^{ - [[XPIMManager shareManager].microQueueManager upMic:postion]; - }]; - - TTActionSheetConfig *downMic = [TTActionSheetConfig normalTitle:@"下麦" clickAction:^{ - [[XPIMManager shareManager].microQueueManager downMic:postion]; - }]; - - MicroQueueItemModel * micModel = [[XPIMManager shareManager].microQueueManager.microQueue objectForKey:postion]; - if (micModel.userInfo && [AccountInfoStorage instance].getUid.integerValue == micModel.userInfo.uid) { - [TTPopup actionSheetWithItems:@[downMic]]; - } else { - [TTPopup actionSheetWithItems:@[upMic]]; - } -} - - -#pragma mark - XPRoomPositionDelgate -- (void)didClickPositionItem:(NSString *)postion { - [self showManagerMicroSheet:postion]; -} - - -@end diff --git a/xplan-ios/Main/Room/View/PositionContainerView/PositionView/Object/XPRoomPositionDelgate.h b/xplan-ios/Main/Room/View/PositionContainerView/PositionView/Object/XPRoomPositionDelgate.h deleted file mode 100644 index a358cb16..00000000 --- a/xplan-ios/Main/Room/View/PositionContainerView/PositionView/Object/XPRoomPositionDelgate.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// XPRoomPositionDelgate.h -// xplan-ios -// -// Created by 冯硕 on 2021/10/22. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@protocol XPRoomPositionDelgate - -///点击了某个item -- (void)didClickPositionItem:(NSString *)postion; - -@end - -NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Room/View/PositionContainerView/PositionView/Object/XPRoomPositionLayoutImpl.h b/xplan-ios/Main/Room/View/PositionContainerView/PositionView/Object/XPRoomPositionLayoutImpl.h deleted file mode 100644 index 59dc943d..00000000 --- a/xplan-ios/Main/Room/View/PositionContainerView/PositionView/Object/XPRoomPositionLayoutImpl.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// XPRoomPositionLayoutImpl.h -// xplan-ios -// -// Created by 冯硕 on 2021/10/15. -// - -#import -///P -#import "XPRoomPositionLayoutProtocol.h" -NS_ASSUME_NONNULL_BEGIN - -@interface XPRoomPositionLayoutImpl : NSObject - -- (CGFloat)getPositionViewHeight; - -@end - -NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Room/View/PositionContainerView/PositionView/Object/XPRoomPositionLayoutImpl.m b/xplan-ios/Main/Room/View/PositionContainerView/PositionView/Object/XPRoomPositionLayoutImpl.m deleted file mode 100644 index 4e1f07de..00000000 --- a/xplan-ios/Main/Room/View/PositionContainerView/PositionView/Object/XPRoomPositionLayoutImpl.m +++ /dev/null @@ -1,131 +0,0 @@ -// -// XPRoomPositionLayoutImpl.m -// xplan-ios -// -// Created by 冯硕 on 2021/10/15. -// - -#import "XPRoomPositionLayoutImpl.h" -///Tool -#import "XPMacro.h" -///View -#import "XCRoomPostionNickView.h" - - -@implementation XPRoomPositionLayoutImpl - -///多少个item -- (int)numberOfItems { - return 9; -} - -///item的class 所有的坑位的样式是相同的 如果不同的话 在做 -- (Class)classOfPositionItme { - return [XCRoomPostionNickView class]; -} - - -///获取所有item中心点 -- (NSArray *)getPositionItemsCenter { - int number = [self numberOfItems]; - CGSize itemSize = [self getNormalItemSize]; - CGSize ownerSize = [self getOwnerItemSize]; - CGFloat lineSpace = [self getItemsLineSpace]; - CGFloat interiteSpace = [self getItemsInteritemSpace]; - CGFloat ownerItemMaxY = ownerSize.height + [self getOwnerItemToNormalItemHeight]; - - CGPoint ownerCenter = CGPointMake(KScreenWidth / 2, ownerSize.height / 2); - NSMutableArray* itemArray = [NSMutableArray arrayWithCapacity:number]; - NSValue * ownerCenterValue = [NSValue valueWithCGPoint:ownerCenter]; - [itemArray addObject:ownerCenterValue]; - - for (int i = 1; i < number; i++) { - CGPoint itemCenter = CGPointZero; - if (i <= 4) { - itemCenter = CGPointMake(itemSize.width / 2 + (itemSize.width + interiteSpace) * (i -1), ownerItemMaxY + itemSize.height/ 2); - } else { - itemCenter = CGPointMake(itemSize.width / 2 + (itemSize.width + interiteSpace) * (i -1), ownerItemMaxY + itemSize.height/ 2 + itemSize.height + lineSpace); - } - NSValue * itemCenterValue = [NSValue valueWithCGPoint:itemCenter]; - [itemArray addObject:itemCenterValue]; - } - return itemArray; -} - -///获取所有item的布局 -- (NSArray *)getPositionItemsRect { - int number = [self numberOfItems]; - CGSize itemSize = [self getNormalItemSize]; - CGSize ownerSize = [self getOwnerItemSize]; - CGFloat lineSpace = [self getItemsLineSpace]; - CGFloat interiteSpace = [self getItemsInteritemSpace]; - CGFloat ownerItemMaxY = [self getOwnerItemSize].height + [self getOwnerItemToNormalItemHeight]; - NSMutableArray* itemArray = [NSMutableArray arrayWithCapacity:number]; - CGRect ownerRect = CGRectMake((KScreenWidth - 40)/2 - ownerSize.width / 2, 0, ownerSize.width, ownerSize.height); - NSValue * ownerFrameValue = [NSValue valueWithCGRect:ownerRect]; - [itemArray addObject:ownerFrameValue]; - for (int i = 1; i < number; i++) { - CGPoint itemOrigin = CGPointZero; - if (i <= 4) { - itemOrigin = CGPointMake((itemSize.width + interiteSpace) * (i -1), ownerItemMaxY); - } else { - itemOrigin = CGPointMake((itemSize.width + interiteSpace) * (i-4 -1), ownerItemMaxY + itemSize.height + lineSpace); - } - CGRect itemRect = CGRectMake(itemOrigin.x, itemOrigin.y, itemSize.width, itemSize.height); - NSValue * itemRectValue = [NSValue valueWithCGRect:itemRect]; - [itemArray addObject:itemRectValue]; - } - return itemArray; -} - -#pragma mark - Public Method -- (CGFloat)getPositionViewHeight { - CGFloat height = 0; - CGSize itemSize = [self getNormalItemSize]; - CGSize ownerSize = [self getOwnerItemSize]; - CGFloat lineSpace = [self getItemsLineSpace]; - int numberLine =([self numberOfItems] -1)/ [self numberOfItemInLine]; - height = ownerSize.height +(itemSize.height + lineSpace) * numberLine + [self getOwnerItemToNormalItemHeight]; - return height; -} - -#pragma mark - Private Method -///获取房主坑位的大小 -- (CGSize)getOwnerItemSize { - return CGSizeMake(58 + 5, 58 + 12 + 6 + 5); -} -///获取普通坑位的大小 -- (CGSize)getNormalItemSize { - CGFloat itemWidth = 55 + 5; - return CGSizeMake(itemWidth, itemWidth + 12 + 6); -} -///获取行之间的间隙 -- (CGFloat)getItemsLineSpace { - return 15; -} - -///获取列之间的间隙 -- (CGFloat)getItemsInteritemSpace { - int number= [self numberOfItemInLine]; - CGFloat itemWidth = (KScreenWidth - 40 - [self getNormalItemSize].width * number) / (number - 1); - return itemWidth; - -} - -///获取容器外部的间隙 -- (UIEdgeInsets)getContainerEsgeInsets { - return UIEdgeInsetsMake(0, 20, 0, 20); -} - -///房主item和普通item之间的距离 -- (CGFloat)getOwnerItemToNormalItemHeight { - return 33; -} - - -///一列有几个item 房主不算 -- (int)numberOfItemInLine { - return 4; -} - -@end diff --git a/xplan-ios/Main/Room/View/PositionContainerView/PositionView/Object/XPRoomPositionLayoutProtocol.h b/xplan-ios/Main/Room/View/PositionContainerView/PositionView/Object/XPRoomPositionLayoutProtocol.h deleted file mode 100644 index d01f4bc0..00000000 --- a/xplan-ios/Main/Room/View/PositionContainerView/PositionView/Object/XPRoomPositionLayoutProtocol.h +++ /dev/null @@ -1,27 +0,0 @@ -// -// XPRoomPositionLayoutProtocol.h -// xplan-ios -// -// Created by 冯硕 on 2021/10/15. -// - -#import - -NS_ASSUME_NONNULL_BEGIN - -@protocol XPRoomPositionLayoutProtocol -///多少个item -- (int)numberOfItems; -///一列有几个item -- (int)numberOfItemInLine; -///item的class 所有的坑位的样式是相同的 如果不同的话 在做 -- (Class)classOfPositionItme; -///获取所有item的布局 -- (NSArray *)getPositionItemsCenter; -///获取所有item的布局 -- (NSArray *)getPositionItemsRect; -///获取容器外部的间隙 -- (UIEdgeInsets)getContainerEsgeInsets; -@end - -NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Room/View/PositionContainerView/PositionView/View/XCRoomPostionNickView.h b/xplan-ios/Main/Room/View/PositionContainerView/PositionView/View/XCRoomPostionNickView.h deleted file mode 100644 index af86030a..00000000 --- a/xplan-ios/Main/Room/View/PositionContainerView/PositionView/View/XCRoomPostionNickView.h +++ /dev/null @@ -1,16 +0,0 @@ - // -// XCRoomPostionNickView.h -// xplan-ios -// -// Created by 冯硕 on 2021/10/15. -// - -#import "XPRoomPostionBaseItemView.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface XCRoomPostionNickView : XPRoomPostionBaseItemView - -@end - -NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Room/View/PositionContainerView/PositionView/View/XCRoomPostionNickView.m b/xplan-ios/Main/Room/View/PositionContainerView/PositionView/View/XCRoomPostionNickView.m deleted file mode 100644 index 9ecc6993..00000000 --- a/xplan-ios/Main/Room/View/PositionContainerView/PositionView/View/XCRoomPostionNickView.m +++ /dev/null @@ -1,139 +0,0 @@ -// -// XCRoomPostionNickView.m -// xplan-ios -// -// Created by 冯硕 on 2021/10/15. -// - -#import "XCRoomPostionNickView.h" -///Third -#import -///Tool -#import "ThemeColor.h" -#import "UIImageView+LoadImage.h" -///Model -#import "MicroQueueItemModel.h" -#import "MicroModel.h" -#import "UserInfoModel.h" - -@interface XCRoomPostionNickView () -///容器 -@property (nonatomic,strong) UIStackView *stackView; -///几号坑位 -@property (nonatomic,strong) UILabel *postionLabel; -///用户名/号麦位 -@property (nonatomic,strong) UILabel *nickLabel; -@end - -@implementation XCRoomPostionNickView - -- (void)initSubViews { - [super initSubViews]; - [self addSubview:self.stackView]; - - [self.stackView addArrangedSubview:self.postionLabel]; - [self.stackView addArrangedSubview:self.nickLabel]; -} - -- (void)initSubViewConstraints { - [super initSubViewConstraints]; - [self.stackView mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerX.mas_equalTo(self); - make.top.mas_equalTo(self.avatarImageView.mas_bottom).offset(7); - }]; - - [self.postionLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.height.mas_equalTo(14); - }]; -} - -#pragma mark - Private Method -- (void)configItemStatus:(MicroModel *)micState { - self.micStateImageView.hidden = micState.micState == MicroMicStateType_Open; - if (micState.posState == MicroPosStateType_Free) { - self.avatarImageView.image = [UIImage imageNamed:@"room_position_normal"]; - } else { - self.avatarImageView.image = [UIImage imageNamed:@"room_position_lock"]; - } - self.postionLabel.text = [NSString stringWithFormat:@"%d", micState.position + 1]; -} - -- (void)confiItemAvatarNick:(UserInfoModel *)userInfo { - self.nickLabel.text = @"号坑位"; - if (userInfo) { - [self.avatarImageView load_imageWithUrl:userInfo.avatar placeholderImage:[UIImageConstant defaultAvatarPlaceholder]]; - if (userInfo.gender == GenderType_Male) { - [self.postionLabel setBackgroundColor:[ThemeColor positionMaleNickBackColor]]; - } else if(userInfo.gender == GenderType_Female){ - [self.postionLabel setBackgroundColor:[ThemeColor positionFemaleNickBackColor]]; - } - if (userInfo.nick.length > 0) { - self.nickLabel.text = userInfo.nick; - } - } else { - [self.postionLabel setBackgroundColor:[ThemeColor positionNormalNickBackColor]]; - } - -} - -#pragma mark - XPRoomPositionDataSourceProtocol -- (void)configNormalPositionItem:(int)position { - self.position = position; - if (position == 0) { - self.postionLabel.hidden = YES; - self.nickLabel.hidden = YES; - } else { - self.postionLabel.hidden = NO; - self.nickLabel.hidden = NO; - self.postionLabel.text = [NSString stringWithFormat:@"%d", position]; - self.nickLabel.text = @"号麦位"; - } -} - - -- (void)configPositionItem:(MicroQueueItemModel *)model { - MicroModel * micStats = model.microState; - UserInfoModel * userInfo = model.userInfo; - [self configItemStatus:micStats]; - [self confiItemAvatarNick:userInfo]; -} - - -#pragma mark - Getters And Setters -- (UILabel *)nickLabel { - if (!_nickLabel) { - _nickLabel = [[UILabel alloc] init]; - _nickLabel.font = [UIFont systemFontOfSize:11]; - _nickLabel.textColor = [ThemeColor mainTextColor]; - _nickLabel.textAlignment = NSTextAlignmentCenter; - } - return _nickLabel; -} - -- (UIStackView *)stackView { - if (!_stackView) { - _stackView = [[UIStackView alloc] init]; - _stackView.axis = UILayoutConstraintAxisHorizontal; - _stackView.distribution = UIStackViewDistributionFill; - _stackView.alignment = UIStackViewAlignmentCenter; - _stackView.spacing = 2; - } - return _stackView; -} - -- (UILabel *)postionLabel { - if (!_postionLabel) { - _postionLabel = [[UILabel alloc] init]; - _postionLabel.font = [UIFont systemFontOfSize:10]; - _postionLabel.textAlignment = NSTextAlignmentCenter; - _postionLabel.textColor = [ThemeColor mainTextColor]; - _postionLabel.layer.masksToBounds = YES; - _postionLabel.layer.cornerRadius = 7; - - [_postionLabel setBackgroundColor:[ThemeColor positionNormalNickBackColor]]; - } - return _postionLabel; -} - - -@end diff --git a/xplan-ios/Main/Room/View/PositionContainerView/PositionView/View/XPRoomPostionBaseItemView.h b/xplan-ios/Main/Room/View/PositionContainerView/PositionView/View/XPRoomPostionBaseItemView.h deleted file mode 100644 index 7ccf59f7..00000000 --- a/xplan-ios/Main/Room/View/PositionContainerView/PositionView/View/XPRoomPostionBaseItemView.h +++ /dev/null @@ -1,25 +0,0 @@ -// -// XPRoomPostionBaseItemView.h -// xplan-ios -// -// Created by 冯硕 on 2021/10/15. -// - -#import -#import "XPRoomPositionDataSourceProtocol.h" -NS_ASSUME_NONNULL_BEGIN - -@interface XPRoomPostionBaseItemView : UIView -///头像 -@property (nonatomic,strong, readonly) UIImageView *avatarImageView; -///坑位是否闭麦的 -@property (nonatomic,strong, readonly) UIImageView *micStateImageView; -///坑位的编号 -@property (nonatomic,assign) int position; - -- (void)initSubViews; -- (void)initSubViewConstraints; - -@end - -NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Room/View/PositionContainerView/PositionView/View/XPRoomPostionBaseItemView.m b/xplan-ios/Main/Room/View/PositionContainerView/PositionView/View/XPRoomPostionBaseItemView.m deleted file mode 100644 index 6f2aefe6..00000000 --- a/xplan-ios/Main/Room/View/PositionContainerView/PositionView/View/XPRoomPostionBaseItemView.m +++ /dev/null @@ -1,106 +0,0 @@ -// -// XPRoomPostionBaseItemView.m -// xplan-ios -// -// Created by 冯硕 on 2021/10/15. -// - -#import "XPRoomPostionBaseItemView.h" -///Third -#import -///View -#import "XPRoomPositionItemSpeakingView.h" -@interface XPRoomPostionBaseItemView () -///头像 -@property (nonatomic,strong) UIImageView *avatarImageView; -///坑位是否闭麦的 -@property (nonatomic,strong) UIImageView *micStateImageView; -///声波动画 -@property (nonatomic,strong) XPRoomPositionItemSpeakingView *animationView; -@end - -@implementation XPRoomPostionBaseItemView - -- (instancetype)initWithFrame:(CGRect)frame { - self = [super initWithFrame:frame]; - if (self) { - [self initSubViews]; - [self initSubViewConstraints]; - } - return self; -} - -- (void)layoutSubviews { - self.avatarImageView.layer.masksToBounds = YES; - self.avatarImageView.layer.cornerRadius = self.frame.size.width / 2; -} - -#pragma mark - Public Method -///开始展示声波动画 -- (void)startSpeakingAnimation { - [self.animationView startSpeakingAnimation]; -} -///结束声波动画 -- (void)stopSpeakingAnimation { - [self.animationView stopSpeakingAnimation]; -} - -- (void)initSubViews { - [self addSubview:self.animationView]; - [self addSubview:self.avatarImageView]; - [self addSubview:self.micStateImageView]; -} - -- (void)initSubViewConstraints { - [self.animationView mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.mas_equalTo(self.avatarImageView); - }]; - - [self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.right.top.mas_equalTo(self); - make.height.mas_equalTo(self.mas_width); - }]; - - [self.micStateImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.mas_equalTo(self.avatarImageView); - }]; -} - -#pragma mark - XPRoomPositionDataSourceProtocol -- (void)itemUserSpeaking { - [self startSpeakingAnimation]; -} - -- (int)getItemPosition { - return self.position; -} - - -#pragma mark - Getters And Setters -- (UIImageView *)avatarImageView { - if (!_avatarImageView) { - _avatarImageView = [[UIImageView alloc] init]; - _avatarImageView.userInteractionEnabled = YES; - _avatarImageView.image = [UIImage imageNamed:@"room_position_normal"]; - } - return _avatarImageView; -} - -- (UIImageView *)micStateImageView { - if (!_micStateImageView) { - _micStateImageView = [[UIImageView alloc] init]; - _micStateImageView.userInteractionEnabled = YES; - _micStateImageView.image = [UIImage imageNamed:@"room_position_mute"]; - _micStateImageView.hidden = YES; - } - return _micStateImageView; -} - -- (XPRoomPositionItemSpeakingView *)animationView { - if (!_animationView) { - _animationView = [[XPRoomPositionItemSpeakingView alloc] init]; - } - return _animationView; -} - -@end diff --git a/xplan-ios/Main/Room/View/PositionContainerView/PositionView/XPRoomPositionView.h b/xplan-ios/Main/Room/View/PositionContainerView/PositionView/XPRoomPositionView.h deleted file mode 100644 index 0fbf7ccb..00000000 --- a/xplan-ios/Main/Room/View/PositionContainerView/PositionView/XPRoomPositionView.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// XPRoomPositionView.h -// xplan-ios -// -// Created by 冯硕 on 2021/10/15. -// - -#import -#import "XPRoomPositionLayoutProtocol.h" -#import "XPRoomPositionDelgate.h" -#import "RtcManager.h" -NS_ASSUME_NONNULL_BEGIN - -@interface XPRoomPositionView : UIView - -- (instancetype)initWithFrame:(CGRect)frame layout:(id)layout delegate:(id)delegate; -@end - -NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Room/View/PositionContainerView/PositionView/XPRoomPositionView.m b/xplan-ios/Main/Room/View/PositionContainerView/PositionView/XPRoomPositionView.m deleted file mode 100644 index 026fddaa..00000000 --- a/xplan-ios/Main/Room/View/PositionContainerView/PositionView/XPRoomPositionView.m +++ /dev/null @@ -1,122 +0,0 @@ -// -// XPRoomPositionView.m -// xplan-ios -// -// Created by 冯硕 on 2021/10/15. -// - -#import "XPRoomPositionView.h" -///Model -#import "MicroQueueItemModel.h" -#import "UserInfoModel.h" -///Tool -#import "XPIMManager.h" - -///P -#import "XPRoomPositionDataSourceProtocol.h" - -@interface XPRoomPositionView () -///UI相关的 -@property (nonatomic,strong) id layout; -///所有的item的数组 -@property (nonatomic,strong) NSMutableArray *itemArray; -/// -@property (nonatomic,strong) id delegate; - -@end - -@implementation XPRoomPositionView - -- (void)dealloc { - [[XPIMManager shareManager].microQueueManager removeDelegate:self]; -} - -- (instancetype)initWithFrame:(CGRect)frame layout:(id)layout delegate:(id)delegate { - self = [super initWithFrame:frame]; - if (self) { - self.layout = layout; - self.delegate =delegate; - [[XPIMManager shareManager].microQueueManager addDelegate:self]; - [self initSubViews]; - } - return self; -} - -#pragma mark - Response -- (void)didTapItemRecognzier:(UITapGestureRecognizer *)tap { - UIView * view =(UIView *)[tap view]; - int position = [view getItemPosition]; - NSString * micPositon = [NSString stringWithFormat:@"%d", position - 1]; - if ([self.delegate respondsToSelector:@selector(didClickPositionItem:)]) { - [self.delegate didClickPositionItem:micPositon]; - } -} - - -#pragma mark - Private Method -- (void)initSubViews { - int number = [self.layout numberOfItems]; - NSArray * array = [self.layout getPositionItemsRect]; - for (int i = 0; i < number; i++) { - UIView * view = [self getItemView]; - [view configNormalPositionItem:i]; - NSValue * rect = [array objectAtIndex:i]; - view.frame = rect.CGRectValue; - [self addSubview:view]; - UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didTapItemRecognzier:)]; - [view addGestureRecognizer:tap]; - [self.itemArray addObject:view]; - } -} - -- (BOOL)positionItemUserIsSeaking:(NSMutableArray *)speakings uid:(NSString *)uid { - BOOL isSpeaking = NO; - for (NSString * speakingUid in speakings) { - if (speakingUid == uid) { - isSpeaking = YES; - break; - } - } - return isSpeaking; -} -#pragma mark - XPRoomPositionLayoutProtocol -- (UIView *)getItemView { - Class class = [self.layout classOfPositionItme]; - return [[class alloc] init];; -} -#pragma mark - XPIMRoomMicQueueDelegate -///获取房间队列成功 -- (void)onGetRoomMicroQueueSuccess:(NSDictionary*)microQueue { - for (int i = 0; i< self.itemArray.count; i++) { - UIView * view = [self.itemArray objectAtIndex:i]; - NSString *position = [NSString stringWithFormat:@"%d",i-1]; - MicroQueueItemModel * model = [microQueue objectForKey:position]; - [view configPositionItem:model]; - } -} - -#pragma mark - RtcDelegate -///声网声音的回调 -- (void)usersSpeaking:(NSMutableArray *)uids { - NSDictionary * microQueue = [XPIMManager shareManager].microQueueManager.microQueue; - for (int i = 0; i< self.itemArray.count; i++) { - UIView * view = [self.itemArray objectAtIndex:i]; - NSString *position = [NSString stringWithFormat:@"%d",i-1]; - MicroQueueItemModel * model = [microQueue objectForKey:position]; - if (model.userInfo) { - NSString * uid = [NSString stringWithFormat:@"%ld", model.userInfo.uid]; - if ([self positionItemUserIsSeaking:uids uid:uid]) { - [view itemUserSpeaking]; - } - } - } -} -#pragma mark - Getters And Setters -- (NSMutableArray *)itemArray { - if (!_itemArray) { - _itemArray = [NSMutableArray array]; - } - return _itemArray; -} - -@end diff --git a/xplan-ios/Main/Room/View/PositionContainerView/XPRoomPositionContainView.h b/xplan-ios/Main/Room/View/PositionContainerView/XPRoomPositionContainView.h deleted file mode 100644 index 8b501a78..00000000 --- a/xplan-ios/Main/Room/View/PositionContainerView/XPRoomPositionContainView.h +++ /dev/null @@ -1,18 +0,0 @@ -// -// XPRoomPositionView.h -// xplan-ios -// -// Created by 冯硕 on 2021/10/11. -// - -#import - -NS_ASSUME_NONNULL_BEGIN -@class XPRoomPositionView; -@interface XPRoomPositionContainView : UIView -///坑位 -@property (nonatomic,strong, readonly) XPRoomPositionView *postionView; -- (CGFloat)positionContainerViewHeight; -@end - -NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Room/View/PositionContainerView/XPRoomPositionContainView.m b/xplan-ios/Main/Room/View/PositionContainerView/XPRoomPositionContainView.m deleted file mode 100644 index d07b03ff..00000000 --- a/xplan-ios/Main/Room/View/PositionContainerView/XPRoomPositionContainView.m +++ /dev/null @@ -1,74 +0,0 @@ -// -// XPRoomPositionView.m -// xplan-ios -// -// Created by 冯硕 on 2021/10/11. -// - -#import "XPRoomPositionContainView.h" -///Third -#import -///Tool -#import "XPRoomPositionLayoutImpl.h" -#import "XPRoomPositionDelegateImpl.h" -///View -#import "XPRoomPositionView.h" - -@interface XPRoomPositionContainView () -/// -@property (nonatomic,strong) XPRoomPositionView *postionView; -/// -@property (nonatomic,strong) XPRoomPositionLayoutImpl *layoutImpl; -/// -@property (nonatomic,strong) XPRoomPositionDelegateImpl *delegate; -@end - -@implementation XPRoomPositionContainView -- (instancetype)initWithFrame:(CGRect)frame { - self = [super initWithFrame:frame]; - if (self) { - [self initSubViews]; - [self initSubViewConstraints]; - } - return self; -} -#pragma mark - Public Method -- (CGFloat)positionContainerViewHeight { - return [self.layoutImpl getPositionViewHeight]; -} - -#pragma mark - Private Method -- (void)initSubViews { - [self addSubview:self.postionView]; -} - -- (void)initSubViewConstraints { - [self.postionView mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.right.mas_equalTo(self).inset(20); - make.top.bottom.mas_equalTo(self); - }]; -} - -#pragma mark - Getters And Setters -- (XPRoomPositionView *)postionView { - if (!_postionView) { - _postionView = [[XPRoomPositionView alloc] initWithFrame:CGRectZero layout:self.layoutImpl delegate:self.delegate]; - } - return _postionView; -} - -- (XPRoomPositionLayoutImpl *)layoutImpl { - if (!_layoutImpl) { - _layoutImpl = [[XPRoomPositionLayoutImpl alloc] init]; - } - return _layoutImpl; -} - -- (XPRoomPositionDelegateImpl *)delegate { - if (!_delegate) { - _delegate = [[XPRoomPositionDelegateImpl alloc] init]; - } - return _delegate; -} - -@end diff --git a/xplan-ios/Main/Room/View/RoomDelegate.h b/xplan-ios/Main/Room/View/RoomDelegate.h new file mode 100644 index 00000000..f7398fa5 --- /dev/null +++ b/xplan-ios/Main/Room/View/RoomDelegate.h @@ -0,0 +1,22 @@ +// +// RoomDelegate.h +// xplan-ios +// +// Created by apple on 2021/10/26. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class RoomInfoModel; +@class UserInfoModel; + +@protocol RoomDelegate + +- (RoomInfoModel*)getRoomInfo; +- (UserInfoModel*)getUserInfo; + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Room/View/StageView/MicroView/MicroView.h b/xplan-ios/Main/Room/View/StageView/MicroView/MicroView.h new file mode 100644 index 00000000..e95832aa --- /dev/null +++ b/xplan-ios/Main/Room/View/StageView/MicroView/MicroView.h @@ -0,0 +1,16 @@ +// +// MicroView.h +// xplan-ios +// +// Created by 冯硕 on 2021/10/15. +// + +#import +#import "MicroViewProtocol.h" +NS_ASSUME_NONNULL_BEGIN + +@interface MicroView : UIView + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Room/View/StageView/MicroView/MicroView.m b/xplan-ios/Main/Room/View/StageView/MicroView/MicroView.m new file mode 100644 index 00000000..109d6134 --- /dev/null +++ b/xplan-ios/Main/Room/View/StageView/MicroView/MicroView.m @@ -0,0 +1,187 @@ +// +// MicroView.m +// xplan-ios +// +// Created by 冯硕 on 2021/10/15. +// + +#import "MicroView.h" +///Third +#import +///View +#import "MicroWaveView.h" + +#import "UIImageView+LoadImage.h" +#import "ThemeColor.h" + +#import "MicroQueueModel.h" +#import "MicroStateModel.h" +#import "UserInfoModel.h" + +@interface MicroView () +///头像 +@property (nonatomic,strong) UIImageView *avatarImageView; +///坑位是否闭麦的 +@property (nonatomic,strong) UIImageView *micStateImageView; +///昵称容器 +@property (nonatomic,strong) UIStackView *stackView; +///几号坑位 +@property (nonatomic,strong) UILabel *postionLabel; +///用户名/号麦位 +@property (nonatomic,strong) UILabel *nickLabel; +///声波动画 +@property (nonatomic,strong) MicroWaveView *animationView; +@end + +@implementation MicroView + +- (instancetype)initWithFrame:(CGRect)frame { + self = [super initWithFrame:frame]; + if (self) { + [self initSubViews]; + [self initSubViewConstraints]; + } + return self; +} + +- (void)layoutSubviews { + self.avatarImageView.layer.masksToBounds = YES; + self.avatarImageView.layer.cornerRadius = self.frame.size.width / 2; +} + +- (void)initSubViews { + [self addSubview:self.animationView]; + [self addSubview:self.avatarImageView]; + [self addSubview:self.micStateImageView]; + + [self addSubview:self.stackView]; + [self.stackView addArrangedSubview:self.postionLabel]; + [self.stackView addArrangedSubview:self.nickLabel]; +} + +- (void)initSubViewConstraints { + [self.animationView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.mas_equalTo(self.avatarImageView); + }]; + + [self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.top.mas_equalTo(self); + make.height.mas_equalTo(self.mas_width); + }]; + + [self.micStateImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.mas_equalTo(self.avatarImageView); + }]; + + [self.stackView mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.mas_equalTo(self); + make.top.mas_equalTo(self.avatarImageView.mas_bottom).offset(7); + }]; + + [self.postionLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.height.mas_equalTo(14); + }]; +} + +#pragma mark - MicroViewProtocol +- (void)userSpeaking { + [self.animationView startWaveAnimation]; +} + +- (void)configMicroView:(MicroQueueModel *)model { + MicroStateModel * micStats = model.microState; + UserInfoModel * userInfo = model.userInfo; + [self configMicroState:micStats]; + [self configUser:userInfo]; +} + +- (void)configMicroState:(MicroStateModel *)micState { + self.micStateImageView.hidden = micState.micState == MicroMicStateType_Open; + if (micState.posState == MicroPosStateType_Free) { + self.avatarImageView.image = [UIImage imageNamed:@"room_position_normal"]; + } else { + self.avatarImageView.image = [UIImage imageNamed:@"room_position_lock"]; + } + self.postionLabel.text = [NSString stringWithFormat:@"%d", micState.position + 1]; +} + +- (void)configUser:(UserInfoModel *)userInfo { + self.nickLabel.text = @"号坑位"; + if (userInfo) { + [self.avatarImageView load_imageWithUrl:userInfo.avatar placeholderImage:[UIImageConstant defaultAvatarPlaceholder]]; + if (userInfo.gender == GenderType_Male) { + [self.postionLabel setBackgroundColor:[ThemeColor positionMaleNickBackColor]]; + } else if(userInfo.gender == GenderType_Female){ + [self.postionLabel setBackgroundColor:[ThemeColor positionFemaleNickBackColor]]; + } + if (userInfo.nick.length > 0) { + self.nickLabel.text = userInfo.nick; + } + } else { + [self.postionLabel setBackgroundColor:[ThemeColor positionNormalNickBackColor]]; + } +} + +#pragma mark - Getters And Setters +- (UIImageView *)avatarImageView { + if (!_avatarImageView) { + _avatarImageView = [[UIImageView alloc] init]; + _avatarImageView.userInteractionEnabled = YES; + _avatarImageView.image = [UIImage imageNamed:@"room_position_normal"]; + } + return _avatarImageView; +} + +- (UIImageView *)micStateImageView { + if (!_micStateImageView) { + _micStateImageView = [[UIImageView alloc] init]; + _micStateImageView.userInteractionEnabled = YES; + _micStateImageView.image = [UIImage imageNamed:@"room_position_mute"]; + _micStateImageView.hidden = YES; + } + return _micStateImageView; +} + +- (MicroWaveView *)animationView { + if (!_animationView) { + _animationView = [[MicroWaveView alloc] init]; + } + return _animationView; +} + +- (UILabel *)nickLabel { + if (!_nickLabel) { + _nickLabel = [[UILabel alloc] init]; + _nickLabel.font = [UIFont systemFontOfSize:11]; + _nickLabel.textColor = [ThemeColor mainTextColor]; + _nickLabel.textAlignment = NSTextAlignmentCenter; + } + return _nickLabel; +} + +- (UIStackView *)stackView { + if (!_stackView) { + _stackView = [[UIStackView alloc] init]; + _stackView.axis = UILayoutConstraintAxisHorizontal; + _stackView.distribution = UIStackViewDistributionFill; + _stackView.alignment = UIStackViewAlignmentCenter; + _stackView.spacing = 2; + } + return _stackView; +} + +- (UILabel *)postionLabel { + if (!_postionLabel) { + _postionLabel = [[UILabel alloc] init]; + _postionLabel.font = [UIFont systemFontOfSize:10]; + _postionLabel.textAlignment = NSTextAlignmentCenter; + _postionLabel.textColor = [ThemeColor mainTextColor]; + _postionLabel.layer.masksToBounds = YES; + _postionLabel.layer.cornerRadius = 7; + + [_postionLabel setBackgroundColor:[ThemeColor positionNormalNickBackColor]]; + } + return _postionLabel; +} + +@end diff --git a/xplan-ios/Main/Room/View/StageView/MicroView/MicroViewProtocol.h b/xplan-ios/Main/Room/View/StageView/MicroView/MicroViewProtocol.h new file mode 100644 index 00000000..5477d820 --- /dev/null +++ b/xplan-ios/Main/Room/View/StageView/MicroView/MicroViewProtocol.h @@ -0,0 +1,23 @@ +// +// XPRoomPositionDataSourceProtocol.h +// xplan-ios +// +// Created by apple on 2021/10/27. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class MicroQueueModel; + +@protocol MicroViewProtocol + +///赋值给item +- (void)configMicroView:(MicroQueueModel *)model; +///坑位用户正在说话 +- (void)userSpeaking; + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Room/View/PositionContainerView/PositionView/View/SeapkingView/XPRoomPositionItemSpeakingView.h b/xplan-ios/Main/Room/View/StageView/MicroView/MicroWaveView.h similarity index 55% rename from xplan-ios/Main/Room/View/PositionContainerView/PositionView/View/SeapkingView/XPRoomPositionItemSpeakingView.h rename to xplan-ios/Main/Room/View/StageView/MicroView/MicroWaveView.h index 45cfbd10..b80f75c2 100644 --- a/xplan-ios/Main/Room/View/PositionContainerView/PositionView/View/SeapkingView/XPRoomPositionItemSpeakingView.h +++ b/xplan-ios/Main/Room/View/StageView/MicroView/MicroWaveView.h @@ -1,5 +1,5 @@ // -// XPRoomPositionItemSpeakingView.h +// MicroWaveView.h // xplan-ios // // Created by 冯硕 on 2021/10/20. @@ -9,12 +9,12 @@ NS_ASSUME_NONNULL_BEGIN -@interface XPRoomPositionItemSpeakingView : UIView +@interface MicroWaveView : UIView ///开始展示声波动画 -- (void)startSpeakingAnimation; +- (void)startWaveAnimation; ///结束声波动画 -- (void)stopSpeakingAnimation; +- (void)stopWaveAnimation; @end NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Room/View/PositionContainerView/PositionView/View/SeapkingView/XPRoomPositionItemSpeakingView.m b/xplan-ios/Main/Room/View/StageView/MicroView/MicroWaveView.m similarity index 90% rename from xplan-ios/Main/Room/View/PositionContainerView/PositionView/View/SeapkingView/XPRoomPositionItemSpeakingView.m rename to xplan-ios/Main/Room/View/StageView/MicroView/MicroWaveView.m index ae1711fd..c6ab720d 100644 --- a/xplan-ios/Main/Room/View/PositionContainerView/PositionView/View/SeapkingView/XPRoomPositionItemSpeakingView.m +++ b/xplan-ios/Main/Room/View/StageView/MicroView/MicroWaveView.m @@ -1,24 +1,24 @@ // -// XPRoomPositionItemSpeakingView.m +// MicroWaveView.m // xplan-ios // // Created by 冯硕 on 2021/10/20. // -#import "XPRoomPositionItemSpeakingView.h" +#import "MicroWaveView.h" ///Third #import #import -@interface XPRoomPositionItemSpeakingView () +@interface MicroWaveView () //声波动画图层 @property (nonatomic,strong) UIView * firstView; -///是否正在动画中 +//是否正在动画中 @property (nonatomic,assign) BOOL isAnimationing; @end -@implementation XPRoomPositionItemSpeakingView +@implementation MicroWaveView - (instancetype)initWithFrame:(CGRect)frame { @@ -34,10 +34,10 @@ [super layoutSubviews]; self.firstView.layer.cornerRadius = self.frame.size.width / 2; } + #pragma mark - Public Method ///开始展示声波动画 -- (void)startSpeakingAnimation { - NSLog(@"开始动画"); +- (void)startWaveAnimation { if (self.isAnimationing) { return; } @@ -46,7 +46,7 @@ } ///结束声波动画 -- (void)stopSpeakingAnimation { +- (void)stopWaveAnimation { self.isAnimationing = NO; [self.firstView.layer removeAllAnimations]; } @@ -64,7 +64,6 @@ }]; } - - (void)animationWithLayer:(UIView *)view { int animtionDura = 1; POPBasicAnimation *animation2 = [POPBasicAnimation animationWithPropertyNamed:kPOPLayerScaleXY]; diff --git a/xplan-ios/Main/IM/MicroQueue/Model/MicroQueueItemModel.h b/xplan-ios/Main/Room/View/StageView/Model/MicroQueueModel.h similarity index 53% rename from xplan-ios/Main/IM/MicroQueue/Model/MicroQueueItemModel.h rename to xplan-ios/Main/Room/View/StageView/Model/MicroQueueModel.h index 20be4857..72a58f6f 100644 --- a/xplan-ios/Main/IM/MicroQueue/Model/MicroQueueItemModel.h +++ b/xplan-ios/Main/Room/View/StageView/Model/MicroQueueModel.h @@ -1,17 +1,17 @@ // -// MicroQueueItemModel.h +// MicroQueueModel.h // xplan-ios // // Created by 冯硕 on 2021/10/21. // -#import "BaseObject.h" +#import "NSObject+MJExtension.h" NS_ASSUME_NONNULL_BEGIN -@class UserInfoModel, MicroModel; -@interface MicroQueueItemModel : BaseObject +@class UserInfoModel, MicroStateModel; +@interface MicroQueueModel : NSObject ///麦序的状态 -@property (nonatomic, strong) MicroModel *microState; +@property (nonatomic, strong) MicroStateModel *microState; ///麦序上是否有人 @property (nonatomic, strong, nullable) UserInfoModel *userInfo; @end diff --git a/xplan-ios/Main/Room/View/StageView/Model/MicroQueueModel.m b/xplan-ios/Main/Room/View/StageView/Model/MicroQueueModel.m new file mode 100644 index 00000000..56541aea --- /dev/null +++ b/xplan-ios/Main/Room/View/StageView/Model/MicroQueueModel.m @@ -0,0 +1,12 @@ +// +// MicroQueueModel.m +// xplan-ios +// +// Created by 冯硕 on 2021/10/21. +// + +#import "MicroQueueModel.h" + +@implementation MicroQueueModel + +@end diff --git a/xplan-ios/Main/IM/MicroQueue/Model/MicroModel.h b/xplan-ios/Main/Room/View/StageView/Model/MicroStateModel.h similarity index 86% rename from xplan-ios/Main/IM/MicroQueue/Model/MicroModel.h rename to xplan-ios/Main/Room/View/StageView/Model/MicroStateModel.h index 5a7babaf..5fe464e3 100644 --- a/xplan-ios/Main/IM/MicroQueue/Model/MicroModel.h +++ b/xplan-ios/Main/Room/View/StageView/Model/MicroStateModel.h @@ -1,11 +1,11 @@ // -// MicroModel.h +// MicroStateModel.h // xplan-ios // // Created by 冯硕 on 2021/10/21. // -#import "BaseObject.h" +#import "NSObject+MJExtension.h" NS_ASSUME_NONNULL_BEGIN typedef NS_ENUM(NSInteger, MicroPosStateType) { @@ -19,7 +19,7 @@ typedef NS_ENUM(NSInteger, MicroMicStateType) { }; -@interface MicroModel : BaseObject +@interface MicroStateModel : NSObject ///坑位的序号 @property (nonatomic, assign) int position; ///坑位状态 锁坑/开坑 diff --git a/xplan-ios/Main/Room/View/StageView/Model/MicroStateModel.m b/xplan-ios/Main/Room/View/StageView/Model/MicroStateModel.m new file mode 100644 index 00000000..3ef8f67f --- /dev/null +++ b/xplan-ios/Main/Room/View/StageView/Model/MicroStateModel.m @@ -0,0 +1,21 @@ +// +// MicroStateModel.m +// xplan-ios +// +// Created by 冯硕 on 2021/10/21. +// + +#import "MicroStateModel.h" + +@implementation MicroStateModel + +- (instancetype)init { + self = [super init]; + if (self) { + _posState = MicroPosStateType_Free; + _micState = MicroMicStateType_Open; + } + return self; +} + +@end diff --git a/xplan-ios/Main/Room/View/StageView/SocialStageView.h b/xplan-ios/Main/Room/View/StageView/SocialStageView.h new file mode 100644 index 00000000..92a27a76 --- /dev/null +++ b/xplan-ios/Main/Room/View/StageView/SocialStageView.h @@ -0,0 +1,16 @@ +// +// SocialStageView.h +// xplan-ios +// +// Created by zu on 2021/10/26. +// + +#import "StageView.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface SocialStageView : StageView + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Room/View/StageView/SocialStageView.m b/xplan-ios/Main/Room/View/StageView/SocialStageView.m new file mode 100644 index 00000000..f4a519e2 --- /dev/null +++ b/xplan-ios/Main/Room/View/StageView/SocialStageView.m @@ -0,0 +1,74 @@ +// +// SocialStageView.m +// xplan-ios +// +// Created by zu on 2021/10/26. +// + +#import "SocialStageView.h" +#import "MicroView.h" +#import "XPMacro.h" + +// 房主头像宽 58 + 光圈 5 +#define ownerWidth (58 + 5) +// 昵称高12,距离头像间距 6 +#define ownerHeight (ownerWidth + 6 + 12) +// 下面 8 个坑位宽55 + 光圈 5 +#define mcWidth (55 + 5) +#define mcHeight (mcWidth + 6 + 12) +// 左右 padding 20 +#define paddingH 20 +// 房主与下面的坑位间隔 33 +#define marginV1 33 +// 下面 8 个坑位两两之间的间距 +#define marginH (KScreenWidth - paddingH * 2 - mcWidth * 4) / 3 +// 第一行坑位的顶部 +#define firstRowTop ownerHeight + marginV1 +// 第一行坑位与第二行坑位的间距 +#define marginV2 15 +// 第一行坑位的顶部 +#define secondRowTop (firstRowTop + mcHeight + marginV2) + +@implementation SocialStageView + +- (NSInteger)countOfMircoView { + return 9; +} + +- (UIView *)microViewForIndex:(NSInteger)index { + UIView * microView = [super microViewForIndex:index]; + if (microView) { + return microView; + } + return [[MicroView alloc]init]; +} + +/** + * | ◯ | * 房主头像宽 58 + 光圈 5 + * | 33 | * 房主与下面的坑位间隔 33 + * | 20 ◯ ◯ ◯ ◯ 20 | * 左右 padding 20 + * | 15 | * 上下两排间距 15 + * | ◯ ◯ ◯ ◯ | * 下面 8 个坑位宽55 + 光圈 5 + * * 昵称高12,距离头像间距 6 + */ +- (CGRect)rectForViewAtIndex:(NSInteger)index { + if (index == 0) { + return CGRectMake(KScreenWidth / 2 - ownerWidth / 2, 0, ownerWidth, ownerHeight); + } + + if (index >= 1 && index <= 4) { + return CGRectMake(paddingH + (mcWidth + marginH) * (index - 1), firstRowTop, mcWidth, mcHeight); + } + + if (index >= 5 && index <= 9) { + return CGRectMake(paddingH + (mcWidth + marginH) * (index - 4 - 1), secondRowTop, mcWidth, mcHeight); + } + + return [super rectForViewAtIndex:index]; +} + +- (CGFloat)hightForStageView { + return ownerHeight + marginV1 + mcHeight + marginH + mcHeight; +} + +@end diff --git a/xplan-ios/Main/Room/View/StageView/StageView.h b/xplan-ios/Main/Room/View/StageView/StageView.h new file mode 100644 index 00000000..e449fc93 --- /dev/null +++ b/xplan-ios/Main/Room/View/StageView/StageView.h @@ -0,0 +1,45 @@ +// +// StageView.h +// xplan-ios +// +// Created by zu on 2021/10/25. +// + +#import +#import "RoomDelegate.h" +#import "MicroViewProtocol.h" + +NS_ASSUME_NONNULL_BEGIN + +@class MicroQueueModel; + +@protocol StageViewDelegate +/** + * 坑位数目 + */ +- (NSInteger)countOfMircoView; +/** + * 坑位区域的高度(宽度默认屏幕宽度) + */ +- (CGFloat)hightForStageView; +/** + * index 处的坑位 + */ +- (UIView *)microViewForIndex:(NSInteger)index; +/** + * index 处的坑位的区域 + */ +- (CGRect)rectForViewAtIndex:(NSInteger)index; +/** + * index 处的坑位点击事件 + */ +- (void)didSelectAtIndex:(NSInteger)index; +@end + +@interface StageView : UIView + +@property (nonatomic, strong) id hostDelegate; + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Room/View/StageView/StageView.m b/xplan-ios/Main/Room/View/StageView/StageView.m new file mode 100644 index 00000000..8f54c6af --- /dev/null +++ b/xplan-ios/Main/Room/View/StageView/StageView.m @@ -0,0 +1,339 @@ +// +// StageView.m +// xplan-ios +// +// Created by zu on 2021/10/25. +// + +#import "StageView.h" +#import +#import +#import "RtcManager.h" +#import "RtcDelegate.h" +#import "RoomInfoModel.h" +#import "UserInfoModel.h" +#import "MicroStateModel.h" +#import "MicroQueueModel.h" +#import "NSObject+MJExtension.h" +#import "TTPopup.h" + +@interface StageView() + +/** 云信麦序的 position 和本类 index 的关系。 + * + * **Note:** + * + * 网易云信返回的麦序(position)从 -1 开始。 + * - 使用者:MicroStateModel、self.micQueue 。 + * + * 麦位 View 的 index 从 0 开始。使用者:MicroStateModel、self.micQueue 。 + * - 使用者:StageViewDelegate、self.microViews 。 + */ +@property (nonatomic, strong) NSMutableArray *microViews; +@property (nonatomic, strong) NSMutableDictionary *micQueue; + +@end + +@implementation StageView + +- (instancetype)init { + self = [super init]; + if (self) { + NSInteger microCount = self.countOfMircoView; + for (int i = 0; i < microCount; i++) { + UIView* microView = [self microViewForIndex:i]; + if (microView) { + microView.tag = i; + microView.frame = [self rectForViewAtIndex:i]; + [self addSubview:microView]; + UITapGestureRecognizer* tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(microViewTapped:)]; + [microView addGestureRecognizer:tap]; + [self.microViews insertObject:microView atIndex:i]; + } + } + [self microQueueUpdated]; + + [self mas_makeConstraints:^(MASConstraintMaker *make) { + make.height.mas_equalTo(self.hightForStageView); + }]; + } + return self; +} + +/** + * 延迟设置 hostDelegate ,且初始化。 + * 临时方法,还会调整。 + */ +- (void)setHostDelegate:(id)hostDelegate { + if (_hostDelegate) { + return; + } + _hostDelegate = hostDelegate; + [self initRtcRoom]; +} + +- (void)initRtcRoom { + RoomInfoModel* roomInfo = self.hostDelegate.getRoomInfo; + + // 1. 加入语音房间。 + RtcEngineType type = [roomInfo.audioSdkType isEqualToString:@"wujie"] ? RtcEngineType_WJ : ([roomInfo.audioSdkType isEqualToString:@"zego"] ? RtcEngineType_Zego : RtcEngineType_Agora); + [RtcManager initEngineWithType:type delegate:self]; + [[RtcManager instance] enterRoom:[NSString stringWithFormat:@"%ld", (long)roomInfo.uid]]; + + // 2. 获取麦位的状态,并初始化 self.micQueue 。 + [[NIMSDK sharedSDK].chatManager addDelegate:self]; + [[NIMSDK sharedSDK].chatroomManager fetchChatroomInfo:[NSString stringWithFormat:@"%ld", (long)roomInfo.roomId] completion:^(NSError * _Nullable error, NIMChatroom * _Nullable chatroom) { + if (error) { + return; + } + NSDictionary *info = (NSDictionary *)[chatroom.ext toJSONObject]; + NSDictionary *micState = [info[@"micQueue"] toJSONObject]; + for (NSString *position in micState.allKeys) { + MicroStateModel *state = [MicroStateModel modelWithJSON:micState[position]]; + MicroQueueModel *sequence = [self.micQueue objectForKey:position]; + sequence.microState = state; + } + [self microQueueUpdated]; + }]; + + // 3. 获取麦位的用户,并初始化 self.micQueue 。 + [[NIMSDK sharedSDK].chatroomManager fetchChatroomQueue:[NSString stringWithFormat:@"%ld", (long)roomInfo.roomId] completion:^(NSError * _Nullable error, NSArray *> * _Nullable info) { + if (error) { + return; + } + for (NSDictionary *item in info) { + UserInfoModel *userInfo = [UserInfoModel modelWithJSON:item.allValues.firstObject]; + NSString *position = item.allKeys.firstObject; + MicroQueueModel *sequence = [self.micQueue objectForKey:position]; + sequence.userInfo = userInfo; + } + [self microQueueUpdated]; + }]; +} + +#pragma mark - microQueueUpdated +/** 麦位状态或者卖上用户发生变化后,通过该方法刷新麦位的界面状态。 + * 且会根据当前用户是否在麦位上,决定音频推拉流。 + * + * **Note:** 也即意味着其他的方法(回调),仅更新 self.micQueue 数据。 + */ +- (void)microQueueUpdated { + bool selfOnMicro = NO; + for (int i = 0; i < self.countOfMircoView; i++) { + UIView * view = [self findMicroViewByIndex:i]; + MicroQueueModel * model = [self.micQueue objectForKey:[self indexToPosition:i]]; + [view configMicroView:model]; + if (model.userInfo.uid == self.hostDelegate.getUserInfo.uid) { + selfOnMicro = YES; + } + } + [[RtcManager instance] broadcast:selfOnMicro]; +} + +#pragma mark - RtcDelegate - 讲话的波纹回调 +- (void)usersSpeaking:(NSMutableArray *)uids { + for (NSString* uid in uids) { + UIView* microView = [self findMicroViewByUid:uid]; + if (microView) { + [microView userSpeaking]; + } + } +} + +#pragma mark - NIMChatManagerDelegate - 麦位状态/成员的变化回调 +- (void)onRecvMessages:(NSArray *)messages { + bool microQueueChanged = NO; + for (NIMMessage * message in messages) { + // 非房间内消息不处理 + if (message.session.sessionType != NIMSessionTypeChatroom) { + continue; + } + // 非本房间不处理 + if (![message.session.sessionId isEqualToString:[NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.roomId]]) { + continue; + } + + if (message.messageType == NIMMessageTypeNotification) { + NIMNotificationObject *notiMsg = (NIMNotificationObject *)message.messageObject; + NIMChatroomNotificationContent *content = (NIMChatroomNotificationContent *)notiMsg.content; + + switch (content.eventType) { + case NIMChatroomEventTypeInfoUpdated: // 麦序状态更新 + { + NSDictionary *data = [content.notifyExt toJSONObject]; + int type = [data[@"type"] intValue]; + switch (type) { + case 2: + case 3: ///更新了某一个麦序信息 + { + MicroStateModel *microState = [MicroStateModel modelWithJSON:data[@"micInfo"]]; + MicroQueueModel *micSequence = [self.micQueue objectForKey:[NSString stringWithFormat:@"%d", microState.position]]; + micSequence.microState = microState; + microQueueChanged = YES; + } + break; + } + } + break; + + case NIMChatroomEventTypeQueueChange: // 麦序上下麦 + { + NSDictionary* data = (NSDictionary *)content.ext; + NSString* position = [data objectForKey:NIMChatroomEventInfoQueueChangeItemKey]; + UserInfoModel* userInfo = [UserInfoModel modelWithJSON:[data objectForKey:NIMChatroomEventInfoQueueChangeItemValueKey]]; + NSInteger changeType = [data[NIMChatroomEventInfoQueueChangeTypeKey] integerValue]; + + // 先清除该用户旧的麦位 + for (MicroQueueModel *sequence in self.micQueue.allValues) { + if (userInfo.uid == sequence.userInfo.uid) { + sequence.userInfo = nil; + } + } + + if (changeType == 1) { // 上麦 + MicroQueueModel *sequence = [self.micQueue objectForKey:position]; + sequence.userInfo = userInfo; + } + + microQueueChanged = YES; + } + break; + + default: + break; + } + } + } + if (microQueueChanged) { + [self microQueueUpdated]; + } +} + +#pragma mark - StageViewDelegate - 留给子 View 重写的模板方法 +- (void)didSelectAtIndex:(NSInteger)index { + MicroQueueModel* micModel = [self.micQueue objectForKey:[self indexToPosition:index]]; + UserInfoModel* userInfo = self.hostDelegate.getUserInfo; + RoomInfoModel* roomInfo = self.hostDelegate.getRoomInfo; + NSString* pisition = [self indexToPosition:index]; + NSString* roomId = [NSString stringWithFormat:@"%ld", roomInfo.roomId]; + + TTActionSheetConfig *upMic = [TTActionSheetConfig normalTitle:@"上麦" clickAction:^{ + NIMChatroomQueueUpdateRequest *request = [[NIMChatroomQueueUpdateRequest alloc]init]; + request.key = pisition; + request.value = [userInfo toJSONString]; + request.roomId = roomId; + request.transient = YES; + [[NIMSDK sharedSDK].chatroomManager updateChatroomQueueObject:request completion:^(NSError * _Nullable error) { + if (error) { + + } + }]; + }]; + + TTActionSheetConfig *downMic = [TTActionSheetConfig normalTitle:@"下麦" clickAction:^{ + NIMChatroomQueueRemoveRequest *request = [[NIMChatroomQueueRemoveRequest alloc]init]; + request.key = pisition; + request.roomId = roomId; + [[NIMSDK sharedSDK].chatroomManager removeChatroomQueueObject:request completion:^(NSError * _Nullable error, NSDictionary * _Nullable element) { + if (error) { + + } + }]; + }]; + + if (!micModel.userInfo && micModel.microState.posState == MicroPosStateType_Free) { + [TTPopup actionSheetWithItems:@[upMic]]; + } else if (self.hostDelegate.getUserInfo.uid == micModel.userInfo.uid) { + [TTPopup actionSheetWithItems:@[downMic]]; + } else { + // TODO: 用户资料卡片弹窗 + } +} + +- (NSInteger)countOfMircoView { + return 0; +} + +- (CGFloat)hightForStageView { + return 0; +} + +- (nonnull UIView *)microViewForIndex:(NSInteger)index { + return [self findMicroViewByIndex:index]; +} + +- (CGRect)rectForViewAtIndex:(NSInteger)index { + return CGRectZero; +} + +#pragma mark - Private Utils Methods - 以下可以不关注 +/** + * 网易云信的麦序转成坑位的 index + */ +- (NSInteger)positionToIndex:(NSString*)position { + return position.intValue + 1; +} +/** + * 坑位的 index 转成网易云信的麦序 + */ +- (NSString *)indexToPosition:(NSInteger)index { + return [NSString stringWithFormat:@"%ld", (long)(index - 1)]; +} +/** + * 根据 uid 查找该用户的上麦的坑位 View,用户不在麦位上将返回 nil。 + */ +- (UIView *)findMicroViewByUid:(NSString *)uid { + for (int i = 0; i < self.countOfMircoView; i++) { + MicroQueueModel* mode = [self.micQueue objectForKey:[self indexToPosition:i]]; + if (mode.userInfo && mode.userInfo.uid == uid.intValue) { + return [self findMicroViewByIndex:i]; + } + } + return nil; +} +/** + * 根据 index 查找该用户的上麦的坑位 View,用户不在麦位上将返回 nil。 + */ +- (UIView *)findMicroViewByIndex:(NSInteger)index { + if (self.microViews && self.microViews.count > index) { + return [self.microViews objectAtIndex:index]; + } + return nil; +} +/** + * 根据 position 查找该用户的上麦的坑位 View,用户不在麦位上将返回 nil。 + */ +- (UIView *)findMicroViewByPosition:(NSString *)position { + return [self findMicroViewByIndex:[self positionToIndex:position]]; +} + +/** + * 麦位的点击响应入口。 + */ +- (void)microViewTapped:(UITapGestureRecognizer *)sender { + [self didSelectAtIndex:sender.view.tag]; +} + +- (NSMutableArray *)microViews { + if (!_microViews) { + _microViews = [NSMutableArray arrayWithCapacity:self.countOfMircoView]; + } + return _microViews; +} + +- (NSMutableDictionary *)micQueue { + if (!_micQueue) { + _micQueue= [NSMutableDictionary dictionary]; + for (int i = 0; i < self.countOfMircoView; i++) { + NSString* position = [self indexToPosition:i]; + MicroQueueModel *micSequence = [[MicroQueueModel alloc]init]; + micSequence.userInfo = nil; + micSequence.microState = [[MicroStateModel alloc]init]; + micSequence.microState.position = [position intValue]; + [self.micQueue setObject:micSequence forKey:position]; + } + } + return _micQueue; +} + +@end diff --git a/xplan-ios/Main/Room/View/XPRoomViewController.h b/xplan-ios/Main/Room/View/XPRoomViewController.h index d67acd30..54e6bb59 100644 --- a/xplan-ios/Main/Room/View/XPRoomViewController.h +++ b/xplan-ios/Main/Room/View/XPRoomViewController.h @@ -8,7 +8,7 @@ #import "MvpViewController.h" NS_ASSUME_NONNULL_BEGIN -@class XPRoomBackContainerView,XPRoomInfoContainerView,XPRoomMessageContainerView,XPRoomMenuContainerView,XPRoomActivityContainerView, XPRoomPositionContainView, RoomInfoModel, UserInfoModel; +@class XPRoomBackContainerView,XPRoomInfoContainerView,XPRoomMessageContainerView,XPRoomMenuContainerView,XPRoomActivityContainerView, XPRoomPositionContainView, RoomInfoModel, UserInfoModel, SocialStageView; @interface XPRoomViewController : MvpViewController ///房间的Uid @@ -19,7 +19,7 @@ NS_ASSUME_NONNULL_BEGIN ///房间信息 @property (nonatomic,strong, readonly) XPRoomInfoContainerView *roomInfoContainerView; ///坑位信息 -@property (nonatomic,strong, readonly) XPRoomPositionContainView *positionContainerView; +@property (nonatomic,strong, readonly) SocialStageView *stageView; ///公屏 @property (nonatomic,strong, readonly) XPRoomMessageContainerView *messageContainerView; ///底部操作栏 @@ -29,7 +29,7 @@ NS_ASSUME_NONNULL_BEGIN ///房间信息 @property (nonatomic,strong, readonly) RoomInfoModel *roomInfo; ///用户信息 -@property (nonatomic,strong, readonly) UserInfoModel *usereInfo; +@property (nonatomic,strong, readonly) UserInfoModel *userInfo; @end diff --git a/xplan-ios/Main/Room/View/XPRoomViewController.m b/xplan-ios/Main/Room/View/XPRoomViewController.m index 61a57785..c09afc9e 100644 --- a/xplan-ios/Main/Room/View/XPRoomViewController.m +++ b/xplan-ios/Main/Room/View/XPRoomViewController.m @@ -20,32 +20,34 @@ #import "XPRoomBackContainerView.h" #import "XPRoomMenuContainerView.h" #import "XPRoomMessageContainerView.h" -#import "XPRoomPositionContainView.h" #import "XPRoomInfoContainerView.h" +#import "SocialStageView.h" ///P #import "XPRoomPresenter.h" #import "XPRoomProtocol.h" #import "XPIMRoomDelegate.h" +#import "RoomDelegate.h" ///Category #import "XPRoomViewController+RoomInfoContainerView.h" #import "XPIMManager.h" -@interface XPRoomViewController () +@interface XPRoomViewController () ///背景 @property (nonatomic,strong) XPRoomBackContainerView *backContainerView; ///房间信息 @property (nonatomic,strong) XPRoomInfoContainerView *roomInfoContainerView; ///坑位信息 -@property (nonatomic,strong) XPRoomPositionContainView *positionContainerView; +@property (nonatomic,strong) SocialStageView *stageView; ///公屏 @property (nonatomic,strong) XPRoomMessageContainerView *messageContainerView; ///底部操作栏 @property (nonatomic,strong) XPRoomMenuContainerView *menuContainerView; ///活动 @property (nonatomic,strong) XPRoomActivityContainerView *activityContainerView; + ///用户信息 -@property (nonatomic,strong) UserInfoModel *usereInfo; +@property (nonatomic,strong) UserInfoModel *userInfo; ///房间信息 @property (nonatomic,strong) RoomInfoModel *roomInfo; @end @@ -87,7 +89,7 @@ - (void)initSubViews { [self.view addSubview:self.backContainerView]; [self.view addSubview:self.roomInfoContainerView]; - [self.view addSubview:self.positionContainerView]; + [self.view addSubview:self.stageView]; [self.view addSubview:self.messageContainerView]; [self.view addSubview:self.menuContainerView]; [self.view addSubview:self.activityContainerView]; @@ -103,14 +105,13 @@ make.height.mas_equalTo(kNavigationHeight); }]; - [self.positionContainerView mas_makeConstraints:^(MASConstraintMaker *make) { + [self.stageView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.mas_equalTo(self.view); make.top.mas_equalTo(self.roomInfoContainerView.mas_bottom); - make.height.mas_equalTo([self.positionContainerView positionContainerViewHeight]); }]; [self.messageContainerView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.equalTo(self.positionContainerView.mas_bottom); + make.top.equalTo(self.stageView.mas_bottom); make.bottom.equalTo(self.menuContainerView.mas_top).offset(-5); make.left.equalTo(self.view); make.right.equalTo(self.activityContainerView.mas_left).offset(-10); @@ -129,11 +130,10 @@ make.width.mas_equalTo(80); }]; } + #pragma mark - XPRoomProtocol - (void)getRoomInfoSuccess:(RoomInfoModel *)roomInfo { self.roomInfo = roomInfo; - RtcEngineType type = [roomInfo.audioSdkType isEqualToString:@"wujie"] ? RtcEngineType_WJ : ([roomInfo.audioSdkType isEqualToString:@"zego"] ? RtcEngineType_Zego : RtcEngineType_Agora); - [RtcManager initEngineWithType:type delegate:self.positionContainerView.postionView]; ///保存一下房间信息 结构调整的时候 改掉就行 [[XPIMManager shareManager].chatRoomManager setCurrentRoomInfo:roomInfo]; NSString * uid = [AccountInfoStorage instance].getUid; @@ -154,31 +154,43 @@ } - (void)getUserInfoSuccess:(UserInfoModel *)userInfo { - self.usereInfo = userInfo; - // TODO: 进入云信房间。 - [[XPIMManager shareManager].chatRoomManager enterRoomWithRoomId:[NSString stringWithFormat:@"%ld", self.roomInfo.roomId] userInfo:self.usereInfo]; + self.userInfo = userInfo; + [self.presenter enterNIMRoom:[NSString stringWithFormat:@"%ld", self.roomInfo.roomId] user:self.userInfo]; } - (void)openRoomSuccess:(RoomInfoModel *)roomInfo { + self.roomInfo = roomInfo; [self configRoomInfoContainerViewWithRoomInfo:roomInfo]; - // TODO: 进入云信房间。 - [[XPIMManager shareManager].chatRoomManager enterRoomWithRoomId:[NSString stringWithFormat:@"%ld", self.roomInfo.roomId] userInfo:self.usereInfo]; + [self.presenter enterNIMRoom:[NSString stringWithFormat:@"%ld", self.roomInfo.roomId] user:self.userInfo]; } -- (void)onExitChatRoomSuccess { - ///停止声网 - [[RtcManager instance] exitRoom]; - [[RtcManager instance] destory]; - ///重置一下用户 信息 - [[XPIMManager shareManager].microQueueManager setCurrentUserInfo:nil]; - [[XPIMManager shareManager].chatRoomManager removeDelegate:self]; - [self enterRoomFail]; +- (void)enterRoomSuccess { + [self.stageView setHostDelegate:self]; } - (void)enterRoomFail { [self dismissViewControllerAnimated:YES completion:nil]; } +- (void)onExitChatRoomSuccess { + ///停止声网 + [[RtcManager instance] exitRoom]; + [[RtcManager instance] destory]; + ///重置一下用户 信息 +// [[XPIMManager shareManager].microQueueManager setCurrentUserInfo:nil]; + [[XPIMManager shareManager].chatRoomManager removeDelegate:self]; + [self enterRoomFail]; +} + +#pragma mark - RoomDelegate +- (RoomInfoModel *)getRoomInfo { + return self.roomInfo; +} + +- (UserInfoModel *)getUserInfo { + return self.userInfo; +} + - (XPRoomBackContainerView *)backContainerView { if (!_backContainerView) { _backContainerView = [[XPRoomBackContainerView alloc] init]; @@ -194,11 +206,11 @@ return _roomInfoContainerView; } -- (XPRoomPositionContainView *)positionContainerView { - if (!_positionContainerView) { - _positionContainerView = [[XPRoomPositionContainView alloc] init]; +- (SocialStageView *)stageView { + if (!_stageView) { + _stageView = [[SocialStageView alloc] init]; } - return _positionContainerView; + return _stageView; } - (XPRoomMessageContainerView *)messageContainerView { @@ -222,5 +234,4 @@ return _activityContainerView; } - @end diff --git a/xplan-ios/Main/Tabbar/MainPresenter.m b/xplan-ios/Main/Tabbar/MainPresenter.m index 320ae6a7..9a2b5879 100644 --- a/xplan-ios/Main/Tabbar/MainPresenter.m +++ b/xplan-ios/Main/Tabbar/MainPresenter.m @@ -11,7 +11,7 @@ #import "AccountModel.h" #import "Api+Main.h" #import "MainProtocol.h" -#import "NSObject+JSONString.h" +#import "NSObject+MJExtension.h" #import @implementation MainPresenter @@ -60,7 +60,7 @@ if (array == nil || array.count <= 0) { return; } - NSString * transcationIdStr = [array objectToJSONString]; + NSString * transcationIdStr = [array toJSONString]; [Api requestCheckTranscationIds:[self createHttpCompletion:^(BaseModel * _Nonnull data) { NSString * uid = [AccountInfoStorage instance].getUid; [RechargeStorage delegateAllTranscationIdsWithUid:uid];