Compare commits

..

10 Commits

Author SHA1 Message Date
edwinQQQ
83d1a1df95 Version update 2024-12-19 14:04:51 +08:00
edwinQQQ
75a9bac88a Version update 2024-12-19 14:04:39 +08:00
edwinQQQ
c0e7e7ff83 修复验收问题 2024-12-19 14:02:37 +08:00
edwinQQQ
47c0f141a8 Update version 2024-12-18 17:12:48 +08:00
edwinQQQ
a0b2dea116 100% 完成需求 2024-12-18 17:12:03 +08:00
edwinQQQ
e82939f767 70% 完成需求 2024-12-16 19:41:23 +08:00
edwinQQQ
68370912b2 fix: 修正线上问题 2024-12-11 10:48:01 +08:00
edwinQQQ
57735e37c4 fix: 优化送礼的内存效率 |
TODO:调整 combo 时的金币变动效果
2024-12-09 19:27:02 +08:00
edwinQQQ
8ba4eaf2f5 try to fix send gift animation problems 2024-12-06 21:00:20 +08:00
edwinQQQ
612b84e47b Version update 2024-12-06 14:41:12 +08:00
139 changed files with 5594 additions and 931 deletions

View File

@@ -497,12 +497,21 @@
23FF42792AA6E19C0055733C /* HomeMenuSourceModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 23FF42782AA6E19C0055733C /* HomeMenuSourceModel.m */; };
23FF428E2AAB2D3A0055733C /* XPCandyTreeBuyView.m in Sources */ = {isa = PBXBuildFile; fileRef = 23FF428D2AAB2D3A0055733C /* XPCandyTreeBuyView.m */; };
4C1892992CF84349004D4426 /* RoomCahtCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C1892982CF84349004D4426 /* RoomCahtCell.m */; };
4C5C37232D0C1C7900BA9AB8 /* RegionListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C5C37222D0C1C7900BA9AB8 /* RegionListViewController.m */; };
4C6C92C02D1172D9000A4693 /* RegionListInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C6C92BF2D1172D9000A4693 /* RegionListInfo.m */; };
4C6E1F752CEAEC3C0073D0A3 /* ShoppingMallTagView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C6E1F742CEAEC3C0073D0A3 /* ShoppingMallTagView.m */; };
4C6E1F792CEB12780073D0A3 /* UIView+GradientLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C6E1F782CEB12780073D0A3 /* UIView+GradientLayer.m */; };
4C6E1F7C2CEB25B10073D0A3 /* ShoppingMallItemPreview.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C6E1F7B2CEB25B10073D0A3 /* ShoppingMallItemPreview.m */; };
4C71C69F2D069D2B00ECCA24 /* GiftAnimationHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C71C69E2D069D2B00ECCA24 /* GiftAnimationHelper.m */; };
4C71C6A22D06DB3D00ECCA24 /* GiftAnimationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C71C6A12D06DB3D00ECCA24 /* GiftAnimationManager.m */; };
4C815A172CFEB758002A46A6 /* SuperBlockViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C815A162CFEB758002A46A6 /* SuperBlockViewController.m */; };
4CC6195A2CEC7770008C1EE8 /* MyDressingDataPresent.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CC619592CEC7770008C1EE8 /* MyDressingDataPresent.m */; };
4CC6195D2CEC996E008C1EE8 /* MyDressingDataModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CC6195C2CEC996E008C1EE8 /* MyDressingDataModel.m */; };
4CEB9EA72D09643E00443480 /* UserRoomCardViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CEB9EA62D09643E00443480 /* UserRoomCardViewController.m */; };
4CEB9EAA2D097E8400443480 /* MoliAvatar.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CEB9EA92D097E8400443480 /* MoliAvatar.m */; };
4CEB9EAD2D09AA0400443480 /* SexAgeLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CEB9EAC2D09AA0400443480 /* SexAgeLabel.m */; };
4CEB9EB02D0AF4FE00443480 /* TwentyMicStageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CEB9EAF2D0AF4FE00443480 /* TwentyMicStageView.m */; };
4CEB9EB32D0AFCE200443480 /* NineteenMicStageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CEB9EB22D0AFCE200443480 /* NineteenMicStageView.m */; };
540EC1D02C89925F00F3BF0D /* GiftComboView.m in Sources */ = {isa = PBXBuildFile; fileRef = 540EC1CF2C89925F00F3BF0D /* GiftComboView.m */; };
540EC1D32C89998500F3BF0D /* GiftComboManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 540EC1D22C89998500F3BF0D /* GiftComboManager.m */; };
5412E0F42C4E460300FDD668 /* XPMineCenterAgencyView.m in Sources */ = {isa = PBXBuildFile; fileRef = 5412E0F32C4E460300FDD668 /* XPMineCenterAgencyView.m */; };
@@ -2582,18 +2591,36 @@
23FF428D2AAB2D3A0055733C /* XPCandyTreeBuyView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPCandyTreeBuyView.m; sourceTree = "<group>"; };
4C1892972CF84349004D4426 /* RoomCahtCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RoomCahtCell.h; sourceTree = "<group>"; };
4C1892982CF84349004D4426 /* RoomCahtCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RoomCahtCell.m; sourceTree = "<group>"; };
4C5C37212D0C1C7900BA9AB8 /* RegionListViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RegionListViewController.h; sourceTree = "<group>"; };
4C5C37222D0C1C7900BA9AB8 /* RegionListViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RegionListViewController.m; sourceTree = "<group>"; };
4C6C92BE2D1172D9000A4693 /* RegionListInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RegionListInfo.h; sourceTree = "<group>"; };
4C6C92BF2D1172D9000A4693 /* RegionListInfo.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RegionListInfo.m; sourceTree = "<group>"; };
4C6E1F732CEAEC3C0073D0A3 /* ShoppingMallTagView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ShoppingMallTagView.h; sourceTree = "<group>"; };
4C6E1F742CEAEC3C0073D0A3 /* ShoppingMallTagView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ShoppingMallTagView.m; sourceTree = "<group>"; };
4C6E1F772CEB12780073D0A3 /* UIView+GradientLayer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIView+GradientLayer.h"; sourceTree = "<group>"; };
4C6E1F782CEB12780073D0A3 /* UIView+GradientLayer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIView+GradientLayer.m"; sourceTree = "<group>"; };
4C6E1F7A2CEB25B10073D0A3 /* ShoppingMallItemPreview.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ShoppingMallItemPreview.h; sourceTree = "<group>"; };
4C6E1F7B2CEB25B10073D0A3 /* ShoppingMallItemPreview.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ShoppingMallItemPreview.m; sourceTree = "<group>"; };
4C71C69D2D069D2B00ECCA24 /* GiftAnimationHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GiftAnimationHelper.h; sourceTree = "<group>"; };
4C71C69E2D069D2B00ECCA24 /* GiftAnimationHelper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GiftAnimationHelper.m; sourceTree = "<group>"; };
4C71C6A02D06DB3D00ECCA24 /* GiftAnimationManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GiftAnimationManager.h; sourceTree = "<group>"; };
4C71C6A12D06DB3D00ECCA24 /* GiftAnimationManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GiftAnimationManager.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>"; };
4CC619582CEC7770008C1EE8 /* MyDressingDataPresent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MyDressingDataPresent.h; sourceTree = "<group>"; };
4CC619592CEC7770008C1EE8 /* MyDressingDataPresent.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MyDressingDataPresent.m; sourceTree = "<group>"; };
4CC6195B2CEC996E008C1EE8 /* MyDressingDataModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MyDressingDataModel.h; sourceTree = "<group>"; };
4CC6195C2CEC996E008C1EE8 /* MyDressingDataModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MyDressingDataModel.m; sourceTree = "<group>"; };
4CEB9EA52D09643E00443480 /* UserRoomCardViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UserRoomCardViewController.h; sourceTree = "<group>"; };
4CEB9EA62D09643E00443480 /* UserRoomCardViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UserRoomCardViewController.m; sourceTree = "<group>"; };
4CEB9EA82D097E8400443480 /* MoliAvatar.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MoliAvatar.h; sourceTree = "<group>"; };
4CEB9EA92D097E8400443480 /* MoliAvatar.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MoliAvatar.m; sourceTree = "<group>"; };
4CEB9EAB2D09AA0400443480 /* SexAgeLabel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SexAgeLabel.h; sourceTree = "<group>"; };
4CEB9EAC2D09AA0400443480 /* SexAgeLabel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SexAgeLabel.m; sourceTree = "<group>"; };
4CEB9EAE2D0AF4FE00443480 /* TwentyMicStageView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TwentyMicStageView.h; sourceTree = "<group>"; };
4CEB9EAF2D0AF4FE00443480 /* TwentyMicStageView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TwentyMicStageView.m; sourceTree = "<group>"; };
4CEB9EB12D0AFCE200443480 /* NineteenMicStageView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NineteenMicStageView.h; sourceTree = "<group>"; };
4CEB9EB22D0AFCE200443480 /* NineteenMicStageView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NineteenMicStageView.m; sourceTree = "<group>"; };
540EC1CE2C89925F00F3BF0D /* GiftComboView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GiftComboView.h; sourceTree = "<group>"; };
540EC1CF2C89925F00F3BF0D /* GiftComboView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GiftComboView.m; sourceTree = "<group>"; };
540EC1D12C89998500F3BF0D /* GiftComboManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GiftComboManager.h; sourceTree = "<group>"; };
@@ -5191,6 +5218,10 @@
189DD68226E1FDBB00AB55B1 /* XNDJTDDLoadingTool.m */,
E8B825CB26EA18C8009E8E9F /* DJDKMIMOMColor.h */,
E8B825CC26EA18C8009E8E9F /* DJDKMIMOMColor.m */,
4CEB9EA82D097E8400443480 /* MoliAvatar.h */,
4CEB9EA92D097E8400443480 /* MoliAvatar.m */,
4CEB9EAB2D09AA0400443480 /* SexAgeLabel.h */,
4CEB9EAC2D09AA0400443480 /* SexAgeLabel.m */,
);
path = CustomUI;
sourceTree = "<group>";
@@ -5215,6 +5246,8 @@
E824543426F57D6E00BE8163 /* XPLoginVerifBindPhoneViewController.m */,
23B2AEC32A6516C200543D17 /* LoginForgetPasswordViewController.h */,
23B2AEC22A6516C200543D17 /* LoginForgetPasswordViewController.m */,
4C5C37212D0C1C7900BA9AB8 /* RegionListViewController.h */,
4C5C37222D0C1C7900BA9AB8 /* RegionListViewController.m */,
);
path = View;
sourceTree = "<group>";
@@ -8161,6 +8194,8 @@
E82325FD274E48D0003A3332 /* Cell */,
E82325F0274E2DE6003A3332 /* XPUserCardViewController.h */,
E82325F1274E2DE6003A3332 /* XPUserCardViewController.m */,
4CEB9EA52D09643E00443480 /* UserRoomCardViewController.h */,
4CEB9EA62D09643E00443480 /* UserRoomCardViewController.m */,
);
path = View;
sourceTree = "<group>";
@@ -8271,6 +8306,10 @@
E8998D7F28597B0300C68558 /* XPRoomLuckyBigPrizeView.m */,
E838D99E275E1BF60079E0B5 /* XPRoomAnimationView.h */,
E838D99F275E1BF60079E0B5 /* XPRoomAnimationView.m */,
4C71C6A02D06DB3D00ECCA24 /* GiftAnimationManager.h */,
4C71C6A12D06DB3D00ECCA24 /* GiftAnimationManager.m */,
4C71C69D2D069D2B00ECCA24 /* GiftAnimationHelper.h */,
4C71C69E2D069D2B00ECCA24 /* GiftAnimationHelper.m */,
23E9EA782A8385CC00B792F2 /* XPTreasureFairyGiftView.h */,
23E9EA772A8385CB00B792F2 /* XPTreasureFairyGiftView.m */,
E8E21A9928B4BD92008F7C9D /* XPRoomGraffitiGiftAnimationView.h */,
@@ -10589,6 +10628,10 @@
236B2E512AA08756003967A8 /* LittleGameScrollStageView.m */,
236B2E522AA08757003967A8 /* LittleGameStageView.h */,
236B2E502AA08756003967A8 /* LittleGameStageView.m */,
4CEB9EAE2D0AF4FE00443480 /* TwentyMicStageView.h */,
4CEB9EAF2D0AF4FE00443480 /* TwentyMicStageView.m */,
4CEB9EB12D0AFCE200443480 /* NineteenMicStageView.h */,
4CEB9EB22D0AFCE200443480 /* NineteenMicStageView.m */,
);
path = StageView;
sourceTree = "<group>";
@@ -10665,6 +10708,8 @@
E81C27AA26EF2D920031E639 /* ThirdUserInfo.m */,
E818DD1D2A48974300F163F7 /* LoginAreaModel.h */,
E818DD1E2A48974300F163F7 /* LoginAreaModel.m */,
4C6C92BE2D1172D9000A4693 /* RegionListInfo.h */,
4C6C92BF2D1172D9000A4693 /* RegionListInfo.m */,
);
path = Model;
sourceTree = "<group>";
@@ -11738,6 +11783,7 @@
E8751E6328A646400056EF44 /* XPSailingRankView.m in Sources */,
23C9DFCC2B85DD8B00B51558 /* PIGuildAnchorIncomeSectionView.m in Sources */,
9BD9A18027A0EFC7004186FE /* XPMineVisitorTableViewCell.m in Sources */,
4C6C92C02D1172D9000A4693 /* RegionListInfo.m in Sources */,
233423D02AAEFBC300B1253F /* PICandyTreeSetModel.m in Sources */,
E85E7B112A4EB0D200B6D00A /* GuildPersonIncomeRecordModel.m in Sources */,
54283CEB2CE48B71009729B5 /* ShoppingMallCategoryListView.m in Sources */,
@@ -11873,6 +11919,7 @@
23E9EAAE2A84C9B800B792F2 /* XPMineUserInfoTagView.m in Sources */,
236B2E4E2AA07D06003967A8 /* Api+LittleGame.m in Sources */,
237700E02BC7D78600D661F1 /* MSBaseRTLFlowLayout.m in Sources */,
4CEB9EB32D0AFCE200443480 /* NineteenMicStageView.m in Sources */,
2331C1B32A60F32D00E1D940 /* XPCandyTreeMoreRuleCell.m in Sources */,
14A6034C29A35EE600D2A6A5 /* XPMineItemTableViewCell.m in Sources */,
9BAC92F528E6E63000147DD8 /* XPRoomInsideOperationCell.m in Sources */,
@@ -12148,6 +12195,7 @@
E8B846CF26FDD96100A777FE /* XPMineRechageHeadView.m in Sources */,
E852D74728633E92001465ED /* MonentsCommentReplyModel.m in Sources */,
186A534926FC6ED900D67B2C /* TTAlertMessageAttributedConfig.m in Sources */,
4CEB9EB02D0AF4FE00443480 /* TwentyMicStageView.m in Sources */,
E8B3E80C2848BA40009746AB /* NewUserGreetModel.m in Sources */,
E85E7B4D2A4EB0D300B6D00A /* XPMineGuildRemoveMemberViewController.m in Sources */,
9BCB99A028F571B500466D64 /* XPMineCollectPartyRoomViewController.m in Sources */,
@@ -12237,6 +12285,7 @@
9B0E1C5926E77022005D4442 /* BaseNavigationController.m in Sources */,
E8664ED927E4355C000171BA /* XPRoomPKRecordTableViewCell.m in Sources */,
238B37AB2AC55A2C00BFC9D5 /* TreasureFairyConvertRecordModel.m in Sources */,
4CEB9EAD2D09AA0400443480 /* SexAgeLabel.m in Sources */,
23FF42762AA6E1480055733C /* XPHomeRecommendOtherRoomView.m in Sources */,
142721B229A7647F00C7C423 /* XPBlankViewController.m in Sources */,
E85E7B6B2A4EC39400B6D00A /* XPMineExchangeAuthorityModel.m in Sources */,
@@ -12272,6 +12321,7 @@
E8EEB91726FC7B35007C6EBA /* XPMineUserInfoDesViewController.m in Sources */,
544A36352C94160F00CA7858 /* RoomMenuBar.m in Sources */,
9B1B72AC280031DB003FACE9 /* XPAnchorPKViewController.m in Sources */,
4CEB9EA72D09643E00443480 /* UserRoomCardViewController.m in Sources */,
237852A12C072D8D00E360AC /* MSRoomGameModel.m in Sources */,
180806FB2729A354001FD836 /* ThemeColor+Room.m in Sources */,
9BC8C83028090C9200C24F85 /* XPRoomAnchorRankBannerView.m in Sources */,
@@ -12378,6 +12428,7 @@
238B37C52AC55A2C00BFC9D5 /* XPTreasureFairyMoreView.m in Sources */,
E811FFF72742367B00918544 /* XPGiftEmptyCollectionViewCell.m in Sources */,
189DD67E26E1FD8900AB55B1 /* UIImage+Utils.m in Sources */,
4C71C6A22D06DB3D00ECCA24 /* GiftAnimationManager.m in Sources */,
E82D5C73276AE94800858D6D /* CarModel.m in Sources */,
E85E7B0B2A4EB0D200B6D00A /* XPGuildSetNamePresenter.m in Sources */,
E87E62762A3F5907002F68C9 /* XPNewHomePlayTableViewCell.m in Sources */,
@@ -12437,6 +12488,7 @@
9B734F76288A92FB00CBDAA9 /* XPMineFunctionItemModel.m in Sources */,
541DD9552C1EDEFB00B616C4 /* XPHomePagingViewController.m in Sources */,
E82D5C70276AE60000858D6D /* HeadwearModel.m in Sources */,
4C5C37232D0C1C7900BA9AB8 /* RegionListViewController.m in Sources */,
238B37CC2AC55A2C00BFC9D5 /* XPTreasureFairyPrizeSubView.m in Sources */,
E81125C4296E57B7000D9804 /* QinputPhotoView.m in Sources */,
E880B3A1278BD60C00A83B0D /* XPAcrossRoomPKSelectRoomView.m in Sources */,
@@ -12543,6 +12595,7 @@
23FF25792ABD67CD0064E904 /* XPFreeGiftModel.m in Sources */,
9B92A33C2797E38100AD168F /* XPMineHeadItemTableViewCell.m in Sources */,
E854103928646A00005CFD9F /* XPMonentsReplyMoreTableViewCell.m in Sources */,
4CEB9EAA2D097E8400443480 /* MoliAvatar.m in Sources */,
9B8DE0E1289CF02900FB6EC2 /* XPGiftCompoundModel.m in Sources */,
23FF256E2ABC48810064E904 /* XPSessionMainViewController.m in Sources */,
E85E7B092A4EB0D200B6D00A /* XPGuildRemoveMemberPresenter.m in Sources */,
@@ -12758,6 +12811,7 @@
E81DCCD0282B63FD0039E5C5 /* XPMomentsRecommendViewController.m in Sources */,
9B7D804A2753783D003DAC0C /* SessionViewController.m in Sources */,
E85E7BA92A4EC99300B6D00A /* XPMineConfirmGiveDiamondView.m in Sources */,
4C71C69F2D069D2B00ECCA24 /* GiftAnimationHelper.m in Sources */,
54C9A1102C3D3E1700C6D970 /* XPMineGameMateOrderView.m in Sources */,
E85E7BA72A4EC99300B6D00A /* XPMineGiveDiamondPasswordView.m in Sources */,
54283CEE2CE48B97009729B5 /* ShoppingMallDataPresent.m in Sources */,
@@ -13222,7 +13276,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 20.20.45;
MARKETING_VERSION = 20.20.49;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
@@ -13574,7 +13628,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 20.20.45;
MARKETING_VERSION = 20.20.49;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",

