From 63492e37cf99a33806cde799cdbc4a5174676ccb Mon Sep 17 00:00:00 2001 From: liyuhua <15626451870@163.com> Date: Tue, 17 Oct 2023 18:30:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=BF=E9=97=B4=E7=9B=B8=E5=86=8C=E6=A8=A1?= =?UTF-8?q?=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- YuMi.xcodeproj/project.pbxproj | 44 +++- YuMi/CustomUI/XNDJTDDLoadingTool.h | 1 + YuMi/CustomUI/XNDJTDDLoadingTool.m | 18 +- YuMi/Global/YUMIConstant.m | 1 + .../Modules/YMMessage/Model/AttachmentModel.h | 8 + YuMi/Modules/YMMine/Api/Api+Mine.h | 10 + YuMi/Modules/YMMine/Api/Api+Mine.m | 11 + .../Modules/YMMine/Model/XPMaskManagerModel.h | 27 +++ .../Modules/YMMine/Model/XPMaskManagerModel.m | 13 + .../YMMine/Model/XPMineSettingItemModel.h | 1 + .../YMMine/Presenter/XPMineSettingPresent.h | 5 +- .../YMMine/Presenter/XPMineSettingPresent.m | 21 +- .../YMMine/Protocol/XPMineSettingProtocol.h | 4 + .../View/Cell/Setting/XPMaskManagerCell.h | 26 ++ .../View/Cell/Setting/XPMaskManagerCell.m | 175 ++++++++++++++ .../YMMine/View/Setting/XPMaskManagerVC.h | 16 ++ .../YMMine/View/Setting/XPMaskManagerVC.m | 166 +++++++++++++ .../Setting/XPMineSettingViewController.m | 7 + .../MineInfo/XPMineUserInfoEditPickView.m | 8 +- .../View/CustomView/XPNewHomeItemCell.m | 9 +- .../View/XPHomeRecommendViewController.m | 9 +- YuMi/Modules/YMRoom/Api/Api+Room.h | 9 + YuMi/Modules/YMRoom/Api/Api+Room.m | 15 ++ YuMi/Modules/YMRoom/Model/RoomInfoModel.h | 3 +- .../YMRoom/Presenter/XPRoomPresenter.h | 4 +- .../YMRoom/Presenter/XPRoomPresenter.m | 19 ++ YuMi/Modules/YMRoom/Protocol/XPRoomProtocol.h | 2 + .../AnimationView/XPRoomLuckyBigPrizeView.m | 18 +- .../Model/XPMessageInfoModel.h | 4 + .../Model/XPMessageRemoteExtModel.h | 1 + .../Tool/XPRoomMessageParser.m | 10 + .../View/PIRoomMessagePhotoAlbumCell.h | 7 +- .../View/PIRoomMessagePhotoAlbumCell.m | 51 +++- .../View/PIRoomMessagePhotoAlbumView.h | 8 +- .../View/PIRoomMessagePhotoAlbumView.m | 79 ++++++ .../View/PIRoomMessageUnlockPhotoAlbumView.h | 11 +- .../View/PIRoomMessageUnlockPhotoAlbumView.m | 10 + .../XPRoomMessageContainerView.h | 1 - .../XPRoomMessageContainerView.m | 160 ++++++++++--- .../MoreView/Presenter/XPMoreMenuPresenter.m | 4 +- .../View/RoomPhotoAlbum/Api/Api+PhotoAlbum.h | 40 ++++ .../View/RoomPhotoAlbum/Api/Api+PhotoAlbum.m | 55 +++++ .../Model/PIRoomPhotoAlbumItemModel.h | 28 +++ .../Model/PIRoomPhotoAlbumItemModel.m | 15 ++ .../Presenter/PIRoomPhotoAlbumItemPresenter.h | 35 +++ .../Presenter/PIRoomPhotoAlbumItemPresenter.m | 69 ++++++ .../Protocol/PIRoomPhotoAlbumItemProtocol.h | 29 +++ .../View/Cell/PIRoomPhotoAlbumItemCell.h | 4 +- .../View/Cell/PIRoomPhotoAlbumItemCell.m | 42 +++- .../View/PIRoomPhotoAlbumItemVC.h | 10 +- .../View/PIRoomPhotoAlbumItemVC.m | 225 ++++++++++++++++-- .../RoomPhotoAlbum/View/PIRoomPhotoAlbumVC.m | 3 +- .../PIRoomPhotoAlbumChoosePhotoView.h | 7 +- .../PIRoomPhotoAlbumChoosePhotoView.m | 26 +- .../SubViews/PIRoomPhotoAlbumOperateView.h | 15 +- .../SubViews/PIRoomPhotoAlbumOperateView.m | 3 + .../Cell/XPTreasureFairyShopingExchangeCell.m | 40 ++-- .../View/View/XPTreasureFairyDrawView.m | 5 +- .../UserCard/Presenter/XPUserCardPresenter.m | 8 +- .../YMRoom/View/XPRoomViewController.m | 21 +- .../YMTabbar/View/TabbarViewController.m | 2 +- YuMi/Structure/PrefixHeader.pch | 1 + .../CardManager/XPSkillCardPlayerManager.h | 3 +- YuMi/Tools/SDPhotoBrowser/SDPhotoBrowser.m | 27 ++- YuMi/zh-Hans.lproj/Localizable.strings | 16 +- YuMi/zh-Hant.lproj/Localizable.strings | 19 +- 66 files changed, 1598 insertions(+), 146 deletions(-) create mode 100644 YuMi/Modules/YMMine/Model/XPMaskManagerModel.h create mode 100644 YuMi/Modules/YMMine/Model/XPMaskManagerModel.m create mode 100644 YuMi/Modules/YMMine/View/Guild/View/Cell/Setting/XPMaskManagerCell.h create mode 100644 YuMi/Modules/YMMine/View/Guild/View/Cell/Setting/XPMaskManagerCell.m create mode 100644 YuMi/Modules/YMMine/View/Setting/XPMaskManagerVC.h create mode 100644 YuMi/Modules/YMMine/View/Setting/XPMaskManagerVC.m create mode 100644 YuMi/Modules/YMRoom/View/RoomPhotoAlbum/Api/Api+PhotoAlbum.h create mode 100644 YuMi/Modules/YMRoom/View/RoomPhotoAlbum/Api/Api+PhotoAlbum.m create mode 100644 YuMi/Modules/YMRoom/View/RoomPhotoAlbum/Model/PIRoomPhotoAlbumItemModel.h create mode 100644 YuMi/Modules/YMRoom/View/RoomPhotoAlbum/Model/PIRoomPhotoAlbumItemModel.m create mode 100644 YuMi/Modules/YMRoom/View/RoomPhotoAlbum/Presenter/PIRoomPhotoAlbumItemPresenter.h create mode 100644 YuMi/Modules/YMRoom/View/RoomPhotoAlbum/Presenter/PIRoomPhotoAlbumItemPresenter.m create mode 100644 YuMi/Modules/YMRoom/View/RoomPhotoAlbum/Protocol/PIRoomPhotoAlbumItemProtocol.h diff --git a/YuMi.xcodeproj/project.pbxproj b/YuMi.xcodeproj/project.pbxproj index 82b6aedf..5ce3517a 100644 --- a/YuMi.xcodeproj/project.pbxproj +++ b/YuMi.xcodeproj/project.pbxproj @@ -138,6 +138,9 @@ 2305F3382AD9194B00AD403C /* PIRoomMessageUnlockPhotoAlbumView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2305F3372AD9194B00AD403C /* PIRoomMessageUnlockPhotoAlbumView.m */; }; 2305F33B2AD9293D00AD403C /* PIRoomPhotoAlbumOperateView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2305F33A2AD9293D00AD403C /* PIRoomPhotoAlbumOperateView.m */; }; 2305F33E2AD9295800AD403C /* PIRoomPhotoAlbumOperateCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 2305F33D2AD9295800AD403C /* PIRoomPhotoAlbumOperateCell.m */; }; + 2305F3412AD94D5200AD403C /* XPMaskManagerVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 2305F33F2AD94D5200AD403C /* XPMaskManagerVC.m */; }; + 2305F3442AD94E2700AD403C /* XPMaskManagerModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 2305F3432AD94E2700AD403C /* XPMaskManagerModel.m */; }; + 2305F3472AD94E9D00AD403C /* XPMaskManagerCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 2305F3462AD94E9C00AD403C /* XPMaskManagerCell.m */; }; 23194DBB2AD13EAB00649F51 /* PILoginManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 23194DBA2AD13EAB00649F51 /* PILoginManager.m */; }; 23194DCC2AD14BF000649F51 /* DDTTYLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 23194DBD2AD14BF000649F51 /* DDTTYLogger.m */; }; 23194DCD2AD14BF000649F51 /* DDASLLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 23194DC02AD14BF000649F51 /* DDASLLogger.m */; }; @@ -294,6 +297,9 @@ 23B2AEC42A6516C200543D17 /* LoginForgetPasswordViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 23B2AEC22A6516C200543D17 /* LoginForgetPasswordViewController.m */; }; 23BA165B2A5D2ACF0030C5A3 /* PIBaseAnimationViewModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 23BA165A2A5D2ACF0030C5A3 /* PIBaseAnimationViewModel.m */; }; 23C7C0B72A7CD7B000802205 /* XPNewMineGuildItemView.m in Sources */ = {isa = PBXBuildFile; fileRef = 23C7C0B62A7CD7B000802205 /* XPNewMineGuildItemView.m */; }; + 23D321D22ADD0EBC006B259C /* PIRoomPhotoAlbumItemPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 23D321D12ADD0EBC006B259C /* PIRoomPhotoAlbumItemPresenter.m */; }; + 23D321D52ADD0F05006B259C /* Api+PhotoAlbum.m in Sources */ = {isa = PBXBuildFile; fileRef = 23D321D42ADD0F05006B259C /* Api+PhotoAlbum.m */; }; + 23D321D92ADD1B46006B259C /* PIRoomPhotoAlbumItemModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 23D321D82ADD1B46006B259C /* PIRoomPhotoAlbumItemModel.m */; }; 23D8DEF22AC5633300644637 /* PIIAPRegulate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23D8DEF12AC5633300644637 /* PIIAPRegulate.swift */; }; 23E45C052AC2B0A200D88BCA /* SessionDiscoverNewTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 23E45C042AC2B0A200D88BCA /* SessionDiscoverNewTableViewCell.m */; }; 23E9E9972A80C3A100B792F2 /* XPMineGuildPersonalBillRecordVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 23E9E9942A80C39F00B792F2 /* XPMineGuildPersonalBillRecordVC.m */; }; @@ -1688,6 +1694,12 @@ 2305F33A2AD9293D00AD403C /* PIRoomPhotoAlbumOperateView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PIRoomPhotoAlbumOperateView.m; sourceTree = ""; }; 2305F33C2AD9295800AD403C /* PIRoomPhotoAlbumOperateCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PIRoomPhotoAlbumOperateCell.h; sourceTree = ""; }; 2305F33D2AD9295800AD403C /* PIRoomPhotoAlbumOperateCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PIRoomPhotoAlbumOperateCell.m; sourceTree = ""; }; + 2305F33F2AD94D5200AD403C /* XPMaskManagerVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XPMaskManagerVC.m; sourceTree = ""; }; + 2305F3402AD94D5200AD403C /* XPMaskManagerVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPMaskManagerVC.h; sourceTree = ""; }; + 2305F3422AD94E2700AD403C /* XPMaskManagerModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPMaskManagerModel.h; sourceTree = ""; }; + 2305F3432AD94E2700AD403C /* XPMaskManagerModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XPMaskManagerModel.m; sourceTree = ""; }; + 2305F3452AD94E9C00AD403C /* XPMaskManagerCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPMaskManagerCell.h; sourceTree = ""; }; + 2305F3462AD94E9C00AD403C /* XPMaskManagerCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XPMaskManagerCell.m; sourceTree = ""; }; 23194DB92AD13EAB00649F51 /* PILoginManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PILoginManager.h; sourceTree = ""; }; 23194DBA2AD13EAB00649F51 /* PILoginManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PILoginManager.m; sourceTree = ""; }; 23194DBD2AD14BF000649F51 /* DDTTYLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DDTTYLogger.m; sourceTree = ""; }; @@ -2000,6 +2012,13 @@ 23BA165A2A5D2ACF0030C5A3 /* PIBaseAnimationViewModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PIBaseAnimationViewModel.m; sourceTree = ""; }; 23C7C0B52A7CD7B000802205 /* XPNewMineGuildItemView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPNewMineGuildItemView.h; sourceTree = ""; }; 23C7C0B62A7CD7B000802205 /* XPNewMineGuildItemView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPNewMineGuildItemView.m; sourceTree = ""; }; + 23D321D02ADD0EBC006B259C /* PIRoomPhotoAlbumItemPresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PIRoomPhotoAlbumItemPresenter.h; sourceTree = ""; }; + 23D321D12ADD0EBC006B259C /* PIRoomPhotoAlbumItemPresenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PIRoomPhotoAlbumItemPresenter.m; sourceTree = ""; }; + 23D321D32ADD0F05006B259C /* Api+PhotoAlbum.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Api+PhotoAlbum.h"; sourceTree = ""; }; + 23D321D42ADD0F05006B259C /* Api+PhotoAlbum.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "Api+PhotoAlbum.m"; sourceTree = ""; }; + 23D321D62ADD0F2C006B259C /* PIRoomPhotoAlbumItemProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PIRoomPhotoAlbumItemProtocol.h; sourceTree = ""; }; + 23D321D72ADD1B46006B259C /* PIRoomPhotoAlbumItemModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PIRoomPhotoAlbumItemModel.h; sourceTree = ""; }; + 23D321D82ADD1B46006B259C /* PIRoomPhotoAlbumItemModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PIRoomPhotoAlbumItemModel.m; sourceTree = ""; }; 23D8DEF12AC5633300644637 /* PIIAPRegulate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PIIAPRegulate.swift; sourceTree = ""; }; 23E45C032AC2B0A200D88BCA /* SessionDiscoverNewTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SessionDiscoverNewTableViewCell.h; sourceTree = ""; }; 23E45C042AC2B0A200D88BCA /* SessionDiscoverNewTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SessionDiscoverNewTableViewCell.m; sourceTree = ""; }; @@ -4894,6 +4913,8 @@ 2305EEE72AD677D300AD403C /* Presenter */ = { isa = PBXGroup; children = ( + 23D321D02ADD0EBC006B259C /* PIRoomPhotoAlbumItemPresenter.h */, + 23D321D12ADD0EBC006B259C /* PIRoomPhotoAlbumItemPresenter.m */, ); path = Presenter; sourceTree = ""; @@ -4901,6 +4922,7 @@ 2305EEE82AD677D300AD403C /* Protocol */ = { isa = PBXGroup; children = ( + 23D321D62ADD0F2C006B259C /* PIRoomPhotoAlbumItemProtocol.h */, ); path = Protocol; sourceTree = ""; @@ -4910,6 +4932,8 @@ children = ( 2305EEFF2AD6A33E00AD403C /* PIRoomPhotoAlbumItemChoosePhotoModel.h */, 2305EF002AD6A33E00AD403C /* PIRoomPhotoAlbumItemChoosePhotoModel.m */, + 23D321D72ADD1B46006B259C /* PIRoomPhotoAlbumItemModel.h */, + 23D321D82ADD1B46006B259C /* PIRoomPhotoAlbumItemModel.m */, ); path = Model; sourceTree = ""; @@ -4962,6 +4986,8 @@ 2305EEED2AD677D300AD403C /* Api */ = { isa = PBXGroup; children = ( + 23D321D32ADD0F05006B259C /* Api+PhotoAlbum.h */, + 23D321D42ADD0F05006B259C /* Api+PhotoAlbum.m */, ); path = Api; sourceTree = ""; @@ -7902,8 +7928,10 @@ E85E7AE82A4EB0D200B6D00A /* Setting */ = { isa = PBXGroup; children = ( - E85E7AE92A4EB0D200B6D00A /* XPMineGuildManagerPerTableViewCell.m */, E85E7AEB2A4EB0D200B6D00A /* XPMineGuildManagerPerTableViewCell.h */, + E85E7AE92A4EB0D200B6D00A /* XPMineGuildManagerPerTableViewCell.m */, + 2305F3452AD94E9C00AD403C /* XPMaskManagerCell.h */, + 2305F3462AD94E9C00AD403C /* XPMaskManagerCell.m */, ); path = Setting; sourceTree = ""; @@ -9785,6 +9813,8 @@ E8E20BEB2816A5B90033B688 /* XPMineBlackListViewController.m */, 140A818B299CFF1C00841594 /* XPVendorCallViewController.h */, 140A818C299CFF1C00841594 /* XPVendorCallViewController.m */, + 2305F3402AD94D5200AD403C /* XPMaskManagerVC.h */, + 2305F33F2AD94D5200AD403C /* XPMaskManagerVC.m */, ); path = Setting; sourceTree = ""; @@ -9829,6 +9859,8 @@ E8AC722E26F49610007D6E91 /* XPMineNotificationItemModel.m */, E8AC723826F49AAE007D6E91 /* XPMineNotifyStatus.h */, E8AC723926F49AAE007D6E91 /* XPMineNotifyStatus.m */, + 2305F3422AD94E2700AD403C /* XPMaskManagerModel.h */, + 2305F3432AD94E2700AD403C /* XPMaskManagerModel.m */, E8EEB90A26FC5EBC007C6EBA /* XPMineUserInfoEditModel.h */, E8EEB90B26FC5EBC007C6EBA /* XPMineUserInfoEditModel.m */, 9B734F74288A92FB00CBDAA9 /* XPMineFuntionItemModel.h */, @@ -10504,6 +10536,7 @@ E824544826F5945300BE8163 /* XPMinePayPwdProtocol.h in Sources */, E8AB633628AE54A40023B0D2 /* XPSailingPrizeCollectionViewCell.m in Sources */, 2305EF0A2AD7CC7C00AD403C /* PIRoomPhotoAlbumChooseGiftView.m in Sources */, + 23D321D92ADD1B46006B259C /* PIRoomPhotoAlbumItemModel.m in Sources */, 23FF42792AA6E19C0055733C /* HomeMenuSourceModel.m in Sources */, E85E7B4E2A4EB0D300B6D00A /* XPMineGuildSetNameViewController.m in Sources */, 2331C1642A5EB71000E1D940 /* NobleInfo.m in Sources */, @@ -10552,6 +10585,7 @@ E8F63CB4298B563D00B338BA /* Api+SayHello.m in Sources */, 23E9EA972A84C37000B792F2 /* XPMineUserInfoRecordedSoundVC.m in Sources */, E81E09C9290F71BF00A1F410 /* XPAdvertiseView.m in Sources */, + 2305F3412AD94D5200AD403C /* XPMaskManagerVC.m in Sources */, 238B37D32AC55A2C00BFC9D5 /* XPTreasureFairyShopingRecordView.m in Sources */, 9BC5C91F277C902B007C8719 /* XPReleaseRadioView.m in Sources */, E84843AF27F59E7E0050D365 /* XPRoomPKResultView.m in Sources */, @@ -10744,6 +10778,7 @@ E87DF4D42A42C9B1009C1185 /* HomeRecommendRoomModel.m in Sources */, 23E9EAB22A84C9DE00B792F2 /* XPMineUserInfoTagViewCell.m in Sources */, 9B42869C28C1FD3D009034D2 /* XPOpenRedPacketCell.m in Sources */, + 23D321D22ADD0EBC006B259C /* PIRoomPhotoAlbumItemPresenter.m in Sources */, 9BFE992E288142FD009DA429 /* RoomClassifyModel.m in Sources */, 2331C1B72A60F32D00E1D940 /* XPCandyRankContainerView.m in Sources */, 23194DCE2AD14BF000649F51 /* ContextFilterLogFormatter.m in Sources */, @@ -11340,6 +11375,7 @@ E87DF4B72A42C2FD009C1185 /* XPFirstRechargeCollectionView.m in Sources */, 238B37A92AC55A2C00BFC9D5 /* TreasureFairyUserInfoModel.m in Sources */, E85E7B382A4EB0D300B6D00A /* XPMineGuildSearchMemberTableViewCell.m in Sources */, + 23D321D52ADD0F05006B259C /* Api+PhotoAlbum.m in Sources */, 23E9EA842A84B6FD00B792F2 /* XPMineUserInfoTagModel.m in Sources */, E8998D852859B4FA00C68558 /* XPMineUserInfoGiftView.m in Sources */, 186A536B26FC6F2E00D67B2C /* XPShareItemCell.m in Sources */, @@ -11411,6 +11447,7 @@ E88B5CC126FB407B00DA9178 /* XPMineUserInfoViewController.m in Sources */, 2331C1AC2A60F32D00E1D940 /* CandyTreeRecordModel.m in Sources */, E81E09CF290F750800A1F410 /* AdvertiseModel.m in Sources */, + 2305F3472AD94E9D00AD403C /* XPMaskManagerCell.m in Sources */, E852D74428633A08001465ED /* MonentsCommentModel.m in Sources */, 238B37C42AC55A2C00BFC9D5 /* XPTreasureFairyBallContentView.m in Sources */, E8C1CD6D27D8938C00376F83 /* XPRoomFaceTitleCollectionViewCell.m in Sources */, @@ -11557,6 +11594,7 @@ E885D5392977D10E004DC088 /* SessionSettingUserView.m in Sources */, 2305EF072AD6B51200AD403C /* PIRoomPhotoAlbumChoosePhotoGiftView.m in Sources */, 2331C16C2A5EB71000E1D940 /* XPNobleCenterEmptyView.m in Sources */, + 2305F3442AD94E2700AD403C /* XPMaskManagerModel.m in Sources */, 9BE01AD128927AC000B50299 /* XPDressUpShopViewController.m in Sources */, E8D34D6728084E88009C4835 /* XPMineUserInfoGiftWallCollectionViewCell.m in Sources */, 23E9E9AA2A80FDF100B792F2 /* XPNewMineHallIncomeCell.m in Sources */, @@ -11775,7 +11813,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 20.00.1; + MARKETING_VERSION = 20.10.0; PRODUCT_BUNDLE_IDENTIFIER = com.peko.enterprise.ios; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -11810,7 +11848,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 20.00.1; + MARKETING_VERSION = 20.10.0; PRODUCT_BUNDLE_IDENTIFIER = com.peko.enterprise.ios; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/YuMi/CustomUI/XNDJTDDLoadingTool.h b/YuMi/CustomUI/XNDJTDDLoadingTool.h index c1216a1a..039a7c91 100644 --- a/YuMi/CustomUI/XNDJTDDLoadingTool.h +++ b/YuMi/CustomUI/XNDJTDDLoadingTool.h @@ -142,6 +142,7 @@ NS_ASSUME_NONNULL_BEGIN 在view上显示菊花+文字 */ + (void)showLoadingWithMessage:(NSString *)message inView:(nullable UIView *)view enabled:(BOOL)enabled; ++(void)showOnlyView:(UIView *)view enabled:(BOOL)enabled; @end NS_ASSUME_NONNULL_END diff --git a/YuMi/CustomUI/XNDJTDDLoadingTool.m b/YuMi/CustomUI/XNDJTDDLoadingTool.m index b93a2a07..0e9c64dc 100644 --- a/YuMi/CustomUI/XNDJTDDLoadingTool.m +++ b/YuMi/CustomUI/XNDJTDDLoadingTool.m @@ -391,6 +391,22 @@ static NSArray * _animationImages = nil; hud.removeFromSuperViewOnHide = YES; }); } - ++(void)showOnlyView:(UIView *)view enabled:(BOOL)enabled{ + if (!view) { + view = [UIApplication sharedApplication].keyWindow; + } + [self hideOnlyView:view]; + dispatch_main_sync_safe(^{ + MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:view animated:YES]; + hud.bezelView.style = MBProgressHUDBackgroundStyleSolidColor; + hud.minSize = CGSizeMake(100, 150); + hud.userInteractionEnabled = enabled; + hud.mode = MBProgressHUDModeCustomView; + [hud.bezelView addSubview:[self loadingView]]; + hud.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.35]; + hud.bezelView.color = [UIColor clearColor]; + hud.removeFromSuperViewOnHide = YES; + }); +} @end diff --git a/YuMi/Global/YUMIConstant.m b/YuMi/Global/YUMIConstant.m index b91f41da..29161820 100644 --- a/YuMi/Global/YUMIConstant.m +++ b/YuMi/Global/YUMIConstant.m @@ -31,6 +31,7 @@ NSString * const kRoomReceivedCandyNotificationKey = @"Um9vbVJlY2VpdmVkQ2FuZHlOb NSString * const kGiveDiamondDailyNum = @"a0dpdmVEaWFtb25kRGFpbHlOdW0="; ///弹出首充界面 NSString * const kShowFirstRechargeView = @"a1Nob3dGaXJzdFJlY2hhcmdlVmlldw=="; + ///邀请成员成功 NSString * const kInviteMemeberSuccess = @"a0ludml0ZU1lbWViZXJTdWNjZXNz"; NSString * const kUserFirstRegisterKey = @"kUserFirstRegisterKey"; diff --git a/YuMi/Modules/YMMessage/Model/AttachmentModel.h b/YuMi/Modules/YMMessage/Model/AttachmentModel.h index b3c21a97..13d0b6ad 100644 --- a/YuMi/Modules/YMMessage/Model/AttachmentModel.h +++ b/YuMi/Modules/YMMessage/Model/AttachmentModel.h @@ -108,6 +108,8 @@ typedef NS_ENUM(NSUInteger, CustomMessageType) { CustomMessageType_Service_Reply = 99, ///通用h5 CustomMessageType_Common_H5 = 100, + ///房间相册 + CustomMessageType_Room_Album = 101, }; @@ -606,6 +608,12 @@ typedef NS_ENUM(NSUInteger, CustomMessageTypeCommonH5) { Custom_Message_Sub_Common_H5_Advanced = 1102, +}; +///房间相册 +//CustomMessageType_Room_Album = 101, +typedef NS_ENUM(NSUInteger, CustomMessageTypeRoomAlbum) { + ///所有房间 + Custom_Message_Sub_Room_Album = 1011, }; @interface AttachmentModel : NSObject @property (nonatomic,assign) int first; diff --git a/YuMi/Modules/YMMine/Api/Api+Mine.h b/YuMi/Modules/YMMine/Api/Api+Mine.h index 1f08fe0c..100a2dc4 100644 --- a/YuMi/Modules/YMMine/Api/Api+Mine.h +++ b/YuMi/Modules/YMMine/Api/Api+Mine.h @@ -335,6 +335,16 @@ NS_ASSUME_NONNULL_BEGIN +(void)saveAreaConfigWithArea:(HttpRequestHelperCompletion)completion region:(NSString *)region; /// +(void)requestQueryWithRoomType:(HttpRequestHelperCompletion)completion; +///屏蔽房间列表 +/// - Parameter completion: 完成 ++(void)getBlackRoomList:(HttpRequestHelperCompletion)completion pageNum:(NSString *)pageNum pageSize:(NSString *)pageSize; + +/// 解除屏蔽 +/// - Parameters: +/// - completion: 完成 +/// - roomUid: 房间id +/// - type: 1=房间 ++(void)requestUnmaskingFromBlackRoomList:(HttpRequestHelperCompletion)completion objId:(NSString *)objId type:(NSString *)type ; @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMMine/Api/Api+Mine.m b/YuMi/Modules/YMMine/Api/Api+Mine.m index 6a3c299e..24fcbb25 100644 --- a/YuMi/Modules/YMMine/Api/Api+Mine.m +++ b/YuMi/Modules/YMMine/Api/Api+Mine.m @@ -439,4 +439,15 @@ +(void)saveAreaConfigWithArea:(HttpRequestHelperCompletion)completion region:(NSString *)region{ [self makeRequest:@"region/save" method:HttpRequestHelperMethodPOST completion:completion,__FUNCTION__,region, nil]; } ++(void)getBlackRoomList:(HttpRequestHelperCompletion)completion pageNum:(NSString *)pageNum pageSize:(NSString *)pageSize{ + [self makeRequest:@"user/black/pageRoom" method:HttpRequestHelperMethodGET completion:completion,__FUNCTION__, pageNum,pageSize,nil]; +} +/// 解除屏蔽 +/// - Parameters: +/// - completion: 完成 +/// - roomUid: 房间id +/// - type: 1=房间 ++(void)requestUnmaskingFromBlackRoomList:(HttpRequestHelperCompletion)completion objId:(NSString *)objId type:(NSString *)type { + [self makeRequest:@"user/black/delete" method:HttpRequestHelperMethodPOST completion:completion,__FUNCTION__,objId,type, nil]; +} @end diff --git a/YuMi/Modules/YMMine/Model/XPMaskManagerModel.h b/YuMi/Modules/YMMine/Model/XPMaskManagerModel.h new file mode 100644 index 00000000..9ad949bb --- /dev/null +++ b/YuMi/Modules/YMMine/Model/XPMaskManagerModel.h @@ -0,0 +1,27 @@ +// +// XPMaskManagerModel.h +// xplan-ios +// +// Created by duoban on 2022/12/28. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface XPMaskManagerModel : NSObject + +@property (nonatomic,copy) NSString *uid; +@property (nonatomic,copy) NSString *roomId; +@property (nonatomic,copy) NSString *erbanNo; +@property (nonatomic,copy) NSString *title; +@property (nonatomic,copy) NSString *avatar; +@property (nonatomic,copy) NSString *roomTag; +@property (nonatomic,copy) NSString *tagPict; + +@end + +NS_ASSUME_NONNULL_END + + + diff --git a/YuMi/Modules/YMMine/Model/XPMaskManagerModel.m b/YuMi/Modules/YMMine/Model/XPMaskManagerModel.m new file mode 100644 index 00000000..d9442760 --- /dev/null +++ b/YuMi/Modules/YMMine/Model/XPMaskManagerModel.m @@ -0,0 +1,13 @@ +// +// XPMaskManagerModel.m +// xplan-ios +// +// Created by duoban on 2022/12/28. +// + +#import "XPMaskManagerModel.h" + +@implementation XPMaskManagerModel + +@end + diff --git a/YuMi/Modules/YMMine/Model/XPMineSettingItemModel.h b/YuMi/Modules/YMMine/Model/XPMineSettingItemModel.h index 563d9efd..08ea61af 100644 --- a/YuMi/Modules/YMMine/Model/XPMineSettingItemModel.h +++ b/YuMi/Modules/YMMine/Model/XPMineSettingItemModel.h @@ -24,6 +24,7 @@ typedef NS_ENUM(NSInteger, XPMineSettingItemType){ XPMineSettingItemType_About_Us,///关于我们 XPMineSettingItemType_CheckUpdate,///检查更新 XPMineSettingItemType_Delete_Account,///注销账号 + XPMineSettingItemType_Shield_management,///屏蔽管理 }; @interface XPMineSettingItemModel : NSObject diff --git a/YuMi/Modules/YMMine/Presenter/XPMineSettingPresent.h b/YuMi/Modules/YMMine/Presenter/XPMineSettingPresent.h index 5b0ed46a..4c4dba0a 100644 --- a/YuMi/Modules/YMMine/Presenter/XPMineSettingPresent.h +++ b/YuMi/Modules/YMMine/Presenter/XPMineSettingPresent.h @@ -23,7 +23,10 @@ NS_ASSUME_NONNULL_BEGIN ///获取版本更新 - (void)getVersionUpdate; - +///得到屏蔽房间列表 +-(void)getBlackRoomListWithPageNum:(NSString *)pageNum pageSize:(NSString *)pageSize; +///解除屏蔽 +-(void)requestUnmaskingFromBlackRoomListWithRoomUid:(NSString *)roomUid type:(NSString *)type; @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMMine/Presenter/XPMineSettingPresent.m b/YuMi/Modules/YMMine/Presenter/XPMineSettingPresent.m index 57e181a9..1568b7c3 100644 --- a/YuMi/Modules/YMMine/Presenter/XPMineSettingPresent.m +++ b/YuMi/Modules/YMMine/Presenter/XPMineSettingPresent.m @@ -17,6 +17,7 @@ #import "YYUtility.h" #import "XPVersionUpdateModel.h" #import "Api+Main.h" +#import "XPMaskManagerModel.h" ///Tool #import "AccountInfoStorage.h" #import "XPRoomMiniManager.h" @@ -62,6 +63,11 @@ loginItem.type = XPMineSettingItemType_Login_Password; self.loginItem = loginItem; + XPMineSettingItemModel * shieldItem = [[XPMineSettingItemModel alloc] init]; + shieldItem.title = YMLocalizedString(@"XPMineSettingPresent27"); + + shieldItem.type = XPMineSettingItemType_Shield_management; + XPMineSettingItemModel * blackListItem = [[XPMineSettingItemModel alloc] init]; blackListItem.title = YMLocalizedString(@"XPMineSettingPresent8"); blackListItem.subTitle = @""; @@ -109,7 +115,7 @@ aboutusItem.type = XPMineSettingItemType_About_Us; NSArray * oneSection = @[phoneItem]; - NSArray * twoSection = @[loginItem,payItem, notificaItem, blackListItem]; + NSArray * twoSection = @[loginItem,payItem, notificaItem,shieldItem, blackListItem]; NSArray * threeSection = @[privacyItem]; NSArray * fourthSection = @[helperItem, feedbackItem, clearMemoryItem, updateItem, aboutusItem]; @@ -198,5 +204,16 @@ [[self getView] getVersionUpdateFail]; } errorToast:NO] appVersion:appVersion os:os channel:channel]; } - +-(void)getBlackRoomListWithPageNum:(NSString *)pageNum pageSize:(NSString *)pageSize{ + [Api getBlackRoomList:[self createHttpCompletion:^(BaseModel * _Nonnull data) { + NSArray *list = [XPMaskManagerModel modelsWithArray:data.data]; + [[self getView]getBlackRoomList:list]; + }showLoading:NO] pageNum:pageNum pageSize:pageSize]; +} +///解除屏蔽 +-(void)requestUnmaskingFromBlackRoomListWithRoomUid:(NSString *)roomUid type:(NSString *)type{ + [Api requestUnmaskingFromBlackRoomList:[self createHttpCompletion:^(BaseModel * _Nonnull data) { + [[self getView]requestUnmaskingFromBlackRoomListSuccess]; + }showLoading:YES] objId:roomUid type:type ]; +} @end diff --git a/YuMi/Modules/YMMine/Protocol/XPMineSettingProtocol.h b/YuMi/Modules/YMMine/Protocol/XPMineSettingProtocol.h index 495bdd2e..2634d681 100644 --- a/YuMi/Modules/YMMine/Protocol/XPMineSettingProtocol.h +++ b/YuMi/Modules/YMMine/Protocol/XPMineSettingProtocol.h @@ -22,6 +22,10 @@ NS_ASSUME_NONNULL_BEGIN - (void)getVersionUpdateFail; ///版本更新 -(void)getVersionUpdate:(XPVersionUpdateModel *)model; +///屏蔽房间列表 +-(void)getBlackRoomList:(NSArray *)list; +///解除屏蔽 +-(void)requestUnmaskingFromBlackRoomListSuccess; @end diff --git a/YuMi/Modules/YMMine/View/Guild/View/Cell/Setting/XPMaskManagerCell.h b/YuMi/Modules/YMMine/View/Guild/View/Cell/Setting/XPMaskManagerCell.h new file mode 100644 index 00000000..462eee66 --- /dev/null +++ b/YuMi/Modules/YMMine/View/Guild/View/Cell/Setting/XPMaskManagerCell.h @@ -0,0 +1,26 @@ +// +// XPMaskManagerCell.h +// xplan-ios +// +// Created by duoban on 2022/12/26. +// + +#import +#import "XPMaskManagerModel.h" + +NS_ASSUME_NONNULL_BEGIN + + +@protocol XPMaskManagerCellDelegate + +-(void)unmaskingHandleWithModel:(XPMaskManagerModel *)model; + +@end + + +@interface XPMaskManagerCell : UITableViewCell +@property (nonatomic,strong) XPMaskManagerModel *model; +@property (nonatomic,weak) id delegate; +@end + +NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMMine/View/Guild/View/Cell/Setting/XPMaskManagerCell.m b/YuMi/Modules/YMMine/View/Guild/View/Cell/Setting/XPMaskManagerCell.m new file mode 100644 index 00000000..3f1d69cd --- /dev/null +++ b/YuMi/Modules/YMMine/View/Guild/View/Cell/Setting/XPMaskManagerCell.m @@ -0,0 +1,175 @@ +// +// XPMaskManagerCell.m +// xplan-ios +// +// Created by duoban on 2022/12/26. +// + +#import "XPMaskManagerCell.h" +@interface XPMaskManagerCell() +@property (nonatomic,strong) UIView *bgView; +@property (nonatomic,strong) NetImageView *headView; +@property (nonatomic,strong) UILabel *nameView; +@property (nonatomic,strong) UILabel *idView; +@property (nonatomic,strong) UIButton *unmaskingBtn; +@property (nonatomic,strong) UIStackView *stackView; +@property (nonatomic,strong) NetImageView *iconView; + +@end +@implementation XPMaskManagerCell +- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { + if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { + [self initSubViews]; + [self initSubViewConstraints]; + } + return self; +} + +#pragma mark - Private Method +- (void)initSubViews { + self.backgroundColor = [UIColor clearColor]; + self.selectionStyle = UITableViewCellSelectionStyleNone; + [self.contentView addSubview:self.bgView]; + [self.contentView addSubview:self.headView]; + [self.bgView addSubview:self.nameView]; + + [self.bgView addSubview:self.stackView]; + + [self.stackView addArrangedSubview:self.iconView]; + [self.stackView addArrangedSubview:self.idView]; + + + [self.bgView addSubview:self.unmaskingBtn]; + +} +- (void)initSubViewConstraints { + [self.headView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(kGetScaleWidth(15)); + make.width.height.mas_equalTo(kGetScaleWidth(74)); + make.top.mas_equalTo(kGetScaleWidth(20)); + }]; + [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(kGetScaleWidth(36)); + make.right.mas_equalTo(-kGetScaleWidth(15)); + make.top.mas_equalTo(kGetScaleWidth(15)); + make.height.mas_equalTo(kGetScaleWidth(84)); + }]; + [self.unmaskingBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.right.mas_equalTo(-kGetScaleWidth(12)); + make.height.mas_equalTo(kGetScaleWidth(30)); + make.width.mas_equalTo(kGetScaleWidth(83)); + make.centerY.equalTo(self.bgView); + }]; + [self.nameView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(kGetScaleWidth(65)); + make.top.mas_equalTo(kGetScaleWidth(15)); + make.height.mas_equalTo(kGetScaleWidth(21)); + make.right.equalTo(self.unmaskingBtn.mas_left).mas_offset(-kGetScaleWidth(10)); + }]; + + [self.stackView mas_makeConstraints:^(MASConstraintMaker *make) { + make.right.left.equalTo(self.nameView); + make.top.equalTo(self.nameView.mas_bottom).mas_offset(kGetScaleWidth(16)); + }]; + + [self.iconView mas_makeConstraints:^(MASConstraintMaker *make) { + make.height.mas_equalTo(kGetScaleWidth(15)); + make.width.height.mas_equalTo(kGetScaleWidth(32)); + }]; + + + [self.idView mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.greaterThanOrEqualTo(@10); + + }]; + +} +-(void)setModel:(XPMaskManagerModel *)model{ + _model = model; + _headView.imageUrl = _model.avatar; + _nameView.text = _model.title; + _idView.text = [NSString stringWithFormat:@"ID:%@",_model.erbanNo]; + if(_model.tagPict.length > 0){ + self.iconView.hidden = NO; + self.iconView.imageUrl = _model.tagPict; + }else{ + self.iconView.hidden = YES; + + } + +} +-(void)unmaskingAction{ + if(self.delegate && [self.delegate respondsToSelector:@selector(unmaskingHandleWithModel:)]){ + [self.delegate unmaskingHandleWithModel:self.model]; + } +} +#pragma mark -懒加载 +- (UIStackView *)stackView { + if (!_stackView) { + _stackView = [[UIStackView alloc] init]; + _stackView.axis = UILayoutConstraintAxisHorizontal; + _stackView.distribution = UIStackViewDistributionFill; + _stackView.alignment = UIStackViewAlignmentCenter; + _stackView.spacing = kGetScaleWidth(9); + } + return _stackView; +} +-(UIView *)bgView{ + if (!_bgView){ + _bgView = [UIView new]; + _bgView.backgroundColor = [UIColor whiteColor]; + _bgView.layer.cornerRadius = kGetScaleWidth(14); + _bgView.layer.masksToBounds = YES; + } + return _bgView; +} +- (NetImageView *)headView{ + if (!_headView){ + NetImageConfig *config = [[NetImageConfig alloc]init]; + config.placeHolder = [UIImageConstant defaultAvatarPlaceholder]; + _headView = [[NetImageView alloc]initWithConfig:config]; + _headView.layer.cornerRadius = kGetScaleWidth(74)/2; + _headView.layer.masksToBounds = YES; + } + return _headView; +} +- (UILabel *)nameView{ + if (!_nameView){ + _nameView = [UILabel labelInitWithText:@"" font:kFontRegular(15) textColor:[DJDKMIMOMColor inputTextColor]]; + } + return _nameView; +} +-(NetImageView *)iconView{ + if (!_iconView){ + _iconView = [[NetImageView alloc]init]; + } + return _iconView; +} +- (UILabel *)idView{ + if (!_idView){ + _idView = [UILabel labelInitWithText:@"" font:kFontRegular(13) textColor:UIColorFromRGB(0x6D6B89)]; + } + return _idView; +} +-(UIButton *)unmaskingBtn{ + if (!_unmaskingBtn){ + UIImage *image = [UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor confirmButtonGradientStartColor],[DJDKMIMOMColor confirmButtonGradientMiddleColor],[DJDKMIMOMColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(kGetScaleWidth(83), kGetScaleWidth(30))]; + _unmaskingBtn = [UIButton buttonInitWithText:YMLocalizedString(@"XPMaskManagerCell0") font:kFontMedium(14) textColor:[UIColor whiteColor] image:nil bgImage:image]; + _unmaskingBtn.layer.cornerRadius = kGetScaleWidth(15); + _unmaskingBtn.layer.masksToBounds = YES; + [_unmaskingBtn addTarget:self action:@selector(unmaskingAction) forControlEvents:UIControlEventTouchUpInside]; + } + return _unmaskingBtn; +} +- (void)awakeFromNib { + [super awakeFromNib]; + // Initialization code +} + +- (void)setSelected:(BOOL)selected animated:(BOOL)animated { + [super setSelected:selected animated:animated]; + + // Configure the view for the selected state +} + +@end diff --git a/YuMi/Modules/YMMine/View/Setting/XPMaskManagerVC.h b/YuMi/Modules/YMMine/View/Setting/XPMaskManagerVC.h new file mode 100644 index 00000000..e5289765 --- /dev/null +++ b/YuMi/Modules/YMMine/View/Setting/XPMaskManagerVC.h @@ -0,0 +1,16 @@ +// +// XPMaskManagerVC.h +// xplan-ios +// +// Created by duoban on 2022/12/26. +// + +#import "MvpViewController.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XPMaskManagerVC : MvpViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMMine/View/Setting/XPMaskManagerVC.m b/YuMi/Modules/YMMine/View/Setting/XPMaskManagerVC.m new file mode 100644 index 00000000..36ce0723 --- /dev/null +++ b/YuMi/Modules/YMMine/View/Setting/XPMaskManagerVC.m @@ -0,0 +1,166 @@ +// +// XPMaskManagerVC.m +// xplan-ios +// +// Created by duoban on 2022/12/26. +// + +#import "XPMaskManagerVC.h" +///view +#import "XPMaskManagerCell.h" +#import "XPMineSettingPresent.h" +#import "XPMineSettingProtocol.h" +#import "XPMineFriendEmptyTableViewCell.h" +#import "XPMaskManagerModel.h" +#import + +@interface XPMaskManagerVC () +@property (nonatomic,strong) UITableView *tableView; +@property (nonatomic,strong) NSMutableArray *listData; +@property (nonatomic,strong) UIView *foodView; +@property (nonatomic,strong) XPMaskManagerModel * chooseModel; +@property (nonatomic,assign) NSInteger page; + +@end + +@implementation XPMaskManagerVC + +- (__kindof id)createPresenter{ + return [[XPMineSettingPresent alloc]init]; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + [self initSubViews]; + [self initSubViewConstraints]; + [self initHeaderAndFooterRrfresh]; + +} +#pragma mark - 下拉刷新 +- (void)initHeaderAndFooterRrfresh { + MJRefreshNormalHeader *header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(headerRefresh)]; + header.stateLabel.font = kFontRegular(14); + header.lastUpdatedTimeLabel.font = kFontRegular(14); + header.stateLabel.textColor = UIColorFromRGB(0x6D6B89); + header.lastUpdatedTimeLabel.textColor = UIColorFromRGB(0x6D6B89); + self.tableView.mj_header = header; + + MJRefreshBackNormalFooter *footer = [MJRefreshBackNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(footerRefresh)]; + footer.stateLabel.textColor = UIColorFromRGB(0x6D6B89); + footer.stateLabel.font = kFontRegular(14); + [footer setTitle:YMLocalizedString(@"XPMaskManagerVC1") forState:MJRefreshStateNoMoreData]; + self.tableView.mj_footer = footer; + + [self headerRefresh]; +} +#pragma mark - 刷新的fangfa +- (void)headerRefresh { + self.page = 1; + [self.presenter getBlackRoomListWithPageNum:@(self.page).stringValue pageSize:@"20"]; +} + +- (void)footerRefresh { + + self.page++; + [self.presenter getBlackRoomListWithPageNum:@(self.page).stringValue pageSize:@"20"]; +} + +-(void)getBlackRoomList:(NSArray *)list{ + [self.tableView.mj_footer endRefreshing]; + [self.tableView.mj_header endRefreshing]; + if(self.page == 1){ + self.listData = [NSMutableArray arrayWithArray:list]; + }else{ + if(list.count == 0){ + [self.tableView.mj_footer endRefreshingWithNoMoreData]; + }else{ + [self.listData addObjectsFromArray:list]; + } + } + [self.tableView reloadData]; +} +-(void)requestUnmaskingFromBlackRoomListSuccess{ + if(self.chooseModel){ + if([self.listData containsObject:self.chooseModel]){ + [self.listData removeObject:self.chooseModel]; + [self.tableView reloadData]; + [self showSuccessToast:YMLocalizedString(@"XPMaskManagerVC3")]; + } + } +} +#pragma mark - Private Method +- (void)initSubViews { + self.title = YMLocalizedString(@"XPMaskManagerVC0"); + self.view.backgroundColor = UIColorFromRGB(0xF3F5FA); + [self.view addSubview:self.tableView]; +} +- (void)initSubViewConstraints { + [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.equalTo(self.view); + }]; +} +#pragma mark - XPMaskManagerCellDelegate +-(void)unmaskingHandleWithModel:(XPMaskManagerModel *)model{ + self.chooseModel = model; + [self showLoading]; + [self.presenter requestUnmaskingFromBlackRoomListWithRoomUid:model.uid type:@"1"]; +} + +#pragma mark UITableViewDelegate,UITableViewDataSource +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ + return self.listData.count > 0 ? self.listData.count : 1; +} +-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ + return self.listData.count > 0 ? kGetScaleWidth(99) : self.view.frame.size.height; +} + +-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ + if(self.listData.count > 0){ + XPMaskManagerCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMaskManagerCell class]) forIndexPath:indexPath]; + if(indexPath.row < self.listData.count){ + cell.model = self.listData[indexPath.row]; + } + cell.delegate = self; + return cell; + } + + XPMineFriendEmptyTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineFriendEmptyTableViewCell class])]; + cell.emptyTitle = YMLocalizedString(@"XPMaskManagerVC2"); + return cell; +} + +#pragma mark -懒加载 +- (UITableView *)tableView { + if (!_tableView) { + _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain]; + _tableView.delegate = self; + _tableView.dataSource = self; + _tableView.showsVerticalScrollIndicator = NO; + _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; + _tableView.backgroundColor = [UIColor clearColor]; + if (@available(iOS 11.0, *)) { + _tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; + } + [_tableView registerClass:[XPMaskManagerCell class] forCellReuseIdentifier:NSStringFromClass([XPMaskManagerCell class])]; + [_tableView registerClass:[XPMineFriendEmptyTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPMineFriendEmptyTableViewCell class])]; + + } + return _tableView; +} +- (UIView *)foodView{ + if (!_foodView){ + _foodView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, kGetScaleWidth(117))]; + UILabel *titleView = [UILabel labelInitWithText:YMLocalizedString(@"XPMaskManagerVC1") font:kFontRegular(14) textColor:UIColorFromRGB(0x6D6B89)]; + titleView.frame = _foodView.bounds; + titleView.textAlignment = NSTextAlignmentCenter; + [_foodView addSubview:titleView]; + } + return _foodView; +} +- (NSMutableArray *)listData{ + if (!_listData){ + _listData = [NSMutableArray array]; + } + return _listData; +} +@end diff --git a/YuMi/Modules/YMMine/View/Setting/XPMineSettingViewController.m b/YuMi/Modules/YMMine/View/Setting/XPMineSettingViewController.m index a8bff24b..822dfb56 100644 --- a/YuMi/Modules/YMMine/View/Setting/XPMineSettingViewController.m +++ b/YuMi/Modules/YMMine/View/Setting/XPMineSettingViewController.m @@ -39,6 +39,7 @@ #import "XPPrivacyViewController.h" #import "XPMineLoginPasswordViewController.h" #import "XPMineBlackListViewController.h" +#import "XPMaskManagerVC.h" ///不同模块的VC #import "XPWebViewController.h" #import "XPLoginVerifBindPhoneViewController.h" @@ -215,6 +216,12 @@ } } break; + case XPMineSettingItemType_Shield_management: + { + XPMaskManagerVC *vc = [XPMaskManagerVC new]; + [self.navigationController pushViewController:vc animated:YES]; + break; + } default: break; } diff --git a/YuMi/Modules/YMMine/View/SubViews/MineInfo/XPMineUserInfoEditPickView.m b/YuMi/Modules/YMMine/View/SubViews/MineInfo/XPMineUserInfoEditPickView.m index 0aff08f4..ab891085 100644 --- a/YuMi/Modules/YMMine/View/SubViews/MineInfo/XPMineUserInfoEditPickView.m +++ b/YuMi/Modules/YMMine/View/SubViews/MineInfo/XPMineUserInfoEditPickView.m @@ -88,9 +88,11 @@ } } -(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component{ - - self.area = self.dataArray[row]; - [pickerView reloadAllComponents]; + if(row < self.dataArray.count){ + self.area = self.dataArray[row]; + [pickerView reloadAllComponents]; + } + } #pragma mark - Private Method - (void)initSubViews { diff --git a/YuMi/Modules/YMNewHome/View/CustomView/XPNewHomeItemCell.m b/YuMi/Modules/YMNewHome/View/CustomView/XPNewHomeItemCell.m index 812e6ebe..7f61d143 100644 --- a/YuMi/Modules/YMNewHome/View/CustomView/XPNewHomeItemCell.m +++ b/YuMi/Modules/YMNewHome/View/CustomView/XPNewHomeItemCell.m @@ -29,7 +29,12 @@ } -(void)setItmeModel:(PIHomeItemModel *)itmeModel{ _itmeModel = itmeModel; - _bgImageView.imageUrl = _itmeModel.icon; + _bgImageView.layer.cornerRadius = kGetScaleWidth(12); + @kWeakify(self); + [_bgImageView loadImageWithUrl: _itmeModel.icon completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) { + @kStrongify(self); + self.bgImageView.layer.cornerRadius = kGetScaleWidth(0); + }];; } #pragma mark - 懒加载 - (NetImageView *)bgImageView{ @@ -37,6 +42,8 @@ NetImageConfig *config = [[NetImageConfig alloc]init]; config.placeHolder = [UIImageConstant defalutBannerPlaceholder]; _bgImageView = [[NetImageView alloc]initWithConfig:config]; + _bgImageView.layer.cornerRadius = kGetScaleWidth(12); + _bgImageView.layer.masksToBounds = YES; } return _bgImageView; } diff --git a/YuMi/Modules/YMNewHome/View/XPHomeRecommendViewController.m b/YuMi/Modules/YMNewHome/View/XPHomeRecommendViewController.m index e4fae903..d99a168a 100644 --- a/YuMi/Modules/YMNewHome/View/XPHomeRecommendViewController.m +++ b/YuMi/Modules/YMNewHome/View/XPHomeRecommendViewController.m @@ -64,6 +64,8 @@ UIKIT_EXTERN NSString * const kShieldingNotification; @property(nonatomic,strong)XPNewHomePartyTableViewCell *cell; ///正在播放声音的cell在UITableView的Y坐标 @property(nonatomic,assign) CGFloat cellY; +///正在播放声音的cell在UITableView的Y坐标 +@property(nonatomic,assign) CGFloat cellMinY; ///游戏列表 @property (nonatomic, strong) NSMutableArray *littleGameArray; @end @@ -85,7 +87,7 @@ UIKIT_EXTERN NSString * const kShieldingNotification; } -(void)viewDidAppear:(BOOL)animated{ [super viewDidAppear:animated]; - self.countDownHelper.delegate = self; + } @@ -93,7 +95,6 @@ UIKIT_EXTERN NSString * const kShieldingNotification; -(void)viewDidDisappear:(BOOL)animated{ [super viewDidAppear:animated]; [self.countDownHelper stopCountDown]; - self.countDownHelper.delegate = nil; [[XPSkillCardPlayerManager shareInstance] stopMusic]; if(self.cell != nil){ [self.cell setPlaySoundStatus:NO]; @@ -271,11 +272,11 @@ UIKIT_EXTERN NSString * const kShieldingNotification; if(self.cell != nil){ if(scrollView.contentOffset.y > self.cellY){ [self.countDownHelper stopCountDown]; - self.countDownHelper .delegate = nil; [[XPSkillCardPlayerManager shareInstance] stopMusic]; [self.cell setPlaySoundStatus:NO]; self.cell = nil; } + } if(self.scrollCallback){ self.scrollCallback(scrollView); @@ -482,6 +483,7 @@ UIKIT_EXTERN NSString * const kShieldingNotification; self.cell = cell; CGRect cellRect = [self.tableView rectForRowAtIndexPath:[self.tableView indexPathForCell:self.cell]]; self.cellY = cellRect.origin.y + cellRect.size.height; + self.cellMinY = (cellRect.size.height + self.tableView.frame.size.height); NSString *fileName = [[roomModel.userVoice componentsSeparatedByString:@"/"] lastObject]; NSString *filePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) safeObjectAtIndex1:0] stringByAppendingPathComponent:@"kMineSoundCard"]; NSString *fullPath = [filePath stringByAppendingPathComponent:fileName]; @@ -573,6 +575,7 @@ UIKIT_EXTERN NSString * const kShieldingNotification; - (CountDownHelper *)countDownHelper{ if (!_countDownHelper){ _countDownHelper = [[CountDownHelper alloc]init]; + _countDownHelper.delegate = self; } return _countDownHelper; } diff --git a/YuMi/Modules/YMRoom/Api/Api+Room.h b/YuMi/Modules/YMRoom/Api/Api+Room.h index cd321a64..88109eec 100644 --- a/YuMi/Modules/YMRoom/Api/Api+Room.h +++ b/YuMi/Modules/YMRoom/Api/Api+Room.h @@ -212,6 +212,15 @@ NS_ASSUME_NONNULL_BEGIN + (void)requesstShielding:(HttpRequestHelperCompletion)completion type:(NSString *)type objId:(NSString *)objId; ///得到免费礼物数据 +(void)requestFreeGiftData:(HttpRequestHelperCompletion)completion; +/// /获取已解锁照片id列表 +/// @param completion 完成 +/// @param id 相册id +/// @param roomUid 房间id ++(void)unlockRoomAlbumPhoto:(HttpRequestHelperCompletion)completion id:(NSString *)id roomUid:(NSString *)roomUid; +/// 获取已解锁照片id列表 +/// @param completion 完成 +/// @param roomUid 房间id ++(void)getUnlockRoomAlbumPhotoList:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid; @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/Api/Api+Room.m b/YuMi/Modules/YMRoom/Api/Api+Room.m index 642f0f67..e228d7eb 100644 --- a/YuMi/Modules/YMRoom/Api/Api+Room.m +++ b/YuMi/Modules/YMRoom/Api/Api+Room.m @@ -7,6 +7,7 @@ #import "Api+Room.h" #import + @implementation Api (Room) /// 获取房间信息 @@ -289,4 +290,18 @@ +(void)requestFreeGiftData:(HttpRequestHelperCompletion)completion{ [self makeRequest:@"roomFreeGift/get" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__,nil]; } +/// /解锁照片 +/// @param completion 完成 +/// @param id 相册id +/// @param roomUid 房间id ++(void)unlockRoomAlbumPhoto:(HttpRequestHelperCompletion)completion id:(NSString *)id roomUid:(NSString *)roomUid{ + [self makeRequest:@"roomAlbum/unlockPhoto" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__,id,roomUid,nil]; +} + +/// 获取已解锁照片id列表 +/// @param completion 完成 +/// @param roomUid 房间id ++(void)getUnlockRoomAlbumPhotoList:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid{ + [self makeRequest:@"roomAlbum/listUnlockPhoto" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__,roomUid,nil]; +} @end diff --git a/YuMi/Modules/YMRoom/Model/RoomInfoModel.h b/YuMi/Modules/YMRoom/Model/RoomInfoModel.h index aaf2cc64..ae5f3a0d 100644 --- a/YuMi/Modules/YMRoom/Model/RoomInfoModel.h +++ b/YuMi/Modules/YMRoom/Model/RoomInfoModel.h @@ -166,7 +166,8 @@ typedef NS_ENUM(NSInteger, RoomDatingStateChangeType) { @property (nonatomic,strong) CandyTreeSwitchModel *findLoveDrawSwitchVo; ///夺宝精灵的配置 @property(nonatomic,strong) CandyTreeSwitchModel *seizeTreasureSwitchVo; - +///是否有房间相册权限 +@property(nonatomic,assign) BOOL hasRoomAlbum; @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/Presenter/XPRoomPresenter.h b/YuMi/Modules/YMRoom/Presenter/XPRoomPresenter.h index e1f39e7b..2ffedc58 100644 --- a/YuMi/Modules/YMRoom/Presenter/XPRoomPresenter.h +++ b/YuMi/Modules/YMRoom/Presenter/XPRoomPresenter.h @@ -68,7 +68,9 @@ NS_ASSUME_NONNULL_BEGIN - (void)requesstShieldingWtihType:(NSString *)type objId:(NSString *)objId; ///获取免费礼物 -(void)getFreeGiftData; - +/// 获取已解锁照片id列表 +/// @param roomUid 房间id +-(void)getUnlockRoomAlbumPhotoListWithRoomUid:(NSString *)roomUid; @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/Presenter/XPRoomPresenter.m b/YuMi/Modules/YMRoom/Presenter/XPRoomPresenter.m index 08d0473d..9d08bad9 100644 --- a/YuMi/Modules/YMRoom/Presenter/XPRoomPresenter.m +++ b/YuMi/Modules/YMRoom/Presenter/XPRoomPresenter.m @@ -57,6 +57,18 @@ [room sendCompleted]; } fail:^(NSInteger code, NSString * _Nullable msg) { [user sendError:nil]; + if(code == 500 && [msg containsString:@"你已屏蔽該房間"]){ + TTAlertConfig *config = [[TTAlertConfig alloc]init]; + config.actionStyle = TTAlertActionConfirmStyle; + config.title = YMLocalizedString(@"XPRoomSettingViewController3"); + config.message = YMLocalizedString(@"XPRoomViewController19"); + [TTPopup alertWithConfig:config confirmHandler:^{ + + } cancelHandler:^{ + + }]; + + } } showLoading:NO errorToast:NO] uid:roomUid intoUid:uid]; } @@ -265,4 +277,11 @@ [[self getView]getFreeGiftDataSuccess:freeModel]; }]]; } +/// 获取已解锁照片id列表 +/// @param roomUid 房间id +-(void)getUnlockRoomAlbumPhotoListWithRoomUid:(NSString *)roomUid{ + [Api getUnlockRoomAlbumPhotoList:[self createHttpCompletion:^(BaseModel * _Nonnull data) { + [[self getView]getUnlockRoomAlbumPhotoListSuccessWithList:data.data]; + } showLoading:NO errorToast:NO] roomUid:roomUid]; +} @end diff --git a/YuMi/Modules/YMRoom/Protocol/XPRoomProtocol.h b/YuMi/Modules/YMRoom/Protocol/XPRoomProtocol.h index 1074784b..7dd741be 100644 --- a/YuMi/Modules/YMRoom/Protocol/XPRoomProtocol.h +++ b/YuMi/Modules/YMRoom/Protocol/XPRoomProtocol.h @@ -35,6 +35,8 @@ NS_ASSUME_NONNULL_BEGIN -(void)requesstShieldingSuccess; ///获取免费礼物成功 -(void)getFreeGiftDataSuccess:(XPFreeGiftModel *)freeModel; +///获取已解锁照片id列表 +-(void)getUnlockRoomAlbumPhotoListSuccessWithList:(NSArray *)list; @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/AnimationView/XPRoomLuckyBigPrizeView.m b/YuMi/Modules/YMRoom/View/AnimationView/XPRoomLuckyBigPrizeView.m index c665525c..71abefd3 100644 --- a/YuMi/Modules/YMRoom/View/AnimationView/XPRoomLuckyBigPrizeView.m +++ b/YuMi/Modules/YMRoom/View/AnimationView/XPRoomLuckyBigPrizeView.m @@ -60,24 +60,26 @@ - (void)setGiftInfo:(PIBaseAnimationViewModel*)giftInfo { _giftInfo = giftInfo; if (_giftInfo) { - NSString * nick = _giftInfo.nick; + NSString * nick = _giftInfo.nick ?: @""; if (nick.length > 6) { nick = [nick substringToIndex:6]; } + NSString *goldPrice = giftInfo.goldPrice ?: @""; + NSString *giftName = giftInfo.giftName ?: @""; CGFloat fontSize = 22; NSDictionary * dic = @{NSFontAttributeName:[UIFont systemFontOfSize:fontSize], NSForegroundColorAttributeName:[UIColor whiteColor]}; NSDictionary * mainDic = @{NSFontAttributeName:[UIFont systemFontOfSize:fontSize], NSForegroundColorAttributeName:[DJDKMIMOMColor appMainColor]}; NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] init]; [attributedString appendAttributedString:[[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPGiftLuckyGiftBroadcastCell0") attributes:dic]]; - if (nick) { - [attributedString appendAttributedString:[[NSMutableAttributedString alloc] initWithString:nick attributes:mainDic]]; - } + + [attributedString appendAttributedString:[[NSMutableAttributedString alloc] initWithString:nick attributes:mainDic]]; + [attributedString appendAttributedString:[[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:YMLocalizedString(@"XPRoomLuckyBigPrizeView1"),_giftInfo.luckyBagName] attributes:dic]]; - if (giftInfo.goldPrice) { - [attributedString appendAttributedString:[[NSMutableAttributedString alloc] initWithString:giftInfo.goldPrice attributes:mainDic]]; - } - [attributedString appendAttributedString:[[NSMutableAttributedString alloc] initWithString:giftInfo.giftName attributes:mainDic]]; + + [attributedString appendAttributedString:[[NSMutableAttributedString alloc] initWithString:goldPrice attributes:mainDic]]; + + [attributedString appendAttributedString:[[NSMutableAttributedString alloc] initWithString:giftName attributes:mainDic]]; NSMutableParagraphStyle *paragraphStyle = [NSMutableParagraphStyle new]; paragraphStyle.lineBreakMode = NSLineBreakByCharWrapping; paragraphStyle.alignment = NSTextAlignmentLeft; diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.h b/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.h index abe00be2..e9c85566 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.h +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageInfoModel.h @@ -6,9 +6,13 @@ // #import +#import "XPMessageRemoteExtModel.h" NS_ASSUME_NONNULL_BEGIN @interface XPMessageInfoModel : NSObject +@property(nonatomic,assign) int first; +@property(nonatomic,copy) NSDictionary * data; +@property(nonatomic,copy) NSString *nameText; ///显示文本 @property (nonatomic,strong) NSAttributedString *content; ///cell的高度 diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageRemoteExtModel.h b/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageRemoteExtModel.h index edb49516..7e1a2f89 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageRemoteExtModel.h +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/Model/XPMessageRemoteExtModel.h @@ -11,6 +11,7 @@ NS_ASSUME_NONNULL_BEGIN @interface XPMessageRemoteExtModel : NSObject + ///魅力等级 @property (nonatomic,copy) NSString *charmUrl; @property (nonatomic,assign) NSInteger erbanNo; diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m b/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m index 2aa5a7fc..161d04e1 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/Tool/XPRoomMessageParser.m @@ -144,6 +144,16 @@ return [self createStarredKitchenAttribute:attachment messageInfo:messageInfo]; }else if (first == CustomMessageType_Treasure_Fairy) { return [self createTreasureFairyAttribute:attachment messageInfo:messageInfo]; + }else if (first == CustomMessageType_Room_Album) { + NSString * uid = [AccountInfoStorage instance].getUid; + NSString * nick = [NSString stringWithFormat:@"%@:", ((NIMMessageChatroomExtension *)message.messageExt).roomNickname]; + if ([message.from isEqualToString:uid]) { + nick = YMLocalizedString(@"XPRoomMessageParser0"); + } + messageInfo.first = CustomMessageType_Room_Album; + messageInfo.nameText = nick; + messageInfo.data = attachment.data; + return messageInfo; } return nil; } diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/View/PIRoomMessagePhotoAlbumCell.h b/YuMi/Modules/YMRoom/View/MessageContainerView/View/PIRoomMessagePhotoAlbumCell.h index 527d5b4c..9e499485 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/View/PIRoomMessagePhotoAlbumCell.h +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/View/PIRoomMessagePhotoAlbumCell.h @@ -7,16 +7,21 @@ #import #import "RoomInfoModel.h" +#import "PIRoomPhotoAlbumItemModel.h" @class PIRoomMessagePhotoAlbumCell,XPNetImageYYLabel, XPMessageInfoModel,XPRoomMessageParser, YYLabel,XPMessageInfoModel; @protocol PIRoomMessagePhotoAlbumCellDelegate - (void)pIRoomMessagePhotoAlbumCellDelegateDidTapEmpty:(PIRoomMessagePhotoAlbumCell *_Nonnull)view; --(void)unlockAlbumHandleWithInfo:(XPMessageInfoModel *_Nonnull)info; +///解锁 +-(void)unlockAlbumHandleWithInfo:(PIRoomPhotoAlbumItemModel *_Nonnull)info; +///查看图片 +-(void)pIRoomMessagePhotoAlbumCell:(PIRoomMessagePhotoAlbumCell *_Nonnull)cell lookUpAlbumPhotoWithAlbumModel:(PIRoomPhotoAlbumItemModel *_Nonnull)albumModel; @end NS_ASSUME_NONNULL_BEGIN @interface PIRoomMessagePhotoAlbumCell : UITableViewCell + ///当前房间的类型 @property (nonatomic,assign) RoomType roomType; diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/View/PIRoomMessagePhotoAlbumCell.m b/YuMi/Modules/YMRoom/View/MessageContainerView/View/PIRoomMessagePhotoAlbumCell.m index 7c036096..5741507b 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/View/PIRoomMessagePhotoAlbumCell.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/View/PIRoomMessagePhotoAlbumCell.m @@ -18,6 +18,7 @@ #import "PIRoomMessagePhotoAlbumView.h" #import "XPRoomMessageConstant.h" +#import "XPSkillCardPlayerManager.h" @interface PIRoomMessagePhotoAlbumCell() ///气泡 @property (nonatomic,strong) NetImageView *bubbleImageView; @@ -31,18 +32,25 @@ @property(nonatomic,strong) PIRoomMessagePhotoAlbumView *unlockPhotoView; ///点击空白区域的手势 @property (nonatomic,strong) UITapGestureRecognizer *tapEmptyRecognizer; +@property(nonatomic,strong) PIRoomPhotoAlbumItemModel *albumModel; @end @implementation PIRoomMessagePhotoAlbumCell +-(void)dealloc{ + [[NSNotificationCenter defaultCenter]removeObserver:self]; +} -(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{ self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if(self){ [self installUI]; [self installConstraints]; + } return self; } -(void)installUI{ + [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(updateUnlockRoomAlbumPhotoList) name:@"kGetgetUnlockRoomAlbumPhotoListNot" object:nil]; + self.selectionStyle = UITableViewCellSelectionStyleNone; self.backgroundColor = [UIColor clearColor]; @@ -58,6 +66,17 @@ self.tapEmptyRecognizer = tap; [self.contentView addGestureRecognizer:self.tapEmptyRecognizer]; } +-(void)updateUnlockRoomAlbumPhotoList{ + if([[XPSkillCardPlayerManager shareInstance].photoIdList containsObject:self.albumModel.ID] && ![self.albumModel.uid isEqualToString:[AccountInfoStorage instance].getUid] && self.albumModel.type.intValue == 2) { + self.albumModel.status = 1; + self.unlockPhotoView.albumModel = self.albumModel; + }else{ + if(self.albumModel != nil){ + self.albumModel.status = 0; + self.unlockPhotoView.albumModel = self.albumModel; + } + } +} -(void)installConstraints{ [self.bubbleImageView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.top.mas_equalTo(self.contentView); @@ -147,7 +166,22 @@ - (void)setMessageInfo:(XPMessageInfoModel *)messageInfo { _messageInfo = messageInfo; if (_messageInfo) { - self.nameView.text = _messageInfo.content.string; + PIRoomPhotoAlbumItemModel *albumModel = [PIRoomPhotoAlbumItemModel modelWithDictionary:messageInfo.data[@"roomPhoto"]]; + if([[XPSkillCardPlayerManager shareInstance].photoIdList containsObject:albumModel.ID] && ![albumModel.uid isEqualToString:[AccountInfoStorage instance].getUid] && albumModel.type.intValue == 2) { + albumModel.status = 1; + }else{ + albumModel.status = 0; + } + NSDictionary *userLevel = messageInfo.data[@"userLevel"]; + if(userLevel != nil){ + NSString *charmUrl = userLevel[@"charmUrl"]; + NSString *experUrl = userLevel[@"experUrl"]; + self.charmView.imageUrl = charmUrl; + self.wealthView.imageUrl = experUrl; + } + self.albumModel = albumModel; + self.unlockPhotoView.albumModel = albumModel; + self.nameView.text = _messageInfo.nameText; if (_messageInfo.bubbleImageUrl.length) { [self.bubbleImageView loadImageWithUrl:_messageInfo.bubbleImageUrl completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) { UIImage *image1 = [UIImage imageWithCGImage:image.CGImage scale:2.0 orientation:UIImageOrientationUp]; @@ -163,9 +197,21 @@ #pragma mark - PIRoomMessagePhotoAlbumViewDelegate - (void)unlockAlbumHandle{ if(self.delegate && [self.delegate respondsToSelector:@selector(unlockAlbumHandleWithInfo:)]){ - [self.delegate unlockAlbumHandleWithInfo:self.messageInfo]; + [self.delegate unlockAlbumHandleWithInfo:self.albumModel]; } } +-(void)lookUpAlbumPhotoHandle{ + if(self.albumModel.type.intValue == 2 && ![self.albumModel.uid isEqualToString:[AccountInfoStorage instance].getUid] && self.albumModel.status == 0){ + if(self.delegate && [self.delegate respondsToSelector:@selector(unlockAlbumHandleWithInfo:)]){ + [self.delegate unlockAlbumHandleWithInfo:self.albumModel]; + } + return; + } + if(self.delegate && [self.delegate respondsToSelector:@selector(pIRoomMessagePhotoAlbumCell:lookUpAlbumPhotoWithAlbumModel:)]){ + [self.delegate pIRoomMessagePhotoAlbumCell:self lookUpAlbumPhotoWithAlbumModel:self.albumModel]; + } +} + #pragma mark - 懒加载 - (NetImageView *)bubbleImageView { if (!_bubbleImageView) { @@ -173,6 +219,7 @@ _bubbleImageView.layer.masksToBounds = YES; _bubbleImageView.layer.cornerRadius = 12; _bubbleImageView.userInteractionEnabled = YES; + } return _bubbleImageView; } diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/View/PIRoomMessagePhotoAlbumView.h b/YuMi/Modules/YMRoom/View/MessageContainerView/View/PIRoomMessagePhotoAlbumView.h index 5526409f..d92552d3 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/View/PIRoomMessagePhotoAlbumView.h +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/View/PIRoomMessagePhotoAlbumView.h @@ -6,17 +6,21 @@ // #import +#import "PIRoomPhotoAlbumItemModel.h" @protocol PIRoomMessagePhotoAlbumViewDelegate - +///解锁 -(void)unlockAlbumHandle; - +///查看图片 +-(void)lookUpAlbumPhotoHandle; @end NS_ASSUME_NONNULL_BEGIN @interface PIRoomMessagePhotoAlbumView : UIView +@property(nonatomic,strong) NSMutableArray *photoIdList; @property(nonatomic,weak) iddelegate; +@property(nonatomic,strong) PIRoomPhotoAlbumItemModel *albumModel; @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/View/PIRoomMessagePhotoAlbumView.m b/YuMi/Modules/YMRoom/View/MessageContainerView/View/PIRoomMessagePhotoAlbumView.m index dbc7149c..979c7f1a 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/View/PIRoomMessagePhotoAlbumView.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/View/PIRoomMessagePhotoAlbumView.m @@ -6,6 +6,7 @@ // #import "PIRoomMessagePhotoAlbumView.h" +#import "XPSkillCardPlayerManager.h" @interface PIRoomMessagePhotoAlbumView() ///解锁的图片 @property(nonatomic,strong) NetImageView *unlockPhotoView; @@ -33,6 +34,7 @@ return self; } -(void)installUI{ + self.backgroundColor = [UIColor clearColor]; [self addSubview:self.unlockPhotoView]; [self addSubview:self.lockedView]; @@ -44,6 +46,7 @@ [self.pi_maskView addSubview:self.pi_priceView]; [self.pi_maskView addSubview:self.unlockView]; } + -(void)installConstraints{ [self.unlockPhotoView mas_makeConstraints:^(MASConstraintMaker *make) { make.edges.equalTo(self); @@ -79,11 +82,84 @@ make.trailing.equalTo(self.unlockView.mas_leading).mas_offset(-5); }]; } +-(void)setAlbumModel:(PIRoomPhotoAlbumItemModel *)albumModel{ + _albumModel = albumModel; + + if(_albumModel.type.intValue == 1){ + self.pi_maskView.hidden = YES; + self.unlockPhotoView.imageUrl = _albumModel.photoUrl; + return; + } + + + _giftView.imageUrl = _albumModel.giftUrl; + _pi_priceView.text = _albumModel.totalGoldPrice; + self.pi_maskView.hidden = NO; + if([_albumModel.uid isEqualToString:[AccountInfoStorage instance].getUid]){ + self.unlockView.hidden = YES; + self.lockedView.hidden = YES; + self.unlockPhotoView.imageUrl = _albumModel.photoUrl; + }else{ + self.unlockView.hidden = _albumModel.status == 1; + self.lockedView.hidden = _albumModel.status == 0; + @kWeakify(self); + if(_albumModel.status == 0){ + [self.unlockPhotoView loadImageWithUrl:_albumModel.photoUrl completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) { + @kStrongify(self); + self.unlockPhotoView.image = [self setBlurImage:image]; + }]; + }else{ + self.unlockPhotoView.image = nil; + [self.unlockPhotoView loadImageWithUrl:_albumModel.photoUrl completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) { + @kStrongify(self); + self.unlockPhotoView.image = image; + }]; + } + } + +} +-(UIImage *)setBlurImage:(UIImage *)image{ + + + CIContext *context = [CIContext contextWithOptions:nil]; + CIImage * sourceImage = [CIImage imageWithCGImage:image.CGImage];//将图片转换成CIImage + + ///图片仿射滤镜 + + CIFilter * clamp = [CIFilter filterWithName:@"CIAffineClamp"];//设置绘制类型 + + [clamp setValue:sourceImage forKey:kCIInputImageKey];//设置要绘制的图片 + + CIImage *clampResult = [clamp valueForKey:kCIOutputImageKey]; + + ///高斯模糊滤镜 + + CIFilter* gaussianBlur = [CIFilter filterWithName:@"CIGaussianBlur"]; + + [gaussianBlur setValue:clampResult forKey:kCIInputImageKey]; + + [gaussianBlur setValue:[NSNumber numberWithFloat:30] forKey:@"inputRadius"];//设置模糊值 + + CIImage * gaussianBlurResult = [gaussianBlur valueForKey:kCIOutputImageKey]; + + ///转化获取图片 + + CGImageRef cgImage = [context createCGImage:gaussianBlurResult fromRect:[sourceImage extent]]; + + UIImage * resultImage = [UIImage imageWithCGImage:cgImage]; + return resultImage; + +} -(void)unlockAction{ if(self.delegate && [self.delegate respondsToSelector:@selector(unlockAlbumHandle)]){ [self.delegate unlockAlbumHandle]; } } +-(void)lookUpPhoto{ + if(self.delegate && [self.delegate respondsToSelector:@selector(lookUpAlbumPhotoHandle)]){ + [self.delegate lookUpAlbumPhotoHandle]; + } +} #pragma mark - 懒加载 - (NetImageView *)unlockPhotoView{ @@ -93,6 +169,9 @@ _unlockPhotoView = [[NetImageView alloc]initWithConfig:config]; [_unlockPhotoView setCornerWithLeftTopCorner:6 rightTopCorner:6 bottomLeftCorner:6 bottomRightCorner:6 size:CGSizeMake(138, 140)]; _unlockPhotoView.userInteractionEnabled = YES; + _unlockPhotoView.contentMode = UIViewContentModeScaleAspectFill; + UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(lookUpPhoto)]; + [_unlockPhotoView addGestureRecognizer:tap]; } return _unlockPhotoView; } diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/View/PIRoomMessageUnlockPhotoAlbumView.h b/YuMi/Modules/YMRoom/View/MessageContainerView/View/PIRoomMessageUnlockPhotoAlbumView.h index 814f07c8..030d8c17 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/View/PIRoomMessageUnlockPhotoAlbumView.h +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/View/PIRoomMessageUnlockPhotoAlbumView.h @@ -6,11 +6,20 @@ // #import +#import "PIRoomPhotoAlbumItemModel.h" + +@protocol PIRoomMessageUnlockPhotoAlbumViewDelegate + +-(void)unlockRoomAlbumImageWithAlbumModel:(PIRoomPhotoAlbumItemModel *_Nonnull)albumModel; + +@end + NS_ASSUME_NONNULL_BEGIN @interface PIRoomMessageUnlockPhotoAlbumView : UIView - +@property(nonatomic,strong) PIRoomPhotoAlbumItemModel *albumModel; +@property(nonatomic,weak) iddelegate; @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/View/PIRoomMessageUnlockPhotoAlbumView.m b/YuMi/Modules/YMRoom/View/MessageContainerView/View/PIRoomMessageUnlockPhotoAlbumView.m index 4b0e14b4..acb39348 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/View/PIRoomMessageUnlockPhotoAlbumView.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/View/PIRoomMessageUnlockPhotoAlbumView.m @@ -83,6 +83,16 @@ [TTPopup dismiss]; } -(void)unlockImageAction{ + [self dissViewAction]; + if(self.delegate && [self.delegate respondsToSelector:@selector(unlockRoomAlbumImageWithAlbumModel:)]){ + [self.delegate unlockRoomAlbumImageWithAlbumModel:self.albumModel]; + } +} +- (void)setAlbumModel:(PIRoomPhotoAlbumItemModel *)albumModel{ + _albumModel = albumModel; + _giftView.imageUrl = _albumModel.giftUrl; + _giftNumView.text = _albumModel.totalGoldPrice; + _giftNameVeiw.text = _albumModel.giftName; } #pragma mark - 懒加载 diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.h b/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.h index 2976c3c6..77e9d26a 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.h +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.h @@ -11,7 +11,6 @@ NS_ASSUME_NONNULL_BEGIN @interface XPRoomMessageContainerView : UIView - - (instancetype)initWithDelegate:(id)delegate; @end diff --git a/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.m b/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.m index 24075fc6..df758d8b 100644 --- a/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.m +++ b/YuMi/Modules/YMRoom/View/MessageContainerView/XPRoomMessageContainerView.m @@ -22,6 +22,7 @@ #import #import "ThemeColor+Room.h" #import "NSArray+Safe.h" +#import "Api+Room.h" ///Model #import "RoomInfoModel.h" #import "AttachmentModel.h" @@ -38,11 +39,13 @@ #import "View/XPRoomMessageHeaderView.h" #import "PIRoomMessagePhotoAlbumCell.h" #import "PIRoomMessageUnlockPhotoAlbumView.h" - +#import "PIRoomPhotoAlbumItemModel.h" +#import "SDPhotoBrowser.h" +#import "XPSkillCardPlayerManager.h" NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey"; -@interface XPRoomMessageContainerView () +@interface XPRoomMessageContainerView () ///房间的代理 @property (nonatomic,weak) id hostDelegate; @@ -70,6 +73,7 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey"; @property (nonatomic,strong) XPRoomMessageParser *messageParser; ///是否是大的 只有在小游戏的时候有用 @property (nonatomic,assign) BOOL isLarge; +@property(nonatomic,strong) PIRoomPhotoAlbumItemModel *lookUpModel; @end @@ -333,15 +337,14 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey"; ///执行插入动画并滚动 - (void)scrollToBottom:(BOOL)animated { - NSInteger s = [self.messageTableView numberOfSections]; //有多少组 - if (s<1) return; - NSInteger r = [self.messageTableView numberOfRowsInSection:s-1]; //最后一组行 - if (r<1) return; - NSIndexPath *ip = [NSIndexPath indexPathForRow:r-1 inSection:s-1]; //取最后一行数据 - [self.messageTableView scrollToRowAtIndexPath:ip atScrollPosition:UITableViewScrollPositionBottom animated:animated]; //滚动到最后一行 - self.atCount = 0; - self.atTipBtn.hidden = YES; - [self.locationArray removeAllObjects]; + if(self.datasource.count > 0){ + NSIndexPath *ip = [NSIndexPath indexPathForRow:self.datasource.count-1 inSection:0]; //取最后一行数据 + [self.messageTableView scrollToRowAtIndexPath:ip atScrollPosition:UITableViewScrollPositionBottom animated:animated]; //滚动到最后一行 + self.atCount = 0; + self.atTipBtn.hidden = YES; + [self.locationArray removeAllObjects]; + } + } ///自定义消息 是否可以加到 公屏 需要自己维护 @@ -376,7 +379,13 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey"; } } else if(attachment.first == CustomMessageType_Graffiti_Star_Kitchen){ return YES; - } + } else if(attachment.first == CustomMessageType_Room_Album){ + return YES; + }else if(attachment.first == CustomMessageType_Gift) { + if(attachment.data[@"isRoomAlbum"] != nil){ + return NO ; + } + } return [[[self supportMessageDic] objectForKey:@(attachment.first)] containsObject:@(attachment.second)]; } return NO; @@ -870,24 +879,30 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey"; } - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { - return 186; - XPMessageInfoModel* mesageInfo = [self.datasource safeObjectAtIndex1:indexPath.row]; - return mesageInfo.rowHeight; + XPMessageInfoModel* messageInfo = [self.datasource safeObjectAtIndex1:indexPath.row]; + + if(messageInfo.first == CustomMessageType_Room_Album){ + return 186; + } + + return messageInfo.rowHeight; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { -// XPRoomMessageTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPRoomMessageTableViewCell class])]; -// cell.delegate = self; -// XPMessageInfoModel* attr = [self.datasource safeObjectAtIndex1:indexPath.row]; -// cell.messageInfo = attr; -// cell.roomType = self.hostDelegate.getRoomInfo.type; -// return cell; - PIRoomMessagePhotoAlbumCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([PIRoomMessagePhotoAlbumCell class])]; - cell.delegate = self; XPMessageInfoModel* attr = [self.datasource safeObjectAtIndex1:indexPath.row]; - cell.messageInfo = attr; - cell.roomType = self.hostDelegate.getRoomInfo.type; - return cell; + if(attr.first == CustomMessageType_Room_Album){ + PIRoomMessagePhotoAlbumCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([PIRoomMessagePhotoAlbumCell class])]; + cell.delegate = self; + cell.messageInfo = attr; + cell.roomType = self.hostDelegate.getRoomInfo.type; + return cell; + } + XPRoomMessageTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPRoomMessageTableViewCell class])]; + cell.delegate = self; + cell.messageInfo = attr; + cell.roomType = self.hostDelegate.getRoomInfo.type; + return cell; + } @@ -904,18 +919,95 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey"; } #pragma mark - PIRoomMessagePhotoAlbumCell - (void)pIRoomMessagePhotoAlbumCellDelegateDidTapEmpty:(PIRoomMessagePhotoAlbumCell *)view{ -// if (self.hostDelegate.getRoomInfo.type == RoomType_MiniGame) { -// self.isLarge = !self.isLarge; -// CGFloat height = self.isLarge ? 200 : 80; -// [self mas_updateConstraints:^(MASConstraintMaker *make) { -// make.height.mas_equalTo(height); -// }]; -// } + if (self.hostDelegate.getRoomInfo.type == RoomType_MiniGame) { + self.isLarge = !self.isLarge; + CGFloat height = self.isLarge ? 200 : 80; + [self mas_updateConstraints:^(MASConstraintMaker *make) { + make.height.mas_equalTo(height); + }]; + } } --(void)unlockAlbumHandleWithInfo:(XPMessageInfoModel *_Nonnull)info{ +-(void)unlockAlbumHandleWithInfo:(PIRoomPhotoAlbumItemModel *_Nonnull)info{ PIRoomMessageUnlockPhotoAlbumView *albumView = [[PIRoomMessageUnlockPhotoAlbumView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)]; + albumView.albumModel = info; + albumView.delegate = self; [TTPopup popupView:albumView style:TTPopupStyleAlert]; } +-(void)pIRoomMessagePhotoAlbumCell:(PIRoomMessagePhotoAlbumCell *_Nonnull)cell lookUpAlbumPhotoWithAlbumModel:(PIRoomPhotoAlbumItemModel *_Nonnull)albumModel;{ + SDPhotoBrowser *browser = [[SDPhotoBrowser alloc]init]; + browser.sourceImagesContainerView = cell; + browser.delegate = self; + browser.imageCount = 1; + browser.currentImageIndex = 0; + browser.isMe = NO; + self.lookUpModel = albumModel; + [browser show]; +} +#pragma mark - PIRoomMessageUnlockPhotoAlbumViewDelegate +- (void)unlockRoomAlbumImageWithAlbumModel:(PIRoomPhotoAlbumItemModel *)albumModel{ + [XNDJTDDLoadingTool showLoading]; + [Api unlockRoomAlbumPhoto:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { + + [XNDJTDDLoadingTool hideHUD]; + if(code == 200){ + NSMutableDictionary *getData = [NSMutableDictionary dictionary]; + [getData addEntriesFromDictionary:data.data]; + AttachmentModel *attachment = [[AttachmentModel alloc] init]; + attachment.first = CustomMessageType_Gift; + attachment.second = Custom_Message_Sub_Gift_Send; + NSDictionary *targetUsers = ((NSArray *)[getData objectForKey:@"targetUsers"]).firstObject; + [getData setObject:[targetUsers valueForKeyPath:@"uid"] forKey:@"targetUid"]; + [getData setObject:[targetUsers valueForKeyPath:@"nick"] forKey:@"targetNick"]; + [getData setObject:[targetUsers valueForKeyPath:@"avatar"] forKey:@"targetAvatar"]; + [getData setObject:@(YES) forKey:@"isRoomAlbum"]; + attachment.data = getData; + [self sendCustomMessage:attachment]; + if(albumModel.ID != nil){ + if(![[XPSkillCardPlayerManager shareInstance].photoIdList containsObject:albumModel.ID]){ + if([XPSkillCardPlayerManager shareInstance].photoIdList == nil){ + [XPSkillCardPlayerManager shareInstance].photoIdList = [NSMutableArray arrayWithArray:@[albumModel.ID]]; + }else{ + [[XPSkillCardPlayerManager shareInstance].photoIdList addObject:albumModel.ID]; + } + } + [[NSNotificationCenter defaultCenter]postNotificationName:@"kGetgetUnlockRoomAlbumPhotoListNot" object:nil]; + } + return; + } + [XNDJTDDLoadingTool showErrorWithMessage:msg]; + } id:albumModel.ID roomUid:@(self.hostDelegate.getRoomInfo.uid).stringValue]; +} +- (void)sendCustomMessage:(AttachmentModel *)attachment { + + NSString *sessionID = [NSString stringWithFormat:@"%ld", [self.hostDelegate getRoomInfo].roomId]; + NIMMessage *message = [[NIMMessage alloc]init]; + NIMCustomObject *object = [[NIMCustomObject alloc] init]; + object.attachment = attachment; + message.messageObject = object; + + UserInfoModel *userInfo = [self.hostDelegate getUserInfo]; + XPMessageRemoteExtModel *extModel = [[XPMessageRemoteExtModel alloc] init]; + extModel.androidBubbleUrl = userInfo.androidBubbleUrl; + extModel.iosBubbleUrl = userInfo.iosBubbleUrl; + extModel.fromSayHelloChannel = userInfo.fromSayHelloChannel; + NSMutableDictionary *remoteExt = [NSMutableDictionary dictionaryWithObject:extModel.model2dictionary forKey:[NSString stringWithFormat:@"%ld", userInfo.uid]]; + message.remoteExt = remoteExt; + NIMSessionType sessionType = NIMSessionTypeChatroom; + //构造会话 + NIMSession *session = [NIMSession session:sessionID type:sessionType]; + [[NIMSDK sharedSDK].chatManager sendMessage:message toSession:session error:nil]; +} + +#pragma mark - SDPhotoBrowserDelegate +- (NSURL *)photoBrowser:(SDPhotoBrowser *)browser highQualityImageURLForIndex:(NSInteger)index{ + if(self.lookUpModel != nil){ + return [[NSURL alloc]initWithString:self.lookUpModel.photoUrl]; + } + return nil; +} +- (UIImage *)photoBrowser:(SDPhotoBrowser *)browser placeholderImageForIndex:(NSInteger)index { + return [UIImageConstant defalutBannerPlaceholder]; +} #pragma mark - Getters And Setters - (UITableView *)messageTableView { if (!_messageTableView) { diff --git a/YuMi/Modules/YMRoom/View/MoreView/Presenter/XPMoreMenuPresenter.m b/YuMi/Modules/YMRoom/View/MoreView/Presenter/XPMoreMenuPresenter.m index 362ea37d..1bbb4879 100644 --- a/YuMi/Modules/YMRoom/View/MoreView/Presenter/XPMoreMenuPresenter.m +++ b/YuMi/Modules/YMRoom/View/MoreView/Presenter/XPMoreMenuPresenter.m @@ -203,7 +203,9 @@ } [array addObject:report]; - [array addObject:roomPhotoAlbum]; + if(roomInfo.hasRoomAlbum == YES){ + [array insertObject:roomPhotoAlbum atIndex:1]; + } [[self getView] getMoreMenuDataSuccess:array]; }]; } diff --git a/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/Api/Api+PhotoAlbum.h b/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/Api/Api+PhotoAlbum.h new file mode 100644 index 00000000..d5c1c1a5 --- /dev/null +++ b/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/Api/Api+PhotoAlbum.h @@ -0,0 +1,40 @@ +// +// Api+PhotoAlbum.h +// YuMi +// +// Created by duoban on 2023/10/16. +// + +#import "Api.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface Api (PhotoAlbum) +///获取已上传图片 +/// - Parameters: +/// - completion: 完成 +/// - roomUid: 房间id +/// - type: null=全部,1=普通,2=礼物解锁 ++ (void)getRoomAlbumList:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid page:(NSString *)page pageSize:(NSString *)pageSize uid:(NSString *)uid ticket:(NSString *)ticket type:(NSString *_Nullable)type; +/// 上传房间房间图片 +/// - Parameters: +/// - completion: 完成 +/// - giftId: 当type=2时传入礼物id +/// - photoUrls: 照片数组 +/// - roomUid: 房间UId +/// - type:类型 1=普通,2=礼物解锁 ++(void)uploadRoomAlbumList:(HttpRequestHelperCompletion)completion photoUrls:(NSString *)photoUrls roomUid:(NSString *)roomUid uid:(NSString *)uid ticket:(NSString *)ticket type:(NSString *)type giftId:(NSString *_Nullable)giftId; + +/// 删除房间图片 +/// - Parameters: +/// - completion: 完成 +/// - photoId: 图片id ++(void)deleteRoomAlbumPhoto:(HttpRequestHelperCompletion)completion id:(NSString *)id; +/// 发送房间图片 +/// - Parameters: +/// - completion: 完成 +/// - photoId: 图片id ++(void)sendRoomAlbumPhoto:(HttpRequestHelperCompletion)completion id:(NSString *)id roomUid:(NSString *)roomUid; +@end + +NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/Api/Api+PhotoAlbum.m b/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/Api/Api+PhotoAlbum.m new file mode 100644 index 00000000..b745d132 --- /dev/null +++ b/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/Api/Api+PhotoAlbum.m @@ -0,0 +1,55 @@ +// +// Api+PhotoAlbum.m +// YuMi +// +// Created by duoban on 2023/10/16. +// + +#import "Api+PhotoAlbum.h" + + +@implementation Api (PhotoAlbum) + +///获取已上传图片 +/// - Parameters: +/// - completion: 完成 +/// - roomUid: 房间id +/// - type: null=全部,1=普通,2=礼物解锁 ++ (void)getRoomAlbumList:(HttpRequestHelperCompletion)completion roomUid:(NSString *)roomUid page:(NSString *)page pageSize:(NSString *)pageSize uid:(NSString *)uid ticket:(NSString *)ticket type:(NSString *_Nullable)type{ + + + [self makeRequest:@"roomAlbum/pagePhoto" method:HttpRequestHelperMethodGET completion:completion,__FUNCTION__,roomUid,page,pageSize,uid,ticket,type, nil]; +} + +/// 上传房间房间图片 +/// - Parameters: +/// - completion: 完成 +/// - giftId: 当type=2时传入礼物id +/// - photoUrls: 照片数组 +/// - roomUid: 房间UId +/// - type:类型 1=普通,2=礼物解锁 ++(void)uploadRoomAlbumList:(HttpRequestHelperCompletion)completion photoUrls:(NSString *)photoUrls roomUid:(NSString *)roomUid uid:(NSString *)uid ticket:(NSString *)ticket type:(NSString *)type giftId:(NSString *_Nullable)giftId{ + + if(giftId != nil){ + [self makeRequest:@"roomAlbum/upload" method:HttpRequestHelperMethodPOST completion:completion,__FUNCTION__,photoUrls,roomUid,uid,ticket,type,giftId, nil]; + return; + } + [self makeRequest:@"roomAlbum/upload" method:HttpRequestHelperMethodPOST completion:completion,__FUNCTION__,photoUrls,roomUid,uid,ticket,type, nil]; + +} +/// 删除房间图片 +/// - Parameters: +/// - completion: 完成 +/// - photoId: 图片id ++(void)deleteRoomAlbumPhoto:(HttpRequestHelperCompletion)completion id:(NSString *)id{ + + [self makeRequest:@"roomAlbum/delete" method:HttpRequestHelperMethodPOST completion:completion,__FUNCTION__,id, nil]; +} +/// 发送房间图片 +/// - Parameters: +/// - completion: 完成 +/// - photoId: 图片id ++(void)sendRoomAlbumPhoto:(HttpRequestHelperCompletion)completion id:(NSString *)id roomUid:(NSString *)roomUid{ + [self makeRequest:@"roomAlbum/sendPhoto" method:HttpRequestHelperMethodPOST completion:completion,__FUNCTION__,id,roomUid, nil]; +} +@end diff --git a/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/Model/PIRoomPhotoAlbumItemModel.h b/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/Model/PIRoomPhotoAlbumItemModel.h new file mode 100644 index 00000000..e6b89d17 --- /dev/null +++ b/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/Model/PIRoomPhotoAlbumItemModel.h @@ -0,0 +1,28 @@ +// +// PIRoomPhotoAlbumItemModel.h +// YuMi +// +// Created by duoban on 2023/10/16. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface PIRoomPhotoAlbumItemModel : NSObject +@property(nonatomic,copy) NSString *giftName; +@property(nonatomic,copy) NSString *giftId; +@property(nonatomic,copy) NSString *giftNum; +@property(nonatomic,copy) NSString *giftUrl; +@property(nonatomic,copy) NSString *ID; +@property(nonatomic,copy) NSString *photoUrl; +@property(nonatomic,copy) NSString *roomUid; +//1=普通,2=礼物解锁 +@property(nonatomic,copy) NSString *type; +///1=可以看,0=高斯模糊 +@property(nonatomic,assign) int status; +@property(nonatomic,copy) NSString *uid; +@property(nonatomic,copy) NSString *totalGoldPrice; +@end + +NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/Model/PIRoomPhotoAlbumItemModel.m b/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/Model/PIRoomPhotoAlbumItemModel.m new file mode 100644 index 00000000..e2f2d219 --- /dev/null +++ b/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/Model/PIRoomPhotoAlbumItemModel.m @@ -0,0 +1,15 @@ +// +// PIRoomPhotoAlbumItemModel.m +// YuMi +// +// Created by duoban on 2023/10/16. +// + +#import "PIRoomPhotoAlbumItemModel.h" + +@implementation PIRoomPhotoAlbumItemModel +///如果一个模型中需要字段映射的话 比如id -> ID name -> other.name ++ (NSDictionary *)replacedKeyFromPropertyName { + return @{@"ID":@"id"}; +} +@end diff --git a/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/Presenter/PIRoomPhotoAlbumItemPresenter.h b/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/Presenter/PIRoomPhotoAlbumItemPresenter.h new file mode 100644 index 00000000..0d1af01b --- /dev/null +++ b/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/Presenter/PIRoomPhotoAlbumItemPresenter.h @@ -0,0 +1,35 @@ +// +// PIRoomPhotoAlbumItemPresenter.h +// YuMi +// +// Created by duoban on 2023/10/16. +// + +#import +#import "BaseMvpPresenter.h" +#import "Api+PhotoAlbum.h" +NS_ASSUME_NONNULL_BEGIN + + +@interface PIRoomPhotoAlbumItemPresenter : BaseMvpPresenter +///获取已上传图片 +/// - Parameters: +/// - roomUid: 房间id +/// - type: null=全部,1=普通,2=礼物解锁 +- (void)getRoomAlbumListWithroomUid:(NSString *)roomUid type:(NSString *_Nullable)type page:(NSString *)page pageSize:(NSString *)pageSize; +/// 上传房间房间图片 +/// - Parameters: +/// - giftId: 当type=2时传入礼物id +/// - photoUrls: 照片数组 +/// - roomUid: 房间UId +/// - type:类型 1=普通,2=礼物解锁 +-(void)uploadRoomAlbumListWithGiftId:(NSString *_Nullable)giftId photoUrls:(NSArray *)photoUrls roomUid:(NSString *)roomUid type:(NSString *)type; +///删除房间相册 +-(void)deleteRoomAlbumPhotoWithId:(NSString *)id; +/// 发送房间图片 +/// - Parameters: +/// - photoId: 图片id +-(void)sendRoomAlbumPhotoWithId:(NSString *)id roomUid:(NSString *)roomUid; +@end + +NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/Presenter/PIRoomPhotoAlbumItemPresenter.m b/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/Presenter/PIRoomPhotoAlbumItemPresenter.m new file mode 100644 index 00000000..bbf8b193 --- /dev/null +++ b/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/Presenter/PIRoomPhotoAlbumItemPresenter.m @@ -0,0 +1,69 @@ +// +// PIRoomPhotoAlbumItemPresenter.m +// YuMi +// +// Created by duoban on 2023/10/16. +// + +#import "PIRoomPhotoAlbumItemPresenter.h" +#import "PIRoomPhotoAlbumItemProtocol.h" +#import "PIRoomPhotoAlbumItemModel.h" + +@implementation PIRoomPhotoAlbumItemPresenter +///获取已上传图片 +/// - Parameters: +/// - roomUid: 房间id +/// - type: null=全部,1=普通,2=礼物解锁 +- (void)getRoomAlbumListWithroomUid:(NSString *)roomUid type:(NSString *_Nullable)type page:(NSString *)page pageSize:(NSString *)pageSize{ + NSString * uid = [AccountInfoStorage instance].getUid; + NSString * ticket = [AccountInfoStorage instance].getTicket; + [Api getRoomAlbumList:[self createHttpCompletion:^(BaseModel * _Nonnull data) { + NSArray *list = [PIRoomPhotoAlbumItemModel modelsWithArray:data.data]; + [[self getView]getRoomAlbumListSuccessWithList:list]; + }fail:^(NSInteger code, NSString * _Nullable msg) { + [[self getView]getRoomAlbumListFail]; + } showLoading:NO errorToast:YES] roomUid:roomUid page:page pageSize:pageSize uid:uid ticket:ticket type:type] ; + +} +/// 上传房间房间图片 +/// - Parameters: +/// - giftId: 当type=2时传入礼物id +/// - photoUrls: 照片数组 +/// - roomUid: 房间UId +/// - type:类型 1=普通,2=礼物解锁 +-(void)uploadRoomAlbumListWithGiftId:(NSString *_Nullable)giftId photoUrls:(NSArray *)photoUrls roomUid:(NSString *)roomUid type:(NSString *)type{ + NSString * uid = [AccountInfoStorage instance].getUid; + NSString * ticket = [AccountInfoStorage instance].getTicket; + NSString *photoUrl = @""; + for (NSString *getUrl in photoUrls) { + if(photoUrl.length > 0){ + photoUrl = [NSString stringWithFormat:@"%@,%@",photoUrl,getUrl]; + }else{ + photoUrl = getUrl; + } + } + [Api uploadRoomAlbumList:[self createHttpCompletion:^(BaseModel * _Nonnull data) { + [[self getView]uploadRoomAlbumListSuccess]; + } fail:^(NSInteger code, NSString * _Nullable msg) { + [[self getView]uploadRoomAlbumListFail]; + } showLoading:NO errorToast:YES] photoUrls:photoUrl roomUid:roomUid uid:uid ticket:ticket type:type giftId:giftId]; +} +///删除房间相册 +-(void)deleteRoomAlbumPhotoWithId:(NSString *)id{ + [Api deleteRoomAlbumPhoto:[self createHttpCompletion:^(BaseModel * _Nonnull data) { + [[self getView]deleteRoomAlbumPhotoSuccessWithPhotoId:id]; + } fail:^(NSInteger code, NSString * _Nullable msg) { + + } showLoading:YES errorToast:YES] id:id]; +} +/// 发送房间图片 +/// - Parameters: +/// - photoId: 图片id +-(void)sendRoomAlbumPhotoWithId:(NSString *)id roomUid:(NSString *)roomUid{ + [Api sendRoomAlbumPhoto:[self createHttpCompletion:^(BaseModel * _Nonnull data) { + [[self getView]sendRoomAlbumPhotoSuccess]; + } fail:^(NSInteger code, NSString * _Nullable msg) { + [[self getView]sendRoomAlbumPhotoFail]; + } showLoading:NO errorToast:YES] id:id roomUid:roomUid]; +} +@end diff --git a/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/Protocol/PIRoomPhotoAlbumItemProtocol.h b/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/Protocol/PIRoomPhotoAlbumItemProtocol.h new file mode 100644 index 00000000..11fad82d --- /dev/null +++ b/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/Protocol/PIRoomPhotoAlbumItemProtocol.h @@ -0,0 +1,29 @@ +// +// PIRoomPhotoAlbumItemProtocol.h +// YuMi +// +// Created by duoban on 2023/10/16. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@protocol PIRoomPhotoAlbumItemProtocol +///获取已上传图片 +-(void)getRoomAlbumListSuccessWithList:(NSArray *)list; +///获取已上传图片失败 +-(void)getRoomAlbumListFail; +///上传房间图片成功 +-(void)uploadRoomAlbumListSuccess; +///上传房间图片失败 +-(void)uploadRoomAlbumListFail; +///删除房间图片成功 +-(void)deleteRoomAlbumPhotoSuccessWithPhotoId:(NSString *)photoId; +///发送图片成功 +-(void)sendRoomAlbumPhotoSuccess; +///发送图片失败 +-(void)sendRoomAlbumPhotoFail; +@end + +NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/View/Cell/PIRoomPhotoAlbumItemCell.h b/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/View/Cell/PIRoomPhotoAlbumItemCell.h index 830d2971..8df9e190 100644 --- a/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/View/Cell/PIRoomPhotoAlbumItemCell.h +++ b/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/View/Cell/PIRoomPhotoAlbumItemCell.h @@ -6,10 +6,11 @@ // #import +#import "PIRoomPhotoAlbumItemModel.h" @class PIRoomPhotoAlbumItemCell; @protocol PIRoomPhotoAlbumItemCellDelegate --(void)pIRoomPhotoAlbumItemCell:(PIRoomPhotoAlbumItemCell *_Nonnull)cell clickMornWithModel:(id _Nonnull )model; +-(void)pIRoomPhotoAlbumItemCell:(PIRoomPhotoAlbumItemCell *_Nonnull)cell clickMornWithModel:(PIRoomPhotoAlbumItemModel *_Nonnull )model; @end @@ -18,6 +19,7 @@ NS_ASSUME_NONNULL_BEGIN @interface PIRoomPhotoAlbumItemCell : UICollectionViewCell @property(nonatomic,weak) iddelegate; +@property(nonatomic,strong) PIRoomPhotoAlbumItemModel *albumModel; @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/View/Cell/PIRoomPhotoAlbumItemCell.m b/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/View/Cell/PIRoomPhotoAlbumItemCell.m index 1003306d..6636766f 100644 --- a/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/View/Cell/PIRoomPhotoAlbumItemCell.m +++ b/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/View/Cell/PIRoomPhotoAlbumItemCell.m @@ -75,6 +75,42 @@ make.top.mas_equalTo(kGetScaleWidth(54)); }]; } +-(void)setAlbumModel:(PIRoomPhotoAlbumItemModel *)albumModel{ + _albumModel = albumModel; + @kWeakify(self); + self.coverView.hidden = _albumModel.type.intValue == 1; + self.operateBtn.hidden = ![_albumModel.uid isEqualToString:[AccountInfoStorage instance].getUid]; + if(_albumModel.type.intValue == 2){ + _pi_priceView.text = _albumModel.totalGoldPrice; + _lockView.hidden = _albumModel.status == 1; + _giftView.imageUrl = _albumModel.giftUrl; + + if(_albumModel.status == 0){ + + [self.bgImageView loadImageWithUrl:_albumModel.photoUrl completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) { + @kStrongify(self); + self.bgImageView.image = [self setBlurImage:image]; + }]; + }else{ + self.bgImageView.image = nil; + [self.bgImageView loadImageWithUrl:_albumModel.photoUrl completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) { + @kStrongify(self); + self.bgImageView.image = image; + }]; + + } + }else{ + _lockView.hidden = YES; + _pi_priceView.text = _albumModel.totalGoldPrice; + self.bgImageView.image = nil; + [self.bgImageView loadImageWithUrl:_albumModel.photoUrl completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) { + @kStrongify(self); + self.bgImageView.image = image; + }]; + _giftView.image = nil; + } + +} -(UIImage *)setBlurImage:(UIImage *)image{ @@ -95,7 +131,7 @@ [gaussianBlur setValue:clampResult forKey:kCIInputImageKey]; - [gaussianBlur setValue:[NSNumber numberWithFloat:10] forKey:@"inputRadius"];//设置模糊值 + [gaussianBlur setValue:[NSNumber numberWithFloat:30] forKey:@"inputRadius"];//设置模糊值 CIImage * gaussianBlurResult = [gaussianBlur valueForKey:kCIOutputImageKey]; @@ -109,7 +145,7 @@ } -(void)operateAction{ if(self.delegate && [self.delegate respondsToSelector:@selector(pIRoomPhotoAlbumItemCell:clickMornWithModel:)]){ - [self.delegate pIRoomPhotoAlbumItemCell:self clickMornWithModel:nil]; + [self.delegate pIRoomPhotoAlbumItemCell:self clickMornWithModel:self.albumModel]; } } #pragma mark - 懒加载 @@ -138,7 +174,7 @@ NetImageConfig *config = [[NetImageConfig alloc]init]; config.placeHolder = [UIImageConstant defaultAvatarPlaceholder]; _giftView = [[NetImageView alloc]initWithConfig:config]; - _giftView.layer.cornerRadius = kGetScaleWidth(4)/2; + _giftView.layer.cornerRadius = kGetScaleWidth(6)/2; _giftView.layer.masksToBounds = YES; _giftView.layer.borderWidth = 1; _giftView.layer.borderColor = [UIColor whiteColor].CGColor; diff --git a/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/View/PIRoomPhotoAlbumItemVC.h b/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/View/PIRoomPhotoAlbumItemVC.h index c03fe401..e3b80231 100644 --- a/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/View/PIRoomPhotoAlbumItemVC.h +++ b/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/View/PIRoomPhotoAlbumItemVC.h @@ -7,10 +7,18 @@ #import "MvpViewController.h" #import + +typedef enum : NSUInteger { + Photo_Album_Type_Mine = 0,///我上传的照片 + Photo_Album_Type_Normal,///普通照片 + Photo_Album_Type_Unlock,///解锁照片 +} PIRoomPhotoAlbumItemVCType; + NS_ASSUME_NONNULL_BEGIN @interface PIRoomPhotoAlbumItemVC : MvpViewController -@property(nonatomic,strong) NSString *roomUid; + +- (instancetype)initWithType:(PIRoomPhotoAlbumItemVCType)type roomUid:(NSString *)roomUid; @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/View/PIRoomPhotoAlbumItemVC.m b/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/View/PIRoomPhotoAlbumItemVC.m index 891fc743..e5acef3c 100644 --- a/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/View/PIRoomPhotoAlbumItemVC.m +++ b/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/View/PIRoomPhotoAlbumItemVC.m @@ -14,7 +14,10 @@ #import "Api+Mine.h" #import "MonentsPicResInfo.h" #import "PIRoomPhotoAlbumOperateView.h" -@interface PIRoomPhotoAlbumItemVC () +#import "PIRoomPhotoAlbumItemPresenter.h" +#import "PIRoomPhotoAlbumItemProtocol.h" +#import "SDPhotoBrowser.h" +@interface PIRoomPhotoAlbumItemVC () @property(nonatomic,strong) UICollectionView *collectionView; @property(nonatomic,strong) UIButton *sendImageView; @property(nonatomic,strong) NSMutableArray *photoList; @@ -26,16 +29,69 @@ @property (nonatomic,strong) NSArray *uploadImageList; ///上传的个数 @property (nonatomic,assign) int imageCount; +@property(nonatomic,assign) PIRoomPhotoAlbumItemVCType type; +@property(nonatomic,strong) NSString *roomUid; +@property(nonatomic,assign) NSInteger page; +@property(nonatomic,strong) PIRoomPhotoAlbumItemModel *lookUpModel; @end @implementation PIRoomPhotoAlbumItemVC - +-(void)dealloc{ + [[NSNotificationCenter defaultCenter]removeObserver:self]; +} +- (__kindof id)createPresenter { + return [[PIRoomPhotoAlbumItemPresenter alloc] init]; +} +- (instancetype)initWithType:(PIRoomPhotoAlbumItemVCType)type roomUid:(NSString *)roomUid{ + self = [super init]; + if(self){ + self.type = type; + self.roomUid = roomUid; + } + return self; +} - (void)viewDidLoad { [super viewDidLoad]; + [self installUI]; [self installConstraints]; + [self initHeaderAndFooterRrfresh]; +} +-(void)headerRefresh{ + self.page = 1; + if(self.type == Photo_Album_Type_Mine){ + [self.presenter getRoomAlbumListWithroomUid:self.roomUid type:@"0" page:@(self.page).stringValue pageSize:@"20"]; + return; + } + [self.presenter getRoomAlbumListWithroomUid:self.roomUid type:self.type == Photo_Album_Type_Normal ? @"1":@"2" page:@(self.page).stringValue pageSize:@"20"]; +} +-(void)footerRefresh{ + self.page++; + if(self.type == Photo_Album_Type_Mine){ + [self.presenter getRoomAlbumListWithroomUid:self.roomUid type:@"0" page:@(self.page).stringValue pageSize:@"20"]; + return; + } + [self.presenter getRoomAlbumListWithroomUid:self.roomUid type:self.type == Photo_Album_Type_Normal ? @"1":@"2" page:@(self.page).stringValue pageSize:@"20"]; +} +- (void)initHeaderAndFooterRrfresh { + MJRefreshNormalHeader *header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(headerRefresh)]; + header.stateLabel.font = [UIFont systemFontOfSize:10.0]; + header.lastUpdatedTimeLabel.font = [UIFont systemFontOfSize:10.0]; + header.stateLabel.textColor = [DJDKMIMOMColor secondTextColor]; + header.lastUpdatedTimeLabel.textColor = [DJDKMIMOMColor secondTextColor]; + self.collectionView.mj_header = header; + + MJRefreshBackNormalFooter *footer = [MJRefreshBackNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(footerRefresh)]; + footer.stateLabel.textColor = [DJDKMIMOMColor secondTextColor]; + footer.stateLabel.font = [UIFont systemFontOfSize:10.0]; + self.collectionView.mj_footer = footer; + + [self.collectionView.mj_header beginRefreshing]; + + [self headerRefresh]; } -(void)installUI{ + [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(headerRefresh) name:@"kPhotoAlbumRefreshData" object:nil]; [self.view addSubview:self.collectionView]; [self.view addSubview:self.sendImageView]; } @@ -51,6 +107,61 @@ make.bottom.mas_equalTo(-kGetScaleWidth(44)); }]; } +#pragma mark- PIRoomPhotoAlbumItemProtocol +///获取已上传图片 +-(void)getRoomAlbumListSuccessWithList:(NSArray *)list{ + if(self.page == 1){ + [self.photoList removeAllObjects]; + } + [self.collectionView.mj_header endRefreshing]; + [self.collectionView.mj_footer endRefreshing]; + if(list.count > 0){ + [self.photoList addObjectsFromArray:list]; + [self.collectionView reloadData]; + } +} +///获取已上传图片失败 +-(void)getRoomAlbumListFail{ + [self.collectionView.mj_header endRefreshing]; + [self.collectionView.mj_footer endRefreshing]; +} +///上传房间图片成功 +-(void)uploadRoomAlbumListSuccess{ + [XNDJTDDLoadingTool hideOnlyView:kWindow]; + [self headerRefresh]; + [self showSuccessToast:YMLocalizedString(@"PIRoomPhotoAlbumItemVC3")]; + PIRoomPhotoAlbumChoosePhotoView *photoView = [kWindow viewWithTag:1000001]; + [photoView dissViewAction]; + [[NSNotificationCenter defaultCenter]postNotificationName:@"kPhotoAlbumRefreshData" object:nil]; +} +///上传房间图片失败 +-(void)uploadRoomAlbumListFail{ + [XNDJTDDLoadingTool hideOnlyView:kWindow]; +} +///删除房间图片成功 +-(void)deleteRoomAlbumPhotoSuccessWithPhotoId:(NSString *)photoId{ + NSInteger index = 0; + for (int i = 0; i < self.photoList.count; i++) { + PIRoomPhotoAlbumItemModel *model = self.photoList[i]; + if([model.ID isEqualToString:photoId]){ + index = i; + break; + } + } + if(self.photoList.count > 0){ + [self.photoList removeObjectAtIndex:index]; + [self.collectionView reloadData]; + } +} +///发送图片成功 +-(void)sendRoomAlbumPhotoSuccess{ + [XNDJTDDLoadingTool hideOnlyView:kWindow]; + [self showSuccessToast:YMLocalizedString(@"XPSessionFindNewGreetListView0")]; +} +///发送图片失败 +-(void)sendRoomAlbumPhotoFail{ + [XNDJTDDLoadingTool hideOnlyView:kWindow]; +} #pragma mark -UICollectionViewDelegate,UICollectionViewDataSource - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{ if(self.photoList.count == 0)return self.collectionView.frame.size; @@ -67,6 +178,7 @@ return cell; } PIRoomPhotoAlbumItemCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([PIRoomPhotoAlbumItemCell class]) forIndexPath:indexPath]; + cell.albumModel = [self.photoList safeObjectAtIndex1:indexPath.row]; cell.delegate = self; return cell; } @@ -87,34 +199,52 @@ }]; } #pragma mark- PIRoomPhotoAlbumChoosePhotoViewDelegate +///选择相册图片 -(void)clickChoosePictures{ TZImagePickerController *imagePickerVc = [[TZImagePickerController alloc] initWithMaxImagesCount:1 delegate:self]; imagePickerVc.modalPresentationStyle = UIModalPresentationOverFullScreen; imagePickerVc.allowPickingVideo = NO; imagePickerVc.allowTakeVideo = NO; - imagePickerVc.maxImagesCount = 9; + imagePickerVc.maxImagesCount = 6; imagePickerVc.naviBgColor = [DJDKMIMOMColor appCellBackgroundColor]; imagePickerVc.naviTitleColor = [DJDKMIMOMColor mainTextColor]; imagePickerVc.barItemTextColor = [DJDKMIMOMColor mainTextColor]; imagePickerVc.selectedAssets = self.originAssets; [self presentViewController:imagePickerVc animated:YES completion:nil]; } +///删除图片 -(void)delPhotoWidthIndex:(NSInteger)index{ [self.datasource removeObjectAtIndex:index]; [self.originAssets removeObjectAtIndex:index]; } -- (void)clickUploadPictures:(NSArray *)picList{ +///返回,需要清空图片 +-(void)cleanPhotoList{ + [self.datasource removeAllObjects]; + [self.originAssets removeAllObjects]; +} +///确认上传图片 +- (void)clickUploadPictures:(NSArray *)picList giftModel:(GiftInfoModel * _Nullable)giftModel{ + if(self.datasource.count == 0){ + [self showErrorToast:YMLocalizedString(@"PIRoomPhotoAlbumItemVC2")]; + return; + } + self.imageCount = 0; - [self showLoading]; + [XNDJTDDLoadingTool showOnlyView:kWindow enabled:YES]; [self uploadAlbumPicList:self.datasource finish:^(NSArray *list) { if(list.count == 0){ - [self hideHUD]; + [XNDJTDDLoadingTool hideOnlyView:kWindow]; [self showErrorToast:YMLocalizedString(@"PIRoomPhotoAlbumItemVC1")]; return; } - + if(giftModel == nil){ + [self.presenter uploadRoomAlbumListWithGiftId:nil photoUrls:list roomUid:self.roomUid type: @"1"]; + return; + } + [self.presenter uploadRoomAlbumListWithGiftId:@(giftModel.giftId).stringValue photoUrls:list roomUid:self.roomUid type:@"2"]; }]; } +///上传图片 - (void)uploadAlbumPicList:(NSArray *)array finish:(void(^)(NSArray *list))finish { dispatch_semaphore_t semaphore = dispatch_semaphore_create(1); dispatch_queue_t queue = dispatch_get_global_queue(0, 0); @@ -129,29 +259,14 @@ [UploadImage uploadImage:image named:key token:token success:^(NSString * _Nonnull key, NSDictionary * _Nonnull resp) { dispatch_semaphore_signal(semaphore); self.imageCount ++; - NSMutableDictionary * dict= [NSMutableDictionary dictionary]; - MonentsPicResInfo * infor = [MonentsPicResInfo modelWithDictionary:resp]; - if (infor.path) { - [dict safeSetObject:infor.path forKey:@"resUrl"]; + if(resp[@"path"] != nil){ + [dataArray addObject:resp[@"path"]]; } - if (infor.format) { - [dict safeSetObject:infor.format forKey:@"format"]; - } - - if (infor.w) { - [dict safeSetObject:@(infor.w) forKey:@"width"]; - } - - if (infor.h) { - [dict safeSetObject:@(infor.h) forKey:@"height"]; - } - [dataArray addObject:dict]; if (self.imageCount == array.count) { dispatch_async(dispatch_get_main_queue(), ^{ finish(dataArray); }); } - } failure:^(NSNumber * _Nonnull resCode, NSString * _Nonnull message) { self.imageCount ++; dispatch_semaphore_signal(semaphore); @@ -179,10 +294,11 @@ } #pragma mark- PIRoomPhotoAlbumItemCellDelegate --(void)pIRoomPhotoAlbumItemCell:(PIRoomPhotoAlbumItemCell *_Nonnull)cell clickMornWithModel:(id _Nonnull )model +-(void)pIRoomPhotoAlbumItemCell:(PIRoomPhotoAlbumItemCell *_Nonnull)cell clickMornWithModel:(PIRoomPhotoAlbumItemModel *_Nonnull )model { PIRoomPhotoAlbumOperateView *operateView = [[PIRoomPhotoAlbumOperateView alloc]initWithFrame:CGRectMake(0, KScreenHeight, KScreenWidth, KScreenHeight)]; - + operateView.albumModel = model; + operateView.delegate = self; [kWindow addSubview:operateView]; [UIView animateWithDuration:0.2 animations:^{ operateView.frame = CGRectMake(0, 0, KScreenWidth, KScreenHeight); @@ -190,6 +306,57 @@ operateView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.4]; }]; } +#pragma mark- PIRoomPhotoAlbumOperateViewDelegate +- (void)clickOperateIncidentWithType:(PIRoomPhotoAlbumOperateType)type albumModel:(PIRoomPhotoAlbumItemModel *)albumModel{ + if(type == Photo_Album_Operate_Type_Send){ + TTAlertConfig *config = [[TTAlertConfig alloc]init]; + config.title = YMLocalizedString(@"XPIAPRechargeViewController7"); + config.message = YMLocalizedString(@"PIRoomPhotoAlbumItemVC5"); + [TTPopup alertWithConfig:config confirmHandler:^{ + [XNDJTDDLoadingTool showOnlyView:kWindow enabled:YES]; + [self.presenter sendRoomAlbumPhotoWithId:albumModel.ID roomUid:self.roomUid]; + } cancelHandler:^{ + + }]; + + }else if(type == Photo_Album_Operate_Type_Delete){ + TTAlertConfig *config = [[TTAlertConfig alloc]init]; + config.title = YMLocalizedString(@"XPIAPRechargeViewController7"); + config.message = YMLocalizedString(@"PIRoomPhotoAlbumItemVC4"); + [TTPopup alertWithConfig:config confirmHandler:^{ + [self.presenter deleteRoomAlbumPhotoWithId:albumModel.ID]; + } cancelHandler:^{ + + }]; + + }else{ + if(albumModel.type.intValue == 2 && ![albumModel.uid isEqualToString:[AccountInfoStorage instance].getUid] && albumModel.status == 0){ + return; + } + NSInteger row = [self.photoList indexOfObject:albumModel]; + PIRoomPhotoAlbumItemCell *cell = (PIRoomPhotoAlbumItemCell *)[self.collectionView cellForItemAtIndexPath:[NSIndexPath indexPathForRow:row inSection:0]]; + SDPhotoBrowser *browser = [[SDPhotoBrowser alloc]init]; + if(cell !=nil){ + browser.sourceImagesContainerView = cell; + } + browser.delegate = self; + browser.imageCount = 1; + browser.currentImageIndex = 0; + browser.isMe = NO; + self.lookUpModel = albumModel; + [browser show]; + } +} +#pragma mark - SDPhotoBrowserDelegate +- (NSURL *)photoBrowser:(SDPhotoBrowser *)browser highQualityImageURLForIndex:(NSInteger)index{ + if(self.lookUpModel != nil){ + return [[NSURL alloc]initWithString:self.lookUpModel.photoUrl]; + } + return nil; +} +- (UIImage *)photoBrowser:(SDPhotoBrowser *)browser placeholderImageForIndex:(NSInteger)index { + return [UIImageConstant defalutBannerPlaceholder]; +} #pragma mark - 懒加载 - (UICollectionView *)collectionView{ if (!_collectionView) { @@ -241,4 +408,10 @@ } return _originAssets; } +- (NSMutableArray *)photoList{ + if(!_photoList){ + _photoList = [NSMutableArray array]; + } + return _photoList; +} @end diff --git a/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/View/PIRoomPhotoAlbumVC.m b/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/View/PIRoomPhotoAlbumVC.m index 0eebd8a8..6ba38bf7 100644 --- a/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/View/PIRoomPhotoAlbumVC.m +++ b/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/View/PIRoomPhotoAlbumVC.m @@ -54,8 +54,7 @@ if (list) { return list; } else { - PIRoomPhotoAlbumItemVC *vc = [PIRoomPhotoAlbumItemVC new]; - vc.roomUid = self.roomUid; + PIRoomPhotoAlbumItemVC *vc = [[PIRoomPhotoAlbumItemVC alloc]initWithType:index roomUid:self.roomUid]; return vc; } } diff --git a/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/View/SubViews/PIRoomPhotoAlbumChoosePhotoView.h b/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/View/SubViews/PIRoomPhotoAlbumChoosePhotoView.h index 54486250..cca437b2 100644 --- a/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/View/SubViews/PIRoomPhotoAlbumChoosePhotoView.h +++ b/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/View/SubViews/PIRoomPhotoAlbumChoosePhotoView.h @@ -6,14 +6,16 @@ // #import - +#import "GiftInfoModel.h" @protocol PIRoomPhotoAlbumChoosePhotoViewDelegate ///上传图片 --(void)clickUploadPictures:(NSArray *_Nullable)picList; +-(void)clickUploadPictures:(NSArray *_Nullable)picList giftModel:(GiftInfoModel *_Nullable)giftModel; ///添加图片 -(void)clickChoosePictures; ///删除图片 -(void)delPhotoWidthIndex:(NSInteger)index; +///返回,需要清空图片 +-(void)cleanPhotoList; @end NS_ASSUME_NONNULL_BEGIN @@ -22,6 +24,7 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic,strong) NSString *roomUid; @property(nonatomic,weak) iddelegate; @property(nonatomic,copy) NSArray *picList; +-(void)dissViewAction; @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/View/SubViews/PIRoomPhotoAlbumChoosePhotoView.m b/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/View/SubViews/PIRoomPhotoAlbumChoosePhotoView.m index 81ad721f..8d618111 100644 --- a/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/View/SubViews/PIRoomPhotoAlbumChoosePhotoView.m +++ b/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/View/SubViews/PIRoomPhotoAlbumChoosePhotoView.m @@ -13,6 +13,7 @@ #import "PIRoomPhotoAlbumChooseGiftView.h" #import "GiftInfoModel.h" #import "SDPhotoBrowser.h" +#import "PIRoomPhotoAlbumChoosePhotoGiftView.h" @interface PIRoomPhotoAlbumChoosePhotoView () @property(nonatomic,strong) UIButton *pi_dissView; @property(nonatomic,strong) UIView *bgView; @@ -23,6 +24,7 @@ @property(nonatomic,strong) PIRoomPhotoAlbumChoosePhotoGiftView *photoGiftView; @property(nonatomic,strong) UIButton *sendPhotoView; @property(nonatomic,strong) PIRoomPhotoAlbumItemChoosePhotoModel *defaultModel; +@property(nonatomic,assign) PIRoomPhotoAlbumChoosePhotoGiftViewType chooseType; @end @implementation PIRoomPhotoAlbumChoosePhotoView @@ -35,6 +37,7 @@ return self; } -(void)installUI{ + self.chooseType = Photo_Type_Normal; [self.choosePhotoList addObject:self.defaultModel]; self.backgroundColor = [UIColor clearColor]; [self addSubview:self.pi_dissView]; @@ -116,8 +119,19 @@ return image != nil ? image : [UIImageConstant defalutBannerPlaceholder]; } -(void)clickUploadPicturesAction{ - if(self.delegate && [self.delegate respondsToSelector:@selector(clickUploadPictures:)]){ - [self.delegate clickUploadPictures:self.picList]; + if(self.chooseType == Photo_Type_Unlock){ + if(self.photoGiftView.giftModel == nil){ + [XNDJTDDLoadingTool showErrorWithMessage:YMLocalizedString(@"PIRoomPhotoAlbumChoosePhotoView1")]; + return; + } + if(self.delegate && [self.delegate respondsToSelector:@selector(clickUploadPictures:giftModel:)]){ + [self.delegate clickUploadPictures:self.picList giftModel:self.photoGiftView.giftModel]; + return; + } + return; + } + if(self.delegate && [self.delegate respondsToSelector:@selector(clickUploadPictures:giftModel:)]){ + [self.delegate clickUploadPictures:self.picList giftModel:nil]; return; } } @@ -129,7 +143,7 @@ [self.delegate delPhotoWidthIndex:index]; } [self.choosePhotoList removeObject:chooseModel]; - if(self.choosePhotoList.count < 9 && ![self.choosePhotoList containsObject:self.defaultModel]){ + if(self.choosePhotoList.count < 6 && ![self.choosePhotoList containsObject:self.defaultModel]){ [self.choosePhotoList addObject:self.defaultModel]; } [self.collectionView reloadData]; @@ -150,7 +164,7 @@ photoModel.chooseImage = _picList[i]; [self.choosePhotoList addObject:photoModel]; } - if(self.choosePhotoList.count < 9){ + if(self.choosePhotoList.count < 6){ [self.choosePhotoList addObject:self.defaultModel]; } [self.collectionView reloadData]; @@ -171,6 +185,7 @@ #pragma mark - PIRoomPhotoAlbumChoosePhotoTypeViewDelegate - (void)clickPhotoType:(PIRoomPhotoAlbumChoosePhotoGiftViewType)type{ self.photoGiftView.photoType = type; + self.chooseType = type; if(type == Photo_Type_Normal){ self.photoGiftView.chooseGiftType = Photo_Type_No_Choose_Gift; }else{ @@ -191,6 +206,9 @@ } completion:^(BOOL finished) { [self removeFromSuperview]; }]; + if(self.delegate && [self.delegate respondsToSelector:@selector(cleanPhotoList)]){ + [self.delegate cleanPhotoList]; + } } -(void)clickChooseGiftViewAction{ if(self.photoGiftView.photoType == Photo_Type_Normal)return; diff --git a/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/View/SubViews/PIRoomPhotoAlbumOperateView.h b/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/View/SubViews/PIRoomPhotoAlbumOperateView.h index c8c57e3d..db83020b 100644 --- a/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/View/SubViews/PIRoomPhotoAlbumOperateView.h +++ b/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/View/SubViews/PIRoomPhotoAlbumOperateView.h @@ -6,11 +6,24 @@ // #import +#import "PIRoomPhotoAlbumItemModel.h" +typedef enum : NSUInteger { + Photo_Album_Operate_Type_Send= 0,///发送到公屏 + Photo_Album_Operate_Type_Delete= 1,///删除 + Photo_Album_Operate_Type_Look_Up= 2,///查看大图 +} PIRoomPhotoAlbumOperateType; + +@protocol PIRoomPhotoAlbumOperateViewDelegate + +-(void)clickOperateIncidentWithType:(PIRoomPhotoAlbumOperateType)type albumModel:(PIRoomPhotoAlbumItemModel *_Nonnull)albumModel; + +@end NS_ASSUME_NONNULL_BEGIN @interface PIRoomPhotoAlbumOperateView : UIView - +@property(nonatomic,weak) iddelegate; +@property(nonatomic,strong) PIRoomPhotoAlbumItemModel *albumModel; @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/View/SubViews/PIRoomPhotoAlbumOperateView.m b/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/View/SubViews/PIRoomPhotoAlbumOperateView.m index 55deddd5..08a612f6 100644 --- a/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/View/SubViews/PIRoomPhotoAlbumOperateView.m +++ b/YuMi/Modules/YMRoom/View/RoomPhotoAlbum/View/SubViews/PIRoomPhotoAlbumOperateView.m @@ -45,6 +45,9 @@ } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ [self dissViewAction]; + if(self.delegate && [self.delegate respondsToSelector:@selector(clickOperateIncidentWithType:albumModel:)]){ + [self.delegate clickOperateIncidentWithType:indexPath.row albumModel:self.albumModel]; + } } -(void)dissViewAction{ self.backgroundColor = [UIColor clearColor]; diff --git a/YuMi/Modules/YMRoom/View/TreasureFairy/View/Cell/XPTreasureFairyShopingExchangeCell.m b/YuMi/Modules/YMRoom/View/TreasureFairy/View/Cell/XPTreasureFairyShopingExchangeCell.m index 6e5e1815..fc7e2294 100644 --- a/YuMi/Modules/YMRoom/View/TreasureFairy/View/Cell/XPTreasureFairyShopingExchangeCell.m +++ b/YuMi/Modules/YMRoom/View/TreasureFairy/View/Cell/XPTreasureFairyShopingExchangeCell.m @@ -67,12 +67,12 @@ [self.backImageView mas_makeConstraints:^(MASConstraintMaker *make) { make.edges.mas_equalTo(self.contentView); }]; - + [self.ballImaegView mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.mas_equalTo(90); - make.height.mas_equalTo(90); + make.width.mas_equalTo(70); + make.height.mas_equalTo(70); make.centerX.mas_equalTo(self.backImageView); - make.top.mas_equalTo(59.0); + make.top.mas_equalTo(55); }]; [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) { @@ -113,19 +113,21 @@ } [self.ballImaegView loadImageWithUrl:fragmemtModel.rewardPicUrl completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) { self.ballImaegView.image = image; - CGFloat width = 60; - CGFloat height = 60; - if(image.size.width < image.size.height){ - height = width * image.size.height / (image.size.width > 0 ? image.size.width : 1); - }else if (image.size.width > image.size.height){ - width = height * image.size.width / (image.size.height > 0 ? image.size.height : 1); - } - dispatch_async(dispatch_get_main_queue(), ^{ - [self.ballImaegView mas_updateConstraints:^(MASConstraintMaker *make) { - make.width.mas_equalTo(width); - make.height.mas_equalTo(height); - }]; - }); +// CGFloat width = 60; +// CGFloat height = 60; +// if(image.size.width < image.size.height){ +// width = width * image.size.height / (image.size.width > 0 ? image.size.width : 1); +// }else if (image.size.width > image.size.height){ +// height = height * image.size.width / (image.size.height > 0 ? image.size.height : 1); +// } +// dispatch_async(dispatch_get_main_queue(), ^{ +// [self.ballImaegView mas_remakeConstraints:^(MASConstraintMaker *make) { +// make.centerX.mas_equalTo(self.backImageView); +// make.top.mas_equalTo(59.0); +// make.width.mas_equalTo(width); +// make.height.mas_equalTo(height); +// }]; +// }); }]; self.pieceCountLabel.text = [NSString stringWithFormat:@"%ld",fragmemtModel.expendNum]; [self.exchangeButton setTitle:YMLocalizedString(@"XPTreasureFairyShopingExchangeCell1") forState:UIControlStateNormal]; @@ -155,8 +157,8 @@ NetImageConfig * config = [[NetImageConfig alloc]init]; config.placeHolder = [UIImageConstant defaultAvatarPlaceholder]; _ballImaegView = [[NetImageView alloc] initWithConfig:config]; -// _ballImaegView.clipsToBounds = YES; -// _ballImaegView.contentMode = UIViewContentModeScaleAspectFill; + + _ballImaegView.contentMode = UIViewContentModeScaleAspectFit; } return _ballImaegView; } diff --git a/YuMi/Modules/YMRoom/View/TreasureFairy/View/View/XPTreasureFairyDrawView.m b/YuMi/Modules/YMRoom/View/TreasureFairy/View/View/XPTreasureFairyDrawView.m index 6d9548af..cdc8fcff 100644 --- a/YuMi/Modules/YMRoom/View/TreasureFairy/View/View/XPTreasureFairyDrawView.m +++ b/YuMi/Modules/YMRoom/View/TreasureFairy/View/View/XPTreasureFairyDrawView.m @@ -333,9 +333,11 @@ - (void)setRewardInfo:(TreasureFairyInfoModel *)rewardInfo { _rewardInfo = rewardInfo; if (_rewardInfo) { + for (int i = 0; i < self.failyList.count; i++) { TreasureFairyInfoModel * info = [_failyList safeObjectAtIndex1:i]; if (info.itemIndex == _rewardInfo.itemIndex) { + self.rewardNumber = i; if (i > self.currentIndex) { self.rewardIndex = (i - self.currentIndex); @@ -343,8 +345,9 @@ self.rewardIndex = (12 - self.currentIndex) + i +1; } break; - } + } } + } } -(void)rebrushAction{ diff --git a/YuMi/Modules/YMRoom/View/UserCard/Presenter/XPUserCardPresenter.m b/YuMi/Modules/YMRoom/View/UserCard/Presenter/XPUserCardPresenter.m index 5c53dbea..bb0be8aa 100644 --- a/YuMi/Modules/YMRoom/View/UserCard/Presenter/XPUserCardPresenter.m +++ b/YuMi/Modules/YMRoom/View/UserCard/Presenter/XPUserCardPresenter.m @@ -445,7 +445,9 @@ NIMChatroomMemberKickRequest *request = [[NIMChatroomMemberKickRequest alloc] init]; request.roomId = roomId; request.userId = targetUid; - request.notifyExt = [@{@"reason":@"kick",@"account":targetUid,@"handleUid":uid} toJSONString]; + if(targetUid != nil && uid != nil){ + request.notifyExt = [@{@"reason":@"kick",@"account":targetUid,@"handleUid":uid} toJSONString]; + } [[NIMSDK sharedSDK].chatroomManager kickMember:request completion:^(NSError * _Nullable error) { [[self getView] makeKickUserFinish:error]; }]; @@ -583,7 +585,9 @@ return [RACSignal createSignal:^RACDisposable *(id subscriber) { NIMChatroomMembersByIdsRequest *request = [[NIMChatroomMembersByIdsRequest alloc]init]; request.roomId = roomId; - request.userIds = @[uid]; + if(uid != nil){ + request.userIds = @[uid]; + } [[NIMSDK sharedSDK].chatroomManager fetchChatroomMembersByIds:request completion:^(NSError * _Nullable error, NSArray * _Nullable members) { if (error == nil) { [subscriber sendNext:members.firstObject]; diff --git a/YuMi/Modules/YMRoom/View/XPRoomViewController.m b/YuMi/Modules/YMRoom/View/XPRoomViewController.m index b3f51b6b..f22865b6 100644 --- a/YuMi/Modules/YMRoom/View/XPRoomViewController.m +++ b/YuMi/Modules/YMRoom/View/XPRoomViewController.m @@ -74,6 +74,7 @@ #import "LittleGameScrollStageView.h" #import "XPRoomLittleGameContainerView.h" +UIKIT_EXTERN NSString * const kShieldingNotification; UIKIT_EXTERN NSString * const kRoomGiftEffectUpdateNotificationKey; UIKIT_EXTERN NSString * const kRoomMiniNotificationKey; UIKIT_EXTERN NSString * kNewUserRechargeKey; @@ -207,6 +208,8 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 - (void)dealloc { #warning to dox - 时刻注意这个方法 功能做完的时候删除此方法 NSLog(@"房间销毁了"); + + [XPSkillCardPlayerManager shareInstance].photoIdList = nil; [XPSkillCardPlayerManager shareInstance].isInRoomVC = NO; [XPSkillCardPlayerManager shareInstance].isInRoomFirstRecharge = NO; [XPSkillCardPlayerManager shareInstance].isInRoom = NO; @@ -252,6 +255,8 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 [self.presenter getFreeGiftData]; ///获取首充次数 [self.presenter getRoomFirstCharegWindow:self.roomUid]; + ///获取已解锁照片id列表 + [self.presenter getUnlockRoomAlbumPhotoListWithRoomUid:self.roomUid]; //监听云信消息x [[NIMSDK sharedSDK].chatroomManager addDelegate:self]; [[NIMSDK sharedSDK].chatManager addDelegate:self]; @@ -853,6 +858,11 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 -(void)requesstShieldingAction{ [self.presenter requesstShieldingWtihType:@"1" objId:[NSString stringWithFormat:@"%ld",self.roomInfo.uid]]; } +-(void)requesstShieldingSuccess{ + [self showErrorToast:YMLocalizedString(@"RoomHeaderView11")]; + [[NSNotificationCenter defaultCenter]postNotificationName:kShieldingNotification object:nil userInfo:nil]; + [self exitRoom]; +} #pragma mark - 本地礼物特效更新 - (void)myGiftEffectUpdate:(NSNotification *)notification { NSDictionary * dic = notification.object; @@ -861,6 +871,15 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 [self.roomHeaderView onRoomUpdate]; } #pragma mark - XPRoomProtocol +///获取已解锁照片id列表 +-(void)getUnlockRoomAlbumPhotoListSuccessWithList:(NSArray *)list{ + [XPSkillCardPlayerManager shareInstance].photoIdList = [NSMutableArray array]; + for (int i = 0; i < list.count; i++) { + [[XPSkillCardPlayerManager shareInstance].photoIdList addObject:[NSString stringWithFormat:@"%@",list[i]]]; + } + [[NSNotificationCenter defaultCenter]postNotificationName:@"kGetgetUnlockRoomAlbumPhotoListNot" object:nil]; +} + - (void)initEnterRoomSuccess:(RoomInfoModel *)roomInfo user:(UserInfoModel *)userInfo { [XNDJTDDLoadingTool hideHUDInView:self.navigationController.view]; [XPSkillCardPlayerManager shareInstance].roomUid = @(roomInfo.uid).stringValue; @@ -1452,7 +1471,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 } } - [self.messageContainerView handleNIMCustomMessage:message]; + [self.messageContainerView handleNIMCustomMessage:message]; } } else if(message.messageType == NIMMessageTypeText) { [self.messageContainerView handleNIMTextMessage:message]; diff --git a/YuMi/Modules/YMTabbar/View/TabbarViewController.m b/YuMi/Modules/YMTabbar/View/TabbarViewController.m index e90926c3..4a05b4f5 100644 --- a/YuMi/Modules/YMTabbar/View/TabbarViewController.m +++ b/YuMi/Modules/YMTabbar/View/TabbarViewController.m @@ -133,7 +133,7 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey; } - (void)viewDidLoad { [super viewDidLoad]; - + [self.presenter autoLogin]; [self configTheme]; diff --git a/YuMi/Structure/PrefixHeader.pch b/YuMi/Structure/PrefixHeader.pch index af325beb..437a441b 100644 --- a/YuMi/Structure/PrefixHeader.pch +++ b/YuMi/Structure/PrefixHeader.pch @@ -25,6 +25,7 @@ isEnterprise = [bundleID isEqualToString:@"com.hflighting.yumi"];\ #else #define NSLog(...) #endif +#import #import "Music+CoreDataProperties.h" #import "YUMIMacroUitls.h" #import diff --git a/YuMi/Tools/CardManager/XPSkillCardPlayerManager.h b/YuMi/Tools/CardManager/XPSkillCardPlayerManager.h index 08f46269..60658d0d 100644 --- a/YuMi/Tools/CardManager/XPSkillCardPlayerManager.h +++ b/YuMi/Tools/CardManager/XPSkillCardPlayerManager.h @@ -9,7 +9,8 @@ #import @interface XPSkillCardPlayerManager : NSObject - +////获取已解锁照片id列表 +@property(nonatomic,strong) NSMutableArray *photoIdList; ///播放器 @property (nonatomic, strong) AVAudioPlayer *player; ///是否正在播放 diff --git a/YuMi/Tools/SDPhotoBrowser/SDPhotoBrowser.m b/YuMi/Tools/SDPhotoBrowser/SDPhotoBrowser.m index a6de9401..2f73f56f 100755 --- a/YuMi/Tools/SDPhotoBrowser/SDPhotoBrowser.m +++ b/YuMi/Tools/SDPhotoBrowser/SDPhotoBrowser.m @@ -166,20 +166,23 @@ // 加载图片 - (void)setupImageOfImageViewForIndex:(NSInteger)index { - SDBrowserImageView *imageView = _scrollView.subviews[index]; - self.currentImageIndex = index; - if (imageView.hasLoadedImage) return; - if ([self highQualityImageURLForIndex:index]) { - [imageView setImageWithURL:[self highQualityImageURLForIndex:index] placeholderImage:[self placeholderImageForIndex:index]]; - } else { - if([self highQualityImageForIndex: index]){ - imageView.image = [self highQualityImageForIndex: index]; - }else{ - imageView.image = [self placeholderImageForIndex:index]; + if(index < _scrollView.subviews.count){ + SDBrowserImageView *imageView = _scrollView.subviews[index]; + self.currentImageIndex = index; + if (imageView.hasLoadedImage) return; + if ([self highQualityImageURLForIndex:index]) { + [imageView setImageWithURL:[self highQualityImageURLForIndex:index] placeholderImage:[self placeholderImageForIndex:index]]; + } else { + if([self highQualityImageForIndex: index]){ + imageView.image = [self highQualityImageForIndex: index]; + }else{ + imageView.image = [self placeholderImageForIndex:index]; + } + } - + imageView.hasLoadedImage = YES; } - imageView.hasLoadedImage = YES; + } - (void)photoClick:(UITapGestureRecognizer *)recognizer diff --git a/YuMi/zh-Hans.lproj/Localizable.strings b/YuMi/zh-Hans.lproj/Localizable.strings index a995c291..c8b440aa 100644 --- a/YuMi/zh-Hans.lproj/Localizable.strings +++ b/YuMi/zh-Hans.lproj/Localizable.strings @@ -160,7 +160,7 @@ "XPMineSettingPresent24" = "清除缓存"; "XPMineSettingPresent25" = "注销账号"; "XPMineSettingPresent26" = "修改"; - +"XPMineSettingPresent27" = "屏蔽管理"; ///XPMineUserInfoEditPresenter.m "XPMineUserInfoEditPresenter0" = "上传失败"; "XPMineUserInfoEditPresenter1" = "昵称"; @@ -3086,8 +3086,12 @@ ///PIRoomPhotoAlbumItemVC "PIRoomPhotoAlbumItemVC0"="上传照片"; "PIRoomPhotoAlbumItemVC1"="上传失败,请重新上传"; +"PIRoomPhotoAlbumItemVC2"="请选择上传的房间的照片"; +"PIRoomPhotoAlbumItemVC3"="上传成功"; +"PIRoomPhotoAlbumItemVC4"="确认将删除该照片吗?"; +"PIRoomPhotoAlbumItemVC5"="确认将该照片发送至公屏?"; ///PIRoomPhotoAlbumChoosePhotoCell -"PIRoomPhotoAlbumChoosePhotoCell0"="每次最多上传9张"; +"PIRoomPhotoAlbumChoosePhotoCell0"="每次最多上传6张"; ///PIRoomPhotoAlbumChoosePhotoTypeView "PIRoomPhotoAlbumChoosePhotoTypeView0"="照片类型"; "PIRoomPhotoAlbumChoosePhotoTypeView1"="普通照片"; @@ -3098,6 +3102,7 @@ "PIRoomPhotoAlbumChoosePhotoGiftView2"="选择解锁礼物"; ///PIRoomPhotoAlbumChoosePhotoView "PIRoomPhotoAlbumChoosePhotoView0"="确认上传"; +"PIRoomPhotoAlbumChoosePhotoView1"="请选择解锁礼物"; ///PIRoomPhotoAlbumChooseGiftView "PIRoomPhotoAlbumChooseGiftView0"="选择解锁礼物"; ///PIRoomMessagePhotoAlbumView @@ -3110,6 +3115,13 @@ "PIRoomPhotoAlbumOperateView0"="发送到公屏"; "PIRoomPhotoAlbumOperateView1"="删除照片"; "PIRoomPhotoAlbumOperateView2"="查看大图"; +///XPMaskManagerVC +"XPMaskManagerVC0"="屏蔽管理"; +"XPMaskManagerVC1"="暂无更多数据哦~"; +"XPMaskManagerVC2"="你的屏蔽列表为空哦!"; +"XPMaskManagerVC3"="解除屏蔽成功"; +///XPMaskManagerCell +"XPMaskManagerCell0"="解除屏蔽"; ///不能脚本生成的 "App_Common_And" = "和"; "App_Common_Male" = "男"; diff --git a/YuMi/zh-Hant.lproj/Localizable.strings b/YuMi/zh-Hant.lproj/Localizable.strings index 6738aaf4..3673a3e2 100644 --- a/YuMi/zh-Hant.lproj/Localizable.strings +++ b/YuMi/zh-Hant.lproj/Localizable.strings @@ -160,6 +160,7 @@ "XPMineSettingPresent24" = "清除緩存"; "XPMineSettingPresent25" = "註銷賬號"; "XPMineSettingPresent26" = "修改"; +"XPMineSettingPresent27" = "屏蔽管理"; ///XPMineUserInfoEditPresenter.m "XPMineUserInfoEditPresenter0" = "上傳失敗"; @@ -3086,8 +3087,14 @@ ///PIRoomPhotoAlbumItemVC "PIRoomPhotoAlbumItemVC0"="上傳照片"; "PIRoomPhotoAlbumItemVC1"="上傳失敗,請重新上傳"; +"PIRoomPhotoAlbumItemVC2"="請選擇上傳的房間的照片"; + +"PIRoomPhotoAlbumItemVC3"="上傳成功"; +"PIRoomPhotoAlbumItemVC4"="確認將刪除該照片嗎?"; +"PIRoomPhotoAlbumItemVC5"="確認將該照片發送至公屏?"; + ///PIRoomPhotoAlbumChoosePhotoCell -"PIRoomPhotoAlbumChoosePhotoCell0"="每次最多上傳9張"; +"PIRoomPhotoAlbumChoosePhotoCell0"="每次最多上傳6張"; ///PIRoomPhotoAlbumChoosePhotoTypeView "PIRoomPhotoAlbumChoosePhotoTypeView0"="照片類型"; "PIRoomPhotoAlbumChoosePhotoTypeView1"="普通照片"; @@ -3098,6 +3105,7 @@ "PIRoomPhotoAlbumChoosePhotoGiftView2"="選擇解鎖禮物"; ///PIRoomPhotoAlbumChoosePhotoView "PIRoomPhotoAlbumChoosePhotoView0"="確認上傳"; +"PIRoomPhotoAlbumChoosePhotoView1"="請選擇解鎖禮物"; ///PIRoomPhotoAlbumChooseGiftView "PIRoomPhotoAlbumChooseGiftView0"="選擇解鎖禮物"; ///PIRoomMessagePhotoAlbumView @@ -3110,6 +3118,15 @@ "PIRoomPhotoAlbumOperateView0"="發送到公屏"; "PIRoomPhotoAlbumOperateView1"="刪除照片"; "PIRoomPhotoAlbumOperateView2"="查看大圖"; +///XPMaskManagerVC +"XPMaskManagerVC0"="屏蔽管理"; +"XPMaskManagerVC1"="暫無更多數據哦~"; + +"XPMaskManagerVC2"="你的屏蔽列表為空哦!"; + +"XPMaskManagerVC3"="解除屏蔽成功"; +///XPMaskManagerCell +"XPMaskManagerCell0"="解除屏蔽"; ///不能腳本生成的 "App_Common_And" = "和"; "App_Common_Male" = "男";