添加首充管理功能,新增 FirstRechargeManager 和相关模型以支持首充监控;在多个模块中集成首充监控逻辑,确保在登录和页面加载时正确启动和停止监控;移除不再使用的首充相关代码,优化代码结构和可读性。
This commit is contained in:
@@ -525,6 +525,8 @@
|
||||
4C7989EC2D19392E006AE07B /* EmptyDataView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C7989EB2D19392E006AE07B /* EmptyDataView.m */; };
|
||||
4C7989EF2D195277006AE07B /* RoomModeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C7989EE2D195277006AE07B /* RoomModeViewController.m */; };
|
||||
4C7989F32D1952DA006AE07B /* RoomModePresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C7989F22D1952DA006AE07B /* RoomModePresenter.m */; };
|
||||
4C7F2A672E0BE0AB002F5058 /* FirstRechargeModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C7F2A662E0BE0AB002F5058 /* FirstRechargeModel.m */; };
|
||||
4C7F2A6B2E0BE7E7002F5058 /* FirstRechargeManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C7F2A6A2E0BE7E7002F5058 /* FirstRechargeManager.m */; };
|
||||
4C815A172CFEB758002A46A6 /* SuperBlockViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C815A162CFEB758002A46A6 /* SuperBlockViewController.m */; };
|
||||
4C85DB812DCDD83E00FD9839 /* CreateEventPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C85DB802DCDD83E00FD9839 /* CreateEventPresenter.m */; };
|
||||
4C85DB842DCDDD6800FD9839 /* CreateEventViewControllerV2.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C85DB832DCDDD6800FD9839 /* CreateEventViewControllerV2.m */; };
|
||||
@@ -806,7 +808,6 @@
|
||||
9BE01AEA2893CB4400B50299 /* XPDressSearchViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BE01AE92893CB4400B50299 /* XPDressSearchViewController.m */; };
|
||||
9BE01AED2893D0DF00B50299 /* XPDressShopSearchTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BE01AEC2893D0DF00B50299 /* XPDressShopSearchTableViewCell.m */; };
|
||||
9BE01AF02893E31700B50299 /* NewUserRechargeModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BE01AEF2893E31700B50299 /* NewUserRechargeModel.m */; };
|
||||
9BE01AF72893E7F500B50299 /* XPNewUserRechargeCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BE01AF62893E7F500B50299 /* XPNewUserRechargeCollectionViewCell.m */; };
|
||||
9BE2FA90288010D300EF3D83 /* AnchorRoomSrollTipView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BE2FA8F288010D300EF3D83 /* AnchorRoomSrollTipView.m */; };
|
||||
9BE570BC28F65B7200D491A5 /* XPMineCollectRoomCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BE570BB28F65B7200D491A5 /* XPMineCollectRoomCell.m */; };
|
||||
9BE9F0F927FED12D00667200 /* XPAnchorFansPrivilegeModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BE9F0F827FED12D00667200 /* XPAnchorFansPrivilegeModel.m */; };
|
||||
@@ -840,10 +841,6 @@
|
||||
E80B0712280D0A6700A79F63 /* FansInfoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E80B0711280D0A6700A79F63 /* FansInfoModel.m */; };
|
||||
E80B0734280D740600A79F63 /* MessageContentGuildView.m in Sources */ = {isa = PBXBuildFile; fileRef = E80B0733280D740600A79F63 /* MessageContentGuildView.m */; };
|
||||
E80CBDEA27D0C53F001E1EC2 /* XPWeakTimer.m in Sources */ = {isa = PBXBuildFile; fileRef = E80CBDE927D0C53F001E1EC2 /* XPWeakTimer.m */; };
|
||||
E80DE4072775665000BE5BCB /* XPFirstRechargeCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E80DE4062775665000BE5BCB /* XPFirstRechargeCollectionViewCell.m */; };
|
||||
E80DE40A277568D300BE5BCB /* ThemeColor+FirstRecharge.m in Sources */ = {isa = PBXBuildFile; fileRef = E80DE409277568D300BE5BCB /* ThemeColor+FirstRecharge.m */; };
|
||||
E80DE40D2775ABA500BE5BCB /* XPFirstRechargeFlowLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = E80DE40C2775ABA500BE5BCB /* XPFirstRechargeFlowLayout.m */; };
|
||||
E80DE4102775C34E00BE5BCB /* XPFirstRechargeSuccessView.m in Sources */ = {isa = PBXBuildFile; fileRef = E80DE40F2775C34E00BE5BCB /* XPFirstRechargeSuccessView.m */; };
|
||||
E80E09A92A40B70100CD2BE7 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = E80E09AB2A40B70100CD2BE7 /* Localizable.strings */; };
|
||||
E80E09AE2A41336500CD2BE7 /* XPWebViewNavView.m in Sources */ = {isa = PBXBuildFile; fileRef = E80E09AC2A41336500CD2BE7 /* XPWebViewNavView.m */; };
|
||||
E80E09B32A42071D00CD2BE7 /* XPRoomStarKitchenBannerView.m in Sources */ = {isa = PBXBuildFile; fileRef = E80E09B22A42071D00CD2BE7 /* XPRoomStarKitchenBannerView.m */; };
|
||||
@@ -1162,10 +1159,7 @@
|
||||
E8412FA92779C2ED006E1101 /* XPRoomSettingItemModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E8412FA82779C2ED006E1101 /* XPRoomSettingItemModel.m */; };
|
||||
E8412FB02779CB4D006E1101 /* XPRoomSettingPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E8412FAF2779CB4D006E1101 /* XPRoomSettingPresenter.m */; };
|
||||
E8412FB32779E285006E1101 /* Api+RoomSetting.m in Sources */ = {isa = PBXBuildFile; fileRef = E8412FB22779E285006E1101 /* Api+RoomSetting.m */; };
|
||||
E84150BB27747BAF00A7F548 /* XPFirstRechargePresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E84150BA27747BAF00A7F548 /* XPFirstRechargePresenter.m */; };
|
||||
E84150BF27747BD300A7F548 /* Api+FirstRecharge.m in Sources */ = {isa = PBXBuildFile; fileRef = E84150BE27747BD300A7F548 /* Api+FirstRecharge.m */; };
|
||||
E84150C227747BF700A7F548 /* FirstRechargeModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E84150C127747BF700A7F548 /* FirstRechargeModel.m */; };
|
||||
E84150C527747E0900A7F548 /* FirstRechargeRewardModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E84150C427747E0900A7F548 /* FirstRechargeRewardModel.m */; };
|
||||
E841ED61280FB0BD00904808 /* ContentLevelUpgradeModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E841ED60280FB0BD00904808 /* ContentLevelUpgradeModel.m */; };
|
||||
E84843AF27F59E7E0050D365 /* XPRoomPKResultView.m in Sources */ = {isa = PBXBuildFile; fileRef = E84843AE27F59E7E0050D365 /* XPRoomPKResultView.m */; };
|
||||
E84843B227F5A0740050D365 /* XPRomPKResultTitleLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = E84843B127F5A0740050D365 /* XPRomPKResultTitleLabel.m */; };
|
||||
@@ -1386,9 +1380,6 @@
|
||||
E87C0A9D27D9986700CB2241 /* XPRoomFaceCollectionFlowLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = E87C0A9C27D9986700CB2241 /* XPRoomFaceCollectionFlowLayout.m */; };
|
||||
E87C0AA027D9DE6400CB2241 /* RoomFaceSendInfoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E87C0A9F27D9DE6400CB2241 /* RoomFaceSendInfoModel.m */; };
|
||||
E87C54BE2823CC5B0051AA11 /* XPMineResetLoginPwdPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E87C54BD2823CC5B0051AA11 /* XPMineResetLoginPwdPresenter.m */; };
|
||||
E87DF4B02A429B32009C1185 /* XPFirstRechargeView.m in Sources */ = {isa = PBXBuildFile; fileRef = E87DF4AE2A429B32009C1185 /* XPFirstRechargeView.m */; };
|
||||
E87DF4B32A429C6E009C1185 /* FirstChargeRoomWindowModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E87DF4B22A429C6E009C1185 /* FirstChargeRoomWindowModel.m */; };
|
||||
E87DF4B72A42C2FD009C1185 /* XPFirstRechargeCollectionView.m in Sources */ = {isa = PBXBuildFile; fileRef = E87DF4B52A42C2FD009C1185 /* XPFirstRechargeCollectionView.m */; };
|
||||
E87DF4BF2A42C8C1009C1185 /* HomeTagModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E87DF4BE2A42C8C1009C1185 /* HomeTagModel.m */; };
|
||||
E87DF4C22A42C900009C1185 /* XPNoteView.m in Sources */ = {isa = PBXBuildFile; fileRef = E87DF4C12A42C900009C1185 /* XPNoteView.m */; };
|
||||
E87DF4CC2A42C960009C1185 /* HomeBannerInfoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E87DF4CB2A42C960009C1185 /* HomeBannerInfoModel.m */; };
|
||||
@@ -2717,6 +2708,10 @@
|
||||
4C7989EE2D195277006AE07B /* RoomModeViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RoomModeViewController.m; sourceTree = "<group>"; };
|
||||
4C7989F12D1952DA006AE07B /* RoomModePresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RoomModePresenter.h; sourceTree = "<group>"; };
|
||||
4C7989F22D1952DA006AE07B /* RoomModePresenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RoomModePresenter.m; sourceTree = "<group>"; };
|
||||
4C7F2A652E0BE0AB002F5058 /* FirstRechargeModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FirstRechargeModel.h; sourceTree = "<group>"; };
|
||||
4C7F2A662E0BE0AB002F5058 /* FirstRechargeModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FirstRechargeModel.m; sourceTree = "<group>"; };
|
||||
4C7F2A692E0BE7E7002F5058 /* FirstRechargeManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FirstRechargeManager.h; sourceTree = "<group>"; };
|
||||
4C7F2A6A2E0BE7E7002F5058 /* FirstRechargeManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FirstRechargeManager.m; sourceTree = "<group>"; };
|
||||
4C815A152CFEB758002A46A6 /* SuperBlockViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SuperBlockViewController.h; sourceTree = "<group>"; };
|
||||
4C815A162CFEB758002A46A6 /* SuperBlockViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SuperBlockViewController.m; sourceTree = "<group>"; };
|
||||
4C85DB7F2DCDD83E00FD9839 /* CreateEventPresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CreateEventPresenter.h; sourceTree = "<group>"; };
|
||||
@@ -3261,8 +3256,6 @@
|
||||
9BE01AEC2893D0DF00B50299 /* XPDressShopSearchTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPDressShopSearchTableViewCell.m; sourceTree = "<group>"; };
|
||||
9BE01AEE2893E31700B50299 /* NewUserRechargeModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NewUserRechargeModel.h; sourceTree = "<group>"; };
|
||||
9BE01AEF2893E31700B50299 /* NewUserRechargeModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NewUserRechargeModel.m; sourceTree = "<group>"; };
|
||||
9BE01AF52893E7F500B50299 /* XPNewUserRechargeCollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPNewUserRechargeCollectionViewCell.h; sourceTree = "<group>"; };
|
||||
9BE01AF62893E7F500B50299 /* XPNewUserRechargeCollectionViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPNewUserRechargeCollectionViewCell.m; sourceTree = "<group>"; };
|
||||
9BE2FA8E288010D300EF3D83 /* AnchorRoomSrollTipView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AnchorRoomSrollTipView.h; sourceTree = "<group>"; };
|
||||
9BE2FA8F288010D300EF3D83 /* AnchorRoomSrollTipView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AnchorRoomSrollTipView.m; sourceTree = "<group>"; };
|
||||
9BE570BA28F65B7200D491A5 /* XPMineCollectRoomCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineCollectRoomCell.h; sourceTree = "<group>"; };
|
||||
@@ -3334,14 +3327,6 @@
|
||||
E80B0733280D740600A79F63 /* MessageContentGuildView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MessageContentGuildView.m; sourceTree = "<group>"; };
|
||||
E80CBDE827D0C53F001E1EC2 /* XPWeakTimer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPWeakTimer.h; sourceTree = "<group>"; };
|
||||
E80CBDE927D0C53F001E1EC2 /* XPWeakTimer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPWeakTimer.m; sourceTree = "<group>"; };
|
||||
E80DE4052775665000BE5BCB /* XPFirstRechargeCollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPFirstRechargeCollectionViewCell.h; sourceTree = "<group>"; };
|
||||
E80DE4062775665000BE5BCB /* XPFirstRechargeCollectionViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPFirstRechargeCollectionViewCell.m; sourceTree = "<group>"; };
|
||||
E80DE408277568D300BE5BCB /* ThemeColor+FirstRecharge.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ThemeColor+FirstRecharge.h"; sourceTree = "<group>"; };
|
||||
E80DE409277568D300BE5BCB /* ThemeColor+FirstRecharge.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "ThemeColor+FirstRecharge.m"; sourceTree = "<group>"; };
|
||||
E80DE40B2775ABA500BE5BCB /* XPFirstRechargeFlowLayout.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPFirstRechargeFlowLayout.h; sourceTree = "<group>"; };
|
||||
E80DE40C2775ABA500BE5BCB /* XPFirstRechargeFlowLayout.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPFirstRechargeFlowLayout.m; sourceTree = "<group>"; };
|
||||
E80DE40E2775C34E00BE5BCB /* XPFirstRechargeSuccessView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPFirstRechargeSuccessView.h; sourceTree = "<group>"; };
|
||||
E80DE40F2775C34E00BE5BCB /* XPFirstRechargeSuccessView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPFirstRechargeSuccessView.m; sourceTree = "<group>"; };
|
||||
E80E09AA2A40B70100CD2BE7 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/Localizable.strings"; sourceTree = "<group>"; };
|
||||
E80E09AC2A41336500CD2BE7 /* XPWebViewNavView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XPWebViewNavView.m; sourceTree = "<group>"; };
|
||||
E80E09AD2A41336500CD2BE7 /* XPWebViewNavView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPWebViewNavView.h; sourceTree = "<group>"; };
|
||||
@@ -3811,15 +3796,8 @@
|
||||
E8412FAF2779CB4D006E1101 /* XPRoomSettingPresenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomSettingPresenter.m; sourceTree = "<group>"; };
|
||||
E8412FB12779E285006E1101 /* Api+RoomSetting.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Api+RoomSetting.h"; sourceTree = "<group>"; };
|
||||
E8412FB22779E285006E1101 /* Api+RoomSetting.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "Api+RoomSetting.m"; sourceTree = "<group>"; };
|
||||
E84150B927747BAF00A7F548 /* XPFirstRechargePresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPFirstRechargePresenter.h; sourceTree = "<group>"; };
|
||||
E84150BA27747BAF00A7F548 /* XPFirstRechargePresenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPFirstRechargePresenter.m; sourceTree = "<group>"; };
|
||||
E84150BC27747BBD00A7F548 /* XPFirstRechargeProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPFirstRechargeProtocol.h; sourceTree = "<group>"; };
|
||||
E84150BD27747BD300A7F548 /* Api+FirstRecharge.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Api+FirstRecharge.h"; sourceTree = "<group>"; };
|
||||
E84150BE27747BD300A7F548 /* Api+FirstRecharge.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "Api+FirstRecharge.m"; sourceTree = "<group>"; };
|
||||
E84150C027747BF700A7F548 /* FirstRechargeModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FirstRechargeModel.h; sourceTree = "<group>"; };
|
||||
E84150C127747BF700A7F548 /* FirstRechargeModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FirstRechargeModel.m; sourceTree = "<group>"; };
|
||||
E84150C327747E0900A7F548 /* FirstRechargeRewardModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FirstRechargeRewardModel.h; sourceTree = "<group>"; };
|
||||
E84150C427747E0900A7F548 /* FirstRechargeRewardModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FirstRechargeRewardModel.m; sourceTree = "<group>"; };
|
||||
E841ED5F280FB0BD00904808 /* ContentLevelUpgradeModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ContentLevelUpgradeModel.h; sourceTree = "<group>"; };
|
||||
E841ED60280FB0BD00904808 /* ContentLevelUpgradeModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ContentLevelUpgradeModel.m; sourceTree = "<group>"; };
|
||||
E84843AD27F59E7E0050D365 /* XPRoomPKResultView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomPKResultView.h; sourceTree = "<group>"; };
|
||||
@@ -4287,12 +4265,6 @@
|
||||
E87C54BC2823CC5B0051AA11 /* XPMineResetLoginPwdPresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineResetLoginPwdPresenter.h; sourceTree = "<group>"; };
|
||||
E87C54BD2823CC5B0051AA11 /* XPMineResetLoginPwdPresenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineResetLoginPwdPresenter.m; sourceTree = "<group>"; };
|
||||
E87C54BF2823CC940051AA11 /* XPMineResetLoginPwdProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineResetLoginPwdProtocol.h; sourceTree = "<group>"; };
|
||||
E87DF4AE2A429B32009C1185 /* XPFirstRechargeView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XPFirstRechargeView.m; sourceTree = "<group>"; };
|
||||
E87DF4AF2A429B32009C1185 /* XPFirstRechargeView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPFirstRechargeView.h; sourceTree = "<group>"; };
|
||||
E87DF4B12A429C6E009C1185 /* FirstChargeRoomWindowModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FirstChargeRoomWindowModel.h; sourceTree = "<group>"; };
|
||||
E87DF4B22A429C6E009C1185 /* FirstChargeRoomWindowModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FirstChargeRoomWindowModel.m; sourceTree = "<group>"; };
|
||||
E87DF4B52A42C2FD009C1185 /* XPFirstRechargeCollectionView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XPFirstRechargeCollectionView.m; sourceTree = "<group>"; };
|
||||
E87DF4B62A42C2FD009C1185 /* XPFirstRechargeCollectionView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPFirstRechargeCollectionView.h; sourceTree = "<group>"; };
|
||||
E87DF4BD2A42C8C1009C1185 /* HomeTagModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HomeTagModel.h; sourceTree = "<group>"; };
|
||||
E87DF4BE2A42C8C1009C1185 /* HomeTagModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HomeTagModel.m; sourceTree = "<group>"; };
|
||||
E87DF4C02A42C900009C1185 /* XPNoteView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPNoteView.h; sourceTree = "<group>"; };
|
||||
@@ -5502,6 +5474,7 @@
|
||||
189DD5A726DFA09700AB55B1 /* Tools */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
4C7F2A682E0BE7C8002F5058 /* FirstCharge */,
|
||||
4CC312212D79878B00F57A07 /* Share */,
|
||||
234F44E12B3EA4DC00E2B532 /* YMLine */,
|
||||
23CEFC082AFB8FC100576D89 /* sdkContent */,
|
||||
@@ -6857,6 +6830,15 @@
|
||||
path = RoomMode;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
4C7F2A682E0BE7C8002F5058 /* FirstCharge */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
4C7F2A692E0BE7E7002F5058 /* FirstRechargeManager.h */,
|
||||
4C7F2A6A2E0BE7E7002F5058 /* FirstRechargeManager.m */,
|
||||
);
|
||||
path = FirstCharge;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
4C886BE42E013BF7006F0BA7 /* Medals */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -7648,8 +7630,6 @@
|
||||
9BE01AF42893E7E000B50299 /* Cell */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
9BE01AF52893E7F500B50299 /* XPNewUserRechargeCollectionViewCell.h */,
|
||||
9BE01AF62893E7F500B50299 /* XPNewUserRechargeCollectionViewCell.m */,
|
||||
9BFE0D8C2898C8C300F53C24 /* XPAnchorCardSkillCollectionViewCell.h */,
|
||||
9BFE0D8D2898C8C300F53C24 /* XPAnchorCardSkillCollectionViewCell.m */,
|
||||
);
|
||||
@@ -7911,17 +7891,6 @@
|
||||
path = Timer;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
E80DE4042775663500BE5BCB /* Cell */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E80DE4052775665000BE5BCB /* XPFirstRechargeCollectionViewCell.h */,
|
||||
E80DE4062775665000BE5BCB /* XPFirstRechargeCollectionViewCell.m */,
|
||||
E80DE40B2775ABA500BE5BCB /* XPFirstRechargeFlowLayout.h */,
|
||||
E80DE40C2775ABA500BE5BCB /* XPFirstRechargeFlowLayout.m */,
|
||||
);
|
||||
path = Cell;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
E80EC74A28ACD84000D133C5 /* InputView */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -8938,48 +8907,11 @@
|
||||
E84150B027747A7400A7F548 /* FirstRecharge */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E84150B527747AAD00A7F548 /* Model */,
|
||||
E84150B427747AA400A7F548 /* Api */,
|
||||
E84150B327747A9E00A7F548 /* View */,
|
||||
E84150B227747A9500A7F548 /* Presenter */,
|
||||
E84150B127747A8D00A7F548 /* Protocol */,
|
||||
E80DE408277568D300BE5BCB /* ThemeColor+FirstRecharge.h */,
|
||||
E80DE409277568D300BE5BCB /* ThemeColor+FirstRecharge.m */,
|
||||
);
|
||||
path = FirstRecharge;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
E84150B127747A8D00A7F548 /* Protocol */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E84150BC27747BBD00A7F548 /* XPFirstRechargeProtocol.h */,
|
||||
);
|
||||
path = Protocol;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
E84150B227747A9500A7F548 /* Presenter */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E84150B927747BAF00A7F548 /* XPFirstRechargePresenter.h */,
|
||||
E84150BA27747BAF00A7F548 /* XPFirstRechargePresenter.m */,
|
||||
);
|
||||
path = Presenter;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
E84150B327747A9E00A7F548 /* View */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E87DF4B62A42C2FD009C1185 /* XPFirstRechargeCollectionView.h */,
|
||||
E87DF4B52A42C2FD009C1185 /* XPFirstRechargeCollectionView.m */,
|
||||
E87DF4AF2A429B32009C1185 /* XPFirstRechargeView.h */,
|
||||
E87DF4AE2A429B32009C1185 /* XPFirstRechargeView.m */,
|
||||
E80DE4042775663500BE5BCB /* Cell */,
|
||||
E80DE40E2775C34E00BE5BCB /* XPFirstRechargeSuccessView.h */,
|
||||
E80DE40F2775C34E00BE5BCB /* XPFirstRechargeSuccessView.m */,
|
||||
);
|
||||
path = View;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
E84150B427747AA400A7F548 /* Api */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -8989,19 +8921,6 @@
|
||||
path = Api;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
E84150B527747AAD00A7F548 /* Model */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E84150C027747BF700A7F548 /* FirstRechargeModel.h */,
|
||||
E84150C127747BF700A7F548 /* FirstRechargeModel.m */,
|
||||
E84150C327747E0900A7F548 /* FirstRechargeRewardModel.h */,
|
||||
E84150C427747E0900A7F548 /* FirstRechargeRewardModel.m */,
|
||||
E87DF4B12A429C6E009C1185 /* FirstChargeRoomWindowModel.h */,
|
||||
E87DF4B22A429C6E009C1185 /* FirstChargeRoomWindowModel.m */,
|
||||
);
|
||||
path = Model;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
E84A2E7E2A527DF800D6AF8A /* IncomeRecord */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -10231,6 +10150,8 @@
|
||||
4CCB809E2DD5DFDF00C756D3 /* EventRoomModel.m */,
|
||||
4C3851972DD5F4D50089CFCC /* EventConfigModel.h */,
|
||||
4C3851982DD5F4D50089CFCC /* EventConfigModel.m */,
|
||||
4C7F2A652E0BE0AB002F5058 /* FirstRechargeModel.h */,
|
||||
4C7F2A662E0BE0AB002F5058 /* FirstRechargeModel.m */,
|
||||
);
|
||||
path = Model;
|
||||
sourceTree = "<group>";
|
||||
@@ -12271,7 +12192,6 @@
|
||||
E89D60BD271D647A001F8895 /* XPRoomPresenter.m in Sources */,
|
||||
E8751E5C28A62A530056EF44 /* XPSailingViewController.m in Sources */,
|
||||
9B7D904D287BC5E20033A45E /* AnchorRoomScrollView.m in Sources */,
|
||||
E80DE4072775665000BE5BCB /* XPFirstRechargeCollectionViewCell.m in Sources */,
|
||||
238B37D12AC55A2C00BFC9D5 /* XPTreasureFairyShopingRecordSubView.m in Sources */,
|
||||
E8899C822785A694007944BE /* DatingInfoModel.m in Sources */,
|
||||
9BB89DC327FE7F3A00586A83 /* XPAnchorFansRelationModel.m in Sources */,
|
||||
@@ -12318,7 +12238,6 @@
|
||||
2320F63C2BDF738E00227EEB /* MSRoomMenuGameCell.m in Sources */,
|
||||
E824543D26F58C3A00BE8163 /* XPLoginBindSuccessView.m in Sources */,
|
||||
E85E7B282A4EB0D300B6D00A /* XPClanMenuView.m in Sources */,
|
||||
9BE01AF72893E7F500B50299 /* XPNewUserRechargeCollectionViewCell.m in Sources */,
|
||||
E81125C7296E596D000D9804 /* QInputPhototCell.m in Sources */,
|
||||
545831A62C2C085C00364026 /* ArabMicroView.m in Sources */,
|
||||
E8EEB8F726FC2673007C6EBA /* UserPhoto.m in Sources */,
|
||||
@@ -12336,7 +12255,6 @@
|
||||
9BD8D4E328911E9900AE03FF /* XPMineCollectRoomListViewController.m in Sources */,
|
||||
2331C1732A5EB71000E1D940 /* XPNoblePrivilegeCell.m in Sources */,
|
||||
9B2EA7C628041EFC00ED17BF /* XPAnchorPkPanelView.m in Sources */,
|
||||
E84150BB27747BAF00A7F548 /* XPFirstRechargePresenter.m in Sources */,
|
||||
4C6E1F752CEAEC3C0073D0A3 /* ShoppingMallTagView.m in Sources */,
|
||||
E8A88D2D27E81E8700CA8837 /* RoomPKChooseUserModel.m in Sources */,
|
||||
E82325F9274E2E42003A3332 /* Api+UserCard.m in Sources */,
|
||||
@@ -12398,6 +12316,7 @@
|
||||
E87E62682A3F571D002F68C9 /* XPHomeContainerPresenter.m in Sources */,
|
||||
E8EEB8F326FC2050007C6EBA /* SDWaitingView.m in Sources */,
|
||||
E85E7B2F2A4EB0D300B6D00A /* XPGoldIncomeSectionView.m in Sources */,
|
||||
4C7F2A672E0BE0AB002F5058 /* FirstRechargeModel.m in Sources */,
|
||||
54F469382C29C3B400A83655 /* XPMineAlbumTableViewCell.m in Sources */,
|
||||
23E9EAA12A84C53900B792F2 /* TTNewAlertView.m in Sources */,
|
||||
238B37BC2AC55A2C00BFC9D5 /* XPTreasureFairySendView.m in Sources */,
|
||||
@@ -12487,7 +12406,6 @@
|
||||
E8AC723526F49939007D6E91 /* XPMineNotificaPresenter.m in Sources */,
|
||||
1427218E29A75F6F00C7C423 /* HTTPMessage.m in Sources */,
|
||||
239D0FE72C049D61002977CE /* MSRoomGameMsgView.m in Sources */,
|
||||
E80DE40A277568D300BE5BCB /* ThemeColor+FirstRecharge.m in Sources */,
|
||||
238B37BE2AC55A2C00BFC9D5 /* XPTreasureFairyBottomView.m in Sources */,
|
||||
9B42869828C1E06B009034D2 /* XPRedPacketModel.m in Sources */,
|
||||
233423D62AB0397500B1253F /* PIMessageContentServiceReplyView.m in Sources */,
|
||||
@@ -12557,7 +12475,6 @@
|
||||
E84B0E3F2727EDF6008818C6 /* XPRoomMessageTableViewCell.m in Sources */,
|
||||
E82325FC274E4735003A3332 /* XPUserCardItemModel.m in Sources */,
|
||||
E8C1CD6627D88EF800376F83 /* XPRoomFaceViewController.m in Sources */,
|
||||
E80DE4102775C34E00BE5BCB /* XPFirstRechargeSuccessView.m in Sources */,
|
||||
E8412FB32779E285006E1101 /* Api+RoomSetting.m in Sources */,
|
||||
23CEFC4A2AFB8FC100576D89 /* BSNSStringUtil.m in Sources */,
|
||||
9B2F72D028E45A480000E4FA /* XPRoomQuickMessageContainView.m in Sources */,
|
||||
@@ -12805,7 +12722,6 @@
|
||||
2331C1B02A60F32D00E1D940 /* XPCandyTreeMoreView.m in Sources */,
|
||||
4CC6195D2CEC996E008C1EE8 /* MyDressingDataModel.m in Sources */,
|
||||
E8412FB02779CB4D006E1101 /* XPRoomSettingPresenter.m in Sources */,
|
||||
E87DF4B02A429B32009C1185 /* XPFirstRechargeView.m in Sources */,
|
||||
E878893C273A54C300BF1D57 /* Api+Gift.m in Sources */,
|
||||
E897ABFC28AF2E71003B3587 /* XPSailingGiftView.m in Sources */,
|
||||
E8998D8028597B0300C68558 /* XPRoomLuckyBigPrizeView.m in Sources */,
|
||||
@@ -13018,7 +12934,6 @@
|
||||
E83DB4842746661800D8CBD1 /* XPRoomGiftBroadcastView.m in Sources */,
|
||||
E8778AF82988F4E200CF139B /* XPSessionSayHelloHeaderView.m in Sources */,
|
||||
4C3475C42DD1FE590099B984 /* CreateEventSelectRoomViewController.m in Sources */,
|
||||
E84150C527747E0900A7F548 /* FirstRechargeRewardModel.m in Sources */,
|
||||
E8B9843328ABA2FF0022D026 /* MonentsPicResInfo.m in Sources */,
|
||||
239D0FDB2C047F24002977CE /* MSTabbarRoomGameCell.m in Sources */,
|
||||
54F469412C2AB56900A83655 /* XPMineGiftsTableViewCell.m in Sources */,
|
||||
@@ -13037,7 +12952,6 @@
|
||||
E8751E5928A62A390056EF44 /* Api+Sailing.m in Sources */,
|
||||
E897ABFF28AF39B4003B3587 /* XPSailingAnimationView.m in Sources */,
|
||||
E885D5362977CE28004DC088 /* SessionSettingModel.m in Sources */,
|
||||
E80DE40D2775ABA500BE5BCB /* XPFirstRechargeFlowLayout.m in Sources */,
|
||||
9BE01AE128937DBC00B50299 /* XPDressUpShopCardViewController.m in Sources */,
|
||||
E896EFA22771AE9400AD2CC1 /* XPMineFriendViewController.m in Sources */,
|
||||
1427218D29A75F6F00C7C423 /* HTTPRedirectResponse.m in Sources */,
|
||||
@@ -13077,12 +12991,12 @@
|
||||
E85E7B092A4EB0D200B6D00A /* XPGuildRemoveMemberPresenter.m in Sources */,
|
||||
E8950186282CAC80007E459A /* XPMomentsTooBarView.m in Sources */,
|
||||
E86507E5281A7D4D006951B0 /* MessageContentTweetView.m in Sources */,
|
||||
4C7F2A6B2E0BE7E7002F5058 /* FirstRechargeManager.m in Sources */,
|
||||
E824544B26F5BBB800BE8163 /* XPMineModifPayPwdViewController.m in Sources */,
|
||||
E81C1B2227705F950020D1E4 /* Api+ArrangeMic.m in Sources */,
|
||||
E8E20BE828169BDC0033B688 /* XPMineLoginPasswordPresenter.m in Sources */,
|
||||
238B37D52AC55A2C00BFC9D5 /* PITreasureFairyBuyElfShardView.m in Sources */,
|
||||
E85E7B3F2A4EB0D300B6D00A /* XPGuildSingleRoomIncomeTableViewCell.m in Sources */,
|
||||
E84150C227747BF700A7F548 /* FirstRechargeModel.m in Sources */,
|
||||
9B1EF3D227E81C0600554295 /* XPMineDressUpBubbleViewController.m in Sources */,
|
||||
2331C1AB2A60F32D00E1D940 /* CandyTreeResultModel.m in Sources */,
|
||||
23C9DFC32B84807A00B51558 /* PIRoomActivityClickView.m in Sources */,
|
||||
@@ -13235,7 +13149,6 @@
|
||||
187EEEF026E89FE8002833B2 /* AccountInfoStorage.m in Sources */,
|
||||
2331C1B82A60F32D00E1D940 /* XPRoomHalfWebView.m in Sources */,
|
||||
9BFE0D8E2898C8C300F53C24 /* XPAnchorCardSkillCollectionViewCell.m in Sources */,
|
||||
E87DF4B72A42C2FD009C1185 /* XPFirstRechargeCollectionView.m in Sources */,
|
||||
54AE7E172C9AE589006D2BE2 /* CPListViewController.m in Sources */,
|
||||
238B37A92AC55A2C00BFC9D5 /* TreasureFairyUserInfoModel.m in Sources */,
|
||||
E85E7B382A4EB0D300B6D00A /* XPMineGuildSearchMemberTableViewCell.m in Sources */,
|
||||
@@ -13385,7 +13298,6 @@
|
||||
4CD6FF692D673F7F00262AB7 /* AgentMessageTableViewCell.m in Sources */,
|
||||
4C1392962D6DA22B00A6DFB5 /* RechargerTransferHistoryViewController.m in Sources */,
|
||||
4CF3CE2E2E040EEC0071101F /* MedalsWearingListCollectionViewCell.m in Sources */,
|
||||
E87DF4B32A429C6E009C1185 /* FirstChargeRoomWindowModel.m in Sources */,
|
||||
E8AC722126F47E23007D6E91 /* XPMineAboutUsViewController.m in Sources */,
|
||||
E8E21A9E28B4DFE8008F7C9D /* XPSailingBuyFuelView.m in Sources */,
|
||||
18F403CB2758C66800A6C548 /* MessageContentText.m in Sources */,
|
||||
|
@@ -29,8 +29,6 @@ NSString * const kRoomKickoutTime = @"a1Jvb21LaWNrb3V0VGltZQ==";///被踢时间
|
||||
|
||||
///每日转赠钻石总额限制
|
||||
NSString * const kGiveDiamondDailyNum = @"a0dpdmVEaWFtb25kRGFpbHlOdW0=";
|
||||
///弹出首充界面
|
||||
NSString * const kShowFirstRechargeView = @"a1Nob3dGaXJzdFJlY2hhcmdlVmlldw==";
|
||||
|
||||
///邀请成员成功
|
||||
NSString * const kInviteMemeberSuccess = @"a0ludml0ZU1lbWViZXJTdWNjZXNz";
|
||||
|
@@ -18,6 +18,7 @@
|
||||
#import "AccountModel.h"
|
||||
#import "UserInfoModel.h"
|
||||
#import "XPLoginAuthCodeVC.h"
|
||||
#import "FirstRechargeManager.h"
|
||||
@implementation PILoginManager
|
||||
+(void)loginWithVC:(MvpViewController *)VC isLoginPhone:(BOOL)isLoginPhone{
|
||||
[XNDJTDDLoadingTool showLoading];
|
||||
@@ -80,5 +81,8 @@
|
||||
vc.inviteCode = inviteCode;
|
||||
BaseNavigationController *bnc = [[BaseNavigationController alloc] initWithRootViewController:vc];
|
||||
kWindow.rootViewController = bnc;
|
||||
|
||||
// 登录成功并进入主页后,启动首充监控
|
||||
[[FirstRechargeManager sharedManager] startMonitoring];
|
||||
}
|
||||
@end
|
||||
|
@@ -14,6 +14,7 @@
|
||||
#import "PILoginManager.h"
|
||||
#import "PISwitchingEnvironmentVC.h"
|
||||
#import "FeedBackViewController.h"
|
||||
#import "FirstRechargeManager.h"
|
||||
|
||||
NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
|
||||
|
||||
@@ -51,6 +52,9 @@ typedef NS_ENUM(NSUInteger, LoginType) {
|
||||
[super viewDidLoad];
|
||||
[self loadPolicySelectedStatus];
|
||||
[self setupUI];
|
||||
|
||||
// 进入登录页面时停止首充监控
|
||||
[[FirstRechargeManager sharedManager] stopMonitoring];
|
||||
}
|
||||
|
||||
- (void)setupUI {
|
||||
@@ -290,6 +294,14 @@ typedef NS_ENUM(NSUInteger, LoginType) {
|
||||
- (void)loginThirdPartSuccess {
|
||||
[self showSuccessToast:YMLocalizedString(@"XPLoginViewController4")];
|
||||
[PILoginManager loginWithVC:self isLoginPhone:NO];
|
||||
|
||||
// 登录成功后重新启动首充监控
|
||||
[[FirstRechargeManager sharedManager] startMonitoring];
|
||||
}
|
||||
|
||||
- (void)loginSuccess {
|
||||
// 登录成功后重新启动首充监控
|
||||
[[FirstRechargeManager sharedManager] startMonitoring];
|
||||
}
|
||||
|
||||
#pragma mark - Polisy Status
|
||||
|
@@ -25,6 +25,9 @@
|
||||
#import <JXCategoryView/JXCategoryView.h>
|
||||
#import <JXCategoryView/JXCategoryIndicatorBackgroundView.h>
|
||||
#import <JXCategoryView/JXCategoryListContainerView.h>
|
||||
|
||||
#import "FirstRechargeManager.h"
|
||||
|
||||
@interface XPIncomeRecordVC ()<XPExchangeDiamondsVCDelegate,XPIncomeRecordViewDelegate,XPIncomeRecordProtocol,JXCategoryViewDelegate, JXCategoryListContainerViewDelegate>
|
||||
///钻石
|
||||
@property (nonatomic,strong) XPIncomeRecordView *diamondView;
|
||||
@@ -54,7 +57,6 @@
|
||||
[super viewDidLoad];
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
// [self showLoading];
|
||||
}
|
||||
|
||||
- (void)viewWillDisappear:(BOOL)animated {
|
||||
@@ -71,6 +73,10 @@
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)handleTapFirstCharge {
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
self.view.backgroundColor = [UIColor whiteColor];
|
||||
@@ -82,7 +88,21 @@
|
||||
[self.view addSubview:self.titleView];
|
||||
[self.view addSubview:self.pi_containerView];
|
||||
|
||||
|
||||
FirstRechargeModel *model = [FirstRechargeManager.sharedManager loadCurrentModel];
|
||||
if (![NSString isEmpty:model.chargeBanner]) {
|
||||
NetImageView *imageView = [[NetImageView alloc] init];
|
||||
[imageView setCornerRadius:12];
|
||||
imageView.imageUrl = model.chargeBanner;
|
||||
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTapFirstCharge)];
|
||||
imageView.userInteractionEnabled = YES;
|
||||
[imageView addGestureRecognizer:tap];
|
||||
[self.view addSubview:imageView];
|
||||
[imageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(-50);
|
||||
make.leading.trailing.mas_equalTo(self.view).inset(15);
|
||||
make.height.mas_equalTo(100);
|
||||
}];
|
||||
}
|
||||
}
|
||||
- (void)initSubViewConstraints {
|
||||
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
|
@@ -10,6 +10,8 @@
|
||||
#import <Masonry.h>
|
||||
|
||||
#import "RechargeListModel.h"
|
||||
#import "FirstRechargeManager.h"
|
||||
#import "MoliMoneyLabel.h"
|
||||
|
||||
@interface XPIAPRechargeCollectionViewCell()
|
||||
|
||||
@@ -23,6 +25,9 @@
|
||||
/// 数量
|
||||
@property (nonatomic, strong) UILabel *numLabel;
|
||||
|
||||
@property (nonatomic, strong) UIView *extBG;
|
||||
@property (nonatomic, strong) MoliMoneyLabel *moneyLabel;
|
||||
|
||||
@end
|
||||
|
||||
@implementation XPIAPRechargeCollectionViewCell
|
||||
@@ -65,7 +70,17 @@
|
||||
make.edges.equalTo(self.bgPriceView);
|
||||
}];
|
||||
|
||||
[self.contentView addSubview:self.extBG];
|
||||
[self.extBG mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.trailing.mas_equalTo(self.bgView);
|
||||
make.size.mas_equalTo(CGSizeMake(64, 20));
|
||||
}];
|
||||
|
||||
[self.contentView addSubview:self.moneyLabel];
|
||||
[self.moneyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.mas_equalTo(self.extBG);
|
||||
make.trailing.mas_equalTo(self.extBG).offset(-5);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)setRechargeModel:(RechargeListModel *)rechargeModel {
|
||||
@@ -76,6 +91,16 @@
|
||||
NSCharacterSet* nonDigits =[[NSCharacterSet decimalDigitCharacterSet] invertedSet];
|
||||
int remainSecond = [[rechargeModel.prodName stringByTrimmingCharactersInSet:nonDigits] intValue];
|
||||
self.numLabel.text = [NSString stringWithFormat:@"%d",remainSecond];
|
||||
|
||||
FirstRechargeModel *model = [FirstRechargeManager.sharedManager loadCurrentModel];
|
||||
if (model && model.chargeStatus == NO) {
|
||||
for (FirstRechargeLevelModel *levelModel in model.levelCharge) {
|
||||
if (levelModel.exp == remainSecond) {
|
||||
[self.moneyLabel updateContent: [NSString stringWithFormat:@"+ %@", @(levelModel.awardNum)]];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setSelectedStyle:(BOOL)selectedStyle {
|
||||
@@ -134,4 +159,23 @@
|
||||
return _numLabel;
|
||||
}
|
||||
|
||||
- (UIView *)extBG {
|
||||
if (!_extBG) {
|
||||
_extBG = [[UIView alloc] init];
|
||||
[_extBG addGradientBackgroundWithColors:@[
|
||||
UIColorFromRGB(0xFFE347),
|
||||
UIColorFromRGB(0xFF9A51),
|
||||
] startPoint:CGPointMake(0, 0.5) endPoint:CGPointMake(1, 0.5) cornerRadius:4];
|
||||
[_extBG setCornerWithLeftTopCorner:4 rightTopCorner:kGetScaleWidth(9) bottomLeftCorner:4 bottomRightCorner:4 size:CGSizeMake(64, 20)];
|
||||
}
|
||||
return _extBG;
|
||||
}
|
||||
|
||||
- (MoliMoneyLabel *)moneyLabel {
|
||||
if (!_moneyLabel) {
|
||||
_moneyLabel = [MoliMoneyLabel moneyLabelWithTextColot:UIColorFromRGB(0x582B00) font:kFontMedium(13) moneyPostion:2 moneySize:CGSizeMake(14, 14)];
|
||||
}
|
||||
return _moneyLabel;
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -36,6 +36,7 @@
|
||||
#import "YuMi-swift.h"
|
||||
|
||||
#import "IAPManager.h"
|
||||
#import "FirstRechargeManager.h"
|
||||
|
||||
#define kHeaderViewHeight 220.0/375.0*KScreenWidth
|
||||
|
||||
|
@@ -49,6 +49,7 @@
|
||||
#import "BaseNavigationController.h"
|
||||
#import "LoginViewController.h"
|
||||
#import "SocialShareManager.h"
|
||||
#import "FirstRechargeManager.h"
|
||||
|
||||
@interface XPMineSettingViewController ()<UITableViewDelegate, UITableViewDataSource, XPMineSettingProtocol>
|
||||
///
|
||||
@@ -394,6 +395,9 @@
|
||||
}
|
||||
|
||||
- (void)logoutCurrentAccountSuccess {
|
||||
// 停止首充监控
|
||||
[[FirstRechargeManager sharedManager] stopMonitoring];
|
||||
|
||||
[[SocialShareManager sharedManager] reset];
|
||||
|
||||
LoginViewController *lvc = [[LoginViewController alloc] init];
|
||||
|
@@ -228,6 +228,10 @@ UIKIT_EXTERN NSString *kRequestTicket;
|
||||
return;
|
||||
}
|
||||
|
||||
//#if DEBUG
|
||||
// [self pushGiveDiamondVC];
|
||||
//#endif
|
||||
|
||||
switch (type) {
|
||||
case XPMineItemType_My_Medal:
|
||||
[self clickMedalsAction];
|
||||
|
31
YuMi/Modules/YMNewHome/Model/FirstRechargeModel.h
Normal file
31
YuMi/Modules/YMNewHome/Model/FirstRechargeModel.h
Normal file
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// FirstRechargeModel.h
|
||||
// YuMi
|
||||
//
|
||||
// Created by P on 2025/6/25.
|
||||
//
|
||||
|
||||
#import "PIBaseModel.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface FirstRechargeLevelModel : PIBaseModel
|
||||
|
||||
@property (nonatomic, assign) NSInteger awardNum;
|
||||
@property (nonatomic, assign) NSInteger exp;
|
||||
@property (nonatomic, copy) NSString *pic;
|
||||
@property (nonatomic, copy) NSString *rewardName;
|
||||
@property (nonatomic, copy) NSString *rewardType;
|
||||
@property (nonatomic, copy) NSString *unit;
|
||||
|
||||
@end
|
||||
|
||||
@interface FirstRechargeModel : PIBaseModel
|
||||
|
||||
@property (nonatomic, copy) NSString *chargeBanner;
|
||||
@property (nonatomic, assign) BOOL chargeStatus;
|
||||
@property (nonatomic, copy) NSArray <FirstRechargeLevelModel*>* levelCharge;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
23
YuMi/Modules/YMNewHome/Model/FirstRechargeModel.m
Normal file
23
YuMi/Modules/YMNewHome/Model/FirstRechargeModel.m
Normal file
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// FirstRechargeModel.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by P on 2025/6/25.
|
||||
//
|
||||
|
||||
#import "FirstRechargeModel.h"
|
||||
|
||||
@implementation FirstRechargeLevelModel
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@implementation FirstRechargeModel
|
||||
|
||||
+ (NSDictionary *)objectClassInArray {
|
||||
return @{
|
||||
@"levelCharge": [FirstRechargeLevelModel class],
|
||||
};
|
||||
}
|
||||
|
||||
@end
|
@@ -6,6 +6,7 @@
|
||||
//
|
||||
|
||||
#import "BaseMvpPresenter.h"
|
||||
#import "FirstRechargeModel.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@@ -24,6 +25,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
//- (void)getHomeAllTopsData;
|
||||
|
||||
- (void)getHomeRanks;
|
||||
|
||||
- (void)getUserFirstChargeStatus;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -17,6 +17,7 @@
|
||||
#import "PIHomeCategoryTitleModel.h"
|
||||
#import "HomeRankAvatarModel.h"
|
||||
#import "HomePlayRoomModel.h"
|
||||
#import "Api+FirstRecharge.h"
|
||||
|
||||
@implementation XPHomeContainerPresenter
|
||||
- (void)getHomeTopData {
|
||||
@@ -58,69 +59,6 @@
|
||||
}]];
|
||||
}
|
||||
|
||||
//- (void)getHomeAllTopsData {
|
||||
// RACSubject *banner = [RACSubject subject];
|
||||
// RACSubject *menu = [RACSubject subject];
|
||||
// RACSubject *rank = [RACSubject subject];
|
||||
//
|
||||
// RACSignal *bannerSignal = [banner catch:^RACSignal *(NSError *error) {
|
||||
// return [RACSignal return:nil];
|
||||
// }];
|
||||
// RACSignal *menuSignal = [menu catch:^RACSignal *(NSError *error) {
|
||||
// return [RACSignal return:nil];
|
||||
// }];
|
||||
//
|
||||
// RACSignal *rankSignal = [rank catch:^RACSignal *(NSError *error) {
|
||||
// return [RACSignal return:nil];
|
||||
// }];
|
||||
//
|
||||
// RACSignal *combinedSignal = [RACSignal combineLatest:@[bannerSignal, menuSignal, rankSignal]
|
||||
// reduce:^id(NSArray* bannerList, NSArray* menuList, NSArray *rankAvatars) {
|
||||
// return @[bannerList ?: @[],
|
||||
// menuList ?: @[],
|
||||
// rankAvatars ?: @[]];
|
||||
// }];
|
||||
//
|
||||
// @kWeakify(self);
|
||||
// [[combinedSignal deliverOn:RACScheduler.mainThreadScheduler]
|
||||
// subscribeNext:^(NSArray *combinedValues) {
|
||||
// @kStrongify(self);
|
||||
// [[self getView] getHomeTopDataSuccess:[combinedValues xpSafeObjectAtIndex:0]
|
||||
// banners:[combinedValues xpSafeObjectAtIndex:1]
|
||||
// rankAvatars:[combinedValues xpSafeObjectAtIndex:2]];
|
||||
// } error:^(NSError * _Nullable error) {
|
||||
//
|
||||
// }];
|
||||
//
|
||||
// NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
// [Api homeBannerList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
// NSArray * array = [HomeBannerInfoModel modelsWithArray:data.data];
|
||||
// [banner sendNext:array];
|
||||
// [banner sendCompleted];
|
||||
// }fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
// [banner sendError:nil];
|
||||
// [banner sendCompleted];
|
||||
// } errorToast:NO] uid:uid type:@"1"];
|
||||
//
|
||||
// [Api requestCurrentResourceListCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
// NSArray *list = [PIHomeItemModel modelsWithArray:data.data];
|
||||
// [menu sendNext:list];
|
||||
// [menu sendCompleted];
|
||||
// }fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
// [menu sendError:nil];
|
||||
// [menu sendCompleted];
|
||||
// }]];
|
||||
//
|
||||
// [Api getHomeRanksCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
// NSArray *list = [HomeRankAvatarModel modelsWithArray:data.data];
|
||||
// [rank sendNext:list];
|
||||
// [rank sendCompleted];
|
||||
// }fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
// [rank sendError:nil];
|
||||
// [rank sendCompleted];
|
||||
// }]];
|
||||
//}
|
||||
|
||||
///得到首页轮播图
|
||||
- (void)getHomeTopBannerList{
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
@@ -204,4 +142,16 @@
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)getUserFirstChargeStatus {
|
||||
@kWeakify(self);
|
||||
[Api firstchargeInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
@kStrongify(self);
|
||||
if ([self.getView respondsToSelector:@selector(getFirstChargeSuccess:)]) {
|
||||
[self.getView getFirstChargeSuccess:[FirstRechargeModel modelWithJSON:data.data]];
|
||||
}
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
|
||||
} showLoading:NO errorToast:NO]];
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -6,7 +6,7 @@
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class FirstRechargeModel;
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class PIHomeCategoryTitleModel;
|
||||
@protocol XPHomeContainerProtocol <NSObject>
|
||||
@@ -31,6 +31,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
rankAvatars:(NSArray *)rankAvatars;
|
||||
- (void)getHomeRanksSuccess:(NSArray *)resourceList;
|
||||
|
||||
- (void)getFirstChargeSuccess:(FirstRechargeModel *)model;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -13,6 +13,8 @@
|
||||
#import <JXCategoryView/JXCategoryView.h>
|
||||
#import <MJRefresh/MJRefresh.h>
|
||||
#import "SDWebImageManager.h"
|
||||
#import "FirstRechargeModel.h"
|
||||
#import "FirstRechargeManager.h"
|
||||
///Tool
|
||||
#import "Api+Home.h"
|
||||
#import "YUMIMacroUitls.h"
|
||||
@@ -329,7 +331,8 @@ JXCategoryViewDelegate,
|
||||
XPHomeContainerProtocol,
|
||||
XPNewHomeNavViewDelegate,
|
||||
XPNewHomeHeadViewDelegate,
|
||||
XPHomeRecommendOtherRoomViewDelegate>
|
||||
XPHomeRecommendOtherRoomViewDelegate,
|
||||
FirstRechargeManagerDelegate>
|
||||
|
||||
///头视图
|
||||
@property(nonatomic,strong) XPNewHomeHeadView *headView;
|
||||
@@ -357,6 +360,11 @@ XPHomeRecommendOtherRoomViewDelegate>
|
||||
|
||||
@property (nonatomic, assign) bool hasLoadAPIs;
|
||||
|
||||
// 首充弹窗引用
|
||||
@property (nonatomic, strong) XPWebViewController *firstChargeWebVC;
|
||||
// 首充弹窗背景视图
|
||||
@property (nonatomic, strong) UIView *firstChargeBackgroundView;
|
||||
|
||||
@end
|
||||
|
||||
@implementation XPNewHomeViewController
|
||||
@@ -370,6 +378,7 @@ XPHomeRecommendOtherRoomViewDelegate>
|
||||
|
||||
-(void)dealloc{
|
||||
[[NSNotificationCenter defaultCenter]removeObserver:self];
|
||||
[FirstRechargeManager sharedManager].delegate = nil;
|
||||
}
|
||||
|
||||
- (BOOL)isHiddenNavBar {
|
||||
@@ -390,6 +399,12 @@ XPHomeRecommendOtherRoomViewDelegate>
|
||||
[self initSubViewConstraints];
|
||||
|
||||
[self requestCheckIp];
|
||||
|
||||
// 注册首充管理器监听
|
||||
[FirstRechargeManager sharedManager].delegate = self;
|
||||
[[FirstRechargeManager sharedManager] startMonitoring];
|
||||
|
||||
// [self.presenter getUserFirstChargeStatus];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -406,6 +421,9 @@ XPHomeRecommendOtherRoomViewDelegate>
|
||||
}
|
||||
|
||||
- (void)tokenInvalid {
|
||||
// 停止首充监控
|
||||
[[FirstRechargeManager sharedManager] stopMonitoring];
|
||||
|
||||
[[AccountInfoStorage instance] saveAccountInfo:nil];
|
||||
[[AccountInfoStorage instance] saveTicket:nil];
|
||||
if ([NIMSDK sharedSDK].loginManager.isLogined) {
|
||||
@@ -769,6 +787,85 @@ XPHomeRecommendOtherRoomViewDelegate>
|
||||
self.type = index;
|
||||
}
|
||||
|
||||
- (void)getFirstChargeSuccess:(FirstRechargeModel *)model {
|
||||
if (model.chargeStatus == NO) {
|
||||
// TODO: 弹出窗口 web view
|
||||
XPWebViewController *web = [[XPWebViewController alloc] initWithRoomUID:@""];
|
||||
[self addChildViewController:web];
|
||||
[self.view addSubview:web.view];
|
||||
web.view.frame = CGRectMake(0, 0, KScreenWidth/2, KScreenHeight/2);
|
||||
web.view.center = self.view.center;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - FirstRechargeManagerDelegate
|
||||
|
||||
- (void)firstRechargeManager:(FirstRechargeManager *)manager didCheckFirstRecharge:(FirstRechargeModel *)model shouldShow:(BOOL)shouldShow {
|
||||
if (shouldShow && model.chargeStatus == NO) {
|
||||
// 展示首充弹窗
|
||||
[self showFirstRechargePopup:model];
|
||||
|
||||
// 标记今天已展示过(在展示后标记)
|
||||
[[FirstRechargeManager sharedManager] markTodayShown];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)showFirstRechargePopup:(FirstRechargeModel *)model {
|
||||
if (model.chargeStatus) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 如果已经有弹窗在显示,先移除它
|
||||
[self removeFirstChargePopup];
|
||||
|
||||
// 创建背景视图
|
||||
self.firstChargeBackgroundView = [[UIView alloc] initWithFrame:self.view.bounds];
|
||||
self.firstChargeBackgroundView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5];
|
||||
|
||||
// 添加点击手势
|
||||
UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleBackgroundTap:)];
|
||||
[self.firstChargeBackgroundView addGestureRecognizer:tapGesture];
|
||||
|
||||
// 添加背景视图
|
||||
[self.view addSubview:self.firstChargeBackgroundView];
|
||||
|
||||
// 创建并配置 web 视图
|
||||
self.firstChargeWebVC = [[XPWebViewController alloc] initWithRoomUID:@""];
|
||||
self.firstChargeWebVC.isPush = NO;
|
||||
self.firstChargeWebVC.url = @"https://jandan.net/pic";
|
||||
[self addChildViewController:self.firstChargeWebVC];
|
||||
[self.firstChargeBackgroundView addSubview:self.firstChargeWebVC.view];
|
||||
self.firstChargeWebVC.view.frame = CGRectMake(0, 0, KScreenWidth/2, KScreenHeight/2);
|
||||
self.firstChargeWebVC.view.center = self.firstChargeBackgroundView.center;
|
||||
|
||||
// 3秒后自动移除
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[self removeFirstChargePopup];
|
||||
});
|
||||
}
|
||||
|
||||
// 处理背景点击事件
|
||||
- (void)handleBackgroundTap:(UITapGestureRecognizer *)gesture {
|
||||
CGPoint location = [gesture locationInView:self.firstChargeBackgroundView];
|
||||
if (!CGRectContainsPoint(self.firstChargeWebVC.view.frame, location)) {
|
||||
[self removeFirstChargePopup];
|
||||
}
|
||||
}
|
||||
|
||||
// 修改移除弹窗的方法
|
||||
- (void)removeFirstChargePopup {
|
||||
if (self.firstChargeWebVC) {
|
||||
[self.firstChargeWebVC.view removeFromSuperview];
|
||||
[self.firstChargeWebVC removeFromParentViewController];
|
||||
self.firstChargeWebVC = nil;
|
||||
}
|
||||
|
||||
if (self.firstChargeBackgroundView) {
|
||||
[self.firstChargeBackgroundView removeFromSuperview];
|
||||
self.firstChargeBackgroundView = nil;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - XPNewHomeHeadViewDelegate
|
||||
///
|
||||
-(void)checkIpRegionSuccess:(NSInteger)seconds{
|
||||
|
@@ -63,10 +63,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (void)getRedPacket:(NSString *)roomUid;
|
||||
///获取单个红包信息
|
||||
-(void)getRedPacketInft:(NSString *)redEnvelopeId;
|
||||
///拿到首充弹窗次数
|
||||
-(void)getRoomFirstCharegWindow:(NSString *)roomUid;
|
||||
///更新首充弹窗次数
|
||||
-(void)updateRoomFirstChargeWindow:(NSString *)roomUid;
|
||||
|
||||
|
||||
///屏蔽
|
||||
- (void)requestShieldingWithType:(NSString *)type objId:(NSString *)objId;
|
||||
|
@@ -23,7 +23,6 @@
|
||||
#import "RoomNewUserGreetModel.h"
|
||||
#import "XPRoomRecommendModel.h"
|
||||
#import "XPRedPacketModel.h"
|
||||
#import "FirstChargeRoomWindowModel.h"
|
||||
#import "XPFreeGiftModel.h"
|
||||
#import "BoomInfoModel.h"
|
||||
///P
|
||||
@@ -267,18 +266,7 @@
|
||||
[[self getView]getRedPacketInfoSuccess:redModel];
|
||||
}] redEnvelopeId:redEnvelopeId];
|
||||
}
|
||||
-(void)getRoomFirstCharegWindow:(NSString *)roomUid{
|
||||
@kWeakify(self);
|
||||
[Api requestRoomFirstCharegWindow:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
@kStrongify(self);
|
||||
FirstChargeRoomWindowModel *freeModel = [FirstChargeRoomWindowModel modelWithDictionary:data.data];
|
||||
[[self getView]getRoomFirstChargeWindowSuccess:freeModel];
|
||||
}showLoading:NO errorToast:NO] roomUid:roomUid];
|
||||
}
|
||||
-(void)updateRoomFirstChargeWindow:(NSString *)roomUid{
|
||||
[Api updateRoomFirstCharegWindow:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
}showLoading:NO errorToast:NO] roomUid:roomUid];
|
||||
}
|
||||
|
||||
- (void)requestShieldingWithType:(NSString *)type objId:(NSString *)objId{
|
||||
@kWeakify(self);
|
||||
[Api requestShielding:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
|
@@ -31,8 +31,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (void)getRedPacketSuccess:(NSArray *)list;
|
||||
///获取红包成功
|
||||
- (void)getRedPacketInfoSuccess:(XPRedPacketModel *)redInfo;
|
||||
///获取首充弹窗
|
||||
-(void)getRoomFirstChargeWindowSuccess:(FirstChargeRoomWindowModel*)model;
|
||||
|
||||
///屏蔽
|
||||
-(void)requestShieldingSuccess;
|
||||
///获取免费礼物成功
|
||||
|
@@ -33,7 +33,6 @@
|
||||
#import "XPCandyTreeViewController.h"
|
||||
#import "XPWebViewController.h"
|
||||
#import "XPRoomViewController.h"
|
||||
#import "XPFirstRechargeSuccessView.h"
|
||||
#import "XPArrangeMicViewController.h"
|
||||
#import "XPSailingViewController.h"
|
||||
#import "XCCurrentVCStackManager.h"
|
||||
@@ -52,7 +51,6 @@
|
||||
#import "BoomInfoViewController.h"
|
||||
|
||||
|
||||
UIKIT_EXTERN NSString *kShowFirstRechargeView;
|
||||
@interface XPRoomActivityContainerView ()<SDCycleScrollViewDelegate,PIRoomEnterRedPacketViewDelegate>
|
||||
///容器
|
||||
@property (nonatomic,strong) UIStackView *stackView;
|
||||
@@ -423,10 +421,6 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
|
||||
if (obj.attachment != nil && [obj.attachment isKindOfClass:[AttachmentModel class]]) {
|
||||
AttachmentModel *attachment = (AttachmentModel *)obj.attachment;
|
||||
if (attachment.first == CustomMessageType_First_Recharge_Reward && attachment.second == Custom_Message_Sub_Room_First_Recharge_Reward) {
|
||||
FirstRechargeModel *model = [FirstRechargeModel modelWithJSON:attachment.data];
|
||||
XPFirstRechargeSuccessView * firstRechargeView= [[XPFirstRechargeSuccessView alloc] init];
|
||||
firstRechargeView.rechargeInfo = model;
|
||||
[TTPopup popupView:firstRechargeView style:TTPopupStyleAlert];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -607,7 +601,6 @@ UIKIT_EXTERN NSString *kShowFirstRechargeView;
|
||||
}
|
||||
|
||||
- (void)firstRechargeTapRecognizer {
|
||||
[[NSNotificationCenter defaultCenter]postNotificationName:kShowFirstRechargeView object:nil];
|
||||
}
|
||||
|
||||
- (void)didTapJoinDatingRecognizer {
|
||||
|
@@ -11,10 +11,11 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface Api (FirstRecharge)
|
||||
|
||||
/// 获取首充奖励列表
|
||||
/// @param completion 完成
|
||||
/// @param channelType 渠道 目前是3
|
||||
+ (void)firstRechargeRewardList:(HttpRequestHelperCompletion)completion channelType:(NSString *)channelType;
|
||||
|
||||
|
||||
/// 用户首充状态
|
||||
/// @param completion complete
|
||||
+ (void)firstchargeInfo:(HttpRequestHelperCompletion)completion;
|
||||
|
||||
@end
|
||||
|
||||
|
@@ -6,16 +6,11 @@
|
||||
//
|
||||
|
||||
#import "Api+FirstRecharge.h"
|
||||
#import <Base64/MF_Base64Additions.h>
|
||||
|
||||
@implementation Api (FirstRecharge)
|
||||
|
||||
|
||||
/// 获取首充奖励列表
|
||||
/// @param completion 完成
|
||||
/// @param channelType 渠道 目前是3
|
||||
+ (void)firstRechargeRewardList:(HttpRequestHelperCompletion)completion channelType:(NSString *)channelType {
|
||||
NSString * fang = [NSString stringFromBase64String:@"Zmlyc3QvY2hhcmdlL2xpc3Q="];///first/charge/list
|
||||
[self makeRequest:fang method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, channelType, nil];
|
||||
+ (void)firstchargeInfo:(HttpRequestHelperCompletion)completion {
|
||||
[self makeRequest:@"firstcharge/info" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, nil];
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -1,21 +0,0 @@
|
||||
//
|
||||
// FirstChargeRoomWindowModel.h
|
||||
// YuMi
|
||||
//
|
||||
// Created by YuMi on 2023/6/21.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface FirstChargeRoomWindowModel : PIBaseModel
|
||||
///是否需要弹出首充
|
||||
@property (nonatomic,assign) BOOL needToShow;
|
||||
///房间id
|
||||
@property (nonatomic,copy) NSString *roomUid;
|
||||
///延时弹出首充的时间
|
||||
@property (nonatomic,assign) NSInteger showAfterSecond;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,12 +0,0 @@
|
||||
//
|
||||
// FirstChargeRoomWindowModel.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by YuMi on 2023/6/21.
|
||||
//
|
||||
|
||||
#import "FirstChargeRoomWindowModel.h"
|
||||
|
||||
@implementation FirstChargeRoomWindowModel
|
||||
|
||||
@end
|
@@ -1,27 +0,0 @@
|
||||
//
|
||||
// FirstRechargeModel.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/12/23.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "FirstRechargeRewardModel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface FirstRechargeModel : PIBaseModel
|
||||
///充值的额度
|
||||
@property(nonatomic, assign) CGFloat chargeMoney;
|
||||
@property(nonatomic, strong) NSString *chargeProdId;
|
||||
@property(nonatomic, strong) NSString *chargeProdDesc;
|
||||
@property(nonatomic, strong) NSString *chargeProdTitle;
|
||||
@property(nonatomic, strong) NSArray<FirstRechargeRewardModel *> *firstChargeRewardList;
|
||||
@property (nonatomic, assign) NSInteger giveMoney;
|
||||
|
||||
///新用户充值优惠使用----
|
||||
///是否完成当前档位的充值
|
||||
@property (nonatomic, assign) BOOL finishCharge;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,18 +0,0 @@
|
||||
//
|
||||
// FirstRechargeModel.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/12/23.
|
||||
//
|
||||
|
||||
#import "FirstRechargeModel.h"
|
||||
|
||||
@implementation FirstRechargeModel
|
||||
|
||||
///扩展方法 按需索取 重写即可
|
||||
///如果一个模型中 包含一个数组 数组中是另一个模型
|
||||
+ (NSDictionary *)objectClassInArray {
|
||||
return @{@"firstChargeRewardList": FirstRechargeRewardModel.class};
|
||||
}
|
||||
|
||||
@end
|
@@ -1,23 +0,0 @@
|
||||
//
|
||||
// FirstRechargeRewardModel.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/12/23.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface FirstRechargeRewardModel : PIBaseModel
|
||||
@property (nonatomic, assign) long rewardId;
|
||||
///奖励的图片
|
||||
@property(nonatomic, strong) NSString *showPir;
|
||||
///展示奖励的文字
|
||||
@property(nonatomic, strong) NSString *showText;
|
||||
///奖励的天数
|
||||
@property(nonatomic, copy) NSString * showTime;
|
||||
@property (nonatomic, strong) NSString *rid;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,17 +0,0 @@
|
||||
//
|
||||
// FirstRechargeRewardModel.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/12/23.
|
||||
//
|
||||
|
||||
#import "FirstRechargeRewardModel.h"
|
||||
|
||||
@implementation FirstRechargeRewardModel
|
||||
|
||||
///如果一个模型中需要字段映射的话 比如id -> ID name -> other.name
|
||||
+ (NSDictionary *)replacedKeyFromPropertyName {
|
||||
return @{@"id": @"fid"};
|
||||
}
|
||||
|
||||
@end
|
@@ -1,16 +0,0 @@
|
||||
//
|
||||
// YMFirstRechargePresenter.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/12/23.
|
||||
//
|
||||
|
||||
#import "BaseMvpPresenter.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPFirstRechargePresenter : BaseMvpPresenter
|
||||
- (void)getFirstRechargeRewardList;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,22 +0,0 @@
|
||||
//
|
||||
// YMFirstRechargePresenter.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/12/23.
|
||||
//
|
||||
|
||||
#import "XPFirstRechargePresenter.h"
|
||||
#import "Api+FirstRecharge.h"
|
||||
#import "FirstRechargeModel.h"
|
||||
#import "XPFirstRechargeProtocol.h"
|
||||
|
||||
@implementation XPFirstRechargePresenter
|
||||
|
||||
- (void)getFirstRechargeRewardList {
|
||||
[Api firstRechargeRewardList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
NSArray * array = [FirstRechargeModel modelsWithArray:data.data];
|
||||
[[self getView] getFirstRechargeListSuccess:array];
|
||||
} showLoading:YES] channelType:@"3"];
|
||||
}
|
||||
|
||||
@end
|
@@ -1,19 +0,0 @@
|
||||
//
|
||||
// YMFirstRechargeProtocol.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/12/23.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol XPFirstRechargeProtocol <NSObject>
|
||||
|
||||
///获取首充列表成功
|
||||
- (void)getFirstRechargeListSuccess:(NSArray *)array;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,41 +0,0 @@
|
||||
//
|
||||
// ThemeColorFirstRecharge.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/12/24.
|
||||
//
|
||||
|
||||
#import "DJDKMIMOMColor.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface DJDKMIMOMColor (FirstRecharge)
|
||||
///首充的文字的颜色
|
||||
+ (UIColor *)firstRechargeTextColor;
|
||||
|
||||
/// 奖励的天数 渐变色的开始 0xFFB556
|
||||
+ (UIColor *)rewardTimeButtonGradientStartColor;
|
||||
|
||||
/// 奖励的天数 渐变色的结束 #FE581E
|
||||
+ (UIColor *)rewardTimeButtonGradientEndColor;
|
||||
|
||||
/// 奖励提示的颜色 #FB486A
|
||||
+ (UIColor *)rewardReminderTextColor;
|
||||
|
||||
/// 选择滑块的颜色 FFDB49
|
||||
+ (UIColor *)rewardSegmentTextColor;
|
||||
|
||||
/// 选择滑块的颜色 0x653BBA
|
||||
+ (UIColor *)rewardSegmentNormalTextColor;
|
||||
/// 滑块的默认的背景颜色 0x653BB9
|
||||
+ (UIColor *)rewardSegmentNormalBgColor;
|
||||
///背景色 0x000000 0.4
|
||||
+ (UIColor *)firstRechargeBackgroundColor;
|
||||
|
||||
/// 奖励内容 渐变色的开始 0x5D31B3
|
||||
+ (UIColor *)rewardBackgroundGradientMiddleColor;
|
||||
/// 奖励内容 渐变色的开始 0x5226AB
|
||||
+ (UIColor *)rewardBackgroundGradientTopColor;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,61 +0,0 @@
|
||||
//
|
||||
// ThemeColorFirstRecharge.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/12/24.
|
||||
//
|
||||
|
||||
#import "ThemeColor+FirstRecharge.h"
|
||||
|
||||
@implementation DJDKMIMOMColor (FirstRecharge)
|
||||
|
||||
///首充的文字的颜色
|
||||
+ (UIColor *)firstRechargeTextColor {
|
||||
return UIColorFromRGB(0xFFFFFF);
|
||||
}
|
||||
|
||||
/// 奖励的天数 渐变色的开始 0xFFB556
|
||||
+ (UIColor *)rewardTimeButtonGradientStartColor {
|
||||
return UIColorFromRGB(0xFFB556);
|
||||
}
|
||||
/// 奖励的天数 渐变色的结束 #FE581E
|
||||
+ (UIColor *)rewardTimeButtonGradientEndColor {
|
||||
return UIColorFromRGB(0xFE581E);
|
||||
}
|
||||
|
||||
/// 奖励提示的颜色 #FB486A
|
||||
+ (UIColor *)rewardReminderTextColor {
|
||||
return UIColorFromRGB(0xFB486A);
|
||||
}
|
||||
|
||||
/// 选择滑块的颜色 FFDB49
|
||||
+ (UIColor *)rewardSegmentTextColor {
|
||||
return UIColorFromRGB(0xFFFFFF);
|
||||
}
|
||||
|
||||
/// 选择滑块的颜色 0x653BBA
|
||||
+ (UIColor *)rewardSegmentNormalTextColor {
|
||||
return UIColorFromRGB(0x845DFF);
|
||||
}
|
||||
|
||||
/// 滑块的默认的背景颜色 0x653BB9
|
||||
+ (UIColor *)rewardSegmentNormalBgColor {
|
||||
return UIColorFromRGB(0xE0B4FF);
|
||||
}
|
||||
|
||||
///背景色 0x000000 0.4
|
||||
+ (UIColor *)firstRechargeBackgroundColor {
|
||||
return UIColorRGBAlpha(0x000000, 0.3);
|
||||
}
|
||||
|
||||
/// 奖励内容 渐变色的开始 0x5226AB
|
||||
+ (UIColor *)rewardBackgroundGradientTopColor {
|
||||
return UIColorFromRGB(0x5226AB);
|
||||
}
|
||||
|
||||
/// 奖励内容 渐变色的开始 0x5D31B3
|
||||
+ (UIColor *)rewardBackgroundGradientMiddleColor {
|
||||
return UIColorFromRGB(0x5D31B3);
|
||||
}
|
||||
|
||||
@end
|
@@ -1,17 +0,0 @@
|
||||
//
|
||||
// YMFirstRechargeCollectionViewCell.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/12/24.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class FirstRechargeRewardModel;
|
||||
@interface XPFirstRechargeCollectionViewCell : UICollectionViewCell
|
||||
///奖励的模型
|
||||
@property (nonatomic,strong) FirstRechargeRewardModel *rewardInfo;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,116 +0,0 @@
|
||||
//
|
||||
// YMFirstRechargeCollectionViewCell.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/12/24.
|
||||
//
|
||||
|
||||
#import "XPFirstRechargeCollectionViewCell.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
///Tool
|
||||
#import "ThemeColor+FirstRecharge.h"
|
||||
#import "NetImageView.h"
|
||||
#import "UIImage+Utils.h"
|
||||
///Model
|
||||
#import "FirstRechargeRewardModel.h"
|
||||
|
||||
@interface XPFirstRechargeCollectionViewCell ()
|
||||
///奖励的图片
|
||||
@property (nonatomic, strong) NetImageView *iconImageView;
|
||||
///显示奖励图片
|
||||
@property (nonatomic, strong) UILabel *titleLabel;
|
||||
///显示奖励的时间
|
||||
@property (nonatomic, strong) UIButton *timeButton;
|
||||
@end
|
||||
|
||||
@implementation XPFirstRechargeCollectionViewCell
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews{
|
||||
[self addSubview:self.iconImageView];
|
||||
[self addSubview:self.titleLabel];
|
||||
[self addSubview:self.timeButton];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints{
|
||||
[self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(0);
|
||||
make.centerX.mas_equalTo(self.mas_centerX);
|
||||
make.width.height.mas_equalTo(60);
|
||||
}];
|
||||
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self);
|
||||
make.height.mas_equalTo(10);
|
||||
make.bottom.mas_equalTo(0);
|
||||
make.leading.mas_equalTo(0);
|
||||
}];
|
||||
|
||||
[self.timeButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.trailing.mas_equalTo(self.iconImageView);
|
||||
make.height.mas_equalTo(12);
|
||||
make.width.mas_equalTo(30);
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - setupData
|
||||
- (void)setRewardInfo:(FirstRechargeRewardModel *)rewardInfo {
|
||||
_rewardInfo = rewardInfo;
|
||||
self.timeButton.hidden = !(_rewardInfo.showTime > 0);
|
||||
[self.timeButton setTitle:[NSString stringWithFormat:@"%@", _rewardInfo.showTime] forState:UIControlStateNormal];
|
||||
self.titleLabel.text = _rewardInfo.showText;
|
||||
self.iconImageView.imageUrl = _rewardInfo.showPir;
|
||||
}
|
||||
|
||||
|
||||
- (UIImageView *)iconImageView {
|
||||
if (!_iconImageView) {
|
||||
NetImageConfig * config = [[NetImageConfig alloc] init];
|
||||
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
|
||||
config.imageType = ImageTypeUserIcon;
|
||||
_iconImageView = [[NetImageView alloc] initWithConfig:config];
|
||||
_iconImageView.backgroundColor = UIColorFromRGB(0xE0B4FF);
|
||||
_iconImageView.layer.cornerRadius = 4;
|
||||
_iconImageView.layer.masksToBounds = YES;
|
||||
_iconImageView.contentMode = UIViewContentModeScaleAspectFit;
|
||||
}
|
||||
return _iconImageView;
|
||||
}
|
||||
|
||||
- (UILabel *)titleLabel{
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.textColor = UIColorFromRGB(0x845DFF);
|
||||
_titleLabel.font = [UIFont systemFontOfSize:10];
|
||||
_titleLabel.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
- (UIButton *)timeButton{
|
||||
if (!_timeButton) {
|
||||
_timeButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_timeButton setTitleColor:[DJDKMIMOMColor firstRechargeTextColor] forState:UIControlStateNormal];
|
||||
_timeButton.titleLabel.font = [UIFont systemFontOfSize:10];
|
||||
[_timeButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor rewardTimeButtonGradientStartColor], [DJDKMIMOMColor rewardTimeButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal];
|
||||
_timeButton.hidden = YES;
|
||||
UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, 30, 12) byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(4, 4)];
|
||||
CAShapeLayer *maskLayer = [CAShapeLayer layer];
|
||||
maskLayer.path = path.CGPath;
|
||||
_timeButton.layer.mask = maskLayer;
|
||||
}
|
||||
return _timeButton;
|
||||
}
|
||||
|
||||
@end
|
@@ -1,16 +0,0 @@
|
||||
//
|
||||
// YMFirstRechargeFlowLayout.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/12/24.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPFirstRechargeFlowLayout : MSBaseRTLFlowLayout
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,95 +0,0 @@
|
||||
//
|
||||
// YMFirstRechargeFlowLayout.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/12/24.
|
||||
//
|
||||
|
||||
#import "XPFirstRechargeFlowLayout.h"
|
||||
|
||||
@interface XPFirstRechargeFlowLayout ()
|
||||
///
|
||||
@property (nonatomic,assign) CGFloat currentY;
|
||||
///
|
||||
@property (nonatomic,assign) CGFloat currentX;
|
||||
///
|
||||
@property (nonatomic,strong) NSMutableArray *attributeArray;
|
||||
@end
|
||||
|
||||
@implementation XPFirstRechargeFlowLayout
|
||||
|
||||
|
||||
- (void)prepareLayout {
|
||||
[super prepareLayout];
|
||||
NSInteger count = [self.collectionView numberOfItemsInSection:0];
|
||||
_currentX = self.sectionInset.left;
|
||||
_currentY = self.sectionInset.top;
|
||||
_attributeArray = [NSMutableArray array];
|
||||
for (int i = 0; i< count; i++) {
|
||||
NSIndexPath * indexPath = [NSIndexPath indexPathForRow:i inSection:0];
|
||||
UICollectionViewLayoutAttributes * attributes = [self layoutAttributesForItemAtIndexPath:indexPath];
|
||||
[self.attributeArray addObject:attributes];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
- (UICollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||
CGFloat contentWidth = self.collectionView.frame.size.width - self.sectionInset.left - self.sectionInset.right;
|
||||
CGFloat contentHeight = self.collectionView.frame.size.height - self.sectionInset.top - self.sectionInset.bottom;
|
||||
UICollectionViewLayoutAttributes * temp= [UICollectionViewLayoutAttributes layoutAttributesForCellWithIndexPath:indexPath];
|
||||
NSInteger count = [self.collectionView numberOfItemsInSection:0];
|
||||
CGFloat itemWidth = self.itemSize.width;
|
||||
CGFloat itemHeight = self.itemSize.height;
|
||||
CGRect frame;
|
||||
frame.size = self.itemSize;
|
||||
if (count == 6) {
|
||||
CGFloat space =(contentWidth - itemWidth * 3) / 2;
|
||||
CGFloat temIndexRow = indexPath.row % 3;
|
||||
CGFloat temIndex = indexPath.row / 3;
|
||||
_currentX = temIndexRow *(itemWidth + space) + self.sectionInset.left;
|
||||
_currentY = (itemHeight + self.minimumLineSpacing) * temIndex + self.sectionInset.top;
|
||||
|
||||
} else if(count == 5) {
|
||||
CGFloat space =(contentWidth - itemWidth * 3) / 2;
|
||||
CGFloat temIndexRow = indexPath.row % 3;
|
||||
CGFloat temIndex = indexPath.row / 3;
|
||||
if (temIndex > 0) {
|
||||
CGFloat leftSpace = (contentWidth - itemWidth * 2) /3;
|
||||
_currentX = temIndexRow *itemWidth + leftSpace * (temIndexRow + 1) + self.sectionInset.left;
|
||||
_currentY = (itemHeight + self.minimumLineSpacing) * temIndex + self.sectionInset.top;
|
||||
} else {
|
||||
_currentX = temIndexRow *(itemWidth + space) + self.sectionInset.left;
|
||||
_currentY = (itemHeight + self.minimumLineSpacing) * temIndex + self.sectionInset.top;
|
||||
}
|
||||
} else if(count == 4) {
|
||||
CGFloat space = (contentWidth - itemWidth * 2) / 3;
|
||||
CGFloat temIndexRow = indexPath.row % 2;
|
||||
CGFloat temIndex = indexPath.row / 2;
|
||||
_currentX = temIndexRow *itemWidth + space * (temIndexRow + 1) + self.sectionInset.left;
|
||||
_currentY = (itemHeight + self.minimumLineSpacing) * temIndex + self.sectionInset.top;
|
||||
} else if(count == 3) {
|
||||
CGFloat space =(contentWidth - itemWidth * 3) / 2;
|
||||
CGFloat temIndexRow = indexPath.row % 3;
|
||||
_currentX = temIndexRow *(itemWidth + space) + self.sectionInset.left;
|
||||
_currentY = (contentHeight - itemHeight) / 2 + self.sectionInset.top;
|
||||
} else if(count == 2) {
|
||||
CGFloat space = (contentWidth - itemWidth * 2) / 3;
|
||||
CGFloat temIndexRow = indexPath.row % 2;
|
||||
_currentX = temIndexRow *itemWidth + space * (temIndexRow + 1) + self.sectionInset.left;
|
||||
_currentY = (contentHeight - itemHeight) / 2 + self.sectionInset.top;
|
||||
}else if(count == 1) {
|
||||
_currentX = (contentWidth - itemWidth) / 2 + self.sectionInset.left;
|
||||
_currentY = (contentHeight - itemHeight) / 2 + self.sectionInset.top;
|
||||
}
|
||||
frame.origin = CGPointMake(_currentX, _currentY);
|
||||
temp.frame = frame;
|
||||
return temp;
|
||||
}
|
||||
- (CGSize)collectionViewContentSize {
|
||||
return CGSizeMake(1, _currentY + self.itemSize.height + self.sectionInset.bottom);
|
||||
}
|
||||
|
||||
- (NSArray<__kindof UICollectionViewLayoutAttributes *> *)layoutAttributesForElementsInRect:(CGRect)rect {
|
||||
return _attributeArray;
|
||||
}
|
||||
@end
|
@@ -1,18 +0,0 @@
|
||||
//
|
||||
// XPFirstRechargeCollectionView.h
|
||||
// YuMi
|
||||
//
|
||||
// Created by YuMi on 2023/2/21.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class FirstRechargeRewardModel;
|
||||
@interface XPFirstRechargeCollectionView : UIView
|
||||
///奖励的模型
|
||||
@property (nonatomic,strong) FirstRechargeRewardModel *rewardInfo;
|
||||
- (instancetype)initWithFrame:(CGRect)frame isFirst:(BOOL)isFirst;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,138 +0,0 @@
|
||||
//
|
||||
// XPFirstRechargeCollectionView.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by YuMi on 2023/2/21.
|
||||
//
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
///Tool
|
||||
#import "ThemeColor+FirstRecharge.h"
|
||||
#import "NetImageView.h"
|
||||
#import "UIImage+Utils.h"
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import "UIView+Corner.h"
|
||||
///Model
|
||||
#import "FirstRechargeRewardModel.h"
|
||||
#import "XPFirstRechargeCollectionView.h"
|
||||
@interface XPFirstRechargeCollectionView()
|
||||
///奖励的背景图片
|
||||
@property (nonatomic,strong) UIImageView *bgImageView;
|
||||
///奖励的图片
|
||||
@property (nonatomic, strong) NetImageView *iconImageView;
|
||||
///显示奖励图片
|
||||
@property (nonatomic, strong) UILabel *titleLabel;
|
||||
///显示奖励的时间
|
||||
@property (nonatomic, strong) UIButton *timeButton;
|
||||
///
|
||||
@property (nonatomic,assign) BOOL isFirst;
|
||||
@end
|
||||
@implementation XPFirstRechargeCollectionView
|
||||
- (instancetype)initWithFrame:(CGRect)frame isFirst:(BOOL)isFirst{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
self.isFirst = isFirst;
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews{
|
||||
[self addSubview:self.bgImageView];
|
||||
[self addSubview:self.iconImageView];
|
||||
[self addSubview:self.titleLabel];
|
||||
[self addSubview:self.timeButton];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints{
|
||||
CGFloat bgWidth = self.isFirst == YES ? kGetScaleWidth(100) : kGetScaleWidth(65);
|
||||
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.top.equalTo(self);
|
||||
make.width.height.mas_equalTo(bgWidth);
|
||||
}];
|
||||
|
||||
CGFloat iconWidth = self.isFirst == YES ? kGetScaleWidth(74) : kGetScaleWidth(48);
|
||||
[self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.center.equalTo(self.bgImageView);
|
||||
make.width.height.mas_equalTo(iconWidth);
|
||||
}];
|
||||
CGFloat titleWidth = self.isFirst == YES ? kGetScaleWidth(18):kGetScaleWidth(15);
|
||||
CGFloat top = self.isFirst == YES ? kGetScaleWidth(8):kGetScaleWidth(4);
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo(titleWidth);
|
||||
make.leading.trailing.equalTo(self);
|
||||
make.top.equalTo(self.bgImageView.mas_bottom).mas_offset(top);
|
||||
}];
|
||||
CGSize size = self.isFirst == YES ? CGSizeMake(kGetScaleWidth(40), kGetScaleWidth(12)):CGSizeMake(kGetScaleWidth(29), kGetScaleWidth(11));
|
||||
CGFloat timeTop = _isFirst == YES ? kGetScaleWidth(3) :kGetScaleWidth(2);
|
||||
[self.timeButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.leading.mas_equalTo(self.bgImageView).mas_offset(timeTop);
|
||||
make.size.mas_equalTo(size);
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - setupData
|
||||
- (void)setRewardInfo:(FirstRechargeRewardModel *)rewardInfo {
|
||||
_rewardInfo = rewardInfo;
|
||||
self.timeButton.hidden = !(_rewardInfo.showTime > 0);
|
||||
[self.timeButton setTitle:[NSString stringWithFormat:@"%@", _rewardInfo.showTime] forState:UIControlStateNormal];
|
||||
self.titleLabel.text = _rewardInfo.showText;
|
||||
self.iconImageView.imageUrl = _rewardInfo.showPir;
|
||||
}
|
||||
|
||||
- (UIImageView *)bgImageView{
|
||||
if (!_bgImageView){
|
||||
CGFloat width = _isFirst == YES ? kGetScaleWidth(100):kGetScaleWidth(65);
|
||||
_bgImageView = [UIImageView new];
|
||||
_bgImageView.image = [UIImage imageNamed:@"room_first_recharge_cell_bg"];
|
||||
UIImage *bgImage = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0xF4D2FF),UIColorFromRGB(0xF8E9FD)] gradientType:GradientTypeTopToBottom imgSize:CGSizeMake(width, width)];
|
||||
_bgImageView.backgroundColor = [UIColor colorWithPatternImage:bgImage];
|
||||
UIImage *lineImage = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0xF8D6FF),UIColorFromRGB(0xF0BEFF)] gradientType:GradientTypeTopToBottom imgSize:CGSizeMake(width, width)];
|
||||
_bgImageView.layer.borderWidth = kGetScaleWidth(2);
|
||||
_bgImageView.layer.borderColor = [UIColor colorWithPatternImage:lineImage].CGColor;
|
||||
_bgImageView.layer.cornerRadius = _isFirst == YES ? kGetScaleWidth(10) : kGetScaleWidth(6);
|
||||
_bgImageView.layer.masksToBounds = YES;
|
||||
}
|
||||
return _bgImageView;
|
||||
}
|
||||
- (UIImageView *)iconImageView {
|
||||
if (!_iconImageView) {
|
||||
CGFloat width = _isFirst == YES ? kGetScaleWidth(74):kGetScaleWidth(48);
|
||||
NetImageConfig * config = [[NetImageConfig alloc] init];
|
||||
config.imageType = ImageTypeUserIcon;
|
||||
_iconImageView = [[NetImageView alloc] initWithConfig:config];
|
||||
UIImage *image = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0xF8D6FF),UIColorFromRGB(0xF0BEFF)] gradientType:GradientTypeTopToBottom imgSize:CGSizeMake(width, width)];
|
||||
_iconImageView.image = image;
|
||||
_iconImageView.contentMode = UIViewContentModeScaleAspectFit;
|
||||
}
|
||||
return _iconImageView;
|
||||
}
|
||||
|
||||
- (UILabel *)titleLabel{
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.textColor = UIColorFromRGB(0x7E26B0);
|
||||
_titleLabel.font = _isFirst == YES ? [UIFont systemFontOfSize:13] : [UIFont systemFontOfSize:11];
|
||||
_titleLabel.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
- (UIButton *)timeButton{
|
||||
if (!_timeButton) {
|
||||
CGSize size = _isFirst == YES ? CGSizeMake(kGetScaleWidth(40), kGetScaleWidth(12)):CGSizeMake(kGetScaleWidth(29), kGetScaleWidth(11));
|
||||
CGFloat corner = _isFirst == YES ? kGetScaleWidth(7):kGetScaleWidth(4);
|
||||
_timeButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_timeButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
_timeButton.titleLabel.font = [UIFont systemFontOfSize:9];
|
||||
_timeButton.backgroundColor = [UIColor colorWithPatternImage:[UIImage gradientColorImageFromColors:@[UIColorFromRGB(0xE669F7),UIColorFromRGB(0xE98EF4)] gradientType:GradientTypeLeftToRight imgSize:size]];
|
||||
_timeButton.hidden = YES;
|
||||
[_timeButton setCornerWithLeftTopCorner:corner rightTopCorner:0 bottomLeftCorner:0 bottomRightCorner:corner size:size];
|
||||
}
|
||||
return _timeButton;
|
||||
}
|
||||
|
||||
@end
|
@@ -1,17 +0,0 @@
|
||||
//
|
||||
// YMFirstRechargeSuccessView.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/12/24.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class FirstRechargeModel;
|
||||
@interface XPFirstRechargeSuccessView : UIView
|
||||
|
||||
@property (nonatomic,strong) FirstRechargeModel *rechargeInfo;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,201 +0,0 @@
|
||||
//
|
||||
// YMFirstRechargeSuccessView.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2021/12/24.
|
||||
//
|
||||
|
||||
#import "XPFirstRechargeSuccessView.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
///Tool
|
||||
#import "UIImage+Utils.h"
|
||||
#import "ThemeColor+FirstRecharge.h"
|
||||
#import "XPFirstRechargeFlowLayout.h"
|
||||
#import "TTPopup.h"
|
||||
#import "NSArray+Safe.h"
|
||||
///Model
|
||||
#import "FirstRechargeModel.h"
|
||||
///View
|
||||
#import "XPFirstRechargeCollectionViewCell.h"
|
||||
|
||||
@interface XPFirstRechargeSuccessView ()<UICollectionViewDelegate, UICollectionViewDataSource>
|
||||
///背景图
|
||||
@property (nonatomic,strong) UIImageView *backImageView;
|
||||
///奖励的背景
|
||||
@property (nonatomic,strong) UIImageView * rewardBackView;
|
||||
///额外的奖励说明
|
||||
@property (nonatomic,strong) UIButton *extraButton;
|
||||
///列表
|
||||
@property (nonatomic,strong) UICollectionView *collectionView;
|
||||
///提示
|
||||
@property (nonatomic,strong) UILabel *descriptionLabel;
|
||||
///知道了
|
||||
@property (nonatomic,strong) UIButton *knownButton;
|
||||
///数据源
|
||||
@property (nonatomic,strong) NSArray *datasource;
|
||||
@end
|
||||
|
||||
@implementation XPFirstRechargeSuccessView
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self addSubview:self.backImageView];
|
||||
[self addSubview:self.knownButton];
|
||||
|
||||
[self.backImageView addSubview:self.rewardBackView];
|
||||
[self.backImageView addSubview:self.descriptionLabel];
|
||||
|
||||
[self.rewardBackView addSubview:self.extraButton];
|
||||
[self.rewardBackView addSubview:self.collectionView];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(290);
|
||||
make.bottom.mas_equalTo(self.knownButton.mas_bottom);
|
||||
}];
|
||||
|
||||
[self.backImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.top.mas_equalTo(self);
|
||||
make.height.mas_equalTo(375);
|
||||
make.width.mas_equalTo(290);
|
||||
}];
|
||||
|
||||
[self.knownButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(185, 45));
|
||||
make.centerX.mas_equalTo(self);
|
||||
make.centerY.mas_equalTo(self.backImageView.mas_bottom);
|
||||
}];
|
||||
|
||||
[self.descriptionLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.trailing.mas_equalTo(self);
|
||||
make.top.mas_equalTo(self.collectionView.mas_bottom).offset(21);
|
||||
}];
|
||||
|
||||
[self.rewardBackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.trailing.mas_equalTo(self.backImageView).inset(20);
|
||||
make.top.mas_equalTo(self.backImageView).offset(70);
|
||||
make.height.mas_equalTo(235);
|
||||
}];
|
||||
|
||||
[self.extraButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(245, 18));
|
||||
make.top.mas_equalTo(self.rewardBackView).offset(10);
|
||||
make.centerX.mas_equalTo(self.rewardBackView);
|
||||
}];
|
||||
|
||||
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.extraButton.mas_bottom);
|
||||
make.leading.trailing.mas_equalTo(self.rewardBackView);
|
||||
make.bottom.mas_equalTo(self.rewardBackView);
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - UICollectionViewDelegate And UICollectionViewDatasource
|
||||
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
|
||||
return self.datasource.count;
|
||||
}
|
||||
|
||||
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||
XPFirstRechargeCollectionViewCell * cell= [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPFirstRechargeCollectionViewCell class]) forIndexPath:indexPath];
|
||||
cell.rewardInfo = [self.datasource xpSafeObjectAtIndex:indexPath.row];
|
||||
return cell;
|
||||
}
|
||||
|
||||
#pragma mark - Event Response
|
||||
- (void)knowButtonAction:(UIButton *)sender {
|
||||
[TTPopup dismiss];
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setRechargeInfo:(FirstRechargeModel *)rechargeInfo {
|
||||
_rechargeInfo = rechargeInfo;
|
||||
self.datasource = _rechargeInfo.firstChargeRewardList;
|
||||
[self.collectionView reloadData];
|
||||
|
||||
NSString * title = rechargeInfo.chargeProdTitle;
|
||||
NSString * chargeMoneyStr = [NSString stringWithFormat:@"%ld", rechargeInfo.chargeMoney];
|
||||
NSString * giveMoneyStr = [NSString stringWithFormat:@"%ld", rechargeInfo.giveMoney];
|
||||
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] initWithString:title attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:12], NSForegroundColorAttributeName:[DJDKMIMOMColor rewardSegmentTextColor]}];
|
||||
[attribute addAttribute:NSForegroundColorAttributeName value:[DJDKMIMOMColor rewardReminderTextColor] range:[title rangeOfString:chargeMoneyStr]];
|
||||
[attribute addAttribute:NSForegroundColorAttributeName value:[DJDKMIMOMColor rewardReminderTextColor] range:[title rangeOfString:giveMoneyStr]];
|
||||
[self.extraButton setAttributedTitle:attribute forState:UIControlStateNormal];
|
||||
}
|
||||
|
||||
- (UICollectionView *)collectionView{
|
||||
if (!_collectionView) {
|
||||
XPFirstRechargeFlowLayout *layout = [[XPFirstRechargeFlowLayout alloc] init];
|
||||
layout.itemSize = CGSizeMake(70, 70+ 16);
|
||||
layout.minimumLineSpacing = 12;
|
||||
layout.sectionInset = UIEdgeInsetsMake(10, 10, 10, 10);
|
||||
_collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
|
||||
_collectionView.dataSource = self;
|
||||
_collectionView.delegate = self;
|
||||
_collectionView.backgroundColor = [UIColor clearColor];
|
||||
[_collectionView registerClass:[XPFirstRechargeCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([XPFirstRechargeCollectionViewCell class])];
|
||||
}
|
||||
return _collectionView;
|
||||
}
|
||||
|
||||
|
||||
- (UIImageView *)backImageView {
|
||||
if (!_backImageView) {
|
||||
_backImageView = [[UIImageView alloc] init];
|
||||
_backImageView.userInteractionEnabled = YES;
|
||||
_backImageView.image = [UIImage imageNamed:@"room_first_recharge_success_bg"];
|
||||
}
|
||||
return _backImageView;
|
||||
}
|
||||
|
||||
- (UILabel *)descriptionLabel {
|
||||
if (!_descriptionLabel) {
|
||||
_descriptionLabel = [[UILabel alloc] init];
|
||||
_descriptionLabel.text = YMLocalizedString(@"XPFirstRechargeSuccessView0");
|
||||
_descriptionLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:10];
|
||||
_descriptionLabel.textAlignment = NSTextAlignmentCenter;
|
||||
_descriptionLabel.textColor = [DJDKMIMOMColor firstRechargeTextColor];
|
||||
}
|
||||
return _descriptionLabel;
|
||||
}
|
||||
|
||||
- (UIButton *)knownButton {
|
||||
if (!_knownButton) {
|
||||
_knownButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_knownButton setBackgroundImage:[UIImage imageNamed:@"room_first_recharge_recharge"] forState:UIControlStateNormal];
|
||||
[_knownButton setBackgroundImage:[UIImage imageNamed:@"room_first_recharge_recharge"] forState:UIControlStateSelected];
|
||||
[_knownButton setTitle:YMLocalizedString(@"XPFirstRechargeSuccessView1") forState:UIControlStateNormal];
|
||||
_knownButton.titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Bold" size:20];
|
||||
[_knownButton setTitleColor:[DJDKMIMOMColor firstRechargeTextColor] forState:UIControlStateNormal];
|
||||
[_knownButton addTarget:self action:@selector(knowButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _knownButton;
|
||||
}
|
||||
|
||||
- (UIButton *)extraButton {
|
||||
if (!_extraButton) {
|
||||
_extraButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_extraButton setBackgroundImage:[UIImage imageNamed:@"room_first_recharge_reward_extra_bg"] forState:UIControlStateNormal];
|
||||
}
|
||||
return _extraButton;
|
||||
}
|
||||
|
||||
- (UIImageView *)rewardBackView {
|
||||
if (!_rewardBackView) {
|
||||
_rewardBackView = [[UIImageView alloc] init];
|
||||
_rewardBackView.image = [UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor rewardBackgroundGradientTopColor], [DJDKMIMOMColor rewardBackgroundGradientMiddleColor], [DJDKMIMOMColor rewardBackgroundGradientTopColor]] gradientType:GradientTypeTopToBottom imgSize:CGSizeMake(10, 10)];
|
||||
_rewardBackView.layer.masksToBounds = YES;
|
||||
_rewardBackView.layer.cornerRadius = 10;
|
||||
}
|
||||
return _rewardBackView;
|
||||
}
|
||||
@end
|
@@ -1,29 +0,0 @@
|
||||
//
|
||||
// XPFirstRechargeView.h
|
||||
// YuMi
|
||||
//
|
||||
// Created by YuMi on 2023/2/27.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol XPFirstRechargeViewDelegate <NSObject>
|
||||
@optional
|
||||
///
|
||||
-(void)rechargeHandle;
|
||||
///联系客服
|
||||
-(void)contactCustomerService;
|
||||
@end
|
||||
|
||||
|
||||
@interface XPFirstRechargeView : UIView
|
||||
@property (nonatomic,copy) NSString * type;
|
||||
@property (nonatomic,copy) NSString * diamonds;
|
||||
///
|
||||
///
|
||||
@property (nonatomic,weak) id<XPFirstRechargeViewDelegate>delegate ;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,485 +0,0 @@
|
||||
//
|
||||
// XPFirstRechargeView.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by YuMi on 2023/2/27.
|
||||
//
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
#import <NIMSDK/NIMSDK.h>
|
||||
///Tool
|
||||
#import <Base64/MF_Base64Additions.h>
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import "ThemeColor+FirstRecharge.h"
|
||||
#import "UIImage+Utils.h"
|
||||
#import "XPFirstRechargeFlowLayout.h"
|
||||
#import "NSArray+Safe.h"
|
||||
#import "XNDJTDDLoadingTool.h"
|
||||
#import "AccountInfoStorage.h"
|
||||
#import "YYUtility.h"
|
||||
#import "Api+Mine.h"
|
||||
#import "Api+Main.h"
|
||||
|
||||
///Model
|
||||
#import "FirstRechargeModel.h"
|
||||
///View
|
||||
#import "XPFirstRechargeCollectionViewCell.h"
|
||||
#import "XPFirstRechargeCollectionView.h"
|
||||
///P
|
||||
#import "XPFirstRechargePresenter.h"
|
||||
#import "XPFirstRechargeProtocol.h"
|
||||
///VC
|
||||
|
||||
|
||||
#import "XPWebViewController.h"
|
||||
#import "XPFirstRechargeView.h"
|
||||
#import "Api+FirstRecharge.h"
|
||||
#import "FirstRechargeModel.h"
|
||||
#import "XPSkillCardPlayerManager.h"
|
||||
#import "YuMi-swift.h"
|
||||
#import "ClientConfig.h"
|
||||
|
||||
#import "IAPManager.h"
|
||||
|
||||
@interface XPFirstRechargeView ()<UICollectionViewDelegate, UICollectionViewDataSource,UICollectionViewDelegateFlowLayout>
|
||||
///
|
||||
@property (nonatomic,strong) UIButton *backBtn;
|
||||
///背景图
|
||||
@property (nonatomic,strong) UIImageView *backImageView;
|
||||
///奖励的容器 segment 额外奖励的 礼物的
|
||||
@property (nonatomic,strong) UIImageView * rewardBackView;
|
||||
///
|
||||
@property (nonatomic,strong) UIImageView *typeArrowView;
|
||||
///tab 切换
|
||||
@property (nonatomic,strong) UIStackView * segmentView;
|
||||
///额外的奖励说明
|
||||
@property (nonatomic,strong) UIButton *extraButton;
|
||||
///列表
|
||||
@property (nonatomic,strong) UICollectionView *collectionView;
|
||||
///奖励说明
|
||||
@property (nonatomic,strong) UIButton *rewardHelpButton;
|
||||
///礼包说明背景
|
||||
@property (nonatomic, strong) UIImageView *descripBgView;
|
||||
///礼包说明
|
||||
@property (nonatomic, strong) SZTextView *descripTextView;
|
||||
///立即充值
|
||||
@property (nonatomic, strong) UIButton *rechargeButton;
|
||||
///数据源
|
||||
@property (nonatomic,strong) NSArray<FirstRechargeRewardModel *> *rewardArray;
|
||||
///初始数据源
|
||||
@property (nonatomic,strong) NSArray<FirstRechargeModel *> *originArray;
|
||||
///当前的导航栏
|
||||
@property (nonatomic,weak) UINavigationController * currentNav;
|
||||
///
|
||||
@property (nonatomic,strong) XPFirstRechargeCollectionView *rechargeView;
|
||||
@property (nonatomic,strong) FirstRechargeModel *currentInfo;
|
||||
@property (nonatomic,copy) NSString *orderId;
|
||||
|
||||
@end
|
||||
@implementation XPFirstRechargeView
|
||||
|
||||
- (void)dealloc {
|
||||
|
||||
}
|
||||
|
||||
|
||||
-(instancetype)initWithFrame:(CGRect)frame{
|
||||
self = [super initWithFrame:frame];
|
||||
if(self){
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
[self getFirstRechargeRewardList];
|
||||
|
||||
for (id view in self.descripTextView.subviews) {
|
||||
if ([view isKindOfClass:[UITextView class]]){
|
||||
UITextView *textView = view;
|
||||
textView.textAlignment = NSTextAlignmentLeft;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)getFirstRechargeRewardList{
|
||||
[XNDJTDDLoadingTool showLoading];
|
||||
|
||||
@kWeakify(self);
|
||||
[Api firstRechargeRewardList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
@kStrongify(self);
|
||||
[XNDJTDDLoadingTool hideHUD];
|
||||
if(code == 200){
|
||||
NSArray * array = [FirstRechargeModel modelsWithArray:data.data];
|
||||
[self getFirstRechargeListSuccess:array];
|
||||
return;
|
||||
}
|
||||
[XNDJTDDLoadingTool showErrorWithMessage:msg];
|
||||
} channelType:@"3"];
|
||||
}
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
self.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5];
|
||||
[self addSubview:self.backBtn];
|
||||
[self addSubview:self.backImageView];
|
||||
[self.backImageView addSubview:self.rewardHelpButton];
|
||||
|
||||
[self.backImageView addSubview:self.segmentView];
|
||||
[self.backImageView addSubview:self.rewardBackView];
|
||||
[self.backImageView addSubview:self.typeArrowView];
|
||||
[self.rewardBackView addSubview:self.extraButton];
|
||||
[self.backImageView addSubview:self.rechargeButton];
|
||||
[self.rewardBackView addSubview:self.collectionView];
|
||||
[self.rewardBackView addSubview:self.rechargeView];
|
||||
[self addSubview:self.descripBgView];
|
||||
[self.descripBgView addSubview:self.descripTextView];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.backBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self);
|
||||
}];
|
||||
[self.backImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.center.mas_equalTo(self);
|
||||
make.height.mas_equalTo(kGetScaleWidth(460));
|
||||
make.width.mas_equalTo(kGetScaleWidth(306));
|
||||
}];
|
||||
[self.rewardHelpButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.trailing.mas_equalTo(-kGetScaleWidth(11));
|
||||
make.top.mas_equalTo(kGetScaleWidth(121));
|
||||
make.width.height.mas_equalTo(kGetScaleWidth(20));
|
||||
}];
|
||||
[self.segmentView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.rewardHelpButton.mas_bottom).mas_offset(kGetScaleWidth(12));
|
||||
make.height.mas_equalTo(kGetScaleWidth(30));
|
||||
make.trailing.mas_equalTo(-kGetScaleWidth(15));
|
||||
make.leading.mas_equalTo(kGetScaleWidth(15));
|
||||
}];
|
||||
[self.rewardBackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.trailing.equalTo(self.segmentView);
|
||||
make.top.mas_equalTo(self.segmentView.mas_bottom).offset(kGetScaleWidth(12));
|
||||
make.height.mas_equalTo(kGetScaleWidth(230));
|
||||
}];
|
||||
[self.typeArrowView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.mas_equalTo(kGetScaleWidth(15));
|
||||
make.width.mas_equalTo(kGetScaleWidth(13));
|
||||
make.height.mas_equalTo(kGetScaleWidth(7));
|
||||
make.bottom.equalTo(self.rewardBackView.mas_top);
|
||||
}];
|
||||
|
||||
[self.extraButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(kGetScaleWidth(276), kGetScaleWidth(20)));
|
||||
make.top.mas_equalTo(kGetScaleWidth(11));
|
||||
make.centerX.mas_equalTo(self.rewardBackView);
|
||||
}];
|
||||
[self.rechargeButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(kGetScaleWidth(183), kGetScaleWidth(54)));
|
||||
make.centerX.mas_equalTo(self.backImageView);
|
||||
make.centerY.mas_equalTo(self.backImageView.mas_bottom);
|
||||
}];
|
||||
|
||||
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.extraButton.mas_bottom);
|
||||
make.leading.trailing.mas_equalTo(self.rewardBackView);
|
||||
make.bottom.mas_equalTo(self.rewardBackView);
|
||||
}];
|
||||
[self.rechargeView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo(kGetScaleWidth(127));
|
||||
make.center.equalTo(self.collectionView);
|
||||
make.width.mas_equalTo(kGetScaleWidth(100));
|
||||
}];
|
||||
[self.descripBgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.rewardHelpButton.mas_bottom).mas_offset(-2);
|
||||
make.trailing.equalTo(self.backImageView.mas_trailing).mas_offset(4);
|
||||
make.width.mas_equalTo(152);
|
||||
make.height.mas_equalTo(81);
|
||||
}];
|
||||
[self.descripTextView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.descripBgView).offset(10);
|
||||
make.trailing.mas_equalTo(self.descripBgView).inset(5);
|
||||
make.leading.mas_equalTo(self.descripBgView).inset(10);
|
||||
make.bottom.mas_equalTo(self.descripBgView).mas_offset(-10);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)createExtraRewardAttrebute:(FirstRechargeModel *)model {
|
||||
self.descripTextView.text = model.chargeProdDesc;
|
||||
|
||||
NSString * title = model.chargeProdTitle;
|
||||
NSString * giveMoneyStr = [NSString stringWithFormat:@"%ld", model.giveMoney];
|
||||
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] initWithString:title attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:12], NSForegroundColorAttributeName:UIColorFromRGB(0xBE5AF6)}];
|
||||
[attribute addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:12 weight:UIFontWeightSemibold] range:[title rangeOfString:giveMoneyStr]];
|
||||
[self.extraButton setAttributedTitle:attribute forState:UIControlStateNormal];
|
||||
}
|
||||
|
||||
#pragma mark - XPFirstRechargeProtocol
|
||||
- (void)getFirstRechargeListSuccess:(NSArray *)array {
|
||||
if (array.count <= 0) return;
|
||||
self.typeArrowView.hidden = NO;
|
||||
self.originArray = array;
|
||||
self.currentInfo = [array xpSafeObjectAtIndex:0];
|
||||
if (self.segmentView.arrangedSubviews.count > 0) {
|
||||
[[self.segmentView arrangedSubviews] enumerateObjectsUsingBlock:^(__kindof UIView * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
[obj removeFromSuperview];
|
||||
}];
|
||||
}
|
||||
for (int i = 0 ; i < array.count; i++) {
|
||||
FirstRechargeModel * modelInfo = [array xpSafeObjectAtIndex:i];
|
||||
NSString * title = [NSString stringWithFormat:@"$%.2f", modelInfo.chargeMoney];
|
||||
UIButton * button = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[button setTitleColor:[UIColor whiteColor] forState:UIControlStateSelected];
|
||||
[button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
button.titleLabel.font = [UIFont systemFontOfSize:15 weight:UIFontWeightMedium];
|
||||
[button setTitle:title forState:UIControlStateNormal];
|
||||
[button setTitle:title forState:UIControlStateSelected];
|
||||
button.tag = i;
|
||||
|
||||
[button addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[button setBackgroundImage:[UIImage imageWithColor:[UIColor clearColor]] forState:UIControlStateNormal];
|
||||
[button setBackgroundImage:[UIImage imageNamed:@"room_first_recharge_segment_select"] forState:UIControlStateSelected];
|
||||
[self.segmentView addArrangedSubview:button];
|
||||
if (i == 0) {
|
||||
button.selected = YES;
|
||||
[self createExtraRewardAttrebute:modelInfo];
|
||||
self.rewardArray = modelInfo.firstChargeRewardList;
|
||||
[self.collectionView reloadData];
|
||||
button.layer.cornerRadius = 0;
|
||||
button.layer.masksToBounds = YES;
|
||||
button.layer.borderWidth = 0;
|
||||
}else{
|
||||
button.layer.cornerRadius = kGetScaleWidth(8);
|
||||
button.layer.masksToBounds = YES;
|
||||
button.layer.borderWidth = kGetScaleWidth(1);
|
||||
button.layer.borderColor = [UIColor colorWithWhite:1 alpha:0.5].CGColor;
|
||||
button.backgroundColor = [UIColor colorWithWhite:1 alpha:0.3];
|
||||
}
|
||||
}
|
||||
[self.segmentView layoutIfNeeded];
|
||||
CGFloat x = kGetScaleWidth(15) + self.segmentView.arrangedSubviews.firstObject.frame.origin.x + self.segmentView.arrangedSubviews.firstObject.frame.size.width / 2 - kGetScaleWidth(7)/2;
|
||||
[self.typeArrowView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.mas_equalTo(x);
|
||||
}];
|
||||
self.collectionView.hidden = self.rewardArray.count < 2;
|
||||
self.rechargeView.hidden = self.rewardArray.count != 1;
|
||||
if(self.rewardArray.count == 1){
|
||||
self.rechargeView.rewardInfo = self.rewardArray.firstObject;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - UICollectionViewDelegate And UICollectionViewDatasource
|
||||
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
|
||||
return self.rewardArray.count;
|
||||
}
|
||||
|
||||
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||
XPFirstRechargeCollectionViewCell * cell= [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPFirstRechargeCollectionViewCell class]) forIndexPath:indexPath];
|
||||
cell.rewardInfo = [self.rewardArray xpSafeObjectAtIndex:indexPath.row];
|
||||
return cell;
|
||||
}
|
||||
|
||||
#pragma mark - Event Response
|
||||
- (void)rewardHelpButtonAction:(UIButton *)sender {
|
||||
sender.selected = !sender.selected;
|
||||
self.descripBgView.hidden = !sender.selected;
|
||||
}
|
||||
|
||||
- (void)rechargeButtonAction {
|
||||
if (self.currentInfo == nil|| self.currentInfo.chargeProdId == nil) {
|
||||
return;
|
||||
}
|
||||
FirstRechargeModel *model = self.currentInfo;
|
||||
if (model.chargeProdId) {
|
||||
[XNDJTDDLoadingTool showOnlyView:kWindow];
|
||||
@kWeakify(self);
|
||||
[[IAPManager sharedManager] purchase:model.chargeProdId
|
||||
success:^(NSString *transactionID, NSString *orderID){
|
||||
[XNDJTDDLoadingTool hideOnlyView:kWindow];
|
||||
} failure:^(NSError * _Nonnull error) {
|
||||
[XNDJTDDLoadingTool hideOnlyView:kWindow];
|
||||
} contactCS:^(NSString * _Nonnull uid) {
|
||||
@kStrongify(self);
|
||||
[XNDJTDDLoadingTool hideOnlyView:kWindow];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
if(self.delegate && [self.delegate respondsToSelector:@selector(contactCustomerService)]){
|
||||
[self.delegate contactCustomerService];
|
||||
}
|
||||
[self backAction];
|
||||
});
|
||||
}];
|
||||
}
|
||||
}
|
||||
-(void)backAction{
|
||||
[self removeFromSuperview];
|
||||
}
|
||||
- (void)buttonAction:(UIButton *)sender {
|
||||
if (sender.tag <= self.originArray.count) {
|
||||
FirstRechargeModel * model = [self.originArray xpSafeObjectAtIndex:sender.tag];
|
||||
self.currentInfo = model;
|
||||
[self createExtraRewardAttrebute:model];
|
||||
self.rewardArray = model.firstChargeRewardList;
|
||||
self.collectionView.hidden = self.rewardArray.count < 2;
|
||||
self.rechargeView.hidden = self.rewardArray.count != 1;
|
||||
if(self.rewardArray.count == 1){
|
||||
self.rechargeView.rewardInfo = self.rewardArray.firstObject;
|
||||
}
|
||||
[self.collectionView reloadData];
|
||||
}
|
||||
CGFloat x = kGetScaleWidth(15) + sender.frame.origin.x + sender.frame.size.width / 2 - kGetScaleWidth(7)/2;
|
||||
[self.typeArrowView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.mas_equalTo(x);
|
||||
}];
|
||||
[[self.segmentView arrangedSubviews] enumerateObjectsUsingBlock:^(__kindof UIView * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
UIButton * button = obj;
|
||||
if (button.tag <= self.originArray.count) {
|
||||
FirstRechargeModel * model = [self.originArray xpSafeObjectAtIndex:sender.tag];
|
||||
[self createExtraRewardAttrebute:model];
|
||||
}
|
||||
button.selected = NO;
|
||||
if (sender.tag == button.tag) {
|
||||
button.layer.cornerRadius = 0;
|
||||
button.layer.borderWidth = 0;
|
||||
button.backgroundColor = [UIColor clearColor];
|
||||
}else{
|
||||
button.layer.cornerRadius = kGetScaleWidth(8);
|
||||
button.layer.masksToBounds = YES;
|
||||
button.layer.borderWidth = kGetScaleWidth(1);
|
||||
button.layer.borderColor = [UIColor colorWithWhite:1 alpha:0.5].CGColor;
|
||||
button.backgroundColor = [UIColor colorWithWhite:1 alpha:0.3];
|
||||
}
|
||||
}];
|
||||
sender.selected = !sender.selected;
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (UICollectionView *)collectionView{
|
||||
if (!_collectionView) {
|
||||
XPFirstRechargeFlowLayout *layout = [[XPFirstRechargeFlowLayout alloc] init];
|
||||
layout.itemSize = CGSizeMake(kGetScaleWidth(65), kGetScaleWidth(96));
|
||||
layout.minimumLineSpacing = kGetScaleWidth(9);
|
||||
layout.sectionInset = UIEdgeInsetsMake(kGetScaleWidth(11), kGetScaleWidth(18), kGetScaleWidth(12), kGetScaleWidth(17));
|
||||
_collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
|
||||
_collectionView.dataSource = self;
|
||||
_collectionView.delegate = self;
|
||||
_collectionView.backgroundColor = [UIColor clearColor];
|
||||
[_collectionView registerClass:[XPFirstRechargeCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([XPFirstRechargeCollectionViewCell class])];
|
||||
}
|
||||
return _collectionView;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
- (UIImageView *)backImageView {
|
||||
if (!_backImageView) {
|
||||
_backImageView = [[UIImageView alloc] init];
|
||||
_backImageView.userInteractionEnabled = YES;
|
||||
_backImageView.image = [UIImage imageNamed:@"room_first_recharge_bg"];
|
||||
}
|
||||
return _backImageView;
|
||||
}
|
||||
|
||||
- (UIImageView *)rewardBackView {
|
||||
if (!_rewardBackView) {
|
||||
_rewardBackView = [[UIImageView alloc] init];
|
||||
_rewardBackView.layer.backgroundColor = [UIColor colorWithRed:255/255.0 green:255/255.0 blue:255/255.0 alpha:1.0].CGColor;
|
||||
_rewardBackView.layer.cornerRadius = kGetScaleWidth(16);
|
||||
_rewardBackView.layer.masksToBounds = YES;
|
||||
_rewardBackView.layer.shadowColor = [UIColor colorWithRed:240/255.0 green:162/255.0 blue:244/255.0 alpha:1.0].CGColor;
|
||||
_rewardBackView.layer.shadowOffset = CGSizeMake(0,kGetScaleWidth(2));
|
||||
_rewardBackView.layer.shadowOpacity = kGetScaleWidth(1);
|
||||
_rewardBackView.layer.shadowRadius = kGetScaleWidth(4);
|
||||
_rewardBackView.userInteractionEnabled = YES;
|
||||
|
||||
_rewardBackView.backgroundColor = [UIColor whiteColor];
|
||||
}
|
||||
return _rewardBackView;
|
||||
}
|
||||
|
||||
- (UIButton *)extraButton {
|
||||
if (!_extraButton) {
|
||||
_extraButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_extraButton setBackgroundImage:[UIImage imageNamed:@"room_first_recharge_extra"] forState:UIControlStateNormal];
|
||||
|
||||
}
|
||||
return _extraButton;
|
||||
}
|
||||
|
||||
- (UIStackView *)segmentView {
|
||||
if (!_segmentView) {
|
||||
_segmentView = [[UIStackView alloc] init];
|
||||
_segmentView.axis = UILayoutConstraintAxisHorizontal;
|
||||
_segmentView.distribution = UIStackViewDistributionFillEqually;
|
||||
_segmentView.alignment = UIStackViewAlignmentFill;
|
||||
_segmentView.spacing = kGetScaleWidth(12);
|
||||
}
|
||||
return _segmentView;
|
||||
}
|
||||
|
||||
- (UIImageView *)descripBgView {
|
||||
if (!_descripBgView) {
|
||||
_descripBgView = [[UIImageView alloc] init];
|
||||
_descripBgView.image = [[UIImage imageNamed:@"room_first_recharge_descrip_bg"] resizableImageWithCapInsets:UIEdgeInsetsMake(35, 120, 35, 20) resizingMode:UIImageResizingModeStretch];
|
||||
_descripBgView.contentMode = UIViewContentModeScaleToFill;
|
||||
_descripBgView.hidden = YES;
|
||||
}
|
||||
return _descripBgView;
|
||||
}
|
||||
|
||||
- (SZTextView *)descripTextView {
|
||||
if (!_descripTextView) {
|
||||
_descripTextView = [[SZTextView alloc] init];
|
||||
_descripTextView.text = YMLocalizedString(@"XPFirstRechargeViewController0");
|
||||
_descripTextView.textColor = UIColorFromRGB(0x333333);
|
||||
_descripTextView.backgroundColor = [UIColor clearColor];
|
||||
_descripTextView.font = [UIFont systemFontOfSize:11];
|
||||
_descripTextView.editable = NO;
|
||||
}
|
||||
return _descripTextView;
|
||||
}
|
||||
|
||||
- (UIButton *)rewardHelpButton {
|
||||
if (!_rewardHelpButton) {
|
||||
_rewardHelpButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_rewardHelpButton setImage:[UIImage imageNamed:@"room_first_recharge_help"] forState:UIControlStateNormal];
|
||||
[_rewardHelpButton setImage:[UIImage imageNamed:@"room_first_recharge_help"] forState:UIControlStateSelected];
|
||||
[_rewardHelpButton addTarget:self action:@selector(rewardHelpButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _rewardHelpButton;
|
||||
}
|
||||
|
||||
- (UIButton *)rechargeButton {
|
||||
if (!_rechargeButton) {
|
||||
_rechargeButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_rechargeButton setBackgroundImage:[UIImage imageNamed:@"room_first_recharge_recharge"] forState:UIControlStateNormal];
|
||||
[_rechargeButton setBackgroundImage:[UIImage imageNamed:@"room_first_recharge_recharge"] forState:UIControlStateSelected];
|
||||
[_rechargeButton setTitle:YMLocalizedString(@"XPFirstRechargeViewController1") forState:UIControlStateNormal];
|
||||
_rechargeButton.titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightSemibold];
|
||||
[_rechargeButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
[_rechargeButton addTarget:self action:@selector(rechargeButtonAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _rechargeButton;
|
||||
}
|
||||
- (UIImageView *)typeArrowView{
|
||||
if (!_typeArrowView){
|
||||
_typeArrowView = [UIImageView new];
|
||||
_typeArrowView.image = [UIImage imageNamed:@"room_first_recharge_recharge_arrow"];
|
||||
_typeArrowView.hidden = YES;
|
||||
}
|
||||
return _typeArrowView;
|
||||
}
|
||||
- (XPFirstRechargeCollectionView *)rechargeView{
|
||||
if (!_rechargeView){
|
||||
_rechargeView = [[XPFirstRechargeCollectionView alloc]initWithFrame:CGRectZero isFirst:YES];
|
||||
_rechargeView.hidden = YES;
|
||||
}
|
||||
return _rechargeView;
|
||||
}
|
||||
- (UIButton *)backBtn{
|
||||
if (!_backBtn){
|
||||
_backBtn = [UIButton new];
|
||||
[_backBtn addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
}
|
||||
return _backBtn;
|
||||
}
|
||||
|
||||
@end
|
@@ -536,17 +536,20 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey";
|
||||
}
|
||||
if (attachment.first == CustomMessageType_RedPacket) {
|
||||
return NO;
|
||||
} else if (attachment.first == CustomMessageType_Face && attachment.second == Custom_Message_Sub_Face_Send) {
|
||||
if ([attachment.data[@"data"] isKindOfClass:[NSArray class]]) {
|
||||
NSArray * array = [RoomFaceSendInfoModel modelsWithArray:attachment.data[@"data"]];
|
||||
for (int i = 0; i< array.count; i++) {
|
||||
RoomFaceSendInfoModel * sendInfo = [array xpSafeObjectAtIndex:i];
|
||||
if (sendInfo.resultIndexes.count <=0) {
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
}
|
||||
}else if (attachment.first == CustomMessageType_Room_PK && attachment.second == Custom_Message_Sub_Room_PK_Manager_Up_Mic) {
|
||||
|
||||
// if (attachment.first == CustomMessageType_Face && attachment.second == Custom_Message_Sub_Face_Send) {
|
||||
// if ([attachment.data[@"data"] isKindOfClass:[NSArray class]]) {
|
||||
// NSArray * array = [RoomFaceSendInfoModel modelsWithArray:attachment.data[@"data"]];
|
||||
// for (int i = 0; i< array.count; i++) {
|
||||
// RoomFaceSendInfoModel * sendInfo = [array xpSafeObjectAtIndex:i];
|
||||
// if (sendInfo.resultIndexes.count <=0) {
|
||||
// return NO;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
if (attachment.first == CustomMessageType_Room_PK && attachment.second == Custom_Message_Sub_Room_PK_Manager_Up_Mic) {
|
||||
if (attachment.data && [attachment.data allKeys].count > 0) {
|
||||
for (NSDictionary * dic in [attachment.data allValues]) {
|
||||
RoomPKChooseUserModel * userModel = [RoomPKChooseUserModel modelWithDictionary:dic];
|
||||
@@ -914,7 +917,8 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey";
|
||||
}
|
||||
break;
|
||||
case CustomMessageType_Face: {
|
||||
NSInteger delay = 0;
|
||||
// MARK: 只处理带结果内容的特殊表情
|
||||
NSInteger delay = -1;
|
||||
if ([message.messageObject isKindOfClass:[NIMCustomObject class]]) {
|
||||
NIMCustomObject *obj = (NIMCustomObject *)message.messageObject;
|
||||
AttachmentModel *attachment =(AttachmentModel *)obj.attachment;
|
||||
@@ -930,10 +934,12 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey";
|
||||
}
|
||||
}
|
||||
|
||||
if (delay > 0 ) {
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delay * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[self addRoomMessage:message];
|
||||
});
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@@ -32,7 +32,6 @@
|
||||
#import "XPSailingViewController.h"
|
||||
#import "XCCurrentVCStackManager.h"
|
||||
#import "XPCandyTreeViewController.h"
|
||||
#import "XPFirstRechargeSuccessView.h"
|
||||
#import "XPArrangeMicViewController.h"
|
||||
#import "XPTreasureFairyViewController.h"
|
||||
|
||||
@@ -40,7 +39,6 @@
|
||||
#import "LuckyPackageLogicManager.h"
|
||||
#import "OpenLuckyPackageEntranceView.h"
|
||||
|
||||
UIKIT_EXTERN NSString *kShowFirstRechargeView;
|
||||
|
||||
static CGFloat const kMenuItemSpacing = 4.0f;
|
||||
static CGFloat const kMenuItemInset = 15.0f;
|
||||
@@ -740,10 +738,6 @@ static CGFloat const kNormalHeight = 160.0f;
|
||||
switch (attachment.first) {
|
||||
case CustomMessageType_First_Recharge_Reward: {
|
||||
if (attachment.second == Custom_Message_Sub_Room_First_Recharge_Reward) {
|
||||
FirstRechargeModel *model = [FirstRechargeModel modelWithJSON:attachment.data];
|
||||
XPFirstRechargeSuccessView * firstRechargeView= [[XPFirstRechargeSuccessView alloc] init];
|
||||
firstRechargeView.rechargeInfo = model;
|
||||
[TTPopup popupView:firstRechargeView style:TTPopupStyleAlert];
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -869,7 +863,7 @@ static CGFloat const kNormalHeight = 160.0f;
|
||||
}
|
||||
|
||||
- (void)firstRechargeTapRecognizer {
|
||||
[[NSNotificationCenter defaultCenter]postNotificationName:kShowFirstRechargeView object:nil];
|
||||
|
||||
}
|
||||
|
||||
- (void)lookLoveTapRecognizer {
|
||||
|
@@ -53,7 +53,7 @@
|
||||
static NSString * const kTargetUidKey = @"targetUid";
|
||||
|
||||
UIKIT_EXTERN NSString * const kFreeGiftCountdownNotification;
|
||||
UIKIT_EXTERN NSString * kShowFirstRechargeView;
|
||||
|
||||
|
||||
@interface XPSendGiftView ()< XPGiftBarViewDelegate, XPGiftProtocol, XPGraffitiGiftViewDelegate, XPGiftUsersViewDelegate, XPGiftHeadTypeViewDelegate, XPGiftLuckyGiftBroadcastViewDelegate, XPGiftTwelveStarBroadcastViewDelegate,PIGiftInfoSegmentedViewDelegate,PIGiftSuperGiftBroadcastViewDelegate>
|
||||
///顶部的区域
|
||||
@@ -697,7 +697,7 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
|
||||
@kWeakify(self);
|
||||
[self dismissViewControllerAnimated:NO completion:^{
|
||||
@kStrongify(self);
|
||||
[[NSNotificationCenter defaultCenter]postNotificationName:kShowFirstRechargeView object:@{@"type":@"1",@"diamonds": self.giftBarView.walletInfoModel.diamonds ?: @"0"}];
|
||||
// [[NSNotificationCenter defaultCenter]postNotificationName:kShowFirstRechargeView object:@{@"type":@"1",@"diamonds": self.giftBarView.walletInfoModel.diamonds ?: @"0"}];
|
||||
}];
|
||||
}
|
||||
|
||||
@@ -753,7 +753,7 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
|
||||
@kWeakify(self);
|
||||
[self dismissViewControllerAnimated:NO completion:^{
|
||||
@kStrongify(self);
|
||||
[[NSNotificationCenter defaultCenter]postNotificationName:kShowFirstRechargeView object:@{@"type":@"1",@"diamonds": self.giftBarView.walletInfoModel.diamonds ?: @"0"}];
|
||||
// [[NSNotificationCenter defaultCenter]postNotificationName:kShowFirstRechargeView object:@{@"type":@"1",@"diamonds": self.giftBarView.walletInfoModel.diamonds ?: @"0"}];
|
||||
}];
|
||||
|
||||
}
|
||||
@@ -1097,7 +1097,7 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
|
||||
- (void)showNotSufficientFundsWithToast:(NSString *)msg {
|
||||
if (self.delegate.getUserInfo.isFirstCharge) {
|
||||
[self dismissViewControllerAnimated:NO completion:^{
|
||||
[[NSNotificationCenter defaultCenter]postNotificationName:kShowFirstRechargeView object:@{@"type":self.delegate != nil ? @"2" : @"9",@"diamonds": self.giftBarView.walletInfoModel.diamonds ?: @"0"}];
|
||||
// [[NSNotificationCenter defaultCenter]postNotificationName:kShowFirstRechargeView object:@{@"type":self.delegate != nil ? @"2" : @"9",@"diamonds": self.giftBarView.walletInfoModel.diamonds ?: @"0"}];
|
||||
}];
|
||||
} else {
|
||||
[self showErrorToast:msg];
|
||||
|
@@ -35,7 +35,6 @@
|
||||
#import "ContentLevelUpgradeModel.h"
|
||||
#import "XPReceiveRedPacketModel.h"
|
||||
#import "XPRedPacketModel.h"
|
||||
#import "FirstChargeRoomWindowModel.h"
|
||||
#import "XPFreeGiftModel.h"
|
||||
#import "XPUserCardInfoModel.h"
|
||||
///View
|
||||
@@ -61,7 +60,6 @@
|
||||
#import "AnchorRoomScrollView.h"
|
||||
#import "AnchorRoomSrollTipView.h"
|
||||
#import "XPReceiveRedPacketView.h"
|
||||
#import "XPFirstRechargeView.h"
|
||||
#import "XPWebViewController.h"
|
||||
#import "SessionViewController.h"
|
||||
#import "XPFreeGiftsObtainView.h"
|
||||
@@ -100,7 +98,6 @@
|
||||
UIKIT_EXTERN NSString * const kRoomGiftEffectUpdateNotificationKey;
|
||||
UIKIT_EXTERN NSString * const kRoomMiniNotificationKey;
|
||||
UIKIT_EXTERN NSString * kNewUserRechargeKey;
|
||||
UIKIT_EXTERN NSString * kShowFirstRechargeView;
|
||||
UIKIT_EXTERN NSString * const kFreeGiftCountdownNotification;
|
||||
NSString * const kHadShowAnchorRoomTipKey = @"kHadShowAnchorRoomTipKey";//是否展示过个播房上划用户引导
|
||||
NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出过非自己房间
|
||||
@@ -114,7 +111,6 @@ NIMConversationManagerDelegate,
|
||||
NIMLoginManagerDelegate,
|
||||
XPRoomSettingInputViewDelegate,
|
||||
AnchorRoomScrollViewDelegate,
|
||||
XPFirstRechargeViewDelegate,
|
||||
NIMBroadcastManagerDelegate,
|
||||
XPRoomLittleGameContainerViewDelegate,
|
||||
CountDownHelperDelegate,
|
||||
@@ -179,10 +175,7 @@ XPCandyTreeInsufficientBalanceViewDelegate>
|
||||
@property (nonatomic,strong) NSMutableArray<NSString *> *anchorRoomList;
|
||||
///序号
|
||||
@property (nonatomic,assign) NSInteger anchorIndex;
|
||||
///首充
|
||||
@property (nonatomic,strong) XPFirstRechargeView *firstRechargeView;
|
||||
///是否显示首充
|
||||
@property (nonatomic,assign) BOOL isShowFirstRecharge;
|
||||
|
||||
///免费礼物数量
|
||||
@property (nonatomic,strong) XPFreeGiftModel *freeModel;
|
||||
///免费礼物弹窗
|
||||
@@ -421,7 +414,6 @@ XPCandyTreeInsufficientBalanceViewDelegate>
|
||||
|
||||
- (void)setupNotifications {
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(myGiftEffectUpdate:) name:kRoomGiftEffectUpdateNotificationKey object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(showRoomFirstChargeWindowFormNot:) name:kShowFirstRechargeView object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(openRedPacketNotification:) name:@"kOpenRedPacketNotification" object:nil];
|
||||
|
||||
@kWeakify(self);
|
||||
@@ -1142,8 +1134,6 @@ XPCandyTreeInsufficientBalanceViewDelegate>
|
||||
@"isCountdownFinish": @(NO)}];
|
||||
}
|
||||
|
||||
-(void)showRoomFirstChargeWindowFormNot:(NSNotification *)not{}
|
||||
-(void)showRoomFirstChargeWindow{}
|
||||
|
||||
- (void)cancelRoomArrangeMic {
|
||||
///退出排麦
|
||||
@@ -1792,11 +1782,7 @@ XPCandyTreeInsufficientBalanceViewDelegate>
|
||||
[XPRoomMiniManager shareManager].curState = nil;
|
||||
}
|
||||
}
|
||||
- (void)getRoomFirstChargeWindowSuccess:(FirstChargeRoomWindowModel *)model{
|
||||
if(model.needToShow == NO || model.showAfterSecond <= 0 || self.isShowFirstRecharge == YES)return;
|
||||
self.isShowFirstRecharge = YES;
|
||||
[self performSelector:@selector(showRoomFirstChargeWindow) withObject:nil afterDelay:model.showAfterSecond];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - NIMChatroomManagerDelegate
|
||||
- (void)chatroomBeKicked:(NIMChatroomBeKickedResult *)result {
|
||||
@@ -2483,7 +2469,7 @@ XPCandyTreeInsufficientBalanceViewDelegate>
|
||||
}
|
||||
|
||||
[self.menuContainerView menuResignFirstResponder];
|
||||
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(showRoomFirstChargeWindow) object:nil];
|
||||
|
||||
NSDictionary *roomInfoDic = self.roomInfo.model2dictionary != nil ? self.roomInfo.model2dictionary : @{};
|
||||
NSDictionary *userInfoDic = self.userInfo.model2dictionary != nil ? self.userInfo.model2dictionary : @{};
|
||||
NSMutableDictionary *queueDic = self.getMicroQueue != nil ? self.getMicroQueue : [@{} mutableCopy];
|
||||
@@ -2900,15 +2886,6 @@ XPCandyTreeInsufficientBalanceViewDelegate>
|
||||
return _anchorRoomList;
|
||||
}
|
||||
|
||||
- (XPFirstRechargeView *)firstRechargeView{
|
||||
if (!_firstRechargeView){
|
||||
XPFirstRechargeView *firstRechargeView = [[XPFirstRechargeView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)];
|
||||
firstRechargeView.delegate = self;
|
||||
|
||||
_firstRechargeView = firstRechargeView;
|
||||
}
|
||||
return _firstRechargeView;
|
||||
}
|
||||
-(XPFreeGiftsObtainView *)freeView{
|
||||
if (!_freeView){
|
||||
_freeView = [[XPFreeGiftsObtainView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)];
|
||||
|
@@ -1,20 +0,0 @@
|
||||
//
|
||||
// YMNewUserRechargeCollectionViewCell.h
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2022/7/29.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class FirstRechargeRewardModel;
|
||||
@interface XPNewUserRechargeCollectionViewCell : UICollectionViewCell
|
||||
|
||||
///奖励的模型
|
||||
@property (nonatomic,strong) FirstRechargeRewardModel *rewardInfo;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -1,113 +0,0 @@
|
||||
//
|
||||
// YMNewUserRechargeCollectionViewCell.m
|
||||
// YUMI
|
||||
//
|
||||
// Created by YUMI on 2022/7/29.
|
||||
//
|
||||
|
||||
#import "XPNewUserRechargeCollectionViewCell.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
///Tool
|
||||
#import "ThemeColor+FirstRecharge.h"
|
||||
#import "NetImageView.h"
|
||||
#import "UIImage+Utils.h"
|
||||
///Model
|
||||
#import "FirstRechargeRewardModel.h"
|
||||
|
||||
@interface XPNewUserRechargeCollectionViewCell ()
|
||||
///奖励的图片
|
||||
@property (nonatomic, strong) NetImageView *iconImageView;
|
||||
///显示奖励图片
|
||||
@property (nonatomic, strong) UILabel *titleLabel;
|
||||
///显示奖励的时间
|
||||
@property (nonatomic, strong) UIButton *timeButton;
|
||||
@end
|
||||
|
||||
|
||||
@implementation XPNewUserRechargeCollectionViewCell
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews{
|
||||
[self addSubview:self.iconImageView];
|
||||
[self addSubview:self.titleLabel];
|
||||
[self addSubview:self.timeButton];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints{
|
||||
[self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(0);
|
||||
make.centerX.mas_equalTo(self.mas_centerX);
|
||||
make.width.height.mas_equalTo(60);
|
||||
}];
|
||||
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self);
|
||||
make.height.mas_equalTo(17);
|
||||
make.top.mas_equalTo(self.iconImageView.mas_bottom).mas_offset(2);
|
||||
make.leading.mas_equalTo(0);
|
||||
}];
|
||||
|
||||
[self.timeButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.titleLabel.mas_bottom);
|
||||
make.height.mas_equalTo(14);
|
||||
make.centerX.mas_equalTo(self);
|
||||
make.leading.mas_equalTo(0);
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - setupData
|
||||
- (void)setRewardInfo:(FirstRechargeRewardModel *)rewardInfo {
|
||||
_rewardInfo = rewardInfo;
|
||||
self.timeButton.hidden = !(_rewardInfo.showTime > 0);
|
||||
[self.timeButton setTitle:[NSString stringWithFormat:@"(%@)", _rewardInfo.showTime] forState:UIControlStateNormal];
|
||||
self.titleLabel.text = _rewardInfo.showText;
|
||||
self.iconImageView.imageUrl = _rewardInfo.showPir;
|
||||
}
|
||||
|
||||
|
||||
- (UIImageView *)iconImageView {
|
||||
if (!_iconImageView) {
|
||||
NetImageConfig * config = [[NetImageConfig alloc] init];
|
||||
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
|
||||
config.imageType = ImageTypeUserIcon;
|
||||
_iconImageView = [[NetImageView alloc] initWithConfig:config];
|
||||
_iconImageView.backgroundColor = UIColorRGBAlpha(0xFF9CC3, 0.1);
|
||||
_iconImageView.layer.cornerRadius = 8;
|
||||
_iconImageView.layer.masksToBounds = YES;
|
||||
_iconImageView.contentMode = UIViewContentModeScaleAspectFit;
|
||||
}
|
||||
return _iconImageView;
|
||||
}
|
||||
|
||||
- (UILabel *)titleLabel{
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.textColor = [DJDKMIMOMColor mainTextColor];
|
||||
_titleLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium];
|
||||
_titleLabel.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
- (UIButton *)timeButton{
|
||||
if (!_timeButton) {
|
||||
_timeButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_timeButton setTitleColor:[DJDKMIMOMColor textThirdColor] forState:UIControlStateNormal];
|
||||
_timeButton.titleLabel.font = [UIFont systemFontOfSize:10 weight:UIFontWeightMedium];
|
||||
_timeButton.hidden = YES;
|
||||
}
|
||||
return _timeButton;
|
||||
}
|
||||
|
||||
@end
|
@@ -11,6 +11,7 @@
|
||||
#import "ClientConfig.h"
|
||||
#import "LoginViewController.h"
|
||||
#import "BaseNavigationController.h"
|
||||
#import "FirstRechargeManager.h"
|
||||
|
||||
@interface BaseMvpPresenter()
|
||||
|
||||
@@ -29,13 +30,16 @@
|
||||
}
|
||||
|
||||
- (void)logout {
|
||||
// 1. 数据logout
|
||||
// 1. 停止首充监控
|
||||
[[FirstRechargeManager sharedManager] stopMonitoring];
|
||||
|
||||
// 2. 数据logout
|
||||
[[AccountInfoStorage instance] saveAccountInfo:nil];
|
||||
[[AccountInfoStorage instance] saveTicket:nil];
|
||||
if ([NIMSDK sharedSDK].loginManager.isLogined) {
|
||||
[[NIMSDK sharedSDK].loginManager logout:nil];
|
||||
}
|
||||
// 2. 跳登录页面
|
||||
// 3. 跳登录页面
|
||||
[self tokenInvalid];
|
||||
// ///关闭心跳
|
||||
// [[ClientConfig shareConfig] resetHeartBratTimer];
|
||||
|
32
YuMi/Tools/FirstCharge/FirstRechargeManager.h
Normal file
32
YuMi/Tools/FirstCharge/FirstRechargeManager.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "FirstRechargeModel.h"
|
||||
@protocol FirstRechargeManagerDelegate;
|
||||
|
||||
@interface FirstRechargeManager : NSObject
|
||||
|
||||
+ (instancetype)sharedManager;
|
||||
|
||||
@property (nonatomic, weak) id<FirstRechargeManagerDelegate> delegate;
|
||||
@property (nonatomic, strong, readonly) FirstRechargeModel *currentFirstRechargeData;
|
||||
|
||||
- (void)startMonitoring;
|
||||
- (void)stopMonitoring;
|
||||
- (void)manualCheckFirstRecharge;
|
||||
- (void)markTodayShown;
|
||||
|
||||
- (FirstRechargeModel *)loadCurrentModel;
|
||||
|
||||
@end
|
||||
|
||||
@protocol FirstRechargeManagerDelegate <NSObject>
|
||||
|
||||
@required
|
||||
- (void)firstRechargeManager:(FirstRechargeManager *)manager
|
||||
didCheckFirstRecharge:(FirstRechargeModel *)model
|
||||
shouldShow:(BOOL)shouldShow;
|
||||
|
||||
@optional
|
||||
- (void)firstRechargeManager:(FirstRechargeManager *)manager
|
||||
didFailWithError:(NSError *)error;
|
||||
|
||||
@end
|
240
YuMi/Tools/FirstCharge/FirstRechargeManager.m
Normal file
240
YuMi/Tools/FirstCharge/FirstRechargeManager.m
Normal file
@@ -0,0 +1,240 @@
|
||||
//
|
||||
// FirstRechargeManager.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by P on 2025/6/25.
|
||||
//
|
||||
|
||||
#import "FirstRechargeManager.h"
|
||||
#import "FirstRechargeModel.h"
|
||||
#import "Api+FirstRecharge.h"
|
||||
#import "AccountInfoStorage.h"
|
||||
#import "NSDate+DateUtils.h"
|
||||
|
||||
// 存储键
|
||||
static NSString * const kFirstRechargeModelKey = @"FirstRechargeModel";
|
||||
static NSString * const kLastCheckDateKey = @"FirstRechargeLastCheckDate";
|
||||
static NSString * const kTodayShownKey = @"FirstRechargeTodayShown";
|
||||
|
||||
|
||||
|
||||
@interface FirstRechargeManager ()
|
||||
|
||||
@property (nonatomic, strong) FirstRechargeModel *currentFirstRechargeData;
|
||||
@property (nonatomic, strong) NSTimer *dailyTimer;
|
||||
@property (nonatomic, assign) BOOL isMonitoring;
|
||||
|
||||
@end
|
||||
|
||||
@implementation FirstRechargeManager
|
||||
|
||||
+ (instancetype)sharedManager {
|
||||
static FirstRechargeManager *instance = nil;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
instance = [[FirstRechargeManager alloc] init];
|
||||
});
|
||||
return instance;
|
||||
}
|
||||
|
||||
- (instancetype)init {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
_isMonitoring = NO;
|
||||
[self loadCachedModel];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
[self stopMonitoring];
|
||||
}
|
||||
|
||||
#pragma mark - Public Methods
|
||||
|
||||
- (FirstRechargeModel *)loadCurrentModel {
|
||||
return self.currentFirstRechargeData;
|
||||
}
|
||||
|
||||
- (void)startMonitoring {
|
||||
if (self.isMonitoring) {
|
||||
return;
|
||||
}
|
||||
|
||||
self.isMonitoring = YES;
|
||||
|
||||
// 立即检查一次
|
||||
[self checkFirstRechargeStatus];
|
||||
|
||||
// 设置每日定时检查
|
||||
[self setupDailyTimer];
|
||||
|
||||
// 监听应用进入前台事件
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(applicationDidBecomeActive)
|
||||
name:UIApplicationDidBecomeActiveNotification
|
||||
object:nil];
|
||||
}
|
||||
|
||||
- (void)stopMonitoring {
|
||||
if (!self.isMonitoring) {
|
||||
return;
|
||||
}
|
||||
|
||||
self.isMonitoring = NO;
|
||||
|
||||
// 停止定时器
|
||||
if (self.dailyTimer) {
|
||||
[self.dailyTimer invalidate];
|
||||
self.dailyTimer = nil;
|
||||
}
|
||||
|
||||
// 移除通知监听
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
}
|
||||
|
||||
- (void)manualCheckFirstRecharge {
|
||||
[self checkFirstRechargeStatus];
|
||||
}
|
||||
|
||||
- (void)markTodayShown {
|
||||
NSString *today = [self getTodayString];
|
||||
[[NSUserDefaults standardUserDefaults] setObject:today forKey:kTodayShownKey];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
}
|
||||
|
||||
#pragma mark - Private Methods
|
||||
|
||||
- (void)setupDailyTimer {
|
||||
// 计算到明天凌晨的时间间隔
|
||||
NSTimeInterval secondsUntilMidnight = [self secondsUntilNextMidnight];
|
||||
|
||||
// 设置定时器在明天凌晨触发,然后每24小时重复
|
||||
self.dailyTimer = [NSTimer scheduledTimerWithTimeInterval:secondsUntilMidnight
|
||||
target:self
|
||||
selector:@selector(dailyTimerFired)
|
||||
userInfo:nil
|
||||
repeats:NO];
|
||||
}
|
||||
|
||||
- (void)dailyTimerFired {
|
||||
// 检查首充状态
|
||||
[self checkFirstRechargeStatus];
|
||||
|
||||
// 重新设置明天的定时器
|
||||
[self setupDailyTimer];
|
||||
}
|
||||
|
||||
- (NSTimeInterval)secondsUntilNextMidnight {
|
||||
NSCalendar *calendar = [NSCalendar currentCalendar];
|
||||
NSDate *now = [NSDate date];
|
||||
|
||||
// 获取明天
|
||||
NSDate *tomorrow = [calendar dateByAddingUnit:NSCalendarUnitDay value:1 toDate:now options:0];
|
||||
|
||||
// 获取明天的开始时间(凌晨)
|
||||
NSDate *tomorrowStart = [calendar startOfDayForDate:tomorrow];
|
||||
|
||||
// 计算时间差
|
||||
return [tomorrowStart timeIntervalSinceDate:now];
|
||||
}
|
||||
|
||||
- (void)applicationDidBecomeActive {
|
||||
// 应用进入前台时检查是否需要更新
|
||||
if ([self shouldCheckToday]) {
|
||||
[self checkFirstRechargeStatus];
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)shouldCheckToday {
|
||||
NSString *lastCheckDate = [[NSUserDefaults standardUserDefaults] objectForKey:kLastCheckDateKey];
|
||||
NSString *today = [self getTodayString];
|
||||
|
||||
return ![today isEqualToString:lastCheckDate];
|
||||
}
|
||||
|
||||
- (void)checkFirstRechargeStatus {
|
||||
// 检查是否登录
|
||||
if ([AccountInfoStorage instance].getTicket.length == 0 ||
|
||||
[AccountInfoStorage instance].getUid.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 调用API获取首充信息
|
||||
[Api firstchargeInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
if (code == 200 && data.data) {
|
||||
FirstRechargeModel *model = [FirstRechargeModel modelWithJSON:data.data];
|
||||
[self handleFirstRechargeResult:model];
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)handleFirstRechargeResult:(FirstRechargeModel *)model {
|
||||
if (!model) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 保存模型
|
||||
self.currentFirstRechargeData = model;
|
||||
[self saveCachedModel:model];
|
||||
|
||||
// 更新检查日期
|
||||
NSString *today = [self getTodayString];
|
||||
[[NSUserDefaults standardUserDefaults] setObject:today forKey:kLastCheckDateKey];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
|
||||
// 判断是否需要展示
|
||||
BOOL shouldShow = [self shouldShowFirstRecharge:model];
|
||||
|
||||
// 通知代理
|
||||
[self notifyDelegatesWithModel:model shouldShow:shouldShow];
|
||||
}
|
||||
|
||||
- (BOOL)shouldShowFirstRecharge:(FirstRechargeModel *)model {
|
||||
// 如果已经首充过,不展示
|
||||
if (model.chargeStatus) {
|
||||
return NO;
|
||||
}
|
||||
#if DEBUG
|
||||
return YES;
|
||||
#endif
|
||||
// 检查今天是否已经展示过
|
||||
NSString *shownDate = [[NSUserDefaults standardUserDefaults] objectForKey:kTodayShownKey];
|
||||
NSString *today = [self getTodayString];
|
||||
|
||||
return ![today isEqualToString:shownDate];
|
||||
}
|
||||
|
||||
- (void)notifyDelegatesWithModel:(FirstRechargeModel *)model shouldShow:(BOOL)shouldShow {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(firstRechargeManager:didCheckFirstRecharge:shouldShow:)]) {
|
||||
[self.delegate firstRechargeManager:self didCheckFirstRecharge:model shouldShow:shouldShow];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
- (NSString *)getTodayString {
|
||||
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
|
||||
[formatter setDateFormat:@"yyyy-MM-dd"];
|
||||
return [formatter stringFromDate:[NSDate date]];
|
||||
}
|
||||
|
||||
- (void)saveCachedModel:(FirstRechargeModel *)model {
|
||||
if (model) {
|
||||
NSData *data = [NSKeyedArchiver archivedDataWithRootObject:model.toJSONObject requiringSecureCoding:NO error:nil];
|
||||
[[NSUserDefaults standardUserDefaults] setObject:data forKey:kFirstRechargeModelKey];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)loadCachedModel {
|
||||
NSData *data = [[NSUserDefaults standardUserDefaults] objectForKey:kFirstRechargeModelKey];
|
||||
if (data) {
|
||||
NSDictionary *dict = [NSKeyedUnarchiver unarchivedObjectOfClass:[NSDictionary class] fromData:data error:nil];
|
||||
if (dict) {
|
||||
self.currentFirstRechargeData = [FirstRechargeModel modelWithJSON:dict];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
Reference in New Issue
Block a user