View File

@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -1,7 +1,6 @@
{
"images" : [
{
"filename" : "user_card_open_mic.png",
"idiom" : "universal",
"scale" : "1x"
},
@@ -10,6 +9,7 @@
"scale" : "2x"
},
{
"filename" : "切图 30@3x.png",
"idiom" : "universal",
"scale" : "3x"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -1,7 +1,6 @@
{
"images" : [
{
"filename" : "user_card_lock_mic.png",
"idiom" : "universal",
"scale" : "1x"
},
@@ -10,6 +9,7 @@
"scale" : "2x"
},
{
"filename" : "勾选@3x.png",
"idiom" : "universal",
"scale" : "3x"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -1,7 +1,6 @@
{
"images" : [
{
"filename" : "user_card_close_mic.png",
"idiom" : "universal",
"scale" : "1x"
},
@@ -10,6 +9,7 @@
"scale" : "2x"
},
{
"filename" : "3@3x.png",
"idiom" : "universal",
"scale" : "3x"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

@@ -1,7 +1,6 @@
{
"images" : [
{
"filename" : "user_card_no_lock_mic.png",
"idiom" : "universal",
"scale" : "1x"
},
@@ -10,6 +9,7 @@
"scale" : "2x"
},
{
"filename" : "2@3x (1).png",
"idiom" : "universal",
"scale" : "3x"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "3@3x (1).png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "2@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "2@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "5@3x (3).png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "4@3x (1).png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "2@3x (2).png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "1@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "1@3x (1).png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "5@3x (2).png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "4@3x (2).png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "5@3x (1).png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "举报@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "1@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "4@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "1@3x (2).png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "5@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "组 8307@3x (1).png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "组 8307@3x (3).png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "组 8307@3x (2).png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

View File

@@ -1,21 +0,0 @@
{
"images" : [
{
"filename" : "user_card_clean_gift_value.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 825 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -1,21 +0,0 @@
{
"images" : [
{
"filename" : "user_card_down_mic_listen.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 933 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 922 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 854 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 988 B

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "usercard_invite_micro_disable@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "usercard_invite_micro_disable@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "usercard_invite_micro_normal@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "usercard_invite_micro_normal@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1001 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -0,0 +1,22 @@
//
// MoliAvatar.h
// YuMi
//
// Created by P on 2024/12/11.
//
#import <UIKit/UIKit.h>
@class UserInfoModel;
NS_ASSUME_NONNULL_BEGIN
@interface MoliAvatar : UIView
@property(nonatomic, strong) UserInfoModel *userInfo;
@property(nonatomic, copy) void(^handleTapAvatar)(void);
@end
NS_ASSUME_NONNULL_END

153
YuMi/CustomUI/MoliAvatar.m Normal file
View File

@@ -0,0 +1,153 @@
//
// MoliAvatar.m
// YuMi
//
// Created by P on 2024/12/11.
//
#import "MoliAvatar.h"
#import "UserInfoModel.h"
#import <SVGA.h>
#import <YYImage/YYAnimatedImageView.h>
#import "UIView+VAP.h"
#import "SpriteSheetImageManager.h"
@interface MoliAvatar ()
@property (nonatomic,strong) NetImageView *avatarView;
///
@property (nonatomic, strong) SpriteSheetImageManager *sequenceFrameManager;
@property (nonatomic,strong) YYAnimatedImageView *sequenceFrameHeadWear;
///SVGA
@property (nonatomic, strong) SVGAImageView *headWearSvgaImageView;
@end
@implementation MoliAvatar
- (void)dealloc
{
if (_headWearSvgaImageView) {
[_headWearSvgaImageView stopAnimation];
}
}
- (instancetype)init {
if (self = [super init]) {
[self addSubview:self.avatarView];
[self.avatarView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self);
}];
}
return self;
}
- (void)layoutSubviews {
[super layoutSubviews];
[self.avatarView setCornerRadius:self.frame.size.height / 2];
}
- (void)setUserInfo:(UserInfoModel *)userInfo {
_userInfo = userInfo;
self.avatarView.imageUrl = userInfo.avatar;
NSString *headerUrl = self.userInfo.headwearEffect.length > 0 ? self.userInfo.headwearEffect : self.userInfo.headwearPic;
if ([NSString isEmpty:headerUrl]) {
return;
}
if ([userInfo isHeadWearSVGA]) {
[self setupAndPlaySVGA: headerUrl];
} else {
[self setupAndPlayAnimate: headerUrl];
}
}
- (void)setupAndPlaySVGA:(NSString *)url {
[self addSubview:self.headWearSvgaImageView];
[self.headWearSvgaImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.center.mas_equalTo(self.avatarView);
make.size.mas_equalTo(self.avatarView).multipliedBy(1.3);
}];
[self.headWearSvgaImageView setImageName:url];
}
- (void)setupAndPlayAnimate:(NSString *)url {
[self addSubview:self.sequenceFrameHeadWear];
[self.sequenceFrameHeadWear mas_makeConstraints:^(MASConstraintMaker *make) {
make.center.mas_equalTo(self.avatarView);
make.size.mas_equalTo(self.avatarView).multipliedBy(1.3);
}];
@kWeakify(self);
[self.sequenceFrameManager loadSpriteSheetImageWithURL:[NSURL URLWithString:url]
completionBlock:^(YYSpriteSheetImage * _Nullable sprit) {
@kStrongify(self);
self.sequenceFrameHeadWear.image = sprit;
} failureBlock:^(NSError * _Nullable error) {}];
}
#pragma mark -
- (void)clickAvatarAction {
if (self.handleTapAvatar) {
self.handleTapAvatar();
}
}
#pragma mark -
#pragma mark -
-(NetImageView *)avatarView{
if (!_avatarView){
NetImageConfig * config = [[NetImageConfig alloc] init];
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
config.imageType = ImageTypeUserIcon;
_avatarView = [[NetImageView alloc]initWithConfig:config];
_avatarView.layer.cornerRadius = kGetScaleWidth(41);
_avatarView.layer.masksToBounds = YES;
_avatarView.layer.borderWidth = 1;
_avatarView.userInteractionEnabled = YES;
_avatarView.layer.borderColor = [UIColor whiteColor].CGColor;
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(clickAvatarAction)];
[_avatarView addGestureRecognizer:tap];
}
return _avatarView;
}
- (SVGAImageView *)headWearSvgaImageView {
if (!_headWearSvgaImageView) {
_headWearSvgaImageView = [[SVGAImageView alloc]init];
_headWearSvgaImageView.backgroundColor = [UIColor clearColor];
_headWearSvgaImageView.frame = self.bounds;
_headWearSvgaImageView.userInteractionEnabled = NO;
_headWearSvgaImageView.autoPlay = YES;
}
return _headWearSvgaImageView;
}
- (YYAnimatedImageView *)sequenceFrameHeadWear {
if (!_sequenceFrameHeadWear) {
_sequenceFrameHeadWear = [[YYAnimatedImageView alloc] init];
_sequenceFrameHeadWear.backgroundColor = [UIColor clearColor];
_sequenceFrameHeadWear.contentMode = UIViewContentModeScaleAspectFit;
}
return _sequenceFrameHeadWear;
}
- (SpriteSheetImageManager *)sequenceFrameManager {
if (!_sequenceFrameManager) {
_sequenceFrameManager = [[SpriteSheetImageManager alloc] init];
}
return _sequenceFrameManager;
}
@end

View File

@@ -0,0 +1,18 @@
//
// SexAgeLabel.h
// YuMi
//
// Created by P on 2024/12/11.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SexAgeLabel : UIView
- (void)updateSex:(BOOL)isMale age:(NSInteger)age;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,65 @@
//
// SexAgeLabel.m
// YuMi
//
// Created by P on 2024/12/11.
//
#import "SexAgeLabel.h"
@interface SexAgeLabel ()
@property(nonatomic, strong) UIView *pillBackground;
@property(nonatomic, strong) UIImageView *sexImageView;
@property(nonatomic, strong) UILabel *ageLabel;
@end
@implementation SexAgeLabel
- (instancetype)init {
if (self = [super init]) {
// self.frame = CGRectMake(0, 0, 35, 16);
[self setCornerRadius:8];
[self addGradientBackgroundWithColors:@[[UIColor redColor], [UIColor blueColor]] startPoint:CGPointMake(0.5, 0) endPoint:CGPointMake(0.5, 1) cornerRadius:8];
[self addSubview:self.sexImageView];
[self addSubview:self.ageLabel];
[self.sexImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self);
make.leading.mas_equalTo(2);
make.width.height.mas_equalTo(8);
}];
[self.ageLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self);
make.leading.mas_equalTo(self.sexImageView.mas_trailing).offset(2);
make.trailing.mas_equalTo(-2);
}];
}
return self;
}
- (void)updateSex:(BOOL)isMale age:(NSInteger)age {
self.sexImageView.image = isMale ? kImage(@"session_user_sex_male") : kImage(@"session_user_sex_female");
self.ageLabel.text = @(age).stringValue;
}
- (UIImageView *)sexImageView {
if (!_sexImageView) {
_sexImageView = [[UIImageView alloc] init];
_sexImageView.contentMode = UIViewContentModeScaleAspectFit;
}
return _sexImageView;
}
- (UILabel *)ageLabel {
if (!_ageLabel) {
_ageLabel = [UILabel labelInitWithText:@"" font:kFontSemibold(12) textColor:[UIColor whiteColor]];
}
return _ageLabel;
}
@end

View File

@@ -82,6 +82,7 @@ NSString * const kImageTypeMonentsPhoto = @"imageMogr2/auto-orient/thumbnail/400
break;
case ImageTypeUserCardLevel:
configUrl = kImageTypeUserCardLevel;
break;
case ImageTypeMonentsPhoto:
configUrl = kImageTypeMonentsPhoto;
break;

View File

@@ -46,7 +46,7 @@ isPhoneXSeries = [[UIApplication sharedApplication] delegate].window.safeAreaIns
#define kFontHeavy(font) [UIFont systemFontOfSize:kGetScaleWidth(font) weight:UIFontWeightHeavy]
///内置版本号
#define PI_App_Version @"1.0.30"
#define PI_App_Version @"1.0.34"
///渠道
#define PI_App_Source @"appstore"
#define PI_Test_Flight @"TestFlight"

View File

@@ -0,0 +1,26 @@
//
// RegionListInfo.h
// YuMi
//
// Created by P on 2024/12/17.
//
#import "PIBaseModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface RegionListInfo : PIBaseModel
@property(nonatomic, assign) BOOL checked;
@property(nonatomic, copy) NSString *code;
@property(nonatomic, copy) NSString *icon;
@property(nonatomic, copy) NSString *id;
@property(nonatomic, copy) NSString *name;
@property(nonatomic, copy) NSString *partitionDesc;
@property(nonatomic, assign) NSInteger partitionId;
@property(nonatomic, copy) NSString *regionDesc;
@property(nonatomic, assign) NSInteger seq;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,12 @@
//
// RegionListInfo.m
// YuMi
//
// Created by P on 2024/12/17.
//
#import "RegionListInfo.h"
@implementation RegionListInfo
@end

View File

@@ -8,7 +8,7 @@
#import "BaseMvpPresenter.h"
NS_ASSUME_NONNULL_BEGIN
@class ThirdUserInfo;
@class ThirdUserInfo, RegionListInfo;
@interface LoginFullInfoPresenter : BaseMvpPresenter
/// 获取保存的第三方的数据模型
@@ -31,7 +31,10 @@ NS_ASSUME_NONNULL_BEGIN
inviteCode:(NSString * __nullable)inviteCode
roomUid:(NSString * __nullable)roomUid
shareUid:(NSString * __nullable)shareUid
shareChannel:(NSString * __nullable)shareChannel;
shareChannel:(NSString * __nullable)shareChannel
regionId:(NSString *)regionId;
- (void)loadAllRegionInfo:(void(^)(NSArray <RegionListInfo *>*array))success failure:(void(^)(NSError *error))failure;
@end

View File

@@ -14,6 +14,7 @@
#import "AccountInfoStorage.h"
///Model
#import "ThirdUserInfo.h"
#import "RegionListInfo.h"
@implementation LoginFullInfoPresenter
@@ -52,7 +53,8 @@
inviteCode:(NSString * __nullable)inviteCode
roomUid:(NSString * __nullable)roomUid
shareUid:(NSString * __nullable)shareUid
shareChannel:(NSString * __nullable)shareChannel {
shareChannel:(NSString * __nullable)shareChannel
regionId:(NSString *)regionId{
NSString * uid = [[AccountInfoStorage instance] getUid];
NSString * ticket = [[AccountInfoStorage instance] getTicket];
NSMutableDictionary * params = [NSMutableDictionary dictionary];
@@ -61,6 +63,9 @@
[params safeSetObject:nick forKey:@"nick"];
[params safeSetObject:uid forKey:@"uid"];
[params safeSetObject:ticket forKey:@"ticket"];
if (regionId.length > 0) {
[params safeSetObject:regionId forKey:@"regionId"];
}
if (inviteCode.length > 0) {
[params safeSetObject:inviteCode forKey:@"inviteCode"];
}
@@ -83,4 +88,19 @@
} errorToast:YES] userInfo:params];
}
- (void)loadAllRegionInfo:(void(^)(NSArray <RegionListInfo *>*array))success failure:(void(^)(NSError *error))failure {
[Api requestAllRegionInfoCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
if (data.code == 200) {
NSArray *array = [RegionListInfo modelsWithArray:data.data];
if (success) {
success(array);
}
}
} fail:^(NSInteger code, NSString * _Nullable msg) {
if (failure) {
failure([NSError errorWithDomain:msg code:code userInfo:nil]);
}
} showLoading:YES errorToast:YES]];
}
@end

View File

@@ -21,8 +21,8 @@
#import "ThirdUserInfo.h"
#import "AccountModel.h"
#import "DESEncrypt.h"
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKLoginKit/FBSDKLoginKit.h>
//#import <FBSDKCoreKit/FBSDKCoreKit.h>
//#import <FBSDKLoginKit/FBSDKLoginKit.h>
#import "YuMi-swift.h"
#import "FeedBackConfigModel.h"
@@ -33,25 +33,25 @@
- (instancetype)init{
self = [super init];
if(self){
[[NSNotificationCenter defaultCenter] addObserverForName:FBSDKProfileDidChangeNotification
object:nil
queue:[NSOperationQueue mainQueue]
usingBlock:
^(NSNotification *notification) {
if ([FBSDKProfile currentProfile]) {
//
[FBSDKProfile loadCurrentProfileWithCompletion:
^(FBSDKProfile *profile, NSError *error) {
if (profile) {
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
AccountInfoStorage *accountStorage = [AccountInfoStorage instance];
accountStorage.thirdUserInfo.userName = profile.name;
accountStorage.thirdUserInfo.avatarUrl = profile.imageURL.absoluteString;
});
}
}];
}
}];
// [[NSNotificationCenter defaultCenter] addObserverForName:FBSDKProfileDidChangeNotification
// object:nil
// queue:[NSOperationQueue mainQueue]
// usingBlock:
// ^(NSNotification *notification) {
// if ([FBSDKProfile currentProfile]) {
// //
// [FBSDKProfile loadCurrentProfileWithCompletion:
// ^(FBSDKProfile *profile, NSError *error) {
// if (profile) {
// dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
// AccountInfoStorage *accountStorage = [AccountInfoStorage instance];
// accountStorage.thirdUserInfo.userName = profile.name;
// accountStorage.thirdUserInfo.avatarUrl = profile.imageURL.absoluteString;
// });
// }
// }];
// }
// }];
}
return self;
}
@@ -200,31 +200,31 @@
}];
}
-(void)thirdLoginByFBWithPresentingViewController:(UIViewController *)presentingViewController {
[FBSDKProfile enableUpdatesOnAccessTokenChange:YES];
[FBSDKAccessToken setCurrentAccessToken:nil];
FBSDKLoginManager *manager = [[FBSDKLoginManager alloc] init];
[manager logOut];
[XNDJTDDLoadingTool showOnlyView:kWindow];
@kWeakify(self);
[manager logInWithPermissions:@[@"public_profile"]
fromViewController:presentingViewController
handler:^(FBSDKLoginManagerLoginResult * _Nullable result, NSError * _Nullable error) {
@kStrongify(self);
if (error) {
[XNDJTDDLoadingTool hideOnlyView:kWindow];
[[self getView] showErrorToast:YMLocalizedString(@"LoginPresenter1")];
} else if (result.isCancelled) {
[XNDJTDDLoadingTool hideOnlyView:kWindow];
[[self getView] showErrorToast:YMLocalizedString(@"LoginPresenter0")];
} else {
ThirdUserInfo * userInfo = [[ThirdUserInfo alloc] init];
userInfo.openid = result.token.userID;
userInfo.access_token = result.token.tokenString;
userInfo.unionid = result.token.userID;
[AccountInfoStorage instance].thirdUserInfo = userInfo;
[self loginWithThirdPartWithType:ThirdLoginType_FB];
}
}];
// [FBSDKProfile enableUpdatesOnAccessTokenChange:YES];
// [FBSDKAccessToken setCurrentAccessToken:nil];
// FBSDKLoginManager *manager = [[FBSDKLoginManager alloc] init];
// [manager logOut];
// [XNDJTDDLoadingTool showOnlyView:kWindow];
// @kWeakify(self);
// [manager logInWithPermissions:@[@"public_profile"]
// fromViewController:presentingViewController
// handler:^(FBSDKLoginManagerLoginResult * _Nullable result, NSError * _Nullable error) {
// @kStrongify(self);
// if (error) {
// [XNDJTDDLoadingTool hideOnlyView:kWindow];
// [[self getView] showErrorToast:YMLocalizedString(@"LoginPresenter1")];
// } else if (result.isCancelled) {
// [XNDJTDDLoadingTool hideOnlyView:kWindow];
// [[self getView] showErrorToast:YMLocalizedString(@"LoginPresenter0")];
// } else {
// ThirdUserInfo * userInfo = [[ThirdUserInfo alloc] init];
// userInfo.openid = result.token.userID;
// userInfo.access_token = result.token.tokenString;
// userInfo.unionid = result.token.userID;
// [AccountInfoStorage instance].thirdUserInfo = userInfo;
// [self loginWithThirdPartWithType:ThirdLoginType_FB];
// }
// }];
}
-(void)thirdLoginByGoogleWithPresentingViewController:(UIViewController *)presentingViewController configuration:(GIDConfiguration *)configuration{
@kWeakify(self);

View File

@@ -26,7 +26,11 @@
#import "PILoginManager.h"
#import "ClientConfig.h"
@interface LoginFullInfoViewController ()<LoginFullInfoProtocol>
#import "RegionListViewController.h"
#import "RegionListInfo.h"
@interface LoginFullInfoViewController ()<LoginFullInfoProtocol, UIViewControllerTransitioningDelegate>
///
@property(nonatomic,strong) UIImageView *bgImageView;
@@ -61,11 +65,19 @@
///
@property (nonatomic,strong) MSBaseTextField *codeTextField;
@property (nonatomic,strong) UIView *regionContainView;
@property(nonatomic, strong) UILabel *regionLabel;
@property(nonatomic, strong) NetImageView *regionFlagImageView;
///
@property (nonatomic,strong) ThirdUserInfo *thirdInfo;
///
@property (nonatomic,copy) NSString *sexString;
@property(nonatomic, copy) NSArray <RegionListInfo *> *regionInfoList;
@property(nonatomic, strong) RegionListInfo *selectedRegion;
@end
@implementation LoginFullInfoViewController
@@ -83,6 +95,7 @@
[self initSubViews];
[self initSubViewConstraints];
[self initEvents];
[self loadAllRegions];
ClientConfig *config = [ClientConfig shareConfig];
if (config.inviteCode.length > 0){
self.inviteCode = config.inviteCode;
@@ -94,6 +107,22 @@
[self.view endEditing:YES];
}
- (void)loadAllRegions {
@kWeakify(self);
[self.presenter loadAllRegionInfo:^(NSArray<RegionListInfo *> * _Nonnull array) {
@kStrongify(self);
self.regionInfoList = array;
for (RegionListInfo *info in array) {
if (info.checked) {
[self updateRegion:info];
break;
}
}
} failure:^(NSError * _Nonnull error) {
}];
}
#pragma mark - Private Method
- (void)initSubViews {
self.view.backgroundColor = [UIColor whiteColor];
@@ -107,6 +136,7 @@
[self.bgView addSubview:self.backView];
[self.view addSubview:self.codeContainView];
[self.view addSubview:self.regionContainView];
[self.view addSubview:self.nextButton];
[self.view addSubview:self.block18Tips];
@@ -118,6 +148,21 @@
[self.sexStackView addArrangedSubview:self.femaleView];
[self.codeContainView addSubview:self.codeTextField];
UIStackView *regionStack = [[UIStackView alloc] initWithArrangedSubviews:@[
self.regionFlagImageView,
self.regionLabel
]];
regionStack.spacing = 4;
[self.regionContainView addSubview:regionStack];
[regionStack mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(kGetScaleWidth(24));
make.centerY.mas_equalTo(self.regionContainView);
}];
[self.regionFlagImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(0, 18));
}];
if ([self.presenter getThirdUserInfo] && [self.presenter getThirdUserInfo].userName.length > 0) {
self.textField.text = [self.presenter getThirdUserInfo].userName;
@@ -130,23 +175,30 @@
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.trailing.top.equalTo(self.view);
make.height.mas_equalTo(kGetScaleWidth(418));
make.height.mas_equalTo(kGetScaleWidth(140));
}];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self.view);
make.top.mas_equalTo(kGetScaleWidth(128));
if (iPhoneXSeries) {
make.top.mas_equalTo(kGetScaleWidth(128));
} else {
make.top.mas_equalTo(kGetScaleWidth(68));
}
make.leading.mas_equalTo(kGetScaleWidth(24));
make.height.mas_equalTo(kGetScaleWidth(40));
}];
[self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.trailing.bottom.equalTo(self.view);
make.top.mas_equalTo(kGetScaleWidth(192));
if (iPhoneXSeries) {
make.top.mas_equalTo(kGetScaleWidth(192));
} else {
make.top.mas_equalTo(kGetScaleWidth(132));
}
}];
[self.remindLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.trailing.equalTo(self.bgView).inset(kGetScaleWidth(10));
make.top.mas_equalTo(kGetScaleWidth(48));
}];
[self.sexStackView mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -196,12 +248,17 @@
make.top.bottom.mas_equalTo(self.codeContainView);
make.trailing.mas_equalTo(self.codeContainView).offset(-kGetScaleWidth(18));
}];
[self.regionContainView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.trailing.height.mas_equalTo(self.backView);
make.top.mas_equalTo(self.codeContainView.mas_bottom).offset(kGetScaleWidth(20));
}];
[self.nextButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(kGetScaleWidth(303));
make.centerX.equalTo(self.bgView);
make.height.mas_equalTo(kGetScaleWidth(48));
make.top.mas_equalTo(self.codeContainView.mas_bottom).offset(kGetScaleWidth(48));
make.top.mas_equalTo(self.regionContainView.mas_bottom).offset(kGetScaleWidth(38));
}];
[self.block18Tips mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -228,10 +285,59 @@
_inviteCode = inviteCode;
self.codeTextField.text = _inviteCode;
}
- (void)didTapRegionButton {
__block RegionListViewController *vc;
if (self.regionInfoList.count == 0) {
@kWeakify(self);
[self.presenter loadAllRegionInfo:^(NSArray<RegionListInfo *> * _Nonnull array) {
@kStrongify(self);
self.regionInfoList = array;
vc = [[RegionListViewController alloc] initForRegionList:array];
[self presentViewController:vc animated:YES completion:nil];
@kWeakify(self);
[vc setHandleTapRegionComfirm:^(RegionListInfo * _Nonnull regionInfo) {
@kStrongify(self);
[self updateRegion:regionInfo];
}];
} failure:^(NSError * _Nonnull error) {
}];
} else {
vc = [[RegionListViewController alloc] initForRegionList:self.regionInfoList];
[self presentViewController:vc animated:YES completion:nil];
@kWeakify(self);
[vc setHandleTapRegionComfirm:^(RegionListInfo * _Nonnull regionInfo) {
@kStrongify(self);
[self updateRegion:regionInfo];
}];
}
}
- (void)updateRegion:(RegionListInfo *)model {
self.selectedRegion = model;
self.regionLabel.text = model.name;
self.regionFlagImageView.imageUrl = model.icon;
self.regionLabel.textColor = UIColorFromRGB(0x313131);
[self.regionFlagImageView mas_updateConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(24, 18));
}];
[self.regionContainView layoutIfNeeded];
[self updateNextButton];
}
///
- (void)updateUserInfo {
[XNDJTDDLoadingTool showOnlyView:self.view];
[self.presenter complectionInfoWithAvatar:[self getAvatarUrl] gender:self.maleView.selected ? @"1":@"2" nick:self.textField.text inviteCode:self.codeTextField.text roomUid:nil shareUid:nil shareChannel:nil];
[self.presenter complectionInfoWithAvatar:[self getAvatarUrl]
gender:self.maleView.selected ? @"1":@"2" nick:self.textField.text
inviteCode:self.codeTextField.text
roomUid:nil
shareUid:nil
shareChannel:nil
regionId:self.selectedRegion.id];
}
///
@@ -246,7 +352,7 @@
}
- (void)updateNextButton {
if (self.textField.text.length > 0 && self.sexString.length > 0) {
if (self.textField.text.length > 0 && self.sexString.length > 0 && self.selectedRegion) {
self.nextButton.enabled = YES;
} else {
self.nextButton.enabled = NO;
@@ -318,8 +424,8 @@
- (UIImageView *)bgImageView{
if(!_bgImageView){
_bgImageView = [[UIImageView alloc]init];
_bgImageView.image = kImage(@"login_phone_pwd_bg");
_bgImageView.contentMode = 2;
_bgImageView.image = kImage(@"home_top_bg");
_bgImageView.contentMode = UIViewContentModeScaleAspectFill;
}
return _bgImageView;
}
@@ -494,4 +600,46 @@
}
return _bgView;
}
- (UIView *)regionContainView {
if (!_regionContainView) {
_regionContainView = [[UIView alloc] init];
_regionContainView.backgroundColor = UIColorFromRGB(0xF5F6FA);
[_regionContainView setCornerRadius:kGetScaleWidth(52)/2];
UIImageView *arrow = [[UIImageView alloc] initWithImage:[kImage(@"grey_arrow") ms_SetImageForRTL]];
// arrow.layer.contentsRect = CGRectMake(0.1, 0.1, 0.8, 0.8);
arrow.contentMode = UIViewContentModeScaleAspectFit;
[_regionContainView addSubview:arrow];
[arrow mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(_regionContainView);
make.trailing.mas_equalTo(-20);
make.width.height.mas_equalTo(20);
}];
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didTapRegionButton)];
[_regionContainView addGestureRecognizer:tap];
}
return _regionContainView;
}
- (UILabel *)regionLabel {
if (!_regionLabel) {
_regionLabel = [UILabel labelInitWithText:YMLocalizedString(@"1.0.31_text_0")
font:kFontMedium(12)
textColor:UIColorFromRGB(0xb3b3c1)];
_regionLabel.userInteractionEnabled = YES;
}
return _regionLabel;
}
- (NetImageView *)regionFlagImageView {
if (!_regionFlagImageView) {
_regionFlagImageView = [[NetImageView alloc] init];
_regionFlagImageView.contentMode = UIViewContentModeScaleAspectFit;
_regionFlagImageView.userInteractionEnabled = YES;
}
return _regionFlagImageView;
}
@end

