装扮商城-购买装扮

This commit is contained in:
chenguilong
2022-07-29 15:26:33 +08:00
parent c90ad79488
commit e0571c6e75
19 changed files with 1588 additions and 1 deletions

View File

@@ -272,6 +272,13 @@
9BE01AC528913B2500B50299 /* XPNewUserRechargeSuccessView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BE01AC428913B2500B50299 /* XPNewUserRechargeSuccessView.m */; }; 9BE01AC528913B2500B50299 /* XPNewUserRechargeSuccessView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BE01AC428913B2500B50299 /* XPNewUserRechargeSuccessView.m */; };
9BE01AC828913D4C00B50299 /* XPNewUserRechargeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BE01AC728913D4C00B50299 /* XPNewUserRechargeViewController.m */; }; 9BE01AC828913D4C00B50299 /* XPNewUserRechargeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BE01AC728913D4C00B50299 /* XPNewUserRechargeViewController.m */; };
9BE01ACE28925F7D00B50299 /* XPMineNewUserRechargeView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BE01ACD28925F7D00B50299 /* XPMineNewUserRechargeView.m */; }; 9BE01ACE28925F7D00B50299 /* XPMineNewUserRechargeView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BE01ACD28925F7D00B50299 /* XPMineNewUserRechargeView.m */; };
9BE01AD128927AC000B50299 /* XPDressUpShopViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BE01AD028927AC000B50299 /* XPDressUpShopViewController.m */; };
9BE01AD428927E9C00B50299 /* XPDressUpShopListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BE01AD328927E9C00B50299 /* XPDressUpShopListViewController.m */; };
9BE01ADA289296B500B50299 /* XPDressUpShopPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BE01AD9289296B500B50299 /* XPDressUpShopPresenter.m */; };
9BE01ADE2892A66D00B50299 /* DressUpShopModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BE01ADD2892A66D00B50299 /* DressUpShopModel.m */; };
9BE01AE128937DBC00B50299 /* XPDressUpShopCardViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BE01AE028937DBC00B50299 /* XPDressUpShopCardViewController.m */; };
9BE01AE428937EDE00B50299 /* XPDressUpShopCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BE01AE328937EDE00B50299 /* XPDressUpShopCollectionViewCell.m */; };
9BE01AE728938AB600B50299 /* XPDressUpShopCardTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BE01AE628938AB600B50299 /* XPDressUpShopCardTableViewCell.m */; };
9BE29A6B27D1BFF700446AB5 /* anchor_room_speak.svga in Resources */ = {isa = PBXBuildFile; fileRef = 9BE29A6927D1BFF700446AB5 /* anchor_room_speak.svga */; }; 9BE29A6B27D1BFF700446AB5 /* anchor_room_speak.svga in Resources */ = {isa = PBXBuildFile; fileRef = 9BE29A6927D1BFF700446AB5 /* anchor_room_speak.svga */; };
9BE29A6D27D210A500446AB5 /* anchor_room_bg.svga in Resources */ = {isa = PBXBuildFile; fileRef = 9BE29A6C27D210A500446AB5 /* anchor_room_bg.svga */; }; 9BE29A6D27D210A500446AB5 /* anchor_room_bg.svga in Resources */ = {isa = PBXBuildFile; fileRef = 9BE29A6C27D210A500446AB5 /* anchor_room_bg.svga */; };
9BE2FA90288010D300EF3D83 /* AnchorRoomSrollTipView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BE2FA8F288010D300EF3D83 /* AnchorRoomSrollTipView.m */; }; 9BE2FA90288010D300EF3D83 /* AnchorRoomSrollTipView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BE2FA8F288010D300EF3D83 /* AnchorRoomSrollTipView.m */; };
@@ -1420,6 +1427,21 @@
9BE01AC728913D4C00B50299 /* XPNewUserRechargeViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPNewUserRechargeViewController.m; sourceTree = "<group>"; }; 9BE01AC728913D4C00B50299 /* XPNewUserRechargeViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPNewUserRechargeViewController.m; sourceTree = "<group>"; };
9BE01ACC28925F7D00B50299 /* XPMineNewUserRechargeView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineNewUserRechargeView.h; sourceTree = "<group>"; }; 9BE01ACC28925F7D00B50299 /* XPMineNewUserRechargeView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineNewUserRechargeView.h; sourceTree = "<group>"; };
9BE01ACD28925F7D00B50299 /* XPMineNewUserRechargeView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineNewUserRechargeView.m; sourceTree = "<group>"; }; 9BE01ACD28925F7D00B50299 /* XPMineNewUserRechargeView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineNewUserRechargeView.m; sourceTree = "<group>"; };
9BE01ACF28927AC000B50299 /* XPDressUpShopViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPDressUpShopViewController.h; sourceTree = "<group>"; };
9BE01AD028927AC000B50299 /* XPDressUpShopViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPDressUpShopViewController.m; sourceTree = "<group>"; };
9BE01AD228927E9C00B50299 /* XPDressUpShopListViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPDressUpShopListViewController.h; sourceTree = "<group>"; };
9BE01AD328927E9C00B50299 /* XPDressUpShopListViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPDressUpShopListViewController.m; sourceTree = "<group>"; };
9BE01AD8289296B500B50299 /* XPDressUpShopPresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPDressUpShopPresenter.h; sourceTree = "<group>"; };
9BE01AD9289296B500B50299 /* XPDressUpShopPresenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPDressUpShopPresenter.m; sourceTree = "<group>"; };
9BE01ADB2892975000B50299 /* XPDressUpShopProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPDressUpShopProtocol.h; sourceTree = "<group>"; };
9BE01ADC2892A66D00B50299 /* DressUpShopModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DressUpShopModel.h; sourceTree = "<group>"; };
9BE01ADD2892A66D00B50299 /* DressUpShopModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DressUpShopModel.m; sourceTree = "<group>"; };
9BE01ADF28937DBC00B50299 /* XPDressUpShopCardViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPDressUpShopCardViewController.h; sourceTree = "<group>"; };
9BE01AE028937DBC00B50299 /* XPDressUpShopCardViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPDressUpShopCardViewController.m; sourceTree = "<group>"; };
9BE01AE228937EDE00B50299 /* XPDressUpShopCollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPDressUpShopCollectionViewCell.h; sourceTree = "<group>"; };
9BE01AE328937EDE00B50299 /* XPDressUpShopCollectionViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPDressUpShopCollectionViewCell.m; sourceTree = "<group>"; };
9BE01AE528938AB600B50299 /* XPDressUpShopCardTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPDressUpShopCardTableViewCell.h; sourceTree = "<group>"; };
9BE01AE628938AB600B50299 /* XPDressUpShopCardTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPDressUpShopCardTableViewCell.m; sourceTree = "<group>"; };
9BE29A6927D1BFF700446AB5 /* anchor_room_speak.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = anchor_room_speak.svga; sourceTree = "<group>"; }; 9BE29A6927D1BFF700446AB5 /* anchor_room_speak.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = anchor_room_speak.svga; sourceTree = "<group>"; };
9BE29A6C27D210A500446AB5 /* anchor_room_bg.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = anchor_room_bg.svga; sourceTree = "<group>"; }; 9BE29A6C27D210A500446AB5 /* anchor_room_bg.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = anchor_room_bg.svga; sourceTree = "<group>"; };
9BE2FA8E288010D300EF3D83 /* AnchorRoomSrollTipView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AnchorRoomSrollTipView.h; sourceTree = "<group>"; }; 9BE2FA8E288010D300EF3D83 /* AnchorRoomSrollTipView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AnchorRoomSrollTipView.h; sourceTree = "<group>"; };
@@ -4819,6 +4841,12 @@
E839532C276A030F00CF2F24 /* XPMineDressUpListViewController.m */, E839532C276A030F00CF2F24 /* XPMineDressUpListViewController.m */,
9B1EF3D027E81C0600554295 /* XPMineDressUpBubbleViewController.h */, 9B1EF3D027E81C0600554295 /* XPMineDressUpBubbleViewController.h */,
9B1EF3D127E81C0600554295 /* XPMineDressUpBubbleViewController.m */, 9B1EF3D127E81C0600554295 /* XPMineDressUpBubbleViewController.m */,
9BE01ACF28927AC000B50299 /* XPDressUpShopViewController.h */,
9BE01AD028927AC000B50299 /* XPDressUpShopViewController.m */,
9BE01AD228927E9C00B50299 /* XPDressUpShopListViewController.h */,
9BE01AD328927E9C00B50299 /* XPDressUpShopListViewController.m */,
9BE01ADF28937DBC00B50299 /* XPDressUpShopCardViewController.h */,
9BE01AE028937DBC00B50299 /* XPDressUpShopCardViewController.m */,
); );
path = View; path = View;
sourceTree = "<group>"; sourceTree = "<group>";
@@ -4827,6 +4855,7 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
E8395335276A03E200CF2F24 /* XPMineDressUpProtocol.h */, E8395335276A03E200CF2F24 /* XPMineDressUpProtocol.h */,
9BE01ADB2892975000B50299 /* XPDressUpShopProtocol.h */,
); );
path = Protocol; path = Protocol;
sourceTree = "<group>"; sourceTree = "<group>";
@@ -4836,6 +4865,8 @@
children = ( children = (
E8395332276A03C300CF2F24 /* XPMineDressUpPresenter.h */, E8395332276A03C300CF2F24 /* XPMineDressUpPresenter.h */,
E8395333276A03C300CF2F24 /* XPMineDressUpPresenter.m */, E8395333276A03C300CF2F24 /* XPMineDressUpPresenter.m */,
9BE01AD8289296B500B50299 /* XPDressUpShopPresenter.h */,
9BE01AD9289296B500B50299 /* XPDressUpShopPresenter.m */,
); );
path = Presenter; path = Presenter;
sourceTree = "<group>"; sourceTree = "<group>";
@@ -4853,6 +4884,8 @@
9BBC028D2786FA060007C24B /* NobleCardModel.m */, 9BBC028D2786FA060007C24B /* NobleCardModel.m */,
9B1FC3D327E49A5D006EFFE0 /* ChatBubbleModel.h */, 9B1FC3D327E49A5D006EFFE0 /* ChatBubbleModel.h */,
9B1FC3D427E49A5D006EFFE0 /* ChatBubbleModel.m */, 9B1FC3D427E49A5D006EFFE0 /* ChatBubbleModel.m */,
9BE01ADC2892A66D00B50299 /* DressUpShopModel.h */,
9BE01ADD2892A66D00B50299 /* DressUpShopModel.m */,
); );
path = Model; path = Model;
sourceTree = "<group>"; sourceTree = "<group>";
@@ -4885,6 +4918,10 @@
9B1FC3D727E49C36006EFFE0 /* XPMineDressBubbleCollectionViewCell.m */, 9B1FC3D727E49C36006EFFE0 /* XPMineDressBubbleCollectionViewCell.m */,
9B1EF3D327E8294B00554295 /* XPMineDressEmptyCollectionViewCell.h */, 9B1EF3D327E8294B00554295 /* XPMineDressEmptyCollectionViewCell.h */,
9B1EF3D427E8294B00554295 /* XPMineDressEmptyCollectionViewCell.m */, 9B1EF3D427E8294B00554295 /* XPMineDressEmptyCollectionViewCell.m */,
9BE01AE228937EDE00B50299 /* XPDressUpShopCollectionViewCell.h */,
9BE01AE328937EDE00B50299 /* XPDressUpShopCollectionViewCell.m */,
9BE01AE528938AB600B50299 /* XPDressUpShopCardTableViewCell.h */,
9BE01AE628938AB600B50299 /* XPDressUpShopCardTableViewCell.m */,
); );
path = Cell; path = Cell;
sourceTree = "<group>"; sourceTree = "<group>";
@@ -7283,6 +7320,7 @@
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
9BE01ADA289296B500B50299 /* XPDressUpShopPresenter.m in Sources */,
E8E5E1AF27C3920100F457D8 /* XPHomeRecommendPresenter.m in Sources */, E8E5E1AF27C3920100F457D8 /* XPHomeRecommendPresenter.m in Sources */,
E86B911E2810351A0007DEE7 /* MessageToolMenuCollectionViewCell.m in Sources */, E86B911E2810351A0007DEE7 /* MessageToolMenuCollectionViewCell.m in Sources */,
9B2EA7C32804052E00ED17BF /* AnchorPKMicroView.m in Sources */, 9B2EA7C32804052E00ED17BF /* AnchorPKMicroView.m in Sources */,
@@ -7686,6 +7724,7 @@
E8A03DE9276301CC0098D9EA /* XPCandyRankContainerView.m in Sources */, E8A03DE9276301CC0098D9EA /* XPCandyRankContainerView.m in Sources */,
9BD2ECD5288F838200F5CD9A /* XPMineFootPrintPresenter.m in Sources */, 9BD2ECD5288F838200F5CD9A /* XPMineFootPrintPresenter.m in Sources */,
9B1B72BF2800422E003FACE9 /* XPAnchorPKRuleView.m in Sources */, 9B1B72BF2800422E003FACE9 /* XPAnchorPKRuleView.m in Sources */,
9BE01AE428937EDE00B50299 /* XPDressUpShopCollectionViewCell.m in Sources */,
186A534B26FC6ED900D67B2C /* TTPopupManagerService.m in Sources */, 186A534B26FC6ED900D67B2C /* TTPopupManagerService.m in Sources */,
E8834E35280009090029CCC1 /* XPMineGuildSearchMemberTableViewCell.m in Sources */, E8834E35280009090029CCC1 /* XPMineGuildSearchMemberTableViewCell.m in Sources */,
18E7B1B226E8AF980064BC9B /* MainPresenter.m in Sources */, 18E7B1B226E8AF980064BC9B /* MainPresenter.m in Sources */,
@@ -7796,6 +7835,7 @@
9B17F71827BD150600440843 /* SVGAParserManager.m in Sources */, 9B17F71827BD150600440843 /* SVGAParserManager.m in Sources */,
E80DE40D2775ABA500BE5BCB /* XPFirstRechargeFlowLayout.m in Sources */, E80DE40D2775ABA500BE5BCB /* XPFirstRechargeFlowLayout.m in Sources */,
9B39C88928854AB300564D17 /* XPHomeLiveRecordCell.m in Sources */, 9B39C88928854AB300564D17 /* XPHomeLiveRecordCell.m in Sources */,
9BE01AE128937DBC00B50299 /* XPDressUpShopCardViewController.m in Sources */,
E896EFA22771AE9400AD2CC1 /* XPMineFriendViewController.m in Sources */, E896EFA22771AE9400AD2CC1 /* XPMineFriendViewController.m in Sources */,
E8E70D8C26F2F5A500F03460 /* XPMineHeadItemCollectionViewCell.m in Sources */, E8E70D8C26F2F5A500F03460 /* XPMineHeadItemCollectionViewCell.m in Sources */,
9BE9F0FC27FED2E100667200 /* XPAnchorFansJoinModel.m in Sources */, 9BE9F0FC27FED2E100667200 /* XPAnchorFansJoinModel.m in Sources */,
@@ -7880,6 +7920,7 @@
E89DA67527009ACD008483C1 /* XPMineRechargeNavView.m in Sources */, E89DA67527009ACD008483C1 /* XPMineRechargeNavView.m in Sources */,
E8C1672A2806B1E500ECB15C /* XPGuildSuperAdminSetTableViewCell.m in Sources */, E8C1672A2806B1E500ECB15C /* XPGuildSuperAdminSetTableViewCell.m in Sources */,
E8834E4528003A8F0029CCC1 /* XPMineMangerListViewController.m in Sources */, E8834E4528003A8F0029CCC1 /* XPMineMangerListViewController.m in Sources */,
9BE01AE728938AB600B50299 /* XPDressUpShopCardTableViewCell.m in Sources */,
E82E75062828E76400C25EF7 /* XPCoreDataManager.m in Sources */, E82E75062828E76400C25EF7 /* XPCoreDataManager.m in Sources */,
1808072D2731598F001FD836 /* XPNetImageYYLabel.m in Sources */, 1808072D2731598F001FD836 /* XPNetImageYYLabel.m in Sources */,
E800806827FD3B520055A8AB /* XPClanMenuView.m in Sources */, E800806827FD3B520055A8AB /* XPClanMenuView.m in Sources */,
@@ -7960,6 +8001,7 @@
E8C1CD7627D8AE3D00376F83 /* XPRoomFacePresenter.m in Sources */, E8C1CD7627D8AE3D00376F83 /* XPRoomFacePresenter.m in Sources */,
18F4043A275E20D900A6C548 /* TRTCRtcImpl.m in Sources */, 18F4043A275E20D900A6C548 /* TRTCRtcImpl.m in Sources */,
E8899C7F27853B6A007944BE /* DatingMicroView.m in Sources */, E8899C7F27853B6A007944BE /* DatingMicroView.m in Sources */,
9BE01AD428927E9C00B50299 /* XPDressUpShopListViewController.m in Sources */,
9B41D36E282649230048C588 /* XPWeekStarRankUserModel.m in Sources */, 9B41D36E282649230048C588 /* XPWeekStarRankUserModel.m in Sources */,
E8E5E19A27C36C0B00F457D8 /* XPHomeHotRoomTableViewCell.m in Sources */, E8E5E19A27C36C0B00F457D8 /* XPHomeHotRoomTableViewCell.m in Sources */,
E824545926F5E65900BE8163 /* XPMineVerifIdentityView.m in Sources */, E824545926F5E65900BE8163 /* XPMineVerifIdentityView.m in Sources */,
@@ -8028,6 +8070,7 @@
18E7B29026EA0E6B0064BC9B /* FlutterBoost+Xplan.m in Sources */, 18E7B29026EA0E6B0064BC9B /* FlutterBoost+Xplan.m in Sources */,
E8B846DC26FDE24300A777FE /* RechargeListModel.m in Sources */, E8B846DC26FDE24300A777FE /* RechargeListModel.m in Sources */,
9B1B7292280010E8003FACE9 /* Api+FansTeam.m in Sources */, 9B1B7292280010E8003FACE9 /* Api+FansTeam.m in Sources */,
9BE01ADE2892A66D00B50299 /* DressUpShopModel.m in Sources */,
E851E45B27FF02DF002F3ACB /* XPGuildSearchPresenter.m in Sources */, E851E45B27FF02DF002F3ACB /* XPGuildSearchPresenter.m in Sources */,
E884C36C2743951B00E1EBED /* GiftReceiveInfoModel.m in Sources */, E884C36C2743951B00E1EBED /* GiftReceiveInfoModel.m in Sources */,
9B7B606227BB96E40070BB72 /* XPRoomAnchorInfoCardView.m in Sources */, 9B7B606227BB96E40070BB72 /* XPRoomAnchorInfoCardView.m in Sources */,
@@ -8058,6 +8101,7 @@
E836DBD0279BF5150056F7DD /* XPLittleGameTableViewCell.m in Sources */, E836DBD0279BF5150056F7DD /* XPLittleGameTableViewCell.m in Sources */,
E89DA66727006443008483C1 /* RechargeStorage.m in Sources */, E89DA66727006443008483C1 /* RechargeStorage.m in Sources */,
189DD53F26DE255600AB55B1 /* main.m in Sources */, 189DD53F26DE255600AB55B1 /* main.m in Sources */,
9BE01AD128927AC000B50299 /* XPDressUpShopViewController.m in Sources */,
E8D34D6728084E88009C4835 /* XPMineUserInfoGiftWallCollectionViewCell.m in Sources */, E8D34D6728084E88009C4835 /* XPMineUserInfoGiftWallCollectionViewCell.m in Sources */,
E8A30BE328534A28003B4873 /* XPSessionFindNewViewController.m in Sources */, E8A30BE328534A28003B4873 /* XPSessionFindNewViewController.m in Sources */,
E8A03DF927634A590098D9EA /* CandyTreeResultModel.m in Sources */, E8A03DF927634A590098D9EA /* CandyTreeResultModel.m in Sources */,

