diff --git a/YuMi.xcodeproj/project.pbxproj b/YuMi.xcodeproj/project.pbxproj index 1bd9b2b8..41a8f6a5 100644 --- a/YuMi.xcodeproj/project.pbxproj +++ b/YuMi.xcodeproj/project.pbxproj @@ -155,7 +155,6 @@ 232C43EC2AB169EC00D4B2ED /* pi_room_tarrow_banner.svga in Resources */ = {isa = PBXBuildFile; fileRef = 232C43EB2AB169EB00D4B2ED /* pi_room_tarrow_banner.svga */; }; 232C444B2AB4363200D4B2ED /* pi_room_tarrow_h5_banner.svga in Resources */ = {isa = PBXBuildFile; fileRef = 232C444A2AB4363200D4B2ED /* pi_room_tarrow_h5_banner.svga */; }; 232EBBFF2BD7A25500E8CEAD /* MSParamsDecode.m in Sources */ = {isa = PBXBuildFile; fileRef = 232EBBFE2BD7A25500E8CEAD /* MSParamsDecode.m */; }; - 2331C0DC2A5E9E9000E1D940 /* PIFullScreenBannerAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 2331C0DB2A5E9E9000E1D940 /* PIFullScreenBannerAnimation.m */; }; 2331C1632A5EB71000E1D940 /* XPNobleCenterPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 2331C1322A5EB71000E1D940 /* XPNobleCenterPresenter.m */; }; 2331C1642A5EB71000E1D940 /* NobleInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 2331C1362A5EB71000E1D940 /* NobleInfo.m */; }; 2331C1652A5EB71000E1D940 /* NobleRechargeModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 2331C1392A5EB71000E1D940 /* NobleRechargeModel.m */; }; @@ -522,6 +521,8 @@ 4CEB9EAD2D09AA0400443480 /* SexAgeLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CEB9EAC2D09AA0400443480 /* SexAgeLabel.m */; }; 4CEB9EB02D0AF4FE00443480 /* TwentyMicStageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CEB9EAF2D0AF4FE00443480 /* TwentyMicStageView.m */; }; 4CEB9EB32D0AFCE200443480 /* NineteenMicStageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CEB9EB22D0AFCE200443480 /* NineteenMicStageView.m */; }; + 4CFFEFCD2D3A4E410035D016 /* AppOfficalManagerActionsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CFFEFCC2D3A4E410035D016 /* AppOfficalManagerActionsViewController.m */; }; + 4CFFEFD02D3A5E130035D016 /* Api+SuperAdmin.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CFFEFCF2D3A5E130035D016 /* Api+SuperAdmin.m */; }; 540EC1D02C89925F00F3BF0D /* GiftComboView.m in Sources */ = {isa = PBXBuildFile; fileRef = 540EC1CF2C89925F00F3BF0D /* GiftComboView.m */; }; 540EC1D32C89998500F3BF0D /* GiftComboManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 540EC1D22C89998500F3BF0D /* GiftComboManager.m */; }; 5412E0F42C4E460300FDD668 /* XPMineCenterAgencyView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5412E0F32C4E460300FDD668 /* XPMineCenterAgencyView.m */; }; @@ -1945,8 +1946,6 @@ 232C444A2AB4363200D4B2ED /* pi_room_tarrow_h5_banner.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = pi_room_tarrow_h5_banner.svga; sourceTree = ""; }; 232EBBFD2BD7A25500E8CEAD /* MSParamsDecode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MSParamsDecode.h; sourceTree = ""; }; 232EBBFE2BD7A25500E8CEAD /* MSParamsDecode.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MSParamsDecode.m; sourceTree = ""; }; - 2331C0DA2A5E9E9000E1D940 /* PIFullScreenBannerAnimation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PIFullScreenBannerAnimation.h; sourceTree = ""; }; - 2331C0DB2A5E9E9000E1D940 /* PIFullScreenBannerAnimation.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PIFullScreenBannerAnimation.m; sourceTree = ""; }; 2331C1312A5EB71000E1D940 /* XPNobleCenterPresenter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPNobleCenterPresenter.h; sourceTree = ""; }; 2331C1322A5EB71000E1D940 /* XPNobleCenterPresenter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XPNobleCenterPresenter.m; sourceTree = ""; }; 2331C1342A5EB71000E1D940 /* XPNobleCenterProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPNobleCenterProtocol.h; sourceTree = ""; }; @@ -2650,6 +2649,10 @@ 4CEB9EAF2D0AF4FE00443480 /* TwentyMicStageView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TwentyMicStageView.m; sourceTree = ""; }; 4CEB9EB12D0AFCE200443480 /* NineteenMicStageView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NineteenMicStageView.h; sourceTree = ""; }; 4CEB9EB22D0AFCE200443480 /* NineteenMicStageView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NineteenMicStageView.m; sourceTree = ""; }; + 4CFFEFCB2D3A4E410035D016 /* AppOfficalManagerActionsViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppOfficalManagerActionsViewController.h; sourceTree = ""; }; + 4CFFEFCC2D3A4E410035D016 /* AppOfficalManagerActionsViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppOfficalManagerActionsViewController.m; sourceTree = ""; }; + 4CFFEFCE2D3A5E130035D016 /* Api+SuperAdmin.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Api+SuperAdmin.h"; sourceTree = ""; }; + 4CFFEFCF2D3A5E130035D016 /* Api+SuperAdmin.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "Api+SuperAdmin.m"; sourceTree = ""; }; 540EC1CE2C89925F00F3BF0D /* GiftComboView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GiftComboView.h; sourceTree = ""; }; 540EC1CF2C89925F00F3BF0D /* GiftComboView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GiftComboView.m; sourceTree = ""; }; 540EC1D12C89998500F3BF0D /* GiftComboManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GiftComboManager.h; sourceTree = ""; }; @@ -7599,6 +7602,8 @@ 54E82EAA2CA9261000C931D9 /* Api+Boom.m */, 546104172CD4C06400066B21 /* Api+CustomBackground.h */, 546104182CD4C06400066B21 /* Api+CustomBackground.m */, + 4CFFEFCE2D3A5E130035D016 /* Api+SuperAdmin.h */, + 4CFFEFCF2D3A5E130035D016 /* Api+SuperAdmin.m */, ); path = Api; sourceTree = ""; @@ -10731,8 +10736,6 @@ 9BE01AF42893E7E000B50299 /* Cell */, 189DD53226DE255300AB55B1 /* TabbarViewController.h */, 189DD53326DE255300AB55B1 /* TabbarViewController.m */, - 2331C0DA2A5E9E9000E1D940 /* PIFullScreenBannerAnimation.h */, - 2331C0DB2A5E9E9000E1D940 /* PIFullScreenBannerAnimation.m */, 142721B029A7647F00C7C423 /* XPBlankViewController.h */, 142721B129A7647F00C7C423 /* XPBlankViewController.m */, 140A7F50299CC69000841594 /* XPTabBar.h */, @@ -11007,6 +11010,8 @@ E8DEC99D2764A5B60078CB70 /* XPRoomMoreMenuViewController.m */, E8412F9427795E34006E1101 /* XPRoomInviteFansView.h */, E8412F9527795E34006E1101 /* XPRoomInviteFansView.m */, + 4CFFEFCB2D3A4E410035D016 /* AppOfficalManagerActionsViewController.h */, + 4CFFEFCC2D3A4E410035D016 /* AppOfficalManagerActionsViewController.m */, ); path = View; sourceTree = ""; @@ -11935,6 +11940,7 @@ E81E09C9290F71BF00A1F410 /* XPAdvertiseView.m in Sources */, 2305F3412AD94D5200AD403C /* XPMaskManagerVC.m in Sources */, 238B37D32AC55A2C00BFC9D5 /* XPTreasureFairyShopingRecordView.m in Sources */, + 4CFFEFD02D3A5E130035D016 /* Api+SuperAdmin.m in Sources */, 9BC5C91F277C902B007C8719 /* XPReleaseRadioView.m in Sources */, E84843AF27F59E7E0050D365 /* XPRoomPKResultView.m in Sources */, E83DB47A27462C4500D8CBD1 /* XPGiftBigPrizeModel.m in Sources */, @@ -12049,6 +12055,7 @@ E8788942273A55AD00BF1D57 /* XPGiftUsersView.m in Sources */, 9BD9A17927A0EC57004186FE /* XPMineVisitorPresenter.m in Sources */, E8BD0F8828A9E9E400DE050D /* RoomSailingPrizeModel.m in Sources */, + 4CFFEFCD2D3A4E410035D016 /* AppOfficalManagerActionsViewController.m in Sources */, 238B37B32AC55A2C00BFC9D5 /* XPTreasureFairyPrizeRecordCell.m in Sources */, 23CEFC512AFB8FC100576D89 /* SystemUtil.m in Sources */, E8659909273E800D00EE349D /* XPGiftCollectionViewFlowLayout.m in Sources */, @@ -12986,7 +12993,6 @@ 18F403CB2758C66800A6C548 /* MessageContentText.m in Sources */, 547853A12C258F2A00F45E60 /* XPMineUserViewHeader.m in Sources */, E87DF4E72A42CB00009C1185 /* XPHomePresenter.m in Sources */, - 2331C0DC2A5E9E9000E1D940 /* PIFullScreenBannerAnimation.m in Sources */, E8232600274E48EA003A3332 /* XPUserCardItemCollectionViewCell.m in Sources */, 239D0FA92BFCB88D002977CE /* XPRoomDatingVipUpMicView.m in Sources */, E88B5CC526FB42B000DA9178 /* XPMineUserInfoHeaderView.m in Sources */, diff --git a/YuMi/Assets.xcassets/1.0.34/room_manager_limit.imageset/Contents.json b/YuMi/Assets.xcassets/1.0.34/room_manager_limit.imageset/Contents.json index f40b62af..8803d945 100644 --- a/YuMi/Assets.xcassets/1.0.34/room_manager_limit.imageset/Contents.json +++ b/YuMi/Assets.xcassets/1.0.34/room_manager_limit.imageset/Contents.json @@ -9,7 +9,7 @@ "scale" : "2x" }, { - "filename" : "room_manager_limit@3x.png", + "filename" : "from (2).png", "idiom" : "universal", "scale" : "3x" } diff --git a/YuMi/Assets.xcassets/1.0.34/room_manager_limit.imageset/from (2).png b/YuMi/Assets.xcassets/1.0.34/room_manager_limit.imageset/from (2).png new file mode 100644 index 00000000..79228004 Binary files /dev/null and b/YuMi/Assets.xcassets/1.0.34/room_manager_limit.imageset/from (2).png differ diff --git a/YuMi/Assets.xcassets/1.0.34/room_manager_limit.imageset/room_manager_limit@3x.png b/YuMi/Assets.xcassets/1.0.34/room_manager_limit.imageset/room_manager_limit@3x.png deleted file mode 100644 index 382ea501..00000000 Binary files a/YuMi/Assets.xcassets/1.0.34/room_manager_limit.imageset/room_manager_limit@3x.png and /dev/null differ diff --git a/YuMi/Assets.xcassets/Login/ms_login_choose_phone_icon.imageset/Contents.json b/YuMi/Assets.xcassets/20.20.50/app_admin_icon.imageset/Contents.json similarity index 88% rename from YuMi/Assets.xcassets/Login/ms_login_choose_phone_icon.imageset/Contents.json rename to YuMi/Assets.xcassets/20.20.50/app_admin_icon.imageset/Contents.json index 5501fd72..ee0b03f9 100644 --- a/YuMi/Assets.xcassets/Login/ms_login_choose_phone_icon.imageset/Contents.json +++ b/YuMi/Assets.xcassets/20.20.50/app_admin_icon.imageset/Contents.json @@ -9,7 +9,7 @@ "scale" : "2x" }, { - "filename" : "1.png", + "filename" : "超管@3x.png", "idiom" : "universal", "scale" : "3x" } diff --git a/YuMi/Assets.xcassets/20.20.50/app_admin_icon.imageset/超管@3x.png b/YuMi/Assets.xcassets/20.20.50/app_admin_icon.imageset/超管@3x.png new file mode 100644 index 00000000..9c410cd5 Binary files /dev/null and b/YuMi/Assets.xcassets/20.20.50/app_admin_icon.imageset/超管@3x.png differ diff --git a/YuMi/Assets.xcassets/Language/ar/room_manager_limit_ar.imageset/Contents.json b/YuMi/Assets.xcassets/Language/ar/room_manager_limit_ar.imageset/Contents.json index 64609ff2..cc239228 100644 --- a/YuMi/Assets.xcassets/Language/ar/room_manager_limit_ar.imageset/Contents.json +++ b/YuMi/Assets.xcassets/Language/ar/room_manager_limit_ar.imageset/Contents.json @@ -9,7 +9,7 @@ "scale" : "2x" }, { - "filename" : "room_manager_limit_ar@3x.png", + "filename" : "from (1).png", "idiom" : "universal", "scale" : "3x" } diff --git a/YuMi/Assets.xcassets/Language/ar/room_manager_limit_ar.imageset/from (1).png b/YuMi/Assets.xcassets/Language/ar/room_manager_limit_ar.imageset/from (1).png new file mode 100644 index 00000000..5dba487e Binary files /dev/null and b/YuMi/Assets.xcassets/Language/ar/room_manager_limit_ar.imageset/from (1).png differ diff --git a/YuMi/Assets.xcassets/Language/ar/room_manager_limit_ar.imageset/room_manager_limit_ar@3x.png b/YuMi/Assets.xcassets/Language/ar/room_manager_limit_ar.imageset/room_manager_limit_ar@3x.png deleted file mode 100644 index 27690406..00000000 Binary files a/YuMi/Assets.xcassets/Language/ar/room_manager_limit_ar.imageset/room_manager_limit_ar@3x.png and /dev/null differ diff --git a/YuMi/Assets.xcassets/Language/en/room_manager_limit_en.imageset/Contents.json b/YuMi/Assets.xcassets/Language/en/room_manager_limit_en.imageset/Contents.json index ecfdc2ae..3c95f84d 100644 --- a/YuMi/Assets.xcassets/Language/en/room_manager_limit_en.imageset/Contents.json +++ b/YuMi/Assets.xcassets/Language/en/room_manager_limit_en.imageset/Contents.json @@ -9,7 +9,7 @@ "scale" : "2x" }, { - "filename" : "room_manager_limit_en@3x.png", + "filename" : "from.png", "idiom" : "universal", "scale" : "3x" } diff --git a/YuMi/Assets.xcassets/Language/en/room_manager_limit_en.imageset/from.png b/YuMi/Assets.xcassets/Language/en/room_manager_limit_en.imageset/from.png new file mode 100644 index 00000000..782c66e3 Binary files /dev/null and b/YuMi/Assets.xcassets/Language/en/room_manager_limit_en.imageset/from.png differ diff --git a/YuMi/Assets.xcassets/Language/en/room_manager_limit_en.imageset/room_manager_limit_en@3x.png b/YuMi/Assets.xcassets/Language/en/room_manager_limit_en.imageset/room_manager_limit_en@3x.png deleted file mode 100644 index beaa10b9..00000000 Binary files a/YuMi/Assets.xcassets/Language/en/room_manager_limit_en.imageset/room_manager_limit_en@3x.png and /dev/null differ diff --git a/YuMi/Assets.xcassets/Language/tr/room_manager_limit_tr.imageset/Contents.json b/YuMi/Assets.xcassets/Language/tr/room_manager_limit_tr.imageset/Contents.json index be3dbcf6..c10c49ed 100644 --- a/YuMi/Assets.xcassets/Language/tr/room_manager_limit_tr.imageset/Contents.json +++ b/YuMi/Assets.xcassets/Language/tr/room_manager_limit_tr.imageset/Contents.json @@ -9,7 +9,7 @@ "scale" : "2x" }, { - "filename" : "room_manager_limit_tr@3x.png", + "filename" : "from (3).png", "idiom" : "universal", "scale" : "3x" } diff --git a/YuMi/Assets.xcassets/Language/tr/room_manager_limit_tr.imageset/from (3).png b/YuMi/Assets.xcassets/Language/tr/room_manager_limit_tr.imageset/from (3).png new file mode 100644 index 00000000..0be59d7a Binary files /dev/null and b/YuMi/Assets.xcassets/Language/tr/room_manager_limit_tr.imageset/from (3).png differ diff --git a/YuMi/Assets.xcassets/Language/tr/room_manager_limit_tr.imageset/room_manager_limit_tr@3x.png b/YuMi/Assets.xcassets/Language/tr/room_manager_limit_tr.imageset/room_manager_limit_tr@3x.png deleted file mode 100644 index 5f46f229..00000000 Binary files a/YuMi/Assets.xcassets/Language/tr/room_manager_limit_tr.imageset/room_manager_limit_tr@3x.png and /dev/null differ diff --git a/YuMi/Assets.xcassets/Login/ms_login_choose_phone_icon.imageset/1.png b/YuMi/Assets.xcassets/Login/ms_login_choose_phone_icon.imageset/1.png deleted file mode 100644 index e44f8257..00000000 Binary files a/YuMi/Assets.xcassets/Login/ms_login_choose_phone_icon.imageset/1.png and /dev/null differ diff --git a/YuMi/Assets.xcassets/utils/common_offical.imageset/Contents.json b/YuMi/Assets.xcassets/utils/common_offical.imageset/Contents.json deleted file mode 100644 index 2dd2d8a0..00000000 --- a/YuMi/Assets.xcassets/utils/common_offical.imageset/Contents.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "scale" : "1x" - }, - { - "idiom" : "universal", - "scale" : "2x" - }, - { - "filename" : "common_offical@3x.png", - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/YuMi/Assets.xcassets/utils/common_offical.imageset/common_offical@3x.png b/YuMi/Assets.xcassets/utils/common_offical.imageset/common_offical@3x.png deleted file mode 100644 index 40257f43..00000000 Binary files a/YuMi/Assets.xcassets/utils/common_offical.imageset/common_offical@3x.png and /dev/null differ diff --git a/YuMi/Assets.xcassets/yna/Menu/room_menu_play.imageset/Contents.json b/YuMi/Assets.xcassets/yna/Menu/room_menu_play.imageset/Contents.json deleted file mode 100644 index c1682f44..00000000 --- a/YuMi/Assets.xcassets/yna/Menu/room_menu_play.imageset/Contents.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "scale" : "1x" - }, - { - "idiom" : "universal", - "scale" : "2x" - }, - { - "filename" : "room_menu_play@3x.png", - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/YuMi/Assets.xcassets/yna/Menu/room_menu_play.imageset/room_menu_play@3x.png b/YuMi/Assets.xcassets/yna/Menu/room_menu_play.imageset/room_menu_play@3x.png deleted file mode 100644 index 8aa2c23d..00000000 Binary files a/YuMi/Assets.xcassets/yna/Menu/room_menu_play.imageset/room_menu_play@3x.png and /dev/null differ diff --git a/YuMi/CustomUI/MoliAvatar.m b/YuMi/CustomUI/MoliAvatar.m index 036a2a03..33baae84 100644 --- a/YuMi/CustomUI/MoliAvatar.m +++ b/YuMi/CustomUI/MoliAvatar.m @@ -74,7 +74,7 @@ [self addSubview:self.headWearSvgaImageView]; [self.headWearSvgaImageView mas_makeConstraints:^(MASConstraintMaker *make) { make.center.mas_equalTo(self.avatarView); - make.size.mas_equalTo(self.avatarView).multipliedBy(1.3); + make.size.mas_equalTo(self.avatarView).multipliedBy(1.4); }]; [self.headWearSvgaImageView setImageName:url]; @@ -84,7 +84,7 @@ [self addSubview:self.sequenceFrameHeadWear]; [self.sequenceFrameHeadWear mas_makeConstraints:^(MASConstraintMaker *make) { make.center.mas_equalTo(self.avatarView); - make.size.mas_equalTo(self.avatarView).multipliedBy(1.3); + make.size.mas_equalTo(self.avatarView).multipliedBy(1.4); }]; @kWeakify(self); diff --git a/YuMi/Modules/YMLogin/View/NewLogin/XPLoginViewController.m b/YuMi/Modules/YMLogin/View/NewLogin/XPLoginViewController.m index f1bb4510..31f76a7d 100644 --- a/YuMi/Modules/YMLogin/View/NewLogin/XPLoginViewController.m +++ b/YuMi/Modules/YMLogin/View/NewLogin/XPLoginViewController.m @@ -69,8 +69,6 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy"; ///上次登錄 @property(nonatomic,strong) UILabel *nextLabel; -///选择类型背景 -@property(nonatomic,strong) UIImageView *chooseTypeView; ///选择手机登录 @property(nonatomic,strong) UIButton *chooseAccountBtn; ///选择密码登录 @@ -167,7 +165,6 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy"; [self.view addSubview:self.chooseAccountBtn]; [self.view addSubview:self.chooseSMSBtn]; - [self.view addSubview:self.chooseTypeView]; [self.view addSubview:self.accountView]; [self.view addSubview:self.accountPwdView]; @@ -210,30 +207,17 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy"; CGFloat width = KScreenWidth/2; [self.chooseAccountBtn mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.mas_equalTo(0); + make.centerX.equalTo(self.view); make.height.mas_equalTo(kGetScaleWidth(22)); make.width.mas_equalTo(width); make.top.equalTo(self.logoView.mas_bottom).mas_offset(kGetScaleWidth(31)); }]; - - [self.chooseSMSBtn mas_makeConstraints:^(MASConstraintMaker *make) { - make.height.mas_equalTo(kGetScaleWidth(22)); - make.width.mas_equalTo(width); - make.top.equalTo(self.logoView.mas_bottom).mas_offset(kGetScaleWidth(31)); - make.trailing.mas_equalTo(0); - }]; - - [self.chooseTypeView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.equalTo(self.logoView.mas_bottom).mas_offset(kGetScaleWidth(48)); - make.width.mas_equalTo(kGetScaleWidth(24)); - make.height.mas_equalTo(kGetScaleWidth(14)); - make.leading.mas_equalTo(KScreenWidth/4 - kGetScaleWidth(12)); - }]; + [self.accountView mas_makeConstraints:^(MASConstraintMaker *make) { make.centerX.equalTo(self.view); make.width.mas_equalTo(kGetScaleWidth(303)); - make.top.mas_equalTo(self.chooseTypeView.mas_bottom).offset(kGetScaleWidth(13)); + make.top.mas_equalTo(self.chooseAccountBtn.mas_bottom).offset(kGetScaleWidth(13)); make.height.mas_equalTo(kGetScaleWidth(52)); }]; @@ -268,6 +252,13 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy"; make.top.mas_equalTo(self.loginBtn.mas_bottom).offset(kGetScaleWidth(23)); make.centerX.mas_equalTo(self.view); }]; + + [self.chooseSMSBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.height.mas_equalTo(kGetScaleWidth(22)); + make.width.mas_equalTo(width); + make.top.equalTo(self.stackView.mas_bottom).mas_offset(kGetScaleWidth(31)); + make.centerX.mas_equalTo(self.stackView); + }]; CGFloat left = isMSRTL() ? -11 : 11; CGFloat protocolWidth = 204; @@ -526,15 +517,6 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy"; _phoneInputView.hidden = _loginType == 0; _codeInputView.hidden = _loginType == 0; - - [self.chooseTypeView.superview layoutIfNeeded]; - CGFloat lead = _loginType == 0 ? KScreenWidth/4 - kGetScaleWidth(12) : KScreenWidth/4 * 3 - kGetScaleWidth(12); - [UIView animateWithDuration:0.1 animations:^{ - [self.chooseTypeView mas_updateConstraints:^(MASConstraintMaker *make) { - make.leading.mas_equalTo(lead); - }]; - [self.chooseTypeView.superview layoutIfNeeded]; - }]; } #pragma mark - XPLoginInputViewDelegate @@ -833,17 +815,6 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy"; return _loginBtn; } - - -- (UIImageView *)chooseTypeView{ - if(!_chooseTypeView){ - _chooseTypeView = [UIImageView new]; - _chooseTypeView.userInteractionEnabled = YES; - _chooseTypeView.contentMode = UIViewContentModeScaleAspectFit; - [_chooseTypeView setImage:kImage(@"ms_login_choose_phone_icon")]; - } - return _chooseTypeView; -} - (UIButton *)chooseAccountBtn{ if(!_chooseAccountBtn){ _chooseAccountBtn = [UIButton new]; diff --git a/YuMi/Modules/YMMessage/Model/AttachmentModel.m b/YuMi/Modules/YMMessage/Model/AttachmentModel.m index 340de2c0..6f434db3 100644 --- a/YuMi/Modules/YMMessage/Model/AttachmentModel.m +++ b/YuMi/Modules/YMMessage/Model/AttachmentModel.m @@ -10,7 +10,72 @@ @implementation AttachmentModel - (NSString *)encodeAttachment { +//#if DEBUG +// NSString *s = [self toJSONString]; +// NSString *ss = [self compressJSONString:s]; +// NSString *sss = [self convertModelToJSONString:self]; +//#endif return [self toJSONString]; } +- (NSDictionary *)toDictionary { + NSMutableDictionary *dict = [NSMutableDictionary dictionary]; + + if (self.data) { + dict[@"data"] = self.data; + } + dict[@"first"] = @(self.first); + dict[@"second"] = @(self.second); + dict[@"isBroadcast"] = @(self.isBroadcast); + + return [dict copy]; +} + +- (NSString *)convertModelToJSONString:(AttachmentModel *)model { + if (!model) { + return nil; + } + + // 获取模型的字典表示 + NSDictionary *modelDict = [model toDictionary]; + + // 将字典序列化为 JSON 数据 + NSError *error; + NSData *jsonData = [NSJSONSerialization dataWithJSONObject:modelDict options:0 error:&error]; + + if (error) { + NSLog(@"JSON 序列化失败: %@", error.localizedDescription); + return nil; + } + + // 转换为字符串 + return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; +} + +- (NSString *)compressJSONString:(NSString *)jsonString { + if (!jsonString) return nil; + + // 将 JSON 字符串转为对象(字典或数组) + NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding]; + NSError *error; + id jsonObject = [NSJSONSerialization JSONObjectWithData:jsonData options:0 error:&error]; + + if (error) { + NSLog(@"JSON 解析错误: %@", error.localizedDescription); + return nil; + } + + // 将对象重新序列化为紧凑格式的 JSON 数据 + NSData *compressedData = [NSJSONSerialization dataWithJSONObject:jsonObject options:0 error:&error]; + + if (error) { + NSLog(@"JSON 序列化错误: %@", error.localizedDescription); + return nil; + } + + // 转换为字符串 + NSString *compressedString = [[NSString alloc] initWithData:compressedData encoding:NSUTF8StringEncoding]; + return compressedString; +} + @end diff --git a/YuMi/Modules/YMMessage/View/SessionList/SessionListCell.m b/YuMi/Modules/YMMessage/View/SessionList/SessionListCell.m index 119b5aa6..73f1e918 100644 --- a/YuMi/Modules/YMMessage/View/SessionList/SessionListCell.m +++ b/YuMi/Modules/YMMessage/View/SessionList/SessionListCell.m @@ -86,12 +86,13 @@ self.timeLabel.text = [NIMTimeUtils formattedTimeFromInterval:timeSecond]; } [self.timeLabel sizeToFit]; + if (recent.unreadCount) { self.badgeView.hidden = NO; if (recent.unreadCount > 100) { - self.badgeView.text = @" 99+ "; + self.badgeView.text = @"99+"; } else { - self.badgeView.text = [NSString stringWithFormat:@" %@ ", @(recent.unreadCount)]; + self.badgeView.text = [NSString stringWithFormat:@"%@", @(recent.unreadCount)]; } } else { self.badgeView.hidden = YES; @@ -168,7 +169,7 @@ make.centerY.mas_equalTo(self.messageLabel); make.trailing.mas_equalTo(self.timeLabel); make.height.mas_equalTo(16); - make.width.mas_lessThanOrEqualTo(30); + make.width.mas_equalTo(16); }]; } @@ -225,6 +226,7 @@ _badgeView.backgroundColor = UIColorFromRGB(0xFF4E5C) ; _badgeView.textAlignment = NSTextAlignmentCenter; [_badgeView setCornerRadius:8]; + _badgeView.hidden = YES; } return _badgeView; } diff --git a/YuMi/Modules/YMMessage/View/SessionList/SessionListViewController.m b/YuMi/Modules/YMMessage/View/SessionList/SessionListViewController.m index 2440ccd8..d5969693 100644 --- a/YuMi/Modules/YMMessage/View/SessionList/SessionListViewController.m +++ b/YuMi/Modules/YMMessage/View/SessionList/SessionListViewController.m @@ -85,6 +85,10 @@ NSString * const kMessageShowReadDotKey = @"kMessageShowReadDotKey"; [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(allReadButtonClick) name:@"kAllReadAction" object:nil]; } +- (void)viewDidAppear:(BOOL)animated { + [super viewDidAppear:animated]; +} + - (void)getUserInfo { NSString * uid = [AccountInfoStorage instance].getUid; [Api getUserInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { diff --git a/YuMi/Modules/YMMine/View/DressUp/Model/DressUpShopModel.m b/YuMi/Modules/YMMine/View/DressUp/Model/DressUpShopModel.m index 4680e361..262fd318 100644 --- a/YuMi/Modules/YMMine/View/DressUp/Model/DressUpShopModel.m +++ b/YuMi/Modules/YMMine/View/DressUp/Model/DressUpShopModel.m @@ -34,8 +34,6 @@ NSForegroundColorAttributeName: UIColorFromRGB(0xF8CE1F) }; NSString *formattedPriceString; - -//TODO: 修改为支持 0-1-2 位小数 if (fmod(self.dressPrice, 1.0) == 0.0) { formattedPriceString = [NSString stringWithFormat:@"%ld", (long)self.dressPrice]; diff --git a/YuMi/Modules/YMMine/View/MineInfo/XPMineUserInfoViewController.m b/YuMi/Modules/YMMine/View/MineInfo/XPMineUserInfoViewController.m index 8687131a..066a92a3 100644 --- a/YuMi/Modules/YMMine/View/MineInfo/XPMineUserInfoViewController.m +++ b/YuMi/Modules/YMMine/View/MineInfo/XPMineUserInfoViewController.m @@ -404,9 +404,9 @@ HWDMP4PlayDelegate> if(isMSRTL()){ self.userMomentVC.view.hidden = YES; - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [self.titleView selectItemAtIndex:1]; - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [self.titleView selectItemAtIndex:0]; [self.userDataVC reloadView]; self.userMomentVC.view.hidden = NO; diff --git a/YuMi/Modules/YMMine/View/SubViews/CPGiftBanner.m b/YuMi/Modules/YMMine/View/SubViews/CPGiftBanner.m index 5d411b43..ba0135ed 100644 --- a/YuMi/Modules/YMMine/View/SubViews/CPGiftBanner.m +++ b/YuMi/Modules/YMMine/View/SubViews/CPGiftBanner.m @@ -113,25 +113,6 @@ }); } }]; - -// @kWeakify(bannerView); -// [UIView animateWithDuration:0.25 animations:^{ -// @kStrongify(bannerView); -// bannerView.center = CGPointMake(superView.center.x, height/2 + topSpace); -// } completion:^(BOOL finished) { -// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ -// [UIView animateWithDuration:0.25 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{ -// @kStrongify(bannerView); -// bannerView.frame = CGRectMake(-KScreenWidth, 0, width, height); -// } completion:^(BOOL finished) { -// @kStrongify(bannerView); -// if (bannerView.completeDisplay) { -// bannerView.completeDisplay(); -// } -// [bannerView removeFromSuperview]; -// }]; -// }); -// }]; } - (void)addNotification { diff --git a/YuMi/Modules/YMMine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.m b/YuMi/Modules/YMMine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.m index 3d291807..d8fbe9e4 100644 --- a/YuMi/Modules/YMMine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.m +++ b/YuMi/Modules/YMMine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.m @@ -126,13 +126,14 @@ HWDMP4PlayDelegate> @property (nonatomic,strong) SVGAImageView *onlineIconView; ///正在直播中 @property (nonatomic,strong) UIButton *onlineButton; -/// -@property (nonatomic,strong) UIStackView *idStackView; +@property(nonatomic, strong) UIStackView *stack; ///id @property (nonatomic,strong) UILabel *idLabel; @property (nonatomic, strong) UIImageView *copyIdImageView; @property (nonatomic, strong) XPBeautIDView *beautIDView; +@property(nonatomic, strong) UIView *idEmptyView; + @property (nonatomic, strong) UIButton *copyIdButton; ///魅力等级 等级 铭牌 @property (nonatomic,strong) UIStackView *tagStackView; @@ -270,7 +271,7 @@ HWDMP4PlayDelegate> [self setupNameArea]; - [self setupIDArea]; +// [self setupIDArea]; [self setupNameplateArea]; @@ -407,27 +408,66 @@ HWDMP4PlayDelegate> }]; } +- (void)scrollViewDidScroll:(UIScrollView *)scrollView { + NSLog(@"%@", [NSValue valueWithCGPoint:scrollView.contentOffset]); +} + - (void)setupIDArea { + if (_stack) { + return; + } + UIScrollView *scrollView = [[UIScrollView alloc] init]; - UIStackView *stack = [[UIStackView alloc] init]; - stack.axis = UILayoutConstraintAxisHorizontal; - stack.distribution = UIStackViewDistributionFill; - stack.alignment = UIStackViewAlignmentCenter; - stack.spacing = 4; - [self.userInfoView addSubview:stack]; - [stack mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.mas_equalTo(kGetScaleWidth(15)); - make.top.mas_equalTo(self.nickStackView.mas_bottom).offset(5); - make.height.mas_equalTo(24); - }]; - - [stack addArrangedSubview:self.beautIDView]; - [stack addArrangedSubview:self.idLabel]; - [stack addArrangedSubview:self.copyIdImageView]; - [stack addArrangedSubview:self.experImageView]; - [stack addArrangedSubview:self.charmImageView]; - [stack addArrangedSubview:self.vipPlateImageView]; - [stack addArrangedSubview:self.agentPlateImageView]; + _stack = [[UIStackView alloc] init]; + self.stack.axis = UILayoutConstraintAxisHorizontal; + self.stack.distribution = UIStackViewDistributionFill; + self.stack.alignment = UIStackViewAlignmentCenter; + self.stack.spacing = 4; + + if (self.userInfo.guildNameplateIcon.length > 0) { + scrollView.translatesAutoresizingMaskIntoConstraints = NO; + [self.userInfoView addSubview:scrollView]; + [scrollView mas_makeConstraints:^(MASConstraintMaker *make) { + make.leading.mas_equalTo(kGetScaleWidth(15)); + make.trailing.mas_equalTo(kGetScaleWidth(-15)); + make.top.mas_equalTo(self.nickStackView.mas_bottom).offset(5); + make.height.mas_equalTo(24); + }]; + [scrollView addSubview:self.stack]; + [self.stack mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.equalTo(scrollView); // 内容视图的边缘与滚动视图一致 + make.height.equalTo(scrollView); // 高度与滚动视图一致,确保仅水平滚动 + }]; + + if (isMSRTL()) { + _idEmptyView = [[UIView alloc] init]; + } + } else { + [self.userInfoView addSubview:self.stack]; + [self.stack mas_makeConstraints:^(MASConstraintMaker *make) { + make.leading.mas_equalTo(kGetScaleWidth(15)); + make.top.mas_equalTo(self.nickStackView.mas_bottom).offset(5); + make.height.mas_equalTo(24); + }]; + } + + [self.stack addArrangedSubview:self.beautIDView]; + [self.stack addArrangedSubview:self.idLabel]; + [self.stack addArrangedSubview:self.copyIdImageView]; + [self.stack addArrangedSubview:self.experImageView]; + [self.stack addArrangedSubview:self.charmImageView]; + [self.stack addArrangedSubview:self.vipPlateImageView]; + [self.stack addArrangedSubview:self.agentPlateImageView]; + if (_idEmptyView) { + [self.stack addArrangedSubview:self.idEmptyView]; + [self.idEmptyView mas_makeConstraints:^(MASConstraintMaker *make) { + make.height.mas_equalTo(24); + make.width.mas_equalTo(30); + }]; + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + [scrollView setContentOffset:CGPointMake(34, 0)]; + }); + } [self.beautIDView mas_makeConstraints:^(MASConstraintMaker *make) { make.height.mas_equalTo(24); @@ -877,6 +917,8 @@ HWDMP4PlayDelegate> - (void)updateIDInfo { NSString *text = [NSString stringWithFormat:@"%ld", (long)self.userInfo.erbanNo]; + [self setupIDArea]; + if (self.userInfo.hasPrettyErbanNo) { self.idLabel.hidden = YES; self.beautIDView.hidden = NO; @@ -1025,19 +1067,6 @@ HWDMP4PlayDelegate> return _sexImageView; } -- (UIStackView *)idStackView { - if (!_idStackView) { - _idStackView = [[UIStackView alloc] init]; - _idStackView.backgroundColor = [UIColor clearColor]; - _idStackView.distribution = UIStackViewDistributionFill; - _idStackView.alignment = UIStackViewAlignmentCenter; - _idStackView.userInteractionEnabled = YES; - _idStackView.spacing = 2; - _idStackView.clipsToBounds = NO; - } - return _idStackView; -} - - (UILabel *)idLabel { if (!_idLabel) { _idLabel = [[UILabel alloc] init]; @@ -1226,7 +1255,7 @@ HWDMP4PlayDelegate> if (!_officialImageView) { _officialImageView = [[UIImageView alloc] init]; _officialImageView.userInteractionEnabled = YES; - _officialImageView.image = [UIImage imageNamed:@"common_offical"]; + _officialImageView.image = [UIImage imageNamed:@"app_admin_icon"]; _officialImageView.hidden = YES; } return _officialImageView; diff --git a/YuMi/Modules/YMMonents/View/Cell/XPMomentsTableViewCell.m b/YuMi/Modules/YMMonents/View/Cell/XPMomentsTableViewCell.m index 4fc28678..e5bf1300 100644 --- a/YuMi/Modules/YMMonents/View/Cell/XPMomentsTableViewCell.m +++ b/YuMi/Modules/YMMonents/View/Cell/XPMomentsTableViewCell.m @@ -103,9 +103,9 @@ [self.topicView mas_makeConstraints:^(MASConstraintMaker *make) { make.height.mas_equalTo(kMOMENTS_TEXT_TOPIC_HEIGHT); }]; - [self.photoView mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.mas_equalTo(KScreenWidth-30); - }]; +// [self.photoView mas_makeConstraints:^(MASConstraintMaker *make) { +// make.width.mas_equalTo(KScreenWidth-30); +// }]; [self.toolBarView mas_makeConstraints:^(MASConstraintMaker *make) { make.leading.trailing.mas_equalTo(self.backView); make.top.mas_equalTo(self.stackView.mas_bottom).mas_offset(10); diff --git a/YuMi/Modules/YMMonents/View/SubViews/XPMomentsUserInfoView.m b/YuMi/Modules/YMMonents/View/SubViews/XPMomentsUserInfoView.m index 854efac3..0f81ac0f 100644 --- a/YuMi/Modules/YMMonents/View/SubViews/XPMomentsUserInfoView.m +++ b/YuMi/Modules/YMMonents/View/SubViews/XPMomentsUserInfoView.m @@ -459,7 +459,7 @@ if (!_officialImageView) { _officialImageView = [[UIImageView alloc] init]; _officialImageView.userInteractionEnabled = YES; - _officialImageView.image = [UIImage imageNamed:@"common_offical"]; + _officialImageView.image = [UIImage imageNamed:@"app_admin_icon"]; _officialImageView.hidden = YES; } return _officialImageView; diff --git a/YuMi/Modules/YMNewHome/Presenter/XPHomeMinePresenter.h b/YuMi/Modules/YMNewHome/Presenter/XPHomeMinePresenter.h index 6654fa37..d6d33a2c 100644 --- a/YuMi/Modules/YMNewHome/Presenter/XPHomeMinePresenter.h +++ b/YuMi/Modules/YMNewHome/Presenter/XPHomeMinePresenter.h @@ -13,8 +13,6 @@ NS_ASSUME_NONNULL_BEGIN - (void)getMyRoom; -//- (void)getMyCollectRooms:(NSInteger)page; -//- (void)getMyRecentRooms:(NSInteger)page; @end diff --git a/YuMi/Modules/YMNewHome/Presenter/XPHomeMinePresenter.m b/YuMi/Modules/YMNewHome/Presenter/XPHomeMinePresenter.m index 6b031b08..2bb0de64 100644 --- a/YuMi/Modules/YMNewHome/Presenter/XPHomeMinePresenter.m +++ b/YuMi/Modules/YMNewHome/Presenter/XPHomeMinePresenter.m @@ -29,22 +29,6 @@ }]; } -//- (void)getMyCollectRooms:(NSInteger)page { -// [Api getMyCollectRoomsCompletion:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { -// // TODO: 确认 model -// } -// pageNum:[NSString stringWithFormat:@"%ld", page] -// pageSize:@"20"]; -//} -// -//- (void)getMyRecentRooms:(NSInteger)page { -// [Api getMyRecentRoomsCompletion:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { -// // TODO: 确认 model -// } -// pageNum:[NSString stringWithFormat:@"%ld", page] -// pageSize:@"20"]; -//} - @end diff --git a/YuMi/Modules/YMNewHome/View/Cell/XPNewHomePartyCollectionViewCell.m b/YuMi/Modules/YMNewHome/View/Cell/XPNewHomePartyCollectionViewCell.m index 9def99d4..8bb8024d 100644 --- a/YuMi/Modules/YMNewHome/View/Cell/XPNewHomePartyCollectionViewCell.m +++ b/YuMi/Modules/YMNewHome/View/Cell/XPNewHomePartyCollectionViewCell.m @@ -168,6 +168,12 @@ make.leading.top.mas_equalTo(self.avatarView); make.size.mas_equalTo(CGSizeMake(40, 16)); }]; + + [self.boomImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.contentView).offset(11); + make.trailing.mas_equalTo(self.contentView).offset(-8); + make.size.mas_equalTo(CGSizeMake(40, 40)); + }]; } - (void)setRoomInfo:(HomePlayRoomModel *)roomInfo{ diff --git a/YuMi/Modules/YMNewHome/View/XPHomeMineViewController.m b/YuMi/Modules/YMNewHome/View/XPHomeMineViewController.m index 54b22db2..22d92e52 100644 --- a/YuMi/Modules/YMNewHome/View/XPHomeMineViewController.m +++ b/YuMi/Modules/YMNewHome/View/XPHomeMineViewController.m @@ -481,17 +481,9 @@ _titleView.defaultSelectedIndex = 0; _titleView.averageCellSpacingEnabled = NO; -// _titleView.cellWidth = 50; _titleView.cellSpacing = kGetScaleWidth(28); _titleView.listContainer = (id)self.pagingView.listContainerView; - -// JXCategoryIndicatorImageView *indicator = [[JXCategoryIndicatorImageView alloc] init]; -// indicator.indicatorImageView.image = [UIImage imageNamed:@"ms_login_choose_phone_icon"]; -// indicator.indicatorImageViewSize = CGSizeMake(kGetScaleWidth(24), kGetScaleWidth(24)); -// indicator.verticalMargin = -kGetScaleWidth(4); -// indicator.contentMode = UIViewContentModeScaleAspectFit; -// _titleView.indicators = @[indicator]; } return _titleView; } diff --git a/YuMi/Modules/YMNewHome/View/XPHomePagingViewController.m b/YuMi/Modules/YMNewHome/View/XPHomePagingViewController.m index 67cc9368..a9684c8b 100644 --- a/YuMi/Modules/YMNewHome/View/XPHomePagingViewController.m +++ b/YuMi/Modules/YMNewHome/View/XPHomePagingViewController.m @@ -38,13 +38,7 @@ - (void)viewDidLoad { [super viewDidLoad]; [self setup]; - [self preLoadGifts]; - -//#if DEBUG -// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ -// [self performSelector:@selector(completeUserInfo)]; -// }); -//#endif +// [self preLoadGifts]; } /// 禮物面板緩存-1: 登錄後,用空的 roomUid 預加載默認禮物,並緩存 diff --git a/YuMi/Modules/YMNewHome/View/XPNewHomeViewController.m b/YuMi/Modules/YMNewHome/View/XPNewHomeViewController.m index d9e81a7f..bf67a9a6 100644 --- a/YuMi/Modules/YMNewHome/View/XPNewHomeViewController.m +++ b/YuMi/Modules/YMNewHome/View/XPNewHomeViewController.m @@ -215,6 +215,14 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification; [self.tabCollectionView selectItemAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] animated:NO scrollPosition:UICollectionViewScrollPositionNone]; + + if (isMSRTL()) { + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + [self.tabCollectionView scrollToItemAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] + atScrollPosition:UICollectionViewScrollPositionCenteredHorizontally + animated:YES]; + }); + } } } } diff --git a/YuMi/Modules/YMRoom/Api/Api+Room.h b/YuMi/Modules/YMRoom/Api/Api+Room.h index f9c5e2c0..bbf83846 100644 --- a/YuMi/Modules/YMRoom/Api/Api+Room.h +++ b/YuMi/Modules/YMRoom/Api/Api+Room.h @@ -40,6 +40,8 @@ NS_ASSUME_NONNULL_BEGIN ticket:(NSString *)ticket mgId:(NSString *)mgId; ++ (void)closeRoom:(HttpRequestHelperCompletion)complection uid:(NSString *)uid ticket:(NSString *)ticket; + /// 房间上麦 /// @param complection 完成 /// @param micUid 上麦的uid diff --git a/YuMi/Modules/YMRoom/Api/Api+SuperAdmin.h b/YuMi/Modules/YMRoom/Api/Api+SuperAdmin.h new file mode 100644 index 00000000..4cfa195e --- /dev/null +++ b/YuMi/Modules/YMRoom/Api/Api+SuperAdmin.h @@ -0,0 +1,24 @@ +// +// Api+SuperAdmin.h +// YuMi +// +// Created by P on 2025/1/17. +// + +#import "Api.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface Api(SuperAdmin) +// type: 操作类型 1、解除进房限制;2、锁麦;3、闭麦;4、抱TA下麦;5、踢出房间;6、加入黑名单;7、关闭房间;8、隐藏房间;9、关闭公屏消息;10、开启公屏消息;11、移除黑名单 ++ (void)superAdminOperate:(HttpRequestHelperCompletion)complection + uid:(NSString *)uid + roomUid:(NSString *)roomUid + targetUid:(NSString *)targetUid + operateType:(NSNumber *)type; +// type: 0.关闭隐藏 1.开启隐藏 ++ (void)superAdminOperateRoom:(HttpRequestHelperCompletion)complection roomUid:(NSString *)roomUid type:(NSNumber *)type; + +@end + +NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/Api/Api+SuperAdmin.m b/YuMi/Modules/YMRoom/Api/Api+SuperAdmin.m new file mode 100644 index 00000000..e9466a20 --- /dev/null +++ b/YuMi/Modules/YMRoom/Api/Api+SuperAdmin.m @@ -0,0 +1,28 @@ +// +// Api+SuperAdmin.m +// YuMi +// +// Created by P on 2025/1/17. +// + +#import "Api+SuperAdmin.h" + +@implementation Api(SuperAdmin) + ++ (void)superAdminOperate:(HttpRequestHelperCompletion)complection + uid:(NSString *)uid + roomUid:(NSString *)roomUid + targetUid:(NSString *)targetUid + operateType:(NSNumber *)type { + [self makeRequest:@"super/admin/operate/save" + method:HttpRequestHelperMethodPOST + completion:complection, __FUNCTION__, uid, roomUid, targetUid, type, nil]; +} + ++ (void)superAdminOperateRoom:(HttpRequestHelperCompletion)complection roomUid:(NSString *)roomUid type:(NSNumber *)type { + [self makeRequest:@"super/hide/room" + method:HttpRequestHelperMethodPOST + completion:complection, __FUNCTION__, roomUid, type, nil]; +} + +@end diff --git a/YuMi/Modules/YMRoom/View/AcrossRoomPK/View/SubViews/XPAcrossRoomPKPanelView.m b/YuMi/Modules/YMRoom/View/AcrossRoomPK/View/SubViews/XPAcrossRoomPKPanelView.m index 9868cfaf..66c93bdb 100644 --- a/YuMi/Modules/YMRoom/View/AcrossRoomPK/View/SubViews/XPAcrossRoomPKPanelView.m +++ b/YuMi/Modules/YMRoom/View/AcrossRoomPK/View/SubViews/XPAcrossRoomPKPanelView.m @@ -388,7 +388,6 @@ static CGFloat MiniHeight = 130.5; } - (void)initUserSubViews { - // TODO: 换图 for (int i = 0; i < 3; i++) { XPAcrossRoomPKPanelUserView * userView = [[XPAcrossRoomPKPanelUserView alloc] init]; userView.tag = (1000 + i); diff --git a/YuMi/Modules/YMRoom/View/ActivityContainerView/XPRoomActivityContainerView.m b/YuMi/Modules/YMRoom/View/ActivityContainerView/XPRoomActivityContainerView.m index c7d1383b..17db6a48 100644 --- a/YuMi/Modules/YMRoom/View/ActivityContainerView/XPRoomActivityContainerView.m +++ b/YuMi/Modules/YMRoom/View/ActivityContainerView/XPRoomActivityContainerView.m @@ -43,7 +43,7 @@ #import "PIRoomActivityWebView.h" #import "MSRoomGameWebVC.h" -#import "XPRoomAnimationView.h" +#import "RoomAnimationView.h" #import "MSRoomMenuGameVC.h" #import "BoomInfoModel.h" @@ -698,9 +698,9 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView; vc.view.frame = CGRectMake(0, 0, KScreenWidth, KScreenHeight); XPRoomViewController *roomVC = (XPRoomViewController *)self.hostDelegate; [roomVC addChildViewController:vc]; - XPRoomAnimationView *animationView; + RoomAnimationView *animationView; for (id obj in self.hostDelegate.getSuperView.subviews) { - if ([obj isKindOfClass:[XPRoomAnimationView class]]){ + if ([obj isKindOfClass:[RoomAnimationView class]]){ animationView = obj; break; } diff --git a/YuMi/Modules/YMRoom/View/AnimationView/GameUniversalBannerView.m b/YuMi/Modules/YMRoom/View/AnimationView/GameUniversalBannerView.m index b0791264..a0319e1d 100644 --- a/YuMi/Modules/YMRoom/View/AnimationView/GameUniversalBannerView.m +++ b/YuMi/Modules/YMRoom/View/AnimationView/GameUniversalBannerView.m @@ -7,6 +7,7 @@ #import "GameUniversalBannerView.h" +#import #import #import "AttachmentModel.h" #import "PIUniversalBannerModel.h" @@ -45,26 +46,74 @@ bannerView.gameID = model.skipContent; [superView addSubview:bannerView]; - // TODO: 添加手势 | 调整为 pop 动画 - + [bannerView addNotification]; + @kWeakify(bannerView); - [UIView animateWithDuration:0.25 animations:^{ - bannerView.center = CGPointMake(superView.center.x, height/2 + 0); - } completion:^(BOOL finished) { - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - [UIView animateWithDuration:0.25 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{ - bannerView.frame = CGRectMake(-KScreenWidth, 0, width, height); - } completion:^(BOOL finished) { + [bannerView popEnterAnimation:^(BOOL finished) { + if (finished) { + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ @kStrongify(bannerView); - [bannerView removeFromSuperview]; - if (bannerView.completeDisplay) { - bannerView.completeDisplay(); - } - }]; - }); + [bannerView popLeaveAnimation:^(bool finished) { + if (bannerView.completeDisplay) { + bannerView.completeDisplay(); + } + [bannerView removeFromSuperview]; + }]; + }); + } }]; } +- (void)addNotification { + @kWeakify(self); + [[NSNotificationCenter defaultCenter] addObserverForName:@"SwipeOutBanner" + object:nil + queue:[NSOperationQueue mainQueue] + usingBlock:^(NSNotification * _Nonnull notification) { + @kStrongify(self); + [self dismissBanner]; + }]; +} + +- (void)dismissBanner { + [self pop_removeAllAnimations]; // 停止所有动画 + + [self popLeaveAnimation:^(bool finished) { + if (self.completeDisplay) { + self.completeDisplay(); + } + [self removeFromSuperview]; + }]; +} + +- (void)popEnterAnimation:(void(^)(BOOL finished))finish { + NSInteger height = kGetScaleWidth(70); + POPSpringAnimation *enterAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPViewFrame]; + enterAnimation.toValue = [NSValue valueWithCGRect:CGRectMake(0, 0, KScreenWidth, height)]; + enterAnimation.springBounciness = 10; // 弹性系数 + enterAnimation.springSpeed = 12; // 动画速度 + enterAnimation.completionBlock = ^(POPAnimation *anim, BOOL finished) { + if (finish) { + finish(finished); + } + }; + [self pop_addAnimation:enterAnimation forKey:@"enterAnimation"]; +} + +- (void)popLeaveAnimation:(void(^)(bool finished))finish { + NSInteger height = kGetScaleWidth(70); + POPBasicAnimation *exitAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewFrame]; + exitAnimation.toValue = [NSValue valueWithCGRect:CGRectMake(-KScreenWidth, 0, KScreenWidth, height)]; + exitAnimation.duration = 0.25; // 动画持续时间 + exitAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; + exitAnimation.completionBlock = ^(POPAnimation *anim, BOOL finished) { + if (finish) { + finish(finished); + } + }; + [self pop_addAnimation:exitAnimation forKey:@"exitAnimation"]; +} + - (instancetype)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { [self addSubview:self.bgSVGA]; diff --git a/YuMi/Modules/YMRoom/View/AnimationView/RoomAnimationView.m b/YuMi/Modules/YMRoom/View/AnimationView/RoomAnimationView.m index 80ff8f7d..bfb0626c 100644 --- a/YuMi/Modules/YMRoom/View/AnimationView/RoomAnimationView.m +++ b/YuMi/Modules/YMRoom/View/AnimationView/RoomAnimationView.m @@ -33,7 +33,6 @@ #import "GiftAnimationManager.h" #import "MSRoomGameWebVC.h" -#import "XPRoomAnimationView.h" #import "XPRoomViewController.h" #import "PIUniversalBannerView.h" #import "PIUniversalBannerModel.h" @@ -151,18 +150,19 @@ XPRoomGraffitiGiftAnimationViewDelegate - (void)dealloc { - if (self.giftEffectTimer) { + [[NIMSDK sharedSDK].broadcastManager removeDelegate:self]; + + [NSObject cancelPreviousPerformRequestsWithTarget:self]; + + [self pop_removeAllAnimations]; + + if (_giftEffectTimer) { dispatch_source_cancel(self.giftEffectTimer); self.giftEffectTimer = nil; } - if (self.giftEffectsQueue) { + if (_giftEffectsQueue) { self.giftEffectsQueue = NULL; } - - [self.enterRoomAnimationQueue removeAllObjects]; - [self.enterEffectView stopAnimation]; - - [[NIMSDK sharedSDK].broadcastManager removeDelegate:self]; } -(void)resumeTimer{ @@ -213,7 +213,6 @@ XPRoomGraffitiGiftAnimationViewDelegate [self.bannerContainer mas_makeConstraints:^(MASConstraintMaker *make) { make.top.mas_equalTo(self).offset(kNavigationHeight); make.leading.trailing.mas_equalTo(self); -// make.bottom.mas_equalTo(self.mas_centerY); make.height.mas_equalTo(180); }]; } @@ -255,6 +254,10 @@ XPRoomGraffitiGiftAnimationViewDelegate NSDictionary * dic = [(NSDictionary *)messageExt.roomExt.toJSONObject objectForKey:message.from]; XPMessageRemoteExtModel *extModel = [XPMessageRemoteExtModel modelWithJSON:dic]; + if (extModel.platformRole == 1) { + return; + } + if (extModel.enterHide) { //隐身进房 if ([message.from isEqualToString:[AccountInfoStorage instance].getUid]) { @@ -416,6 +419,9 @@ XPRoomGraffitiGiftAnimationViewDelegate - (void)endAnimationEnterEffect { self.isEnterRoomAnimating = NO; + [self.enterEffectView stopAnimation]; + self.enterEffectView.hidden = YES; + [self.enterEffectView removeFromSuperview]; [self tryDequeueAnimation]; } @@ -469,6 +475,11 @@ XPRoomGraffitiGiftAnimationViewDelegate } - (void)playRoomGiftBanner:(AttachmentModel *)obj { + if (!obj.data) { + [self processNextRoomEffectAttachment]; + return; + } + @kWeakify(self); [RoomHighValueGiftBannerAnimation display:self.bannerContainer with:obj @@ -589,9 +600,9 @@ XPRoomGraffitiGiftAnimationViewDelegate vc.view.frame = CGRectMake(0, 0, KScreenWidth, KScreenHeight); XPRoomViewController *roomVC = (XPRoomViewController *)self.hostDelegate; [roomVC addChildViewController:vc]; - XPRoomAnimationView *animationView; + RoomAnimationView *animationView; for (id obj in self.hostDelegate.getSuperView.subviews) { - if ([obj isKindOfClass:[XPRoomAnimationView class]]){ + if ([obj isKindOfClass:[RoomAnimationView class]]){ animationView = obj; break; } @@ -616,6 +627,9 @@ XPRoomGraffitiGiftAnimationViewDelegate if (!self.hostDelegate.getRoomInfo.hasAnimationEffect) { return; } + if (self.hostDelegate.getUserInfo.platformRole == 1) { + return; + } NSInteger otherViewType = [attachment.data[@"otherViewType"] integerValue]; NSString *viewUrl = attachment.data[@"viewUrl"]; NSString *effect = attachment.data[@"effect"]; @@ -1252,6 +1266,7 @@ XPRoomGraffitiGiftAnimationViewDelegate [self _handleGift:receiveInfo attachment:attachment]; break; case Custom_Message_Sub_AllMicroSend: + case Custom_Message_Sub_AllBatchSend: [self _handleGift:receiveInfo attachment:attachment]; break; case Custom_Message_Sub_Gift_ChannelNotify: @@ -1301,7 +1316,7 @@ XPRoomGraffitiGiftAnimationViewDelegate model.uid = receiveInfo.uid.integerValue; receiveInfo.targetUsers = @[model]; } - if (receiveInfo.targetUids.count == 0) { + if (receiveInfo.targetUids.count == 0 && attachment.second == Custom_Message_Sub_Gift_Send) { receiveInfo.targetUids = @[@(receiveInfo.uid.integerValue)]; } } @@ -1649,7 +1664,12 @@ XPRoomGraffitiGiftAnimationViewDelegate - (void)addBnnerContainGesture { UISwipeGestureRecognizer *swipe = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipe)]; - swipe.direction = UISwipeGestureRecognizerDirectionLeft; + if (isMSRTL()) { + swipe.direction = UISwipeGestureRecognizerDirectionRight; + } else { + swipe.direction = UISwipeGestureRecognizerDirectionLeft; + } + [self.bannerContainer addGestureRecognizer:swipe]; } @@ -1823,9 +1843,6 @@ XPRoomGraffitiGiftAnimationViewDelegate - (XPRoomAnimationHitView *)bannerContainer { if (!_bannerContainer) { _bannerContainer = [[XPRoomAnimationHitView alloc] init]; -//#if DEBUG -// _bannerContainer.backgroundColor = [UIColor colorWithWhite:1 alpha:0.4]; -//#endif } return _bannerContainer; } diff --git a/YuMi/Modules/YMRoom/View/AnimationView/XPRoomAnimationView.m b/YuMi/Modules/YMRoom/View/AnimationView/XPRoomAnimationView.m index 86e2505a..85a38ccd 100644 --- a/YuMi/Modules/YMRoom/View/AnimationView/XPRoomAnimationView.m +++ b/YuMi/Modules/YMRoom/View/AnimationView/XPRoomAnimationView.m @@ -59,7 +59,6 @@ #import "XPRoomStarKitchenBannerView.h" #import "XPWebViewController.h" #import "PIBaseAnimationViewModel.h" -#import "PIFullScreenBannerAnimation.h" #import "XPTreasureFairyGiftView.h" #import "XPRoomTarrowBannerView.h" #import "PIRoomGiftBroadcastWindow.h" diff --git a/YuMi/Modules/YMRoom/View/BaseUIContainerView/XPRoomFunctionContainerView.m b/YuMi/Modules/YMRoom/View/BaseUIContainerView/XPRoomFunctionContainerView.m index af6a4050..3a401f48 100644 --- a/YuMi/Modules/YMRoom/View/BaseUIContainerView/XPRoomFunctionContainerView.m +++ b/YuMi/Modules/YMRoom/View/BaseUIContainerView/XPRoomFunctionContainerView.m @@ -69,7 +69,6 @@ #import "XPAnchorPKResultView.h" #import "XPAnchorPKFinishView.h" #import "XPSendGiftView.h" -#import "XPUserCardViewController.h" #import "UserRoomCardViewController.h" #import "XPRoomViewController.h" #import "AcrossRoomPKPrizeModel.h" @@ -276,7 +275,7 @@ [self.hourRankEntranceView mas_makeConstraints:^(MASConstraintMaker *make) { make.width.mas_equalTo(66); - make.height.mas_equalTo(22); + make.height.mas_equalTo(27); }]; [self.musicEnterButton mas_makeConstraints:^(MASConstraintMaker *make) { @@ -1126,11 +1125,13 @@ RoomInfoModel * roomInfo = self.delegate.getRoomInfo; NSString * targetUid = uid; XPUserCardInfoModel * model = [[XPUserCardInfoModel alloc] init]; + __block MicroQueueModel *micModel = nil; [[self.delegate.getMicroQueue allValues] enumerateObjectsUsingBlock:^(MicroQueueModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { if (targetUid.integerValue == obj.userInfo.uid) { model.position = [NSString stringWithFormat:@"%d", obj.microState.position]; model.posState = obj.microState.posState; model.micState = obj.microState.micState; + micModel = obj; *stop = YES; } }]; @@ -1140,8 +1141,8 @@ model.roomInfo = roomInfo; model.micQueue = self.delegate.getMicroQueue; model.superMangerList = self.delegate.getRoomSuperAdminList; - - UserRoomCardViewController *vc = [[UserRoomCardViewController alloc] initWithUser:model]; + model.platformRole = micModel.userInfo.platformRole; + UserRoomCardViewController *vc = [[UserRoomCardViewController alloc] initWithUser:model controlUser:self.delegate.getUserInfo]; vc.modalPresentationStyle = UIModalPresentationOverFullScreen; [self.delegate.getCurrentNav presentViewController:vc animated:NO completion:nil]; } diff --git a/YuMi/Modules/YMRoom/View/LittleGame/View/XPRoomLittleGameContainerView.m b/YuMi/Modules/YMRoom/View/LittleGame/View/XPRoomLittleGameContainerView.m index 01313dee..705d1997 100644 --- a/YuMi/Modules/YMRoom/View/LittleGame/View/XPRoomLittleGameContainerView.m +++ b/YuMi/Modules/YMRoom/View/LittleGame/View/XPRoomLittleGameContainerView.m @@ -101,6 +101,12 @@ BOOL isTestEnv = NO; #ifdef DEBUG isTestEnv = YES; + + NSString *isProduction = [[NSUserDefaults standardUserDefaults]valueForKey:@"kIsProductionEnvironment"]; + if([isProduction isEqualToString:@"YES"]){ + isTestEnv = NO; + } + #else isTestEnv = NO; #endif diff --git a/YuMi/Modules/YMRoom/View/MenuContainerView/MSRoomMenuGameVC.m b/YuMi/Modules/YMRoom/View/MenuContainerView/MSRoomMenuGameVC.m index 5605fe9f..c07460b2 100644 --- a/YuMi/Modules/YMRoom/View/MenuContainerView/MSRoomMenuGameVC.m +++ b/YuMi/Modules/YMRoom/View/MenuContainerView/MSRoomMenuGameVC.m @@ -14,7 +14,7 @@ #import "XPSailingViewController.h" #import "XPRoomViewController.h" #import "MSRoomGameWebVC.h" -#import "XPRoomAnimationView.h" +#import "RoomAnimationView.h" #import "XPRoomMoreItemModel.h" #import "GuildSuperAdminInfoModel.h" #import "XPRoomPKViewController.h" @@ -306,9 +306,9 @@ vc.view.frame = CGRectMake(0, 0, KScreenWidth, KScreenHeight); XPRoomViewController *roomVC = (XPRoomViewController *)self.hostDelegate; [roomVC addChildViewController:vc]; - XPRoomAnimationView *animationView; + RoomAnimationView *animationView; for (id obj in self.hostDelegate.getSuperView.subviews) { - if ([obj isKindOfClass:[XPRoomAnimationView class]]){ + if ([obj isKindOfClass:[RoomAnimationView class]]){ animationView = obj; break; } @@ -318,24 +318,6 @@ } } -//-(void)clickLeaderccGameVC:(ActivityInfoModel *)model{ -// if ([self.hostDelegate isKindOfClass:[XPRoomViewController class]]){ -// MSRoomGameWebVC *vc = [[MSRoomGameWebVC alloc]initWithDelegate:self.hostDelegate gameModel:model]; -// vc.view.frame = CGRectMake(0, 0, KScreenWidth, KScreenHeight); -// XPRoomViewController *roomVC = (XPRoomViewController *)self.hostDelegate; -// [roomVC addChildViewController:vc]; -// XPRoomAnimationView *animationView; -// for (id obj in self.hostDelegate.getSuperView.subviews) { -// if ([obj isKindOfClass:[XPRoomAnimationView class]]){ -// animationView = obj; -// break; -// } -// } -// [self.hostDelegate.getSuperView addSubview:vc.view]; -// vc.view.tag = 913; -// } -//} - - (void)lookLoveTapRecognizer { if ([self.hostDelegate isKindOfClass:[XPRoomViewController class]]){ XPCandyTreeViewController * candyTreeVC = [[XPCandyTreeViewController alloc] initWithDelegate:self.hostDelegate]; diff --git a/YuMi/Modules/YMRoom/View/MenuContainerView/XPRoomMenuContainerView.m b/YuMi/Modules/YMRoom/View/MenuContainerView/XPRoomMenuContainerView.m index 0bcf8ff0..33ec82e6 100644 --- a/YuMi/Modules/YMRoom/View/MenuContainerView/XPRoomMenuContainerView.m +++ b/YuMi/Modules/YMRoom/View/MenuContainerView/XPRoomMenuContainerView.m @@ -17,6 +17,7 @@ #import "XCCurrentVCStackManager.h" #import "UIImage+Utils.h" ///Model +#import "UserInfoModel.h" #import "XPRoomMenuItem.h" #import "MicroQueueModel.h" #import "UserInfoModel.h" @@ -58,16 +59,12 @@ UIKIT_EXTERN NSString * kRoomBackMusicCaptureVolumeKey; @property (nonatomic,strong) UIButton *messageButton; ///更多 @property (nonatomic,strong) UIButton *moreButton; -/// PK 入口 -@property (nonatomic,strong) UIButton *pkButton; + ///礼物 @property (nonatomic,strong) UIButton *giftButton; ///排麦 @property (nonatomic,strong) UIButton *arrangeMicButton; -///游戏、活动 -@property(nonatomic,strong) UIButton *baiShunGameButton; - ///输入框 @property (nonatomic,strong) XPRoomSendTextView *inputTextView; @property (nonatomic,strong) XPRoomMessageBubbleView *miniMessageView; @@ -432,7 +429,9 @@ UIKIT_EXTERN NSString * kRoomBackMusicCaptureVolumeKey; - (void)initSubViewConstraints { [self.inputButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.size.mas_equalTo(CGSizeMake(110, 36)); +// make.size.mas_equalTo(CGSizeMake(110, 36)); + make.width.mas_greaterThanOrEqualTo(50); + make.height.mas_equalTo(36); }]; [self.faceButton mas_makeConstraints:^(MASConstraintMaker *make) { @@ -581,23 +580,28 @@ UIKIT_EXTERN NSString * kRoomBackMusicCaptureVolumeKey; [self onRoomUpdate]; } -- (void)onRoomUpdate { - RoomInfoModel * roomInfo = self.delegate.getRoomInfo; +- (void)superAdminLayout { + [self.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)]; + [self.stackView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)]; + [self addSubview:self.stackView]; + [self.stackView mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.mas_equalTo(self).offset(-kSafeAreaBottomHeight); + make.centerX.mas_equalTo(self); + make.top.mas_equalTo(self); + }]; + self.stackView.distribution = UIStackViewDistributionFillEqually; + self.stackView.alignment = UIStackViewAlignmentCenter; + [self.stackView addArrangedSubview:self.voiceButton]; + [self.stackView addArrangedSubview:self.messageButton]; + [self.stackView addArrangedSubview:self.moreButton]; +} - // MARK: 房主 or 超管可以看到按钮 - self.baiShunGameButton.hidden = YES; - self.pkButton.hidden = YES; - if ([AccountInfoStorage instance].getUid.integerValue == roomInfo.uid) { - self.baiShunGameButton.hidden = NO; - self.pkButton.hidden = roomInfo.type == RoomType_Anchor; - } else { - for (GuildSuperAdminInfoModel *managerInfo in self.delegate.getRoomSuperAdminList) { - if ([managerInfo.uid isEqualToString:[AccountInfoStorage instance].getUid]) { - self.baiShunGameButton.hidden = NO; - self.pkButton.hidden = NO; - break; - } - } +- (void)onRoomUpdate { + RoomInfoModel *roomInfo = self.delegate.getRoomInfo; + UserInfoModel *userInfo = self.delegate.getUserInfo; + if (userInfo.platformRole == 1) { + [self superAdminLayout]; + return; } self.arrangeMicButton.hidden = roomInfo.roomModeType != RoomModeType_Open_Micro_Mode; @@ -829,18 +833,6 @@ UIKIT_EXTERN NSString * kRoomBackMusicCaptureVolumeKey; return _moreButton; } -- (UIButton *)pkButton { - if (!_pkButton) { - _pkButton = [UIButton buttonWithType:UIButtonTypeCustom]; - _pkButton.imageView.contentMode = UIViewContentModeScaleAspectFit; - _pkButton.tag = XPRoomMenuItemType_PK; - [_pkButton setImage:[UIImage imageNamed:@"ms_room_menu_game"] forState:UIControlStateNormal]; - [_pkButton addTarget:self action:@selector(menuButtonAction:) forControlEvents:UIControlEventTouchUpInside]; - } - return _pkButton; -} - - - (UIButton *)giftButton { if (!_giftButton) { _giftButton = [UIButton buttonWithType:UIButtonTypeCustom]; @@ -881,16 +873,7 @@ UIKIT_EXTERN NSString * kRoomBackMusicCaptureVolumeKey; } return _miniMessageView; } -- (UIButton *)baiShunGameButton{ - if(!_baiShunGameButton){ - _baiShunGameButton = [UIButton new]; - [_baiShunGameButton setImage:[UIImage imageNamed:@"room_menu_play"] forState:UIControlStateNormal]; - [_baiShunGameButton setImage:[UIImage imageNamed:@"room_menu_play"] forState:UIControlStateSelected]; - _baiShunGameButton.tag = MSRoomMenuItemType_BAISHUN_GAME; - [_baiShunGameButton addTarget:self action:@selector(menuButtonAction:) forControlEvents:UIControlEventTouchUpInside]; - } - return _baiShunGameButton; -} + - (UIButton *)closeMicControlButton { if (!_closeMicControlButton) { diff --git a/YuMi/Modules/YMRoom/View/MenuContainerView/XPRoomSendTextView.m b/YuMi/Modules/YMRoom/View/MenuContainerView/XPRoomSendTextView.m index eecbd8e5..84072dda 100644 --- a/YuMi/Modules/YMRoom/View/MenuContainerView/XPRoomSendTextView.m +++ b/YuMi/Modules/YMRoom/View/MenuContainerView/XPRoomSendTextView.m @@ -85,6 +85,7 @@ extModel.androidBubbleUrl = userInfo.androidBubbleUrl; extModel.iosBubbleUrl = userInfo.iosBubbleUrl; extModel.fromSayHelloChannel = userInfo.fromSayHelloChannel; + extModel.platformRole = userInfo.platformRole; extModel.nick = userInfo.nick; if([self.delegate getPublicScreenType]==1){ diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m b/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m index 3a3e2c5c..a2fb287c 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m @@ -176,9 +176,6 @@ return [self createTarotAttribute:attachment messageInfo:messageInfo]; } else if (first == CustomMessageType_Anchor_FansTeam) {//粉丝团 return [self createAnchorFansTeamAttribute:attachment messageInfo:messageInfo]; - } else if(first == CustomMessageType_Hall_Super_Admin) {///超管踢人出房间 - XPKickUserModel * kickModel = [XPKickUserModel modelWithJSON:attachment.data]; - return [self createKickUserAttribute:attachment info:kickModel messageInfo:messageInfo]; } else if (first == CustomMessageType_Room_PK) {///房内PK return [self createRoomPKAttribute:attachment messageInfo:messageInfo]; } else if (first == CustomMessageType_LuckyBag) {///幸运礼物 @@ -219,6 +216,79 @@ return [self createGeneralPublicScreenAttribute:attachment messageInfo:messageInfo]; }else if(first == CustomMessageType_Super_Gift){ return [self createGeneralPublicScreenAttribute:attachment messageInfo:messageInfo]; + } else if (first == CustomMessageType_Hall_Super_Admin) { + messageInfo.bubbleImageUrl = @""; + NSString *content = @""; + NSDictionary *dic = attachment.data; + NSString *highLightContent = @""; + + switch (attachment.second) { + case Custom_Message_Sub_Hall_Super_Admin_Lock_Mic: { + NSNumber *micNum = [dic objectForKey:@"micNumber"]; + if (micNum) { + content = [NSString stringWithFormat:YMLocalizedString(@"1.0.34_text_8"), @(micNum.integerValue + 2)]; + } + } + break; + case Custom_Message_Sub_Hall_Super_Admin_Mute_Mic: { + NSNumber *micNum = [dic objectForKey:@"micNumber"]; + if (micNum) { + content = [NSString stringWithFormat:YMLocalizedString(@"1.0.34_text_9"), @(micNum.integerValue + 2)]; + } + } + break; + case Custom_Message_Sub_Hall_Super_Admin_Kick_Down_Mic: { + NSString *targetNick = [dic objectForKey:@"targetNick"]; + if (targetNick) { + content = [NSString stringWithFormat:YMLocalizedString(@"1.0.34_text_10"), targetNick]; + highLightContent = targetNick; + } + } + break; + case Custom_Message_Sub_Hall_Super_Admin_Kick_Out_Room: { + NSString *targetNick = [dic objectForKey:@"targetNick"]; + if (targetNick) { + content = [NSString stringWithFormat:YMLocalizedString(@"1.0.34_text_11"), targetNick]; + highLightContent = targetNick; + } + } + break; + case Custom_Message_Sub_Hall_Super_Admin_Mark_Black: { + NSString *targetNick = [dic objectForKey:@"targetNick"]; + if (targetNick) { + content = [NSString stringWithFormat:YMLocalizedString(@"1.0.34_text_12"), targetNick]; + highLightContent = targetNick; + } + } + break; + case Custom_Message_Sub_Hall_Super_Admin_Kick_Manager_Out_Room: { + XPKickUserModel * kickModel = [XPKickUserModel modelWithJSON:attachment.data]; + return [self createKickUserAttribute:attachment info:kickModel messageInfo:messageInfo]; + } + break; + + default: + break; + } + + if ([NSString isEmpty:content]) { + return nil; + } else { + NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] initWithString:content + attributes:@{ + NSFontAttributeName: kFontSemibold(14), + NSForegroundColorAttributeName: [UIColor lightTextColor] + }]; + NSRange range = [content rangeOfString:highLightContent]; + if (range.location != NSNotFound) { + // 设置目标文本颜色为红色 + [attribute addAttribute:NSForegroundColorAttributeName value:[DJDKMIMOMColor messageNickColor] range:range]; + } + messageInfo.content = attribute; + messageInfo.first = attachment.first; + return messageInfo; + } + } return nil; @@ -1290,7 +1360,7 @@ NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init]; //offical if (levelType == UserLevelType_Offical) { - [attribute appendAttributedString: [self createLocalImageAttribute:@"common_offical"]]; + [attribute appendAttributedString: [self createLocalImageAttribute:@"app_admin_icon"]]; [attribute appendAttributedString:[self createSapceAttribute:2]]; } if (newUser) { @@ -1349,11 +1419,14 @@ RoomInfoModel * roomInfo = self.hostDelegate.getRoomInfo; NSString * targetUid = [NSString stringWithFormat:@"%ld", uid]; XPUserCardInfoModel * model = [[XPUserCardInfoModel alloc] init]; + __block MicroQueueModel *micModel = nil; [[self.hostDelegate.getMicroQueue allValues] enumerateObjectsUsingBlock:^(MicroQueueModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { if (uid == obj.userInfo.uid) { model.position = [NSString stringWithFormat:@"%d", obj.microState.position]; model.posState = obj.microState.posState; model.micState = obj.microState.micState; + model.platformRole = obj.userInfo.platformRole; + micModel = obj; *stop = YES; } }]; @@ -1363,8 +1436,8 @@ model.roomInfo = roomInfo; model.delegate = self.hostDelegate; model.superMangerList = self.hostDelegate.getRoomSuperAdminList; - - UserRoomCardViewController *vc = [[UserRoomCardViewController alloc] initWithUser:model]; + model.platformRole = micModel.userInfo.platformRole; + UserRoomCardViewController *vc = [[UserRoomCardViewController alloc] initWithUser:model controlUser:self.hostDelegate.getUserInfo]; [self.hostDelegate.getCurrentNav presentViewController:vc animated:YES completion:nil]; } diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPRoomMessageTableViewCell.m b/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPRoomMessageTableViewCell.m index ca1f7038..d5312a68 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPRoomMessageTableViewCell.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/View/XPRoomMessageTableViewCell.m @@ -138,6 +138,9 @@ } - (void)updateLayoutWithoutBubble:(BOOL)hasBubble layoutSize:(CGSize)size { + if (self.isLeftBigImage) { + return; + } [self.contentLabel mas_remakeConstraints:^(MASConstraintMaker *make) { make.top.mas_equalTo(self.messageInfo.contentTopMargin); make.bottom.mas_equalTo(-self.messageInfo.cellBottomMargin); diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.m b/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.m index b7642d6a..131f42d4 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.m @@ -224,127 +224,6 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey"; // 6. 滚动到指定位置或底部 [self scrollToFirstLocationOrBottom]; - -// if (self.incomingMessages.count < 1) { -// NSInteger rows = self.datasource.count; -// if (!self.locationArray.count) { -// [self.messageTableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:(rows-1) inSection:0] atScrollPosition:UITableViewScrollPositionBottom animated:YES]; -// self.messageTipsBtn.hidden = YES; -// self.isPending = NO; -// self.atCount = 0; -// self.atTipBtn.hidden = YES; -// return; -// } -// int index = [self.locationArray[0] intValue]; -// NSIndexPath *indexPath = [NSIndexPath indexPathForRow:index inSection:0]; -// if (rows > indexPath.row) { -// [self.messageTableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionBottom animated:YES]; -// if (rows == indexPath.row + 1) { -// self.messageTipsBtn.hidden = YES; -// self.isPending = NO; -// } -// } else { -// [self.messageTableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:(rows-1) inSection:0] atScrollPosition:UITableViewScrollPositionBottom animated:YES]; -// //滚动到底部时隐藏@提示 -// self.messageTipsBtn.hidden = YES; -// } -// if (self.locationArray.count) { -// [self.locationArray removeObjectAtIndex:0]; -// self.atCount -= 1; -// [self.atTipBtn setTitle:[NSString stringWithFormat:YMLocalizedString(@"XPRoomMessageContainerView0"), (unsigned long)self.locationArray.count] forState:UIControlStateNormal]; -// if (self.locationArray.count == 0) { -// self.atTipBtn.hidden = YES; -// } -// } else { -// self.atTipBtn.hidden = YES; -// } -// } else { -// if (self.datasource.count > kRoomMessageMaxLength) { -// NSIndexSet *set = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, kRoomMessageMaxLength/2)]; -// NSArray *needRemoveMsgArray = [self.datasource objectsAtIndexes:set]; -// [self.datasource removeObjectsInArray:needRemoveMsgArray]; -// [self updateAllDataSource:nil]; -// NSMutableIndexSet *indexSet = [NSMutableIndexSet indexSet]; -// for (int i = 0; i indexPath.row) { -// [self.messageTableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionBottom animated:YES]; -// if (rows == indexPath.row + 1) { -// self.messageTipsBtn.hidden = YES; -// self.isPending = NO; -// } -// } else { -// [self.messageTableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:(rows-1) inSection:0] atScrollPosition:UITableViewScrollPositionBottom animated:YES]; -// //滚动到底部时隐藏@提示 -// self.messageTipsBtn.hidden = YES; -// } -// if (self.locationArray.count) { -// [self.locationArray removeObjectAtIndex:0]; -// self.atCount -= 1; -// [self.atTipBtn setTitle:[NSString stringWithFormat:YMLocalizedString(@"XPRoomMessageContainerView1"), (unsigned long)self.locationArray.count] forState:UIControlStateNormal]; -// if (self.locationArray.count == 0) { -// self.atTipBtn.hidden = YES; -// } -// } else { -// self.atTipBtn.hidden = YES; -// } -// } } - (void)scrollToBottomWithTipsHidden:(BOOL)hidden { @@ -573,19 +452,6 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey"; } if (self.isPending) { -// switch (self.displayType) { -// case 1: -// self.messageTipsBtn.hidden = self.datasource.count == messageCount; -// break; -// case 2: -// self.messageTipsBtn.hidden = self.datasource_chat.count == messageCount; -// break; -// case 3: -// self.messageTipsBtn.hidden = self.datasource_gift.count == messageCount; -// break; -// default: -// break; -// } self.messageTipsBtn.hidden = NO; [self findAtMeNumber]; } else { @@ -999,6 +865,32 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey"; } }]; return; + } else if (attachment.first == CustomMessageType_Hall_Super_Admin) { + [self addRoomMessage:message]; +// switch (attachment.second) { +// +// case Custom_Message_Sub_Hall_Super_Admin_Lock_Mic: { +// [self addRoomMessage:message]; +// } +// break; +// case Custom_Message_Sub_Hall_Super_Admin_Mute_Mic: +// [self addRoomMessage:message]; +// break; +// case Custom_Message_Sub_Hall_Super_Admin_Kick_Down_Mic: +// +// break; +// case Custom_Message_Sub_Hall_Super_Admin_Mark_Black: +// +// break; +// case Custom_Message_Sub_Hall_Super_Admin_Kick_Out_Room: +// +// break; +// case Custom_Message_Sub_Hall_Super_Admin_Kick_Manager_Out_Room: +// +// break; +// default: +// break; +// } } } if (self.hostDelegate.getRoomInfo.isCloseScreen) { @@ -1068,7 +960,7 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey"; } } }]; - } + }// else if (roomInfo) } } @@ -1514,6 +1406,7 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey"; extModel.androidBubbleUrl = userInfo.androidBubbleUrl; extModel.iosBubbleUrl = userInfo.iosBubbleUrl; extModel.fromSayHelloChannel = userInfo.fromSayHelloChannel; + extModel.platformRole = userInfo.platformRole; NSMutableDictionary *remoteExt = [NSMutableDictionary dictionaryWithObject:extModel.model2dictionary forKey:[NSString stringWithFormat:@"%ld", userInfo.uid]]; message.remoteExt = remoteExt; NIMSessionType sessionType = NIMSessionTypeChatroom; diff --git a/YuMi/Modules/YMRoom/View/MoreView/Model/XPRoomMoreItemModel.h b/YuMi/Modules/YMRoom/View/MoreView/Model/XPRoomMoreItemModel.h index 387c8155..b6554423 100644 --- a/YuMi/Modules/YMRoom/View/MoreView/Model/XPRoomMoreItemModel.h +++ b/YuMi/Modules/YMRoom/View/MoreView/Model/XPRoomMoreItemModel.h @@ -64,6 +64,8 @@ typedef NS_ENUM(NSInteger, RoomMoreMenuType) { RoomMoreMenuType_Room_Type_Background = 26, RoomMoreMenuType_Room_Music_Panel = 27, + + RoomMoreMenuType_App_Manager = 28, }; @interface XPRoomMoreItemModel : PIBaseModel @@ -78,6 +80,8 @@ typedef NS_ENUM(NSInteger, RoomMoreMenuType) { ///类型 @property (nonatomic,assign) RoomMoreMenuType type; +@property(nonatomic, strong) UIColor *imageTintColor; + +(XPRoomMoreItemModel *)initWithTitle:(NSString *)title imageName:(NSString *)imageName type:(RoomMoreMenuType)type titleColor:(UIColor *)titleColor; @end diff --git a/YuMi/Modules/YMRoom/View/MoreView/Presenter/XPMoreMenuPresenter.h b/YuMi/Modules/YMRoom/View/MoreView/Presenter/XPMoreMenuPresenter.h index 4be71216..19af4bb2 100644 --- a/YuMi/Modules/YMRoom/View/MoreView/Presenter/XPMoreMenuPresenter.h +++ b/YuMi/Modules/YMRoom/View/MoreView/Presenter/XPMoreMenuPresenter.h @@ -12,7 +12,7 @@ NS_ASSUME_NONNULL_BEGIN @interface XPMoreMenuPresenter : BaseMvpPresenter ///获取更多菜单 -- (void)getMoreMenuDataSource:(RoomInfoModel *)roomInfo isSuperAdmin:(BOOL)isSuperAdmin isOnMic:(BOOL)isOnMic; +- (void)getMoreMenuDataSource:(RoomInfoModel *)roomInfo isSuperAdmin:(BOOL)isSuperAdmin isOnMic:(BOOL)isOnMic isAppSuperAdmin:(BOOL)isAppSuperAdmin; /// 开启房间礼物值 /// @param roomUid 房间的uid diff --git a/YuMi/Modules/YMRoom/View/MoreView/Presenter/XPMoreMenuPresenter.m b/YuMi/Modules/YMRoom/View/MoreView/Presenter/XPMoreMenuPresenter.m index 872f4158..0f84b28d 100644 --- a/YuMi/Modules/YMRoom/View/MoreView/Presenter/XPMoreMenuPresenter.m +++ b/YuMi/Modules/YMRoom/View/MoreView/Presenter/XPMoreMenuPresenter.m @@ -25,7 +25,7 @@ @implementation XPMoreMenuPresenter -- (void)getMoreMenuDataSource:(RoomInfoModel *)roomInfo isSuperAdmin:(BOOL)isSuperAdmin isOnMic:(BOOL)isOnMic { +- (void)getMoreMenuDataSource:(RoomInfoModel *)roomInfo isSuperAdmin:(BOOL)isSuperAdmin isOnMic:(BOOL)isOnMic isAppSuperAdmin:(BOOL)isAppSuperAdmin{ XPRoomMoreItemModel * roomPK = [[XPRoomMoreItemModel alloc] init]; roomPK.title = roomInfo.roomModeType == RoomModeType_Open_PK_Mode ?YMLocalizedString(@"XPMoreMenuPresenter26") : YMLocalizedString(@"XPMoreMenuPresenter1"); roomPK.imageName= @"room_pk_menu_icon"; @@ -141,6 +141,12 @@ musicPanel.imageName = @"menu_music"; musicPanel.type = RoomMoreMenuType_Room_Music_Panel; musicPanel.titleColor = [DJDKMIMOMColor roomMoreMenuTextColor]; + + XPRoomMoreItemModel *appManager = [[XPRoomMoreItemModel alloc] init]; + appManager.type = RoomMoreMenuType_App_Manager; + appManager.title = YMLocalizedString(@"1.0.34_text_1"); + appManager.imageName = @"app_admin_icon"; + appManager.titleColor = [UIColor orangeColor]; NSString * uid = [AccountInfoStorage instance].getUid; if (uid.length <= 0) { @@ -150,6 +156,16 @@ NIMChatroomMembersByIdsRequest *request = [[NIMChatroomMembersByIdsRequest alloc]init]; request.roomId = roomId; request.userIds = @[uid]; + + if (isAppSuperAdmin) { + NSMutableArray * array = [NSMutableArray array]; + [array addObject:trumpet]; + [array addObject:giftEffect]; + [array addObject:appManager]; + [array addObject:report]; + [[self getView] getMoreMenuDataSuccess:array]; + return; + } [[NIMSDK sharedSDK].chatroomManager fetchChatroomMembersByIds:request completion:^(NSError * _Nullable error, NSArray * _Nullable members) { NSMutableArray * array = [NSMutableArray array]; diff --git a/YuMi/Modules/YMRoom/View/MoreView/View/AppOfficalManagerActionsViewController.h b/YuMi/Modules/YMRoom/View/MoreView/View/AppOfficalManagerActionsViewController.h new file mode 100644 index 00000000..44936b4b --- /dev/null +++ b/YuMi/Modules/YMRoom/View/MoreView/View/AppOfficalManagerActionsViewController.h @@ -0,0 +1,23 @@ +// +// AppOfficalManagerActionsViewController.h +// YuMi +// +// Created by P on 2025/1/17. +// + +#import "MvpViewController.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface AppOfficalManagerActionsViewController : MvpViewController + +@property(nonatomic, assign) BOOL isRoomHide; + +@property(nonatomic, copy) NSString *controlUid; +@property(nonatomic, copy) NSString *targetUid; +@property(nonatomic, copy) NSString *roomUid; +@property(nonatomic, copy) NSString *roomID; + +@end + +NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/MoreView/View/AppOfficalManagerActionsViewController.m b/YuMi/Modules/YMRoom/View/MoreView/View/AppOfficalManagerActionsViewController.m new file mode 100644 index 00000000..9506fc20 --- /dev/null +++ b/YuMi/Modules/YMRoom/View/MoreView/View/AppOfficalManagerActionsViewController.m @@ -0,0 +1,251 @@ +// +// AppOfficalManagerActionsViewController.m +// YuMi +// +// Created by P on 2025/1/17. +// + +#import "AppOfficalManagerActionsViewController.h" + +#import "Api+Room.h" +#import "Api+SuperAdmin.h" +#import "XPRoomRoleViewController.h" + +@interface AppOfficalManagerActionsViewController () + +@property(nonatomic, strong) UIView *hideRoom; +@property(nonatomic, strong) UILabel *hideRoomTitle; +@property(nonatomic, strong) UISwitch *hideRoomSwitch; + +@property(nonatomic, strong) UIView *blackList; +@property(nonatomic, strong) UILabel *blackListTitle; +@property(nonatomic, strong) UIImageView *blackListArrow; + +@property(nonatomic, strong) UIView *closeRoom; +@property(nonatomic, strong) UILabel *closeRoomTitle; +@property(nonatomic, strong) UIImageView *closeRoomMark; + +@end + +@implementation AppOfficalManagerActionsViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + self.title = YMLocalizedString(@"1.0.34_text_1"); + +// [self.view addSubview:self.hideRoom]; + [self.view addSubview:self.blackList]; + [self.view addSubview:self.closeRoom]; + +// [self.hideRoom mas_makeConstraints:^(MASConstraintMaker *make) { +// make.leading.trailing.mas_equalTo(self.view).inset(15); +// make.top.mas_equalTo(16); +// make.height.mas_equalTo(64); +// }]; + + [self.blackList mas_makeConstraints:^(MASConstraintMaker *make) { + make.leading.trailing.mas_equalTo(self.view).inset(15); +// make.top.mas_equalTo(self.hideRoom.mas_bottom).offset(8); + make.top.mas_equalTo(16); + make.height.mas_equalTo(64); + }]; + + [self.closeRoom mas_makeConstraints:^(MASConstraintMaker *make) { + make.leading.trailing.mas_equalTo(self.view).inset(15); + make.top.mas_equalTo(self.blackList.mas_bottom).offset(8); + make.height.mas_equalTo(64); + }]; + +// [self.hideRoom addSubview:self.hideRoomTitle]; +// [self.hideRoom addSubview:self.hideRoomSwitch]; +// [self.hideRoomTitle mas_makeConstraints:^(MASConstraintMaker *make) { +// make.centerY.mas_equalTo(self.hideRoom); +// make.leading.mas_equalTo(15); +// make.height.mas_equalTo(18); +// }]; +// [self.hideRoomSwitch mas_makeConstraints:^(MASConstraintMaker *make) { +// make.centerY.mas_equalTo(self.hideRoom); +// make.trailing.mas_equalTo(-15); +// }]; + + [self.blackList addSubview:self.blackListTitle]; + [self.blackList addSubview:self.blackListArrow]; + [self.blackListTitle mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerY.mas_equalTo(self.blackList); + make.leading.mas_equalTo(15); + make.height.mas_equalTo(18); + }]; + [self.blackListArrow mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerY.mas_equalTo(self.blackList); + make.trailing.mas_equalTo(-15); + make.size.mas_equalTo(CGSizeMake(18, 18)); + }]; + + [self.closeRoom addSubview:self.closeRoomTitle]; + [self.closeRoom addSubview:self.closeRoomMark]; + [self.closeRoomTitle mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerY.mas_equalTo(self.closeRoom); + make.leading.mas_equalTo(15); + make.height.mas_equalTo(18); + }]; + [self.closeRoomMark mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerY.mas_equalTo(self.closeRoom); + make.trailing.mas_equalTo(-15); + make.size.mas_equalTo(CGSizeMake(18, 18)); + }]; +} + +- (void)viewDidAppear:(BOOL)animated { + [super viewDidAppear:animated]; + self.hideRoomSwitch.on = self.isRoomHide; +} + +#pragma mark - +- (void)switchDidChange:(UISwitch *)sender { + BOOL newState = sender.isOn; // 用户意图改变的状态 + sender.on = !newState; // 立即恢复到原来的状态,等待用户确认后改变 + + TTAlertConfig *config = [[TTAlertConfig alloc] init]; + config.title = YMLocalizedString(@"1.0.18_20"); + config.message = YMLocalizedString(@"1.0.34_text_4"); + config.actionStyle = TTAlertActionBothStyle; + @kWeakify(self); + [TTPopup alertWithConfig:config confirmHandler:^{ + @kStrongify(self); + [XNDJTDDLoadingTool showLoading]; + [Api superAdminOperateRoom:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { + [XNDJTDDLoadingTool hideHUD]; + if (code == 200) { + sender.on = newState; + } else { + [XNDJTDDLoadingTool showErrorWithMessage:msg]; + } + } roomUid:self.roomUid type:sender.isOn ? @1 : @0]; + } cancelHandler:^{ + + }]; +} + +- (void)handleCloseRoom { + TTAlertConfig *config = [[TTAlertConfig alloc] init]; + config.title = YMLocalizedString(@"1.0.18_20"); + config.message = YMLocalizedString(@"1.0.34_text_5"); + config.actionStyle = TTAlertActionBothStyle; + @kWeakify(self); + [TTPopup alertWithConfig:config confirmHandler:^{ + [XNDJTDDLoadingTool showLoading]; + @kStrongify(self); + [Api closeRoom:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { + if (code == 200) { + [Api superAdminOperate:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { + [XNDJTDDLoadingTool hideHUD]; + + } uid:self.controlUid roomUid:self.roomUid targetUid:self.targetUid operateType:@7]; + }else { + [XNDJTDDLoadingTool showErrorWithMessage:msg]; + } + } uid:self.roomUid ticket:[[AccountInfoStorage instance] getTicket]]; + } cancelHandler:^{ + + }]; +} + +- (void)handleBlackList { + XPRoomRoleViewController * managerVC = [[XPRoomRoleViewController alloc] init]; + managerVC.roomId = self.roomID; + managerVC.type = RoomRoleListType_Black; + managerVC.isAppAdmin = YES; + [self.navigationController pushViewController:managerVC animated:YES]; +} + +#pragma mark - +- (UIView *)hideRoom { + if (!_hideRoom) { + _hideRoom = [[UIView alloc] init]; + _hideRoom.backgroundColor = [UIColor whiteColor]; + [_hideRoom setCornerRadius:8]; + } + return _hideRoom; +} + +- (UILabel *)hideRoomTitle { + if (!_hideRoomTitle) { + _hideRoomTitle = [UILabel labelInitWithText:YMLocalizedString(@"1.0.34_text_2") + font:kFontSemibold(14) + textColor:UIColorFromRGB(0x313131)]; + } + return _hideRoomTitle; +} + +- (UISwitch *)hideRoomSwitch { + if (!_hideRoomSwitch) { + _hideRoomSwitch = [[UISwitch alloc] init]; + _hideRoomSwitch.onTintColor = [DJDKMIMOMColor appEmphasizeColor]; + _hideRoomSwitch.tintColor = [DJDKMIMOMColor appMainColor]; + _hideRoomSwitch.backgroundColor = [UIColor clearColor]; + [_hideRoomSwitch addTarget:self action:@selector(switchDidChange:) forControlEvents:UIControlEventValueChanged]; + } + return _hideRoomSwitch; +} + +- (UIView *)blackList { + if (!_blackList) { + _blackList = [[UIView alloc] init]; + _blackList.backgroundColor = [UIColor whiteColor]; + [_blackList setCornerRadius:8]; + + UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleBlackList)]; + [_blackList addGestureRecognizer:tap]; + } + return _blackList; +} + +- (UILabel *)blackListTitle { + if (!_blackListTitle) { + _blackListTitle = [UILabel labelInitWithText:YMLocalizedString(@"XPMineSettingPresent20") + font:kFontSemibold(14) + textColor:UIColorFromRGB(0x313131)]; + } + return _blackListTitle; +} + +- (UIImageView *)blackListArrow { + if (!_blackListArrow) { + _blackListArrow = [[UIImageView alloc] initWithImage:kImage(@"pi_room_photo_album_choose_photo_gift_arrow")]; + } + return _blackListArrow; +} + + +- (UIView *)closeRoom { + if (!_closeRoom) { + _closeRoom = [[UIView alloc] init]; + _closeRoom.backgroundColor = [UIColor whiteColor]; + [_closeRoom setCornerRadius:8]; + + UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleCloseRoom)]; + [_closeRoom addGestureRecognizer:tap]; + } + return _closeRoom; +} + +- (UILabel *)closeRoomTitle { + if (!_closeRoomTitle) { + _closeRoomTitle = [UILabel labelInitWithText:YMLocalizedString(@"1.0.34_text_3") + font:kFontSemibold(14) + textColor:UIColorFromRGB(0x313131)]; + _closeRoomTitle.userInteractionEnabled = NO; + } + return _closeRoomTitle; +} + +- (UIImageView *)closeRoomMark { + if (!_closeRoomMark) { + _closeRoomMark = [[UIImageView alloc] initWithImage:kImage(@"room_across_pk_invite_result_close")]; + _closeRoomMark.userInteractionEnabled = NO; + } + return _closeRoomMark; +} + +@end diff --git a/YuMi/Modules/YMRoom/View/MoreView/View/Cell/XPRoomMoreMenuCollectionViewCell.m b/YuMi/Modules/YMRoom/View/MoreView/View/Cell/XPRoomMoreMenuCollectionViewCell.m index 6fce10e0..d834e1b0 100644 --- a/YuMi/Modules/YMRoom/View/MoreView/View/Cell/XPRoomMoreMenuCollectionViewCell.m +++ b/YuMi/Modules/YMRoom/View/MoreView/View/Cell/XPRoomMoreMenuCollectionViewCell.m @@ -53,9 +53,14 @@ - (void)setItemModel:(XPRoomMoreItemModel *)itemModel { _itemModel = itemModel; if (_itemModel) { - self.logoImageView.image = [UIImage getLanguageImage:_itemModel.imageName]; self.titleLabel.text = _itemModel.title; self.titleLabel.textColor = _itemModel.titleColor ? _itemModel.titleColor : [DJDKMIMOMColor mainTextColor]; + if (itemModel.imageTintColor) { + self.logoImageView.image = [[UIImage getLanguageImage:_itemModel.imageName] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; + self.logoImageView.tintColor = itemModel.imageTintColor; + } else { + self.logoImageView.image = [UIImage getLanguageImage:_itemModel.imageName]; + } } } diff --git a/YuMi/Modules/YMRoom/View/MoreView/View/XPRoomMoreMenuViewController.m b/YuMi/Modules/YMRoom/View/MoreView/View/XPRoomMoreMenuViewController.m index 06f97307..457cf22f 100644 --- a/YuMi/Modules/YMRoom/View/MoreView/View/XPRoomMoreMenuViewController.m +++ b/YuMi/Modules/YMRoom/View/MoreView/View/XPRoomMoreMenuViewController.m @@ -24,7 +24,9 @@ #import "GuildSuperAdminInfoModel.h" #import "AccountInfoStorage.h" #import "NSArray+Safe.h" +#import "UserInfoModel.h" ///View +#import "AppOfficalManagerActionsViewController.h" #import "XPRoomMoreMenuCollectionViewCell.h" #import "XPRoomInviteFansView.h" #import "XPAcrossRoomPKViewController.h" @@ -97,7 +99,10 @@ UIKIT_EXTERN NSString * const kRoomGiftEffectUpdateNotificationKey; break; } } - [self.presenter getMoreMenuDataSource:self.roomInfo isSuperAdmin:meIsSuperAdmin isOnMic:self.isOnMic]; + [self.presenter getMoreMenuDataSource:self.roomInfo + isSuperAdmin:meIsSuperAdmin + isOnMic:self.isOnMic + isAppSuperAdmin:[self.hostDelegate.getUserInfo platformRole]==1]; } #pragma mark - Private Method @@ -530,6 +535,17 @@ UIKIT_EXTERN NSString * const kRoomGiftEffectUpdateNotificationKey; @kStrongify(self); [self.hostDelegate displayMusicPanel]; }]; + } + break; + case RoomMoreMenuType_App_Manager:{ + [self dismissViewControllerAnimated:NO completion:nil]; + AppOfficalManagerActionsViewController *vc = [[AppOfficalManagerActionsViewController alloc] init]; + vc.roomID = @(self.roomInfo.roomId).stringValue; + vc.roomUid = roomUid; + vc.targetUid = roomUid; + vc.controlUid = @(self.hostDelegate.getUserInfo.uid).stringValue; + vc.isRoomHide = self.roomInfo.hideFlag; + [self.hostDelegate.getCurrentNav pushViewController:vc animated:YES]; } break; default: diff --git a/YuMi/Modules/YMRoom/View/QuickMessageView/XPRoomQuickMessageContainView.m b/YuMi/Modules/YMRoom/View/QuickMessageView/XPRoomQuickMessageContainView.m index e7de88c8..d8d6cb6d 100644 --- a/YuMi/Modules/YMRoom/View/QuickMessageView/XPRoomQuickMessageContainView.m +++ b/YuMi/Modules/YMRoom/View/QuickMessageView/XPRoomQuickMessageContainView.m @@ -124,6 +124,7 @@ extModel.androidBubbleUrl = userInfo.androidBubbleUrl; extModel.iosBubbleUrl = userInfo.iosBubbleUrl; extModel.fromSayHelloChannel = userInfo.fromSayHelloChannel; + extModel.platformRole = userInfo.platformRole; extModel.nick = userInfo.nick; NIMMessage * message = [[NIMMessage alloc] init]; diff --git a/YuMi/Modules/YMRoom/View/RoomGame/View/SubView/MSRoomGameMsgView.m b/YuMi/Modules/YMRoom/View/RoomGame/View/SubView/MSRoomGameMsgView.m index 3608a782..43c46723 100644 --- a/YuMi/Modules/YMRoom/View/RoomGame/View/SubView/MSRoomGameMsgView.m +++ b/YuMi/Modules/YMRoom/View/RoomGame/View/SubView/MSRoomGameMsgView.m @@ -263,6 +263,7 @@ extModel.androidBubbleUrl = userInfo.androidBubbleUrl; extModel.iosBubbleUrl = userInfo.iosBubbleUrl; extModel.fromSayHelloChannel = userInfo.fromSayHelloChannel; + extModel.platformRole = userInfo.platformRole; NSMutableDictionary *remoteExt = [NSMutableDictionary dictionaryWithObject:extModel.model2dictionary forKey:[NSString stringWithFormat:@"%ld", userInfo.uid]]; message.remoteExt = remoteExt; NIMSessionType sessionType = NIMSessionTypeChatroom; diff --git a/YuMi/Modules/YMRoom/View/RoomGame/View/SubView/MSRoomGameSendTextView.m b/YuMi/Modules/YMRoom/View/RoomGame/View/SubView/MSRoomGameSendTextView.m index 0aba36f6..4f06c787 100644 --- a/YuMi/Modules/YMRoom/View/RoomGame/View/SubView/MSRoomGameSendTextView.m +++ b/YuMi/Modules/YMRoom/View/RoomGame/View/SubView/MSRoomGameSendTextView.m @@ -71,6 +71,7 @@ extModel.androidBubbleUrl = userInfo.androidBubbleUrl; extModel.iosBubbleUrl = userInfo.iosBubbleUrl; extModel.fromSayHelloChannel = userInfo.fromSayHelloChannel; + extModel.platformRole = userInfo.platformRole; extModel.nick = userInfo.nick; NIMMessage * message = [[NIMMessage alloc] init]; diff --git a/YuMi/Modules/YMRoom/View/RoomSideMenu/RoomSideMenu.m b/YuMi/Modules/YMRoom/View/RoomSideMenu/RoomSideMenu.m index a3cf24e5..42b74214 100644 --- a/YuMi/Modules/YMRoom/View/RoomSideMenu/RoomSideMenu.m +++ b/YuMi/Modules/YMRoom/View/RoomSideMenu/RoomSideMenu.m @@ -24,7 +24,7 @@ #import "MSRoomGameWebVC.h" #import "MSRoomMenuGameVC.h" -#import "XPRoomAnimationView.h" +#import "RoomAnimationView.h" #import "XPWebViewController.h" #import "XPRoomViewController.h" #import "PIRoomActivityWebView.h" @@ -425,9 +425,9 @@ static CGFloat const kNormalHeight = 160.0f; vc.view.frame = CGRectMake(0, 0, KScreenWidth, KScreenHeight); XPRoomViewController *roomVC = (XPRoomViewController *)self.hostDelegate; [roomVC addChildViewController:vc]; - XPRoomAnimationView *animationView; + RoomAnimationView *animationView; for (id obj in self.hostDelegate.getSuperView.subviews) { - if ([obj isKindOfClass:[XPRoomAnimationView class]]){ + if ([obj isKindOfClass:[RoomAnimationView class]]){ animationView = obj; break; } diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/GiftComboManager.m b/YuMi/Modules/YMRoom/View/SendGiftView/GiftComboManager.m index a30cc2a1..70fd9187 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/GiftComboManager.m +++ b/YuMi/Modules/YMRoom/View/SendGiftView/GiftComboManager.m @@ -514,6 +514,7 @@ extModel.androidBubbleUrl = userInfo.androidBubbleUrl; extModel.iosBubbleUrl = userInfo.iosBubbleUrl; extModel.fromSayHelloChannel = userInfo.fromSayHelloChannel; + extModel.platformRole = userInfo.platformRole; NSMutableDictionary *remoteExt = [NSMutableDictionary dictionaryWithObject:extModel.model2dictionary forKey:[NSString stringWithFormat:@"%ld", userInfo.uid]]; message.remoteExt = remoteExt; diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/View/Cell/XPGiftUserCollectionViewCell.m b/YuMi/Modules/YMRoom/View/SendGiftView/View/Cell/XPGiftUserCollectionViewCell.m index cddf3ab3..b854cd3d 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/View/Cell/XPGiftUserCollectionViewCell.m +++ b/YuMi/Modules/YMRoom/View/SendGiftView/View/Cell/XPGiftUserCollectionViewCell.m @@ -16,6 +16,7 @@ #import "XPGiftUserInfoModel.h" ///View #import "NetImageView.h" +#import "XPSkillCardPlayerManager.h" @interface XPGiftUserCollectionViewCell () ///头像 @@ -30,6 +31,8 @@ - (instancetype)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { + self.clipsToBounds = NO; + self.contentView.clipsToBounds = NO; [self initSubViews]; [self initSubViewConstraints]; } @@ -56,7 +59,7 @@ [self.positionLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.height.mas_equalTo(10); make.centerY.mas_equalTo(self.avatarImageView.mas_bottom); - make.width.mas_equalTo(10); + make.width.mas_equalTo(10); make.centerX.mas_equalTo(self.avatarImageView); }]; } @@ -72,17 +75,26 @@ make.width.mas_equalTo(28); }]; } else { - if (_userInfo.position.integerValue == -1) { - self.positionLabel.text = YMLocalizedString(@"XPGiftUserCollectionViewCell0"); - [self.positionLabel mas_updateConstraints:^(MASConstraintMaker *make) { - make.width.mas_equalTo(28); - }]; - } else { - self.positionLabel.text = [NSString stringWithFormat:@"%ld", _userInfo.position.integerValue + 1]; - [self.positionLabel mas_updateConstraints:^(MASConstraintMaker *make) { - make.width.mas_equalTo(10); - }]; - } + if ([XPSkillCardPlayerManager shareInstance].is9Mic) { + if (_userInfo.position.integerValue == -1) { + self.positionLabel.text = YMLocalizedString(@"XPGiftUserCollectionViewCell0"); + [self.positionLabel mas_updateConstraints:^(MASConstraintMaker *make) { + make.width.mas_equalTo(28); + }]; + } else { + NSInteger count = _userInfo.position.integerValue + 2; + self.positionLabel.text = [NSString stringWithFormat:@"%ld", count]; + [self.positionLabel mas_updateConstraints:^(MASConstraintMaker *make) { + make.width.mas_equalTo(count >= 10 ? 14 : 10); + }]; + } + } else { + NSInteger count = _userInfo.position.integerValue + 2; + self.positionLabel.text = [NSString stringWithFormat:@"%ld", count]; + [self.positionLabel mas_updateConstraints:^(MASConstraintMaker *make) { + make.width.mas_equalTo(count >= 10 ? 14 : 10); + }]; + } } } diff --git a/YuMi/Modules/YMRoom/View/SendGiftView/View/XPSendGiftView.m b/YuMi/Modules/YMRoom/View/SendGiftView/View/XPSendGiftView.m index c07462bc..497a42a3 100644 --- a/YuMi/Modules/YMRoom/View/SendGiftView/View/XPSendGiftView.m +++ b/YuMi/Modules/YMRoom/View/SendGiftView/View/XPSendGiftView.m @@ -286,6 +286,12 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; attachment.data = dic; [self sendCustomMessage:attachment]; } + + if (self.segmentType == GiftSegmentType_Graffiti) { + NSString * title = [NSString stringWithFormat:YMLocalizedString(@"XPSendGiftView3"),self.giftInfoView.lastSelectGift.giftName]; + [self showSuccessToast:title]; + [self dismissViewControllerAnimated:YES completion:nil]; + } } - (void)sendCustomMessage:(GiftReceiveInfoModel *)receiveModel @@ -439,6 +445,8 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; [attachment.data setObject:@([[GiftComboManager sharedManager] loadComboCountFromSendGiftView]) forKey:@"comboCount"]; + attachment.data = [self removeNSNullValuesAndEmptyStringsRecursively:attachment.data]; + object.attachment = attachment; message.messageObject = object; @@ -447,12 +455,52 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; extModel.androidBubbleUrl = userInfo.androidBubbleUrl; extModel.iosBubbleUrl = userInfo.iosBubbleUrl; extModel.fromSayHelloChannel = userInfo.fromSayHelloChannel; + extModel.platformRole = userInfo.platformRole; NSMutableDictionary *remoteExt = [NSMutableDictionary dictionaryWithObject:extModel.model2dictionary forKey:[NSString stringWithFormat:@"%ld", userInfo.uid]]; message.remoteExt = remoteExt; NIMSessionType sessionType = self.usingplaceType == SendGiftType_Room ? NIMSessionTypeChatroom : NIMSessionTypeP2P; //构造会话 NIMSession *session = [NIMSession session:sessionID type:sessionType]; - [[NIMSDK sharedSDK].chatManager sendMessage:message toSession:session error:nil]; + [[NIMSDK sharedSDK].chatManager sendMessage:message toSession:session completion:^(NSError * _Nullable error) { + if (error) { + NSLog(@"%@",error); + } + }]; +} + +- (id)removeNSNullValuesAndEmptyStringsRecursively:(id)object { + if ([object isKindOfClass:[NSDictionary class]]) { + NSMutableDictionary *cleanedDictionary = [NSMutableDictionary dictionary]; + [(NSDictionary *)object enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, id _Nonnull obj, BOOL * _Nonnull stop) { + // 检查是否需要移除当前键 + if ([key isKindOfClass:[NSString class]] && + ([key isEqualToString:@"userPurse"] || [key isEqualToString:@"hasSvga"] || [key isEqualToString:@"currentTime"])) { + return; // 跳过 key 为 "userPurse" 或 "hasSvga" 或 "currentTime" 的键值对 + } + + // 递归清理子对象 + id cleanedValue = [self removeNSNullValuesAndEmptyStringsRecursively:obj]; + if (cleanedValue) { + cleanedDictionary[key] = cleanedValue; + } + }]; + return [cleanedDictionary copy]; + } else if ([object isKindOfClass:[NSArray class]]) { + NSMutableArray *cleanedArray = [NSMutableArray array]; + for (id obj in (NSArray *)object) { + id cleanedValue = [self removeNSNullValuesAndEmptyStringsRecursively:obj]; + if (cleanedValue) { + [cleanedArray addObject:cleanedValue]; + } + } + return [cleanedArray copy]; + } else if ([object isKindOfClass:[NSNull class]] || ([object isKindOfClass:[NSString class]] && [(NSString *)object length] == 0)) { + // 移除 NSNull 和空字符串 + return nil; + } else { + // 保留其他类型 + return object; + } } #pragma mark - Deal Send Gift Data @@ -942,7 +990,6 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; dispatch_after(delayTime, dispatch_get_main_queue(), ^{ @kStrongify(self); if (self) { - if ([GiftComboManager sharedManager].enableCombo) { [[GiftComboManager sharedManager] resetCombo]; [self sendCustomMessage:receiveInfo oringinDic:originDic]; @@ -960,11 +1007,6 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView; ///发送涂鸦礼物消息 [self sendGraffitiGiftMessage]; - if (self.segmentType == GiftSegmentType_Graffiti) { - NSString * title = [NSString stringWithFormat:YMLocalizedString(@"XPSendGiftView3"),self.giftInfoView.lastSelectGift.giftName]; - [self showSuccessToast:title]; - [self dismissViewControllerAnimated:YES completion:nil]; - } } ///送礼物失败 diff --git a/YuMi/Modules/YMRoom/View/Setting/View/Cell/XPRoomRoleTableViewCell.h b/YuMi/Modules/YMRoom/View/Setting/View/Cell/XPRoomRoleTableViewCell.h index 323d5907..836c2d1e 100644 --- a/YuMi/Modules/YMRoom/View/Setting/View/Cell/XPRoomRoleTableViewCell.h +++ b/YuMi/Modules/YMRoom/View/Setting/View/Cell/XPRoomRoleTableViewCell.h @@ -23,6 +23,9 @@ NS_ASSUME_NONNULL_BEGIN @property (strong, nonatomic) NIMChatroomMember *member; ///代理 @property (nonatomic,weak) id delegate; + +- (void)hideRemoveButton; + @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/Setting/View/Cell/XPRoomRoleTableViewCell.m b/YuMi/Modules/YMRoom/View/Setting/View/Cell/XPRoomRoleTableViewCell.m index e392ac09..3d0b01af 100644 --- a/YuMi/Modules/YMRoom/View/Setting/View/Cell/XPRoomRoleTableViewCell.m +++ b/YuMi/Modules/YMRoom/View/Setting/View/Cell/XPRoomRoleTableViewCell.m @@ -81,6 +81,10 @@ }]; } +- (void)hideRemoveButton { + self.removeButton.hidden = YES; +} + #pragma mark - Event Response - (void)removeButtonAction:(UIButton *)sender { if (self.delegate && [self.delegate respondsToSelector:@selector(xPRoomRoleTableViewCell:didClickMember:)]) { diff --git a/YuMi/Modules/YMRoom/View/Setting/View/XPRoomOnLineViewController.m b/YuMi/Modules/YMRoom/View/Setting/View/XPRoomOnLineViewController.m index f858dd45..c52c9e02 100644 --- a/YuMi/Modules/YMRoom/View/Setting/View/XPRoomOnLineViewController.m +++ b/YuMi/Modules/YMRoom/View/Setting/View/XPRoomOnLineViewController.m @@ -127,7 +127,14 @@ //获取房间在线用户成功 -(void)getRoomOnlineUserListSuccess:(NSArray *)list{ - self.datasource = [NSMutableArray arrayWithArray:list]; + NSMutableArray *temp = @[].mutableCopy; + for (XPMessageRemoteExtModel *model in list) { + if (model.platformRole == 0) { + [temp addObject:model]; + } + } + self.datasource = temp; + [self.tableView reloadData]; } @@ -216,11 +223,13 @@ RoomInfoModel * roomInfo = self.hostDelegate.getRoomInfo; NSString * targetUid = userInfo.uid; XPUserCardInfoModel * model = [[XPUserCardInfoModel alloc] init]; + __block MicroQueueModel *micModel = nil; [[self.hostDelegate.getMicroQueue allValues] enumerateObjectsUsingBlock:^(MicroQueueModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { if (targetUid.integerValue == obj.userInfo.uid) { model.position = [NSString stringWithFormat:@"%d", obj.microState.position]; model.posState = obj.microState.posState; model.micState = obj.microState.micState; + micModel = obj; *stop = YES; } }]; @@ -231,7 +240,8 @@ model.superMangerList = self.hostDelegate.getRoomSuperAdminList; model.micQueue = self.hostDelegate.getMicroQueue; model.hideSendGiftItem = YES; - UserRoomCardViewController *vc = [[UserRoomCardViewController alloc] initWithUser:model]; + model.platformRole = micModel.userInfo.platformRole; + UserRoomCardViewController *vc = [[UserRoomCardViewController alloc] initWithUser:model controlUser:self.hostDelegate.getUserInfo]; vc.modalPresentationStyle = UIModalPresentationOverFullScreen; [self.hostDelegate.getCurrentNav presentViewController:vc animated:NO completion:nil]; diff --git a/YuMi/Modules/YMRoom/View/Setting/View/XPRoomRoleViewController.h b/YuMi/Modules/YMRoom/View/Setting/View/XPRoomRoleViewController.h index 447b662f..94d158f4 100644 --- a/YuMi/Modules/YMRoom/View/Setting/View/XPRoomRoleViewController.h +++ b/YuMi/Modules/YMRoom/View/Setting/View/XPRoomRoleViewController.h @@ -22,6 +22,9 @@ typedef NS_ENUM(NSInteger, RoomRoleListType) { @property (nonatomic,assign) RoomRoleListType type; ///超管列表 @property (nonatomic,strong) NSArray *superAdmminList; + +@property(nonatomic, assign) BOOL isAppAdmin; + @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/Setting/View/XPRoomRoleViewController.m b/YuMi/Modules/YMRoom/View/Setting/View/XPRoomRoleViewController.m index 1a732cb0..eb6e2cf8 100644 --- a/YuMi/Modules/YMRoom/View/Setting/View/XPRoomRoleViewController.m +++ b/YuMi/Modules/YMRoom/View/Setting/View/XPRoomRoleViewController.m @@ -51,7 +51,9 @@ request.type = NIMChatroomFetchMemberTypeRegular; request.lastMember = self.lastMember; request.limit = 200; + @kWeakify(self); [[NIMSDK sharedSDK].chatroomManager fetchChatroomMembers:request completion:^(NSError * _Nullable error, NSArray * _Nullable members) { + @kStrongify(self); if (error == nil) { self.lastMember = members.lastObject; [members enumerateObjectsUsingBlock:^(NIMChatroomMember * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { @@ -105,6 +107,11 @@ } else { cell.lineView.hidden = NO; } + + if (self.isAppAdmin) { + [cell hideRemoveButton]; + } + return cell; } diff --git a/YuMi/Modules/YMRoom/View/StageView/AnchorPKStageView.m b/YuMi/Modules/YMRoom/View/StageView/AnchorPKStageView.m index 37accd25..27a9d0e2 100644 --- a/YuMi/Modules/YMRoom/View/StageView/AnchorPKStageView.m +++ b/YuMi/Modules/YMRoom/View/StageView/AnchorPKStageView.m @@ -263,8 +263,9 @@ model.roomInfo = roomInfo; model.micQueue = self.getMicroQueue; model.delegate = self.hostDelegate; - model.superMangerList = self.hostDelegate.getRoomSuperAdminList; - UserRoomCardViewController *vc = [[UserRoomCardViewController alloc] initWithUser:model]; + model.superMangerList = self.hostDelegate.getRoomSuperAdminList; + model.platformRole = micModel.userInfo.platformRole; + UserRoomCardViewController *vc = [[UserRoomCardViewController alloc] initWithUser:model controlUser:self.hostDelegate.getUserInfo]; vc.modalPresentationStyle = UIModalPresentationOverFullScreen; [self.hostDelegate.getCurrentNav presentViewController:vc animated:NO completion:nil]; diff --git a/YuMi/Modules/YMRoom/View/StageView/AnchorStageView.m b/YuMi/Modules/YMRoom/View/StageView/AnchorStageView.m index eefbeb8e..dc8fdbd8 100644 --- a/YuMi/Modules/YMRoom/View/StageView/AnchorStageView.m +++ b/YuMi/Modules/YMRoom/View/StageView/AnchorStageView.m @@ -144,8 +144,8 @@ model.micQueue = self.getMicroQueue; model.delegate = self.hostDelegate; model.superMangerList = self.hostDelegate.getRoomSuperAdminList; - - UserRoomCardViewController *vc = [[UserRoomCardViewController alloc] initWithUser:model]; + model.platformRole = micModel.userInfo.platformRole; + UserRoomCardViewController *vc = [[UserRoomCardViewController alloc] initWithUser:model controlUser:self.hostDelegate.getUserInfo]; vc.modalPresentationStyle = UIModalPresentationOverFullScreen; [self.hostDelegate.getCurrentNav presentViewController:vc animated:NO completion:nil]; diff --git a/YuMi/Modules/YMRoom/View/StageView/StageView.m b/YuMi/Modules/YMRoom/View/StageView/StageView.m index 6322a036..cdb4fea3 100644 --- a/YuMi/Modules/YMRoom/View/StageView/StageView.m +++ b/YuMi/Modules/YMRoom/View/StageView/StageView.m @@ -840,7 +840,8 @@ model.micQueue = self.micQueue; model.delegate = self.hostDelegate; model.superMangerList = self.hostDelegate.getRoomSuperAdminList; - UserRoomCardViewController *vc = [[UserRoomCardViewController alloc] initWithUser:model]; + model.platformRole = micModel.userInfo.platformRole; + UserRoomCardViewController *vc = [[UserRoomCardViewController alloc] initWithUser:model controlUser:self.hostDelegate.getUserInfo]; vc.modalPresentationStyle = UIModalPresentationOverFullScreen; [self.hostDelegate.getCurrentNav presentViewController:vc animated:NO completion:nil]; return; @@ -907,8 +908,8 @@ }; /** - * @param firstDown 先下麦 - * @param nextUp 下麦成功后再上的麦位,为nil的时候代表不需要上麦 + * firstDown 先下麦 + * nextUp 下麦成功后再上的麦位,为nil的时候代表不需要上麦 */ void(^nimDownQueue)(NSString*, NSString*) = ^ (NSString* firstDown, NSString* nextUp){ NIMChatroomQueueRemoveRequest *request = [[NIMChatroomQueueRemoveRequest alloc]init]; @@ -923,77 +924,39 @@ }]; }; + // 2.0 + if (userInfo.platformRole == 1) { + // 超级管理不上mic + // 2.0.1 锁麦/解锁 + TTActionSheetConfig *lockMic = [self lockMicAction:position + room:roomInfo + mic:micModel + isAppAdmin:YES]; + // 2.0.2 闭麦/开麦 + TTActionSheetConfig *muteMic = [self muteMicAction:position room:roomInfo mic:micModel isAppAdmin:YES]; + [TTPopup actionSheetWithItems:@[lockMic, muteMic]]; + return; + } + // 2.1 管理员点击了空麦位 if (member.type == NIMTeamMemberTypeOwner || member.type == NIMTeamMemberTypeManager) { // 2.1.1 上麦 - NSString * upTitle = YMLocalizedString(@"StageView5"); - TTActionSheetConfig *upMic = [TTActionSheetConfig normalTitle:upTitle clickAction:^{ - NSString* selfUid = [NSString stringWithFormat:@"%ld", (long)self.hostDelegate.getUserInfo.uid]; - UIView* microView = [self findMicroViewByUid:selfUid]; - - if (roomInfo.type == RoomType_19Mic && micModel.microState.position == 6 ) { - @kWeakify(self); - [Api requestBossMicUp:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { - if (code == 200) { - if (microView) { - nimDownQueue([self indexToPosition:microView.tag], position); - } else { - nimUpQueue(position, NO); - } - } else { - [XNDJTDDLoadingTool showErrorWithMessage:msg]; - } - } roomUid:@(roomInfo.uid).stringValue uid:uid]; - } else { - if (microView) { - nimDownQueue([self indexToPosition:microView.tag], position); - } else { - nimUpQueue(position, NO); - } - } + TTActionSheetConfig *upMic = [self upMicAction:position room:roomInfo mic:micModel blockUp:^(NSString *up, BOOL isFromDownMic) { + nimUpQueue(position, NO); + } blockDown:^(NSString *firstDown, NSString *nextUp) { + nimDownQueue(firstDown, nextUp); }]; // 2.1.2 锁麦/解锁 - NSString * lockTitle; - if (roomInfo.roomModeType == RoomModeType_Open_Micro_Mode) { - lockTitle = micModel.microState.posState == MicroPosStateType_Free ? YMLocalizedString(@"StageView22") : YMLocalizedString(@"StageView8"); - }else { - lockTitle = micModel.microState.posState == MicroPosStateType_Free ? YMLocalizedString(@"StageView23") : YMLocalizedString(@"StageView10"); - } - TTActionSheetConfig *lockMic = [TTActionSheetConfig normalTitle:lockTitle clickAction:^{ - NSString * roomUid = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.uid]; - NSString * state = micModel.microState.posState == MicroPosStateType_Free ? @"1" : @"0"; - NSString * ticket = [[AccountInfoStorage instance] getTicket]; - NSString * uid = [[AccountInfoStorage instance] getUid]; - [Api microLockCompletion:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { - - } roomUid:roomUid state:state position:position ticket:ticket uid:uid]; - }]; - + TTActionSheetConfig *lockMic = [self lockMicAction:position + room:roomInfo + mic:micModel + isAppAdmin:NO]; // 2.1.3 闭麦/开麦 - NSString * muteTitle = micModel.microState.micState == MicroMicStateType_Open ? YMLocalizedString(@"StageView25") : YMLocalizedString(@"StageView14"); - TTActionSheetConfig *muteMic = [TTActionSheetConfig normalTitle:muteTitle clickAction:^{ - NSString * roomUid = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.uid]; - NSString * state = micModel.microState.micState == MicroMicStateType_Open ? @"1" : @"0"; - NSString * ticket = [[AccountInfoStorage instance] getTicket]; - NSString * uid = [[AccountInfoStorage instance] getUid]; - [Api microMuteCompletion:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { - - } roomUid:roomUid state:state position:position ticket:ticket uid:uid]; - }]; + TTActionSheetConfig *muteMic = [self muteMicAction:position room:roomInfo mic:micModel isAppAdmin:NO]; // 抱Ta上麦 - NSString * inviteTitle = ([position isEqualToString:@"-1"] && roomInfo.roomModeType == RoomModeType_Open_Blind) ? YMLocalizedString(@"StageView27") : YMLocalizedString(@"StageView18"); - TTActionSheetConfig *inviteMic = [TTActionSheetConfig normalTitle:inviteTitle clickAction:^{ - XPRoomInviteUserViewController * inviteUserMicVC = [[XPRoomInviteUserViewController alloc] init]; - inviteUserMicVC.isManagerOrOwner = ([position isEqualToString:@"-1"] && roomInfo.roomModeType == RoomModeType_Open_Blind); - inviteUserMicVC.roomId = roomId; - inviteUserMicVC.roomType = self.hostDelegate.getRoomInfo.type; - inviteUserMicVC.position = position; - inviteUserMicVC.roomUid = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.uid]; - inviteUserMicVC.blindDateVipUid = roomInfo.blindDateVipUid; - [self.hostDelegate.getCurrentNav pushViewController:inviteUserMicVC animated:YES]; - }]; + TTActionSheetConfig *inviteMic = [self inviteMicAction:position room:roomInfo mic:micModel]; [TTPopup actionSheetWithItems:@[upMic, inviteMic, lockMic, muteMic]]; } else { // 2.2 非管理员点击了空麦位 @@ -1024,6 +987,140 @@ }]; } +- (TTActionSheetConfig *)upMicAction:(NSString *)position + room:(RoomInfoModel *)roomInfo + mic:(MicroQueueModel *)micInfo + blockUp:(void(^)(NSString* up, BOOL isFromDownMic))blockUp + blockDown:(void(^)(NSString* firstDown, NSString* nextUp))blockDown { + NSString * upTitle = YMLocalizedString(@"StageView5"); + TTActionSheetConfig *upMic = [TTActionSheetConfig normalTitle:upTitle clickAction:^{ + NSString* selfUid = [NSString stringWithFormat:@"%ld", (long)self.hostDelegate.getUserInfo.uid]; + UIView* microView = [self findMicroViewByUid:selfUid]; + + if (roomInfo.type == RoomType_19Mic && micInfo.microState.position == 6 ) { + @kWeakify(self); + [Api requestBossMicUp:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { + if (code == 200) { + if (microView) { + if (blockDown) { + blockDown([self indexToPosition:microView.tag], position); + } + } else { + if (blockUp) { + blockUp(position, NO); + } + } + } else { + [XNDJTDDLoadingTool showErrorWithMessage:msg]; + } + } roomUid:@(roomInfo.uid).stringValue + uid:[NSString stringWithFormat:@"%ld", self.hostDelegate.getUserInfo.uid]]; + } else { + if (microView) { + if (blockDown) { + blockUp([self indexToPosition:microView.tag], position); + } + } else { + if (blockUp) { + blockUp(position, NO); + } + } + } + }]; + return upMic; +} + +- (TTActionSheetConfig *)lockMicAction:(NSString *)position + room:(RoomInfoModel *)roomInfo + mic:(MicroQueueModel *)micInfo + isAppAdmin:(BOOL)isAppAdmin { + NSString * lockTitle; + if (roomInfo.roomModeType == RoomModeType_Open_Micro_Mode) { + lockTitle = micInfo.microState.posState == MicroPosStateType_Free ? YMLocalizedString(@"StageView22") : YMLocalizedString(@"StageView8"); + }else { + lockTitle = micInfo.microState.posState == MicroPosStateType_Free ? YMLocalizedString(@"StageView23") : YMLocalizedString(@"StageView10"); + } + TTActionSheetConfig *lockMic = [TTActionSheetConfig normalTitle:lockTitle clickAction:^{ + NSString * roomUid = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.uid]; + NSString * state = micInfo.microState.posState == MicroPosStateType_Free ? @"1" : @"0"; + NSString * ticket = [[AccountInfoStorage instance] getTicket]; + NSString * uid = [[AccountInfoStorage instance] getUid]; + [Api microLockCompletion:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { + if (code == 200 && isAppAdmin && state.integerValue == 1) { + NIMMessage * message = [[NIMMessage alloc] init]; + AttachmentModel * attachMent = [[AttachmentModel alloc] init]; + attachMent.first = CustomMessageType_Hall_Super_Admin; + attachMent.second = Custom_Message_Sub_Hall_Super_Admin_Lock_Mic; + attachMent.data = @{@"micNumber":@(micInfo.microState.position).stringValue}; + NIMCustomObject *object = [[NIMCustomObject alloc] init]; + object.attachment = attachMent; + message.messageObject = object; + + //构造会话 + NSString * sessionId = [NSString stringWithFormat:@"%ld", roomInfo.roomId]; + NIMSession *session = [NIMSession session:sessionId type:NIMSessionTypeChatroom]; + [[NIMSDK sharedSDK].chatManager sendMessage:message toSession:session completion:^(NSError * _Nullable error) { + + }]; + } + } roomUid:roomUid state:state position:position ticket:ticket uid:uid]; + }]; + + return lockMic; +} + +- (TTActionSheetConfig *)muteMicAction:(NSString *)position + room:(RoomInfoModel *)roomInfo + mic:(MicroQueueModel *)micInfo + isAppAdmin:(BOOL)isAppAdmin { + NSString * muteTitle = micInfo.microState.micState == MicroMicStateType_Open ? YMLocalizedString(@"StageView25") : YMLocalizedString(@"StageView14"); + TTActionSheetConfig *muteMic = [TTActionSheetConfig normalTitle:muteTitle clickAction:^{ + NSString * roomUid = [NSString stringWithFormat:@"%ld", roomInfo.uid]; + NSString * state = micInfo.microState.micState == MicroMicStateType_Open ? @"1" : @"0"; + NSString * ticket = [[AccountInfoStorage instance] getTicket]; + NSString * uid = [[AccountInfoStorage instance] getUid]; + [Api microMuteCompletion:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { + if (code == 200 && isAppAdmin && state.integerValue == 1) { + NIMMessage * message = [[NIMMessage alloc] init]; + AttachmentModel * attachMent = [[AttachmentModel alloc] init]; + attachMent.first = CustomMessageType_Hall_Super_Admin; + attachMent.second = Custom_Message_Sub_Hall_Super_Admin_Mute_Mic; + attachMent.data = @{@"micNumber":@(micInfo.microState.position).stringValue}; + NIMCustomObject *object = [[NIMCustomObject alloc] init]; + object.attachment = attachMent; + message.messageObject = object; + + //构造会话 + NSString * sessionId = [NSString stringWithFormat:@"%ld", roomInfo.roomId]; + NIMSession *session = [NIMSession session:sessionId type:NIMSessionTypeChatroom]; + [[NIMSDK sharedSDK].chatManager sendMessage:message toSession:session completion:^(NSError * _Nullable error) { + + }]; + } + } roomUid:roomUid state:state position:position ticket:ticket uid:uid]; + }]; + return muteMic; +} + +- (TTActionSheetConfig *)inviteMicAction:(NSString *)position + room:(RoomInfoModel *)roomInfo + mic:(MicroQueueModel *)micInfo { + NSString * inviteTitle = ([position isEqualToString:@"-1"] && roomInfo.roomModeType == RoomModeType_Open_Blind) ? YMLocalizedString(@"StageView27") : YMLocalizedString(@"StageView18"); + NSString * roomId = [NSString stringWithFormat:@"%ld", roomInfo.roomId]; + TTActionSheetConfig *inviteMic = [TTActionSheetConfig normalTitle:inviteTitle clickAction:^{ + XPRoomInviteUserViewController * inviteUserMicVC = [[XPRoomInviteUserViewController alloc] init]; + inviteUserMicVC.isManagerOrOwner = ([position isEqualToString:@"-1"] && roomInfo.roomModeType == RoomModeType_Open_Blind); + inviteUserMicVC.roomId = roomId; + inviteUserMicVC.roomType = self.hostDelegate.getRoomInfo.type; + inviteUserMicVC.position = position; + inviteUserMicVC.roomUid = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.uid]; + inviteUserMicVC.blindDateVipUid = roomInfo.blindDateVipUid; + [self.hostDelegate.getCurrentNav pushViewController:inviteUserMicVC animated:YES]; + }]; + return inviteMic; +} + + - (NSInteger)countOfMicroView { return 0; } diff --git a/YuMi/Modules/YMRoom/View/UserCard/Model/XPUserCardInfoModel.h b/YuMi/Modules/YMRoom/View/UserCard/Model/XPUserCardInfoModel.h index 38bf8916..694fecb9 100644 --- a/YuMi/Modules/YMRoom/View/UserCard/Model/XPUserCardInfoModel.h +++ b/YuMi/Modules/YMRoom/View/UserCard/Model/XPUserCardInfoModel.h @@ -35,6 +35,8 @@ NS_ASSUME_NONNULL_BEGIN ///协议 @property (nonatomic,weak) id delegate; +@property(nonatomic, assign) NSInteger platformRole; // 目标用户是否超管: 0 - 1 + @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/UserCard/Presenter/XPUserCardPresenter.h b/YuMi/Modules/YMRoom/View/UserCard/Presenter/XPUserCardPresenter.h index 1b671233..0f82c853 100644 --- a/YuMi/Modules/YMRoom/View/UserCard/Presenter/XPUserCardPresenter.h +++ b/YuMi/Modules/YMRoom/View/UserCard/Presenter/XPUserCardPresenter.h @@ -16,11 +16,11 @@ NS_ASSUME_NONNULL_BEGIN /// 获取用户卡片中中间操作按钮的数据源 /// @param userInfo 目标用户 -- (void)getFunctionItemsByUserInfo:(XPUserCardInfoModel *)userInfo; +- (void)getFunctionItemsByUserInfo:(XPUserCardInfoModel *)userInfo me:(UserInfoModel *)myInfo; /// 用户卡片底部的操作按钮 /// @param userInfo 目标用户的信息 -- (void)getMicroFunctionItemsByUserInfo:(XPUserCardInfoModel *)userInfo; +- (void)getMicroFunctionItemsByUserInfo:(XPUserCardInfoModel *)userInfo me:(UserInfoModel *)myInfo; ///抱她上麦的 数据 /// @param micCount 当前麦序的个数 @@ -50,7 +50,7 @@ NS_ASSUME_NONNULL_BEGIN /// 超管踢管理员 /// @param targetNick 目标用户的昵称 /// @param cardInfo 用户信息 -- (void)superAdminKickUser:(NSString *)targetNick cardInfo:(XPUserCardInfoModel *)cardInfo; +- (void)superAdminKickUser:(NSString *)targetNick cardInfo:(XPUserCardInfoModel *)cardInfo appAdmin:( UserInfoModel * _Nullable )appAdmin; // 锁麦 开锁 /// @param roomUid 房间的uid /// @param state YES 锁坑位,NO取消锁 diff --git a/YuMi/Modules/YMRoom/View/UserCard/Presenter/XPUserCardPresenter.m b/YuMi/Modules/YMRoom/View/UserCard/Presenter/XPUserCardPresenter.m index b4e96e2f..c51dd271 100644 --- a/YuMi/Modules/YMRoom/View/UserCard/Presenter/XPUserCardPresenter.m +++ b/YuMi/Modules/YMRoom/View/UserCard/Presenter/XPUserCardPresenter.m @@ -73,96 +73,107 @@ /// 获取用户卡片中中间操作按钮的数据源 /// @param userInfo 目标用户 -- (void)getFunctionItemsByUserInfo:(XPUserCardInfoModel *)userInfo{ +- (void)getFunctionItemsByUserInfo:(XPUserCardInfoModel *)userInfo me:(nonnull UserInfoModel *)myInfo{ NSString * uid = [[AccountInfoStorage instance] getUid]; NSString * targetUid = userInfo.uid; NSString * roomId = [NSString stringWithFormat:@"%ld", userInfo.roomInfo.roomId]; if ([uid isEqualToString:targetUid]) { ///查看自己的话 没有中间的数据 [[self getView] onGetFunctionArraySccess:@[]]; return; - } else { - [self.functionArray removeAllObjects]; - if (!userInfo.hideSendGiftItem) { - [self.functionArray addObject:self.giftItem]; + } + + ///自己是公会超管 + BOOL meIsSuperAdmin = NO; + ///用户卡片的那个人事公会超管 + BOOL heIsSuperAdmin = NO; + for (GuildSuperAdminInfoModel *managerInfo in userInfo.superMangerList) { + if ([managerInfo.uid isEqualToString:userInfo.uid]) { + heIsSuperAdmin = YES; } - [self.functionArray addObject:self.chatItem]; + if ([managerInfo.uid isEqualToString:[AccountInfoStorage instance].getUid]) { + meIsSuperAdmin = YES; + } + } + + BOOL meIsAppSuperAdmin = myInfo.platformRole == 1; + + [self.functionArray removeAllObjects]; + if (!userInfo.hideSendGiftItem && !meIsAppSuperAdmin) { + [self.functionArray addObject:self.giftItem]; + } + if (!meIsAppSuperAdmin) { [self.functionArray addObject:self.atItem]; - [self.functionArray addObject:self.attentionItem]; - ///获取一下关注的状态 - [self userAttentionStatus:uid targetUid:targetUid]; - ///自己是公会超管 - BOOL meIsSuperAdmin = NO; - ///用户卡片的那个人事公会超管 - BOOL heIsSuperAdmin = NO; - for (GuildSuperAdminInfoModel *managerInfo in userInfo.superMangerList) { - if ([managerInfo.uid isEqualToString:userInfo.uid]) { - heIsSuperAdmin = YES; - } - if ([managerInfo.uid isEqualToString:[AccountInfoStorage instance].getUid]) { - meIsSuperAdmin = YES; - } + } + [self.functionArray addObject:self.chatItem]; + [self.functionArray addObject:self.attentionItem]; + ///获取一下关注的状态 + [self userAttentionStatus:uid targetUid:targetUid]; + + @kWeakify(self); + if (meIsSuperAdmin || meIsAppSuperAdmin) { + if (heIsSuperAdmin) { + [[self getView] onGetFunctionArraySccess:self.functionArray]; + } else { + ///查看 目标用户是否是管理员 + [[self rac_queryChatRoomMember:targetUid roomId:roomId] subscribeNext:^(id _Nullable x) { + @kStrongify(self); + NIMChatroomMember * targetMember = x; + if (targetMember == nil) {return;} + if (targetMember.type == NIMChatroomMemberTypeCreator) { ///目标是房主的话 + [[self getView] onGetFunctionArraySccess:self.functionArray]; + } else { + if (targetMember && targetMember.type == NIMChatroomMemberTypeManager) { + self.managerItem.isSelect = YES; + } + if (!meIsAppSuperAdmin) { + [self.functionArray addObject:self.managerItem]; + } + [self.functionArray addObject:self.kikoutItem]; + [self.functionArray addObject:self.blackItem]; + [[self getView] onGetFunctionArraySccess:self.functionArray]; + } + }]; } - @weakify(self); - if (meIsSuperAdmin) { - if (heIsSuperAdmin) { - [[self getView] onGetFunctionArraySccess:self.functionArray]; - } else { - ///查看 目标用户是否是管理员 - [[self rac_queryChatRoomMember:targetUid roomId:roomId] subscribeNext:^(id _Nullable x) { - NIMChatroomMember * targetMember = x; - if (targetMember == nil) {return;} - if (targetMember.type == NIMChatroomMemberTypeCreator) { ///目标是房主的话 - [[self getView] onGetFunctionArraySccess:self.functionArray]; - } else { + } else { + [[self rac_queryChatRoomMember:uid roomId:roomId] subscribeNext:^(id _Nullable x) { + @kStrongify(self); + NIMChatroomMember * member = x; + if (member == nil) {return;} + if (member.type == NIMChatroomMemberTypeCreator) {///房主 踢出房间 设置管理员 拉黑 + if (heIsSuperAdmin) { + [[self getView] onGetFunctionArraySccess:self.functionArray]; + } else { + [self.functionArray addObject:self.kikoutItem]; + [self.functionArray addObject:self.managerItem]; + [self.functionArray addObject:self.blackItem]; + ///查看 目标用户是否是管理员 + [[self rac_queryChatRoomMember:targetUid roomId:roomId] subscribeNext:^(id _Nullable x) { + NIMChatroomMember * targetMember = x; if (targetMember && targetMember.type == NIMChatroomMemberTypeManager) { self.managerItem.isSelect = YES; } - [self.functionArray addObject:self.managerItem]; + [[self getView] onGetFunctionArraySccess:self.functionArray]; + }]; + } + } else if(member.type == NIMChatroomMemberTypeManager) {///操作者是 管理员 踢出房间 拉黑 + ///查看 目标用户是否是管理员 + @kWeakify(self); + [[self rac_queryChatRoomMember:targetUid roomId:roomId] subscribeNext:^(id _Nullable x) { + @kStrongify(self); + NIMChatroomMember * targetMember = x; + if (targetMember == nil) {return;} + if (targetMember.type == NIMChatroomMemberTypeManager || targetMember.type == NIMChatroomMemberTypeCreator || heIsSuperAdmin) { ///目标是管理员 + [[self getView] onGetFunctionArraySccess:self.functionArray]; + } else { [self.functionArray addObject:self.kikoutItem]; [self.functionArray addObject:self.blackItem]; [[self getView] onGetFunctionArraySccess:self.functionArray]; } }]; + } else { + [[self getView] onGetFunctionArraySccess:self.functionArray]; } - } else { - [[self rac_queryChatRoomMember:uid roomId:roomId] subscribeNext:^(id _Nullable x) { - @strongify(self); - NIMChatroomMember * member = x; - if (member == nil) {return;} - if (member.type == NIMChatroomMemberTypeCreator) {///房主 踢出房间 设置管理员 拉黑 - if (heIsSuperAdmin) { - [[self getView] onGetFunctionArraySccess:self.functionArray]; - } else { - [self.functionArray addObject:self.kikoutItem]; - [self.functionArray addObject:self.managerItem]; - [self.functionArray addObject:self.blackItem]; - ///查看 目标用户是否是管理员 - [[self rac_queryChatRoomMember:targetUid roomId:roomId] subscribeNext:^(id _Nullable x) { - NIMChatroomMember * targetMember = x; - if (targetMember && targetMember.type == NIMChatroomMemberTypeManager) { - self.managerItem.isSelect = YES; - } - [[self getView] onGetFunctionArraySccess:self.functionArray]; - }]; - } - } else if(member.type == NIMChatroomMemberTypeManager) {///操作者是 管理员 踢出房间 拉黑 - ///查看 目标用户是否是管理员 - [[self rac_queryChatRoomMember:targetUid roomId:roomId] subscribeNext:^(id _Nullable x) { - NIMChatroomMember * targetMember = x; - if (targetMember == nil) {return;} - if (targetMember.type == NIMChatroomMemberTypeManager || targetMember.type == NIMChatroomMemberTypeCreator || heIsSuperAdmin) { ///目标是管理员 - [[self getView] onGetFunctionArraySccess:self.functionArray]; - } else { - [self.functionArray addObject:self.kikoutItem]; - [self.functionArray addObject:self.blackItem]; - [[self getView] onGetFunctionArraySccess:self.functionArray]; - } - }]; - } else { - [[self getView] onGetFunctionArraySccess:self.functionArray]; - } - }]; - } + }]; } } @@ -224,36 +235,14 @@ /// 用户卡片底部的操作按钮 /// @param userInfo 目标用户的信息 -- (void)getMicroFunctionItemsByUserInfo:(XPUserCardInfoModel *)userInfo { +- (void)getMicroFunctionItemsByUserInfo:(XPUserCardInfoModel *)userInfo me:(UserInfoModel *)myInfo{ NSString * uid = [[AccountInfoStorage instance] getUid]; NSString * targetUid = userInfo.uid; RoomInfoModel * roomInfo = userInfo.roomInfo; NSString * roomId = [NSString stringWithFormat:@"%ld", userInfo.roomInfo.roomId]; MicroQueueModel * micQueue = [userInfo.micQueue objectForKey:userInfo.position]; NSMutableArray * array = [NSMutableArray array]; - XPUserCardMicroItemModel * muteItem = [[XPUserCardMicroItemModel alloc] init]; - muteItem.title = userInfo.micState == MicroMicStateType_Open ? YMLocalizedString(@"XPUserCardPresenter5") : YMLocalizedString(@"XPUserCardPresenter6"); - muteItem.iconImage = userInfo.micState == MicroMicStateType_Open ? @"room_user_card_close_mic" : @"room_user_card_open_mic"; - muteItem.status = userInfo.micState == MicroMicStateType_Open; - muteItem.type = UserCardMicroType_Mute; - XPUserCardMicroItemModel * upDownItem = [[XPUserCardMicroItemModel alloc] init]; - upDownItem.title = userInfo.position.length <= 0 ? YMLocalizedString(@"XPUserCardPresenter7") : [uid isEqualToString:targetUid] ? YMLocalizedString(@"XPUserCardPresenter8") : YMLocalizedString(@"XPUserCardPresenter9"); - upDownItem.status = userInfo.position.length > 0 ? YES : NO; - upDownItem.type = UserCardMicroType_UpDown; - upDownItem.uid = userInfo.uid; - upDownItem.iconImage = @"room_user_card_up_mic"; - - XPUserCardMicroItemModel * lockItem = [[XPUserCardMicroItemModel alloc] init]; - lockItem.title = userInfo.posState == MicroPosStateType_Free ? YMLocalizedString(@"XPUserCardPresenter10") : YMLocalizedString(@"XPUserCardPresenter11"); - lockItem.iconImage = userInfo.posState == MicroPosStateType_Free ? @"room_user_card_lock" : @"room_user_card_unlock"; - lockItem.status = userInfo.posState == MicroPosStateType_Free; - lockItem.type = UserCardMicroType_Lock; - - XPUserCardMicroItemModel * giftValueItem = [[XPUserCardMicroItemModel alloc] init]; - giftValueItem.title = YMLocalizedString(@"XPUserCardPresenter12"); - giftValueItem.iconImage = @"room_user_card_clean_gift_value"; - giftValueItem.type = UserCardMicroType_Clean_Gift_Value; ///自己是公会超管 BOOL meIsSuperAdmin = NO; ///用户卡片的那个人事公会超管 @@ -266,6 +255,37 @@ meIsSuperAdmin = YES; } } + + BOOL meIsAppSuperAdmin = myInfo.platformRole == 1; + BOOL heIsAppSuperAdmin = userInfo.platformRole == 1; + + BOOL isOnMic = userInfo.position.length > 0; + + XPUserCardMicroItemModel * muteItem = [[XPUserCardMicroItemModel alloc] init]; + muteItem.title = userInfo.micState == MicroMicStateType_Open ? YMLocalizedString(@"XPUserCardPresenter5") : YMLocalizedString(@"XPUserCardPresenter6"); + muteItem.iconImage = userInfo.micState == MicroMicStateType_Open ? @"room_user_card_close_mic" : @"room_user_card_open_mic"; + muteItem.status = userInfo.micState == MicroMicStateType_Open; + muteItem.type = UserCardMicroType_Mute; + + XPUserCardMicroItemModel * upDownItem = [[XPUserCardMicroItemModel alloc] init]; + + upDownItem.title = isOnMic ? ([uid isEqualToString:targetUid] ? YMLocalizedString(@"XPUserCardPresenter8") : YMLocalizedString(@"XPUserCardPresenter9")) : YMLocalizedString(@"XPUserCardPresenter7"); + upDownItem.status = isOnMic ? YES : NO; + upDownItem.type = UserCardMicroType_UpDown; + upDownItem.uid = userInfo.uid; + upDownItem.iconImage = isOnMic ? @"room_user_card_out_mic" : @"room_user_card_up_mic"; + + XPUserCardMicroItemModel * lockItem = [[XPUserCardMicroItemModel alloc] init]; + lockItem.title = userInfo.posState == MicroPosStateType_Free ? YMLocalizedString(@"XPUserCardPresenter10") : YMLocalizedString(@"XPUserCardPresenter11"); + lockItem.iconImage = userInfo.posState == MicroPosStateType_Free ? @"room_user_card_lock" : @"room_user_card_unlock"; + lockItem.status = userInfo.posState == MicroPosStateType_Free; + lockItem.type = UserCardMicroType_Lock; + + XPUserCardMicroItemModel *giftValueItem = [[XPUserCardMicroItemModel alloc] init]; + giftValueItem.title = YMLocalizedString(@"XPUserCardPresenter12"); + giftValueItem.iconImage = @"room_user_card_clean_gift_value"; + giftValueItem.type = UserCardMicroType_Clean_Gift_Value; + if ([targetUid isEqualToString:uid]) {///自己看自己 @weakify(self); [[self rac_queryChatRoomMember:targetUid roomId:roomId] subscribeNext:^(id _Nullable x) { @@ -280,7 +300,7 @@ } } else if(member.type == NIMTeamMemberTypeManager || meIsSuperAdmin) { [array addObject:muteItem]; - if (userInfo.position.length > 0) { + if (isOnMic) { [array addObject:upDownItem]; } [array addObject:lockItem]; @@ -288,7 +308,7 @@ [array removeAllObjects]; } } else { - if (userInfo.position.length > 0) { + if (isOnMic) { [array addObject:upDownItem]; } if (userInfo.roomInfo.type == RoomType_Anchor && userInfo.roomInfo.roomModeType == RoomModeType_Open_AcrossRoomPK_mode) {//个播PK中不显示上麦 @@ -299,13 +319,15 @@ if (member.type == NIMChatroomMemberTypeCreator || member.type == NIMChatroomMemberTypeManager || meIsSuperAdmin) { if (userInfo.roomInfo.leaveMode && userInfo.uid.integerValue == userInfo.roomInfo.uid && [userInfo.position isEqualToString:@"-1"]) { [array addObject:muteItem]; - [array addObject:upDownItem]; + if (!heIsAppSuperAdmin) { + [array addObject:upDownItem]; + } [array addObject:lockItem]; if (roomInfo.showGiftValue) { [array addObject:giftValueItem]; } } else { - if (userInfo.position.length > 0) { + if (isOnMic) { [array addObject:muteItem]; [array addObject:upDownItem]; if (![userInfo.position isEqualToString:@"999"]) { @@ -315,11 +337,11 @@ [array addObject:giftValueItem]; } } else { - [array addObject:upDownItem]; +// [array addObject:upDownItem]; } } } else { - if (userInfo.position.length > 0) { + if (isOnMic) { [array addObject:upDownItem]; } } @@ -327,13 +349,63 @@ [[self getView] onGetMicroFunctionArraySuccess:array]; }]; } else {///不是自己看自己 + if (meIsAppSuperAdmin) { /// APP 超管 + [[self rac_queryChatRoomMember:targetUid roomId:roomId] subscribeNext:^(id _Nullable x) { + NIMChatroomMember * targetMember = x; + if (targetMember == nil) {return;} + if (userInfo.roomInfo.type == RoomType_Anchor) { + if (isOnMic) { + if (targetMember.type != NIMChatroomMemberTypeManager && targetMember.type != NIMChatroomMemberTypeCreator) { + [array addObject:muteItem]; + } + if (targetMember.type != NIMChatroomMemberTypeCreator) { + [array addObject:upDownItem]; + } + [array addObject:lockItem]; + }else{ + if (targetMember.type != NIMChatroomMemberTypeCreator) { + [array addObject:upDownItem]; + } + } + + if (userInfo.uid.integerValue == userInfo.roomInfo.uid && [userInfo.position isEqualToString:@"-1"]) { + [array addObject:giftValueItem]; + } + } else { + if (targetMember.type == NIMChatroomMemberTypeCreator) { + if (isOnMic){ + [array addObject:upDownItem]; + [array addObject:muteItem]; + [array addObject:lockItem]; + } else { + [array addObject:upDownItem]; + } + } else if (heIsAppSuperAdmin) { + [array addObject:self.kikoutItem]; + [array addObject:self.blackItem]; + } else {///目标者是普通用户 + if (isOnMic) { + if (targetMember.type != NIMChatroomMemberTypeManager) { + [array addObject:muteItem]; + } + if (!micQueue.userInfo.vipMic) { + [array addObject:upDownItem]; + [array addObject:lockItem]; + } + } + } + } + [[self getView] onGetMicroFunctionArraySuccess:array]; + }]; + return; + } @weakify(self); [[self rac_queryChatRoomMember:uid roomId:roomId] subscribeNext:^(id _Nullable x) { @strongify(self); NIMChatroomMember * member = x; if (member == nil) {return;} if (member.type == NIMChatroomMemberTypeCreator) { - if (userInfo.position.length > 0) { + if (isOnMic) { if (micQueue.userInfo.vipMic) { [array addObject:muteItem]; if (roomInfo.showGiftValue) { @@ -361,7 +433,7 @@ NIMChatroomMember * targetMember = x; if (targetMember == nil) {return;} if (userInfo.roomInfo.type == RoomType_Anchor) {//个播模式 - if (userInfo.position.length > 0) { + if (isOnMic) { if (targetMember.type != NIMChatroomMemberTypeManager && targetMember.type != NIMChatroomMemberTypeCreator) { [array addObject:muteItem]; } @@ -378,21 +450,21 @@ if (userInfo.uid.integerValue == userInfo.roomInfo.uid && [userInfo.position isEqualToString:@"-1"]) { [array addObject:giftValueItem]; } - } else { if (targetMember.type == NIMChatroomMemberTypeCreator) { - if (userInfo.position.length > 0) { + if (isOnMic) { if (!micQueue.userInfo.vipMic) { [array addObject:lockItem]; } } else { [array addObject:upDownItem]; } + if (roomInfo.showGiftValue) { [array addObject:giftValueItem]; } } else {///目标者是普通用户 - if (userInfo.position.length > 0) { + if (isOnMic) { if (targetMember.type != NIMChatroomMemberTypeManager) { [array addObject:muteItem]; } @@ -408,12 +480,13 @@ } } } - if (userInfo.roomInfo.type == RoomType_Anchor && userInfo.roomInfo.roomModeType == RoomModeType_Open_AcrossRoomPK_mode) { + if (userInfo.roomInfo.type == RoomType_Anchor && + userInfo.roomInfo.roomModeType == RoomModeType_Open_AcrossRoomPK_mode) { [array removeAllObjects]; } [[self getView] onGetMicroFunctionArraySuccess:array]; }]; - }else { + } else { [[self getView] onGetMicroFunctionArraySuccess:@[]]; } }]; @@ -457,7 +530,9 @@ request.roomId = roomId; request.userId = targetUid; request.enable = enable; + @kWeakify(self); [[NIMSDK sharedSDK].chatroomManager markMemberManager:request completion:^(NSError * _Nullable error) { + @kStrongify(self); if (error == nil) { self.managerItem.isSelect = enable; } @@ -475,7 +550,9 @@ request.roomId = roomId; request.userId = targetUid; request.notifyExt = [@{@"reason":@"kick",@"account":targetUid,@"handleUid":uid} toJSONString]; + @kWeakify(self); [[NIMSDK sharedSDK].chatroomManager kickMember:request completion:^(NSError * _Nullable error) { + @kStrongify(self); [[self getView] makeKickUserFinish:error]; }]; } @@ -483,10 +560,50 @@ /// 超管踢管理员 /// @param targetNick 目标用户的昵称 /// @param cardInfo 用户信息 -- (void)superAdminKickUser:(NSString *)targetNick cardInfo:(XPUserCardInfoModel *)cardInfo { +- (void)superAdminKickUser:(NSString *)targetNick cardInfo:(XPUserCardInfoModel *)cardInfo appAdmin:(UserInfoModel *)appAdmin { NSString * targetUid = cardInfo.uid; NSString * roomId = [NSString stringWithFormat:@"%ld", cardInfo.roomInfo.roomId]; + if (appAdmin) { + for (GuildSuperAdminInfoModel *manager in cardInfo.superMangerList) { + if ([manager.uid isEqualToString:@(appAdmin.uid).stringValue]) { + [self superAdminKickUser:targetNick cardInfo:cardInfo appAdmin:nil]; + return; + } + } + + @kWeakify(self); + [Api superAdminHandleUser:[self createHttpCompletion:^(BaseModel * _Nonnull data) { + @kStrongify(self); + [self superAdminKickUser:targetNick cardInfo:cardInfo appAdmin:nil]; + } fail:^(NSInteger code, NSString * _Nullable msg) { + @kStrongify(self); + [[self getView] makeKickUserFinish:[NSError errorWithDomain:msg code:code userInfo:nil]]; + }] roomUid:@(cardInfo.roomInfo.uid).stringValue targetUid:@(appAdmin.uid).stringValue opt:@"1" isSet:@(YES)]; + +// [self superAdminHandleUser:@"" opt:@"1" roomUid:@(cardInfo.roomInfo.uid).stringValue isSet:YES]; + + +// NSString * uid = [[AccountInfoStorage instance] getUid]; +// NIMChatroomMemberUpdateRequest *request = [[NIMChatroomMemberUpdateRequest alloc]init]; +// request.roomId = roomId; +// request.userId = @(appAdmin.uid).stringValue; +// request.enable = YES; +// @kWeakify(self); +// [[NIMSDK sharedSDK].chatroomManager markMemberManager:request completion:^(NSError * _Nullable error) { +// @kStrongify(self); +// if (error == nil) { +//// self.managerItem.isSelect = enable; +// [self superAdminKickUser:targetNick cardInfo:cardInfo appAdmin:nil]; +// } else { +// [[self getView] makeKickUserFinish:error]; +// } +// }]; + return; + } + + @kWeakify(self); [[self rac_queryChatRoomMember:targetUid roomId:roomId] subscribeNext:^(id _Nullable x) { + @kStrongify(self); NIMChatroomMember * member = x; if (member == nil) {return;} if (member.type == NIMChatroomMemberTypeManager) { @@ -601,8 +718,10 @@ /// @param opt 1: 设置为管理员;2:设置普通等级用户;-1:设为黑名单用户;-2:设为禁言用户 /// @param roomUid 房主的uid - (void)superAdminHandleUser:(NSString *)targetUid opt:(NSString *)opt roomUid:(NSString *)roomUid isSet:(BOOL)isSet{ + @kWeakify(self); [Api superAdminHandleUser:[self createHttpCompletion:^(BaseModel * _Nonnull data) { - [[self getView] superAdminHandleUserSuccess:opt]; + @kStrongify(self); + [[self getView] superAdminHandleUserSuccess:opt isSet:isSet]; }] roomUid:roomUid targetUid:targetUid opt:opt isSet:@(isSet)]; } diff --git a/YuMi/Modules/YMRoom/View/UserCard/Protocol/XPUserCardProtocol.h b/YuMi/Modules/YMRoom/View/UserCard/Protocol/XPUserCardProtocol.h index 13ed20d5..4669a26e 100644 --- a/YuMi/Modules/YMRoom/View/UserCard/Protocol/XPUserCardProtocol.h +++ b/YuMi/Modules/YMRoom/View/UserCard/Protocol/XPUserCardProtocol.h @@ -42,7 +42,7 @@ NS_ASSUME_NONNULL_BEGIN ///选择心动成功 - (void)roomDatingPickHeartUserSuccess; ///超管处理用户操作成功 -- (void)superAdminHandleUserSuccess:(NSString *)opt; +- (void)superAdminHandleUserSuccess:(NSString *)opt isSet:(BOOL)isset; @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/UserCard/View/UserRoomCardViewController.h b/YuMi/Modules/YMRoom/View/UserCard/View/UserRoomCardViewController.h index bab5a67b..86a7b91f 100644 --- a/YuMi/Modules/YMRoom/View/UserCard/View/UserRoomCardViewController.h +++ b/YuMi/Modules/YMRoom/View/UserCard/View/UserRoomCardViewController.h @@ -12,7 +12,10 @@ NS_ASSUME_NONNULL_BEGIN @interface UserRoomCardViewController : MvpViewController -- (instancetype)initWithUser:(XPUserCardInfoModel *)cardInfo; +@property(nonatomic, copy) NSArray *roomSuperAdminList; + +- (instancetype)initWithUser:(XPUserCardInfoModel *)cardInfo controlUser:(UserInfoModel *)meInfo; + @end diff --git a/YuMi/Modules/YMRoom/View/UserCard/View/UserRoomCardViewController.m b/YuMi/Modules/YMRoom/View/UserCard/View/UserRoomCardViewController.m index 5354f9be..82b46ede 100644 --- a/YuMi/Modules/YMRoom/View/UserCard/View/UserRoomCardViewController.m +++ b/YuMi/Modules/YMRoom/View/UserCard/View/UserRoomCardViewController.m @@ -29,9 +29,6 @@ #import "SuperBlockViewController.h" #import "XPSkillCardPlayerManager.h" -// TODO: 移除房主位 | 19 mic Boss 位判断 | 全麦位 svga 压力测试 - - @interface Custom19MicLayout : UICollectionViewLayout @property (nonatomic, strong) NSMutableArray *attributesArray; @@ -1060,6 +1057,8 @@ @property(nonatomic, strong) UIActivityIndicatorView *loading; +@property(nonatomic, strong) UserInfoModel *controlUserInfo; + @end @implementation UserRoomCardViewController @@ -1068,10 +1067,11 @@ return [[XPUserCardPresenter alloc] init]; } -- (instancetype)initWithUser:(XPUserCardInfoModel *)cardInfo { +- (instancetype)initWithUser:(XPUserCardInfoModel *)cardInfo controlUser:(nonnull UserInfoModel *)meInfo { if (self = [super init]) { self.modalPresentationStyle = UIModalPresentationOverFullScreen; self.cardInfo = cardInfo; + self.controlUserInfo = meInfo; } return self; } @@ -1106,7 +1106,8 @@ [self.view insertSubview:self.vipBGImageView atIndex:0]; [self.vipBGImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.leading.trailing.mas_equalTo(self.collectionView); + make.top.mas_equalTo(self.collectionView).offset(0); + make.leading.trailing.mas_equalTo(self.collectionView).offset(0); make.height.mas_equalTo(self.collectionView.mas_height); }]; @@ -1132,7 +1133,7 @@ } - (void)loadFunctionsItem { - [self.presenter getFunctionItemsByUserInfo:self.cardInfo]; + [self.presenter getFunctionItemsByUserInfo:self.cardInfo me:self.controlUserInfo]; } - (BOOL)configRoomDatingPickHeart { @@ -1165,13 +1166,7 @@ [self dismissViewControllerAnimated:YES completion:nil]; } -- (void)handleTapItem:(XPUserCardItemModel *)item { - -#if DEBUG - [TTPopup popupView:[self managerLimitToast] style:TTPopupStyleAlert]; - return; -#endif - +- (void)handleTapItem:(XPUserCardItemModel *)item { NSString * roomId = [NSString stringWithFormat:@"%ld", self.cardInfo.roomInfo.roomId]; NSString * roomUid = [NSString stringWithFormat:@"%ld", self.cardInfo.roomInfo.uid]; @@ -1400,9 +1395,10 @@ if (self.userInfoModel.userVipInfoVO.preventKick && self.userInfoModel.uid != [AccountInfoStorage instance].getUid.integerValue) { NSString *message = [NSString stringWithFormat:YMLocalizedString(@"UserCard_1.0.17_0"), @(self.userInfoModel.userVipInfoVO.vipLevel)]; - [TTPopup alertWithMessage:message confirmHandler:^{ - } cancelHandler:^{ - }]; + TTAlertConfig *config = [[TTAlertConfig alloc] init]; + config.message = message; + config.actionStyle = TTAlertActionConfirmStyle; + [TTPopup alertWithConfig:config confirmHandler:^{} cancelHandler:^{}]; } else { NSString * roomId = [NSString stringWithFormat:@"%ld", self.cardInfo.roomInfo.roomId]; if ([self isInSudGame:self.cardInfo.uid]) { @@ -1414,7 +1410,7 @@ [TTPopup alertWithConfig:config confirmHandler:^{ @kStrongify(self); if ([self isSuperUser]) { - [self.presenter superAdminKickUser:self.userInfoModel.nick cardInfo:self.cardInfo]; + [self.presenter superAdminKickUser:self.userInfoModel.nick cardInfo:self.cardInfo appAdmin:self.controlUserInfo]; } else { [self.presenter makeKickUser:self.cardInfo.uid roomId:roomId]; } @@ -1429,7 +1425,7 @@ [TTPopup alertWithConfig:config confirmHandler:^{ @kStrongify(self); if ([self isSuperUser]) { - [self.presenter superAdminKickUser:self.userInfoModel.nick cardInfo:self.cardInfo]; + [self.presenter superAdminKickUser:self.userInfoModel.nick cardInfo:self.cardInfo appAdmin:self.controlUserInfo]; } else { [self.presenter makeKickUser:self.cardInfo.uid roomId:roomId]; } @@ -1568,6 +1564,9 @@ meIsSuperAdmin = YES; } } + if (!meIsSuperAdmin) { + meIsSuperAdmin = self.controlUserInfo.platformRole == 1; + } return meIsSuperAdmin; } @@ -1651,7 +1650,6 @@ #pragma mark - - (void)onGetUserInfoSuccess:(UserInfoModel *)userInfo { self.userInfoModel = userInfo; - self.avatar.userInfo = userInfo; @kWeakify(self); [self.avatar setHandleTapAvatar:^{ @@ -1688,6 +1686,9 @@ if (videoUrl.length) { [self.topMP4View setMute:YES]; [self.topMP4View playHWDMP4:videoUrl repeatCount:-1 delegate:nil]; + [self.vipBGImageView mas_updateConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.collectionView).offset(20); + }]; } } failureBlock:^(NSError * _Nullable error) { }]; @@ -1708,7 +1709,6 @@ NSMutableArray *temp_1 = @[].mutableCopy; if (self.upMicFlag) { - CGRect r_1 = CGRectMake(0, KScreenHeight, KScreenWidth, KScreenHeight - kGetScaleWidth(376)); CGRect r_2 = CGRectMake(0, kGetScaleWidth(376), KScreenWidth, KScreenHeight - kGetScaleWidth(376)); UserRoomMicPositionView *view = [[UserRoomMicPositionView alloc] initWithFrame:r_1]; @@ -1739,7 +1739,7 @@ [temp_1 insertObject:cardModel atIndex:0]; } self.datasource = temp_1.copy; - [self.presenter getMicroFunctionItemsByUserInfo:self.cardInfo]; + [self.presenter getMicroFunctionItemsByUserInfo:self.cardInfo me:self.controlUserInfo]; } else { NSMutableArray *temp_2 = @[].mutableCopy; for (XPUserCardItemModel *model in array) { @@ -1754,7 +1754,7 @@ } self.datasource = temp_1.copy; self.micActions = temp_2.copy; - [self.presenter getMicroFunctionItemsByUserInfo:self.cardInfo]; + [self.presenter getMicroFunctionItemsByUserInfo:self.cardInfo me:self.controlUserInfo]; } [self.collectionView reloadData]; } @@ -1804,6 +1804,12 @@ - (void)markUserManagerFinish:(XPUserCardItemModel *)item error:(NSError *)error { if (error == nil) { + if (item.isSelect) { + [XNDJTDDLoadingTool showSuccessWithMessage:[NSString stringWithFormat:YMLocalizedString(@"1.0.34_text_6"), self.userInfoModel.nick]]; + } else { + [XNDJTDDLoadingTool showSuccessWithMessage:[NSString stringWithFormat:YMLocalizedString(@"1.0.34_text_7"), self.userInfoModel.nick]]; + } + [self.micActions enumerateObjectsUsingBlock:^(XPUserCardItemModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { if (item.type == obj.type) { obj.isSelect = item.isSelect; @@ -1817,9 +1823,36 @@ - (void)makeKickUserFinish:(NSError *)error { if (error == nil && self.userInfoModel) { [self dismissViewControllerAnimated:YES completion:nil]; - [self sendCustomMessageKickOrBlackUser:CustomMessageType_Kick_User second:Custom_Message_Sub_Kick_BeKicked]; + if (self.controlUserInfo.platformRole == 1) { + // 超管操作 + NIMMessage * message = [[NIMMessage alloc] init]; + AttachmentModel * attachMent = [[AttachmentModel alloc] init]; + attachMent.first = CustomMessageType_Hall_Super_Admin; + attachMent.second = Custom_Message_Sub_Hall_Super_Admin_Kick_Out_Room; + attachMent.data = @{ + @"micNumber": self.cardInfo.position, + @"handleUid": @(self.controlUserInfo.uid).stringValue, + @"handleNick": self.controlUserInfo.nick, + @"targetUid": @(self.userInfoModel.uid).stringValue, + @"targetNick": self.userInfoModel.nick, + }; + NIMCustomObject *object = [[NIMCustomObject alloc] init]; + object.attachment = attachMent; + message.messageObject = object; + + //构造会话 + NSString * sessionId = [NSString stringWithFormat:@"%ld", self.cardInfo.roomInfo.roomId]; + NIMSession *session = [NIMSession session:sessionId type:NIMSessionTypeChatroom]; + [[NIMSDK sharedSDK].chatManager sendMessage:message toSession:session completion:^(NSError * _Nullable error) { + + }]; + } else { + [self sendCustomMessageKickOrBlackUser:CustomMessageType_Kick_User second:Custom_Message_Sub_Kick_BeKicked]; + } } else if (error.code == 404) { [self showErrorToast:YMLocalizedString(@"XPUserCardViewController1")]; + } else { + [self showErrorToast:error.domain]; } } @@ -1836,9 +1869,34 @@ } - (void)kickDownMicroSuccess { - if (self.cardInfo.uid.integerValue != [AccountInfoStorage instance].getUid.integerValue) { + if (self.controlUserInfo.platformRole == 1) { + // 超管操作 + NIMMessage * message = [[NIMMessage alloc] init]; + AttachmentModel * attachMent = [[AttachmentModel alloc] init]; + attachMent.first = CustomMessageType_Hall_Super_Admin; + attachMent.second = Custom_Message_Sub_Hall_Super_Admin_Kick_Down_Mic; + attachMent.data = @{ + @"micNumber": self.cardInfo.position, + @"handleUid": @(self.controlUserInfo.uid).stringValue, + @"handleNick": self.controlUserInfo.nick, + @"targetUid": @(self.userInfoModel.uid).stringValue, + @"targetNick": self.userInfoModel.nick, + }; + NIMCustomObject *object = [[NIMCustomObject alloc] init]; + object.attachment = attachMent; + message.messageObject = object; + + //构造会话 + NSString * sessionId = [NSString stringWithFormat:@"%ld", self.cardInfo.roomInfo.roomId]; + NIMSession *session = [NIMSession session:sessionId type:NIMSessionTypeChatroom]; + [[NIMSDK sharedSDK].chatManager sendMessage:message toSession:session completion:^(NSError * _Nullable error) { + + }]; + } + else if (self.cardInfo.uid.integerValue != [AccountInfoStorage instance].getUid.integerValue) { [self sendCustomMessageKickOrBlackUser:CustomMessageType_Queue second:Custom_Message_Sub_Queue_Kick]; } + [self dismissViewControllerAnimated:YES completion:nil]; } @@ -1879,16 +1937,26 @@ } }]; } - [self sendCustomMessageKickOrBlackUser:CustomMessageType_Kick_User second:Custom_Message_Sub_Kick_BlackList]; + if (self.controlUserInfo.platformRole == 1) { + [self sendCustomMessageKickOrBlackUser:CustomMessageType_Hall_Super_Admin second:Custom_Message_Sub_Hall_Super_Admin_Mark_Black]; + } else { + [self sendCustomMessageKickOrBlackUser:CustomMessageType_Kick_User second:Custom_Message_Sub_Kick_BlackList]; + } } else if (error.code == 417) { [self showErrorToast:YMLocalizedString(@"XPUserCardViewController2")]; } } -- (void)superAdminHandleUserSuccess:(NSString *)opt { - [self showSuccessToast:YMLocalizedString(@"XPUserCardViewController4")]; +- (void)superAdminHandleUserSuccess:(NSString *)opt isSet:(BOOL)isset{ [self dismissViewControllerAnimated:YES completion:nil]; - if ([opt isEqualToString:@"-1"]) {///拉黑 + + if ([opt isEqualToString:@"1"]) { + if (isset) { + [XNDJTDDLoadingTool showSuccessWithMessage:[NSString stringWithFormat:YMLocalizedString(@"1.0.34_text_6"), self.userInfoModel.nick]]; + } else { + [XNDJTDDLoadingTool showSuccessWithMessage:[NSString stringWithFormat:YMLocalizedString(@"1.0.34_text_7"), self.userInfoModel.nick]]; + } + }else if ([opt isEqualToString:@"-1"]) {///拉黑 if (self.cardInfo.position.length > 0) { NIMChatroomQueueRemoveRequest *request = [[NIMChatroomQueueRemoveRequest alloc]init]; request.key = self.cardInfo.position; @@ -1898,32 +1966,63 @@ } }]; } - [self sendCustomMessageKickOrBlackUser:CustomMessageType_Kick_User second:Custom_Message_Sub_Kick_BlackList]; + + if (self.controlUserInfo.platformRole == 1) { + [self sendCustomMessageKickOrBlackUser:CustomMessageType_Hall_Super_Admin second:Custom_Message_Sub_Hall_Super_Admin_Mark_Black]; + } else { + [self sendCustomMessageKickOrBlackUser:CustomMessageType_Kick_User second:Custom_Message_Sub_Kick_BlackList]; + } + [XNDJTDDLoadingTool showSuccessWithMessage:[NSString stringWithFormat:YMLocalizedString(@"1.0.34_text_7"), self.userInfoModel.nick]]; } } ///拉黑/踢出房间 发送自定义消息 - (void)sendCustomMessageKickOrBlackUser:(int)first second:(int)second { - RoomInfoModel * roomInfo = self.cardInfo.roomInfo; - XPKickUserModel *notifyModel = [[XPKickUserModel alloc] init]; - notifyModel.handleNick = self.cardInfo.nick; - notifyModel.handleUid = [AccountInfoStorage instance].getUid.integerValue; - notifyModel.targetUid = self.cardInfo.uid.integerValue; - notifyModel.targetNick = self.userInfoModel.nick; - notifyModel.uid = self.cardInfo.uid.integerValue; - AttachmentModel *attachment = [[AttachmentModel alloc] init]; - attachment.first = first; - attachment.second = second; - attachment.data = [notifyModel model2dictionary]; - NSString * sessionId = [NSString stringWithFormat:@"%ld", roomInfo.roomId]; + if (self.controlUserInfo.platformRole == 1 && first == CustomMessageType_Hall_Super_Admin) { + // 超管操作 + NIMMessage * message = [[NIMMessage alloc] init]; + AttachmentModel * attachMent = [[AttachmentModel alloc] init]; + attachMent.first = CustomMessageType_Hall_Super_Admin; + attachMent.second = second; + attachMent.data = @{ + @"micNumber": self.cardInfo.position, + @"handleUid": @(self.controlUserInfo.uid).stringValue, + @"handleNick": self.controlUserInfo.nick, + @"targetUid": @(self.userInfoModel.uid).stringValue, + @"targetNick": self.userInfoModel.nick, + }; + NIMCustomObject *object = [[NIMCustomObject alloc] init]; + object.attachment = attachMent; + message.messageObject = object; + + //构造会话 + NSString * sessionId = [NSString stringWithFormat:@"%ld", self.cardInfo.roomInfo.roomId]; + NIMSession *session = [NIMSession session:sessionId type:NIMSessionTypeChatroom]; + [[NIMSDK sharedSDK].chatManager sendMessage:message toSession:session completion:^(NSError * _Nullable error) { + + }]; + } else { + RoomInfoModel * roomInfo = self.cardInfo.roomInfo; + XPKickUserModel *notifyModel = [[XPKickUserModel alloc] init]; + notifyModel.handleNick = self.cardInfo.nick; + notifyModel.handleUid = [AccountInfoStorage instance].getUid.integerValue; + notifyModel.targetUid = self.cardInfo.uid.integerValue; + notifyModel.targetNick = self.userInfoModel.nick; + notifyModel.uid = self.cardInfo.uid.integerValue; + AttachmentModel *attachment = [[AttachmentModel alloc] init]; + attachment.first = first; + attachment.second = second; + attachment.data = [notifyModel model2dictionary]; + NSString * sessionId = [NSString stringWithFormat:@"%ld", roomInfo.roomId]; - NIMMessage *message = [[NIMMessage alloc]init]; - NIMCustomObject *object = [[NIMCustomObject alloc] init]; - object.attachment = attachment; - message.messageObject = object; - //构造会话 - NIMSession *session = [NIMSession session:sessionId type:NIMSessionTypeChatroom]; - [[NIMSDK sharedSDK].chatManager sendMessage:message toSession:session error:nil]; + NIMMessage *message = [[NIMMessage alloc]init]; + NIMCustomObject *object = [[NIMCustomObject alloc] init]; + object.attachment = attachment; + message.messageObject = object; + //构造会话 + NIMSession *session = [NIMSession session:sessionId type:NIMSessionTypeChatroom]; + [[NIMSDK sharedSDK].chatManager sendMessage:message toSession:session error:nil]; + } } //加入黑名单 diff --git a/YuMi/Modules/YMRoom/View/UserCard/View/XPUserCardViewController.m b/YuMi/Modules/YMRoom/View/UserCard/View/XPUserCardViewController.m index dfed3fcd..4c9986a6 100644 --- a/YuMi/Modules/YMRoom/View/UserCard/View/XPUserCardViewController.m +++ b/YuMi/Modules/YMRoom/View/UserCard/View/XPUserCardViewController.m @@ -557,7 +557,7 @@ [self initSubViewConstraints]; [self initEvent]; - [self.presenter getFunctionItemsByUserInfo:self.cardInfo]; +// [self.presenter getFunctionItemsByUserInfo:self.cardInfo]; self.avatarImageView.imageUrl = userInfo.avatar; // self.nobleImageView.imageUrl = userInfo.userInfoCardPic; @@ -719,12 +719,12 @@ } - (void)onGetFunctionArraySccess:(NSArray *)array { - if (array.count <= 0) { - [self.presenter getMicroFunctionItemsByUserInfo:self.cardInfo]; - return; - } - self.datasource = array; - [self.presenter getMicroFunctionItemsByUserInfo:self.cardInfo]; +// if (array.count <= 0) { +// [self.presenter getMicroFunctionItemsByUserInfo:self.cardInfo me:self.control]; +// return; +// } +// self.datasource = array; +// [self.presenter getMicroFunctionItemsByUserInfo:self.cardInfo]; } -(void)onGetFollowDataSccess{ @@ -1009,33 +1009,11 @@ if (self.targetUserInfo.userVipInfoVO.preventKick && self.targetUserInfo.uid != [AccountInfoStorage instance].getUid.integerValue) { //2、判断是否为管理员操作 -// if (self.cardInfo.roomInfo.uid != [AccountInfoStorage instance].getUid.integerValue) { -// [self showErrorToast:[NSString stringWithFormat:YMLocalizedString(@"XPUserCardViewController5"), self.targetUserInfo.userVipInfoVO.vipName]]; -// } else {//房主操作 NSString *message = [NSString stringWithFormat:YMLocalizedString(@"UserCard_1.0.17_0"), @(self.targetUserInfo.userVipInfoVO.vipLevel)]; [TTPopup alertWithMessage:message confirmHandler:^{ } cancelHandler:^{ }]; -// TTAlertConfig *config = [[TTAlertConfig alloc] init]; -// config.title = @""; -// config.message = message; -// [TTPopup alertWithConfig:config confirmHandler:^{ -// if ([self isInSudGame:self.cardInfo.uid]) { -// NSString *message = YMLocalizedString(@"XPUserCardViewController7"); -// TTAlertConfig *config = [[TTAlertConfig alloc] init]; -// config.title = @""; -// config.message = message; -// [TTPopup alertWithConfig:config confirmHandler:^{ -// [self.presenter makeKickUser:self.cardInfo.uid roomId:roomId]; -// } cancelHandler:^{ -// }]; -// } else { -// [self.presenter makeKickUser:self.cardInfo.uid roomId:roomId]; -// } -// } cancelHandler:^{ -// }]; -// } return; } if ([self isInSudGame:self.cardInfo.uid]) { @@ -1045,7 +1023,7 @@ config.message = message; [TTPopup alertWithConfig:config confirmHandler:^{ if (meIsSuperAdmin) { - [self.presenter superAdminKickUser:self.targetUserInfo.nick cardInfo:self.cardInfo]; +// [self.presenter superAdminKickUser:self.targetUserInfo.nick cardInfo:self.cardInfo isAppAdmin:NO]; } else { [self.presenter makeKickUser:self.cardInfo.uid roomId:roomId]; } @@ -1058,7 +1036,7 @@ config.message = message; [TTPopup alertWithConfig:config confirmHandler:^{ if (meIsSuperAdmin) { - [self.presenter superAdminKickUser:self.targetUserInfo.nick cardInfo:self.cardInfo]; +// [self.presenter superAdminKickUser:self.targetUserInfo.nick cardInfo:self.cardInfo isAppAdmin:NO]; } else { [self.presenter makeKickUser:self.cardInfo.uid roomId:roomId]; } @@ -1529,7 +1507,7 @@ if (!_officialImageView) { _officialImageView = [[UIImageView alloc] init]; _officialImageView.userInteractionEnabled = YES; - _officialImageView.image = [UIImage imageNamed:@"common_offical"]; + _officialImageView.image = [UIImage imageNamed:@"app_admin_icon"]; _officialImageView.hidden = YES; } return _officialImageView; diff --git a/YuMi/Modules/YMRoom/View/XPRoomViewController.m b/YuMi/Modules/YMRoom/View/XPRoomViewController.m index dcfa1d27..4ef61312 100644 --- a/YuMi/Modules/YMRoom/View/XPRoomViewController.m +++ b/YuMi/Modules/YMRoom/View/XPRoomViewController.m @@ -79,7 +79,6 @@ #import "LittleGameStageView.h" #import "LittleGameScrollStageView.h" #import "XPRoomLittleGameContainerView.h" -#import "XPUserCardViewController.h" #import "PIRoomEnterRedPacketView.h" #import "XPIAPRechargeViewController.h" #import "XPCandyTreeInsufficientBalanceView.h" @@ -96,6 +95,9 @@ #import "RoomSideMenu.h" #import "RoomResourceManager.h" + +//#import "XPMineHallAnchorIncomeStatisViewController.h" + UIKIT_EXTERN NSString * const kRoomGiftEffectUpdateNotificationKey; UIKIT_EXTERN NSString * const kRoomMiniNotificationKey; UIKIT_EXTERN NSString * kNewUserRechargeKey; @@ -120,12 +122,9 @@ CountDownHelperDelegate, PIRoomEnterRedPacketViewDelegate, XPReceiveRedPacketViewDelegate, XPCandyTreeInsufficientBalanceViewDelegate> -{ - NSTimer * timer; -} + ///背景 @property (nonatomic,strong) XPRoomBackContainerView *backContainerView; - ///个播上下切换view @property (nonatomic, strong) AnchorRoomScrollView *anchorScrollView; ///房间信息 @@ -291,10 +290,6 @@ XPCandyTreeInsufficientBalanceViewDelegate> - (void)dealloc { NSLog(@"房间销毁了"); - if(timer != nil){ - [timer fire]; - timer = nil; - } [[RoomBoomManager sharedManager] leaveRoom]; @@ -353,7 +348,6 @@ XPCandyTreeInsufficientBalanceViewDelegate> [self.presenter getRoomSuperAdmin:self.roomUid]; [XPSkillCardPlayerManager shareInstance].isInRoom = YES; - [self startCheckOnlineCountTimer]; [CountDownHelper shareHelper].delegate = self; @@ -367,9 +361,10 @@ XPCandyTreeInsufficientBalanceViewDelegate> // [b addTarget:self action:@selector(test) forControlEvents:UIControlEventTouchUpInside]; //#endif } -- (void)test { - -} +//- (void)test { +// XPMineHallAnchorIncomeStatisViewController *vc = [[XPMineHallAnchorIncomeStatisViewController alloc] init]; +// [self.navigationController pushViewController:vc animated:YES]; +//} - (void)handleGiftComboCallBack { @kWeakify(self); @@ -465,14 +460,6 @@ XPCandyTreeInsufficientBalanceViewDelegate> } } -- (void)startCheckOnlineCountTimer { - @kWeakify(self); - timer = [XPWeakTimer scheduledTimerWithTimeInterval:30 block:^(id userInfo) { - @kStrongify(self); - [self getOnlineCount]; - } userInfo:nil repeats:YES]; -} - #pragma mark - MSSessionReleaseHeadlinesViewDelegate -(void)releaseHeadlinesWithText:(NSString *)text{ XPCandyTreeInsufficientBalanceView *balanceView = [[XPCandyTreeInsufficientBalanceView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)]; @@ -801,6 +788,9 @@ XPCandyTreeInsufficientBalanceViewDelegate> if (self.userInfo.userVipInfoVO.enterHide) {///VIP隐身进房,不发座驾消息 return; } + if (self.userInfo.platformRole == 1) { + return; + } if (self.userInfo.viewUrl.length > 0) { [att safeSetObject:self.userInfo.nick forKey:@"nick"]; [att safeSetObject:self.userInfo.viewUrl forKey:@"viewUrl"]; @@ -1204,6 +1194,11 @@ XPCandyTreeInsufficientBalanceViewDelegate> *stop = YES; } }]; + + if (!isSuperAdmin) { + isSuperAdmin = self.userInfo.platformRole == 1; + } + if (!isSuperAdmin) { XPRoomSettingInputView * titleView = [[XPRoomSettingInputView alloc] init]; titleView.maxCount = 15; @@ -1250,6 +1245,9 @@ XPCandyTreeInsufficientBalanceViewDelegate> *stop = YES; } }]; + if (!isSuperAdmin) { + isSuperAdmin = self.userInfo.platformRole == 1; + } if (!isSuperAdmin) { XPRoomSettingInputView * titleView = [[XPRoomSettingInputView alloc] init]; titleView.maxCount = 15; @@ -1394,7 +1392,7 @@ XPCandyTreeInsufficientBalanceViewDelegate> [self.functionView onRoomMiniEntered]; [self.functionView onRoomEntered]; -// [self.menuContainerView onRoomMiniEntered]; + [self.menuContainerView onRoomMiniEntered]; // PK 状态下,从最小化进房需要模仿初始化房间,丢 2 次 roominfo 进去 functionView if (self.roomInfo.roomModeType == RoomModeType_Open_AcrossRoomPK_mode || self.roomInfo.roomModeType == RoomModeType_Open_PK_Mode) { @@ -1453,6 +1451,7 @@ XPCandyTreeInsufficientBalanceViewDelegate> self.userInfo = userInfo; [self requestBoomData]; + [self getOnlineCount]; @kWeakify(self); dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_global_queue(0, 0), ^{ @@ -1495,7 +1494,8 @@ XPCandyTreeInsufficientBalanceViewDelegate> [XNDJTDDLoadingTool hideHUDInView:self.navigationController.view]; self.roomInfo = roomInfo; - + [XPSkillCardPlayerManager shareInstance].is9Mic = roomInfo.type == RoomType_Game; + if (roomInfo.type == RoomType_Anchor) { [self handleInitAnchorRoom]; [self showAnchorScrollTipView]; @@ -1518,8 +1518,7 @@ XPCandyTreeInsufficientBalanceViewDelegate> - (void)enterRoomSuccess:(NIMChatroom *)chatRoom { [XNDJTDDLoadingTool hideHUDInView:self.navigationController.view]; - // room/get中的房间在线人数 是定时更新的 不是及时刷新 - [self getOnlineCount]; + [self.stageView onRoomEntered]; [self.functionView onRoomEntered]; @@ -1549,10 +1548,24 @@ XPCandyTreeInsufficientBalanceViewDelegate> [Api requestRoomOnlineUserList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { @kStrongify(self); if(code == 200){ + NSMutableArray *temp = @[].mutableCopy; NSArray *list = [XPMessageRemoteExtModel modelsWithArray:data.data]; - self.roomInfo.onlineNum = list.count; - [self.functionView updateOnlineCount:[NSString stringWithFormat:@"%ld",list.count] countList:list isUpdateCount:NO]; + for (XPMessageRemoteExtModel *model in list) { + if (model.platformRole != 1) { + [temp addObject:model]; + } + } + self.roomInfo.onlineNum = temp.count; + [self.functionView updateOnlineCount:[NSString stringWithFormat:@"%ld",temp.count] countList:temp.copy isUpdateCount:NO]; } + // 更安全的輪詢 + @kWeakify(self); + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(60 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + @kStrongify(self); + if (self) { + [self getOnlineCount]; + } + }); } roomUid:self.roomUid]; } ///请求房间超管成功 @@ -1648,7 +1661,9 @@ XPCandyTreeInsufficientBalanceViewDelegate> ///个播房初始化一些操作 - (void)handleInitAnchorRoom { if (self.roomInfo.valid) { // 房间有效,直接进入房间 - if (self.roomInfo.roomPwd.length > 0 && self.roomInfo.uid != [AccountInfoStorage instance].getUid.integerValue && [XPRoomMiniManager shareManager].getRoomInfo.uid != self.roomUid.integerValue) {//进房密码的情况 + if (self.roomInfo.roomPwd.length > 0 && + self.roomInfo.uid != [AccountInfoStorage instance].getUid.integerValue && + [XPRoomMiniManager shareManager].getRoomInfo.uid != self.roomUid.integerValue) {//进房密码的情况 if (!self.isRequestSuperAdmin) { @kWeakify(self); [Api getRoomSuperAdminList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { @@ -1897,16 +1912,16 @@ XPCandyTreeInsufficientBalanceViewDelegate> newRoomInfo.hadChangeRoomType = self.roomInfo.type != newRoomInfo.type; BOOL anchorToOther = newRoomInfo.type != RoomType_Anchor && self.roomInfo.type == RoomType_Anchor;//个播变其他房 self.roomInfo = newRoomInfo; - + [self.backContainerView onRoomUpdate]; - + self.quickMessageContainerView.titleArray = self.roomInfo.speakTemplate; if (self.roomInfo.type == RoomType_Anchor && self.roomInfo.hadChangeRoomType) {///从其他房变为个播房 [self handleInitAnchorRoom]; [self showAnchorScrollTipView]; } else if (anchorToOther) { [self __removeAllViews]; - + [self.view addSubview:self.backContainerView]; [self.view addSubview:self.stageView]; [self.view addSubview:self.messageContainerView]; @@ -1917,7 +1932,7 @@ XPCandyTreeInsufficientBalanceViewDelegate> [self.view bringSubviewToFront:self.menuContainerView]; [self.view addSubview:self.functionView]; [self.view bringSubviewToFront:self.animationView]; - + [self initSubViewConstraints]; [self changeStageViewOnRoomUpdate]; [self.stageView onRoomUpdate]; @@ -1994,6 +2009,21 @@ XPCandyTreeInsufficientBalanceViewDelegate> } } break; + case NIMChatroomEventTypeAddManager: { + NIMChatroomNotificationMember *targets = [content.targets firstObject]; + if (targets.userId.integerValue == self.userInfo.uid) { + [XNDJTDDLoadingTool showSuccessWithMessage:YMLocalizedString(@"1.0.34_text_15")]; + } + + } + break; + case NIMChatroomEventTypeRemoveManager: { + NIMChatroomNotificationMember *targets = [content.targets firstObject]; + if (targets.userId.integerValue == self.userInfo.uid) { + [XNDJTDDLoadingTool showSuccessWithMessage:YMLocalizedString(@"1.0.34_text_16")]; + } + } + break; default: break; } @@ -2257,7 +2287,10 @@ XPCandyTreeInsufficientBalanceViewDelegate> return; } - if (error) return; + if (error) { + NSLog(@"%@", error); + return; + }; if (message.messageType == NIMMessageTypeCustom) { NIMCustomObject *obj = (NIMCustomObject *)message.messageObject; if (obj.attachment != nil && [obj.attachment isKindOfClass:[AttachmentModel class]]) { diff --git a/YuMi/Modules/YMTabbar/View/PIFullScreenBannerAnimation.h b/YuMi/Modules/YMTabbar/View/PIFullScreenBannerAnimation.h deleted file mode 100644 index ad017475..00000000 --- a/YuMi/Modules/YMTabbar/View/PIFullScreenBannerAnimation.h +++ /dev/null @@ -1,25 +0,0 @@ -// -// PIFullScreenBannerAnimation.h -// YuMi -// -// Created by duoban on 2023/7/12. -// - -#import -#import "PIBaseAnimationViewModel.h" -NS_ASSUME_NONNULL_BEGIN - -@interface PIFullScreenBannerAnimation : NSObject -- (void)receiveGift:(GiftReceiveInfoModel *)receiveInfo; -- (void)receiveCandyTreeGiftHighLevel:(AttachmentModel *)attatchment; -- (void)receiveLuckyGiftBigPrize:(AttachmentModel *)attachment; --(void)receiveRoomGraffitiStarKitchen:(AttachmentModel *)attacment; -- (void)receiveTreasureFairyGiftHighLevel:(AttachmentModel *)attatchment ; --(void)receiveTarotBanner:(AttachmentModel *)attachment; --(void)receiveCommonH5Banner:(AttachmentModel *)attachment; -- (void)receiveAnchorHourRank:(AttachmentModel *)attachment; -- (void)receiveNobleLevelUp:(AttachmentModel *)attachment; --(void)receiveRoomGeneralFloatingScreen:(AttachmentModel *)attacment; -@end - -NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMTabbar/View/PIFullScreenBannerAnimation.m b/YuMi/Modules/YMTabbar/View/PIFullScreenBannerAnimation.m deleted file mode 100644 index 5a18c686..00000000 --- a/YuMi/Modules/YMTabbar/View/PIFullScreenBannerAnimation.m +++ /dev/null @@ -1,894 +0,0 @@ -// -// PIFullScreenBannerAnimation.m -// YuMi -// -// Created by duoban on 2023/7/12. -// -#import "XPRoomAnimationView.h" -///Third -#import -#import -#import -#import -#import "QGVAPConfigModel.h" -#import "UIView+VAP.h" - -#import -///Tool -#import "XPGiftStorage.h" -#import "YUMIMacroUitls.h" -#import "ThemeColor+Room.h" -#import "NetImageView.h" -#import "XPRoomGiftAnimationParser.h" -#import "XCCurrentVCStackManager.h" -#import "AccountInfoStorage.h" -#import "ClientConfig.h" -///Model -#import "MicroQueueModel.h" -#import "MicroStateModel.h" -#import "UserInfoModel.h" -#import "GiftReceiveInfoModel.h" -#import "GiftInfoModel.h" -#import "RoomInfoModel.h" -#import "AttachmentModel.h" -#import "XPGiftBigPrizeModel.h" -#import "XPGiftBannerUserInfoModel.h" -#import "GiftReceiveInfoModel.h" -#import "XPMessageRemoteExtModel.h" -#import "DatingInfoModel.h" -#import "AcrossRoomPKPrizeModel.h" -#import "RoomHalfHourRankModel.h" -#import "ClientConfig.h" -///View - -#import "XPRoomGiftBroadcastView.h" -#import "XPRoomCandyGiftView.h" -#import "XPRoomDatingAnimationView.h" -#import "XPRoomNobleLevelUpView.h" -#import "QGVAPWrapView.h" -#import "XPAcrossRoomPKPrizeView.h" -#import "XPRoomViewController.h" -#import "XPRoomAnchorRankBannerView.h" -#import "XPRoomEnterHideTipView.h" -#import "XPRoomLuckyBigPrizeView.h" -#import "XPRoomGiftCompoundView.h" -#import "XPSailingAnimationView.h" -#import "XPRoomGraffitiGiftAnimationView.h" -#import "XPRoomStarKitchenBannerView.h" -#import "XPWebViewController.h" -#import "PIBaseAnimationViewModel.h" -#import "PIFullScreenBannerAnimation.h" -#import "XPSkillCardPlayerManager.h" -#import "XPTreasureFairyGiftView.h" -#import "XPRoomTarrowBannerView.h" -#import "PIRoomGiftBroadcastWindow.h" -#import "PIUniversalBannerModel.h" -#import "PIUniversalBannerView.h" -@interface PIFullScreenBannerAnimation() -///礼物飘屏 PresentAchieveAbstractMatrix -@property(nonatomic,strong) NSMutableArray *animationListA; -///玩法飘屏 YUMIPresentBigCaptureMatrix -@property(nonatomic,strong) NSMutableArray *animationListB; -///礼物飘屏正在播放中 -@property(nonatomic,assign) BOOL isPlayOfA; -///玩法飘屏正在播放中 -@property(nonatomic,assign) BOOL isPlayOfB; -///animationListA播放完后,如果有animationListB,那么要在animationListA的位置上播放animationListB,只播放一次 -//@property(nonatomic,assign) BOOL isAnimationListAFinish; -@property(nonatomic,assign) CGFloat broadCastHieght; - -@property (nonatomic, strong) NetImageView *imageLoader; - -@end -@implementation PIFullScreenBannerAnimation - - -- (void)createGiftBroadcastViewAnimation:(GiftReceiveInfoModel *)giftModel { - self.isPlayOfA = YES; - XPRoomGiftBroadcastView * view = [[XPRoomGiftBroadcastView alloc] init]; - view.delegate = self; - view.frame = CGRectMake(KScreenWidth, 35 + statusbarHeight, KScreenWidth, kGetScaleWidth(69)); - view.broadcastModel = giftModel; - [kWindow addSubview:view]; - [self beginGiftBraodcastViewAnimation:view notifyStaySecond:giftModel.notifyStaySecond]; -} - -- (void)beginGiftBraodcastViewAnimation:(XPRoomGiftBroadcastView *)view notifyStaySecond:(int)notifyStaySecond{ - CGFloat startTime = notifyStaySecond > 0 ? notifyStaySecond : 3.0; - POPSpringAnimation *springAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPViewCenter]; - springAnimation.springSpeed = 12; - springAnimation.springBounciness = 10.f; - springAnimation.fromValue = [NSValue valueWithCGPoint:view.center]; - springAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(0 + view.frame.size.width / 2, view.center.y)]; - [springAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) { - if (finished) { - [self removeGiftBroadcastOutAnimation:view stayTime:startTime]; - } - }]; - [view pop_addAnimation:springAnimation forKey:@"spingOutAnimation"]; -} - -- (void)removeGiftBroadcastOutAnimation:(XPRoomGiftBroadcastView *)view stayTime:(CGFloat)stayTime{ - POPBasicAnimation *moveAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewCenter]; - moveAnimation.fromValue = [NSValue valueWithCGPoint:view.center]; - moveAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(-KScreenWidth/2, view.center.y)]; - moveAnimation.beginTime = CACurrentMediaTime() + stayTime; - moveAnimation.duration = 0.5; - moveAnimation.repeatCount = 1; - moveAnimation.removedOnCompletion = YES; - @kWeakify(self); - [moveAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) { - @kStrongify(self); - if (finished) { - [view removeFromSuperview]; - self.isPlayOfA = NO; - if (self.animationListA.count > 0) { - [self.animationListA removeObjectAtIndex:0]; - } - if(self.animationListB.count > 0){ -// self.isAnimationListAFinish = YES; - [self playAnimationWithModel]; - return; - } - if (self.animationListA.count > 0 && self.isPlayOfB == NO && self.isPlayOfA == NO) { - [self createGiftBroadcastViewAnimation:self.animationListA.firstObject]; - } - } - }]; - - [view pop_addAnimation:moveAnimation forKey:@"moveOutAnimation"]; -} - - -///点击了进入房间 -- (void)xPRoomGiftBroadcastView:(XPRoomGiftBroadcastView *)view enterRoom:(NSString *)roomUid roomName:(NSString *)roomName{ - id isShowBroadcastView = [[NSUserDefaults standardUserDefaults]valueForKey:@"kSaveBrooadcastSelectState"]; - if(isShowBroadcastView == nil){ - PIRoomGiftBroadcastWindow *broadcastView = [[PIRoomGiftBroadcastWindow alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)]; - broadcastView.roodUid = roomUid; - broadcastView.roomName = roomName; - broadcastView.delegate = self; - [kWindow addSubview:broadcastView]; - return; - } - if (roomUid.length > 0) { - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.7 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - [XPRoomViewController openRoom:roomUid viewController:[XCCurrentVCStackManager shareManager].getCurrentVC]; - }); - } -} -#pragma mark -PIRoomGiftBroadcastWindowDelegate --(void)confirmLeaveForTheRoom:(NSString *_Nonnull)roomUid{ - if (roomUid.length > 0) { - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.7 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - [XPRoomViewController openRoom:roomUid viewController:[XCCurrentVCStackManager shareManager].getCurrentVC]; - }); - } -} -///收到了礼物 -- (void)receiveGift:(GiftReceiveInfoModel *)receiveInfo { - ///CPU警告的时候 需要停止接收动画 - GiftReceiveInfoModel *giftNotifyInfo = receiveInfo; - if (self.animationListA.count == 0 && self.isPlayOfB == NO && self.isPlayOfA == NO) { - [self createGiftBroadcastViewAnimation:giftNotifyInfo]; - } - [self.animationListA addObject:giftNotifyInfo]; - -} - --(void)playAnimationACompletion{ - PIBaseAnimationViewModel *model = self.animationListB.firstObject; - if(model.type == GiftBannerType_Lucky){ - [self createBigPrizeAnimation:model]; - }else if (model.type == GiftBannerType_Love){ - [self createCandyTreeBannerAnimation:model]; - }else if(model.type == GiftBannerType_Nobleman){ - [self createNobleLevelUpBannerAnimation:model]; - }else if(model.type == GiftBannerType_kitchen){ - [self createStarKitchenBannerAnimation:model]; - }else if(model.type == GiftBannerType_AnchorHour){ - [self createAnchorHourRankAnimation:model]; - }else if(model.type == GiftBannerType_LicneseHour){ - [self createAnchorHourRankAnimation:model]; - }else if(model.type == GiftBannerType_Fairy){ - [self createTreasureFairyBannerAnimation:model]; - }else if(model.type == GiftBannerType_Tarrow){ - [self createBigPrizeAnimation:model]; - }else if(model.type == GiftBannerType_Common_H5){ - [self createCommonH5BannerAnimation:model]; - } -} - --(void)playAnimationWithModel{ -// if(self.isAnimationListAFinish == YES)return; - if(self.animationListB.count <= 0){ - if(self.animationListA.count > 0 && self.isPlayOfB == NO && self.isPlayOfA == NO){ - [self createGiftBroadcastViewAnimation:self.animationListA.firstObject]; - } - return; - } - if(self.isPlayOfB == YES)return; - PIBaseAnimationViewModel *model = self.animationListB.firstObject; - if(model.type == GiftBannerType_Lucky){ - [self createBigPrizeAnimation:model]; - }else if (model.type == GiftBannerType_Love){ - [self createCandyTreeBannerAnimation:model]; - }else if(model.type == GiftBannerType_Nobleman){ - [self createNobleLevelUpBannerAnimation:model]; - }else if(model.type == GiftBannerType_kitchen){ - [self createStarKitchenBannerAnimation:model]; - }else if(model.type == GiftBannerType_AnchorHour){ - [self createAnchorHourRankAnimation:model]; - }else if(model.type == GiftBannerType_LicneseHour){ - [self createAnchorHourRankAnimation:model]; - }else if(model.type == GiftBannerType_Fairy){ - [self createTreasureFairyBannerAnimation:model]; - }else if(model.type == GiftBannerType_Tarrow){ - [self createBigPrizeAnimation:model]; - }else if(model.type == GiftBannerType_Common_H5){ - [self createCommonH5BannerAnimation:model]; - }else if (model.type == GiftBannerType_General_Floating_Screen){ - [self createGeneralFloatingScreenAnimation:model]; - } -} -#pragma mark - 通用飘屏 --(void)receiveRoomGeneralFloatingScreen:(AttachmentModel *)attacment{ - PIBaseAnimationViewModel *roomGraffiti = [PIBaseAnimationViewModel new]; - roomGraffiti.data = attacment.data; - roomGraffiti.type = GiftBannerType_General_Floating_Screen; - roomGraffiti.first = attacment.first; - roomGraffiti.second = attacment.second; - if(self.animationListB.count == 0 && self.isPlayOfB == NO){ - [self createGeneralFloatingScreenAnimation:roomGraffiti]; - } - [self.animationListB addObject:roomGraffiti]; -} -- (void)createGeneralFloatingScreenAnimation:(PIBaseAnimationViewModel *)attacment{ - self.isPlayOfB = YES; - CGFloat top = self.isPlayOfA == YES ? (self.broadCastHieght + statusbarHeight) : (kNavigationHeight + 15); - - PIUniversalBannerModel *model = [PIUniversalBannerModel modelWithDictionary:attacment.data]; - BOOL isSvga = [model.resourceType isEqualToString:@"SVGA"]; - __block PIUniversalBannerView *bannerView; - @kWeakify(self); - if (isSvga == YES) { - SVGAParser *parser = [SVGAParser new]; - [parser parseWithURL:[NSURL URLWithString:[model.resourceContent stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]]] completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) { - @kStrongify(self); - model.videoItem = videoItem; - CGFloat height = kGetScaleWidth(60); - if(videoItem.videoSize.width > 0){ - height = KScreenWidth * videoItem.videoSize.height / videoItem.videoSize.width; - } - bannerView = [[PIUniversalBannerView alloc]initWithFrame:CGRectMake(KScreenWidth, top, KScreenWidth, height)]; - [self showGeneralFloatingScreenView:bannerView model:model]; - } failureBlock:^(NSError * _Nonnull error) { - @kStrongify(self); - [bannerView removeFromSuperview]; - self.isPlayOfB = NO; - if(self.animationListB.count > 0){ - [self.animationListB removeObjectAtIndex:0]; - } - [self playAnimationWithModel]; - }]; - }else{ - if (!_imageLoader) { - _imageLoader = [[NetImageView alloc] init]; - } - [self.imageLoader loadImageWithUrl:model.resourceContent completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) { - @kStrongify(self); - model.image = image; - CGFloat width = image.size.width <= 0 ? kGetScaleWidth(60) : image.size.width; - CGFloat height = image.size.height ; - CGFloat getHeigth = KScreenWidth * height / width; - bannerView = [[PIUniversalBannerView alloc]initWithFrame:CGRectMake(KScreenWidth, top, KScreenWidth, getHeigth) ]; - [self showGeneralFloatingScreenView:bannerView model:model]; - } fail:^(NSError * _Nonnull error) { - @kStrongify(self); - self.isPlayOfB = NO; - if(self.animationListB.count > 0){ - [self.animationListB removeObjectAtIndex:0]; - } - [self playAnimationWithModel]; - }]; - } -} --(void)showGeneralFloatingScreenView:(PIUniversalBannerView *)bannerView model:(PIUniversalBannerModel *)model{ - BOOL isSvga = [model.resourceType isEqualToString:@"SVGA"]; - bannerView.isSvga = isSvga; - bannerView.model = model; - bannerView.delegate = self; - [kWindow addSubview:bannerView]; - POPSpringAnimation *springAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPViewCenter]; - springAnimation.springSpeed = 12; - springAnimation.springBounciness = 10.f; - springAnimation.fromValue = [NSValue valueWithCGPoint:bannerView.center]; - springAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(bannerView.frame.size.width / 2, bannerView.center.y)]; - @kWeakify(self); - [springAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) { - @kStrongify(self); - if (finished) { - POPBasicAnimation *moveAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewCenter]; - moveAnimation.fromValue = [NSValue valueWithCGPoint:CGPointMake(0, bannerView.center.y)]; - moveAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(-KScreenWidth/2, bannerView.center.y)]; - moveAnimation.beginTime = CACurrentMediaTime() + 3; - moveAnimation.duration = 0.5; - moveAnimation.repeatCount = 1; - moveAnimation.removedOnCompletion = YES; - @kWeakify(self); - [moveAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) { - @kStrongify(self); - if (finished) { - [bannerView removeFromSuperview]; - self.isPlayOfB = NO; - if(self.animationListB.count > 0){ - [self.animationListB removeObjectAtIndex:0]; - } - [self playAnimationWithModel]; - } - }]; - [bannerView pop_addAnimation:moveAnimation forKey:@"moveOutAnimation"]; - } - }]; - [bannerView pop_addAnimation:springAnimation forKey:@"starKitchenOutAnimation"]; -} -#pragma mark - PIUniversalBannerViewDelegate -- (void)pIUniversalBannerView:(PIUniversalBannerView *)view didClick:(PIUniversalBannerModel *)model{ - if (model.skipType == 2){ - [XPRoomViewController openRoom:model.skipContent viewController:[XCCurrentVCStackManager shareManager].getCurrentVC]; - }else if (model.skipType == 3){ - XPWebViewController * webVC = [[XPWebViewController alloc] initWithRoomUID:nil]; - webVC.isPush = YES; - webVC.url = model.skipContent; - [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:webVC animated:YES]; - } else if (model.skipType == 7) { - // 跳转到指定游戏 - } -} -#pragma mark - 收到h5通用飘屏 --(void)receiveCommonH5Banner:(AttachmentModel *)attachment{ - - PIBaseAnimationViewModel *giftNotifyInfo = [PIBaseAnimationViewModel modelWithJSON:attachment.data]; - giftNotifyInfo.type = GiftBannerType_Common_H5; - giftNotifyInfo.second = attachment.second; - if (self.animationListB.count == 0 && self.isPlayOfB == NO) { - [self createCommonH5BannerAnimation:giftNotifyInfo]; - } - [self.animationListB addObject:giftNotifyInfo]; -} -- (void)createCommonH5BannerAnimation:(PIBaseAnimationViewModel *)attatchment { - - CGFloat kscale = (CGFloat)55 / (CGFloat)375; - self.isPlayOfB = YES; - CGFloat top = self.isPlayOfA == YES ? (self.broadCastHieght + statusbarHeight) : (kNavigationHeight + 15); - - - XPRoomTarrowBannerView *tarrowVeiw = [[XPRoomTarrowBannerView alloc]initWithFrame:CGRectMake(KScreenWidth, top, KScreenWidth , KScreenWidth * kscale)isH5:YES]; - tarrowVeiw.isBig = attatchment.second == Custom_Message_Sub_Common_H5_Advanced; - tarrowVeiw.giftH5Info = attatchment; - [kWindow addSubview:tarrowVeiw]; - - - POPSpringAnimation *springAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPViewCenter]; - springAnimation.springSpeed = 12; - springAnimation.springBounciness = 10.f; - springAnimation.fromValue = [NSValue valueWithCGPoint:tarrowVeiw.center]; - springAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(tarrowVeiw.frame.size.width / 2, tarrowVeiw.center.y)]; - [springAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) { - if (finished) { - POPBasicAnimation *moveAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewCenter]; - moveAnimation.fromValue = [NSValue valueWithCGPoint:CGPointMake(0, tarrowVeiw.center.y)]; - moveAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(-KScreenWidth/2,tarrowVeiw.center.y)]; - moveAnimation.beginTime = CACurrentMediaTime() + 3; - moveAnimation.duration = 0.5; - moveAnimation.repeatCount = 1; - moveAnimation.removedOnCompletion = YES; - @kWeakify(self); - [moveAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) { - @kStrongify(self); - if (finished) { - [tarrowVeiw removeFromSuperview]; - self.isPlayOfB = NO; - if (self.animationListB.count > 0) { - [self.animationListB removeObjectAtIndex:0]; - } -// if(self. isAnimationListAFinish == YES){ -// -// [self playAnimationWithModel]; -// self.isAnimationListAFinish = NO; -// return; -// } - [self playAnimationWithModel]; - } - }]; - [tarrowVeiw pop_addAnimation:moveAnimation forKey:@"moveOutAnimation"]; - } - }]; - [tarrowVeiw pop_addAnimation:springAnimation forKey:@"candyTreespingOutAnimation"]; - - -} -#pragma mark - 收到塔罗飘屏 --(void)receiveTarotBanner:(AttachmentModel *)attachment{ - PIBaseAnimationViewModel *giftNotifyInfo = [PIBaseAnimationViewModel modelWithJSON:attachment.data]; - giftNotifyInfo.type = GiftBannerType_Tarrow; - giftNotifyInfo.second = attachment.second; - if (self.animationListB.count == 0 && self.isPlayOfB == NO) { - [self createTarotBannerAnimation:giftNotifyInfo]; - } - [self.animationListB addObject:giftNotifyInfo]; -} -- (void)createTarotBannerAnimation:(PIBaseAnimationViewModel *)attatchment { - - CGFloat kscale = (CGFloat)55 / (CGFloat)375; - self.isPlayOfB = YES; - CGFloat top = self.isPlayOfA == YES ? (self.broadCastHieght + statusbarHeight) : (kNavigationHeight + 15); - XPRoomTarrowBannerView *tarrowVeiw = [[XPRoomTarrowBannerView alloc]initWithFrame:CGRectMake(KScreenWidth, top, KScreenWidth , KScreenWidth * kscale) isH5:NO]; - tarrowVeiw.isBig = attatchment.second == Custom_Message_Sub_Tarot_Advanced; - tarrowVeiw.giftInfo = attatchment; - [kWindow addSubview:tarrowVeiw]; - - POPSpringAnimation *springAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPViewCenter]; - springAnimation.springSpeed = 12; - springAnimation.springBounciness = 10.f; - springAnimation.fromValue = [NSValue valueWithCGPoint:tarrowVeiw.center]; - springAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(tarrowVeiw.frame.size.width / 2, tarrowVeiw.center.y)]; - [springAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) { - if (finished) { - POPBasicAnimation *moveAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewCenter]; - moveAnimation.fromValue = [NSValue valueWithCGPoint:CGPointMake(0, tarrowVeiw.center.y)]; - moveAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(-KScreenWidth/2,tarrowVeiw.center.y)]; - moveAnimation.beginTime = CACurrentMediaTime() + 3; - moveAnimation.duration = 0.5; - moveAnimation.repeatCount = 1; - moveAnimation.removedOnCompletion = YES; - @kWeakify(self); - [moveAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) { - @kStrongify(self); - if (finished) { - [tarrowVeiw removeFromSuperview]; - self.isPlayOfB = NO; - if (self.animationListB.count > 0) { - [self.animationListB removeObjectAtIndex:0]; - } -// if(self. isAnimationListAFinish == YES){ -// -// [self playAnimationWithModel]; -// self.isAnimationListAFinish = NO; -// return; -// } - [self playAnimationWithModel]; - } - }]; - [tarrowVeiw pop_addAnimation:moveAnimation forKey:@"moveOutAnimation"]; - } - }]; - [tarrowVeiw pop_addAnimation:springAnimation forKey:@"candyTreespingOutAnimation"]; - - -} -#pragma mark - 夺宝精灵横幅 -- (void)receiveTreasureFairyGiftHighLevel:(AttachmentModel *)attatchment { - PIBaseAnimationViewModel *giftModel = [PIBaseAnimationViewModel new]; - giftModel.data = attatchment.data; - giftModel.second = attatchment.second; - giftModel.first = attatchment.first; - giftModel.type = GiftBannerType_Fairy; - if (self.animationListB.count == 0 && self.isPlayOfB == NO) { - [self createTreasureFairyBannerAnimation:giftModel]; - } - [self.animationListB addObject:giftModel]; - -} -- (void)createTreasureFairyBannerAnimation:(PIBaseAnimationViewModel *)attatchment { - CGFloat kscale = (CGFloat)60 / (CGFloat)375; - self.isPlayOfB = YES; - CGFloat top = self.isPlayOfA == YES ? (self.broadCastHieght + statusbarHeight) : (kNavigationHeight + 15); - XPTreasureFairyGiftView *treasureView = [[XPTreasureFairyGiftView alloc] initWithFrame:CGRectMake(KScreenWidth, top, KScreenWidth , KScreenWidth * kscale)]; - //最大礼物 - if ((attatchment.second == Custom_Message_Sub_Treasure_Fairy_Draw_Gift_L5) || (attatchment.second == Custom_Message_Sub_Treasure_Fairy_Convert_L3)) { - treasureView.isMaxLargeGift = YES; - }else{ - treasureView.isMaxLargeGift = NO; - } - if ((attatchment.second == Custom_Message_Sub_Treasure_Fairy_Draw_Gift_L4) || (attatchment.second == Custom_Message_Sub_Treasure_Fairy_Draw_Gift_L5)) { - treasureView.isDrawGift = YES; //抽奖 - }else{ - treasureView.isDrawGift = NO; //召唤 - } - treasureView.treasureInfo = attatchment.data; - [kWindow addSubview:treasureView]; - POPSpringAnimation *springAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPViewCenter]; - springAnimation.springSpeed = 12; - springAnimation.springBounciness = 10.f; - springAnimation.fromValue = [NSValue valueWithCGPoint:treasureView.center]; - springAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(treasureView.frame.size.width / 2, treasureView.center.y)]; - [springAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) { - if (finished) { - POPBasicAnimation *moveAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewCenter]; - moveAnimation.fromValue = [NSValue valueWithCGPoint:CGPointMake(0, treasureView.center.y)]; - moveAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(-KScreenWidth/2, treasureView.center.y)]; - moveAnimation.beginTime = CACurrentMediaTime() + 3; - moveAnimation.duration = 0.5; - moveAnimation.repeatCount = 1; - moveAnimation.removedOnCompletion = YES; - @kWeakify(self); - [moveAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) { - @kStrongify(self); - if (finished) { - [treasureView removeFromSuperview]; - self.isPlayOfB = NO; - if (self.animationListB.count > 0) { - [self.animationListB removeObjectAtIndex:0]; - } -// if(self. isAnimationListAFinish == YES){ -// -// [self playAnimationWithModel]; -// self.isAnimationListAFinish = NO; -// return; -// } - [self playAnimationWithModel]; - } - }]; - [treasureView pop_addAnimation:moveAnimation forKey:@"moveOutAnimation"]; - } - }]; - [treasureView pop_addAnimation:springAnimation forKey:@"candyTreespingOutAnimation"]; -} - -#pragma mark - 福袋中 四级奖品 -- (void)receiveLuckyGiftBigPrize:(AttachmentModel *)attachment { - if ( attachment.second == Custom_Message_Sub_Room_Gift_LuckBag_FullScree) { - PIBaseAnimationViewModel * prizeModel = [PIBaseAnimationViewModel modelWithDictionary:attachment.data]; - prizeModel.type = GiftBannerType_Lucky; - prizeModel.isInRoomVisable = attachment.second == Custom_Message_Sub_Room_Gift_LuckBag; - - if(self.animationListB.count == 0 && self.isPlayOfB == NO){ - [self createBigPrizeAnimation:prizeModel]; - } - [self.animationListB addObject:prizeModel]; - } -} - -- (void)createBigPrizeAnimation:(PIBaseAnimationViewModel *)prizeModel { - self.isPlayOfB = YES; - CGFloat top = self.isPlayOfA == YES ? (self.broadCastHieght + statusbarHeight) : (kNavigationHeight + 15); - XPRoomLuckyBigPrizeView * luckyGiftEffectView = [[XPRoomLuckyBigPrizeView alloc] initWithFrame:CGRectMake(KScreenWidth, top, 375, 71)]; - luckyGiftEffectView.delegate = self; - [kWindow addSubview:luckyGiftEffectView]; - - luckyGiftEffectView.giftInfo = prizeModel; - - POPSpringAnimation *springAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPViewCenter]; - springAnimation.springSpeed = 12; - springAnimation.springBounciness = 10.f; - springAnimation.fromValue = [NSValue valueWithCGPoint:luckyGiftEffectView.center]; - springAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(KScreenWidth / 2, luckyGiftEffectView.center.y)]; - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 7 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{ - POPBasicAnimation *moveAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewCenter]; - moveAnimation.fromValue = [NSValue valueWithCGPoint:CGPointMake(0, luckyGiftEffectView.center.y)]; - moveAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(-KScreenWidth/2, luckyGiftEffectView.center.y)]; - moveAnimation.beginTime = CACurrentMediaTime(); - moveAnimation.duration = 0.5; - moveAnimation.repeatCount = 1; - moveAnimation.removedOnCompletion = YES; - @kWeakify(self); - [moveAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) { - @kStrongify(self); - if (finished) { - [luckyGiftEffectView removeFromSuperview]; - - if (self.animationListB.count > 0) { - [self.animationListB removeObjectAtIndex:0]; - } - self.isPlayOfB = NO; - // if(self.isAnimationListAFinish == YES){ - // self.isAnimationListAFinish = NO; - // [self playAnimationWithModel]; - // return; - // } - [self playAnimationWithModel]; - } - }]; - [luckyGiftEffectView pop_addAnimation:moveAnimation forKey:@"moveOutAnimation"]; - - - }); - [luckyGiftEffectView pop_addAnimation:springAnimation forKey:@"nobleLevelUpspingOutAnimation"]; -} -#pragma mark - XPRoomLuckyBigPrizeViewDelegate -- (void)xPRoomLuckyBigPrizeView:(XPRoomLuckyBigPrizeView *)view luckyGiftInfo:(PIBaseAnimationViewModel *)giftInfo { - - id isShowBroadcastView = [[NSUserDefaults standardUserDefaults]valueForKey:@"kSaveLuckSelectState"]; - if(isShowBroadcastView == nil){ - PIRoomGiftBroadcastWindow *broadcastView = [[PIRoomGiftBroadcastWindow alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)]; - broadcastView.isLuck = YES; - broadcastView.roodUid = giftInfo.roomUid; - broadcastView.roomName = giftInfo.roomTitle; - broadcastView.delegate = self; - [kWindow addSubview:broadcastView]; - return; - } - if (!giftInfo.isInRoomVisable && giftInfo.roomUid.length > 0 ) { - [XPRoomViewController openRoom:giftInfo.roomUid viewController:[XCCurrentVCStackManager shareManager].getCurrentVC]; - } -} -#pragma mark - 糖果树横幅动画 -- (void)receiveCandyTreeGiftHighLevel:(AttachmentModel *)attatchment { - PIBaseAnimationViewModel *giftModel = [PIBaseAnimationViewModel new]; - giftModel.data = attatchment.data; - giftModel.second = attatchment.second; - giftModel.first = attatchment.first; - giftModel.type = GiftBannerType_Love; - if (self.animationListB.count == 0 && self.isPlayOfB == NO) { - [self createCandyTreeBannerAnimation:giftModel]; - } - [self.animationListB addObject:giftModel]; -} - -- (void)createCandyTreeBannerAnimation:(PIBaseAnimationViewModel *)attatchment { - CGFloat kscale = (CGFloat)60 / (CGFloat)375; - self.isPlayOfB = YES; - CGFloat top = self.isPlayOfA == YES ? (self.broadCastHieght + statusbarHeight) : (kNavigationHeight + 15); - - - XPRoomCandyGiftView *candyTreeView = [[XPRoomCandyGiftView alloc] initWithFrame:CGRectMake(KScreenWidth, top, KScreenWidth , KScreenWidth * kscale)]; - candyTreeView.isMaxLargeGift = attatchment.second == Custom_Message_Sub_Look_Love_InRoom_NeedAllMicSend; - candyTreeView.candyInfo = attatchment.data; - [kWindow addSubview:candyTreeView]; - POPSpringAnimation *springAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPViewCenter]; - springAnimation.springSpeed = 12; - springAnimation.springBounciness = 10.f; - springAnimation.fromValue = [NSValue valueWithCGPoint:candyTreeView.center]; - springAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(candyTreeView.frame.size.width / 2, candyTreeView.center.y)]; - [springAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) { - if (finished) { - POPBasicAnimation *moveAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewCenter]; - moveAnimation.fromValue = [NSValue valueWithCGPoint:CGPointMake(0, candyTreeView.center.y)]; - moveAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(-KScreenWidth/2, candyTreeView.center.y)]; - moveAnimation.beginTime = CACurrentMediaTime() + 3; - moveAnimation.duration = 0.5; - moveAnimation.repeatCount = 1; - moveAnimation.removedOnCompletion = YES; - @kWeakify(self); - [moveAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) { - @kStrongify(self); - if (finished) { - [candyTreeView removeFromSuperview]; - self.isPlayOfB = NO; - if (self.animationListB.count > 0) { - [self.animationListB removeObjectAtIndex:0]; - } -// if(self. isAnimationListAFinish == YES){ -// -// [self playAnimationWithModel]; -// self.isAnimationListAFinish = NO; -// return; -// } - [self playAnimationWithModel]; - } - }]; - [candyTreeView pop_addAnimation:moveAnimation forKey:@"moveOutAnimation"]; - } - }]; - [candyTreeView pop_addAnimation:springAnimation forKey:@"candyTreespingOutAnimation"]; -} -#pragma mark - VIP升级 -- (void)receiveNobleLevelUp:(AttachmentModel *)attachment { - @kWeakify(self); - [[NetImageView new]loadImageWithUrl:attachment.data[@"avatar"] completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) { - @kStrongify(self); - PIBaseAnimationViewModel *nobleModel = [PIBaseAnimationViewModel new]; - nobleModel.data = attachment.data; - nobleModel.type = GiftBannerType_Nobleman; - - if (self.animationListB.count == 0 && self.isPlayOfB == NO) { - [self createNobleLevelUpBannerAnimation:nobleModel]; - } - [self.animationListB addObject:nobleModel]; - }]; -} - -- (void)createNobleLevelUpBannerAnimation:(PIBaseAnimationViewModel *)model { - self.isPlayOfB = YES; - CGFloat top = self.isPlayOfA == YES ? (self.broadCastHieght + statusbarHeight) : (kNavigationHeight + 15); - - XPRoomNobleLevelUpView *nobleLevelUpView = [[XPRoomNobleLevelUpView alloc] initWithFrame:CGRectMake(KScreenWidth, top, KScreenWidth, 90)]; - nobleLevelUpView.nobleInfo = model.data; - [kWindow addSubview:nobleLevelUpView]; - @kWeakify(self); - @kWeakify(nobleLevelUpView); - nobleLevelUpView.completionBlock = ^{ - @kStrongify(self); - @kStrongify(nobleLevelUpView); - POPSpringAnimation *springAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPViewCenter]; - springAnimation.springSpeed = 12; - springAnimation.springBounciness = 10.f; - springAnimation.fromValue = [NSValue valueWithCGPoint:nobleLevelUpView.center]; - springAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(nobleLevelUpView.frame.size.width / 2, nobleLevelUpView.center.y)]; - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(6.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - POPBasicAnimation *moveAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewCenter]; - moveAnimation.fromValue = [NSValue valueWithCGPoint:CGPointMake(0, nobleLevelUpView.center.y)]; - moveAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(-KScreenWidth/2, nobleLevelUpView.center.y)]; - moveAnimation.beginTime = CACurrentMediaTime() + 3; - moveAnimation.duration = 0.5; - moveAnimation.repeatCount = 1; - moveAnimation.removedOnCompletion = YES; - @kWeakify(self); - [moveAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) { - @kStrongify(self); - if (finished) { - self.isPlayOfB = NO; - [nobleLevelUpView removeFromSuperview]; - if (self.animationListB.count > 0) { - [self.animationListB removeObjectAtIndex:0]; - } - // if(self.isAnimationListAFinish == YES){ - // - // [self playAnimationWithModel]; - // self.isAnimationListAFinish = NO; - // return; - // } - [self playAnimationWithModel]; - } - }]; - [nobleLevelUpView pop_addAnimation:moveAnimation forKey:@"moveOutAnimation"]; - }); - - [nobleLevelUpView pop_addAnimation:springAnimation forKey:@"nobleLevelUpspingOutAnimation"]; - }; - -} -#pragma mark - 收到星级厨房飘屏 --(void)receiveRoomGraffitiStarKitchen:(AttachmentModel *)attacment{ - PIBaseAnimationViewModel *roomGraffiti = [PIBaseAnimationViewModel new]; - roomGraffiti.data = attacment.data; - roomGraffiti.type = GiftBannerType_kitchen; - roomGraffiti.first = attacment.first; - roomGraffiti.second = attacment.second; - if(self.animationListB.count == 0 && self.isPlayOfB == NO){ - [self createStarKitchenBannerAnimation:roomGraffiti]; - } - [self.animationListB addObject:roomGraffiti]; -} - -- (void)createStarKitchenBannerAnimation:(PIBaseAnimationViewModel *)attacment{ - self.isPlayOfB = YES; - CGFloat top = self.isPlayOfA == YES ? (self.broadCastHieght + statusbarHeight) : (kNavigationHeight + 15); - XPRoomStarKitchenBannerView *starKitchenView = [[XPRoomStarKitchenBannerView alloc]initWithFrame:CGRectMake(0, top, KScreenWidth, kGetScaleWidth(60))]; - starKitchenView.isSvga = attacment.second == Custom_Message_Sub_Star_Kitchen_FullScreen; - XPRoomStarKitchenModel *starModel = [XPRoomStarKitchenModel modelWithDictionary:attacment.data]; - starKitchenView.delegate = self; - starKitchenView.starModel = starModel; - [kWindow addSubview:starKitchenView]; - POPSpringAnimation *springAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPViewCenter]; - springAnimation.springSpeed = 12; - springAnimation.springBounciness = 10.f; - springAnimation.fromValue = [NSValue valueWithCGPoint:starKitchenView.center]; - springAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(starKitchenView.frame.size.width / 2, starKitchenView.center.y)]; - [springAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) { - if (finished) { - POPBasicAnimation *moveAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewCenter]; - moveAnimation.fromValue = [NSValue valueWithCGPoint:CGPointMake(0, starKitchenView.center.y)]; - moveAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(-KScreenWidth/2, starKitchenView.center.y)]; - moveAnimation.beginTime = CACurrentMediaTime() + 3; - moveAnimation.duration = 0.5; - moveAnimation.repeatCount = 1; - moveAnimation.removedOnCompletion = YES; - @kWeakify(self); - [moveAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) { - @kStrongify(self); - if (finished) { - [starKitchenView removeFromSuperview]; - self.isPlayOfB = NO; - - if(self.animationListB.count > 0){ - [self.animationListB removeObjectAtIndex:0]; - } -// if(self. isAnimationListAFinish == YES){ -// -// [self playAnimationWithModel]; -// self.isAnimationListAFinish = NO; -// return; -// } - [self playAnimationWithModel]; - } - }]; - [starKitchenView pop_addAnimation:moveAnimation forKey:@"moveOutAnimation"]; - } - }]; - [starKitchenView pop_addAnimation:springAnimation forKey:@"starKitchenOutAnimation"]; -} -#pragma mark - XPRoomStarKitchenBannerViewDelegate -- (void)xPRoomStarKitchenBannerView:(XPRoomStarKitchenBannerView *)view didClick:(XPRoomStarKitchenModel *)starModel{ - if(starModel.skipUrl == nil || starModel.skipUrl.length == 0)return; - XPWebViewController * webVC = [[XPWebViewController alloc] initWithRoomUID:starModel.roomUid]; - webVC.isPush = YES; - webVC.url = starModel.skipUrl; - [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:webVC animated:YES]; - -} - -#pragma mark - XPRoomAnchorRankBannerViewDelegate -- (void)xPRoomAnchorRankBannerView:(XPRoomAnchorRankBannerView *)view rankInfo:(RoomHalfHourRankModel *)rankInfo{ - [XPRoomViewController openRoom:rankInfo.uid viewController:[XCCurrentVCStackManager shareManager].getCurrentVC]; -} -#pragma mark - 个播小时榜飘屏或牌照房小时榜飘屏 -- (void)receiveAnchorHourRank:(AttachmentModel *)attachment { - PIBaseAnimationViewModel *anchorModel =[PIBaseAnimationViewModel new]; - anchorModel.data = attachment.data; - anchorModel.type = GiftBannerType_AnchorHour; - if(self.animationListB.count == 0 && self.isPlayOfB == NO){ - [self createAnchorHourRankAnimation:anchorModel]; - } - [self.animationListB addObject:anchorModel]; -} -- (void)createAnchorHourRankAnimation:(PIBaseAnimationViewModel *)attachment { - self.isPlayOfB = YES; - CGFloat top = self.isPlayOfA == YES ? (self.broadCastHieght + statusbarHeight) : (kNavigationHeight + 15); - XPRoomAnchorRankBannerView *anchorRankView = [[XPRoomAnchorRankBannerView alloc] initWithFrame:CGRectMake(KScreenWidth,top, KScreenWidth, kGetScaleWidth(55))]; - anchorRankView.anchorRankInfo = [RoomHalfHourRankModel modelWithDictionary:attachment.data]; - anchorRankView.delegate = self; - UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(gotoTopRankAnchorRoom:)]; - [anchorRankView addGestureRecognizer:tap]; - [kWindow addSubview:anchorRankView]; - POPSpringAnimation *springAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPViewCenter]; - springAnimation.springSpeed = 12; - springAnimation.springBounciness = 10.f; - springAnimation.fromValue = [NSValue valueWithCGPoint:anchorRankView.center]; - springAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(anchorRankView.frame.size.width / 2, anchorRankView.center.y)]; - [springAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) { - if (finished) { - POPBasicAnimation *moveAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewCenter]; - moveAnimation.fromValue = [NSValue valueWithCGPoint:CGPointMake(0, anchorRankView.center.y)]; - moveAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(-KScreenWidth/2, anchorRankView.center.y)]; - moveAnimation.beginTime = CACurrentMediaTime() + 3; - moveAnimation.duration = 0.5; - moveAnimation.repeatCount = 1; - moveAnimation.removedOnCompletion = YES; - [moveAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) { - [anchorRankView removeFromSuperview]; - self.isPlayOfB = NO; - if(self.animationListB.count > 0){ - [self.animationListB removeObjectAtIndex:0]; - } -// if(self.isAnimationListAFinish == YES){ -// self.isAnimationListAFinish = NO; -// [self playAnimationWithModel]; -// return; -// } - [self playAnimationWithModel]; - }]; - [anchorRankView pop_addAnimation:moveAnimation forKey:@"moveOutAnimation"]; - } - }]; - [anchorRankView pop_addAnimation:springAnimation forKey:@"nobleLevelUpspingOutAnimation"]; -} -- (void)gotoTopRankAnchorRoom:(UITapGestureRecognizer *)tap { - XPRoomAnchorRankBannerView * view = (XPRoomAnchorRankBannerView *)tap.view; - if (view.anchorRankInfo.uid.integerValue > 0) { - - [XPRoomViewController openRoom:view.anchorRankInfo.uid viewController:[XCCurrentVCStackManager shareManager].getCurrentVC]; - - } -} -#pragma mark - 懒加载 -- (NSMutableArray *)animationListA{ - if(!_animationListA){ - _animationListA = [NSMutableArray array]; - } - return _animationListA; -} -- (NSMutableArray *)animationListB{ - if(!_animationListB){ - _animationListB = [NSMutableArray array]; - } - return _animationListB; -} -- (CGFloat)broadCastHieght{ - if(_broadCastHieght == 0){ - _broadCastHieght = 190 - 150 + kGetScaleWidth(69); - } - return _broadCastHieght; -} -@end diff --git a/YuMi/Modules/YMTabbar/View/TabbarViewController.m b/YuMi/Modules/YMTabbar/View/TabbarViewController.m index d7fb1dd7..03981005 100644 --- a/YuMi/Modules/YMTabbar/View/TabbarViewController.m +++ b/YuMi/Modules/YMTabbar/View/TabbarViewController.m @@ -83,7 +83,7 @@ #import "MainProtocol.h" #import "RoomHostDelegate.h" #import "XPSkillCardPlayerManager.h" -#import "PIFullScreenBannerAnimation.h" + #import #import "Api+Gift.h" #import "UploadFile.h" @@ -104,7 +104,7 @@ NSString * const kNetworkReachabilityKey = @"kNetworkReachabilityKey"; UIKIT_EXTERN NSString * kNewUserRechargeKey; UIKIT_EXTERN NSString *kTabShowAnchorCardKey; -@interface TabbarViewController () +@interface TabbarViewController () { NSTimer * timer; } @@ -123,8 +123,6 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey; @property (nonatomic, strong) XPAnchorCardView *anchorCardView; ///任务完成提示 @property (nonatomic, strong) XPTaskCompleteTipView *taskTipView; -///全服广播 年度飘屏 -@property (nonatomic,strong) NSMutableArray *giftBroadcastQueue; ///是否是的第一次链接网络 @property (nonatomic,assign) BOOL isFirstReachability; ///是否刷新了 @@ -132,8 +130,6 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey; ///是否刷新了 @property (nonatomic,assign) BOOL isInitReload; @property(nonatomic,assign) BOOL isReloadTicket; -///房间外的飘屏 -@property(nonatomic,strong) PIFullScreenBannerAnimation *roomAnimation; @property(nonatomic, assign) NSInteger retryCount; @@ -157,8 +153,6 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey; [self.presenter autoLogin]; [self initTabs:NO defaultSelectedIndex:0]; -// [[ClientConfig shareConfig] clientInit]; - [[NIMSDK sharedSDK].loginManager addDelegate:self]; [[NIMSDK sharedSDK].chatManager addDelegate:self]; [[NIMSDK sharedSDK].systemNotificationManager addDelegate:self]; @@ -611,49 +605,12 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey; // MARK: 要复查这里的 if else 嵌套 if (attachment.first == CustomMessageType_RedPacket) { [self receiveRedPacketDealWithData:attachment]; - } else if (attachment.first == CustomMessageType_Gift && attachment.second == Custom_Message_Sub_Gift_ChannelNotify){///广播 年度飘屏 - // MARK: 房间外不显示 -// [self receiveBroadcastGift:attachment]; - }else if(attachment.first == CustomMessageType_Version_Update && attachment.second == Custom_Message_Version_Update_Value){ + } else if(attachment.first == CustomMessageType_Version_Update && attachment.second == Custom_Message_Version_Update_Value){ NSString *osValue = attachment.data[@"updateOs"]; if([osValue isEqualToString:@"ios"] && [AccountInfoStorage instance].getUid.length > 0){ XPVersionUpdateModel *updateModel = [XPVersionUpdateModel modelWithDictionary:attachment.data]; [self getVersionUpdate:updateModel]; } - }else if(attachment.first == CustomMessageType_LuckyBag && attachment.second == Custom_Message_Sub_Room_Gift_LuckBag_FullScree){ - if([XPSkillCardPlayerManager shareInstance].isInRoomVC == YES)return; - [self.roomAnimation receiveLuckyGiftBigPrize:attachment]; - }else if(attachment.first == CustomMessageType_Graffiti_Star_Kitchen && attachment.second == Custom_Message_Sub_Star_Kitchen_FullScreen){ - if([XPSkillCardPlayerManager shareInstance].isInRoomVC == YES)return; - [self.roomAnimation receiveRoomGraffitiStarKitchen:attachment]; - }else if(attachment.first == CustomMessageType_Look_Love && attachment.second == Custom_Message_Sub_Look_Love_InRoom_NeedAllMicSend){ - if([XPSkillCardPlayerManager shareInstance].isInRoomVC == YES)return; - [self.roomAnimation receiveCandyTreeGiftHighLevel:attachment]; - }else if (attachment.first == CustomMessageType_Treasure_Fairy && (attachment.second == Custom_Message_Sub_Treasure_Fairy_Draw_Gift_L4 || attachment.second == Custom_Message_Sub_Treasure_Fairy_Draw_Gift_L5 || attachment.second == Custom_Message_Sub_Treasure_Fairy_Convert_L1 || attachment.second == Custom_Message_Sub_Treasure_Fairy_Convert_L2 || attachment.second == Custom_Message_Sub_Treasure_Fairy_Convert_L3)) { //夺宝精灵 - if([XPSkillCardPlayerManager shareInstance].isInRoomVC == YES)return; - [self.roomAnimation receiveTreasureFairyGiftHighLevel:attachment]; - }else if (attachment.first == CustomMessageType_Tarot && (attachment.second == Custom_Message_Sub_Tarot_Advanced || attachment.second == Custom_Message_Sub_Tarot_Intermediate)){ - if([XPSkillCardPlayerManager shareInstance].isInRoomVC == YES)return; - [self.roomAnimation receiveTarotBanner:attachment]; - }else if(attachment.first == CustomMessageType_Common_H5 && (attachment.second == Custom_Message_Sub_Common_H5_Novice || attachment.second == Custom_Message_Sub_Common_H5_Advanced)){ - if([XPSkillCardPlayerManager shareInstance].isInRoomVC == YES)return; - [self.roomAnimation receiveCommonH5Banner:attachment]; - }else if (attachment.first == CustomMessageType_Anchor_Hour_Rank && attachment.second == Custom_Message_Sub_Anchor_Hour_Rank) {///个播小时榜 - if([XPSkillCardPlayerManager shareInstance].isInRoomVC == YES)return; - [self.roomAnimation receiveAnchorHourRank:attachment]; - } else if (attachment.first == CustomMessageType_License_Hour_Rank && attachment.second == Custom_Message_Sub_License_Hour_Rank) {///牌照房小时榜 - if([XPSkillCardPlayerManager shareInstance].isInRoomVC == YES)return; - [self.roomAnimation receiveAnchorHourRank:attachment]; - }else if (attachment.first == CustomMessageType_Noble_VIP && attachment.second == Custom_Message_Sub_Room_Noble_LevelUp_Suspend) {///VIP升级全服飘屏 -// if([XPSkillCardPlayerManager shareInstance].isInRoomVC == YES)return; -// [self.roomAnimation receiveNobleLevelUp:attachment]; - }else if (attachment.first == CustomMessageType_General_Floating_Screen && attachment.second == Custom_Message_Sub_General_Floating_Screen_All_Room){ - return; -// if([XPSkillCardPlayerManager shareInstance].isInRoomVC == YES) { -// return; -// } - // 房间会发通知 -// [self.roomAnimation receiveRoomGeneralFloatingScreen:attachment]; } } } @@ -1074,78 +1031,6 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey; } } -#pragma mark - 年度礼物飘屏 -- (void)receiveBroadcastGift:(AttachmentModel *)attachment { - GiftReceiveInfoModel *giftNotifyInfo = [GiftReceiveInfoModel modelWithJSON:attachment.data]; - if (!giftNotifyInfo.ceremonyGift && giftNotifyInfo.isHomeShow == YES) { - if([XPSkillCardPlayerManager shareInstance].isInRoomVC == YES)return; - [self.roomAnimation receiveGift:giftNotifyInfo]; - return; - } - if(giftNotifyInfo.isHomeShow == NO)return; - if (self.giftBroadcastQueue.count == 0) { - [self createGiftBroadcastViewAnimation:giftNotifyInfo]; - } - [self.giftBroadcastQueue addObject:giftNotifyInfo]; -} - -- (void)createGiftBroadcastViewAnimation:(GiftReceiveInfoModel *)giftModel { - XPRoomYearActivityView * view = [[XPRoomYearActivityView alloc] init]; - view.delegate = self; - view.frame = CGRectMake(KScreenWidth, 35 + statusbarHeight, KScreenWidth, 150); - view.model = giftModel; - [[XCCurrentVCStackManager shareManager].getCurrentVC.view addSubview:view]; - [self beginGiftBraodcastViewAnimation:view notifyStaySecond:giftModel.notifyStaySecond]; -} - -- (void)beginGiftBraodcastViewAnimation:(XPRoomYearActivityView *)view notifyStaySecond:(int)notifyStaySecond{ - CGFloat startTime = notifyStaySecond > 0 ? notifyStaySecond : 3.0; - POPSpringAnimation *springAnimation = [POPSpringAnimation animationWithPropertyNamed:kPOPViewCenter]; - springAnimation.springSpeed = 12; - springAnimation.springBounciness = 10.f; - springAnimation.fromValue = [NSValue valueWithCGPoint:view.center]; - springAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(0 + view.frame.size.width / 2, view.center.y)]; - [springAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) { - if (finished) { - [self removeGiftBroadcastOutAnimation:view stayTime:startTime]; - } - }]; - [view pop_addAnimation:springAnimation forKey:@"spingOutAnimation"]; -} - -- (void)removeGiftBroadcastOutAnimation:(XPRoomYearActivityView *)view stayTime:(CGFloat)stayTime{ - POPBasicAnimation *moveAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewCenter]; - moveAnimation.fromValue = [NSValue valueWithCGPoint:view.center]; - moveAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(-KScreenWidth/2, view.center.y)]; - moveAnimation.beginTime = CACurrentMediaTime() + stayTime; - moveAnimation.duration = 0.5; - moveAnimation.repeatCount = 1; - moveAnimation.removedOnCompletion = YES; - @kWeakify(self); - [moveAnimation setCompletionBlock:^(POPAnimation *anim, BOOL finished) { - @kStrongify(self); - if (finished) { - [view removeFromSuperview]; - if (self.giftBroadcastQueue.count > 0) { - [self.giftBroadcastQueue removeObjectAtIndex:0]; - } - if (self.giftBroadcastQueue.count > 0) { - [self createGiftBroadcastViewAnimation:self.giftBroadcastQueue.firstObject]; - } - } - }]; - - [view pop_addAnimation:moveAnimation forKey:@"moveOutAnimation"]; -} - -#pragma mark - XPRoomGiftBroadcastViewDelegate -- (void)xPRoomYearActivityViewEnterRoom:(NSString *)roomUid{ - if (roomUid.length > 0) { - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.7 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - [XPRoomViewController openRoom:roomUid viewController:[XCCurrentVCStackManager shareManager].getCurrentVC]; - }); - } -} #pragma mark - Getters And Setters - (XPMiniRoomView *)roomMineView { @@ -1173,17 +1058,4 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey; return _taskTipView; } -- (NSMutableArray *)giftBroadcastQueue { - if (!_giftBroadcastQueue) { - _giftBroadcastQueue = [NSMutableArray array]; - } - return _giftBroadcastQueue; -} -- (PIFullScreenBannerAnimation *)roomAnimation{ - if(!_roomAnimation){ - _roomAnimation = [[PIFullScreenBannerAnimation alloc]init]; - } - return _roomAnimation; -} - @end diff --git a/YuMi/Structure/MVP/Model/UserInfoModel.h b/YuMi/Structure/MVP/Model/UserInfoModel.h index e5dc77df..be2c2b1e 100644 --- a/YuMi/Structure/MVP/Model/UserInfoModel.h +++ b/YuMi/Structure/MVP/Model/UserInfoModel.h @@ -60,7 +60,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic , assign) BOOL isBindBankCard; @property (nonatomic , assign) BOOL hasRegPacket; @property (nonatomic , assign) GenderType gender; -@property (nonatomic , assign) NSInteger platformRole; +@property (nonatomic , assign) NSInteger platformRole; /// 0 普通 1超管 @property (nonatomic , assign) NSInteger uid; @property (nonatomic , assign) NSInteger defUser; @property (nonatomic , copy) NSString * phone; diff --git a/YuMi/Tools/CardManager/XPSkillCardPlayerManager.h b/YuMi/Tools/CardManager/XPSkillCardPlayerManager.h index f47c2247..202c8d93 100644 --- a/YuMi/Tools/CardManager/XPSkillCardPlayerManager.h +++ b/YuMi/Tools/CardManager/XPSkillCardPlayerManager.h @@ -42,6 +42,8 @@ typedef enum : NSUInteger { // 作为全局获取当前用户数据的 model,需要在相关 user/get 调用处更新,目前只在 mine tab 更新 @property(nonatomic, strong) UserInfoModel *userInfoModel; +@property(nonatomic, assign) BOOL is9Mic; // 当前房间是否 9 mic + + (instancetype)shareInstance; /** diff --git a/YuMi/Tools/NSString/NSString+Utils.m b/YuMi/Tools/NSString/NSString+Utils.m index 51113243..0d82408b 100644 --- a/YuMi/Tools/NSString/NSString+Utils.m +++ b/YuMi/Tools/NSString/NSString+Utils.m @@ -325,6 +325,9 @@ return day; } +(NSString *)getAgeWithBirth:(long)birth{ + if (birth == 0) { + return @" "; + } NSDateComponents *components1 = [[NSCalendar currentCalendar] components:NSCalendarUnitDay | NSCalendarUnitMonth | NSCalendarUnitYear fromDate:[NSDate dateWithTimeIntervalSince1970:birth/1000]]; NSInteger brithDateYear = [components1 year]; NSInteger brithDateDay = [components1 day]; @@ -335,9 +338,8 @@ NSInteger iAge = currentDateYear - brithDateYear - 1; if ((currentDateMonth > brithDateMonth) || (currentDateMonth == brithDateMonth && currentDateDay >= brithDateDay)) { iAge++; - } - return @(iAge).stringValue; + return [NSString stringWithFormat:@" %ld ", iAge]; } ///得到区号 +(NSString *)getCountryCode{ diff --git a/YuMi/ar.lproj/Localizable.strings b/YuMi/ar.lproj/Localizable.strings index 7755f278..d29d8624 100644 --- a/YuMi/ar.lproj/Localizable.strings +++ b/YuMi/ar.lproj/Localizable.strings @@ -4060,3 +4060,22 @@ ineHeadView12" = "الحمل"; \n\٥. جميع حقوق التفسير مملوكة للمسؤول ولا علاقة لها بـ قوقل أو ابل"; "1.0.33_text_18" = "مستوى الغرفة>=%@ يمكن استخدامه"; "1.0.33_text_19" = "عدد المسؤولين المقابلين لمستوى غرفتك الحالي ممتلئ، يرجى الترقية أولاً ثم الإضافة!"; + +"1.0.34_text_1" = "الإدارة الرسمية"; +"1.0.34_text_2" = "غرفة مخفية"; +"1.0.34_text_3" = "إغلاق الغرفة"; +"1.0.34_text_4" = "الغرفة مخفية. لا يمكن للمستخدمين العثور عليها إلا من خلال البحث أو المتابعة. يرجى العمل بحذر."; +"1.0.34_text_5" = "أغلق الغرفة وأخرج جميع المستخدمين في الغرفة. يرجى العمل بحذر."; +"1.0.34_text_6" = "لقد أضفت %@ كمسؤول عن الغرفة."; +"1.0.34_text_7" = "لقد أزلت %@ كمسؤول عن الغرفة."; + +"1.0.34_text_8" = " يتم اكتشاف مخالفة مشتبه فيها من قبل النظام، %@ الموقع تم قفل الكلام "; +"1.0.34_text_9" = " يتم اكتشاف مخالفة مشتبه فيها من قبل النظام، %@ الموقع تم كتم الصوت"; +"1.0.34_text_10" = " يتم اكتشاف مخالفة مشتبه فيها من قبل النظام، %@ الموقع طُلب النزول من المسرح"; +"1.0.34_text_11" = " يتم اكتشاف مخالفة مشتبه فيها من قبل النظام، %@ تم طرده من الغرفة"; +"1.0.34_text_12" = " يتم اكتشاف مخالفة مشتبه فيها من قبل النظام، %@ تم إرساله إلى الغرفة السوداء"; + +"1.0.34_text_13" = "لقد تمت إضافتك كمسؤول بواسطة %@ معرف الغرفة: %@."; +"1.0.34_text_14" = "لقد تمت إزالتك كمسؤول بواسطة %@ معرف الغرفة: %@."; +"1.0.34_text_15" = "لقد تم تعيينك كمدير من قبل المضيف"; +"1.0.34_text_16" = "لقد تمت إزالتك كمدير من قبل المضيف"; diff --git a/YuMi/en.lproj/Localizable.strings b/YuMi/en.lproj/Localizable.strings index 5efefa4e..edb8a269 100644 --- a/YuMi/en.lproj/Localizable.strings +++ b/YuMi/en.lproj/Localizable.strings @@ -3849,3 +3849,21 @@ "1.0.33_text_18" = "Room Lv. >=%@ Can be used"; "1.0.33_text_19" = "The number of admins corresponding to your current room level is full, please upgrade first and then add!"; +"1.0.34_text_1" = "Official Management"; +"1.0.34_text_2" = "Hidden Room"; +"1.0.34_text_3" = "Close Room"; +"1.0.34_text_4" = "The room is hidden. Users can only find it by searching or following. Please operate with caution."; +"1.0.34_text_5" = "Close the room and kick out all users in the room. Please operate with caution."; +"1.0.34_text_6" = "You have added %@ as a room admin."; +"1.0.34_text_7" = "You have been removed %@ as a room admin."; + +"1.0.34_text_8" = "System detects suspected violation, %@ Number Mic Be locked from speaking"; +"1.0.34_text_9" = "System detects suspected violation,, %@ Number Mic Be muted"; +"1.0.34_text_10" = "System detects suspected violation,, %@ Number Mic Be asked to step down from the stage"; +"1.0.34_text_11" = "System detects suspected violation,, %@ Be kicked out of the room"; +"1.0.34_text_12" = "System detects suspected violation, %@ Be sent to the black room"; + +"1.0.34_text_13" = "You have been added as an admin by %@ room ID: %@."; +"1.0.34_text_14" = "You have been removed as an admin by %@ room ID: %@."; +"1.0.34_text_15" = "You have been set as a manager by the host"; +"1.0.34_text_16" = "You have been removed as a manager by the host"; diff --git a/YuMi/tr.lproj/Localizable.strings b/YuMi/tr.lproj/Localizable.strings index 6fa1b1e5..269e9f8b 100644 --- a/YuMi/tr.lproj/Localizable.strings +++ b/YuMi/tr.lproj/Localizable.strings @@ -3635,3 +3635,26 @@ "1.0.33_text_17" = "1. Yıldız derecelendirmesini artırmak için resmi müşteri hizmetleriyle iletişime geçebilir ve ilgili kanıtları sağlayabilirsiniz.\n2. Yıldız derecelendirmesi 1~5 yıldıza bölünmüştür. 5 yıldız en iyi şarj aracıdır.\n3. Yıldız derecelendirmesi, kullanıcı şarj aracısını bulduğunda görüntülenecektir.\n4. Yıldız derecelendirmesi ne kadar yüksekse, transfer listesindeki sıralama da o kadar yüksek olur.\n5. Tüm yorumlama hakları resmiyete aittir ve Google veya Apple ile hiçbir ilgisi yoktur."; "1.0.33_text_18" = "Oda Lv. >=%@ Kullanılabilir"; "1.0.33_text_19" = "Mevcut oda seviyenize karşılık gelen yönetici sayısı doldu, lütfen önce yükseltin ve ardından ekleyin!"; + +"1.0.34_text_1" = "Resmi Yönetim"; +"1.0.34_text_2" = "Gizli Oda"; +"1.0.34_text_3" = "Odayı Kapat"; +"1.0.34_text_4" = "Oda gizlidir. Kullanıcılar yalnızca arayarak veya takip ederek bulabilir. Lütfen dikkatli olun."; +"1.0.34_text_5" = "Odayı kapatın ve odadaki tüm kullanıcıları dışarı atın. Lütfen dikkatli olun."; +"1.0.34_text_6" = "%@'yi oda yöneticisi olarak eklediniz."; +"1.0.34_text_7" = "%@'yi oda yöneticisi olarak kaldırdınız."; + +"1.0.34_text_8" = "Sistem ihlal tespit etti ve sohbet ekranını kapatma uyarısı verdi"; +"1.0.34_text_9" = "The system detects suspected violations and closes the public screen message warning"; +"1.0.34_text_10" = "The system detects suspected violations and closes the public screen message warning"; + +"1.0.34_text_8" = "Sistem ihlal tespit etti, %@ Mikrofon konumu Mikrofon kilidi"; +"1.0.34_text_9" = "Sistem ihlal tespit etti, %@ Mikrofon konumu Mikrofon kapatıldı"; +"1.0.34_text_10" = "Sistem ihlal tespit etti, %@ Mikrofon konumu Mikrofondan çıkarıldı"; +"1.0.34_text_11" = "Sistem ihlal tespit etti, %@ Odadaki kullanıcıdan çıkarıldı"; +"1.0.34_text_12" = "Sistem ihlal tespit etti, %@ Siyah odada kilitli"; + +"1.0.34_text_13" = "%@ oda kimliği: %@ tarafından yönetici olarak eklendiniz."; +"1.0.34_text_14" = "%@ oda kimliği: %@ tarafından yönetici olarak kaldırıldınız."; +"1.0.34_text_15" = "Oda sahibi sizi yönetici olarak ayarladı"; +"1.0.34_text_16" = "Oda sahibi sizi yöneticilikten çıkardı"; diff --git a/YuMi/zh-Hant.lproj/Localizable.strings b/YuMi/zh-Hant.lproj/Localizable.strings index de0f0827..7c736153 100644 --- a/YuMi/zh-Hant.lproj/Localizable.strings +++ b/YuMi/zh-Hant.lproj/Localizable.strings @@ -1017,7 +1017,7 @@ "XPUserCardViewController6" = "該用戶為%@VIP\n確認是否要將其踢出房間?"; "XPUserCardViewController7" = "遊戲模式下默認該玩家退出遊戲是否要將此用戶踢出房間?"; "XPUserCardViewController8" = "遊戲模式下默認該玩家退出遊戲是否要將此用戶踢出房間"; -"XPUserCardViewController9" = "是否需要將%@踢出房間?"; +"XPUserCardViewController9" = "是否需要將 %@ 踢出房間?"; "XPUserCardViewController10" = "操作提醒"; "XPUserCardViewController11" = "該用戶為%@VIP,只有房主才可以踢出哦"; "XPUserCardViewController12" = "該用戶為%@VIP\n確認是否要將其拉黑?"; @@ -3507,3 +3507,24 @@ "1.0.33_text_17" = "1.您可以聯絡官方客服並提供相關證據來提升星級。\n2.星級分為1~5星。5星是最好的儲值代理。\n3.用戶找到儲值代理商時會顯示星級。\n4.星級越高,在轉職榜的排名越高。\n5.所有解釋權歸官方所有,與Google或蘋果無關。"; "1.0.33_text_18" = "房間等級>=%@可以使用"; "1.0.33_text_19" = "您目前房間等級對應的管理員人數已滿,請先升級再新增!"; + +"1.0.34_text_1" = "官方管理"; +"1.0.34_text_2" = "隱藏房間"; +"1.0.34_text_3" = "關閉房間"; +"1.0.34_text_4" = "隱藏房間,用戶只能通過搜索或關注查找到該房間,請謹慎操作。"; +"1.0.34_text_5" = "關閉房間,並將房間內所有用戶踢出,請謹慎操作。"; +"1.0.34_text_6" = "你已经添加 %@ 为房间管理员"; +"1.0.34_text_7" = "你已经取消 %@ 为房间管理员"; + +"1.0.34_text_8" = "系統檢測涉嫌違規, %@ 號麥位被鎖麥"; +"1.0.34_text_9" = "系統檢測涉嫌違規, %@ 號麥位被閉麥"; +"1.0.34_text_10" = "系統檢測涉嫌違規, %@ 被請下麥"; +"1.0.34_text_11" = "系統檢測涉嫌違規, %@ 被請出房間"; +"1.0.34_text_12" = "系統檢測涉嫌違規, %@ 被關進小黑屋"; +"1.0.34_text_13" = "您被%@房間 ID:%@新增為管理員。"; +"1.0.34_text_14" = "你被%@房間 ID:%@取消管理員。"; +"1.0.34_text_15" = "您已被房主設置為管理員"; +"1.0.34_text_16" = "您已被房主移除管理員"; + + +