View File

@@ -0,0 +1,23 @@
//
// RegionListViewController.h
// YuMi
//
// Created by P on 2024/12/13.
//
#import "MvpViewController.h"
@class PIHomeCategoryTitleModel, RegionListInfo;
NS_ASSUME_NONNULL_BEGIN
@interface RegionListViewController : MvpViewController
@property(nonatomic, copy) void(^handleDismiss)(void);
@property(nonatomic, copy) void(^handleTapCategiryComfirm)(PIHomeCategoryTitleModel *tagModel);
@property(nonatomic, copy) void(^handleTapRegionComfirm)(RegionListInfo *regionInfo);
- (instancetype)initForRegionList:(NSArray <RegionListInfo *>*)regionInfoList;
- (instancetype)initForHomeTags:(NSArray <PIHomeCategoryTitleModel*>*)tags currentItem:(PIHomeCategoryTitleModel *)itemModel;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,510 @@
//
// RegionListViewController.m
// YuMi
//
// Created by P on 2024/12/13.
//
#import "RegionListViewController.h"
#import "PIHomeCategoryTitleModel.h"
#import "LoginFullInfoPresenter.h"
#import "RegionListInfo.h"
@interface RegionListCell : UICollectionViewCell
@property(nonatomic, strong) RegionListInfo *regionModel;
@property(nonatomic, strong) PIHomeCategoryTitleModel *tagModel;
@property(nonatomic, strong) UIView *selectedBG;
@property(nonatomic, strong) UIImageView *selectedMark;
@property(nonatomic, strong) NetImageView *flagImageView;
@property(nonatomic, strong) UILabel *titleLabel;
+ (void)registerTo:(UICollectionView *)collectionView;
+ (RegionListCell *)cellFor:(UICollectionView *)collectionView indexPath:(NSIndexPath *)indexPath;
@end
@implementation RegionListCell
+ (void)registerTo:(UICollectionView *)collectionView {
[collectionView registerClass:[self class] forCellWithReuseIdentifier:NSStringFromClass([self class])];
}
+ (RegionListCell *)cellFor:(UICollectionView *)collectionView
indexPath:(NSIndexPath *)indexPath {
RegionListCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([self class])
forIndexPath:indexPath];
// [cell.contentView setBackgroundColor:UIColorFromRGB(0xF7F7F7)];
// [cell setCornerRadius:19];
return cell;
}
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
[self.contentView addSubview:self.flagImageView];
[self.contentView addSubview:self.titleLabel];
[self.contentView addSubview:self.selectedMark];
[self.flagImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(14);
make.centerY.mas_equalTo(self.contentView);
make.size.mas_equalTo(CGSizeMake(30, 22));
}];
[self.selectedMark mas_makeConstraints:^(MASConstraintMaker *make) {
make.trailing.mas_equalTo(-14);
make.centerY.mas_equalTo(self.contentView);
make.size.mas_equalTo(CGSizeMake(20, 20));
}];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(self.flagImageView.mas_trailing).offset(6);
make.trailing.mas_equalTo(self.selectedMark.mas_leading).offset(-6);
make.centerY.mas_equalTo(self.contentView);
make.height.mas_equalTo(20);
}];
UIView *line = [[UIView alloc] init];
line.backgroundColor = UIColorFromRGB(0xe4e4e4);
[self.contentView addSubview:line];
[line mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self.contentView);
make.trailing.mas_equalTo(self.selectedMark);
make.leading.mas_equalTo(self.flagImageView);
make.height.mas_equalTo(1);
}];
// [self.contentView addSubview:self.selectedBG];
// [self.selectedBG mas_makeConstraints:^(MASConstraintMaker *make) {
// make.edges.mas_equalTo(self.contentView);
// }];
}
return self;
}
- (void)setSelected:(BOOL)selected {
[super setSelected:selected];
// self.selectedBG.hidden = !selected;
self.selectedMark.hidden = !selected;
// if (selected) {
// [self.contentView setBackgroundColor:UIColorFromRGB(0xFFFAF5)];
// } else {
// [self.contentView setBackgroundColor:UIColorFromRGB(0xF7F7F7)];
// }
}
- (void)prepareForReuse {
[super prepareForReuse];
self.flagImageView.image = nil;
}
- (void)setTagModel:(PIHomeCategoryTitleModel *)tagModel {
_tagModel = tagModel;
self.flagImageView.imageUrl = tagModel.icon;
self.titleLabel.text = tagModel.name;
}
- (void)setRegionModel:(RegionListInfo *)regionModel {
_regionModel = regionModel;
self.flagImageView.imageUrl = regionModel.icon;
self.titleLabel.text = regionModel.name;
}
#pragma mark -
- (UIView *)selectedBG {
if (!_selectedBG) {
_selectedBG = [[UIView alloc] init];
[_selectedBG setCornerRadius:19
corners:kCALayerMaxXMaxYCorner | kCALayerMaxXMinYCorner | kCALayerMinXMaxYCorner | kCALayerMinXMinYCorner
borderWidth:1
borderColor:UIColorFromRGB(0xFF8C03)];
_selectedBG.hidden = YES;
}
return _selectedBG;
}
- (NetImageView *)flagImageView {
if (!_flagImageView) {
_flagImageView = [[NetImageView alloc] init];
_flagImageView.contentMode = UIViewContentModeScaleAspectFit;
}
return _flagImageView;
}
- (UILabel *)titleLabel {
if (!_titleLabel) {
_titleLabel = [UILabel labelInitWithText:@"" font:kFontMedium(15) textColor:UIColorFromRGB(0x313131)];
}
return _titleLabel;
}
- (UIImageView *)selectedMark {
if (!_selectedMark) {
_selectedMark = [[UIImageView alloc] initWithImage:kImage(@"region_list_selected")];
_selectedMark.hidden = YES;
}
return _selectedMark;
}
@end
@interface RegionListViewController () <UISearchBarDelegate, UICollectionViewDelegateFlowLayout, UICollectionViewDataSource>
@property(nonatomic, assign) NSInteger type;
@property(nonatomic, assign) CGFloat displayHeight;
@property(nonatomic, strong) UILabel *titleLabel;
@property(nonatomic, strong) UISearchBar *searchBar;
@property(nonatomic, strong) UICollectionView *collectionView;
@property(nonatomic, strong) UIButton *comfirmButton;
@property(nonatomic, strong) UIView *bgView;
@property(nonatomic, strong) UIView *emptyView;
@property(nonatomic, copy) NSArray <PIHomeCategoryTitleModel*> *tagDataSource;
@property(nonatomic, strong) PIHomeCategoryTitleModel *selectedTag;
@property(nonatomic, copy) NSArray <RegionListInfo *> *regionList;
@property(nonatomic, strong) NSMutableArray <RegionListInfo *> *filteredRegionList;
@property(nonatomic, strong) RegionListInfo *selectedRegion;
@property(nonatomic, assign) NSInteger defaultIndex;
@end
@implementation RegionListViewController
- (LoginFullInfoPresenter *)createPresenter {
return [[LoginFullInfoPresenter alloc] init];
}
- (instancetype)initForRegionList:(NSArray <RegionListInfo *>*)regionInfoList {
if (self = [super init]) {
self.type = 1;
self.displayHeight = KScreenHeight/2;
self.regionList = regionInfoList;
self.filteredRegionList = [regionInfoList mutableCopy];
[self.collectionView reloadData];
}
return self;
}
- (instancetype)initForHomeTags:(NSArray <PIHomeCategoryTitleModel*>*)tags
currentItem:(nonnull PIHomeCategoryTitleModel *)itemModel {
if (self = [super init]) {
self.type = 2;
self.modalPresentationStyle = UIModalPresentationOverFullScreen;
self.displayHeight = KScreenHeight*2/3;
NSMutableArray *temp = @[].mutableCopy;
for (PIHomeCategoryTitleModel *model in tags) {
if (![NSString isEmpty:model.regionId]) {
[temp addObject:model];
}
}
self.defaultIndex = [temp indexOfObject:itemModel];
self.selectedTag = itemModel;
self.tagDataSource = temp;
[self.collectionView reloadData];
[self.collectionView selectItemAtIndexPath:[NSIndexPath indexPathForRow:self.defaultIndex inSection:0]
animated:NO
scrollPosition:UICollectionViewScrollPositionNone];
}
return self;
}
- (void)viewDidLoad {
[super viewDidLoad];
self.title = YMLocalizedString(@"1.0.31_text_1");
switch (self.type) {
case 1:
[self setupUIForFullDisplay];
break;
case 2:
[self setupUIForHalfScreen];
break;
default:
break;
}
}
- (void)setupUIForFullDisplay {
self.view.backgroundColor = [UIColor whiteColor];
// self.comfirmButton.frame = CGRectMake(0, 0, 48, 44);
// UIBarButtonItem *rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:self.comfirmButton];
// self.navigationItem.rightBarButtonItem = rightBarButtonItem;
[self.view addSubview:self.titleLabel];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(10);
make.centerX.mas_equalTo(self.view);
make.height.mas_equalTo(34);
}];
[self.view addSubview:self.comfirmButton];
[self.comfirmButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self.titleLabel);
make.trailing.mas_equalTo(-15);
}];
[self.view addSubview:self.searchBar];
[self.searchBar mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(10);
make.leading.trailing.mas_equalTo(self.view).inset(16);
make.height.mas_equalTo(34);
}];
[self.view addSubview:self.collectionView];
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.searchBar.mas_bottom).offset(8);
make.bottom.leading.trailing.mas_equalTo(0);
}];
[self.view addSubview:self.emptyView];
[self.emptyView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.collectionView).offset(8);
make.centerX.mas_equalTo(self.collectionView);
make.size.mas_equalTo(CGSizeMake(120, 120));
}];
}
- (void)setupUIForHalfScreen {
self.view.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5];
[self.view addSubview:self.titleLabel];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(KScreenHeight - self.displayHeight);
make.centerX.mas_equalTo(self.view);
make.height.mas_equalTo(34);
}];
[self.view addSubview:self.comfirmButton];
[self.comfirmButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self.titleLabel);
make.trailing.mas_equalTo(-15);
}];
[self.view addSubview:self.collectionView];
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(8);
make.bottom.leading.trailing.mas_equalTo(0);
}];
[self.view insertSubview:self.bgView belowSubview:self.titleLabel];
[self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.titleLabel).offset(-10);
make.leading.bottom.trailing.mas_equalTo(self.view);
}];
UIButton *b = [UIButton buttonWithType:UIButtonTypeCustom];
[b addTarget:self action:@selector(didTapSpace) forControlEvents:UIControlEventTouchUpInside];
[self.view insertSubview:b atIndex:0];
[b mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.leading.trailing.mas_equalTo(self.view);
make.height.mas_equalTo(KScreenHeight/2);
}];
}
- (void)didTapComfirm {
if (self.type == 1) {
if (self.handleTapRegionComfirm) {
self.handleTapRegionComfirm(self.selectedRegion);
}
} else if (self.type == 2) {
if (self.handleTapCategiryComfirm) {
self.handleTapCategiryComfirm(self.selectedTag);
}
}
[self dismissViewControllerAnimated:YES completion:^{}];
}
- (void)didTapSpace {
@kWeakify(self);
[self dismissViewControllerAnimated:YES completion:^{
@kStrongify(self);
if (self.handleDismiss) {
self.handleDismiss();
}
}];
}
#pragma mark - UISearchBarDelegate
// "Search"
- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar {
[searchBar resignFirstResponder]; //
}
- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText {
if (searchText.length == 0) {
//
self.filteredRegionList = [self.regionList copy];
} else {
//
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"name CONTAINS[cd] %@", searchText];
self.filteredRegionList = [[self.regionList filteredArrayUsingPredicate:predicate] mutableCopy];
}
[self.collectionView reloadData];
self.emptyView.hidden = self.filteredRegionList.count > 0;
}
//
- (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar {
[searchBar resignFirstResponder];
searchBar.text = @"";
self.filteredRegionList = [self.regionList mutableCopy];
[self.collectionView reloadData];
}
#pragma mark -
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
if (self.type == 1) {
return self.filteredRegionList.count;
} else if (self.type == 2) {
return self.tagDataSource.count;
}
return 0;
}
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
RegionListCell *cell = [RegionListCell cellFor:collectionView indexPath:indexPath];
if (self.type == 1) {
cell.regionModel = [self.filteredRegionList xpSafeObjectAtIndex:indexPath.row];
} else if (self.type == 2) {
cell.tagModel = [self.tagDataSource xpSafeObjectAtIndex:indexPath.row];
}
return cell;
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
if (self.type == 1) {
self.selectedRegion = [self.filteredRegionList xpSafeObjectAtIndex:indexPath.row];
} else if (self.type == 2) {
self.selectedTag = [self.tagDataSource xpSafeObjectAtIndex:indexPath.row];
if (self.handleTapCategiryComfirm) {
self.handleTapCategiryComfirm(self.selectedTag);
}
}
}
#pragma mark -
- (UISearchBar *)searchBar {
if (!_searchBar) {
UIColor *bgColor = UIColorFromRGB(0xf4f4f4);
_searchBar = [[UISearchBar alloc] init];
_searchBar.delegate = self;
_searchBar.placeholder = YMLocalizedString(@"XPHomeSearchNavView1");
_searchBar.barTintColor = bgColor;
[_searchBar setCornerRadius:34/2];
if (@available(iOS 13.0, *)) {
_searchBar.searchTextField.backgroundColor = bgColor;
_searchBar.searchTextField.textColor = UIColorFromRGB(0x313131);
} else {
UITextField *searchField = [self findTextFieldInSearchBar:_searchBar];
if (searchField) {
searchField.backgroundColor = bgColor;
searchField.textColor = UIColorFromRGB(0x313131);
}
}
}
return _searchBar;
}
- (UICollectionView *)collectionView {
if (!_collectionView) {
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
// if (self.type == 1) {
layout.itemSize = CGSizeMake(KScreenWidth - 30, 38);
// } else if (self.type == 2) {
// layout.itemSize = CGSizeMake(kGetScaleWidth(166), 38);
// }
layout.sectionInset = UIEdgeInsetsMake(0, 16, kSafeAreaBottomHeight, 16);
layout.minimumLineSpacing = 10;
layout.minimumInteritemSpacing = 10;
_collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 44, KScreenWidth, KScreenHeight-44)
collectionViewLayout:layout];
_collectionView.delegate = self;
_collectionView.dataSource = self;
_collectionView.backgroundColor = [UIColor whiteColor];
[RegionListCell registerTo:_collectionView];
}
return _collectionView;
}
- (UILabel *)titleLabel {
if (!_titleLabel) {
_titleLabel = [UILabel labelInitWithText:YMLocalizedString(@"1.0.31_text_2")
font:kFontSemibold(16)
textColor:UIColorFromRGB(0x313131)];
}
return _titleLabel;
}
- (UIButton *)comfirmButton {
if (!_comfirmButton) {
_comfirmButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_comfirmButton setTitleColor:UIColorFromRGB(0xFF8C03) forState:UIControlStateNormal];
[_comfirmButton setTitle:YMLocalizedString(@"TTAlertConfig0") forState:UIControlStateNormal];
[_comfirmButton addTarget:self
action:@selector(didTapComfirm)
forControlEvents:UIControlEventTouchUpInside];
}
return _comfirmButton;
}
- (UITextField *)findTextFieldInSearchBar:(UISearchBar *)searchBar {
for (UIView *subview in searchBar.subviews) {
for (UIView *nestedSubview in subview.subviews) {
if ([nestedSubview isKindOfClass:[UITextField class]]) {
return (UITextField *)nestedSubview;
}
}
}
return nil;
}
- (UIView *)bgView {
if (!_bgView) {
UIView *bg = [[UIView alloc] init];
bg.backgroundColor = [UIColor whiteColor];
[bg setCornerRadius:16 cornerMask:kCALayerMinXMinYCorner | kCALayerMaxXMinYCorner];
bg.userInteractionEnabled = NO;
_bgView = bg;
}
return _bgView;
}
- (UIView *)emptyView {
if (!_emptyView) {
_emptyView = [[UIView alloc] init];
UIImageView *icon = [[UIImageView alloc] initWithImage:[UIImageConstant defaultEmptyPlaceholder_UFO]];
[_emptyView addSubview:icon];
[icon mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.centerX.mas_equalTo(_emptyView);
make.size.mas_equalTo(CGSizeMake(80, 80));
}];
UILabel *emptyTitle = [UILabel labelInitWithText:YMLocalizedString(@"XPMomentsRecommendViewController0")
font:kFontRegular(14)
textColor:[UIColor colorWithWhite:0 alpha:0.4]];
emptyTitle.textAlignment = NSTextAlignmentCenter;
[_emptyView addSubview:emptyTitle];
[emptyTitle mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(_emptyView);
make.top.mas_equalTo(icon.mas_bottom).offset(6);
make.height.mas_equalTo(22);
}];
_emptyView.hidden = YES;
}
return _emptyView;
}
@end