View File

@@ -77,6 +77,20 @@ NS_ASSUME_NONNULL_BEGIN
/// @param completion 完成 /// @param completion 完成
/// @param type 类型 2 房间的 1 首页的 3 我的装扮 /// @param type 类型 2 房间的 1 首页的 3 我的装扮
+ (void)dressupBannerList:(HttpRequestHelperCompletion)completion type:(NSString *)type; + (void)dressupBannerList:(HttpRequestHelperCompletion)completion type:(NSString *)type;
#pragma mark - 装扮商城
/// 获取装扮商城列表
/// @param completion 完成
/// @param dressType 装扮类型
+ (void)requestDressUpShopList:(HttpRequestHelperCompletion)completion dressType:(NSString *)dressType;
/// 购买装扮
/// @param completion 完成
/// @param dressType 装扮类型
/// @param dressId 装扮id
+ (void)requestDressUpShopBuy:(HttpRequestHelperCompletion)completion dressType:(NSString *)dressType dressId:(NSString *)dressId;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -106,4 +106,19 @@
[self makeRequest:@"home/banner" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, type, nil]; [self makeRequest:@"home/banner" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, type, nil];
} }
#pragma mark -
///
/// @param completion
/// @param dressType
+ (void)requestDressUpShopList:(HttpRequestHelperCompletion)completion dressType:(NSString *)dressType {
[self makeRequest:@"dress/shop/list" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, dressType, nil];
}
///
/// @param completion
/// @param dressId id
+ (void)requestDressUpShopBuy:(HttpRequestHelperCompletion)completion dressType:(NSString *)dressType dressId:(NSString *)dressId {
[self makeRequest:@"dress/shop/buy" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, dressType, dressId, nil];
}
@end @end

