diff --git a/xplan-ios.xcodeproj/project.pbxproj b/xplan-ios.xcodeproj/project.pbxproj index 659db7f6..f25930bd 100644 --- a/xplan-ios.xcodeproj/project.pbxproj +++ b/xplan-ios.xcodeproj/project.pbxproj @@ -171,6 +171,10 @@ 9B6E856E281AABAB0041A321 /* XPRoomRecommendModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B6E856D281AABAB0041A321 /* XPRoomRecommendModel.m */; }; 9B6E8573281AB9B20041A321 /* XPRoomInsideRecommendCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B6E8572281AB9B20041A321 /* XPRoomInsideRecommendCell.m */; }; 9B6E8577281ABECC0041A321 /* XPRoomInsideRecommendEmptyCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B6E8576281ABECC0041A321 /* XPRoomInsideRecommendEmptyCell.m */; }; + 9B734F73288A787000CBDAA9 /* XPMineAccountView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B734F72288A787000CBDAA9 /* XPMineAccountView.m */; }; + 9B734F76288A92FB00CBDAA9 /* XPMineFuntionItemModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B734F75288A92FB00CBDAA9 /* XPMineFuntionItemModel.m */; }; + 9B734F79288A9C4B00CBDAA9 /* XPMineGameTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B734F78288A9C4B00CBDAA9 /* XPMineGameTableViewCell.m */; }; + 9B734F7C288AB05A00CBDAA9 /* XPMIneGameCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B734F7B288AB05A00CBDAA9 /* XPMIneGameCollectionViewCell.m */; }; 9B73CD05279A9A6A006AF255 /* XPSkillCardSaveModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B73CD04279A9A6A006AF255 /* XPSkillCardSaveModel.m */; }; 9B73CD09279A9AA2006AF255 /* XPSkillCardUpdatePropModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B73CD08279A9AA2006AF255 /* XPSkillCardUpdatePropModel.m */; }; 9B73CD11279AE99B006AF255 /* XPSkillCardListCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B73CD10279AE99B006AF255 /* XPSkillCardListCell.m */; }; @@ -194,7 +198,6 @@ 9B86D8802817F4A300494FCD /* XPNobleSettingNavView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B86D87F2817F4A300494FCD /* XPNobleSettingNavView.m */; }; 9B86D88328192DC000494FCD /* XPRoomRankEntranceView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B86D88228192DC000494FCD /* XPRoomRankEntranceView.m */; }; 9B86D886281942D200494FCD /* SocialMicroView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B86D885281942D200494FCD /* SocialMicroView.m */; }; - 9B92A3392797BE4500AD168F /* XPMineSkillTipView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B92A3382797BE4500AD168F /* XPMineSkillTipView.m */; }; 9B92A33C2797E38100AD168F /* XPMineHeadItemTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B92A33B2797E38100AD168F /* XPMineHeadItemTableViewCell.m */; }; 9B92A3442797EE6500AD168F /* XPMatchManagePresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B92A3432797EE6500AD168F /* XPMatchManagePresenter.m */; }; 9B92A3472797EECD00AD168F /* XPMatchManageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B92A3462797EECD00AD168F /* XPMatchManageViewController.m */; }; @@ -1198,6 +1201,14 @@ 9B6E8572281AB9B20041A321 /* XPRoomInsideRecommendCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomInsideRecommendCell.m; sourceTree = ""; }; 9B6E8575281ABECC0041A321 /* XPRoomInsideRecommendEmptyCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomInsideRecommendEmptyCell.h; sourceTree = ""; }; 9B6E8576281ABECC0041A321 /* XPRoomInsideRecommendEmptyCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomInsideRecommendEmptyCell.m; sourceTree = ""; }; + 9B734F71288A787000CBDAA9 /* XPMineAccountView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineAccountView.h; sourceTree = ""; }; + 9B734F72288A787000CBDAA9 /* XPMineAccountView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineAccountView.m; sourceTree = ""; }; + 9B734F74288A92FB00CBDAA9 /* XPMineFuntionItemModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineFuntionItemModel.h; sourceTree = ""; }; + 9B734F75288A92FB00CBDAA9 /* XPMineFuntionItemModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineFuntionItemModel.m; sourceTree = ""; }; + 9B734F77288A9C4B00CBDAA9 /* XPMineGameTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineGameTableViewCell.h; sourceTree = ""; }; + 9B734F78288A9C4B00CBDAA9 /* XPMineGameTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineGameTableViewCell.m; sourceTree = ""; }; + 9B734F7A288AB05A00CBDAA9 /* XPMIneGameCollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMIneGameCollectionViewCell.h; sourceTree = ""; }; + 9B734F7B288AB05A00CBDAA9 /* XPMIneGameCollectionViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMIneGameCollectionViewCell.m; sourceTree = ""; }; 9B73CD03279A9A6A006AF255 /* XPSkillCardSaveModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPSkillCardSaveModel.h; sourceTree = ""; }; 9B73CD04279A9A6A006AF255 /* XPSkillCardSaveModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPSkillCardSaveModel.m; sourceTree = ""; }; 9B73CD07279A9AA2006AF255 /* XPSkillCardUpdatePropModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPSkillCardUpdatePropModel.h; sourceTree = ""; }; @@ -1243,8 +1254,6 @@ 9B86D88228192DC000494FCD /* XPRoomRankEntranceView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomRankEntranceView.m; sourceTree = ""; }; 9B86D884281942D200494FCD /* SocialMicroView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SocialMicroView.h; sourceTree = ""; }; 9B86D885281942D200494FCD /* SocialMicroView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SocialMicroView.m; sourceTree = ""; }; - 9B92A3372797BE4500AD168F /* XPMineSkillTipView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineSkillTipView.h; sourceTree = ""; }; - 9B92A3382797BE4500AD168F /* XPMineSkillTipView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineSkillTipView.m; sourceTree = ""; }; 9B92A33A2797E38100AD168F /* XPMineHeadItemTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineHeadItemTableViewCell.h; sourceTree = ""; }; 9B92A33B2797E38100AD168F /* XPMineHeadItemTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineHeadItemTableViewCell.m; sourceTree = ""; }; 9B92A3412797EE1200AD168F /* XPMatchManageProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMatchManageProtocol.h; sourceTree = ""; }; @@ -6657,6 +6666,8 @@ E8AC723926F49AAE007D6E91 /* XPMineNotifyStatus.m */, E8EEB90A26FC5EBC007C6EBA /* XPMineUserInfoEditModel.h */, E8EEB90B26FC5EBC007C6EBA /* XPMineUserInfoEditModel.m */, + 9B734F74288A92FB00CBDAA9 /* XPMineFuntionItemModel.h */, + 9B734F75288A92FB00CBDAA9 /* XPMineFuntionItemModel.m */, ); path = Model; sourceTree = ""; @@ -6787,14 +6798,14 @@ E8E70D8226F2F51A00F03460 /* XPMineHeadView.m */, E896EFB02771C93B00AD2CC1 /* XPMineFriendNumberView.h */, E896EFB12771C93B00AD2CC1 /* XPMineFriendNumberView.m */, + 9B734F71288A787000CBDAA9 /* XPMineAccountView.h */, + 9B734F72288A787000CBDAA9 /* XPMineAccountView.m */, E824544126F58FCE00BE8163 /* XPMinePayPwdInputView.h */, E824544226F58FCE00BE8163 /* XPMinePayPwdInputView.m */, E824544C26F5BC1A00BE8163 /* XPMineModifPayPwdView.h */, E824544D26F5BC1A00BE8163 /* XPMineModifPayPwdView.m */, E824545726F5E65900BE8163 /* XPMineVerifIdentityView.h */, E824545826F5E65900BE8163 /* XPMineVerifIdentityView.m */, - 9B92A3372797BE4500AD168F /* XPMineSkillTipView.h */, - 9B92A3382797BE4500AD168F /* XPMineSkillTipView.m */, ); path = SubViews; sourceTree = ""; @@ -6819,6 +6830,10 @@ 9B92A33B2797E38100AD168F /* XPMineHeadItemTableViewCell.m */, E8E20BED2816A5FC0033B688 /* XPMineBlackListTableViewCell.h */, E8E20BEE2816A5FC0033B688 /* XPMineBlackListTableViewCell.m */, + 9B734F77288A9C4B00CBDAA9 /* XPMineGameTableViewCell.h */, + 9B734F78288A9C4B00CBDAA9 /* XPMineGameTableViewCell.m */, + 9B734F7A288AB05A00CBDAA9 /* XPMIneGameCollectionViewCell.h */, + 9B734F7B288AB05A00CBDAA9 /* XPMIneGameCollectionViewCell.m */, ); path = Cell; sourceTree = ""; @@ -7416,6 +7431,7 @@ E8788950273A699900BF1D57 /* ThemeColor+SendGift.m in Sources */, E81C279D26EEEC620031E639 /* XPConstant.m in Sources */, 9B92A36D2798179B00AD168F /* XPSkillCardTypeCollectionViewCell.m in Sources */, + 9B734F73288A787000CBDAA9 /* XPMineAccountView.m in Sources */, E8AA6EF227DF1E97009B4C2B /* XPRoomTopicPresenter.m in Sources */, 187EEEFE26E8A82C002833B2 /* NSObject+AutoCoding.m in Sources */, E873EB0C2809850D0071030D /* MessageContentCustomView.m in Sources */, @@ -7505,12 +7521,12 @@ E8834E562800585A0029CCC1 /* XPGuildManagerPerPresenter.m in Sources */, E880B3AC278BD98600A83B0D /* XPAcrossRoomPKEmptyTableViewCell.m in Sources */, 18486235271EB794005FC5DC /* AgoraRtcImpl.m in Sources */, - 9B92A3392797BE4500AD168F /* XPMineSkillTipView.m in Sources */, E8A1E454276208E500B294CA /* CandyTreeInfoModel.m in Sources */, E8C1CD7A27D8B29E00376F83 /* RoomFaceInfoModel.m in Sources */, E81C1B1C27705F6B0020D1E4 /* XPArrangeMicPresenter.m in Sources */, 184862CE27213FD7005FC5DC /* ZegoRtcImpl.m in Sources */, E8A88D2727E8193400CA8837 /* XPRoomPKSelectUserView.m in Sources */, + 9B734F7C288AB05A00CBDAA9 /* XPMIneGameCollectionViewCell.m in Sources */, 9B0E1C5926E77022005D4442 /* BaseNavigationController.m in Sources */, E8664ED927E4355C000171BA /* XPRoomPKRecordTableViewCell.m in Sources */, E8C6FFD027548256004DC9F0 /* XPHomeListCollectionViewCell.m in Sources */, @@ -7604,6 +7620,7 @@ E8DBB70127B6501200AA285D /* XPLittleGameMiniStageView.m in Sources */, E851E46227FF1314002F3ACB /* XPMineGuildEmptyTableViewCell.m in Sources */, E8834E3B280012B60029CCC1 /* XPMineGuildRemoveMemberViewController.m in Sources */, + 9B734F79288A9C4B00CBDAA9 /* XPMineGameTableViewCell.m in Sources */, E8664EDC27E43632000171BA /* XPRoomPKEmptyTableViewCell.m in Sources */, E880B3A9278BD82300A83B0D /* AcrossRoomPKInfoModel.m in Sources */, E82D5C7A276B25D100858D6D /* SpriteSheetImageManager.m in Sources */, @@ -7638,6 +7655,7 @@ E8E20BDE28164D3A0033B688 /* SessionNavView.m in Sources */, E8E859CE28264C2300EE4857 /* HTTPAuthenticationRequest.m in Sources */, 9B92A3442797EE6500AD168F /* XPMatchManagePresenter.m in Sources */, + 9B734F76288A92FB00CBDAA9 /* XPMineFuntionItemModel.m in Sources */, E88B5CBD26FB3BDF00DA9178 /* XPTeenagerAlertView.m in Sources */, 9B86D87D2817EA0900494FCD /* XPNobleSettingViewController.m in Sources */, E82D5C70276AE60000858D6D /* HeadwearModel.m in Sources */, diff --git a/xplan-ios.xcodeproj/xcshareddata/xcschemes/xplan-ios.xcscheme b/xplan-ios.xcodeproj/xcshareddata/xcschemes/xplan-ios.xcscheme index 51c35fc3..670f098f 100644 --- a/xplan-ios.xcodeproj/xcshareddata/xcschemes/xplan-ios.xcscheme +++ b/xplan-ios.xcodeproj/xcshareddata/xcschemes/xplan-ios.xcscheme @@ -31,7 +31,7 @@ *privatePhoto;//相册 ///签名 diff --git a/xplan-ios/Main/Home/Api/Api+Home.h b/xplan-ios/Main/Home/Api/Api+Home.h index 5978666e..2c1ca844 100644 --- a/xplan-ios/Main/Home/Api/Api+Home.h +++ b/xplan-ios/Main/Home/Api/Api+Home.h @@ -108,7 +108,7 @@ NS_ASSUME_NONNULL_BEGIN /// 快速匹配 /// @param completion 完成 /// @param uid 用户的uid -+ (void)homeQuickMatchLittleGame:(HttpRequestHelperCompletion)completion uid:(NSString *)uid; ++ (void)homeQuickMatchLittleGame:(HttpRequestHelperCompletion)completion uid:(NSString *)uid mgId:(NSString *)mgId; /// 获取首页个播浏览记录 /// @param complection 完成 diff --git a/xplan-ios/Main/Home/Api/Api+Home.m b/xplan-ios/Main/Home/Api/Api+Home.m index 1e010820..fd7df684 100644 --- a/xplan-ios/Main/Home/Api/Api+Home.m +++ b/xplan-ios/Main/Home/Api/Api+Home.m @@ -131,7 +131,7 @@ /// 快速匹配 /// @param completion 完成 /// @param uid 用户的uid -+ (void)homeQuickMatchLittleGame:(HttpRequestHelperCompletion)completion uid:(NSString *)uid { ++ (void)homeQuickMatchLittleGame:(HttpRequestHelperCompletion)completion uid:(NSString *)uid mgId:(NSString *)mgId { [self makeRequest:@"home/fastPick" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, uid, nil]; } diff --git a/xplan-ios/Main/Home/Presenter/XPHomeLittleGamePesenter.m b/xplan-ios/Main/Home/Presenter/XPHomeLittleGamePesenter.m index 5f7d340e..46a87749 100644 --- a/xplan-ios/Main/Home/Presenter/XPHomeLittleGamePesenter.m +++ b/xplan-ios/Main/Home/Presenter/XPHomeLittleGamePesenter.m @@ -32,7 +32,7 @@ HomeLittleGameRoomModel * gameRoom = [HomeLittleGameRoomModel modelWithDictionary:data.data]; NSString * uid = gameRoom.uid; [[self getView] quickMatchLittleGameRoomSuccess:uid]; - } showLoading:YES] uid:uid]; + } showLoading:YES] uid:uid mgId:@""]; } @end diff --git a/xplan-ios/Main/Mine/Api/Api+Mine.h b/xplan-ios/Main/Mine/Api/Api+Mine.h index 9aa33991..227e81c3 100644 --- a/xplan-ios/Main/Mine/Api/Api+Mine.h +++ b/xplan-ios/Main/Mine/Api/Api+Mine.h @@ -10,6 +10,19 @@ NS_ASSUME_NONNULL_BEGIN @interface Api (Mine) + +/// 获取个人中心功能列表 +/// @param completion 完成 +/// @param uid uid ++ (void)requestPersonalFunctionItem:(HttpRequestHelperCompletion)completion + uid:(NSString *)uid; + +/// 获取个人中心banner列表 +/// @param completion 完成 +/// @param uid 用户的uid +/// @param type 类型 10 ++ (void)requestMineBannerList:(HttpRequestHelperCompletion)completion uid:(NSString *)uid type:(NSString *)type; + /// 保存反馈的信息 /// @param complection 完成 /// @param feedbackDesc 反馈的内容 diff --git a/xplan-ios/Main/Mine/Api/Api+Mine.m b/xplan-ios/Main/Mine/Api/Api+Mine.m index 0f1ff374..48fd985b 100644 --- a/xplan-ios/Main/Mine/Api/Api+Mine.m +++ b/xplan-ios/Main/Mine/Api/Api+Mine.m @@ -9,6 +9,21 @@ @implementation Api (Mine) +/// 获取个人中心功能列表 +/// @param completion 完成 +/// @param uid uid ++ (void)requestPersonalFunctionItem:(HttpRequestHelperCompletion)completion + uid:(NSString *)uid { + [self makeRequest:@"personal/center/list" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, uid, nil]; +} + +/// 获取个人中心banner列表 +/// @param completion 完成 +/// @param uid 用户的uid +/// @param type 类型 10 ++ (void)requestMineBannerList:(HttpRequestHelperCompletion)completion uid:(NSString *)uid type:(NSString *)type { + [self makeRequest:@"home/banner" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, uid, type, nil]; +} /// 保存反馈的信息 /// @param completion 完成 diff --git a/xplan-ios/Main/Mine/Model/XPMineFuntionItemModel.h b/xplan-ios/Main/Mine/Model/XPMineFuntionItemModel.h new file mode 100644 index 00000000..f17e4339 --- /dev/null +++ b/xplan-ios/Main/Mine/Model/XPMineFuntionItemModel.h @@ -0,0 +1,28 @@ +// +// XPMineFuntionItemModel.h +// xplan-ios +// +// Created by GreenLand on 2022/7/22. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface XPMineFuntionItemModel : NSObject + +@property (nonatomic, assign) NSInteger centerStatus; +@property (nonatomic, copy) NSString *centerPic; +@property (nonatomic, assign) NSInteger centerId; +@property (nonatomic, copy) NSString *centerBadge; +@property (nonatomic, assign) NSInteger skipType; +@property (nonatomic, assign) NSInteger centerSeq; +@property (nonatomic, copy) NSString *centerName; +@property (nonatomic, copy) NSString *centerUrl; + +///未读消息 +@property (nonatomic, assign) NSInteger unReadCount; + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Mine/Model/XPMineFuntionItemModel.m b/xplan-ios/Main/Mine/Model/XPMineFuntionItemModel.m new file mode 100644 index 00000000..d71c4179 --- /dev/null +++ b/xplan-ios/Main/Mine/Model/XPMineFuntionItemModel.m @@ -0,0 +1,12 @@ +// +// XPMineFuntionItemModel.m +// xplan-ios +// +// Created by GreenLand on 2022/7/22. +// + +#import "XPMineFuntionItemModel.h" + +@implementation XPMineFuntionItemModel + +@end diff --git a/xplan-ios/Main/Mine/Model/XPMineItemModel.h b/xplan-ios/Main/Mine/Model/XPMineItemModel.h index 2ae7dda1..c9c7c88f 100644 --- a/xplan-ios/Main/Mine/Model/XPMineItemModel.h +++ b/xplan-ios/Main/Mine/Model/XPMineItemModel.h @@ -9,30 +9,29 @@ NS_ASSUME_NONNULL_BEGIN typedef NS_ENUM(NSInteger, XPMineItemType) { - XPMineItemType_Match_Apply_Record, ///报名记录 - XPMineItemType_Match_Bonus,///奖金 - XPMineItemType_Match_Standings, ///战绩 - XPMineItemType_Match_Card_Bag, ///卡包 - XPMineItemType_Match_Shopping, ///商城 - XPMineItemType_Match_Relevance_Account, ///关联账号 - XPMineItemType_My_Room, ///我的房间 - XPMineItemType_Collect_Room, ///收藏房间 - XPMineItemType_My_Level,///我的等级 - XPMineItemType_Teenager_Mode, ///青少年模式 - XPMineItemType_Real_Name_Authentic,///实名认证 - XPMineItemType_Account,///我的账户 - XPMineItemType_Invite_Friend,///邀请好友 - XPMineItemType_Personinfo,///个人中心 - XPMineItemType_My_Dressup,///我的装扮 - XPMineItemType_Attention_List,///关注列表 - XPMineItemType_Fans_List,///粉丝列表 + XPMineItemType_Match_Relevance_Account = 2, ///跳转url (关联账号,实名认证, 邀请好友) + XPMineItemType_Match_Apply_Record, ///报名记录 + XPMineItemType_Match_Bonus,///奖金 + XPMineItemType_Match_Standings, ///战绩 + XPMineItemType_Match_Card_Bag, ///卡包 + XPMineItemType_Match_Shopping, ///商城 + XPMineItemType_Account,///我的账户 + XPMineItemType_Personinfo,///个人中心 + XPMineItemType_Attention_List,///关注列表 + XPMineItemType_Fans_List,///粉丝列表 XPMineItemType_Noble_Center,///贵族中心 - XPMineItemType_Match_Manage, ///赛程管理 XPMineItemType_Skill_Card, ///技能卡 - XPMineItemType_Visitor,///访客记录 - XPMineItemType_FansTeam,///粉丝团 - ///我的公会 - XPMineItemType_My_Guild, + XPMineItemType_My_Room = 64, ///我的房间 + XPMineItemType_Collect_Room = 65, ///收藏房间 + XPMineItemType_My_Guild = 67,///我的公会 + XPMineItemType_Teenager_Mode = 68, ///青少年模式 + XPMineItemType_Match_Manage = 69, ///赛程管理 + XPMineItemType_Visitor = 70,///访客记录 + XPMineItemType_CP = 71,///cp关系 + XPMineItemType_FansTeam = 72,///粉丝团 + XPMineItemType_DressUp_Market = 73, ///装扮商场 + XPMineItemType_My_Dressup = 74,///我的装扮 + }; diff --git a/xplan-ios/Main/Mine/Presenter/XPMinePresent.h b/xplan-ios/Main/Mine/Presenter/XPMinePresent.h index ff2053e0..0f4f9618 100644 --- a/xplan-ios/Main/Mine/Presenter/XPMinePresent.h +++ b/xplan-ios/Main/Mine/Presenter/XPMinePresent.h @@ -11,17 +11,28 @@ NS_ASSUME_NONNULL_BEGIN @interface XPMinePresent : BaseMvpPresenter -/// 获取普通的items -- (void)getNormalItems; - -///获取卡片items -- (void)getCardItems; - /// 获取用户信息 - (void)getUserInfo; +/// 获取钱包信息 +- (void)getUserWalletInfo; + /// 获取家族详细的信息 - (void)getClanDetailInfo; + +///获取个人功能列表 +- (void)getPersonItemList; + +///获取小游戏列表 +- (void)getLittleGameList; + +///获取个人中心banner +- (void)getMineBannerList; + +///快速匹配小游戏房 +/// @param mgId 游戏ID +- (void)quickMatchLittleGameWithMgId:(NSString *)mgId; + @end NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Mine/Presenter/XPMinePresent.m b/xplan-ios/Main/Mine/Presenter/XPMinePresent.m index a9386d0c..c5d15b9a 100644 --- a/xplan-ios/Main/Mine/Presenter/XPMinePresent.m +++ b/xplan-ios/Main/Mine/Presenter/XPMinePresent.m @@ -11,10 +11,17 @@ ///Api #import "Api+Mine.h" #import "Api+Guild.h" +#import "Api+LittleGame.h" +#import "Api+Home.h" ///Model #import "XPMineItemModel.h" #import "UserInfoModel.h" #import "ClanDetailInfoModel.h" +#import "XPMineFuntionItemModel.h" +#import "LittleGameInfoModel.h" +#import "HomeBannerInfoModel.h" +#import "HomeLittleGameRoomModel.h" +#import "WalletInfoModel.h" ///Protocol #import "XPMineProtocol.h" @implementation XPMinePresent @@ -23,78 +30,6 @@ return ((id) [super getView]); } -///获取卡片items -- (void)getCardItems { - XPMineItemModel *myAccountItem = [[XPMineItemModel alloc] init]; - myAccountItem.itemName = @"我的账户"; - myAccountItem.itemImageName = @"mine_normal_my_account"; - myAccountItem.type = XPMineItemType_Account; - - XPMineItemModel * matchItem = [[XPMineItemModel alloc] init]; - matchItem.itemName = @"赛程管理"; - matchItem.itemImageName = @"mine_normal_match_manage"; - matchItem.type = XPMineItemType_Match_Manage; - - XPMineItemModel * skillCardItem = [[XPMineItemModel alloc] init]; - skillCardItem.itemName = @"技能卡"; - skillCardItem.itemImageName = @"mine_normal_skill_card"; - skillCardItem.type = XPMineItemType_Skill_Card; - NSArray * array = @[myAccountItem, matchItem, skillCardItem]; - [[self getView] onGetCardItemsSuccess:array]; -} - -/// 获取普通的items -- (void)getNormalItems { - - XPMineItemModel * myRoomItem = [[XPMineItemModel alloc] init]; - myRoomItem.itemName = @"我的房间"; - myRoomItem.itemImageName = @"mine_normal_my_room"; - myRoomItem.type = XPMineItemType_My_Room; - myRoomItem.cornerType = UIRectCornerTopLeft | UIRectCornerTopRight; - - XPMineItemModel * teenagerItem = [[XPMineItemModel alloc] init]; - teenagerItem.itemName = @"青少年模式"; - teenagerItem.itemImageName = @"mine_normal_teenager"; - teenagerItem.type = XPMineItemType_Teenager_Mode; - - XPMineItemModel * myDressUp = [[XPMineItemModel alloc] init]; - myDressUp.itemName = @"我的装扮"; - myDressUp.itemImageName = @"mine_normal_my_dressup"; - myDressUp.type = XPMineItemType_My_Dressup; - - XPMineItemModel * mylevel = [[XPMineItemModel alloc] init]; - mylevel.itemName = @"我的等级"; - mylevel.itemImageName = @"mine_normal_my_level"; - mylevel.type = XPMineItemType_My_Level; - XPMineItemModel *inviteFriend = [[XPMineItemModel alloc] init]; - inviteFriend.itemName = @"推荐给好友"; - inviteFriend.itemImageName = @"mine_normal_invite_friend"; - inviteFriend.type = XPMineItemType_Invite_Friend; - - XPMineItemModel * realNameItem = [[XPMineItemModel alloc] init]; - realNameItem.itemName = @"实名认证"; - realNameItem.itemImageName = @"mine_normal_real_name_authentic"; - realNameItem.type = XPMineItemType_Real_Name_Authentic; - realNameItem.cornerType = UIRectCornerBottomLeft | UIRectCornerBottomRight; - - XPMineItemModel * visitorItem = [[XPMineItemModel alloc] init]; - visitorItem.itemName = @"访客记录"; - visitorItem.itemImageName = @"mine_normal_visitor"; - visitorItem.type = XPMineItemType_Visitor; - BaseViewController *vc = [self getView]; - visitorItem.unReadCount = [vc.tabBarItem.badgeValue integerValue]; - - - XPMineItemModel * fansTeamItem = [[XPMineItemModel alloc] init]; - fansTeamItem.itemName = @"粉丝团"; - fansTeamItem.itemImageName = @"mine_normal_anchor_fansTeam"; - fansTeamItem.type = XPMineItemType_FansTeam; - NSArray * array = @[myRoomItem,teenagerItem, myDressUp, mylevel, inviteFriend, visitorItem,fansTeamItem, realNameItem]; - - [[self getView] onGetNormalItemsSuccess:array]; -} - - /// 获取用户信息 - (void)getUserInfo { NSString * uid = [[AccountInfoStorage instance] getUid]; @@ -107,6 +42,16 @@ }] uid:uid]; } +/// 获取钱包信息 +- (void)getUserWalletInfo { + NSString * uid = [AccountInfoStorage instance].getUid; + NSString * ticket = [AccountInfoStorage instance].getTicket; + [Api getUserWalletInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) { + WalletInfoModel * model = [WalletInfoModel modelWithDictionary:data.data]; + [[self getView] getUserWalletInfo:model]; + }] uid:uid ticket:ticket]; +} + /// 获取家族详细的信息 - (void)getClanDetailInfo { NSString * uid = [[AccountInfoStorage instance] getUid]; @@ -119,4 +64,49 @@ }] uid:uid]; } +///获取个人功能列表 +- (void)getPersonItemList { + NSString * uid = [[AccountInfoStorage instance] getUid]; + if (uid == nil) { + return; + } + [Api requestPersonalFunctionItem:[self createHttpCompletion:^(BaseModel * _Nonnull data) { + NSArray *array = [XPMineFuntionItemModel modelsWithArray:data.data]; + [[self getView] onGetMineFuntionItemSuccess:array]; + }] uid:uid]; +} + +///获取小游戏列表 +- (void)getLittleGameList { + [Api getLittleGameList:[self createHttpCompletion:^(BaseModel * _Nonnull data) { + NSArray * array = [LittleGameInfoModel modelsWithArray:data.data]; + [[self getView] onGetLittleGameListSuccess:array]; + }]]; +} + +///获取个人中心banner +- (void)getMineBannerList { + NSString * uid = [[AccountInfoStorage instance] getUid]; + if (uid == nil) { + return; + } + [Api requestMineBannerList:[self createHttpCompletion:^(BaseModel * _Nonnull data) { + NSArray * array = [HomeBannerInfoModel modelsWithArray:data.data]; + [[self getView] onGetPersonalBannerListSuccess:array]; + }] uid:uid type:@"10"]; +} + +///快速匹配小游戏房 +/// @param mgId 游戏ID +- (void)quickMatchLittleGameWithMgId:(NSString *)mgId { + NSString * uid = [AccountInfoStorage instance].getUid; + [Api homeQuickMatchLittleGame:[self createHttpCompletion:^(BaseModel * _Nonnull data) { + HomeLittleGameRoomModel * gameRoom = [HomeLittleGameRoomModel modelWithDictionary:data.data]; + NSString * uid = gameRoom.uid; + [[self getView] quickMatchLittleGameRoomSuccess:uid]; + } fail:^(NSInteger code, NSString * _Nullable msg) { + [[self getView] quickMatchLittleGameRoomFail:mgId]; + } errorToast:NO] uid:uid mgId:mgId]; +} + @end diff --git a/xplan-ios/Main/Mine/Protocol/XPMineProtocol.h b/xplan-ios/Main/Mine/Protocol/XPMineProtocol.h index d228c994..155f98db 100644 --- a/xplan-ios/Main/Mine/Protocol/XPMineProtocol.h +++ b/xplan-ios/Main/Mine/Protocol/XPMineProtocol.h @@ -8,22 +8,28 @@ #import NS_ASSUME_NONNULL_BEGIN -@class XPMineItemModel, UserInfoModel, ClanDetailInfoModel; +@class XPMineItemModel, UserInfoModel, ClanDetailInfoModel, XPMineFuntionItemModel, LittleGameInfoModel, HomeBannerInfoModel, WalletInfoModel; @protocol XPMineProtocol -/// 获取赛事模块的items -/// @param matchItems 数据源 -- (void)onGetMatchItemsSuccess:(NSArray *)matchItems; -/// 获取普通的选项 -/// @param matchItems 数据源 -- (void)onGetNormalItemsSuccess:(NSArray *)matchItems; -///获取卡片选项 -///@param cardItems 数据源 -- (void)onGetCardItemsSuccess:(NSArray *)cardItems; ///获取用户信息成功 - (void)onGetUserInfoSuccess:(UserInfoModel *)userInfo; ///获取家族公会信息成功 - (void)onGetClanDetailInfoSuccess:(ClanDetailInfoModel *)clanInfo; +///获取账户余额 +- (void)getUserWalletInfo:(WalletInfoModel *)balanceInfo; + +///获取个人中心功能 +- (void)onGetMineFuntionItemSuccess:(NSArray *)items; +///获取小游戏列表 +- (void)onGetLittleGameListSuccess:(NSArray *)items; +///获取个人中心banner +- (void)onGetPersonalBannerListSuccess:(NSArray *)items; + +///匹配游戏房成功 +- (void)quickMatchLittleGameRoomSuccess:(NSString *)uid; +///匹配游戏房失败 +- (void)quickMatchLittleGameRoomFail:(NSString *)mgId; + @end NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Mine/View/Cell/XPMIneGameCollectionViewCell.h b/xplan-ios/Main/Mine/View/Cell/XPMIneGameCollectionViewCell.h new file mode 100644 index 00000000..2cc75cc4 --- /dev/null +++ b/xplan-ios/Main/Mine/View/Cell/XPMIneGameCollectionViewCell.h @@ -0,0 +1,19 @@ +// +// XPMIneGameCollectionViewCell.h +// xplan-ios +// +// Created by GreenLand on 2022/7/22. +// + +#import + +NS_ASSUME_NONNULL_BEGIN +@class LittleGameInfoModel; +@interface XPMIneGameCollectionViewCell : UICollectionViewCell + +///游戏 +@property (nonatomic, strong) LittleGameInfoModel *gameModel; + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Mine/View/Cell/XPMIneGameCollectionViewCell.m b/xplan-ios/Main/Mine/View/Cell/XPMIneGameCollectionViewCell.m new file mode 100644 index 00000000..ea83f51c --- /dev/null +++ b/xplan-ios/Main/Mine/View/Cell/XPMIneGameCollectionViewCell.m @@ -0,0 +1,80 @@ +// +// XPMIneGameCollectionViewCell.m +// xplan-ios +// +// Created by GreenLand on 2022/7/22. +// + +#import "XPMIneGameCollectionViewCell.h" +///Third +#import +#import "NetImageView.h" +///Tool +#import "ThemeColor.h" +///Model +#import "LittleGameInfoModel.h" + +@interface XPMIneGameCollectionViewCell () +///显示图片 +@property (nonatomic,strong) NetImageView *logoImageView; +///显示名字 +@property (nonatomic,strong) UILabel *titleLabel; +@end + +@implementation XPMIneGameCollectionViewCell + +- (instancetype)initWithFrame:(CGRect)frame +{ + self = [super initWithFrame:frame]; + if (self) { + [self initSubViews]; + [self initSubViewConstraints]; + } + return self; +} + +#pragma mark - Private Method +- (void)initSubViews { + [self.contentView addSubview:self.logoImageView]; + [self.contentView addSubview:self.titleLabel]; +} + +- (void)initSubViewConstraints { + [self.logoImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.size.mas_equalTo(CGSizeMake(40, 40)); + make.centerX.top.mas_equalTo(self.contentView); + }]; + + [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.logoImageView.mas_bottom).offset(6); + make.centerX.mas_equalTo(self.contentView); + }]; +} + +#pragma mark - Getters And Setters +- (void)setGameModel:(LittleGameInfoModel *)gameModel { + _gameModel = gameModel; + if (gameModel) { + self.titleLabel.text = gameModel.name; + self.logoImageView.imageUrl = gameModel.pic; + } +} + +- (NetImageView *)logoImageView { + if (!_logoImageView) { + _logoImageView = [[NetImageView alloc] init]; + } + return _logoImageView; +} + +- (UILabel *)titleLabel { + if (!_titleLabel) { + _titleLabel = [[UILabel alloc] init]; + _titleLabel.font = [UIFont systemFontOfSize:13]; + _titleLabel.textAlignment = NSTextAlignmentCenter; + _titleLabel.textColor = [ThemeColor secondTextColor]; + } + return _titleLabel; +} + +@end diff --git a/xplan-ios/Main/Mine/View/Cell/XPMineGameTableViewCell.h b/xplan-ios/Main/Mine/View/Cell/XPMineGameTableViewCell.h new file mode 100644 index 00000000..37a42e93 --- /dev/null +++ b/xplan-ios/Main/Mine/View/Cell/XPMineGameTableViewCell.h @@ -0,0 +1,28 @@ +// +// XPMineGameTableViewCell.h +// xplan-ios +// +// Created by GreenLand on 2022/7/22. +// + +#import + +NS_ASSUME_NONNULL_BEGIN +@class LittleGameInfoModel, XPMineGameTableViewCell; +@protocol XPMineGameTableViewCellDelegate + +///选择了某个item +- (void)xPMineGameTableViewCell:(XPMineGameTableViewCell *)cell didSelectItem:(LittleGameInfoModel *)item; + +@end + +@interface XPMineGameTableViewCell : UITableViewCell + +///数据 +@property (nonatomic,strong) NSArray *datasource; +///代理 +@property (nonatomic,weak) id delegate; + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Mine/View/Cell/XPMineGameTableViewCell.m b/xplan-ios/Main/Mine/View/Cell/XPMineGameTableViewCell.m new file mode 100644 index 00000000..6f20ed2a --- /dev/null +++ b/xplan-ios/Main/Mine/View/Cell/XPMineGameTableViewCell.m @@ -0,0 +1,181 @@ +// +// XPMineGameTableViewCell.m +// xplan-ios +// +// Created by GreenLand on 2022/7/22. +// + +#import "XPMineGameTableViewCell.h" +///Third +#import +///Tool +#import "ThemeColor.h" +#import "XPMacro.h" +///View +#import "XPMIneGameCollectionViewCell.h" + +@interface XPMineGameTableViewCell () + +@property (nonatomic, strong) UIView *mainView; +@property (nonatomic, strong) UILabel *titleLabel; +///列表 +@property (nonatomic,strong) UICollectionView *collectionView; + +@property (nonatomic, strong) UIView *slideBackView; +@property (nonatomic, strong) UIView *sliderView; + +@end + +@implementation XPMineGameTableViewCell + +- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { + if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { + [self initSubViews]; + [self initSubViewConstraints]; + } + return self; +} + +#pragma mark - Private Method +- (void)initSubViews { + self.backgroundColor = [UIColor clearColor]; + [self.contentView addSubview:self.mainView]; + [self.mainView addSubview:self.titleLabel]; + [self.mainView addSubview:self.collectionView]; +} + +- (void)initSubViewConstraints { + [self.mainView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.bottom.mas_equalTo(0); + make.left.right.mas_equalTo(self.contentView).inset(15); + }]; + [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.left.mas_equalTo(12); + make.height.mas_equalTo(18); + }]; + [self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.titleLabel.mas_bottom).mas_offset(14); + make.left.right.mas_equalTo(0); + make.height.mas_equalTo(63); + }]; +} + +#pragma mark - UICollectionViewDatasource And UICollectionViewDelegate +- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { + return self.datasource.count; +} + +- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { + XPMIneGameCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPMIneGameCollectionViewCell class]) forIndexPath:indexPath]; + LittleGameInfoModel * item = [self.datasource objectAtIndex:indexPath.row]; + cell.gameModel = item; + return cell; +} + +- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { + [collectionView deselectItemAtIndexPath:indexPath animated:YES]; + if (self.delegate && [self.delegate respondsToSelector:@selector(xPMineGameTableViewCell:didSelectItem:)]) { + LittleGameInfoModel * model = [self.datasource objectAtIndex:indexPath.row]; + [self.delegate xPMineGameTableViewCell:self didSelectItem:model]; + } +} + +#pragma mark - UICollectionViewFlowlayout +- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section { + return 0; +} + +- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath { + CGFloat width = (KScreenWidth - 30) / 4; + return CGSizeMake(width, 63); +} + +- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section { + return 0; +} + +- (void)scrollViewDidScroll:(UIScrollView *)scrollView { + CGPoint offset = scrollView.contentOffset; + CGRect frame = self.sliderView.frame; + frame.origin.x = offset.x*12/(scrollView.contentSize.width-scrollView.frame.size.width); + self.sliderView.frame = frame; +} + +#pragma mark - Getters And Setters +- (void)setDatasource:(NSArray *)datasource { + _datasource = datasource; + if(datasource.count > 4) { + [self.mainView addSubview:self.slideBackView]; + [self.slideBackView addSubview:self.sliderView]; + [self.slideBackView mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.mas_equalTo(self.mainView); + make.size.mas_equalTo(CGSizeMake(24, 4)); + make.top.mas_equalTo(self.collectionView.mas_bottom).mas_offset(10); + }]; + [self.sliderView mas_makeConstraints:^(MASConstraintMaker *make) { + make.size.mas_equalTo(CGSizeMake(12, 4)); + make.top.left.bottom.mas_equalTo(self.slideBackView); + }]; + } else { + [self.sliderView removeFromSuperview]; + [self.slideBackView removeFromSuperview]; + } + [self.collectionView reloadData]; +} + +- (UIView *)mainView { + if (!_mainView) { + _mainView = [[UIView alloc] init]; + _mainView.backgroundColor = [UIColor whiteColor]; + _mainView.layer.cornerRadius = 8; + _mainView.layer.masksToBounds = YES; + } + return _mainView; +} + +- (UILabel *)titleLabel { + if (!_titleLabel) { + _titleLabel = [[UILabel alloc] init]; + _titleLabel.text = @"快捷进房"; + _titleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightBold]; + _titleLabel.textColor = [ThemeColor mainTextColor]; + } + return _titleLabel; +} + +- (UICollectionView *)collectionView{ + if (!_collectionView) { + UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; + layout.scrollDirection = UICollectionViewScrollDirectionHorizontal; + _collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout]; + _collectionView.showsHorizontalScrollIndicator = NO; + _collectionView.dataSource = self; + _collectionView.delegate = self; + _collectionView.backgroundColor = [ThemeColor appCellBackgroundColor]; + [_collectionView registerClass:[XPMIneGameCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([XPMIneGameCollectionViewCell class])]; + } + return _collectionView; +} + +- (UIView *)sliderView { + if (!_sliderView) { + _sliderView = [[UIView alloc] init]; + _sliderView.backgroundColor = UIColorFromRGB(0xFFBC51); + _sliderView.layer.cornerRadius = 2; + _sliderView.layer.masksToBounds = YES; + } + return _sliderView; +} + +- (UIView *)slideBackView { + if (!_slideBackView) { + _slideBackView = [[UIView alloc] init]; + _slideBackView.backgroundColor = UIColorRGBAlpha(0x000000, 0.1); + _slideBackView.layer.cornerRadius = 2; + _slideBackView.layer.masksToBounds = YES; + _sliderView.clipsToBounds = YES; + } + return _slideBackView; +} + +@end diff --git a/xplan-ios/Main/Mine/View/Cell/XPMineHeadItemCollectionViewCell.h b/xplan-ios/Main/Mine/View/Cell/XPMineHeadItemCollectionViewCell.h index 1661fb32..c503cf0e 100644 --- a/xplan-ios/Main/Mine/View/Cell/XPMineHeadItemCollectionViewCell.h +++ b/xplan-ios/Main/Mine/View/Cell/XPMineHeadItemCollectionViewCell.h @@ -8,10 +8,12 @@ #import NS_ASSUME_NONNULL_BEGIN -@class XPMineItemModel; +@class XPMineFuntionItemModel, LittleGameInfoModel; @interface XPMineHeadItemCollectionViewCell : UICollectionViewCell -/// -@property (nonatomic,strong) XPMineItemModel *itemModel; + +///功能 +@property (nonatomic,strong) XPMineFuntionItemModel *itemModel; + @end NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Mine/View/Cell/XPMineHeadItemCollectionViewCell.m b/xplan-ios/Main/Mine/View/Cell/XPMineHeadItemCollectionViewCell.m index c3075c7f..d86a1f4d 100644 --- a/xplan-ios/Main/Mine/View/Cell/XPMineHeadItemCollectionViewCell.m +++ b/xplan-ios/Main/Mine/View/Cell/XPMineHeadItemCollectionViewCell.m @@ -8,14 +8,15 @@ #import "XPMineHeadItemCollectionViewCell.h" ///Third #import +#import "NetImageView.h" ///Tool #import "ThemeColor.h" ///Model -#import "XPMineItemModel.h" +#import "XPMineFuntionItemModel.h" @interface XPMineHeadItemCollectionViewCell () ///显示图片 -@property (nonatomic,strong) UIImageView *logoImageView; +@property (nonatomic,strong) NetImageView *logoImageView; ///显示名字 @property (nonatomic,strong) UILabel *titleLabel; @end @@ -41,28 +42,29 @@ - (void)initSubViewConstraints { [self.logoImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.size.mas_equalTo(CGSizeMake(40, 40)); + make.size.mas_equalTo(CGSizeMake(32, 32)); make.centerX.top.mas_equalTo(self.contentView); }]; [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(self.logoImageView.mas_bottom).offset(8); + make.top.mas_equalTo(self.logoImageView.mas_bottom).offset(4); make.centerX.mas_equalTo(self.contentView); + make.height.mas_equalTo(17); }]; } #pragma mark - Getters And Setters -- (void)setItemModel:(XPMineItemModel *)itemModel { +- (void)setItemModel:(XPMineFuntionItemModel *)itemModel { _itemModel = itemModel; if (_itemModel) { - self.logoImageView.image = [UIImage imageNamed:_itemModel.itemImageName]; - self.titleLabel.text = _itemModel.itemName; + self.logoImageView.imageUrl = itemModel.centerPic; + self.titleLabel.text = _itemModel.centerName; } } -- (UIImageView *)logoImageView { +- (NetImageView *)logoImageView { if (!_logoImageView) { - _logoImageView = [[UIImageView alloc] init]; + _logoImageView = [[NetImageView alloc] init]; _logoImageView.userInteractionEnabled = YES; } return _logoImageView; diff --git a/xplan-ios/Main/Mine/View/Cell/XPMineHeadItemTableViewCell.h b/xplan-ios/Main/Mine/View/Cell/XPMineHeadItemTableViewCell.h index 53bfe2a0..6fbd77e5 100644 --- a/xplan-ios/Main/Mine/View/Cell/XPMineHeadItemTableViewCell.h +++ b/xplan-ios/Main/Mine/View/Cell/XPMineHeadItemTableViewCell.h @@ -8,18 +8,18 @@ #import NS_ASSUME_NONNULL_BEGIN -@class XPMineItemModel, XPMineHeadItemTableViewCell; +@class XPMineFuntionItemModel, XPMineHeadItemTableViewCell; @protocol XPMineHeadItemTableViewCellDelegate ///选择了某个item -- (void)xPMineHeadItemTableViewCell:(XPMineHeadItemTableViewCell *)cell didSelectItem:(XPMineItemModel *)item; +- (void)xPMineHeadItemTableViewCell:(XPMineHeadItemTableViewCell *)cell didSelectItem:(XPMineFuntionItemModel *)item; @end @interface XPMineHeadItemTableViewCell : UITableViewCell ///数据 -@property (nonatomic,strong) NSArray *datasource; +@property (nonatomic,strong) NSArray *datasource; ///代理 @property (nonatomic,weak) id delegate; diff --git a/xplan-ios/Main/Mine/View/Cell/XPMineHeadItemTableViewCell.m b/xplan-ios/Main/Mine/View/Cell/XPMineHeadItemTableViewCell.m index 560202eb..6f2f9e8f 100644 --- a/xplan-ios/Main/Mine/View/Cell/XPMineHeadItemTableViewCell.m +++ b/xplan-ios/Main/Mine/View/Cell/XPMineHeadItemTableViewCell.m @@ -18,6 +18,10 @@ ///列表 @property (nonatomic,strong) UICollectionView *collectionView; +@property (nonatomic, strong) UIView *mainView; +@property (nonatomic, strong) UIView *slideBackView; +@property (nonatomic, strong) UIView *sliderView; + @end @@ -33,13 +37,19 @@ #pragma mark - Private Method - (void)initSubViews { self.backgroundColor = [UIColor clearColor]; - [self.contentView addSubview:self.collectionView]; + [self.contentView addSubview:self.mainView]; + [self.mainView addSubview:self.collectionView]; } - (void)initSubViewConstraints { - [self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.bottom.mas_equalTo(self.contentView); + [self.mainView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.mas_equalTo(self.contentView).inset(15); + make.top.bottom.mas_equalTo(self.contentView); + }]; + [self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(20); + make.left.right.mas_equalTo(self.mainView); + make.height.mas_equalTo(77+32+17); }]; } @@ -50,7 +60,7 @@ - (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { XPMineHeadItemCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPMineHeadItemCollectionViewCell class]) forIndexPath:indexPath]; - XPMineItemModel * item = [self.datasource objectAtIndex:indexPath.row]; + XPMineFuntionItemModel * item = [self.datasource objectAtIndex:indexPath.row]; cell.itemModel = item; return cell; } @@ -58,48 +68,97 @@ - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { [collectionView deselectItemAtIndexPath:indexPath animated:YES]; if (self.delegate && [self.delegate respondsToSelector:@selector(xPMineHeadItemTableViewCell:didSelectItem:)]) { - XPMineItemModel * model = [self.datasource objectAtIndex:indexPath.row]; + XPMineFuntionItemModel * model = [self.datasource objectAtIndex:indexPath.row]; [self.delegate xPMineHeadItemTableViewCell:self didSelectItem:model]; } } #pragma mark - UICollectionViewFlowlayout -- (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section { - return UIEdgeInsetsMake(14, 0, 0, 0); -} - - (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section { return 0; } - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath { - CGFloat width = (KScreenWidth - 30) / 3; - return CGSizeMake(width, 68); + CGFloat width = (KScreenWidth - 30) / 4; + return CGSizeMake(width, 32+4+17); } - (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section { return 0; } +- (void)scrollViewDidScroll:(UIScrollView *)scrollView { + CGPoint offset = scrollView.contentOffset; + CGRect frame = self.sliderView.frame; + frame.origin.x = offset.x*12/(scrollView.contentSize.width-scrollView.frame.size.width); + self.sliderView.frame = frame; +} + #pragma mark - Getters And Setters -- (void)setDatasource:(NSArray *)datasource { +- (void)setDatasource:(NSArray *)datasource { _datasource = datasource; + if(datasource.count > 4) { + [self.mainView addSubview:self.slideBackView]; + [self.slideBackView addSubview:self.sliderView]; + [self.slideBackView mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.mas_equalTo(self.mainView); + make.size.mas_equalTo(CGSizeMake(24, 4)); + make.top.mas_equalTo(self.collectionView.mas_bottom).mas_offset(10); + }]; + [self.sliderView mas_makeConstraints:^(MASConstraintMaker *make) { + make.size.mas_equalTo(CGSizeMake(12, 4)); + make.top.left.bottom.mas_equalTo(self.slideBackView); + }]; + } else { + [self.sliderView removeFromSuperview]; + [self.slideBackView removeFromSuperview]; + } [self.collectionView reloadData]; } - (UICollectionView *)collectionView{ if (!_collectionView) { UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; + layout.scrollDirection = UICollectionViewScrollDirectionHorizontal; _collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout]; _collectionView.dataSource = self; _collectionView.delegate = self; _collectionView.backgroundColor = [ThemeColor appCellBackgroundColor]; [_collectionView registerClass:[XPMineHeadItemCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([XPMineHeadItemCollectionViewCell class])]; - _collectionView.layer.masksToBounds = YES; - _collectionView.layer.cornerRadius = 10; + _collectionView.showsHorizontalScrollIndicator = NO; } return _collectionView; } +- (UIView *)sliderView { + if (!_sliderView) { + _sliderView = [[UIView alloc] init]; + _sliderView.backgroundColor = UIColorFromRGB(0xFFBC51); + _sliderView.layer.cornerRadius = 2; + _sliderView.layer.masksToBounds = YES; + } + return _sliderView; +} + +- (UIView *)slideBackView { + if (!_slideBackView) { + _slideBackView = [[UIView alloc] init]; + _slideBackView.backgroundColor = UIColorRGBAlpha(0x000000, 0.1); + _slideBackView.layer.cornerRadius = 2; + _slideBackView.layer.masksToBounds = YES; + _slideBackView.clipsToBounds = YES; + } + return _slideBackView; +} + +- (UIView *)mainView { + if (!_mainView) { + _mainView = [[UIView alloc] init]; + _mainView.backgroundColor = [UIColor whiteColor]; + _mainView.layer.cornerRadius = 8; + _mainView.layer.masksToBounds = YES; + } + return _mainView; +} @end diff --git a/xplan-ios/Main/Mine/View/SubViews/NobleCenter/XPNobleCenterEntranceView.h b/xplan-ios/Main/Mine/View/SubViews/NobleCenter/XPNobleCenterEntranceView.h index c07e4a68..bacd92b3 100644 --- a/xplan-ios/Main/Mine/View/SubViews/NobleCenter/XPNobleCenterEntranceView.h +++ b/xplan-ios/Main/Mine/View/SubViews/NobleCenter/XPNobleCenterEntranceView.h @@ -6,6 +6,7 @@ // #import +#import "UserVipInfoVo.h" NS_ASSUME_NONNULL_BEGIN diff --git a/xplan-ios/Main/Mine/View/SubViews/NobleCenter/XPNobleCenterEntranceView.m b/xplan-ios/Main/Mine/View/SubViews/NobleCenter/XPNobleCenterEntranceView.m index 88800dec..e78f3e5d 100644 --- a/xplan-ios/Main/Mine/View/SubViews/NobleCenter/XPNobleCenterEntranceView.m +++ b/xplan-ios/Main/Mine/View/SubViews/NobleCenter/XPNobleCenterEntranceView.m @@ -13,6 +13,7 @@ @property (nonatomic, strong) UIImageView *bgImageView; @property (nonatomic, strong) UILabel *titleLabel; +@property (nonatomic, strong) UILabel *descLabel; @end @@ -31,24 +32,32 @@ #pragma mark - Private Method - (void)initSubViews { [self addSubview:self.bgImageView]; - [self.bgImageView addSubview:self.titleLabel]; + [self addSubview:self.titleLabel]; + [self addSubview:self.descLabel]; } - (void)initSubViewConstraints { [self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.right.mas_equalTo(self).inset(15).priority(500); - make.bottom.top.mas_equalTo(0); + make.edges.mas_equalTo(0); }]; [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerY.mas_equalTo(self.bgImageView); - make.right.mas_equalTo(self.bgImageView).mas_offset(-8); + make.bottom.mas_equalTo(self.mas_centerY); + make.left.mas_equalTo(48); + make.right.mas_equalTo(0); + make.height.mas_equalTo(22); + }]; + [self.descLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.titleLabel.mas_bottom).mas_offset(2); + make.left.mas_equalTo(self.titleLabel); + make.right.mas_equalTo(0); + make.height.mas_equalTo(14); }]; } - (void)setHadNoble:(BOOL)hadNoble { if (hadNoble) { - self.titleLabel.text = @"查看我的特权>>"; + self.descLabel.text = @"查看我的特权"; } } @@ -64,11 +73,21 @@ - (UILabel *)titleLabel { if (!_titleLabel) { _titleLabel = [[UILabel alloc] init]; - _titleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium]; - _titleLabel.textColor = UIColorFromRGB(0xffffff); - _titleLabel.text = @"开通贵族立享各项特权>>"; + _titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium]; + _titleLabel.textColor = UIColorFromRGB(0xFFE595); + _titleLabel.text = @"贵族中心"; } return _titleLabel; } +- (UILabel *)descLabel { + if (!_descLabel) { + _descLabel = [[UILabel alloc] init]; + _descLabel.font = [UIFont systemFontOfSize:10 weight:UIFontWeightMedium]; + _descLabel.textColor = UIColorFromRGB(0x9F8052); + _descLabel.text = @"开通贵族立享各项特权"; + } + return _descLabel; +} + @end diff --git a/xplan-ios/Main/Mine/View/SubViews/XPMineAccountView.h b/xplan-ios/Main/Mine/View/SubViews/XPMineAccountView.h new file mode 100644 index 00000000..2d70196d --- /dev/null +++ b/xplan-ios/Main/Mine/View/SubViews/XPMineAccountView.h @@ -0,0 +1,18 @@ +// +// XPMineAccountView.h +// xplan-ios +// +// Created by GreenLand on 2022/7/22. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface XPMineAccountView : UIView + +@property (nonatomic, copy) NSString *diamonds; + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Mine/View/SubViews/XPMineAccountView.m b/xplan-ios/Main/Mine/View/SubViews/XPMineAccountView.m index 44b027a1..c84c922f 100644 --- a/xplan-ios/Main/Mine/View/SubViews/XPMineAccountView.m +++ b/xplan-ios/Main/Mine/View/SubViews/XPMineAccountView.m @@ -2,139 +2,91 @@ // XPMineAccountView.m // xplan-ios // -// Created by 冯硕 on 2021/9/16. -// 我的账户 推荐给好友 +// Created by GreenLand on 2022/7/22. +// #import "XPMineAccountView.h" -///Third #import -///Tool #import "ThemeColor.h" -#import "XPMacro.h" -#import "UIImage+Utils.h" - -@implementation XPMineAccountSubView - -- (instancetype)initWithFrame:(CGRect)frame -{ - self = [super initWithFrame:frame]; - if (self) { - [self initSubViews]; - [self initSubViewConstraints]; - } - return self; -} - -#pragma mark - Private Method -- (void)initSubViews { - [self addSubview:self.backImageView]; - [self addSubview:self.titleLabel]; - [self addSubview:self.freeTicketButton]; -} - -- (void)initSubViewConstraints { - [self.backImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.mas_equalTo(self); - }]; - - [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(self.backImageView).offset(18); - make.left.mas_equalTo(self.backImageView).offset(16); - make.right.mas_lessThanOrEqualTo(self.backImageView); - }]; - - [self.freeTicketButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.right.top.mas_equalTo(self.backImageView); - }]; -} - -- (UIImageView *)backImageView { - if (!_backImageView) { - _backImageView = [[UIImageView alloc] init]; - _backImageView.userInteractionEnabled = YES; - _backImageView.layer.masksToBounds = YES; - _backImageView.layer.cornerRadius = 10; - _backImageView.contentMode = UIViewContentModeScaleAspectFill; - } - return _backImageView; -} - -- (UILabel *)titleLabel { - if (!_titleLabel) { - _titleLabel = [[UILabel alloc] init]; - _titleLabel.font = [UIFont fontWithName:@"PingFang-SC-Bold" size:16]; - _titleLabel.textColor = [ThemeColor mainTextColor]; - } - return _titleLabel; -} - -- (UIButton *)freeTicketButton { - if (!_freeTicketButton) { - _freeTicketButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_freeTicketButton setBackgroundImage:[UIImage imageNamed:@"mine_head_free_ticket"] forState:UIControlStateNormal]; - } - return _freeTicketButton; -} - -@end - - @interface XPMineAccountView () -///我的账户 -@property (nonatomic,strong) XPMineAccountSubView *accountView; -///推荐好友 -@property (nonatomic,strong) XPMineAccountSubView *recommendView; + +@property (nonatomic, strong) UIImageView *bgImageView; +@property (nonatomic, strong) UILabel *coinLabel; +@property (nonatomic, strong) UILabel *descLabel; @end @implementation XPMineAccountView -- (instancetype)initWithFrame:(CGRect)frame { - self = [super initWithFrame:frame]; - if (self) { - [self initSubViews]; - [self initSubViewConstraints]; - } - return self; +- (instancetype)initWithFrame:(CGRect)frame +{ + self = [super initWithFrame:frame]; + if (self) { + [self initSubViews]; + [self initSubViewConstraints]; + } + return self; } + #pragma mark - Private Method - (void)initSubViews { - [self addSubview:self.accountView]; - [self addSubview:self.recommendView]; + [self addSubview:self.bgImageView]; + [self addSubview:self.coinLabel]; + [self addSubview:self.descLabel]; } - (void)initSubViewConstraints { - [self.accountView mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.mas_equalTo(self).offset(15); - make.top.bottom.mas_equalTo(self); - make.width.mas_equalTo((KScreenWidth - 15 * 3) / 2); - }]; - - [self.recommendView mas_makeConstraints:^(MASConstraintMaker *make) { - make.right.mas_equalTo(self).offset(-15); - make.top.bottom.width.mas_equalTo(self.accountView); - }]; + [self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.mas_equalTo(0); + }]; + + [self.coinLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.mas_equalTo(self.mas_centerY); + make.left.mas_equalTo(15); + make.right.mas_equalTo(0); + make.height.mas_equalTo(24); + }]; + [self.descLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.coinLabel); + make.top.mas_equalTo(self.coinLabel.mas_bottom).mas_offset(4); + make.height.mas_equalTo(14); + }]; } + +- (void)setDiamonds:(NSString *)diamonds { + self.coinLabel.text = diamonds; +} + #pragma mark - Getters And Setters - -- (XPMineAccountSubView *)accountView { - if (!_accountView) { - _accountView = [[XPMineAccountSubView alloc] init]; - _accountView.backImageView.image = [UIImage imageNamed:@"mine_head_account_bg"]; - _accountView.titleLabel.text = @"我的账户"; - _accountView.freeTicketButton.hidden = YES; - } - return _accountView; +- (UIImageView *)bgImageView { + if (!_bgImageView) { + _bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mine_head_account_bg"]]; + _bgImageView.contentMode = UIViewContentModeScaleAspectFit; + } + return _bgImageView; } -- (XPMineAccountSubView *)recommendView { - if (!_recommendView) { - _recommendView = [[XPMineAccountSubView alloc] init]; - _recommendView.backImageView.image = [UIImage imageNamed:@"mine_head_recommend_bg"]; - _recommendView.titleLabel.text = @"推荐给好友"; - } - return _recommendView; +- (UILabel *)descLabel { + if (!_descLabel) { + _descLabel = [[UILabel alloc] init]; + _descLabel.font = [UIFont systemFontOfSize:10 weight:UIFontWeightMedium]; + _descLabel.textColor = UIColorRGBAlpha(0x000000, 0.3); + _descLabel.text = @"钻石余额"; + } + return _descLabel; } + +- (UILabel *)coinLabel { + if (!_coinLabel) { + _coinLabel = [[UILabel alloc] init]; + _coinLabel.font = [UIFont systemFontOfSize:20 weight:UIFontWeightBold]; + _coinLabel.textColor = [ThemeColor mainTextColor]; + } + return _coinLabel; +} + + + @end diff --git a/xplan-ios/Main/Mine/View/SubViews/XPMineHeadView.h b/xplan-ios/Main/Mine/View/SubViews/XPMineHeadView.h index d97d6888..831f64a2 100644 --- a/xplan-ios/Main/Mine/View/SubViews/XPMineHeadView.h +++ b/xplan-ios/Main/Mine/View/SubViews/XPMineHeadView.h @@ -8,18 +8,22 @@ #import NS_ASSUME_NONNULL_BEGIN -@class UserInfoModel,XPMineHeadView; +@class UserInfoModel,XPMineHeadView, WalletInfoModel; @protocol XPMineHeadViewDelegate ///点击了头像 - (void)xPMineHeadView:(XPMineHeadView *)view didClickAvatar:(UserInfoModel *)info; -//点击我的账户 -- (void)xPMineHeadView:(XPMineHeadView *)view didClickAccount:(UserInfoModel *)info; -//点击邀请好友 -- (void)xPMineHeadView:(XPMineHeadView *)view didClickInviteFriend:(UserInfoModel *)info; ///点击了关注 - (void)xpMineHeadViewClickAttention; ///点击了粉丝 - (void)xpMineHeadViewClickFans; +///点击了技能卡 +- (void)xpMineHeadViewClickSkillCard; +///点击了访客 +- (void)xpMineHeadViewClickVisitor; +///点击了足迹 +- (void)xpMineHeadViewClickFootprint; +///点击了账户中心 +- (void)xpMineHeadViewClickAcount; ///点击了贵族中心 - (void)xPMineHeadViewCliekNobleCenter; @@ -27,6 +31,7 @@ NS_ASSUME_NONNULL_BEGIN @interface XPMineHeadView : UIView ///用户信息 @property (nonatomic,strong) UserInfoModel *userInfo; +@property (nonatomic, strong) WalletInfoModel *walletInfo; ///代理 @property (nonatomic,assign) id delegate; @end diff --git a/xplan-ios/Main/Mine/View/SubViews/XPMineHeadView.m b/xplan-ios/Main/Mine/View/SubViews/XPMineHeadView.m index 1fadde26..8f4eaa14 100644 --- a/xplan-ios/Main/Mine/View/SubViews/XPMineHeadView.m +++ b/xplan-ios/Main/Mine/View/SubViews/XPMineHeadView.m @@ -18,15 +18,17 @@ #import "UIImage+Utils.h" #import "XPMineFriendNumberView.h" #import "XPNobleCenterEntranceView.h" +#import "XPMineAccountView.h" ///Model #import "UserInfoModel.h" +#import "WalletInfoModel.h" @interface XPMineHeadView () ///头像 @property (nonatomic,strong) NetImageView * avatarImageView; ///name的容器 @property (nonatomic,strong) UIStackView *nameStackView; -///贵族 +///贵族等级icon @property (nonatomic,strong) NetImageView *nobleImageView; ///名字 @property (nonatomic,strong) UILabel *nameLabel; @@ -40,12 +42,20 @@ @property (nonatomic,strong) UIImageView *sexImageView; ///显示等级 @property (nonatomic,strong) YYLabel *levelLabel; -///分割线 -@property (nonatomic,strong) UIView * lineView; +///关注、粉丝的容器 +@property (nonatomic,strong) UIStackView *attentionStackView; ///关注 @property (nonatomic,strong) XPMineFriendNumberView *attentionView; ///粉丝 @property (nonatomic,strong) XPMineFriendNumberView *fansView; +///访客记录 +@property (nonatomic,strong) XPMineFriendNumberView *visitorView; +///足迹 +@property (nonatomic,strong) XPMineFriendNumberView *footprintView; +///技能卡 +@property (nonatomic, strong) UIButton *skillCardButton; +///账户中心 +@property (nonatomic, strong) XPMineAccountView *accountView; ///贵族中心 @property (nonatomic, strong) XPNobleCenterEntranceView *nobleEntranceView; @@ -63,48 +73,28 @@ return self; } -#pragma mark - Response -- (void)tapAvatarImageView { - if (self.delegate && [self.delegate respondsToSelector:@selector(xPMineHeadView:didClickAvatar:)]) { - [self.delegate xPMineHeadView:self didClickAvatar:self.userInfo]; - } -} - -- (void)tapFansRecognizer { - if (self.delegate && [self.delegate respondsToSelector:@selector(xpMineHeadViewClickFans)]) { - [self.delegate xpMineHeadViewClickFans]; - } -} - -- (void)tapAttentionRecognizer { - if (self.delegate && [self.delegate respondsToSelector:@selector(xpMineHeadViewClickAttention)]) { - [self.delegate xpMineHeadViewClickAttention]; - } -} - -- (void)tapNobleCenterrecognizer { - if (self.delegate && [self.delegate respondsToSelector:@selector(xPMineHeadViewCliekNobleCenter)]) { - [self.delegate xPMineHeadViewCliekNobleCenter]; - } -} - #pragma mark - Private Method - (void)initSubViews { self.backgroundColor = [UIColor clearColor]; [self addSubview:self.avatarImageView]; + [self addSubview:self.nobleImageView]; [self addSubview:self.nameStackView]; [self addSubview:self.idStackView]; + [self.nameStackView addArrangedSubview:self.nameLabel]; + [self.nameStackView addArrangedSubview:self.editButton]; + [self.idStackView addArrangedSubview:self.idLabel]; + [self.idStackView addArrangedSubview:self.sexImageView]; [self addSubview:self.levelLabel]; - [self addSubview:self.lineView]; - [self addSubview:self.attentionView]; - [self addSubview:self.fansView]; - [self addSubview:self.nobleEntranceView]; - [self addSubview:self.nobleImageView]; + [self addSubview:self.skillCardButton]; - [self.nameStackView addArrangedSubview:self.nameLabel]; - [self.nameStackView addArrangedSubview:self.editButton]; - [self.idStackView addArrangedSubview:self.idLabel]; - [self.idStackView addArrangedSubview:self.sexImageView]; + [self addSubview:self.attentionStackView]; + [self.attentionStackView addArrangedSubview:self.attentionView]; + [self.attentionStackView addArrangedSubview:self.fansView]; + [self.attentionStackView addArrangedSubview:self.visitorView]; + [self.attentionStackView addArrangedSubview:self.footprintView]; + + [self addSubview:self.accountView]; + [self addSubview:self.nobleEntranceView]; UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAvatarImageView)]; [self.avatarImageView addGestureRecognizer:tap]; @@ -136,29 +126,95 @@ make.left.mas_equalTo(self.nobleImageView); make.top.mas_equalTo(self.idStackView.mas_bottom).offset(4); }]; - [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) { - make.size.mas_equalTo(CGSizeMake(1, 30)); - make.centerY.mas_equalTo(self.idLabel.mas_bottom).offset(2); - make.left.mas_equalTo(self.idLabel.mas_right).offset(30); - }]; - - [self.attentionView mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.mas_equalTo(self.lineView.mas_right); - make.centerY.mas_equalTo(self.lineView); - make.width.mas_equalTo(80); - }]; - - [self.fansView mas_makeConstraints:^(MASConstraintMaker *make) { - make.width.centerY.mas_equalTo(self.attentionView); - make.left.mas_equalTo(self.attentionView.mas_right); - }]; - - CGFloat nobleH = (KScreenWidth - 30.0)/ 345.0 * 44; - [self.nobleEntranceView mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.right.mas_equalTo(self); - make.height.mas_equalTo(nobleH); - make.bottom.mas_equalTo(self.mas_bottom).offset(0); + [self.skillCardButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerY.mas_equalTo(self.avatarImageView); + make.right.mas_equalTo(15); + make.width.mas_equalTo(87); + make.height.mas_equalTo(28); }]; + [self.attentionStackView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.levelLabel.mas_bottom).mas_offset(10); + make.height.mas_equalTo(44); + make.left.mas_equalTo(15); + make.right.mas_equalTo(-15); + }]; + CGFloat width = (KScreenWidth - 30) / 4; + CGFloat height = 44; + [self.attentionView mas_makeConstraints:^(MASConstraintMaker *make) { + make.size.mas_equalTo(CGSizeMake(width, height)); + }]; + [self.fansView mas_makeConstraints:^(MASConstraintMaker *make) { + make.size.mas_equalTo(CGSizeMake(width, height)); + }]; + [self.visitorView mas_makeConstraints:^(MASConstraintMaker *make) { + make.size.mas_equalTo(CGSizeMake(width, height)); + }]; + [self.footprintView mas_makeConstraints:^(MASConstraintMaker *make) { + make.size.mas_equalTo(CGSizeMake(width, height)); + }]; + + width = (KScreenWidth - 30 - 17) * 0.5; + height = width * 64 / 164; + [self.accountView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.attentionStackView.mas_bottom).mas_offset(16); + make.size.mas_equalTo(CGSizeMake(width, height)); + make.left.mas_equalTo(15); + }]; + [self.nobleEntranceView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.accountView); + make.size.mas_equalTo(CGSizeMake(width, height)); + make.right.mas_equalTo(-15); + }]; +} + +#pragma mark - Action +- (void)tapAvatarImageView { + if (self.delegate && [self.delegate respondsToSelector:@selector(xPMineHeadView:didClickAvatar:)]) { + [self.delegate xPMineHeadView:self didClickAvatar:self.userInfo]; + } +} +///技能卡 +- (void)tapSkillCardRecognizer { + if (self.delegate && [self.delegate respondsToSelector:@selector(xpMineHeadViewClickSkillCard)]) { + [self.delegate xpMineHeadViewClickSkillCard]; + } +} + +///粉丝 +- (void)tapFansRecognizer { + if (self.delegate && [self.delegate respondsToSelector:@selector(xpMineHeadViewClickFans)]) { + [self.delegate xpMineHeadViewClickFans]; + } +} +///关注 +- (void)tapAttentionRecognizer { + if (self.delegate && [self.delegate respondsToSelector:@selector(xpMineHeadViewClickAttention)]) { + [self.delegate xpMineHeadViewClickAttention]; + } +} +///访客 +- (void)tapVisitorRecognizer { + if (self.delegate && [self.delegate respondsToSelector:@selector(xpMineHeadViewClickVisitor)]) { + [self.delegate xpMineHeadViewClickVisitor]; + } +} +///足迹 +- (void)tapFootprintRecognizer { + if (self.delegate && [self.delegate respondsToSelector:@selector(xpMineHeadViewClickFootprint)]) { + [self.delegate xpMineHeadViewClickFootprint]; + } +} +///账号中心 +- (void)tapAccountrecognizer { + if (self.delegate && [self.delegate respondsToSelector:@selector(xpMineHeadViewClickAcount)]) { + [self.delegate xpMineHeadViewClickAcount]; + } +} +///贵族中心 +- (void)tapNobleCenterrecognizer { + if (self.delegate && [self.delegate respondsToSelector:@selector(xPMineHeadViewCliekNobleCenter)]) { + [self.delegate xPMineHeadViewCliekNobleCenter]; + } } #pragma mark - NSMutableAttributedString @@ -371,9 +427,16 @@ self.levelLabel.attributedText = [self creatNameplateLevleAttribute:_userInfo]; self.fansView.number = [NSString stringWithFormat:@"%ld",_userInfo.fansNum]; self.attentionView.number = [NSString stringWithFormat:@"%ld",_userInfo.followNum]; + self.visitorView.number = [NSString stringWithFormat:@"%ld", _userInfo.visitNum]; + self.footprintView.number = [NSString stringWithFormat:@"%ld", _userInfo.inRoomNum]; self.nobleEntranceView.hadNoble = userInfo.userVipInfoVO; } } + +- (void)setWalletInfo:(WalletInfoModel *)walletInfo { + self.accountView.diamonds = walletInfo.diamonds; +} + - (NetImageView *)avatarImageView { if (!_avatarImageView) { NetImageConfig * config = [[NetImageConfig alloc]init]; @@ -397,7 +460,7 @@ } return _nameStackView; } - + - (NetImageView *)nobleImageView { if (!_nobleImageView) { _nobleImageView = [[NetImageView alloc] init]; @@ -460,12 +523,30 @@ return _levelLabel; } -- (UIView *)lineView { - if (!_lineView) { - _lineView = [[UIView alloc] init]; - _lineView.backgroundColor = [ThemeColor dividerColor]; - } - return _lineView; +- (UIButton *)skillCardButton { + if (!_skillCardButton) { + _skillCardButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_skillCardButton setImage:[UIImage imageNamed:@"mine_normal_skill_card"] forState:UIControlStateNormal]; + [_skillCardButton setTitle:@"技能卡" forState:UIControlStateNormal]; + _skillCardButton.titleLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium]; + [_skillCardButton setTitleColor:UIColorFromRGB(0x000000) forState:UIControlStateNormal]; + [_skillCardButton setImageEdgeInsets:UIEdgeInsetsMake(0, -10, 0, 0)]; + _skillCardButton.backgroundColor = [UIColor whiteColor]; + _skillCardButton.layer.cornerRadius = 14; + _skillCardButton.layer.masksToBounds = YES; + [_skillCardButton addTarget:self action:@selector(tapSkillCardRecognizer) forControlEvents:UIControlEventTouchUpInside]; + } + return _skillCardButton; +} + +- (UIStackView *)attentionStackView { + if (!_attentionStackView) { + _attentionStackView = [[UIStackView alloc] init]; + _attentionStackView.axis = UILayoutConstraintAxisHorizontal; + _attentionStackView.distribution = UIStackViewDistributionFill; + _attentionStackView.alignment = UIStackViewAlignmentFill; + } + return _attentionStackView; } - (XPMineFriendNumberView *)attentionView { @@ -488,6 +569,35 @@ return _fansView; } +- (XPMineFriendNumberView *)visitorView { + if (!_visitorView) { + _visitorView = [[XPMineFriendNumberView alloc] init]; + _visitorView.title = @"访客"; + UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapVisitorRecognizer)]; + [_visitorView addGestureRecognizer:tap]; + } + return _visitorView; +} + +- (XPMineFriendNumberView *)footprintView { + if (!_footprintView) { + _footprintView = [[XPMineFriendNumberView alloc] init]; + _footprintView.title = @"足迹"; + UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapFootprintRecognizer)]; + [_footprintView addGestureRecognizer:tap]; + } + return _footprintView; +} + +- (XPMineAccountView *)accountView { + if (!_accountView) { + _accountView = [[XPMineAccountView alloc] init]; + UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAccountrecognizer)]; + [_accountView addGestureRecognizer:tap]; + } + return _accountView; +} + - (XPNobleCenterEntranceView *)nobleEntranceView { if (!_nobleEntranceView) { _nobleEntranceView = [[XPNobleCenterEntranceView alloc] init]; diff --git a/xplan-ios/Main/Mine/View/SubViews/XPMineSkillTipView.h b/xplan-ios/Main/Mine/View/SubViews/XPMineSkillTipView.h deleted file mode 100644 index 5f0c50e8..00000000 --- a/xplan-ios/Main/Mine/View/SubViews/XPMineSkillTipView.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// XPMineSkillTipView.h -// xplan-ios -// -// Created by GreenLand on 2022/1/19. -// - -#import - -static NSString * const kYinyouSkillCardTipKey = @"kYinyouSkillCardTipKey"; - -NS_ASSUME_NONNULL_BEGIN - - -@interface XPMineSkillTipView : UIView - -@end - -NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Mine/View/SubViews/XPMineSkillTipView.m b/xplan-ios/Main/Mine/View/SubViews/XPMineSkillTipView.m deleted file mode 100644 index e29281bc..00000000 --- a/xplan-ios/Main/Mine/View/SubViews/XPMineSkillTipView.m +++ /dev/null @@ -1,85 +0,0 @@ -// -// XPMineSkillTipView.m -// xplan-ios -// -// Created by GreenLand on 2022/1/19. -// - -#import "XPMineSkillTipView.h" -///Third -#import -///Tool -#import "ThemeColor.h" -#import "XPMacro.h" - -@interface XPMineSkillTipView() - -@property (nonatomic, strong) UIView *bgView; - -@property (nonatomic, strong) UIImageView *tipImageView; - -@end - -@implementation XPMineSkillTipView - -- (instancetype)initWithFrame:(CGRect)frame { - self = [super initWithFrame:frame]; - if (self) { - [self initSubViews]; - [self initSubViewConstraints]; - } - return self; -} - -#pragma mark - Response -- (void)onTapSkillTip:(UITapGestureRecognizer *)ges { - NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; - [defaults setObject:@"isShow" forKey:kYinyouSkillCardTipKey]; - [defaults synchronize]; - [self removeFromSuperview]; -} - -#pragma mark - Private Method -- (void)initSubViews { - [self addSubview:self.bgView]; - [self addSubview:self.tipImageView]; - UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onTapSkillTip:)]; - [self.tipImageView addGestureRecognizer:tap]; -} - -- (void)initSubViewConstraints { - CGFloat nobleH = (KScreenWidth - 30.0)/ 345.0 * 44; - [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.mas_equalTo(0); - }]; - - CGFloat margin = ((KScreenWidth - 30) / 3 - 40) * 0.5 * 0.5; - CGFloat mutiple = 405/292.0; - [self.tipImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.mas_equalTo(123 + nobleH + kSafeAreaTopHeight + kStatusBarHeight); - make.centerX.mas_equalTo(self); -// make.width.mas_equalTo(292); -// make.height.mas_equalTo(405); - make.height.mas_equalTo(self.tipImageView.mas_width).multipliedBy(mutiple); - make.right.mas_equalTo(-15 - margin); - }]; -} - -- (UIView *)bgView { - if (!_bgView) { - _bgView = [[UIView alloc] init]; - _bgView.backgroundColor = [ThemeColor tabbarNormalColor]; - } - return _bgView; -} - -- (UIImageView *)tipImageView { - if (!_tipImageView) { - _tipImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mine_skillCard_guild"]]; - _tipImageView.contentMode = UIViewContentModeScaleAspectFit; - _tipImageView.userInteractionEnabled = YES; - } - return _tipImageView; -} - -@end diff --git a/xplan-ios/Main/Mine/View/XPMineViewController.m b/xplan-ios/Main/Mine/View/XPMineViewController.m index 46a0325f..2419f3a6 100644 --- a/xplan-ios/Main/Mine/View/XPMineViewController.m +++ b/xplan-ios/Main/Mine/View/XPMineViewController.m @@ -22,15 +22,19 @@ #import "UserInfoModel.h" #import "XPMineVisitorUnReadModel.h" #import "ClanDetailInfoModel.h" +#import "HomeBannerInfoModel.h" +#import "XPMineFuntionItemModel.h" +#import "LittleGameInfoModel.h" +#import "WalletInfoModel.h" ///P #import "XPMineProtocol.h" #import "XPMinePresent.h" ///View -#import "XPMineMenuTableViewCell.h" #import "XPMineHeadItemTableViewCell.h" #import "XPMineHeadView.h" -#import "XPMineSkillTipView.h" #import "XPLittleGameRoomOpenView.h" +#import "XPMineGameTableViewCell.h" +#import "XPHomeBannerTableViewCell.h" ///VC #import "XPMineSettingViewController.h" #import "XPMineTeenagerViewController.h" @@ -50,25 +54,23 @@ #import "XPMineGuildViewController.h" -@interface XPMineViewController () +@interface XPMineViewController () ///顶部背景 @property (nonatomic, strong) UIView *bgImageView; @property (nonatomic,strong) UITableView *tableView; -///数据源 -@property (nonatomic,strong) NSMutableArray *datasource; -///赛事模块的 -@property (nonatomic,strong) NSArray *matchItemArray; -///卡片item -@property (nonatomic, strong) NSArray *cardItemArray; +///个人功能 +@property (nonatomic, strong) NSMutableArray *functionArray; +///游戏列表 +@property (nonatomic, strong) NSMutableArray *littleGameArray; +///banner列表 +@property (nonatomic, strong) NSMutableArray *bannerArray; ///头部 @property (nonatomic,strong) XPMineHeadView *headView; ///设置 @property (nonatomic,strong) UIButton *settingButton; ///用户信息 @property (nonatomic,strong) UserInfoModel *userInfo; - -@property (nonatomic, strong) XPMineSkillTipView *skillTipView; ///家族信息 @property (nonatomic,strong) ClanDetailInfoModel *clanInfo; ///我的公会 @@ -101,13 +103,19 @@ [super viewDidLoad]; [self initSubViews]; [self initSubViewConstraints]; - [self showSkillCardTipView]; } - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; [self.presenter getUserInfo]; - [self.presenter getClanDetailInfo]; + [self.presenter getPersonItemList]; + [self.presenter getLittleGameList]; + [self.presenter getMineBannerList]; +} + +- (void)viewDidAppear:(BOOL)animated { + [super viewDidAppear:animated]; + [self.presenter getUserWalletInfo]; } #pragma mark - Response @@ -123,8 +131,6 @@ [self.view addSubview:self.tableView]; [self.view addSubview:self.settingButton]; self.tableView.tableHeaderView = self.headView; - [self.presenter getNormalItems]; - [self.presenter getCardItems]; if (@available(iOS 15.0, *)) {//移除iOS15列表头默认增加的22高度 self.tableView.sectionHeaderTopPadding = 0; } @@ -146,38 +152,15 @@ }]; } -///展示技能卡引导 -- (void)showSkillCardTipView { - NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; - NSString *skillCardTip = [defaults objectForKey:kYinyouSkillCardTipKey]; - if (!skillCardTip) { - UIWindow *window = [UIApplication sharedApplication].delegate.window; - [window addSubview:self.skillTipView]; - [window bringSubviewToFront:self.skillTipView]; - } -} - -- (void)pushViewControllerWithType:(XPMineItemType)type { +- (void)pushViewControllerWithType:(NSInteger)type functionItem:(XPMineFuntionItemModel *)item { switch (type) { case XPMineItemType_Match_Manage: { XPMatchManageViewController *vc = [[XPMatchManageViewController alloc] init]; [self.navigationController pushViewController:vc animated:YES]; } break; - case XPMineItemType_Match_Apply_Record: - [self pushMatchVCWithKey:@"quotaRecord"]; - break; - case XPMineItemType_Match_Standings: - [self pushMatchVCWithKey:@"performance"]; - break; - case XPMineItemType_Match_Card_Bag: - [self pushMatchVCWithKey:@"bag"]; - break; - case XPMineItemType_Match_Shopping: - [self pushMatchVCWithKey:@"mall"]; - break; case XPMineItemType_Match_Relevance_Account: - [self pushWebViewWIthUrl:URLWithType(kGameBindAccountURL)]; + [self pushWebViewWIthUrl:item.centerUrl]; break; case XPMineItemType_Teenager_Mode: { @@ -186,18 +169,12 @@ [self.navigationController pushViewController:vc animated:YES]; } break; - case XPMineItemType_Real_Name_Authentic: - [self pushWebViewWIthUrl:URLWithType(kIdentityURL)]; - break; case XPMineItemType_Account: { XPMineRechargeViewController * rechargeVC = [[XPMineRechargeViewController alloc] init]; [self.navigationController pushViewController:rechargeVC animated:YES]; } break; - case XPMineItemType_Invite_Friend: - [self pushWebViewWIthUrl:URLWithType(kUserInviteFriendURL)]; - break; case XPMineItemType_Personinfo: { XPMineUserInfoViewController * infoVC = [[XPMineUserInfoViewController alloc] init]; @@ -243,9 +220,6 @@ [self.navigationController pushViewController:attentionVC animated:YES]; } break; - case XPMineItemType_My_Level: - [self pushWebViewWIthUrl:URLWithType(kUserLevelURL)]; - break; case XPMineItemType_Noble_Center: { XPNobleCenterViewController *nobleCenterVC = [[XPNobleCenterViewController alloc] init]; @@ -262,8 +236,8 @@ case XPMineItemType_Visitor: { [self.tabBarItem setBadgeValue:nil]; - for (XPMineItemModel * model in self.datasource) { - if (model.type == XPMineItemType_Visitor) { + for (XPMineFuntionItemModel * model in self.functionArray) { + if (model.skipType == XPMineItemType_Visitor) { model.unReadCount = 0; } } @@ -302,28 +276,23 @@ [self.navigationController pushViewController:webVC animated:YES]; } -- (void)pushMatchVCWithKey:(NSString *)key { - [[FlutterBoost instance] open:key arguments:@{@"animated":@(YES)} completion:^(BOOL success) { - }]; -} - #pragma mark - UITableViewDelegate And UITableViewDataSource -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - if (section == 0) { - return 1; - } - return self.datasource.count; +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { + return 3; } -- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - return 2; +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + return 1; } - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { if (indexPath.section == 0) { - return 96; - }; - + return 172; + } else if (indexPath.section == 1) { + return 129; + } else { + return 80; + } return 53; } @@ -333,24 +302,35 @@ if (cell == nil) { cell = [[XPMineHeadItemTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPMineHeadItemTableViewCell class])]; } - cell.datasource = self.cardItemArray; + if (self.functionArray.count) { + cell.datasource = self.functionArray; + } cell.delegate = self; return cell; - } else { - XPMineMenuTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineMenuTableViewCell class])]; + } else if (indexPath.section == 1) { + XPMineGameTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineGameTableViewCell class])]; if (cell == nil) { - cell = [[XPMineMenuTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPMineMenuTableViewCell class])]; + cell = [[XPMineGameTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPMineGameTableViewCell class])]; } - XPMineItemModel * item = [self.datasource objectAtIndex:indexPath.row]; - cell.itemModel = item; + if (self.littleGameArray.count) { + cell.datasource = self.littleGameArray; + } + cell.delegate = self; return cell; - } + } else { + XPHomeBannerTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPHomeBannerTableViewCell class])]; + if (cell == nil) { + cell = [[XPHomeBannerTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPHomeBannerTableViewCell class])]; + } + if (self.bannerArray.count) { + cell.bannerList = self.bannerArray; + } + cell.delegate = self; + return cell; + } } - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { - if (section == 1) { - return 13; - } return 16; } @@ -360,47 +340,67 @@ return view; } -- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - [tableView deselectRowAtIndexPath:indexPath animated:YES]; - XPMineItemModel * model = [self.datasource objectAtIndex:indexPath.row]; - [self pushViewControllerWithType:model.type]; -} #pragma mark - XPMineHeadViewDelegate ///点击头像 - (void)xPMineHeadView:(XPMineHeadView *)view didClickAvatar:(UserInfoModel *)info { - [self pushViewControllerWithType:XPMineItemType_Personinfo]; -} - -- (void)xPMineHeadView:(XPMineHeadView *)view didClickAccount:(UserInfoModel *)info { - [self pushViewControllerWithType:XPMineItemType_Account]; -} - -- (void)xPMineHeadView:(XPMineHeadView *)view didClickInviteFriend:(UserInfoModel *)info { - [self pushViewControllerWithType:XPMineItemType_Invite_Friend]; + [self pushViewControllerWithType:XPMineItemType_Personinfo functionItem:nil]; } +///点击了粉丝 - (void)xpMineHeadViewClickFans { - [self pushViewControllerWithType:XPMineItemType_Fans_List]; + [self pushViewControllerWithType:XPMineItemType_Fans_List functionItem:nil]; } +///点击了关注 - (void)xpMineHeadViewClickAttention { - [self pushViewControllerWithType:XPMineItemType_Attention_List]; + [self pushViewControllerWithType:XPMineItemType_Attention_List functionItem:nil]; } +///点击了技能卡 +- (void)xpMineHeadViewClickSkillCard { + [self pushViewControllerWithType:XPMineItemType_Skill_Card functionItem:nil]; +} + +///点击了访客 +- (void)xpMineHeadViewClickVisitor { + [self pushViewControllerWithType:XPMineItemType_Visitor functionItem:nil]; +} + +///点击了足迹 +- (void)xpMineHeadViewClickFootprint { +// [self pushViewControllerWithType:XPMineItemType_Attention_List]; +} + +///点击了账户中心 +- (void)xpMineHeadViewClickAcount { + [self pushViewControllerWithType:XPMineItemType_Account functionItem:nil]; +} + +///点击了贵族中心 - (void)xPMineHeadViewCliekNobleCenter { [StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventvipEntranceMeClick]; - [self pushViewControllerWithType:XPMineItemType_Noble_Center]; + [self pushViewControllerWithType:XPMineItemType_Noble_Center functionItem:nil]; } #pragma mark - XPMineProtocol -- (void)onGetNormalItemsSuccess:(NSArray *)normalItems { - [self.datasource removeAllObjects]; - [self.datasource addObjectsFromArray:normalItems]; - [self.tableView reloadData]; +///获取个人中心功能 +- (void)onGetMineFuntionItemSuccess:(NSArray *)items { + [self.functionArray removeAllObjects]; + [self.functionArray addObjectsFromArray:items]; + [self.tableView reloadData]; } -- (void)onGetCardItemsSuccess:(NSArray *)cardItems { - self.cardItemArray = cardItems; +///获取小游戏列表 +- (void)onGetLittleGameListSuccess:(NSArray *)items { + [self.littleGameArray removeAllObjects]; + [self.littleGameArray addObjectsFromArray:items]; + [self.tableView reloadData]; +} + +///获取个人中心banner +- (void)onGetPersonalBannerListSuccess:(NSArray *)items { + [self.bannerArray removeAllObjects]; + [self.bannerArray addObjectsFromArray:items]; [self.tableView reloadData]; } @@ -410,23 +410,58 @@ [self.tableView reloadData]; } +- (void)getUserWalletInfo:(WalletInfoModel *)balanceInfo { + self.headView.walletInfo = balanceInfo; +} + - (void)onGetClanDetailInfoSuccess:(ClanDetailInfoModel *)clanInfo { self.clanInfo = clanInfo; - if (self.clanInfo.clan.elderUid.length > 0 || self.clanInfo.hall.hallId) { - if (![self.datasource containsObject:self.guildItemModel]) { - [self.datasource insertObject:self.guildItemModel atIndex:3]; - } - } else { - if ([self.datasource containsObject:self.guildItemModel]) { - [self.datasource removeObject:self.guildItemModel]; - } - } - [self.tableView reloadData]; +} + +///匹配游戏房成功 +- (void)quickMatchLittleGameRoomSuccess:(NSString *)uid { + if (uid.length > 0) { + [XPRoomViewController openRoom:uid viewController:self]; + } +} + +///匹配游戏房失败 +- (void)quickMatchLittleGameRoomFail:(NSString *)mgId { + [XPRoomViewController openRoom:[NSString stringWithFormat:@"%ld", self.userInfo.uid] mgId:mgId viewController:self]; } #pragma mark - XPMineHeadItemTableViewCellDelegate -- (void)xPMineHeadItemTableViewCell:(XPMineHeadItemTableViewCell *)cell didSelectItem:(XPMineItemModel *)item { - [self pushViewControllerWithType:item.type]; +- (void)xPMineHeadItemTableViewCell:(XPMineHeadItemTableViewCell *)cell didSelectItem:(XPMineFuntionItemModel *)item { + [self pushViewControllerWithType:item.skipType functionItem:item]; +} + +#pragma mark - XPHomeBannerTableViewCellDelegate +///点击了某个banner +- (void)xPHomeBannerTableViewCell:(XPHomeBannerTableViewCell *)view didClickBanner:(HomeBannerInfoModel *)info { + switch (info.skipType) { + case HomeBannerInfoSkipType_Room: + { + if (info.skipUri.length > 0) { + [XPRoomViewController openRoom:info.skipUri viewController:self]; + } + } + break; + case HomeBannerInfoSkipType_Web: + { + XPWebViewController *vc = [[XPWebViewController alloc]init]; + vc.url = info.skipUri; + [self.navigationController pushViewController:vc animated:YES]; + } + break; + default: + break; + } +} + +#pragma mark - XPMineGameTableViewCellDelegate +///选择了某个游戏 +- (void)xPMineGameTableViewCell:(XPMineGameTableViewCell *)cell didSelectItem:(LittleGameInfoModel *)item { + [self.presenter quickMatchLittleGameWithMgId:item.mgId]; } #pragma mark - NSNotification @@ -438,9 +473,9 @@ [self.tabBarItem setBadgeValue:nil]; } - for (int i = 0; i *)functionArray { + if (!_functionArray) { + _functionArray = [NSMutableArray array]; } - return _skillTipView; + return _functionArray; } -- (XPMineItemModel *)guildItemModel { - if (!_guildItemModel) { - XPMineItemModel * guildItem = [[XPMineItemModel alloc] init]; - guildItem.itemName = @"我的公会"; - guildItem.itemImageName = @"mine_normal_my_guild"; - guildItem.type = XPMineItemType_My_Guild; - _guildItemModel = guildItem; - } - return _guildItemModel; +- (NSMutableArray *)littleGameArray { + if (!_littleGameArray) { + _littleGameArray = [NSMutableArray array]; + } + return _littleGameArray; } -- (NSMutableArray *)datasource { - if (!_datasource) { - _datasource = [NSMutableArray array]; - } - return _datasource; +- (NSMutableArray *)bannerArray { + if (!_bannerArray) { + _bannerArray = [NSMutableArray array]; + } + return _bannerArray; } @end