View File

@@ -741,7 +741,7 @@ typedef NS_ENUM(NSUInteger, CustomMessageTypeCustomRoomBackground) {
@interface AttachmentModel : PIBaseModel<NIMCustomAttachment>
@property (nonatomic, strong) id data;
@property (nonatomic, strong) id data; // Must be NSMutable Type
@property (nonatomic,assign) int first;
@property (nonatomic,assign) int second;
@property(nonatomic,assign) BOOL isBroadcast;

View File

@@ -20,7 +20,7 @@ typedef NS_ENUM(NSInteger, XPMineSettingItemType){
XPMineSettingItemType_Permission,///关于我们
XPMineSettingItemType_Helper,///帮助
XPMineSettingItemType_Feedback,//我要反馈
XPMineSettingItemType_Clear_Memory,///清缓存
XPMineSettingItemType_Clear_Memory,///清缓存
XPMineSettingItemType_About_Us,///关于我们
XPMineSettingItemType_CheckUpdate,///检查更新
XPMineSettingItemType_Delete_Account,///注销账号

View File

@@ -46,12 +46,14 @@
} showLoading:YES]];
}
-(void)confirmExchangeDiamondWithGoldNum:(NSString *)goldNum diamondNum:(NSString *)diamondNum currency:(NSString *)currency{
@kWeakify(self);
[Api confirmExchangeDiamond:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
@kStrongify(self);
[[self getView]confirmExchangeDiamondSuccessWithDiamondNum:diamondNum goldNum:goldNum];
} fail:^(NSInteger code, NSString * _Nullable msg) {
[[self getView]confirmExchangeDiamondFail];
@kStrongify(self);
[[self getView] confirmExchangeDiamondFail];
} showLoading:YES errorToast:YES] goldNum:goldNum diamondNum:diamondNum currency:currency];
}
-(void)getGoldDetailsDataWithStartTime:(NSString *)startTime endTime:(NSString *)endTime{

View File

@@ -97,8 +97,7 @@
self.recheckIndex = 0;
}
//
[self requestAPPOrderData:@"com.hflighting.yumi.gold.1_7000" isFroRecheck:YES];
// [self requestAPPOrderData:@"com.hflighting.yumi.gold.1_7000" isFroRecheck:YES];
self.isProcessing = YES;
NSDictionary *dic = [array xpSafeObjectAtIndex:self.recheckIndex];

View File