View File

@@ -0,0 +1,31 @@
//
// DressUpShopModel.h
// xplan-ios
//
// Created by GreenLand on 2022/7/28.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface DressUpShopModel : NSObject
///座驾图片
@property (nonatomic, strong) NSString *pic;
///id
@property (nonatomic, strong) NSString *dressUpId;
///
@property (nonatomic, copy) NSString *dressId;
///座驾名称
@property (nonatomic, strong) NSString *name;
///天数
@property (nonatomic, assign) NSInteger dressDay;
///价格
@property (nonatomic, assign) NSInteger dressPrice;
///装扮类型
@property (nonatomic, assign) NSInteger dressType;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,16 @@
//
// DressUpShopModel.m
// xplan-ios
//
// Created by GreenLand on 2022/7/28.
//
#import "DressUpShopModel.h"
@implementation DressUpShopModel
+ (NSDictionary *)replacedKeyFromPropertyName {
return @{@"dressUpId": @"id"};
}
@end

View File

@@ -0,0 +1,26 @@
//
// XPDressUpShopPresenter.h
// xplan-ios
//
// Created by GreenLand on 2022/7/28.
//
#import "BaseMvpPresenter.h"
#import "XPDressUpShopProtocol.h"
NS_ASSUME_NONNULL_BEGIN
@interface XPDressUpShopPresenter : BaseMvpPresenter
/// 获取装扮商城列表
/// @param type 类型 2铭牌0头饰1座驾3资料卡4聊天气泡
- (void)getDressUpShopList:(DressUpShopListType)type;
/// 购买装扮
/// @param dressType 装扮类型
/// @param dressId 装扮id
- (void)buyDressUp:(DressUpShopListType)dressType dressId:(NSString *)dressId;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,33 @@
//
// XPDressUpShopPresenter.m
// xplan-ios
//
// Created by GreenLand on 2022/7/28.
//
#import "XPDressUpShopPresenter.h"
#import "Api+DressUp.h"
#import "DressUpShopModel.h"
#import "WalletInfoModel.h"
@implementation XPDressUpShopPresenter
///
/// @param type 01234
- (void)getDressUpShopList:(DressUpShopListType)type {
[Api requestDressUpShopList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
NSArray *array = [DressUpShopModel modelsWithArray:data.data];
[[self getView] getShopListSuccess:array type:type];
}] dressType:[NSString stringWithFormat:@"%ld", type]];
}
///
/// @param dressType
/// @param dressId id
- (void)buyDressUp:(DressUpShopListType)dressType dressId:(NSString *)dressId {
[Api requestDressUpShopBuy:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView] buyShopDressSuccessWithType:dressType];
} showLoading:YES] dressType:[NSString stringWithFormat:@"%zd", dressType] dressId:dressId];
}
@end

View File