@@ -144,6 +144,7 @@ HWDMP4PlayDelegate>
@property (nonatomic,strong) NetImageView *rechargeImageView;
///
@property (nonatomic,strong) NetImageView *vipPlateImageView;
@property (nonatomic,strong) NetImageView *agentPlateImageView;
///
@property (nonatomic,strong) UIImageView *newUserImageView;
///
@@ -426,6 +427,7 @@ HWDMP4PlayDelegate>
[stack addArrangedSubview:self.experImageView];
[stack addArrangedSubview:self.charmImageView];
[stack addArrangedSubview:self.vipPlateImageView];
[stack addArrangedSubview:self.agentPlateImageView];
[self.beautIDView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(24);
@@ -452,6 +454,10 @@ HWDMP4PlayDelegate>
make.height.mas_equalTo(24);
make.width.mas_equalTo(60);
}];
[self.agentPlateImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(24);
make.width.mas_equalTo(60);
}];
}
- (void)setupNameplateArea {
@@ -666,6 +672,10 @@ HWDMP4PlayDelegate>
if (userInfo.usingPersonalBackground) {
if (![NSString isEmpty:userInfo.usingPersonalBackground.effect]) {
switch (userInfo.usingPersonalBackground.effectType) {
case 0: {
self.personalBGImageView.imageUrl = userInfo.usingPersonalBackground.effect;
}
break;
case 1: {
@kWeakify(self);
[self.personalBGMP4Parser parseWithURL:[userInfo.usingPersonalBackground.effect pureURLString]
@@ -734,11 +744,18 @@ HWDMP4PlayDelegate>
}
self.charmImageView.hidden = userInfo.userLevelVo.charmUrl.length <= 0;
if (userInfo.userVipInfoVO.nameplateUrl.length > 0) {
[self loadNamePlate:userInfo.userVipInfoVO.nameplateUrl];
[self loadNamePlate:userInfo.userVipInfoVO.nameplateUrl targetView:self.vipPlateImageView];
self.vipPlateImageView.hidden = NO;
} else {
self.vipPlateImageView.hidden = YES;
}
if (userInfo.guildNameplateIcon.length > 0) {
[self loadNamePlate:userInfo.guildNameplateIcon targetView:self.agentPlateImageView];
self.agentPlateImageView.hidden = NO;
} else {
self.agentPlateImageView.hidden = YES;
}
self.rechargeImageView.hidden = !_userInfo.isRechargeUser;
[self.userPhotoArray removeAllObjects];
@@ -781,14 +798,14 @@ HWDMP4PlayDelegate>
}
}
- (void)loadNamePlate:(NSString *)imagePath {
[self.vipPlateImageView loadImageWithUrl:imagePath completion:^(UIImage * _Nullable image, NSURL * _Nonnull url) {
- (void)loadNamePlate:(NSString *)imagePath targetView:(NetImageView *)targetView {
[targetView loadImageWithUrl:imagePath completion:^(UIImage * _Nullable image, NSURL * _Nonnull url) {
if (image) {
CGSize size = image.size;
[self.vipPlateImageView mas_updateConstraints:^(MASConstraintMaker *make) {
[targetView mas_updateConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(round(size.width * 24/size.height));
}];
self.vipPlateImageView.image = image;
targetView.image = image;
}
}];
}
@@ -1181,6 +1198,20 @@ HWDMP4PlayDelegate>
return _vipPlateImageView;
}
- (NetImageView *)agentPlateImageView {
if (!_agentPlateImageView) {
NetImageConfig * config = [[NetImageConfig alloc] init];
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
config.imageType = ImageTypeUserCardLevel;
_agentPlateImageView = [[NetImageView alloc] initWithConfig:config];
_agentPlateImageView.userInteractionEnabled = YES;
_agentPlateImageView.contentMode = UIViewContentModeScaleAspectFit;
}
return _agentPlateImageView;
}
- (UIImageView *)newUserImageView {
if (!_newUserImageView) {
_newUserImageView = [[UIImageView alloc] init];

View File

@@ -16,6 +16,8 @@ NS_ASSUME_NONNULL_BEGIN
@property(nonatomic,copy) NSString *name;
@property(nonatomic,copy) NSString *id;
@property(nonatomic,assign) BOOL isHomeRecommend;
@property(nonatomic, copy) NSString *icon;
@property(nonatomic, copy) NSString *regionId;
@end
NS_ASSUME_NONNULL_END

View File

@@ -133,12 +133,17 @@
@kWeakify(self);
[Api getHomeTabsCompletion:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
@kStrongify(self);
NSArray * array = [PIHomeCategoryTitleModel modelsWithArray:data.data];
for (PIHomeCategoryTitleModel *model in array) {
model.checkedWidth = [UILabel getWidthWithText:model.name height:kGetScaleWidth(44) font:kFontSemibold(16)];
model.noCheckedWidth = [UILabel getWidthWithText:model.name height:kGetScaleWidth(44) font:kFontRegular(14)];
if (code == 200) {
NSArray * array = [PIHomeCategoryTitleModel modelsWithArray:data.data];
for (PIHomeCategoryTitleModel *model in array) {
model.checkedWidth = [UILabel getWidthWithText:model.name height:kGetScaleWidth(44) font:kFontSemibold(16)];
model.noCheckedWidth = [UILabel getWidthWithText:model.name height:kGetScaleWidth(44) font:kFontRegular(14)];
}
[[self getView] getHomeTagListSuccess:array];
} else {
[[self getView] getHomeTagListFailure];
[[self getView] showErrorToast:msg];
}
[[self getView] getHomeTagListSuccess:array];
}];
}
///

View File

@@ -13,6 +13,7 @@ NS_ASSUME_NONNULL_BEGIN
@optional
///获取所有的tag成功
- (void)getHomeTagListSuccess:(NSArray<PIHomeCategoryTitleModel *> *)array;
- (void)getHomeTagListFailure;
///获取首页轮播图列表成功
- (void)getHomeTopBannerListSuccess:(NSArray*)list;
////首页改版资源位

View File

@@ -39,6 +39,12 @@
[super viewDidLoad];
[self setup];
[self preLoadGifts];
//#if DEBUG
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// [self performSelector:@selector(completeUserInfo)];
// });
//#endif
}
/// -1: roomUid

View File

@@ -358,7 +358,7 @@
if (!_collectionView) {
MSBaseRTLFlowLayout *layout = [[MSBaseRTLFlowLayout alloc] init];
layout.minimumInteritemSpacing = kGetScaleWidth(0);
layout.minimumLineSpacing = kGetScaleWidth(10);
layout.minimumLineSpacing = kGetScaleWidth(18);
layout.sectionInset = UIEdgeInsetsMake(0, kGetScaleWidth(15), 0, kGetScaleWidth(15));
_collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
_collectionView.backgroundColor = [UIColor clearColor];

View File

@@ -12,6 +12,7 @@
#import <JXPagingView/JXPagerListRefreshView.h>
#import <JXCategoryView/JXCategoryView.h>
#import <MJRefresh/MJRefresh.h>
#import "SDWebImageManager.h"
///Tool
#import "Api+Home.h"
#import "YUMIMacroUitls.h"
@@ -52,10 +53,232 @@
#import "BaseNavigationController.h"
#import "XPAdImageTool.h"
#import "PIHomeCategoryTitleModel.h"
#import "RegionListViewController.h"
UIKIT_EXTERN NSString * kHomeMoreScrollPageKey;
UIKIT_EXTERN NSString * const kOpenRoomNotification;
@interface XPNewHomeViewController ()<JXPagerViewDelegate,JXPagerMainTableViewGestureDelegate,JXCategoryViewDelegate, XPHomeContainerProtocol, XPNewHomeNavViewDelegate,XPNewHomeHeadViewDelegate,XPHomeRecommendOtherRoomViewDelegate,XPHomeRecommendViewControllerDelegate>
@interface HomeCategoryTabListCell : UICollectionViewCell
@property(nonatomic, assign) BOOL isSelected;
@property(nonatomic, strong) UIView *selectedBackground;
@property(nonatomic, strong) NetImageView *iconImageView;
@property(nonatomic, strong) PIHomeCategoryTitleModel *cellModel;
@property(nonatomic, copy) void(^didTapCategoryModel)(PIHomeCategoryTitleModel *model);
@end
@implementation HomeCategoryTabListCell
- (instancetype)initWithFrame:(CGRect)frame
{
if (self = [super initWithFrame:frame]) {
self.backgroundColor = [UIColor clearColor];
[self.contentView setCornerRadius:15];
self.contentView.backgroundColor = [UIColor whiteColor];
[self.contentView addSubview:self.selectedBackground];
[self.selectedBackground mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.contentView);
}];
[self.contentView addSubview:self.iconImageView];
[self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.center.mas_equalTo(self.contentView);
make.size.mas_equalTo(CGSizeMake(36, 23));
}];
}
return self;
}
- (void)setCellModel:(PIHomeCategoryTitleModel *)cellModel {
_cellModel = cellModel;
self.iconImageView.imageUrl = cellModel.icon;
}
- (void)setSelected:(BOOL)selected {
[super setSelected:selected];
self.selectedBackground.hidden = !selected;
if (selected && self.didTapCategoryModel) {
self.didTapCategoryModel(self.cellModel);
}
}
#pragma mark -
- (UIView *)selectedBackground {
if (!_selectedBackground) {
_selectedBackground = [[UIView alloc] init];
_selectedBackground.backgroundColor = [UIColor whiteColor];
[_selectedBackground setCornerRadius:15
corners:kCALayerMaxXMaxYCorner | kCALayerMaxXMinYCorner | kCALayerMinXMaxYCorner | kCALayerMinXMinYCorner
borderWidth:1
borderColor:UIColorFromRGB(0xFF8C03)];
_selectedBackground.hidden = YES;
}
return _selectedBackground;
}
- (NetImageView *)iconImageView {
if (!_iconImageView) {
_iconImageView = [[NetImageView alloc] init];
}
return _iconImageView;
}
@end
@interface HomeCategoryTabList : UIView <UICollectionViewDataSource, UICollectionViewDelegateFlowLayout>
@property(nonatomic, strong) UIButton *arrowButton;
@property(nonatomic, strong) UIView *gradientMask;
@property(nonatomic, strong) UICollectionView *tabCollectionView;
@property(nonatomic, copy) NSArray <PIHomeCategoryTitleModel*> *tabArray;
@property(nonatomic, copy) void(^didTapCategoryModel)(PIHomeCategoryTitleModel *model);
@property(nonatomic, copy) void(^didTapArrow)(void);
- (void)closeArrow;
- (void)updateIndex:(NSInteger)index;
@end
@implementation HomeCategoryTabList
- (instancetype)init {
if (self = [super init]) {
self.backgroundColor = [[ClientConfig shareConfig] bgColor];
[self addSubview:self.tabCollectionView];
[self.tabCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.bottom.mas_equalTo(self);
make.leading.mas_equalTo(0);
make.trailing.mas_equalTo(self).offset(-15);
}];
[self addSubview:self.arrowButton];
[self.arrowButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self);
make.size.mas_equalTo(CGSizeMake(24, 24));
make.trailing.mas_equalTo(-15);
}];
_gradientMask = [[UIView alloc] init];
[_gradientMask addGradientBackgroundWithColors:@[
UIColorRGBAlpha(0xffffff, 0),
[[ClientConfig shareConfig] bgColor],
] startPoint:CGPointMake(0, 0.5) endPoint:CGPointMake(0.3, 0.5) cornerRadius:0];
[self insertSubview:self.gradientMask belowSubview:self.arrowButton];
[self.gradientMask mas_makeConstraints:^(MASConstraintMaker *make) {
make.trailing.mas_equalTo(self.arrowButton);
make.top.bottom.mas_equalTo(self);
make.width.mas_equalTo(30);
}];
}
return self;
}
- (void)handleTapArrow {
if (_didTapArrow) {
self.didTapArrow();
}
}
- (void)setTabArray:(NSArray<PIHomeCategoryTitleModel *> *)tabArray {
// NSMutableArray *temp = @[].mutableCopy;
// for (PIHomeCategoryTitleModel *model in tabArray) {
// if (![NSString isEmpty:model.regionId]) {
// [temp addObject:model];
// }
// }
_tabArray = tabArray;
if (46 * _tabArray.count + 12 * (_tabArray.count-1) > KScreenWidth-30) {
self.gradientMask.hidden = NO;
self.arrowButton.hidden = NO;
} else {
self.gradientMask.hidden = YES;
self.arrowButton.hidden = YES;
}
[self.tabCollectionView reloadData];
if (_tabArray.count > 0) {
[self.tabCollectionView selectItemAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]
animated:NO
scrollPosition:UICollectionViewScrollPositionNone];
}
}
- (void)closeArrow {
}
- (void)updateIndex:(NSInteger)index {
[self.tabCollectionView selectItemAtIndexPath:[NSIndexPath indexPathForRow:index inSection:0] animated:YES scrollPosition:UICollectionViewScrollPositionNone];
// [self.tabCollectionView scrollToItemAtIndexPath:[NSIndexPath indexPathForRow:index inSection:0] atScrollPosition:UICollectionViewScrollPositionCenteredHorizontally animated:YES];
}
#pragma mark -
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
return self.tabArray.count;
}
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
HomeCategoryTabListCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"HomeCategoryTabListCell" forIndexPath:indexPath];
cell.cellModel = [self.tabArray xpSafeObjectAtIndex:indexPath.row];
@kWeakify(self);
[cell setDidTapCategoryModel:^(PIHomeCategoryTitleModel *model) {
@kStrongify(self);
if (self.didTapCategoryModel) {
self.didTapCategoryModel(model);
}
}];
return cell;
}
#pragma mark -
- (UIButton *)arrowButton {
if (!_arrowButton) {
_arrowButton = [UIButton buttonWithType:UIButtonTypeCustom];
_arrowButton.backgroundColor = [UIColor clearColor];
[_arrowButton setImage:kImage(@"common_down_arrow")
forState:UIControlStateNormal];
[_arrowButton addTarget:self
action:@selector(handleTapArrow)
forControlEvents:UIControlEventTouchUpInside];
}
return _arrowButton;
}
- (UIScrollView *)tabCollectionView {
if (!_tabCollectionView) {
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
layout.itemSize = CGSizeMake(46, 30);
layout.minimumLineSpacing = 12;
layout.minimumInteritemSpacing = 12;
layout.sectionInset = UIEdgeInsetsMake(0, 14, 0, 30);
layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
_tabCollectionView = [[UICollectionView alloc] initWithFrame:CGRectZero
collectionViewLayout:layout];
_tabCollectionView.backgroundColor = [UIColor clearColor];
_tabCollectionView.showsHorizontalScrollIndicator = NO;
_tabCollectionView.delegate = self;
_tabCollectionView.dataSource = self;
[_tabCollectionView registerClass:[HomeCategoryTabListCell class]
forCellWithReuseIdentifier:@"HomeCategoryTabListCell"];
}
return _tabCollectionView;
}
@end
@interface XPNewHomeViewController ()<
JXPagerViewDelegate,
JXPagerMainTableViewGestureDelegate,
JXCategoryViewDelegate,
XPHomeContainerProtocol,
XPNewHomeNavViewDelegate,
XPNewHomeHeadViewDelegate,
XPHomeRecommendOtherRoomViewDelegate,
XPHomeRecommendViewControllerDelegate>
///
@property(nonatomic,strong) XPNewHomeHeadView *headView;
@@ -63,6 +286,8 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
@property (nonatomic, strong) NSMutableArray<PIHomeCategoryTitleModel *> *tagModelList;
///
@property (nonatomic, strong) JXCategoryTitleView *titleView;
@property(nonatomic, strong) HomeCategoryTabList *categoryTagList;
///lineView
@property (nonatomic, strong) JXPagerView *pagingView;
@@ -137,6 +362,18 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
kWindow.rootViewController = nav;
XPAdImageTool.shareImageTool.isImLogin = NO;
}
- (void)createTagScrollView {
if (_categoryTagList) {
return;
}
[self.titleView addSubview:self.categoryTagList];
[self.categoryTagList mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.titleView);
}];
}
#pragma mark - Private Method
- (void)initSubViews {
@@ -244,6 +481,23 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
}];
}
- (void)showAllTags {
RegionListViewController *vc = [[RegionListViewController alloc] initForHomeTags:self.tagModelList
currentItem:self.tagModelList[self.titleView.selectedIndex]];
@kWeakify(self);
vc.handleDismiss = ^{
@kStrongify(self);
[self.categoryTagList closeArrow];
};
vc.handleTapCategiryComfirm = ^(PIHomeCategoryTitleModel *tagModel) {
@kStrongify(self);
NSInteger index = [self.tagModelList indexOfObject:tagModel];
[self.titleView selectItemAtIndex:index];
[self.categoryTagList updateIndex:index];
};
[self presentViewController:vc animated:YES completion:^{ }];
}
#pragma mark - XPNewHomeNavViewDelegate
- (void)xPNewHomeNavView:(XPNewHomeNavView *)view didClickRank:(UIButton *)sender {
XPWebViewController * webVC =[[XPWebViewController alloc] initWithRoomUID:nil];
@@ -310,7 +564,7 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
return self.headView;
}
- (NSUInteger)heightForPinSectionHeaderInPagerView:(JXPagerView *)pagerView {
return kGetScaleWidth(30);
return kGetScaleWidth(40);
}
- (UIView *)viewForPinSectionHeaderInPagerView:(JXPagerView *)pagerView {
return self.titleView;
@@ -342,7 +596,6 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
return self.view;
}
#pragma mark - JXPagerMainTableViewGestureDelegate
- (BOOL)mainTableViewGestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
//categoryView
@@ -389,6 +642,7 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
///tag
- (void)getHomeTagListSuccess:(NSArray<PIHomeCategoryTitleModel *> *)array{
if(array.count == 0) {
[self.pagingView.mainTableView.mj_header endRefreshing];
return;
}
NSMutableArray *list = [NSMutableArray new];
@@ -403,11 +657,18 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
}
}
self.tagModelList = list;
self.titleView.titles = titleArray;
[self.titleView reloadData];
[self createTagScrollView];
[self.categoryTagList setTabArray:list];
}
- (void)getHomeTagListFailure {
[self.pagingView.mainTableView.mj_header endRefreshing];
}
- (void)homeChatPickSuccess:(NSString *)uid {
///
NSString *sessionId = uid;
@@ -521,17 +782,11 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
_titleView.cellSpacing = kGetScaleWidth(20);
_titleView.listContainer = (id<JXCategoryViewListContainer>)self.pagingView.listContainerView;
// JXCategoryIndicatorImageView * indicator = [[JXCategoryIndicatorImageView alloc] init];
// indicator.indicatorImageView.image = kImage(@"ms_login_choose_phone_icon");
// indicator.indicatorImageViewSize = CGSizeMake(kGetScaleWidth(24), kGetScaleWidth(24));
// indicator.verticalMargin = -kGetScaleWidth(4);
// indicator.contentMode = UIViewContentModeScaleAspectFit;
// _titleView.indicators = @[indicator];
}
return _titleView;
}
- (NSMutableArray<PIHomeCategoryTitleModel *> *)tagModelList{
if(!_tagModelList){
_tagModelList = [NSMutableArray array];
@@ -578,4 +833,21 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
}
return _validListDict;
}
- (HomeCategoryTabList *)categoryTagList {
if (!_categoryTagList) {
_categoryTagList = [[HomeCategoryTabList alloc] init];
@kWeakify(self);
[_categoryTagList setDidTapArrow:^{
@kStrongify(self);
[self showAllTags];
}];
[_categoryTagList setDidTapCategoryModel:^(PIHomeCategoryTitleModel *model) {
@kStrongify(self);
NSInteger index = [self.tagModelList indexOfObject:model];
[self.titleView selectItemAtIndex:index];
}];
}
return _categoryTagList;
}
@end

View File

@@ -0,0 +1,29 @@
//
// GiftAnimationManager.h
// YuMi
//
// Created by P on 2024/12/9.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface GiftAnimationHelper : NSObject
/**
* Begins a gift animation from a start point to an end point
* @param giftUrl URL of the gift image to display
* @param startPoint Starting position of the animation
* @param endPoint Ending position of the animation
* @param isGiftCombing Flag to determine if this is a combo animation
*/
- (void)beginGiftAnimation:(NSString *)giftUrl
startPoint:(CGPoint)startPoint
endPoint:(CGPoint)endPoint
isGiftCombing:(BOOL)isGiftCombing
toTargetView:(UIView *)targetView;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,335 @@
//
// GiftAnimationManager.m
// YuMi
//
// Created by P on 2024/12/9.
//
#import "GiftAnimationHelper.h"
// Constants
static const CGFloat kGiftImageSize = 55.0f;
static const CGFloat kStandardAnimationDuration = 3.2f;
static const CGFloat kComboAnimationDuration = 1.0f;
static const CGFloat kCleanupDelay = 0.25f;
static const CGFloat kComboInitialScale = 0.4f;
static const CGFloat kComboFinalScale = 2.0f;
static const CGFloat kComboScaleDuration = 0.1f;
static const CGFloat kComboMoveDuration = 0.5f;
static const CGFloat kComboTotalDuration = 0.6f;
static const CGFloat kStandardScaleDuration = 0.8f;
static const CGFloat kStandardTotalDuration = 3.2f;
static const CGFloat kStandardSecondPhaseDelay = 0.8f;
static const CGFloat kStandardFinalPhaseDelay = 2.6f;
@interface GiftAnimationHelper ()
@property (nonatomic, strong) NSMutableSet<NetImageView *> *giftReuseArray;
@property (nonatomic, strong) NSMutableSet<NetImageView *> *giftVisibleArray;
@property (nonatomic, strong) UIView *lowLevelView;
@end
@implementation GiftAnimationHelper
- (instancetype)init {
if (self = [super init]) {
self.giftReuseArray = [NSMutableSet set];
self.giftVisibleArray = [NSMutableSet set];
}
return self;
}
- (void)beginGiftAnimation:(NSString *)giftUrl
startPoint:(CGPoint)startPoint
endPoint:(CGPoint)endPoint
isGiftCombing:(BOOL)isGiftCombing
toTargetView:(UIView *)targetView {
// Input validation
if (!giftUrl.length || CGPointEqualToPoint(startPoint, endPoint)) {
NSLog(@"Invalid input parameters for gift animation");
return;
}
if (targetView == nil) {
return;
}
self.lowLevelView = targetView;
// Get or create gift image view
NetImageView *giftImageView = [self dequeueGiftImageView];
[self configureGiftImageView:giftImageView
withGiftUrl:giftUrl
startPoint:startPoint];
// Add to view hierarchy
[self.lowLevelView addSubview:giftImageView];
// Create and apply animation
CGFloat animationDuration = isGiftCombing ? kComboAnimationDuration : kStandardAnimationDuration;
CAAnimationGroup *animationGroup = isGiftCombing ?
[self createGiftComboAnimationStartPoint:startPoint endPoint:endPoint] :
[self createGiftAnimationStartPoint:startPoint endPoint:endPoint];
// Ensure correct starting position
giftImageView.layer.position = startPoint;
[giftImageView.layer addAnimation:animationGroup forKey:@"giftDisplayViewAnimation"];
// Schedule cleanup
[self performSelector:@selector(animationDidFinish:)
withObject:giftImageView
afterDelay:(animationDuration + kCleanupDelay)];
}
- (NetImageView *)dequeueGiftImageView {
NetImageView *giftImageView = [self.giftReuseArray anyObject];
if (giftImageView) {
[self.giftReuseArray removeObject:giftImageView];
} else {
giftImageView = [[NetImageView alloc] initWithFrame:CGRectMake(0, 0, kGiftImageSize, kGiftImageSize)];
[self.giftVisibleArray addObject:giftImageView];
}
return giftImageView;
}
- (void)configureGiftImageView:(NetImageView *)giftImageView
withGiftUrl:(NSString *)giftUrl
startPoint:(CGPoint)startPoint {
giftImageView.center = startPoint;
giftImageView.alpha = 1.0;
giftImageView.layer.anchorPoint = CGPointMake(0.5, 0.5);
giftImageView.imageUrl = giftUrl;
giftImageView.hidden = NO;
}
- (void)animationDidFinish:(NetImageView *)giftImageView {
[giftImageView removeFromSuperview];
giftImageView.hidden = YES;
[self.giftReuseArray addObject:giftImageView];
}
- (CAAnimationGroup *)createGiftComboAnimationStartPoint:(CGPoint)startPoint
endPoint:(CGPoint)endPoint {
// Initial shrink animation
CAKeyframeAnimation *initialScale = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"];
initialScale.duration = kComboScaleDuration;
initialScale.values = @[@1.0, @(kComboInitialScale)];
initialScale.repeatCount = 1;
initialScale.calculationMode = kCAAnimationCubic;
initialScale.removedOnCompletion = NO;
initialScale.fillMode = kCAFillModeForwards;
// Movement animation
CAKeyframeAnimation *movement = [CAKeyframeAnimation animationWithKeyPath:@"position"];
movement.duration = kComboMoveDuration;
movement.beginTime = kComboScaleDuration;
movement.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
movement.values = @[
[NSValue valueWithCGPoint:startPoint],
[NSValue valueWithCGPoint:endPoint]
];
movement.repeatCount = 1;
movement.removedOnCompletion = NO;
movement.fillMode = kCAFillModeForwards;
// Growth during movement animation
CAKeyframeAnimation *growthDuringMove = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"];
growthDuringMove.duration = kComboMoveDuration;
growthDuringMove.beginTime = kComboScaleDuration;
growthDuringMove.values = @[@(kComboInitialScale), @(kComboFinalScale)];
growthDuringMove.repeatCount = 1;
growthDuringMove.calculationMode = kCAAnimationCubic;
growthDuringMove.removedOnCompletion = NO;
growthDuringMove.fillMode = kCAFillModeForwards;
// Combine animations
CAAnimationGroup *group = [CAAnimationGroup animation];
group.duration = kComboTotalDuration;
group.animations = @[initialScale, movement, growthDuringMove];
group.repeatCount = 1;
group.removedOnCompletion = NO;
group.fillMode = kCAFillModeForwards;
return group;
}
/**
* Creates a complex gift animation with multiple phases
* @param startPoint Initial position of the gift
* @param endPoint Final position of the gift
* @return CAAnimationGroup containing multiple scale and position animations
*/
- (CAAnimationGroup *)createGiftAnimationStartPoint:(CGPoint)startPoint
endPoint:(CGPoint)endPoint {
CGPoint centerPoint = CGPointMake(KScreenWidth / 2, KScreenHeight / 2);
// Initial scale up animation
CAKeyframeAnimation *initialScale = [CAKeyframeAnimation animation];
initialScale.duration = kStandardScaleDuration;
initialScale.keyPath = @"transform.scale";
initialScale.values = @[@1.0, @1.5, @2.0, @1.5];
initialScale.repeatCount = 1;
initialScale.calculationMode = kCAAnimationCubic;
initialScale.removedOnCompletion = NO;
initialScale.fillMode = kCAFillModeForwards;
// Second phase scale animation
CAKeyframeAnimation *secondScale = [CAKeyframeAnimation animation];
secondScale.duration = kStandardScaleDuration;
secondScale.beginTime = kStandardSecondPhaseDelay;
secondScale.keyPath = @"transform.scale";
secondScale.values = @[@1.5, @2.0, @2.5, @3.0];
secondScale.repeatCount = 1;
secondScale.calculationMode = kCAAnimationCubic;
secondScale.removedOnCompletion = NO;
secondScale.fillMode = kCAFillModeForwards;
// Move to center animation
CAKeyframeAnimation *moveToCenter = [CAKeyframeAnimation animation];
moveToCenter.duration = kStandardScaleDuration;
moveToCenter.beginTime = kStandardSecondPhaseDelay;
moveToCenter.keyPath = @"position";
moveToCenter.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];
moveToCenter.values = @[
[NSValue valueWithCGPoint:startPoint],
[NSValue valueWithCGPoint:centerPoint]
];
moveToCenter.repeatCount = 1;
moveToCenter.removedOnCompletion = NO;
moveToCenter.fillMode = kCAFillModeForwards;
// Final scale down animation
CAKeyframeAnimation *finalScale = [CAKeyframeAnimation animation];
finalScale.duration = kStandardScaleDuration;
finalScale.beginTime = kStandardFinalPhaseDelay;
finalScale.keyPath = @"transform.scale";
finalScale.values = @[@3.0, @2.5, @2.0, @1.5, @1.0];
finalScale.repeatCount = 1;
// Move to final position animation
CAKeyframeAnimation *moveToEnd = [CAKeyframeAnimation animation];
moveToEnd.duration = kStandardScaleDuration;
moveToEnd.beginTime = kStandardFinalPhaseDelay;
moveToEnd.keyPath = @"position";
moveToEnd.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];
moveToEnd.values = @[
[NSValue valueWithCGPoint:centerPoint],
[NSValue valueWithCGPoint:endPoint]
];
moveToEnd.repeatCount = 1;
// Combine all animations
CAAnimationGroup *group = [CAAnimationGroup animation];
group.duration = kStandardTotalDuration;
group.animations = @[initialScale, secondScale, moveToCenter, finalScale, moveToEnd];
group.repeatCount = 1;
group.removedOnCompletion = NO;
group.fillMode = kCAFillModeForwards;
return group;
}
//- (CAAnimationGroup *)createGiftComboAnimationStartPoint:(CGPoint)startPoint
// endPoint:(CGPoint)endPoint {
// // 1: 0.4
// CAKeyframeAnimation *scaleAnimation1 = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"];
// scaleAnimation1.duration = 0.1;
// scaleAnimation1.values = @[@1.0, @0.4];
// scaleAnimation1.repeatCount = 1;
// scaleAnimation1.calculationMode = kCAAnimationCubic;
// scaleAnimation1.removedOnCompletion = NO;
// scaleAnimation1.fillMode = kCAFillModeForwards;
//
// // : 0.5
// CAKeyframeAnimation *positionAnimation = [CAKeyframeAnimation animationWithKeyPath:@"position"];
// positionAnimation.duration = 0.5;
// positionAnimation.beginTime = 0.1; //
// positionAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
// positionAnimation.values = @[[NSValue valueWithCGPoint:startPoint], [NSValue valueWithCGPoint:endPoint]];
// positionAnimation.repeatCount = 1;
// positionAnimation.removedOnCompletion = NO;
// positionAnimation.fillMode = kCAFillModeForwards;
//
// // 2: 1.2
// CAKeyframeAnimation *scaleAnimation2 = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"];
// scaleAnimation2.duration = 0.5;
// scaleAnimation2.beginTime = 0.1; //
// scaleAnimation2.values = @[@0.4, @2];
// scaleAnimation2.repeatCount = 1;
// scaleAnimation2.calculationMode = kCAAnimationCubic;
// scaleAnimation2.removedOnCompletion = NO;
// scaleAnimation2.fillMode = kCAFillModeForwards;
//
// //
// CAAnimationGroup *group = [CAAnimationGroup animation];
// group.duration = 0.6; // 0.1 () + 0.5 ()
// group.animations = @[scaleAnimation1, positionAnimation, scaleAnimation2];
// group.repeatCount = 1;
// group.removedOnCompletion = NO;
// group.fillMode = kCAFillModeForwards;
//
// return group;
//}
//
/////
///// @param startPoint
///// @param endPoint
//- (CAAnimationGroup *)createGiftAnimationStartPoint:(CGPoint)startPoint endPoint:(CGPoint)endPoint {
// CGPoint centerPoint = CGPointMake(KScreenWidth / 2, KScreenHeight / 2);
// CAKeyframeAnimation *animation0 = [CAKeyframeAnimation animation];
// animation0.duration = 0.8;
// animation0.keyPath = @"transform.scale";
// animation0.values = @[@1.0,@1.5,@2.0,@1.5];
// animation0.repeatCount = 1;
// animation0.calculationMode = kCAAnimationCubic;
// animation0.removedOnCompletion = NO;
// animation0.fillMode = kCAFillModeForwards;
//
// CAKeyframeAnimation *animation1 = [CAKeyframeAnimation animation];
// animation1.duration = 0.8;
// animation1.beginTime = 0.8;
// animation1.keyPath = @"transform.scale";
// animation1.values = @[@1.5,@2.0,@2.5,@3.0];
// animation1.repeatCount = 1;
// animation1.calculationMode = kCAAnimationCubic;
// animation1.removedOnCompletion = NO;
// animation1.fillMode = kCAFillModeForwards;
//
// CAKeyframeAnimation *animation2 = [CAKeyframeAnimation animation];
// animation2.duration = 0.8;
// animation2.beginTime = 0.8;
// animation2.keyPath = @"position";
// animation2.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];;
// animation2.values = @[[NSValue valueWithCGPoint:startPoint],[NSValue valueWithCGPoint:CGPointMake(centerPoint.x ,centerPoint.y)]];
// animation2.repeatCount = 1;
// animation2.removedOnCompletion = NO;
// animation2.fillMode = kCAFillModeForwards;
//
// CAKeyframeAnimation *animation3 = [CAKeyframeAnimation animation];
// animation3.duration = 0.8;
// animation3.beginTime = 2.6;//0.8+0.8+1
// animation3.keyPath = @"transform.scale";
// animation3.values = @[@3,@2.5,@2,@1.5,@1];
// animation3.repeatCount = 1;
//
// CAKeyframeAnimation *animation4 = [CAKeyframeAnimation animation];
// animation4.duration = 0.8;
// animation4.beginTime = 2.6;
// animation4.keyPath = @"position";
// animation4.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];
// animation4.values = @[[NSValue valueWithCGPoint:CGPointMake(centerPoint.x ,centerPoint.y)],[NSValue valueWithCGPoint:endPoint]];
// animation4.repeatCount = 1;
//
// CAAnimationGroup *group = [CAAnimationGroup animation];
// group.duration = 3.2;
// group.animations = @[animation0,animation1,animation2, animation3,animation4];
// group.repeatCount = 1;
// group.removedOnCompletion = NO;
// group.fillMode = kCAFillModeForwards;
//
// return group;
//}
@end

View File

@@ -0,0 +1,57 @@
//
// GiftAnimationManager.h
// YuMi
//
// Created by P on 2024/12/9.
//
#import <Foundation/Foundation.h>
@class GiftReceiveInfoModel;
NS_ASSUME_NONNULL_BEGIN
@protocol GiftAnimationDelegate <NSObject>
/**
* Returns the animation point for a given user ID in the stage view
* @param uid The user ID to get the animation point for
* @return CGPoint The point in the view's coordinate system where the animation should occur
*/
- (CGPoint)animationPointAtStageViewByUid:(NSString *)uid;
@optional
/**
* Called when a gift animation starts
* @param giftInfo The gift information model
*/
//- (void)didStartGiftAnimation:(GiftInfoModel *)giftInfo;
/**
* Called when a gift animation completes
* @param giftInfo The gift information model
*/
//- (void)didCompleteGiftAnimation:(GiftInfoModel *)giftInfo;
/**
* Called when the gift queue becomes empty
*/
- (void)didEmptyGiftQueue;
@end
@interface GiftAnimationManager : NSObject
@property (nonatomic, weak) id<GiftAnimationDelegate> delegate;
@property (nonatomic, strong) UIView *containerView;
// Configurable properties
@property (nonatomic, assign) NSTimeInterval animationInterval;
@property (nonatomic, assign) NSTimeInterval comboAnimationDelay;
@property (nonatomic, assign) NSTimeInterval standardAnimationDelay;
- (instancetype)initWithContainerView:(UIView *)containerView;
- (void)enqueueGift:(GiftReceiveInfoModel *)giftInfo;
- (void)startGiftQueue;
- (void)stopGiftQueue;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,200 @@
//
// GiftAnimationManager.m
// YuMi
//
// Created by P on 2024/12/9.
//
#import "GiftAnimationManager.h"
#import "GiftComboManager.h"
#import "GiftAnimationHelper.h"
#import "GiftReceiveInfoModel.h"
@interface GiftAnimationManager ()
@property (nonatomic, strong) dispatch_source_t giftTimer;
@property (nonatomic, strong) NSMutableArray<GiftReceiveInfoModel *> *giftQueue;
@property (nonatomic, strong) GiftAnimationHelper *animationHelper;
@end
@implementation GiftAnimationManager
- (instancetype)initWithContainerView:(UIView *)containerView {
self = [super init];
if (self) {
_containerView = containerView;
_giftQueue = [NSMutableArray array];
_animationHelper = [[GiftAnimationHelper alloc] init];
_animationInterval = 0.2;
_comboAnimationDelay = 0.2;
_standardAnimationDelay = 0.3;
}
return self;
}
- (void)startGiftQueue {
if (self.giftTimer) {
return;
}
dispatch_source_t timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0,
dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0));
dispatch_source_set_timer(timer,
DISPATCH_TIME_NOW,
self.animationInterval * NSEC_PER_SEC,
0.01 * NSEC_PER_SEC);
@kWeakify(self);
dispatch_source_set_event_handler(timer, ^{
@kStrongify(self);
[self processNextGift];
});
[self processNextGift];
dispatch_resume(timer);
self.giftTimer = timer;
}
- (void)processNextGift {
if (self.giftQueue.count == 0) {
[self stopGiftQueue];
return;
}
GiftReceiveInfoModel *giftInfo = self.giftQueue.firstObject;
[self distributeGiftAnimation:giftInfo];
[self.giftQueue removeObjectAtIndex:0];
}
- (void)distributeGiftAnimation:(GiftReceiveInfoModel *)giftInfo {
NSArray<NSString *> *targetUids = [self resolveTargetUids:giftInfo];
CGPoint startPoint = [self calculateAnimationPoint:giftInfo.uid isEndPoint:NO];
BOOL isComboAnimation = [self shouldUseComboAnimationForSender:giftInfo.uid];
NSTimeInterval delay = isComboAnimation ? self.comboAnimationDelay : self.standardAnimationDelay;
for (NSString *targetUid in targetUids) {
CGPoint endPoint = [self calculateAnimationPoint:targetUid isEndPoint:YES];
[self scheduleAnimationWithDelay:delay
giftInfo:giftInfo.gift
startPoint:startPoint
endPoint:endPoint
isComboAnimation:isComboAnimation];
}
}
- (NSArray<NSString *> *)resolveTargetUids:(GiftReceiveInfoModel *)giftInfo {
if (giftInfo.isLuckyBagGift) {
return @[giftInfo.targetUid];
}
if (giftInfo.targetUids.count > 0) {
return [giftInfo.targetUids valueForKey:@"stringValue"];
}
if (giftInfo.targetUsers) {
NSArray *uidDatas = [self ensureArrayContainsOnlyStrings:[giftInfo.targetUsers valueForKeyPath:@"uid"]];
return uidDatas;//[giftInfo.targetUsers valueForKeyPath:@"uid"];
}
return [NSString isEmpty:giftInfo.targetUid] ? @[] : @[giftInfo.targetUid];
}
- (NSArray<NSString *> *)ensureArrayContainsOnlyStrings:(NSArray *)inputArray {
//
NSMutableArray<NSString *> *resultArray = [NSMutableArray array];
for (id item in inputArray) {
if ([item isKindOfClass:[NSString class]]) {
// NSString
[resultArray addObject:item];
} else if ([item isKindOfClass:[NSNumber class]]) {
// NSNumber NSString
[resultArray addObject:[item stringValue]];
} else {
// NSString NSNumber
NSLog(@"Warning: Unsupported item type: %@", [item class]);
}
}
return [resultArray copy]; //
}
- (CGPoint)calculateAnimationPoint:(NSString *)uid isEndPoint:(BOOL)isEndPoint {
CGPoint point = [self.delegate animationPointAtStageViewByUid:uid];
if (point.x <= 0 || point.y <= 0) {
point = [self fallbackPointForEndPoint:isEndPoint];
}
if ([self shouldUseComboAnimationForSender:uid] && !isEndPoint) {
point = [self comboAnimationStartPoint];
}
return point;
}
- (void)scheduleAnimationWithDelay:(NSTimeInterval)delay
giftInfo:(GiftInfoModel *)giftInfo
startPoint:(CGPoint)startPoint
endPoint:(CGPoint)endPoint
isComboAnimation:(BOOL)isComboAnimation {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, delay * NSEC_PER_SEC),
dispatch_get_main_queue(), ^{
[self.animationHelper beginGiftAnimation:giftInfo.giftUrl
startPoint:startPoint
endPoint:endPoint
isGiftCombing:isComboAnimation
toTargetView:self.containerView];
});
}
- (void)stopGiftQueue {
if (self.giftTimer) {
dispatch_source_cancel(self.giftTimer);
//
dispatch_source_cancel(self.giftTimer);
// timer nil
dispatch_source_set_cancel_handler(self.giftTimer, ^{
self.giftTimer = nil;
});
}
}
- (void)enqueueGift:(GiftReceiveInfoModel *)giftInfo {
[self.giftQueue addObject:giftInfo];
[self startGiftQueue];
}
// Helper methods
- (BOOL)shouldUseComboAnimationForSender:(NSString *)uid {
return [[GiftComboManager sharedManager] isGiftCombing] &&
[uid isEqualToString:[AccountInfoStorage instance].getUid];
}
- (CGPoint)fallbackPointForEndPoint:(BOOL)isEndPoint {
CGFloat x = [UIScreen mainScreen].bounds.size.width / 2;
if (isEndPoint) {
x += 30;
}
return CGPointMake(x, 44 + kSafeAreaTopHeight);
}
- (CGPoint)comboAnimationStartPoint {
CGFloat x = 0;
if (isMSRTL()) {
x = kGetScaleWidth(90);
} else {
x = KScreenWidth - kGetScaleWidth(90);
}
return CGPointMake(x,
KScreenHeight - kSafeAreaBottomHeight - kGetScaleWidth(140));
}
@end

View File