@@ -0,0 +1,55 @@
//
// XPDressUpShopProtocol.h
// xplan-ios
//
// Created by GreenLand on 2022/7/28.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSInteger, DressUpShopListType) {
DressUpShopListType_HeadWear = 0,
DressUpShopListType_Car,
DressUpShopListType_Nameplate,
DressUpShopListType_Noble,
DressUpShopListType_Bubble,
};
@class WalletInfoModel;
@protocol XPDressUpShopProtocol <NSObject>
///获取账户余额
- (void)getUserWalletInfo:(WalletInfoModel *)balanceInfo;
///获取商城装扮列表成功
- (void)getShopListSuccess:(NSArray *)array type:(DressUpShopListType)type;
///购买装扮成功
- (void)buyShopDressSuccessWithType:(DressUpShopListType)type;
///获取用户头饰列表成功
- (void)getUserHeadwearListSuccess:(NSArray *)array;
///获取用户头饰列表成功
- (void)getUserCarListSuccess:(NSArray *)array;
///获取用户头饰列表成功
- (void)getUserNameplateListSuccess:(NSArray *)array;
///获取用户贵族资料卡成功
- (void)getUserNobleCardListSuccess:(NSArray *)array;
///获取用户公屏气泡成功
- (void)getUserChatBubbleListSuccess:(NSArray *)array;
///使用头饰成功
- (void)useHeadwearSuccess:(NSString *)headWearId;
///使用座驾成功
- (void)useCarSuccess:(NSString *)carId;
///使用铭牌成功
- (void)useNameplateSuccess:(NSString *)nameplateId;
///使用贵族资料卡成功
- (void)userNobleCardSuccess:(NSString *)nobleCardId;
///使用气泡成功
- (void)useBubbleSuccess:(NSString *)bubbleId;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,30 @@
//
// XPDressUpShopCardTableViewCell.h
// xplan-ios
//
// Created by GreenLand on 2022/7/29.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@class DressUpShopModel, XPDressUpShopCardTableViewCell;
@protocol XPDressUpShopCardTableViewCellDelegate <NSObject>
///赠送装扮
- (void)xPDressUpShopCardTableViewCellSendDress:(XPDressUpShopCardTableViewCell *)view dressId:(NSString *)dressId;
///购买装扮
- (void)xPDressUpShopCardTableViewCellBuyDress:(XPDressUpShopCardTableViewCell *)view dressId:(NSString *)dressId;
@end
@interface XPDressUpShopCardTableViewCell : UITableViewCell
@property (nonatomic,strong) DressUpShopModel *nobleCardModel;
///代理
@property (nonatomic,weak) id<XPDressUpShopCardTableViewCellDelegate> delegate;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,230 @@
//
// XPDressUpShopCardTableViewCell.m
// xplan-ios
//
// Created by GreenLand on 2022/7/29.
//
#import "XPDressUpShopCardTableViewCell.h"
///Third
#import <Masonry/Masonry.h>
///Tool
#import "ThemeColor.h"
#import "NetImageView.h"
#import "UIImage+Utils.h"
#import "XPMacro.h"
///Model
#import "DressUpShopModel.h"
@interface XPDressUpShopCardTableViewCell()
///view
@property (nonatomic, strong) UIView *mainView;
///
@property (nonatomic, strong) UIView *userCardBackView;
///
@property (nonatomic, strong) UIImageView *userCardBackImageView;
///
@property (nonatomic, strong) NetImageView *nobleImageView;
///
@property (nonatomic, strong) UILabel *titleLabel;
///
@property (nonatomic, strong) UIImageView *diamondImageView;
///
@property (nonatomic, strong) UILabel *diamondLabel;
///
@property (nonatomic, strong) UIButton *sendButton;
///使
@property (nonatomic,strong) UIButton *useButton;
@end
@implementation XPDressUpShopCardTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
self.selectionStyle = UITableViewCellSelectionStyleNone;
[self initSubViews];
[self initSubViewConstraints];
}
return self;
}
#pragma mark - Private Method
- (void)initSubViews {
self.backgroundColor = [UIColor clearColor];;
self.selectionStyle = UITableViewCellSelectionStyleNone;
[self.contentView addSubview:self.mainView];
[self.mainView addSubview:self.userCardBackView];
[self.mainView addSubview:self.userCardBackImageView];
[self.mainView addSubview:self.nobleImageView];
[self.mainView addSubview:self.titleLabel];
[self.mainView addSubview:self.diamondImageView];
[self.mainView addSubview:self.diamondLabel];
[self.mainView addSubview:self.sendButton];
[self.mainView addSubview:self.useButton];
}
- (void)initSubViewConstraints {
[self.mainView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(268);
make.left.right.mas_equalTo(self).inset(15);
make.top.mas_equalTo(12);
}];
[self.userCardBackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.top.mas_equalTo(0);
make.height.mas_equalTo(180);
}];
[self.userCardBackImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(110);
make.width.mas_equalTo(285);
make.bottom.mas_equalTo(self.userCardBackView).mas_offset(-4);
make.centerX.mas_equalTo(self.mainView);
}];
[self.nobleImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(180);
make.width.mas_equalTo(330);
make.bottom.mas_equalTo(self.userCardBackImageView);
make.centerX.mas_equalTo(self.mainView);
}];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(12);
make.top.mas_equalTo(self.userCardBackView.mas_bottom).mas_offset(14);
make.height.mas_equalTo(14);
}];
[self.diamondImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(self.diamondLabel.mas_left).mas_offset(-4);
make.size.mas_equalTo(CGSizeMake(11, 11));
make.centerY.mas_equalTo(self.titleLabel);
}];
[self.diamondLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self.titleLabel);
make.right.mas_equalTo(-12);
make.height.mas_equalTo(20);
}];
CGFloat width = (KScreenWidth - 30-20-12) *0.5;
[self.sendButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(width, 32));
make.top.mas_equalTo(self.titleLabel.mas_bottom).mas_offset(16);
make.right.mas_equalTo(self.mas_centerX).mas_offset(-6);
}];
[self.useButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.mas_centerX).mas_offset(6);
make.size.mas_equalTo(self.sendButton);
make.centerY.mas_equalTo(self.sendButton);
}];
}
#pragma mark - private
- (void)setNobleCardModel:(DressUpShopModel *)nobleCardModel {
_nobleCardModel = nobleCardModel;
if (_nobleCardModel) {
self.titleLabel.text = [NSString stringWithFormat:@"%@(%zd天)", nobleCardModel.name, nobleCardModel.dressDay];
self.nobleImageView.imageUrl = nobleCardModel.pic;
self.diamondLabel.text = [NSString stringWithFormat:@"%zd", nobleCardModel.dressPrice];
}
}
#pragma mark - Event Response
- (void)sendButtonAction:(UIButton *)sender {
if (self.delegate && [self.delegate respondsToSelector:@selector(xPDressUpShopCardTableViewCellSendDress:dressId:)]) {
[self.delegate xPDressUpShopCardTableViewCellSendDress:self dressId:self.nobleCardModel.dressId];
}
}
- (void)useButtonAction:(UIButton *)sender {
if (self.delegate && [self.delegate respondsToSelector:@selector(xPDressUpShopCardTableViewCellBuyDress:dressId:)]) {
[self.delegate xPDressUpShopCardTableViewCellBuyDress:self dressId:self.nobleCardModel.dressId];
}
}
#pragma mark - Getter && Setter
- (UIView *)mainView {
if (!_mainView) {
_mainView = [[UIView alloc] init];
_mainView.backgroundColor = [ThemeColor appCellBackgroundColor];
_mainView.layer.cornerRadius = 10;
_mainView.layer.masksToBounds = YES;
}
return _mainView;
}
- (UIView *)userCardBackView {
if (!_userCardBackView) {
_userCardBackView = [[UIView alloc] init];
_userCardBackView.backgroundColor = UIColorFromRGB(0xEAE5FC);
}
return _userCardBackView;;
}
- (NetImageView *)nobleImageView {
if (!_nobleImageView) {
_nobleImageView = [[NetImageView alloc] init];
_nobleImageView.contentMode = UIViewContentModeScaleAspectFit;
}
return _nobleImageView;;
}
- (UIImageView *)userCardBackImageView {
if (!_userCardBackImageView) {
_userCardBackImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mine_dressup_noble_bg"]];
_userCardBackImageView.contentMode = UIViewContentModeScaleAspectFit;
}
return _userCardBackImageView;;
}
- (UILabel *)titleLabel {
if (!_titleLabel) {
_titleLabel = [[UILabel alloc] init];
_titleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
_titleLabel.textColor = [ThemeColor mainTextColor];
}
return _titleLabel;
}
- (UIImageView *)diamondImageView {
if (!_diamondImageView) {
_diamondImageView = [[UIImageView alloc] init];
_diamondImageView.image = [UIImage imageNamed:@"common_diamond"];
}
return _diamondImageView;
}
- (UILabel *)diamondLabel {
if (!_diamondLabel) {
_diamondLabel = [[UILabel alloc] init];
_diamondLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightBold];
_diamondLabel.textColor = UIColorFromRGB(0xFFBC51);
}
return _diamondLabel;
}
- (UIButton *)sendButton {
if (!_sendButton) {
_sendButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_sendButton setTitle:@"赠送" forState:UIControlStateNormal];
[_sendButton setTitleColor:UIColorFromRGB(0xFFA936) forState:UIControlStateNormal];
[_sendButton addTarget:self action:@selector(sendButtonAction:) forControlEvents:UIControlEventTouchUpInside];
_sendButton.layer.masksToBounds = YES;
_sendButton.layer.cornerRadius = 32/2;
_sendButton.titleLabel.font = [UIFont systemFontOfSize:12];
_sendButton.backgroundColor = UIColorFromRGB(0xFFF0C9);
}
return _sendButton;
}
- (UIButton *)useButton {
if (!_useButton) {
_useButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_useButton setTitle:@"使用" forState:UIControlStateNormal];
[_useButton setTitleColor:[ThemeColor confirmButtonTextColor] forState:UIControlStateNormal];
[_useButton addTarget:self action:@selector(useButtonAction:) forControlEvents:UIControlEventTouchUpInside];
_useButton.layer.masksToBounds = YES;
_useButton.layer.cornerRadius = 32/2;
_useButton.titleLabel.font = [UIFont systemFontOfSize:12];
[_useButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[[ThemeColor confirmButtonGradientStartColor], [ThemeColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal];
}
return _useButton;
}
@end

View File

@@ -0,0 +1,31 @@
//
// XPDressUpShopCollectionViewCell.h
// xplan-ios
//
// Created by GreenLand on 2022/7/29.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@class DressUpShopModel, XPDressUpShopCollectionViewCell;
@protocol XPDressUpShopCollectionViewCellDelegate <NSObject>
///赠送装扮
- (void)xPDressUpShopCollectionViewCellSendDress:(XPDressUpShopCollectionViewCell *)view dressId:(NSString *)dressId;
///购买装扮
- (void)xPDressUpShopCollectionViewCellBuyDress:(XPDressUpShopCollectionViewCell *)view dressId:(NSString *)dressId;
@end
@interface XPDressUpShopCollectionViewCell : UICollectionViewCell
@property (nonatomic, strong) DressUpShopModel *dressUpModel;
@property (nonatomic,weak) id<XPDressUpShopCollectionViewCellDelegate> delegate;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,209 @@
//
// XPDressUpShopCollectionViewCell.m
// xplan-ios
//
// Created by GreenLand on 2022/7/29.
//
#import "XPDressUpShopCollectionViewCell.h"
///Third
#import <Masonry/Masonry.h>
///Tool
#import "ThemeColor.h"
#import "NetImageView.h"
#import "UIImage+Utils.h"
#import "XPMacro.h"
///Model
#import "DressUpShopModel.h"
@interface XPDressUpShopCollectionViewCell()
///view
@property (nonatomic, strong) UIView *mainView;
///
@property (nonatomic, strong) UIView *userCardBackView;
///
@property (nonatomic, strong) NetImageView *dressUpImageView;
///
@property (nonatomic, strong) UILabel *titleLabel;
///
@property (nonatomic, strong) UIImageView *diamondImageView;
///
@property (nonatomic, strong) UILabel *diamondLabel;
///
@property (nonatomic, strong) UIButton *sendButton;
///使
@property (nonatomic,strong) UIButton *useButton;
@end
@implementation XPDressUpShopCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
[self initSubViews];
[self initSubViewConstraints];
}
return self;
}
#pragma mark - Private Method
- (void)initSubViews {
[self.contentView addSubview:self.mainView];
[self.mainView addSubview:self.userCardBackView];
[self.mainView addSubview:self.dressUpImageView];
[self.mainView addSubview:self.titleLabel];
[self.mainView addSubview:self.diamondImageView];
[self.mainView addSubview:self.diamondLabel];
[self.mainView addSubview:self.sendButton];
[self.mainView addSubview:self.useButton];
}
- (void)initSubViewConstraints {
[self.mainView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(0);
}];
[self.userCardBackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(92);
make.left.top.right.mas_equalTo(0);
}];
[self.dressUpImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(80, 45));
make.top.mas_equalTo(22);
make.centerX.mas_equalTo(self.userCardBackView);
}];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(8);
make.top.mas_equalTo(self.userCardBackView.mas_bottom).mas_offset(8);
make.height.mas_equalTo(14);
}];
[self.diamondImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.titleLabel);
make.size.mas_equalTo(CGSizeMake(11, 11));
make.top.mas_equalTo(self.titleLabel.mas_bottom).mas_offset(12);
}];
[self.diamondLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self.diamondImageView);
make.left.mas_equalTo(self.diamondImageView.mas_right).mas_offset(4);
make.height.mas_equalTo(17);
}];
CGFloat width = ((KScreenWidth - 42) *0.5 - 16-6) *0.5;
[self.sendButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(width, 24));
make.top.mas_equalTo(self.diamondImageView.mas_bottom).mas_offset(17);
make.right.mas_equalTo(self.mas_centerX).mas_offset(-3);
}];
[self.useButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.mas_centerX).mas_offset(3);
make.size.mas_equalTo(self.sendButton);
make.centerY.mas_equalTo(self.sendButton);
}];
}
#pragma mark - private
- (void)setDressUpModel:(DressUpShopModel *)dressUpModel {
_dressUpModel = dressUpModel;
if (dressUpModel) {
self.titleLabel.text = [NSString stringWithFormat:@"%@(%zd天)", dressUpModel.name, dressUpModel.dressDay];
self.dressUpImageView.imageUrl = dressUpModel.pic;
self.diamondLabel.text = [NSString stringWithFormat:@"%zd", dressUpModel.dressPrice];
}
}
#pragma mark - Event Response
- (void)sendButtonAction:(UIButton *)sender {
if (self.delegate && [self.delegate respondsToSelector:@selector(xPDressUpShopCollectionViewCellSendDress:dressId:)]) {
[self.delegate xPDressUpShopCollectionViewCellSendDress:self dressId:self.dressUpModel.dressId];
}
}
- (void)useButtonAction:(UIButton *)sender {
if (self.delegate && [self.delegate respondsToSelector:@selector(xPDressUpShopCollectionViewCellBuyDress:dressId:)]) {
[self.delegate xPDressUpShopCollectionViewCellBuyDress:self dressId:self.dressUpModel.dressId];
}
}
#pragma mark - Getter && Setter
- (UIView *)mainView {
if (!_mainView) {
_mainView = [[UIView alloc] init];
_mainView.backgroundColor = [ThemeColor appCellBackgroundColor];
_mainView.layer.cornerRadius = 10;
_mainView.layer.masksToBounds = YES;
}
return _mainView;
}
- (UIView *)userCardBackView {
if (!_userCardBackView) {
_userCardBackView = [[UIView alloc] init];
_userCardBackView.backgroundColor = UIColorFromRGB(0xEAE5FC);
}
return _userCardBackView;;
}
- (NetImageView *)dressUpImageView {
if (!_dressUpImageView) {
_dressUpImageView = [[NetImageView alloc] init];
_dressUpImageView.contentMode = UIViewContentModeScaleAspectFit;
}
return _dressUpImageView;;
}
- (UILabel *)titleLabel {
if (!_titleLabel) {
_titleLabel = [[UILabel alloc] init];
_titleLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium];
_titleLabel.textColor = [ThemeColor mainTextColor];
}
return _titleLabel;
}
- (UIImageView *)diamondImageView {
if (!_diamondImageView) {
_diamondImageView = [[UIImageView alloc] init];
_diamondImageView.image = [UIImage imageNamed:@"common_diamond"];
}
return _diamondImageView;
}
- (UILabel *)diamondLabel {
if (!_diamondLabel) {
_diamondLabel = [[UILabel alloc] init];
_diamondLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightBold];
_diamondLabel.textColor = UIColorFromRGB(0xFFBC51);
}
return _diamondLabel;
}
- (UIButton *)sendButton {
if (!_sendButton) {
_sendButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_sendButton setTitle:@"赠送" forState:UIControlStateNormal];
[_sendButton setTitleColor:UIColorFromRGB(0xFFA936) forState:UIControlStateNormal];
[_sendButton addTarget:self action:@selector(sendButtonAction:) forControlEvents:UIControlEventTouchUpInside];
_sendButton.layer.masksToBounds = YES;
_sendButton.layer.cornerRadius = 24/2;
_sendButton.titleLabel.font = [UIFont systemFontOfSize:12];
_sendButton.backgroundColor = UIColorFromRGB(0xFFF0C9);
}
return _sendButton;
}
- (UIButton *)useButton {
if (!_useButton) {
_useButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_useButton setTitle:@"购买" forState:UIControlStateNormal];
[_useButton setTitleColor:[ThemeColor confirmButtonTextColor] forState:UIControlStateNormal];
[_useButton addTarget:self action:@selector(useButtonAction:) forControlEvents:UIControlEventTouchUpInside];
_useButton.layer.masksToBounds = YES;
_useButton.layer.cornerRadius = 24/2;
_useButton.titleLabel.font = [UIFont systemFontOfSize:12];
[_useButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[[ThemeColor confirmButtonGradientStartColor], [ThemeColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal];
}
return _useButton;
}
@end

View File

@@ -0,0 +1,21 @@
//
// XPDressUpShopCardViewController.h
// xplan-ios
//
// Created by GreenLand on 2022/7/29.
//
#import "MvpViewController.h"
#import <JXCategoryView/JXCategoryListContainerView.h>
#import "XPDressUpShopProtocol.h"
NS_ASSUME_NONNULL_BEGIN
@interface XPDressUpShopCardViewController : MvpViewController<JXCategoryListContentViewDelegate>
///类型
@property (nonatomic,assign) DressUpShopListType type;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,189 @@
//
// XPDressUpShopCardViewController.m
// xplan-ios
//
// Created by GreenLand on 2022/7/29.
//
#import "XPDressUpShopCardViewController.h"
///Third
#import <Masonry/Masonry.h>
///Tool
#import "XPMacro.h"
///View
#import "XPMineDressEmptyTableViewCell.h"
#import "XPDressUpShopCardTableViewCell.h"
///P
#import "XPDressUpShopPresenter.h"
///Model
#import "NobleCardModel.h"
@interface XPDressUpShopCardViewController ()<UITableViewDelegate, UITableViewDataSource, XPDressUpShopProtocol, XPDressUpShopCardTableViewCellDelegate>
///
@property (nonatomic,strong) UITableView *tableView;
///
@property (nonatomic,strong) NSArray *datasource;
@end
@implementation XPDressUpShopCardViewController
- (XPDressUpShopPresenter *)createPresenter {
return [[XPDressUpShopPresenter alloc] init];
}
- (void)viewDidLoad {
[super viewDidLoad];
[self initSubViews];
[self initSubViewConstraints];
}
#pragma mark - Private Method
- (void)initSubViews {
[self.view addSubview:self.tableView];
}
- (void)initSubViewConstraints {
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.view);
}];
}
#pragma mark - XPDressUpShopCardTableViewCellDelegate
///
- (void)xPDressUpShopCardTableViewCellSendDress:(XPDressUpShopCardTableViewCell *)view dressId:(NSString *)dressId {
}
///
- (void)xPDressUpShopCardTableViewCellBuyDress:(XPDressUpShopCardTableViewCell *)view dressId:(NSString *)dressId {
[self.presenter buyDressUp:self.type dressId:dressId];
}
#pragma mark - XPMineDressUpProtocol
- (void)getShopListSuccess:(NSArray *)array type:(DressUpShopListType)type {
if (type == self.type) {
self.datasource = array;
[self.tableView reloadData];
}
}
///
- (void)buyShopDressSuccessWithType:(DressUpShopListType)type {
if (type == self.type) {
[self showSuccessToast:@"购买成功"];
[[NSNotificationCenter defaultCenter] postNotificationName:@"buyDressSuccessNoti" object:nil];
}
}
- (void)getUserHeadwearListSuccess:(NSArray *)array {
self.datasource = array;
[self.tableView reloadData];
}
- (void)getUserCarListSuccess:(NSArray *)array {
self.datasource = array;
[self.tableView reloadData];
}
- (void)getUserNameplateListSuccess:(NSArray *)array {
self.datasource = array;
[self.tableView reloadData];
}
- (void)getUserNobleCardListSuccess:(NSArray *)array {
self.datasource = array;
[self.tableView reloadData];
}
- (void)useHeadwearSuccess:(NSString *)headWearId {
// [self.presenter getUserHeadwearList];
[self showSuccessToast:headWearId.integerValue == 0 ? @"取消使用头饰成功" : @"头饰使用成功"];
}
- (void)useCarSuccess:(NSString *)carId {
// [self.presenter getUserCarList];
[self showSuccessToast:carId.integerValue == 0 ? @"取消使用座驾成功" : @"座驾使用成功"];
}
- (void)useNameplateSuccess:(NSString *)nameplateId {
// [self.presenter getUserNameplateList];
[self showSuccessToast:nameplateId.integerValue == 0 ? @"取消使用铭牌成功" : @"铭牌使用成功"];
}
- (void)userNobleCardSuccess:(NSString *)nobleCardId {
[self showSuccessToast:nobleCardId.integerValue == 0 ? @"取消使用资料卡成功" : @"资料卡使用成功"];
if (nobleCardId.integerValue == 0) {
for (NobleCardModel *model in self.datasource) {
model.used = NO;
}
} else {
for (NobleCardModel *model in self.datasource) {
if ([model.cardId isEqualToString:nobleCardId]) {
model.used = YES;
} else {
model.used = NO;
}
}
}
[self.tableView reloadData];
}
#pragma mark - JXCategoryListContentViewDelegate
- (UIView *)listView {
return self.view;
}
#pragma mark - UITableViewDelegate And UITableViewDataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.datasource.count > 0 ? self.datasource.count : 1;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return self.datasource.count > 0 ? 280 : (KScreenHeight - kNavigationHeight - 100 -50);
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if (self.datasource.count > 0) {
XPDressUpShopCardTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPDressUpShopCardTableViewCell class])];
if (cell == nil) {
cell = [[XPDressUpShopCardTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPDressUpShopCardTableViewCell class])];
}
cell.nobleCardModel = [self.datasource objectAtIndex:indexPath.row];
cell.delegate = self;
return cell;
}
XPMineDressEmptyTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineDressEmptyTableViewCell class])];
if (cell == nil) {
cell = [[XPMineDressEmptyTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPMineDressEmptyTableViewCell class])];
}
cell.emptyTitle = @"暂无资料卡";
return cell;
}
#pragma mark - Getters And Setters
- (void)setType:(DressUpShopListType)type {
_type = type;
[self.presenter getDressUpShopList:type];
}
- (UITableView *)tableView {
if (!_tableView) {
_tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
_tableView.delegate = self;
_tableView.dataSource = self;
_tableView.tableFooterView = [UIView new];
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
_tableView.backgroundColor = [UIColor clearColor];
if (@available(iOS 11.0, *)) {
_tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}
_tableView.contentInset = UIEdgeInsetsMake(0, 0, kSafeAreaBottomHeight, 0);
[_tableView registerClass:[XPDressUpShopCardTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPDressUpShopCardTableViewCell class])];
[_tableView registerClass:[XPMineDressEmptyTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPMineDressEmptyTableViewCell class])];
}
return _tableView;
}
@end