@@ -13,36 +13,40 @@
#import "XPRoomViewController.h"
#import "XCCurrentVCStackManager.h"
// Constants
static const CGFloat kBannerWidth = 346.5f;
static const CGFloat kBannerHeight = 82.5f;
static const CGFloat kBannerTopMargin = 80.0f;
static const CGFloat kAvatarSize = 43.0f;
static const CGFloat kAnimationDuration = 0.25f;
static const CGFloat kDisplayDuration = 2.5f;
static const CGFloat kRoomTransitionDelay = 2.0f;
@interface LuckyGiftWinningBannerViewModel : PIBaseModel
// model
@property (nonatomic, copy) NSString *times;
@property (nonatomic, copy) NSString *avatar;
@property (nonatomic, copy) NSString *coins;
@property (nonatomic, copy) NSDictionary *giftNameMap;
@property (nonatomic, copy) NSString *roomUid;
- (NSString *)giftName;
@property (nonatomic, copy, readonly) NSString *times;
@property (nonatomic, copy, readonly) NSString *avatar;
@property (nonatomic, copy, readonly) NSString *coins;
@property (nonatomic, copy, readonly) NSDictionary *giftNameMap;
@property (nonatomic, copy, readonly) NSString *roomUid;
@property (nonatomic, copy, readonly) NSString *giftName;
@end
@implementation LuckyGiftWinningBannerViewModel
+ (NSDictionary *)replacedKeyFromPropertyName {
return @{
@"avatar":@"sender.avatar"
};
return @{@"avatar": @"sender.avatar"};
}
- (NSString *)giftName {
if ([self.giftNameMap.allKeys containsObject:@"ar"] && isMSRTL()) {
if (isMSRTL() && [self.giftNameMap[@"ar"] length]) {
return self.giftNameMap[@"ar"];
} else if ([self.giftNameMap.allKeys containsObject:@"zh"] && isMSZH()) {
return self.giftNameMap[@"zh"];
} else {
return self.giftNameMap[@"en"];
}
if (isMSZH() && [self.giftNameMap[@"zh"] length]) {
return self.giftNameMap[@"zh"];
}
return self.giftNameMap[@"en"] ?: @"";
}
@end
@@ -52,13 +56,11 @@
@property (nonatomic, strong) LuckyGiftWinningBannerViewModel *model;
@property (nonatomic, strong) UIImageView *backgroundImageView;
@property (nonatomic, strong) UIImageView *ballImageView;
@property (nonatomic, strong) NetImageView *avatarImage;
@property (nonatomic, strong) NetImageView *avatarImageView;
@property (nonatomic, strong) UILabel *giftNameLabel;
@property (nonatomic, strong) UILabel *timesLabel;
@property (nonatomic, strong) UILabel *coinsLabel;
@property (nonatomic, assign) NSInteger currentRoomUid;
@property (nonatomic, copy) void(^completeDisplay)(void);
@property (nonatomic, copy) void(^exitCurrentRoom)(void);
@@ -71,39 +73,66 @@
with:(AttachmentModel *)attachment
complete:(void(^)(void))complete
exitCurrentRoom:(void(^)(void))exit {
#if DEBUG
NSParameterAssert(superView);
NSParameterAssert(attachment);
#else
if (!superView || !attachment) {
if (complete) {
complete();
}
return;
}
#endif
LuckyGiftWinningBannerViewModel *model = [LuckyGiftWinningBannerViewModel modelWithDictionary:attachment.data];
CGFloat width = kGetScaleWidth(346.5);
CGFloat height = kGetScaleWidth(82.5);
LuckyGiftWinningBannerView *bannerView = [[LuckyGiftWinningBannerView alloc] initWithFrame:CGRectMake(KScreenWidth, 80, width, height)];
CGFloat width = kGetScaleWidth(kBannerWidth);
CGFloat height = kGetScaleWidth(kBannerHeight);
CGRect frame = CGRectMake(KScreenWidth, kBannerTopMargin, width, height);
LuckyGiftWinningBannerView *bannerView = [[LuckyGiftWinningBannerView alloc] initWithFrame:frame];
bannerView.model = model;
bannerView.completeDisplay = complete;
bannerView.exitCurrentRoom = exit;
bannerView.currentRoomUid = roomUid;
[superView addSubview:bannerView];
@kWeakify(bannerView);
[UIView animateWithDuration:0.25 animations:^{
bannerView.center = CGPointMake(superView.center.x, height/2 + 80);
[bannerView animateDisplay];
}
- (void)animateDisplay {
@kWeakify(self);
[UIView animateWithDuration:kAnimationDuration animations:^{
@kStrongify(self);
self.center = CGPointMake(self.superview.center.x, self.frame.size.height/2 + kBannerTopMargin);
} completion:^(BOOL finished) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[UIView animateWithDuration:0.25 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
bannerView.frame = CGRectMake(-KScreenWidth, 80, width, height);
} completion:^(BOOL finished) {
@kStrongify(bannerView);
[bannerView removeFromSuperview];
if (bannerView.completeDisplay) {
bannerView.completeDisplay();
}
}];
@kStrongify(self);
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(kDisplayDuration * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self animateDisappear];
});
}];
}
- (void)animateDisappear {
@kWeakify(self);
[UIView animateWithDuration:kAnimationDuration
delay:0
options:UIViewAnimationOptionCurveEaseInOut
animations:^{
@kStrongify(self);
self.frame = CGRectMake(-KScreenWidth, kBannerTopMargin, self.frame.size.width, self.frame.size.height);
} completion:^(BOOL finished) {
@kStrongify(self);
[self removeFromSuperview];
if (self.completeDisplay) {
self.completeDisplay();
}
}];
}
- (void)setModel:(LuckyGiftWinningBannerViewModel *)model {
_model = model;
self.avatarImage.imageUrl = model.avatar;
self.avatarImageView.imageUrl = model.avatar;
self.giftNameLabel.text = [model giftName];
self.timesLabel.text = model.times;
self.coinsLabel.text = [NSString formatNumberToKOrM:model.coins];
@@ -127,13 +156,13 @@ exitCurrentRoom:(void(^)(void))exit {
return;
}
__block NSString *targetRoomUid = self.model.roomUid;
@kWeakify(self);
[TTPopup alertWithMessage:YMLocalizedString(@"Combo_10") confirmHandler:^{
@kStrongify(self);
if (self.exitCurrentRoom) {
self.exitCurrentRoom();
}
NSString *targetRoomUid = self.model.roomUid;
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[XPRoomViewController openRoom:targetRoomUid
viewController:[XCCurrentVCStackManager shareManager].getCurrentVC];
@@ -153,8 +182,8 @@ exitCurrentRoom:(void(^)(void))exit {
make.width.mas_equalTo(self.ballImageView.mas_height);
}];
[self addSubview:self.avatarImage];
[self.avatarImage mas_makeConstraints:^(MASConstraintMaker *make) {
[self addSubview:self.avatarImageView];
[self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(kGetScaleWidth(8));
make.top.mas_equalTo(kGetScaleWidth(24));
make.width.height.mas_equalTo(kGetScaleWidth(43));
@@ -163,8 +192,8 @@ exitCurrentRoom:(void(^)(void))exit {
UILabel *titleLabel_1 = [UILabel labelInitWithText:YMLocalizedString(@"Combo_0") font:kFontSemibold(14) textColor:[UIColor whiteColor]];
[self addSubview:titleLabel_1];
[titleLabel_1 mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.avatarImage).offset(2);
make.leading.mas_equalTo(self.avatarImage.mas_trailing).offset(10);
make.top.mas_equalTo(self.avatarImageView).offset(2);
make.leading.mas_equalTo(self.avatarImageView.mas_trailing).offset(10);
}];
[self addSubview:self.giftNameLabel];
@@ -176,8 +205,8 @@ exitCurrentRoom:(void(^)(void))exit {
UILabel *titleLabel_2 = [UILabel labelInitWithText:YMLocalizedString(@"Combo_4") font:kFontSemibold(14) textColor:[UIColor whiteColor]];
[self addSubview:titleLabel_2];
[titleLabel_2 mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self.avatarImage.mas_bottom).offset(-2);
make.leading.mas_equalTo(self.avatarImage.mas_trailing).offset(10);
make.bottom.mas_equalTo(self.avatarImageView.mas_bottom).offset(-2);
make.leading.mas_equalTo(self.avatarImageView.mas_trailing).offset(10);
}];
[self addSubview:self.timesLabel];
@@ -226,19 +255,17 @@ exitCurrentRoom:(void(^)(void))exit {
return _ballImageView;
}
- (NetImageView *)avatarImage {
if (!_avatarImage) {
- (NetImageView *)avatarImageView {
if (!_avatarImageView) {
NetImageConfig * config = [[NetImageConfig alloc]init];
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
config.imageType = ImageTypeCornerAvatar;
_avatarImage = [[NetImageView alloc] initWithConfig:config];
_avatarImage.backgroundColor = [UIColor clearColor];
_avatarImage.contentMode = UIViewContentModeScaleAspectFill;
_avatarImage.layer.cornerRadius = kGetScaleWidth(43/2);
_avatarImage.layer.masksToBounds = YES;
_avatarImage.clipsToBounds = YES;
_avatarImageView = [[NetImageView alloc] initWithConfig:config];
_avatarImageView.backgroundColor = [UIColor clearColor];
_avatarImageView.contentMode = UIViewContentModeScaleAspectFill;
[_avatarImageView setCornerRadius:kGetScaleWidth(43/2)];
}
return _avatarImage;
return _avatarImageView;
}
- (UILabel *)giftNameLabel {

View File

@@ -115,14 +115,6 @@
[stackView addArrangedSubview:self.coinIcon];
[stackView addArrangedSubview:self.winPriceLabel];
[self.coinIcon mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(21, 21));
}];
[self.winPriceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(35);
}];
UIStackView *stackView_2 = [[UIStackView alloc] init];
stackView_2.spacing = 4;
[self addSubview:stackView_2];
@@ -149,10 +141,6 @@
[[NSNotificationCenter defaultCenter] postNotificationName:@"receiveLuckGiftWinning" object:model.coins];
}
- (void)display {
}
#pragma mark -
- (UIImageView *)coinIcon {
if (!_coinIcon) {

View File

@@ -79,6 +79,8 @@
#import "GameUniversalBannerView.h"
#import "RoomHighValueGiftBannerAnimation.h"
#import "GiftAnimationManager.h"
@interface XPRoomAnimationView ()<
SVGAPlayerDelegate,
NIMBroadcastManagerDelegate,
@@ -90,7 +92,9 @@ XPRoomStarKitchenBannerViewDelegate,
PAGViewListener,
XPRoomAnchorRankBannerViewDelegate,
PIRoomGiftBroadcastWindowDelegate,
PIUniversalBannerViewDelegate>
PIUniversalBannerViewDelegate,
GiftAnimationDelegate>
///
///
@property (nonatomic,strong) XPRoomAnimationHitView * lowLevelView;
@@ -116,24 +120,11 @@ PIUniversalBannerViewDelegate>
///
@property (nonatomic,weak) id<RoomHostDelegate>delegate;
///
@property (strong,nonatomic)NSMutableSet * bannerDequePool;
///
@property (strong,nonatomic)NSMutableSet * bannerVisiablePool;
/// 6s
@property (nonatomic,strong)dispatch_source_t giftEffectTimer;
#pragma mark -
///
@property (nonatomic,strong) NSMutableArray<GiftReceiveInfoModel *> *giftQueue;
///
@property (nonatomic ,strong)dispatch_source_t giftTimer;
///
@property (nonatomic,strong) NSMutableSet<NetImageView *> * giftReuseArray;
///
@property (nonatomic,strong) NSMutableSet<NetImageView *> * giftVisibleArray;
@property(nonatomic, strong) GiftAnimationManager *giftAnimationManager;
///
@property (nonatomic,assign) BOOL isLargeGiftAnimating;
#pragma mark -
@@ -205,10 +196,10 @@ PIUniversalBannerViewDelegate>
self.giftEffectTimer = nil;
}
if(self.giftTimer != nil){
dispatch_source_cancel(self.giftTimer);
self.giftTimer = nil;
}
// if(self.giftTimer != nil){
// dispatch_source_cancel(self.giftTimer);
// self.giftTimer = nil;
// }
[self.giftPagView removeListener:self];
}
- (instancetype)initWithDelegate:(id<RoomHostDelegate>)delegate {
@@ -216,9 +207,13 @@ PIUniversalBannerViewDelegate>
if (self) {
[[NIMSDK sharedSDK].broadcastManager addDelegate:self];
self.delegate = delegate;
[self initSubViews];
[self initSubViewConstraints];
self.giftAnimationManager = [[GiftAnimationManager alloc] initWithContainerView:self.lowLevelView];
self.giftAnimationManager.delegate = self;
_roomEffectModelsQueueV2 = [NSMutableArray array];
_GiftDynamicEffectListPath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) xpSafeObjectAtIndex:0] stringByAppendingPathComponent:@"GiftDynamicEffectList"];
@@ -306,22 +301,13 @@ PIUniversalBannerViewDelegate>
AttachmentModel *attachment = (AttachmentModel *)obj.attachment;
if (attachment.first == CustomMessageType_Gift) {
GiftReceiveInfoModel * receiveInfo = [GiftReceiveInfoModel modelWithJSON:attachment.data];
[receiveInfo giftDataAlignment];
if (attachment.second == Custom_Message_Sub_Gift_EmbeddedStyle) {
if (receiveInfo.giftVo) {
receiveInfo.gift = receiveInfo.giftVo;
// receiveInfo.targetUid = receiveInfo.recvUserUid;
// receiveInfo.targetNick = receiveInfo.recvUserNick;
// receiveInfo.targetUids = @[receiveInfo.recvUserUid];
// if (<#condition#>) {
// <#statements#>
// }
// [data setObject:[[obj objectForKey:@"uid"] stringValue] forKey:@"targetUid"];
// [data setObject:[obj objectForKey:@"nick"] forKey:@"targetNick"];
// [data setObject:[obj objectForKey:@"avatar"] forKey:@"targetAvatar"];
}
// TODO:
receiveInfo.targetUid = [[attachment.data objectForKey:@"recvUserUid"] stringValue];
receiveInfo.targetNick = [attachment.data objectForKey:@"recvUserNick"];
receiveInfo.targetAvatar = [attachment.data objectForKey:@"recvUserAvatar"];
@@ -345,10 +331,9 @@ PIUniversalBannerViewDelegate>
receiveInfo.isLuckyBagGift = attachment.second == Custom_Message_Sub_Gift_LuckySend;
receiveInfo.isBatch = (attachment.second == Custom_Message_Sub_AllBatchSend || attachment.second == Custom_Message_Sub_AllBatchMicroLuckySend);
receiveInfo.isComboBatch = attachment.second == Custom_Message_Sub_AllMicroSend;
[self receiveGiftHandleSendGiftAnimation:attachment];
if (receiveInfo.isLuckyBagGift) {
[self receiveGiftHandleSendGiftAnimation:attachment];
if (!self.delegate.getRoomInfo.hasAnimationEffect) {return;}
if (receiveInfo.viewUrl.length > 0) {
[self playLuckyGiftEffectWithVapUrl:receiveInfo.viewUrl];
@@ -363,23 +348,21 @@ PIUniversalBannerViewDelegate>
[self receiveGift:receiveInfo];
});
} else {
if (receiveInfo.gift.notifyFull && attachment.second == Custom_Message_Sub_Gift_Send) {
if (receiveInfo.gift.notifyFull == 1 && attachment.second == Custom_Message_Sub_Gift_Send) {
return;
}
[self receiveGiftHandleSendGiftAnimation:attachment];
[self receiveGift:receiveInfo];
}
} else if (attachment.first == CustomMessageType_AllMicroSend) { //
GiftReceiveInfoModel * receiveInfo = [GiftReceiveInfoModel modelWithJSON:attachment.data];
[receiveInfo giftDataAlignment];
receiveInfo.isLuckyBagGift = (attachment.second == Custom_Message_Sub_AllMicroLuckySend || attachment.second == Custom_Message_Sub_AllBatchMicroLuckySend);
receiveInfo.isComboBatch = attachment.second == Custom_Message_Sub_AllMicroSend;
receiveInfo.isBatch = (attachment.second == Custom_Message_Sub_AllBatchSend || attachment.second == Custom_Message_Sub_AllBatchMicroLuckySend);
if (receiveInfo.gift.notifyFull) {
return;
}
[self receiveGiftHandleSendGiftAnimation:attachment];
if (receiveInfo.isLuckyBagGift) {
[self receiveGiftHandleSendGiftAnimation:attachment];
if (!self.delegate.getRoomInfo.hasAnimationEffect) {return;}
if (receiveInfo.viewUrl.length > 0) {
[self playLuckyGiftEffectWithVapUrl:receiveInfo.viewUrl];
@@ -394,6 +377,7 @@ PIUniversalBannerViewDelegate>
[self receiveGift:receiveInfo];
});
} else {
[self receiveGiftHandleSendGiftAnimation:attachment];
[self receiveGift:receiveInfo];
}
} else if (attachment.first == CustomMessageType_LuckyBag ) {//
@@ -1114,7 +1098,7 @@ PIUniversalBannerViewDelegate>
#pragma mark - XXX
- (void)userEnterRoom:(NIMChatroomNotificationContent *)content ext:(XPMessageRemoteExtModel *)extModel {
NSString *userName = content.source.nick;
NSString *userName = [NSString isEmpty:extModel.nick] ? content.source.nick : extModel.nick;
if ([NSString isEmpty:userName] && content.source.userId.intValue == self.delegate.getUserInfo.uid) {
userName = self.delegate.getUserInfo.nick;
} else if ([NSString isEmpty:userName]) {
@@ -1672,10 +1656,8 @@ PIUniversalBannerViewDelegate>
/// 使
receiveInfo.gift = giftInfo;
receiveInfo.isLuckyBagGift = (attachment.second == Custom_Message_Sub_AllMicroLuckySend || attachment.second == Custom_Message_Sub_AllBatchMicroLuckySend || attachment.second == Custom_Message_Sub_Gift_LuckySend);
[self.giftQueue addObject:receiveInfo];
if (self.giftTimer == nil && self.giftQueue > 0) {
[self startGiftQueueTimer];
}
[self.giftAnimationManager enqueueGift:receiveInfo];
}
#pragma mark -
@@ -1703,260 +1685,16 @@ PIUniversalBannerViewDelegate>
/// 使
receiveInfo.gift = giftInfo;
receiveInfo.isLuckyBagGift = (attachment.second == Custom_Message_Sub_AllMicroLuckySend || attachment.second == Custom_Message_Sub_AllBatchMicroLuckySend || attachment.second == Custom_Message_Sub_Gift_LuckySend);
[self.giftQueue addObject:receiveInfo];
if (self.giftTimer == nil && self.giftQueue > 0) {
[self startGiftQueueTimer];
}
[self.giftAnimationManager enqueueGift:receiveInfo];
}
//
- (void)startGiftQueueTimer {
NSTimeInterval period = 0.5; //
dispatch_source_t _timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, dispatch_get_global_queue(0, 0));
dispatch_source_set_timer(_timer, DISPATCH_TIME_NOW, period * NSEC_PER_SEC, 0 * NSEC_PER_SEC);
dispatch_source_set_event_handler(_timer, ^{
dispatch_async(dispatch_get_main_queue(), ^{
if (self.giftQueue.count) {
GiftReceiveInfoModel * receiveInfo = self.giftQueue.firstObject;
[self handoutGiftDistributeAnimation:receiveInfo];
[self.giftQueue removeObject:receiveInfo];
}else {
dispatch_source_cancel(_timer);
self.giftTimer = nil;
}
});
});
dispatch_resume(_timer);
self.giftTimer = _timer;
}
///
- (void)handoutGiftDistributeAnimation:(GiftReceiveInfoModel *)receiveInfo {
GiftInfoModel * giftInfo = receiveInfo.gift;
NSString * sendUid = receiveInfo.uid;
CGPoint starPoint = [self getGiftAnimationPoint:sendUid isEnd:NO];
CGPoint endPoint;
NSArray * targetUids;
if (receiveInfo.isLuckyBagGift) {
targetUids = @[receiveInfo.targetUid];
} else {
targetUids = receiveInfo.targetUids;
if (targetUids.count <= 0) {
if (receiveInfo.targetUsers) {
targetUids = [receiveInfo.targetUsers valueForKeyPath:@"uid"];
}
if (targetUids.count <=0) {
targetUids = [NSString isEmpty:receiveInfo.targetUid] ? @[] : @[receiveInfo.targetUid];
}
}
}
for (NSString *targetUid in targetUids) {
NSString * userId = targetUid;
if ([userId isKindOfClass:[NSNumber class]]) {
userId = ((NSNumber *)userId).stringValue;
}
endPoint = [self getGiftAnimationPoint:userId isEnd:YES];
dispatch_time_t timer = dispatch_time(DISPATCH_TIME_NOW, 0.5 * NSEC_PER_SEC);
BOOL isCombing = [[GiftComboManager sharedManager] isGiftCombing] &&
[sendUid isEqualToString:[AccountInfoStorage instance].getUid];
if (isCombing) {
timer = dispatch_time(DISPATCH_TIME_NOW, 0.25 * NSEC_PER_SEC);
}
dispatch_after(timer, dispatch_get_main_queue(), ^{
[self beginGiftAnimation:giftInfo.giftUrl
startPoint:starPoint
endPoint:endPoint
isGiftCombing:isCombing];
});
}
}
///
- (CGPoint)getGiftAnimationPoint:(NSString *)uid isEnd:(BOOL)isEnd{
CGPoint point = [self.delegate animationPointAtStageViewByUid:uid];
//
if (point.x <= 0 || point.y <= 0) {
if (isEnd) {
point = CGPointMake([UIScreen mainScreen].bounds.size.width /2 + 30, 44 + kSafeAreaTopHeight);
} else {
point = CGPointMake([UIScreen mainScreen].bounds.size.width / 2, 44 + kSafeAreaTopHeight);
}
}
if ([[GiftComboManager sharedManager] isGiftCombing] &&
[uid isEqualToString:[AccountInfoStorage instance].getUid] &&
isEnd == false) {
if (isMSRTL()) {
point = CGPointMake(kGetScaleWidth(86), [UIScreen mainScreen].bounds.size.height - kSafeAreaTopHeight - kGetScaleWidth(140));
} else {
if (KScreenWidth <= 375) {
point = CGPointMake(kGetScaleWidth([UIScreen mainScreen].bounds.size.width - kGetScaleWidth(86)), [UIScreen mainScreen].bounds.size.height - kSafeAreaBottomHeight - kGetScaleWidth(140));
} else {
point = CGPointMake(kGetScaleWidth([UIScreen mainScreen].bounds.size.width - kGetScaleWidth(150)), [UIScreen mainScreen].bounds.size.height - kSafeAreaBottomHeight - kGetScaleWidth(140));
}
}
}
return point;
}
- (void)beginGiftAnimation:(NSString *)giftUrl
startPoint:(CGPoint)startPoint
endPoint:(CGPoint)endPoint
isGiftCombing:(BOOL)isGiftCombing {
NetImageView * giftImageView = [self.giftReuseArray anyObject];
if (giftImageView == nil) {
giftImageView = [[NetImageView alloc]initWithFrame:CGRectMake(0, 0 , 55, 55)];
giftImageView.center = startPoint;
giftImageView.alpha = 1;
giftImageView.layer.anchorPoint = CGPointMake(0.5, 0.5);
giftImageView.imageUrl = giftUrl;
[self.giftVisibleArray addObject:giftImageView];
}else {
[self.giftReuseArray removeObject:giftImageView];
}
giftImageView.hidden = NO;
giftImageView.imageUrl = giftUrl;
[self.lowLevelView addSubview:giftImageView];
CGFloat delay = 3.2;
CAAnimationGroup *group = [self createGiftAnimationStartPoint:startPoint endPoint:endPoint];
if (isGiftCombing) {
delay = 1.0;
group = [self createGiftComboAnimationStartPoint:startPoint endPoint:endPoint];
}
// startPoint
giftImageView.layer.position = startPoint;
[giftImageView.layer addAnimation:group forKey:@"giftDisplayViewAnimation"];
[self performSelector:@selector(aniationDidFinish:) withObject:giftImageView afterDelay:(delay+0.25)];
}
- (CAAnimationGroup *)createGiftComboAnimationStartPoint:(CGPoint)startPoint
endPoint:(CGPoint)endPoint {
// 1: 0.4
CAKeyframeAnimation *scaleAnimation1 = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"];
scaleAnimation1.duration = 0.1;
scaleAnimation1.values = @[@1.0, @0.4];
scaleAnimation1.repeatCount = 1;
scaleAnimation1.calculationMode = kCAAnimationCubic;
scaleAnimation1.removedOnCompletion = NO;
scaleAnimation1.fillMode = kCAFillModeForwards;
// : 0.5
CAKeyframeAnimation *positionAnimation = [CAKeyframeAnimation animationWithKeyPath:@"position"];
positionAnimation.duration = 0.5;
positionAnimation.beginTime = 0.1; //
positionAnimation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
positionAnimation.values = @[[NSValue valueWithCGPoint:startPoint], [NSValue valueWithCGPoint:endPoint]];
positionAnimation.repeatCount = 1;
positionAnimation.removedOnCompletion = NO;
positionAnimation.fillMode = kCAFillModeForwards;
// 2: 1.2
CAKeyframeAnimation *scaleAnimation2 = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"];
scaleAnimation2.duration = 0.5;
scaleAnimation2.beginTime = 0.1; //
scaleAnimation2.values = @[@0.4, @2];
scaleAnimation2.repeatCount = 1;
scaleAnimation2.calculationMode = kCAAnimationCubic;
scaleAnimation2.removedOnCompletion = NO;
scaleAnimation2.fillMode = kCAFillModeForwards;
//
CAAnimationGroup *group = [CAAnimationGroup animation];
group.duration = 0.6; // 0.1 () + 0.5 ()
group.animations = @[scaleAnimation1, positionAnimation, scaleAnimation2];
group.repeatCount = 1;
group.removedOnCompletion = NO;
group.fillMode = kCAFillModeForwards;
return group;
}
///
/// @param startPoint
/// @param endPoint
- (CAAnimationGroup *)createGiftAnimationStartPoint:(CGPoint)startPoint endPoint:(CGPoint)endPoint {
CGPoint centerPoint = CGPointMake(KScreenWidth / 2, KScreenHeight / 2);
CAKeyframeAnimation *animation0 = [CAKeyframeAnimation animation];
animation0.duration = 0.8;
animation0.keyPath = @"transform.scale";
animation0.values = @[@1.0,@1.5,@2.0,@1.5];
animation0.repeatCount = 1;
animation0.calculationMode = kCAAnimationCubic;
animation0.removedOnCompletion = NO;
animation0.fillMode = kCAFillModeForwards;
CAKeyframeAnimation *animation1 = [CAKeyframeAnimation animation];
animation1.duration = 0.8;
animation1.beginTime = 0.8;
animation1.keyPath = @"transform.scale";
animation1.values = @[@1.5,@2.0,@2.5,@3.0];
animation1.repeatCount = 1;
animation1.calculationMode = kCAAnimationCubic;
animation1.removedOnCompletion = NO;
animation1.fillMode = kCAFillModeForwards;
CAKeyframeAnimation *animation2 = [CAKeyframeAnimation animation];
animation2.duration = 0.8;
animation2.beginTime = 0.8;
animation2.keyPath = @"position";
animation2.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];;
animation2.values = @[[NSValue valueWithCGPoint:startPoint],[NSValue valueWithCGPoint:CGPointMake(centerPoint.x ,centerPoint.y)]];
animation2.repeatCount = 1;
animation2.removedOnCompletion = NO;
animation2.fillMode = kCAFillModeForwards;
CAKeyframeAnimation *animation3 = [CAKeyframeAnimation animation];
animation3.duration = 0.8;
animation3.beginTime = 2.6;//0.8+0.8+1
animation3.keyPath = @"transform.scale";
animation3.values = @[@3,@2.5,@2,@1.5,@1];
animation3.repeatCount = 1;
CAKeyframeAnimation *animation4 = [CAKeyframeAnimation animation];
animation4.duration = 0.8;
animation4.beginTime = 2.6;
animation4.keyPath = @"position";
animation4.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];
animation4.values = @[[NSValue valueWithCGPoint:CGPointMake(centerPoint.x ,centerPoint.y)],[NSValue valueWithCGPoint:endPoint]];
animation4.repeatCount = 1;
CAAnimationGroup *group = [CAAnimationGroup animation];
group.duration = 3.2;
group.animations = @[animation0,animation1,animation2, animation3,animation4];
group.repeatCount = 1;
group.removedOnCompletion = NO;
group.fillMode = kCAFillModeForwards;
return group;
}
- (void)aniationDidFinish:(NetImageView *)giftImageView{
[giftImageView removeFromSuperview];
giftImageView.image = nil;
giftImageView.hidden = YES;
[self.giftVisibleArray removeObject:giftImageView];
[self.giftReuseArray addObject:giftImageView];
#pragma mark - GiftAnimationManagerDelegate
- (CGPoint)animationPointAtStageViewByUid:(NSString *)uid {
return [self.delegate animationPointAtStageViewByUid:uid];
}
#pragma mark -
- (void)receiveBroadcastGift:(AttachmentModel *)attachment {
if ([self isInSudGame]) {return;}
GiftReceiveInfoModel *giftNotifyInfo = [GiftReceiveInfoModel modelWithJSON:attachment.data];
///广 tabbar
if (giftNotifyInfo.ceremonyGift)return;
// if(giftNotifyInfo.isHomeShow == YES)return; /// tabbar
// if(giftNotifyInfo.roomUid == self.delegate.getRoomInfo.uid)return; ///
if (self.animationListA.count == 0 && self.isPlayOfB == NO && self.isPlayOfA == NO) {
[self createGiftBroadcastViewAnimation:giftNotifyInfo];
}
[self.animationListA addObject:giftNotifyInfo];
}
- (void)createGiftBroadcastViewAnimation:(GiftReceiveInfoModel *)giftModel {
self.isPlayOfA = YES;
XPRoomGiftBroadcastView * view = [[XPRoomGiftBroadcastView alloc] init];
@@ -2051,8 +1789,6 @@ PIUniversalBannerViewDelegate>
[self.animationListB addObject:prizeModel];
}
- (void)createBigPrizeAnimation:(PIBaseAnimationViewModel *)prizeModel {
self.isPlayOfB = YES;
@@ -2088,11 +1824,6 @@ PIUniversalBannerViewDelegate>
[self.animationListB removeObjectAtIndex:0];
}
self.isPlayOfB = NO;
// if(self.isAnimationListAFinish == YES){
// self.isAnimationListAFinish = NO;
// [self playAnimationWithModel];
// return;
// }
[self playAnimationWithModel];
}
}];
@@ -3064,19 +2795,6 @@ PIUniversalBannerViewDelegate>
return _parser;
}
- (NSMutableSet *)bannerDequePool {
if (!_bannerDequePool) {
_bannerDequePool = [NSMutableSet set];
}
return _bannerDequePool;
}
- (NSMutableSet *)bannerVisiablePool {
if (!_bannerVisiablePool) {
_bannerVisiablePool = [NSMutableSet set];
}
return _bannerVisiablePool;
}
- (XPRoomAnimationHitView *)lowLevelView {
if (!_lowLevelView) {
_lowLevelView = [[XPRoomAnimationHitView alloc] init];
@@ -3104,27 +2822,6 @@ PIUniversalBannerViewDelegate>
return _highLevleView;
}
- (NSMutableArray<GiftReceiveInfoModel *> *)giftQueue {
if (!_giftQueue) {
_giftQueue = [NSMutableArray array];
}
return _giftQueue;
}
- (NSMutableSet<NetImageView *> *)giftReuseArray {
if (!_giftReuseArray) {
_giftReuseArray = [NSMutableSet set];
}
return _giftReuseArray;
}
- (NSMutableSet<NetImageView *> *)giftVisibleArray {
if (!_giftVisibleArray) {
_giftVisibleArray = [NSMutableSet set];
}
return _giftVisibleArray;
}
- (NSMutableArray<NSDictionary *> *)carEffectQueue {
if (_carEffectQueue == nil) {
_carEffectQueue = [NSMutableArray array];

View File

@@ -70,6 +70,7 @@
#import "XPAnchorPKFinishView.h"
#import "XPSendGiftView.h"
#import "XPUserCardViewController.h"
#import "UserRoomCardViewController.h"
#import "XPRoomViewController.h"
#import "AcrossRoomPKPrizeModel.h"
#import "XPMineUserInfoViewController.h"
@@ -1139,8 +1140,10 @@
model.roomInfo = roomInfo;
model.micQueue = self.delegate.getMicroQueue;
model.superMangerList = self.delegate.getRoomSuperAdminList;
XPUserCardViewController * userCardVC = [[XPUserCardViewController alloc] initWithUser:model];
[self.delegate.getCurrentNav presentViewController:userCardVC animated:NO completion:nil];
UserRoomCardViewController *vc = [[UserRoomCardViewController alloc] initWithUser:model];
vc.modalPresentationStyle = UIModalPresentationOverFullScreen;
[self.delegate.getCurrentNav presentViewController:vc animated:NO completion:nil];
}
#pragma mark - XPAnchorPkPanelViewDelegate

View File

@@ -82,6 +82,7 @@ UIKIT_EXTERN NSString * kRoomBackMusicCaptureVolumeKey;
@property(nonatomic, assign) BOOL isOnMic;
@property(nonatomic, strong) UIButton *closeMicControlButton;
@end
@@ -233,11 +234,16 @@ UIKIT_EXTERN NSString * kRoomBackMusicCaptureVolumeKey;
[self hideMicControlMenu];
return;
} else {
if (!self.closeMicControlButton.superview) {
[self.stackView insertSubview:self.closeMicControlButton atIndex:0];
[self.closeMicControlButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.stackView);
}];
}
self.isDisplayMicStatusControl = YES;
}
self.defaultVoiceVolume = [[RtcManager instance] loadUserSound] > 0 ? [[RtcManager instance] loadUserSound] : 50;
@kWeakify(self);
[self _micControlButton:self.micButton_open isShow:YES complete:^{
@kStrongify(self);
@@ -246,7 +252,7 @@ UIKIT_EXTERN NSString * kRoomBackMusicCaptureVolumeKey;
@kStrongify(self);
[self _micControlButton:self.micButton_close_butMusic isShow:YES complete:^{
if (self.updateHeight) {
self.updateHeight(180);
self.updateHeight(KScreenWidth);
}
}];
}];
@@ -255,6 +261,8 @@ UIKIT_EXTERN NSString * kRoomBackMusicCaptureVolumeKey;
- (void)hideMicControlMenu {
self.isDisplayMicStatusControl = NO;
[self.closeMicControlButton removeFromSuperview];
@kWeakify(self);
[self _micControlButton:self.micButton_close_butMusic isShow:NO complete:^{
@@ -444,6 +452,9 @@ UIKIT_EXTERN NSString * kRoomBackMusicCaptureVolumeKey;
[self.moreButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(36);
}];
[self.arrangeMicButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(36);
}];
[self.giftButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(46, 46));
@@ -547,6 +558,7 @@ UIKIT_EXTERN NSString * kRoomBackMusicCaptureVolumeKey;
self.isOnMic = NO;
self.micButton.hidden = YES;
self.faceButton.hidden = YES;
[self hideMicControlMenu];
}
[self updateMoreRedDotState];
@@ -878,4 +890,14 @@ UIKIT_EXTERN NSString * kRoomBackMusicCaptureVolumeKey;
}
return _baiShunGameButton;
}
- (UIButton *)closeMicControlButton {
if (!_closeMicControlButton) {
_closeMicControlButton = [UIButton buttonWithType:UIButtonTypeCustom];
// _closeMicControlButton.backgroundColor = [UIColor colorWithWhite:1 alpha:0.5];
[_closeMicControlButton addTarget:self action:@selector(hideMicControlMenu) forControlEvents:UIControlEventTouchUpInside];
}
return _closeMicControlButton;
}
@end

View File

@@ -45,7 +45,6 @@
#import "TreasureFailryMessageModel.h"
#import "NetImageView.h"
#import "XPUserCardViewController.h"
#import "XPRoomTopicAlertView.h"
#import "XPRoomSendTextView.h"
#import "XPRoomPKResultView.h"
@@ -56,6 +55,7 @@
#import "QEmotionHelper.h"
#import "BoomInfoModel.h"
#import "UserRoomCardViewController.h"
@implementation XPRoomMessageParser
@@ -1349,8 +1349,9 @@
model.roomInfo = roomInfo;
model.delegate = self.hostDelegate;
model.superMangerList = self.hostDelegate.getRoomSuperAdminList;
XPUserCardViewController * userCardVC = [[XPUserCardViewController alloc] initWithUser:model];
[self.hostDelegate.getCurrentNav presentViewController:userCardVC animated:YES completion:nil];
UserRoomCardViewController *vc = [[UserRoomCardViewController alloc] initWithUser:model];
[self.hostDelegate.getCurrentNav presentViewController:vc animated:YES completion:nil];
}
#pragma mark - private base methods

View File

@@ -1014,7 +1014,7 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey";
self.isMiniEnter = NO;
NIMNotificationObject *notiMsg = (NIMNotificationObject *)message.messageObject;
NIMChatroomNotificationContent *content = (NIMChatroomNotificationContent *)notiMsg.content;
RoomInfoModel * roomInfo = self.hostDelegate.getRoomInfo;
RoomInfoModel *roomInfo = self.hostDelegate.getRoomInfo;
if (content.eventType == NIMChatroomEventTypeEnter) {
if (roomInfo.isCloseScreen) {

View File

@@ -24,6 +24,8 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (CGPoint)animationPointAtStageViewByUid:(NSString *)uid;
- (CGPoint)animationPointAtStageViewByIndex:(NSInteger)index;
@end
NS_ASSUME_NONNULL_END

View File

@@ -21,10 +21,6 @@
@property (nonatomic,strong) UILabel *nickLabel;
///
@property (nonatomic,strong) NetImageView *tagImageView;
///🔥
@property (nonatomic,strong) UIImageView *hotImageView;
///线
@property (nonatomic,strong) UILabel *numberLabel;
@end
@@ -45,8 +41,6 @@
[self addSubview:self.avatarImageView];
[self addSubview:self.nickLabel];
[self addSubview:self.tagImageView];
[self addSubview:self.hotImageView];
[self addSubview:self.numberLabel];
}
- (void)initSubViewConstraints {
@@ -63,20 +57,9 @@
}];
[self.tagImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(self.nickLabel);
make.top.mas_equalTo(self.nickLabel.mas_bottom).mas_offset(12);
make.width.mas_equalTo(43);
make.height.mas_equalTo(18);
make.top.mas_equalTo(self.nickLabel.mas_bottom).mas_offset(12);
}];
[self.hotImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(self.tagImageView.mas_trailing).mas_offset(12);
make.width.height.mas_equalTo(13);
make.centerY.mas_equalTo(self.tagImageView);
}];
[self.numberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(self.hotImageView.mas_trailing).mas_offset(3);
make.centerY.mas_equalTo(self.tagImageView);
make.trailing.mas_equalTo(0);
make.height.mas_equalTo(12);
}];
}
#pragma mark - Getters And Setters
@@ -84,8 +67,20 @@
_model = model;
self.avatarImageView.imageUrl = model.avatar;
self.nickLabel.text = model.title;
self.tagImageView.imageUrl = model.tagPict;
self.numberLabel.text = [NSString stringWithFormat:@"%ld", model.onlineNum];
self.tagImageView.hidden = [NSString isEmpty:model.tagPict];
if (! [NSString isEmpty:model.tagPict]) {
@kWeakify(self);
[self.tagImageView loadImageWithUrl:model.tagPict completion:^(UIImage * _Nullable image, NSURL * _Nonnull url) {
@kStrongify(self);
if (image) {
self.tagImageView.image = image;
[self.tagImageView mas_updateConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(image.size.width/image.size.height * 18);
}];
[self layoutIfNeeded];
}
}];
}
}
- (NetImageView *)avatarImageView {
@@ -108,15 +103,6 @@
return _tagImageView;
}
- (UIImageView *)hotImageView {
if (!_hotImageView) {
_hotImageView = [[UIImageView alloc] init];
_hotImageView.userInteractionEnabled = YES;
_hotImageView.image = [UIImage imageNamed:@"room_like_collect_room_hot"];
}
return _hotImageView;
}
- (UILabel *)nickLabel {
if (!_nickLabel) {
_nickLabel = [[UILabel alloc] init];
@@ -126,13 +112,5 @@
return _nickLabel;
}
- (UILabel *)numberLabel {
if (!_numberLabel) {
_numberLabel = [[UILabel alloc] init];
_numberLabel.font = [UIFont systemFontOfSize:12];
_numberLabel.textColor = [UIColor whiteColor];
}
return _numberLabel;
}
@end

Some files were not shown because too many files have changed in this diff Show More