View File

@@ -0,0 +1,21 @@
//
// XPDressUpShopListViewController.h
// xplan-ios
//
// Created by GreenLand on 2022/7/28.
//
#import "MvpViewController.h"
#import <JXCategoryView/JXCategoryListContainerView.h>
#import "XPDressUpShopProtocol.h"
NS_ASSUME_NONNULL_BEGIN
@interface XPDressUpShopListViewController : MvpViewController<JXCategoryListContentViewDelegate>
///类型
@property (nonatomic,assign) DressUpShopListType type;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,215 @@
//
// XPDressUpShopListViewController.m
// xplan-ios
//
// Created by GreenLand on 2022/7/28.
//
#import "XPDressUpShopListViewController.h"
///Third
#import <Masonry/Masonry.h>
///Tool
#import "XPMacro.h"
///View
#import "XPMineDressEmptyCollectionViewCell.h"
#import "XPDressUpShopCollectionViewCell.h"
///P
#import "XPDressUpShopPresenter.h"
///Model
#import "NobleCardModel.h"
@interface XPDressUpShopListViewController ()<UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout, XPDressUpShopProtocol, XPDressUpShopCollectionViewCellDelegate>
///
@property (nonatomic,strong) UICollectionView *collectionView;
///
@property (nonatomic,strong) NSArray *datasource;
@end
@implementation XPDressUpShopListViewController
- (XPDressUpShopPresenter *)createPresenter {
return [[XPDressUpShopPresenter alloc] init];
}
- (void)viewDidLoad {
[super viewDidLoad];
[self initSubViews];
[self initSubViewConstraints];
}
#pragma mark - Private Method
- (void)initSubViews {
[self.view addSubview:self.collectionView];
}
- (void)initSubViewConstraints {
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.view);
}];
}
#pragma mark - XPDressUpShopCollectionViewCellDelegate
- (void)xPDressUpShopCollectionViewCellSendDress:(XPDressUpShopCollectionViewCell *)view dressId:(NSString *)dressId {
}
- (void)xPDressUpShopCollectionViewCellBuyDress:(XPDressUpShopCollectionViewCell *)view dressId:(NSString *)dressId {
[self.presenter buyDressUp:self.type dressId:dressId];
}
#pragma mark - XPMineDressUpProtocol
- (void)getShopListSuccess:(NSArray *)array type:(DressUpShopListType)type {
if (type == self.type) {
self.datasource = array;
[self.collectionView reloadData];
}
}
///
- (void)buyShopDressSuccessWithType:(DressUpShopListType)type {
if (type == self.type) {
[self showSuccessToast:@"购买成功"];
[[NSNotificationCenter defaultCenter] postNotificationName:@"buyDressSuccessNoti" object:nil];
}
}
- (void)getUserHeadwearListSuccess:(NSArray *)array {
self.datasource = array;
[self.collectionView reloadData];
}
- (void)getUserCarListSuccess:(NSArray *)array {
self.datasource = array;
[self.collectionView reloadData];
}
- (void)getUserNameplateListSuccess:(NSArray *)array {
self.datasource = array;
[self.collectionView reloadData];
}
- (void)getUserNobleCardListSuccess:(NSArray *)array {
self.datasource = array;
[self.collectionView reloadData];
}
- (void)useHeadwearSuccess:(NSString *)headWearId {
// [self.presenter getUserHeadwearList];
[self showSuccessToast:headWearId.integerValue == 0 ? @"取消使用头饰成功" : @"头饰使用成功"];
}
- (void)useCarSuccess:(NSString *)carId {
// [self.presenter getUserCarList];
[self showSuccessToast:carId.integerValue == 0 ? @"取消使用座驾成功" : @"座驾使用成功"];
}
- (void)useNameplateSuccess:(NSString *)nameplateId {
// [self.presenter getUserNameplateList];
[self showSuccessToast:nameplateId.integerValue == 0 ? @"取消使用铭牌成功" : @"铭牌使用成功"];
}
- (void)userNobleCardSuccess:(NSString *)nobleCardId {
[self showSuccessToast:nobleCardId.integerValue == 0 ? @"取消使用资料卡成功" : @"资料卡使用成功"];
if (nobleCardId.integerValue == 0) {
for (NobleCardModel *model in self.datasource) {
model.used = NO;
}
} else {
for (NobleCardModel *model in self.datasource) {
if ([model.cardId isEqualToString:nobleCardId]) {
model.used = YES;
} else {
model.used = NO;
}
}
}
[self.collectionView reloadData];
}
#pragma mark - JXCategoryListContentViewDelegate
- (UIView *)listView {
return self.view;
}
#pragma mark - UICollectionViewDelegate
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
return self.datasource.count > 0 ? self.datasource.count : 1;
}
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
if (self.datasource.count > 0) {
XPDressUpShopCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPDressUpShopCollectionViewCell class]) forIndexPath:indexPath];
cell.dressUpModel = [self.datasource objectAtIndex:indexPath.row];
cell.delegate = self;
return cell;
}
XPMineDressEmptyCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPMineDressEmptyCollectionViewCell class]) forIndexPath:indexPath];
cell.emptyTitle = self.type == DressUpShopListType_HeadWear ? @"暂无头饰" : self.type == DressUpShopListType_Car ? @"暂无座驾" : self.type == DressUpShopListType_Nameplate ? @"暂无铭牌" : @"暂无聊天气泡";
return cell;
}
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
if (self.datasource.count > 0) {
CGFloat width = (KScreenWidth - 42) *0.5;
return CGSizeMake(width, 188);
} else {
return CGSizeMake(KScreenWidth - 32, KScreenHeight - kNavigationHeight - 100 -50);
}
}
- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section {
if (self.datasource.count > 0) {
return 12;
} else {
return 0;
}
}
- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section {
if (self.datasource.count > 0) {
return 12;
} else {
return 0;
}
}
#pragma mark - Getters And Setters
- (void)setType:(DressUpShopListType)type {
_type = type;
switch (type) {
case DressUpShopListType_HeadWear:
[self.presenter getDressUpShopList:DressUpShopListType_HeadWear];
break;
case DressUpShopListType_Car:
[self.presenter getDressUpShopList:DressUpShopListType_Car];
break;
case DressUpShopListType_Nameplate:
[self.presenter getDressUpShopList:DressUpShopListType_Nameplate];
break;
case DressUpShopListType_Bubble:
[self.presenter getDressUpShopList:DressUpShopListType_Bubble];
break;
default:
break;
}
}
- (UICollectionView *)collectionView {
if (!_collectionView) {
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
layout.scrollDirection = UICollectionViewScrollDirectionVertical;
layout.sectionInset = UIEdgeInsetsMake(15, 15, 15, 15);
_collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
_collectionView.dataSource = self;
_collectionView.delegate = self;
_collectionView.backgroundColor = [UIColor clearColor];
[_collectionView registerClass:[XPDressUpShopCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([XPDressUpShopCollectionViewCell class])];
[_collectionView registerClass:[XPMineDressEmptyCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([XPMineDressEmptyCollectionViewCell class])];
}
return _collectionView;
}
@end

View File

@@ -0,0 +1,19 @@
//
// XPDressUpShopViewController.h
// xplan-ios
//
// Created by GreenLand on 2022/7/28.
//
#import "BaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface XPDressUpShopViewController : BaseViewController
///当前的index @[@"头饰", @"座驾", @"铭牌", @"资料卡", @"聊天气泡"]
@property (nonatomic,assign) NSInteger currentIndex;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,381 @@
//
// XPDressUpShopViewController.m
// xplan-ios
//
// Created by GreenLand on 2022/7/28.
//
#import "XPDressUpShopViewController.h"
///Third
#import <Masonry/Masonry.h>
#import <JXCategoryView/JXCategoryView.h>
#import <JXCategoryView/JXCategoryListContainerView.h>
#import <SDCycleScrollView/SDCycleScrollView.h>
///Tool
#import "ThemeColor.h"
#import "Api+DressUp.h"
#import "XPMacro.h"
#import "UIImage+Utils.h"
#import "AccountInfoStorage.h"
///Model
#import "ActivityInfoModel.h"
#import "WalletInfoModel.h"
///View
#import "XPDressUpShopListViewController.h"
#import "XPRoomViewController.h"
#import "XPWebViewController.h"
#import "XPMineDressUpViewController.h"
#import "XPDressUpShopCardViewController.h"
#import "XPMineRechargeViewController.h"
@interface XPDressUpShopViewController ()<JXCategoryViewDelegate, JXCategoryListContainerViewDelegate, SDCycleScrollViewDelegate>
///
@property (nonatomic, strong) NSArray<NSString *> *titles;
///
@property (nonatomic, strong) JXCategoryTitleView *titleView;
///lineView
@property (nonatomic, strong) JXCategoryListContainerView *contentView;
///
@property (nonatomic,strong) XPDressUpShopListViewController *headwearView;
///
@property (nonatomic,strong) XPDressUpShopListViewController *carView;
///
@property (nonatomic,strong) XPDressUpShopListViewController *nameplateView;
///
@property (nonatomic, strong) XPDressUpShopCardViewController *nobleView;
///
@property (nonatomic, strong) XPDressUpShopListViewController *bubbleView;
///
@property (nonatomic,strong) SDCycleScrollView *cycleScrollView;
///
@property (nonatomic,copy) NSArray<ActivityInfoModel *> *activityList;
///view
@property (nonatomic, strong) UIView *mainView;
///
@property (nonatomic, strong) UILabel *titleLabel;
///
@property (nonatomic, strong) UIImageView *diamondImageView;
///
@property (nonatomic, strong) UILabel *diamondLabel;
///
@property (nonatomic, strong) UIButton *sendButton;
@end
@implementation XPDressUpShopViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self requestActivityList];
[self requestWallet];
[self initSubViews];
[self initSubViewConstraints];
[self addNavigationItemWithTitles:@[@"我的装扮"] titleColor:[ThemeColor textThirdColor] isLeft:NO target:self action:@selector(rightButtonAction:) tags:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(buyDressSuccess) name:@"buyDressSuccessNoti" object:nil];
}
#pragma mark - Private Method
- (void)initSubViews {
self.title = @"装扮商城";
[self.view addSubview:self.cycleScrollView];
[self.view addSubview:self.titleView];
[self.view addSubview:self.contentView];
[self.view addSubview:self.mainView];
[self.mainView addSubview:self.titleLabel];
[self.mainView addSubview:self.diamondImageView];
[self.mainView addSubview:self.diamondLabel];
[self.mainView addSubview:self.sendButton];
}
- (void)initSubViewConstraints {
[self.cycleScrollView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.view);
make.left.mas_equalTo(15);
make.right.mas_equalTo(-15);
make.height.mas_equalTo(100);
}];
[self.titleView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.mas_equalTo(self.view);
make.height.mas_equalTo(50);
make.top.mas_equalTo(self.cycleScrollView.mas_bottom);
}];
[self.contentView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.mas_equalTo(self.view);
make.bottom.mas_equalTo(self.mainView.mas_top);
make.top.mas_equalTo(self.titleView.mas_bottom);
}];
[self.mainView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.bottom.mas_equalTo(self.view);
make.height.mas_equalTo(iPhoneXSeries ? 48+34 : 48);
}];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.diamondImageView.mas_right).mas_offset(4);
make.centerY.mas_equalTo(self.diamondImageView);
make.height.mas_equalTo(17);
}];
[self.diamondImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(15);
make.size.mas_equalTo(CGSizeMake(15, 15));
make.top.mas_equalTo(18);
}];
[self.diamondLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self.titleLabel);
make.left.mas_equalTo(self.titleLabel.mas_right).mas_offset(4);
make.height.mas_equalTo(22);
}];
[self.sendButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(72, 24));
make.right.mas_equalTo(-15);
make.centerY.mas_equalTo(self.titleLabel);
}];
}
#pragma mark - notification
- (void)buyDressSuccess {
[self requestWallet];
}
- (void)requestWallet {
NSString * uid = [AccountInfoStorage instance].getUid;
NSString * ticket = [AccountInfoStorage instance].getTicket;
[Api getUserWalletInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
if (code == 200) {
WalletInfoModel * model = [WalletInfoModel modelWithDictionary:data.data];
self.diamondLabel.text = model.diamonds;
}
} uid:uid ticket:ticket];
}
- (void)requestActivityList {
[Api dressupBannerList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
if (code == 200) {
NSArray <ActivityInfoModel *>* array = [ActivityInfoModel modelsWithArray:data.data];
if (array.count <= 0) {
[self.cycleScrollView mas_updateConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(0);
}];
return;
}
self.activityList = array;
NSMutableArray * picList = [NSMutableArray array];
[array enumerateObjectsUsingBlock:^(ActivityInfoModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
if (obj.bannerPic.length > 0) {
[picList addObject:obj.bannerPic];
}
}];
self.cycleScrollView.imageURLStringsGroup = picList;
if (array.count > 1) {
[self.cycleScrollView setAutoScroll:YES];
self.cycleScrollView.autoScrollTimeInterval = 3;
} else {
[self.cycleScrollView setAutoScroll:NO];
}
} else {
[self.cycleScrollView mas_updateConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(0);
}];
}
} type:@"3"];
}
- (void)rightButtonAction:(UIButton *)sender {
XPMineDressUpViewController *vc = [[XPMineDressUpViewController alloc] init];
[self.navigationController pushViewController:vc animated:YES];
}
#pragma mark - JXCategoryViewDelegate
- (NSInteger)numberOfListsInlistContainerView:(JXCategoryListContainerView *)listContainerView {
return self.titles.count;
}
- (id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index {
if (index == 0) {
return self.headwearView;
} else if(index == 1) {
return self.carView;
} else if (index == 2) {
return self.nameplateView;
} else if (index == 3) {
return self.nobleView;
}
return self.bubbleView;
}
//
- (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index {
//
self.navigationController.interactivePopGestureRecognizer.enabled = (index == 0);
}
#pragma mark - SDCycleScrollViewDelegate
- (void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didSelectItemAtIndex:(NSInteger)index {
if (self.activityList.count > index) {
ActivityInfoModel * info = [self.activityList objectAtIndex:index];
if (info.skipType == ActivitySkipType_Room) {
[XPRoomViewController openRoom:info.skipUri viewController:self.navigationController];
} else if(info.skipType == ActivitySkipType_Web) {
XPWebViewController * webVC = [[XPWebViewController alloc] init];
webVC.url = info.skipUri;
[self.navigationController pushViewController:webVC animated:YES];
}
}
}
- (void)rechargeButtonAction:(UIButton *)sender {
XPMineRechargeViewController *vc = [[XPMineRechargeViewController alloc] init];
[self.navigationController pushViewController:vc animated:YES];
}
#pragma mark - Getters And Setters
- (void)setCurrentIndex:(NSInteger)currentIndex {
if (currentIndex < self.titles.count) {
[self.titleView setDefaultSelectedIndex:currentIndex];
}
}
- (JXCategoryTitleView *)titleView {
if (!_titleView) {
_titleView = [[JXCategoryTitleView alloc] init];
_titleView.delegate = self;
_titleView.titles = self.titles;
_titleView.titleColor = [ThemeColor secondTextColor];
_titleView.titleSelectedColor = [ThemeColor mainTextColor];
_titleView.titleFont = [UIFont fontWithName:@"PingFang-SC-Medium" size:16];
_titleView.titleSelectedFont = [UIFont fontWithName:@"PingFang-SC-Medium" size:16];
_titleView.titleLabelAnchorPointStyle = JXCategoryTitleLabelAnchorPointStyleCenter;
_titleView.contentScrollViewClickTransitionAnimationEnabled = NO;
_titleView.defaultSelectedIndex = 0;
_titleView.listContainer = self.contentView;
JXCategoryIndicatorLineView *lineView = [[JXCategoryIndicatorLineView alloc] init];
lineView.indicatorColor = [ThemeColor appMainColor];
lineView.indicatorWidth = 8.f;
lineView.indicatorHeight = 4.f;
lineView.indicatorCornerRadius = 2.f;
_titleView.indicators = @[lineView];
}
return _titleView;
}
- (JXCategoryListContainerView *)contentView {
if (!_contentView) {
_contentView = [[JXCategoryListContainerView alloc] initWithType:JXCategoryListContainerType_ScrollView delegate:self];
_contentView.scrollView.backgroundColor = [UIColor clearColor];
_contentView.defaultSelectedIndex = 0;
}
return _contentView;
}
- (NSArray<NSString *> *)titles {
return @[@"头饰", @"座驾", @"铭牌", @"资料卡", @"聊天气泡"];
}
- (XPDressUpShopListViewController *)headwearView {
if (!_headwearView) {
_headwearView = [[XPDressUpShopListViewController alloc] init];
_headwearView.type = DressUpShopListType_HeadWear;
}
return _headwearView;
}
- (XPDressUpShopListViewController *)carView {
if (!_carView) {
_carView = [[XPDressUpShopListViewController alloc] init];
_carView.type = DressUpShopListType_Car;
}
return _carView;
}
- (XPDressUpShopListViewController *)nameplateView {
if (!_nameplateView) {
_nameplateView = [[XPDressUpShopListViewController alloc] init];
_nameplateView.type = DressUpShopListType_Nameplate;
}
return _nameplateView;
}
- (XPDressUpShopCardViewController *)nobleView {
if (!_nobleView) {
_nobleView = [[XPDressUpShopCardViewController alloc] init];
_nobleView.type = DressUpShopListType_Noble;
}
return _nobleView;
}
- (XPDressUpShopListViewController *)bubbleView {
if (!_bubbleView) {
_bubbleView = [[XPDressUpShopListViewController alloc] init];
_bubbleView.type = DressUpShopListType_Bubble;
}
return _bubbleView;
}
- (SDCycleScrollView *)cycleScrollView {
if (!_cycleScrollView) {
_cycleScrollView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectZero delegate:self placeholderImage:nil];
_cycleScrollView.pageControlAliment = SDCycleScrollViewPageContolAlimentCenter;
_cycleScrollView.currentPageDotColor = [UIColor whiteColor];
_cycleScrollView.pageDotColor = [UIColor colorWithWhite:1 alpha:0.15];
_cycleScrollView.backgroundColor = [UIColor colorWithWhite:1 alpha:0.00];
_cycleScrollView.bannerImageViewContentMode = UIViewContentModeScaleAspectFill;
_cycleScrollView.layer.masksToBounds = YES;
_cycleScrollView.layer.cornerRadius = 12;
}
return _cycleScrollView;
}
- (UIView *)mainView {
if (!_mainView) {
_mainView = [[UIView alloc] init];
_mainView.backgroundColor = [UIColor whiteColor];
}
return _mainView;
}
- (UILabel *)titleLabel {
if (!_titleLabel) {
_titleLabel = [[UILabel alloc] init];
_titleLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightBold];
_titleLabel.textColor = [ThemeColor textThirdColor];
_titleLabel.text = @"我的钻石";
}
return _titleLabel;
}
- (UIImageView *)diamondImageView {
if (!_diamondImageView) {
_diamondImageView = [[UIImageView alloc] init];
_diamondImageView.image = [UIImage imageNamed:@"common_diamond"];
}
return _diamondImageView;
}
- (UILabel *)diamondLabel {
if (!_diamondLabel) {
_diamondLabel = [[UILabel alloc] init];
_diamondLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightBold];
_diamondLabel.textColor = UIColorFromRGB(0xFFBC51);
}
return _diamondLabel;
}
- (UIButton *)sendButton {
if (!_sendButton) {
_sendButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_sendButton setTitle:@"充值" forState:UIControlStateNormal];
[_sendButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[_sendButton addTarget:self action:@selector(rechargeButtonAction:) forControlEvents:UIControlEventTouchUpInside];
_sendButton.layer.masksToBounds = YES;
_sendButton.layer.cornerRadius = 24/2;
_sendButton.titleLabel.font = [UIFont systemFontOfSize:12];
[_sendButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[[ThemeColor confirmButtonGradientStartColor], [ThemeColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal];
}
return _sendButton;
}
@end

View File

@@ -48,6 +48,7 @@
#import "XPWebViewController.h" #import "XPWebViewController.h"
#import "XPRoomViewController.h" #import "XPRoomViewController.h"
#import "XPMineDressUpViewController.h" #import "XPMineDressUpViewController.h"
#import "XPDressUpShopViewController.h"
#import "XPMineFansViewController.h" #import "XPMineFansViewController.h"
#import "XPMineAttentionViewController.h" #import "XPMineAttentionViewController.h"
#import "XPNobleCenterViewController.h" #import "XPNobleCenterViewController.h"
@@ -116,11 +117,11 @@
- (void)viewWillAppear:(BOOL)animated { - (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated]; [super viewWillAppear:animated];
[self.presenter getUserInfo];
} }
- (void)viewDidAppear:(BOOL)animated { - (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated]; [super viewDidAppear:animated];
[self.presenter getUserInfo];
[self.presenter getUserWalletInfo]; [self.presenter getUserWalletInfo];
[self.presenter getPersonItemList]; [self.presenter getPersonItemList];
[self.presenter getClanDetailInfo]; [self.presenter getClanDetailInfo];
@@ -230,6 +231,12 @@
[self.navigationController pushViewController:dressUpVC animated:YES]; [self.navigationController pushViewController:dressUpVC animated:YES];
} }
break; break;
case XPMineItemType_DressUp_Market:
{
XPDressUpShopViewController *dressUpShopVc = [[XPDressUpShopViewController alloc] init];
[self.navigationController pushViewController:dressUpShopVc animated:YES];
}
break;
case XPMineItemType_Fans_List: case XPMineItemType_Fans_List:
{ {
XPMineFansViewController * fansVC = [[XPMineFansViewController alloc] init]; XPMineFansViewController * fansVC = [[XPMineFansViewController alloc] init];