首页数据的接入

This commit is contained in:
fengshuo
2022-02-25 21:18:01 +08:00
parent 63763776a9
commit 93d35ee261
46 changed files with 1845 additions and 432 deletions

View File

@@ -351,6 +351,12 @@
E8AC723726F49982007D6E91 /* XPMineNotificaProtocol.h in Sources */ = {isa = PBXBuildFile; fileRef = E8AC723626F49957007D6E91 /* XPMineNotificaProtocol.h */; };
E8AC723A26F49AAE007D6E91 /* XPMineNotifyStatus.m in Sources */ = {isa = PBXBuildFile; fileRef = E8AC723926F49AAE007D6E91 /* XPMineNotifyStatus.m */; };
E8AC723D26F4B6AA007D6E91 /* XPLoginBindPhoneResultViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8AC723C26F4B6AA007D6E91 /* XPLoginBindPhoneResultViewController.m */; };
E8ACEFE927C8BC1600F66D1A /* XPHomeRecommendHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8ACEFE827C8BC1600F66D1A /* XPHomeRecommendHeaderView.m */; };
E8ACEFEC27C8C22C00F66D1A /* XPHomeHappyViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8ACEFEB27C8C22C00F66D1A /* XPHomeHappyViewController.m */; };
E8ACEFEF27C8C45100F66D1A /* XPHomeHapppyRoomTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8ACEFEE27C8C45100F66D1A /* XPHomeHapppyRoomTableViewCell.m */; };
E8ACEFF227C8E8F000F66D1A /* HomePlayRoomModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E8ACEFF127C8E8F000F66D1A /* HomePlayRoomModel.m */; };
E8ACEFF527C8EF0500F66D1A /* XPHomeHotRoomViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8ACEFF427C8EF0500F66D1A /* XPHomeHotRoomViewController.m */; };
E8ACEFF827C9034C00F66D1A /* XPHomeListEmptyTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8ACEFF727C9034C00F66D1A /* XPHomeListEmptyTableViewCell.m */; };
E8AE427327153A3500BEEBB2 /* XPRoomActivityContainerView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8AE427227153A3500BEEBB2 /* XPRoomActivityContainerView.m */; };
E8AEAED6271412EC0017FCE0 /* XPRoomViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8AEAED5271412EC0017FCE0 /* XPRoomViewController.m */; };
E8AEAEED27141AE20017FCE0 /* XPRoomBackContainerView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8AEAEEC27141AE20017FCE0 /* XPRoomBackContainerView.m */; };
@@ -403,14 +409,13 @@
E8DEC9AC2764A6CD0078CB70 /* XPRoomMoreMenuCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8DEC9AB2764A6CD0078CB70 /* XPRoomMoreMenuCollectionViewCell.m */; };
E8E5E18B27C332EE00F457D8 /* XPHomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8E5E18A27C332EE00F457D8 /* XPHomeViewController.m */; };
E8E5E18E27C3331E00F457D8 /* XPHomeRecommendViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8E5E18D27C3331E00F457D8 /* XPHomeRecommendViewController.m */; };
E8E5E19127C369F000F457D8 /* XPHomeRecommendHeadView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8E5E19027C369F000F457D8 /* XPHomeRecommendHeadView.m */; };
E8E5E19127C369F000F457D8 /* XPHomeRecommendListView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8E5E19027C369F000F457D8 /* XPHomeRecommendListView.m */; };
E8E5E19427C36BA600F457D8 /* XPHomeBannerTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8E5E19327C36BA600F457D8 /* XPHomeBannerTableViewCell.m */; };
E8E5E19727C36BE700F457D8 /* XPHomeRecommendTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8E5E19627C36BE700F457D8 /* XPHomeRecommendTableViewCell.m */; };
E8E5E19A27C36C0B00F457D8 /* XPHomeHotRoomTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8E5E19927C36C0B00F457D8 /* XPHomeHotRoomTableViewCell.m */; };
E8E5E19D27C36C3500F457D8 /* XPHomeMenuTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8E5E19C27C36C3500F457D8 /* XPHomeMenuTableViewCell.m */; };
E8E5E1A027C36E3F00F457D8 /* HomeBannerInfoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E8E5E19F27C36E3F00F457D8 /* HomeBannerInfoModel.m */; };
E8E5E1A327C3730B00F457D8 /* XPHomeSectionView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8E5E1A227C3730B00F457D8 /* XPHomeSectionView.m */; };
E8E5E1A627C37F0C00F457D8 /* XPHomeRecommendCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8E5E1A527C37F0C00F457D8 /* XPHomeRecommendCollectionViewCell.m */; };
E8E5E1A927C3850400F457D8 /* XPHomeHotRoomCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8E5E1A827C3850400F457D8 /* XPHomeHotRoomCollectionViewCell.m */; };
E8E5E1AF27C3920100F457D8 /* XPHomeRecommendPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E8E5E1AE27C3920100F457D8 /* XPHomeRecommendPresenter.m */; };
E8E5E1B327C397A400F457D8 /* HomeMenuInfoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E8E5E1B227C397A400F457D8 /* HomeMenuInfoModel.m */; };
@@ -1128,6 +1133,18 @@
E8AC723926F49AAE007D6E91 /* XPMineNotifyStatus.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineNotifyStatus.m; sourceTree = "<group>"; };
E8AC723B26F4B6AA007D6E91 /* XPLoginBindPhoneResultViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPLoginBindPhoneResultViewController.h; sourceTree = "<group>"; };
E8AC723C26F4B6AA007D6E91 /* XPLoginBindPhoneResultViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPLoginBindPhoneResultViewController.m; sourceTree = "<group>"; };
E8ACEFE727C8BC1600F66D1A /* XPHomeRecommendHeaderView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeRecommendHeaderView.h; sourceTree = "<group>"; };
E8ACEFE827C8BC1600F66D1A /* XPHomeRecommendHeaderView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPHomeRecommendHeaderView.m; sourceTree = "<group>"; };
E8ACEFEA27C8C22C00F66D1A /* XPHomeHappyViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeHappyViewController.h; sourceTree = "<group>"; };
E8ACEFEB27C8C22C00F66D1A /* XPHomeHappyViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPHomeHappyViewController.m; sourceTree = "<group>"; };
E8ACEFED27C8C45100F66D1A /* XPHomeHapppyRoomTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeHapppyRoomTableViewCell.h; sourceTree = "<group>"; };
E8ACEFEE27C8C45100F66D1A /* XPHomeHapppyRoomTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPHomeHapppyRoomTableViewCell.m; sourceTree = "<group>"; };
E8ACEFF027C8E8F000F66D1A /* HomePlayRoomModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HomePlayRoomModel.h; sourceTree = "<group>"; };
E8ACEFF127C8E8F000F66D1A /* HomePlayRoomModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HomePlayRoomModel.m; sourceTree = "<group>"; };
E8ACEFF327C8EF0500F66D1A /* XPHomeHotRoomViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeHotRoomViewController.h; sourceTree = "<group>"; };
E8ACEFF427C8EF0500F66D1A /* XPHomeHotRoomViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPHomeHotRoomViewController.m; sourceTree = "<group>"; };
E8ACEFF627C9034B00F66D1A /* XPHomeListEmptyTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeListEmptyTableViewCell.h; sourceTree = "<group>"; };
E8ACEFF727C9034C00F66D1A /* XPHomeListEmptyTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPHomeListEmptyTableViewCell.m; sourceTree = "<group>"; };
E8AE427127153A3500BEEBB2 /* XPRoomActivityContainerView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomActivityContainerView.h; sourceTree = "<group>"; };
E8AE427227153A3500BEEBB2 /* XPRoomActivityContainerView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomActivityContainerView.m; sourceTree = "<group>"; };
E8AEAED4271412EC0017FCE0 /* XPRoomViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomViewController.h; sourceTree = "<group>"; };
@@ -1231,8 +1248,8 @@
E8E5E18A27C332EE00F457D8 /* XPHomeViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPHomeViewController.m; sourceTree = "<group>"; };
E8E5E18C27C3331E00F457D8 /* XPHomeRecommendViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeRecommendViewController.h; sourceTree = "<group>"; };
E8E5E18D27C3331E00F457D8 /* XPHomeRecommendViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPHomeRecommendViewController.m; sourceTree = "<group>"; };
E8E5E18F27C369F000F457D8 /* XPHomeRecommendHeadView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeRecommendHeadView.h; sourceTree = "<group>"; };
E8E5E19027C369F000F457D8 /* XPHomeRecommendHeadView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPHomeRecommendHeadView.m; sourceTree = "<group>"; };
E8E5E18F27C369F000F457D8 /* XPHomeRecommendListView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeRecommendListView.h; sourceTree = "<group>"; };
E8E5E19027C369F000F457D8 /* XPHomeRecommendListView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPHomeRecommendListView.m; sourceTree = "<group>"; };
E8E5E19227C36BA600F457D8 /* XPHomeBannerTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeBannerTableViewCell.h; sourceTree = "<group>"; };
E8E5E19327C36BA600F457D8 /* XPHomeBannerTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPHomeBannerTableViewCell.m; sourceTree = "<group>"; };
E8E5E19527C36BE700F457D8 /* XPHomeRecommendTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeRecommendTableViewCell.h; sourceTree = "<group>"; };
@@ -1245,8 +1262,6 @@
E8E5E19F27C36E3F00F457D8 /* HomeBannerInfoModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HomeBannerInfoModel.m; sourceTree = "<group>"; };
E8E5E1A127C3730B00F457D8 /* XPHomeSectionView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeSectionView.h; sourceTree = "<group>"; };
E8E5E1A227C3730B00F457D8 /* XPHomeSectionView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPHomeSectionView.m; sourceTree = "<group>"; };
E8E5E1A427C37F0C00F457D8 /* XPHomeRecommendCollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeRecommendCollectionViewCell.h; sourceTree = "<group>"; };
E8E5E1A527C37F0C00F457D8 /* XPHomeRecommendCollectionViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPHomeRecommendCollectionViewCell.m; sourceTree = "<group>"; };
E8E5E1A727C3850400F457D8 /* XPHomeHotRoomCollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeHotRoomCollectionViewCell.h; sourceTree = "<group>"; };
E8E5E1A827C3850400F457D8 /* XPHomeHotRoomCollectionViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPHomeHotRoomCollectionViewCell.m; sourceTree = "<group>"; };
E8E5E1AD27C3920100F457D8 /* XPHomeRecommendPresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeRecommendPresenter.h; sourceTree = "<group>"; };
@@ -3301,6 +3316,8 @@
E8E5E19F27C36E3F00F457D8 /* HomeBannerInfoModel.m */,
E8E5E1B127C397A400F457D8 /* HomeMenuInfoModel.h */,
E8E5E1B227C397A400F457D8 /* HomeMenuInfoModel.m */,
E8ACEFF027C8E8F000F66D1A /* HomePlayRoomModel.h */,
E8ACEFF127C8E8F000F66D1A /* HomePlayRoomModel.m */,
);
path = Model;
sourceTree = "<group>";
@@ -3318,6 +3335,10 @@
E8E5E18A27C332EE00F457D8 /* XPHomeViewController.m */,
E8E5E18C27C3331E00F457D8 /* XPHomeRecommendViewController.h */,
E8E5E18D27C3331E00F457D8 /* XPHomeRecommendViewController.m */,
E8ACEFEA27C8C22C00F66D1A /* XPHomeHappyViewController.h */,
E8ACEFEB27C8C22C00F66D1A /* XPHomeHappyViewController.m */,
E8ACEFF327C8EF0500F66D1A /* XPHomeHotRoomViewController.h */,
E8ACEFF427C8EF0500F66D1A /* XPHomeHotRoomViewController.m */,
E8C6FFDE2754EEF9004DC9F0 /* XPHomeSearchViewController.h */,
E8C6FFDF2754EEF9004DC9F0 /* XPHomeSearchViewController.m */,
E87A27012758BC81002DDC7A /* XPRoomSearchContainerViewController.h */,
@@ -3344,18 +3365,20 @@
E8C6FFE22754F349004DC9F0 /* XPSearchListTableViewCell.m */,
E87A26FE27588445002DDC7A /* XPHomeListEmptyCollectionViewCell.h */,
E87A26FF27588445002DDC7A /* XPHomeListEmptyCollectionViewCell.m */,
E8ACEFF627C9034B00F66D1A /* XPHomeListEmptyTableViewCell.h */,
E8ACEFF727C9034C00F66D1A /* XPHomeListEmptyTableViewCell.m */,
E8E5E19227C36BA600F457D8 /* XPHomeBannerTableViewCell.h */,
E8E5E19327C36BA600F457D8 /* XPHomeBannerTableViewCell.m */,
E8E5E19B27C36C3500F457D8 /* XPHomeMenuTableViewCell.h */,
E8E5E19C27C36C3500F457D8 /* XPHomeMenuTableViewCell.m */,
E8E5E19527C36BE700F457D8 /* XPHomeRecommendTableViewCell.h */,
E8E5E19627C36BE700F457D8 /* XPHomeRecommendTableViewCell.m */,
E8E5E1A427C37F0C00F457D8 /* XPHomeRecommendCollectionViewCell.h */,
E8E5E1A527C37F0C00F457D8 /* XPHomeRecommendCollectionViewCell.m */,
E8E5E19827C36C0B00F457D8 /* XPHomeHotRoomTableViewCell.h */,
E8E5E19927C36C0B00F457D8 /* XPHomeHotRoomTableViewCell.m */,
E8E5E1A727C3850400F457D8 /* XPHomeHotRoomCollectionViewCell.h */,
E8E5E1A827C3850400F457D8 /* XPHomeHotRoomCollectionViewCell.m */,
E8ACEFED27C8C45100F66D1A /* XPHomeHapppyRoomTableViewCell.h */,
E8ACEFEE27C8C45100F66D1A /* XPHomeHapppyRoomTableViewCell.m */,
);
path = Cell;
sourceTree = "<group>";
@@ -3369,8 +3392,10 @@
E8C6FFD62754BC61004DC9F0 /* XPHomeNavView.m */,
E8C6FFE82755040B004DC9F0 /* XPHomeSearchNavView.h */,
E8C6FFE92755040B004DC9F0 /* XPHomeSearchNavView.m */,
E8E5E18F27C369F000F457D8 /* XPHomeRecommendHeadView.h */,
E8E5E19027C369F000F457D8 /* XPHomeRecommendHeadView.m */,
E8ACEFE727C8BC1600F66D1A /* XPHomeRecommendHeaderView.h */,
E8ACEFE827C8BC1600F66D1A /* XPHomeRecommendHeaderView.m */,
E8E5E18F27C369F000F457D8 /* XPHomeRecommendListView.h */,
E8E5E19027C369F000F457D8 /* XPHomeRecommendListView.m */,
E8E5E1A127C3730B00F457D8 /* XPHomeSectionView.h */,
E8E5E1A227C3730B00F457D8 /* XPHomeSectionView.m */,
);
@@ -3812,6 +3837,7 @@
E8E5E1AF27C3920100F457D8 /* XPHomeRecommendPresenter.m in Sources */,
181D7F1B2726CE2A00B7C059 /* StageView.m in Sources */,
18EE3FF12750D2AD00A452BF /* NIMTimeUtils.m in Sources */,
E8ACEFEF27C8C45100F66D1A /* XPHomeHapppyRoomTableViewCell.m in Sources */,
E84BF7DA277C72AC00EF8877 /* XPRoomRoleTableViewCell.m in Sources */,
E839532D276A030F00CF2F24 /* XPMineDressUpListViewController.m in Sources */,
E8B846D826FDE17300A777FE /* XPMineRechargeProtocol.h in Sources */,
@@ -3898,6 +3924,7 @@
18EE3FF42750FA3700A452BF /* UIView+NIM.m in Sources */,
E8A03DFF27635F960098D9EA /* XPRoomCandyGiftView.m in Sources */,
180116F9279E8C4C00F2CBC0 /* PLTimeUtil.m in Sources */,
E8ACEFF227C8E8F000F66D1A /* HomePlayRoomModel.m in Sources */,
E8252FEE27687DF1002B3164 /* ActivityInfoModel.m in Sources */,
E84BF7D1277BFCDD00EF8877 /* RoomTagModel.m in Sources */,
E8AC723526F49939007D6E91 /* XPMineNotificaPresenter.m in Sources */,
@@ -4039,8 +4066,8 @@
E8C6FFE02754EEF9004DC9F0 /* XPHomeSearchViewController.m in Sources */,
E8AE427327153A3500BEEBB2 /* XPRoomActivityContainerView.m in Sources */,
E86596432701611A00846EBD /* UIImage+ImageEffects.m in Sources */,
E8ACEFE927C8BC1600F66D1A /* XPHomeRecommendHeaderView.m in Sources */,
18486217271EAB8C005FC5DC /* BaseRtcImpl.m in Sources */,
E8E5E1A627C37F0C00F457D8 /* XPHomeRecommendCollectionViewCell.m in Sources */,
E8DACCFB2766EDC60052092C /* MicroGiftValueView.m in Sources */,
E8CEA03D26EA3DE500644B44 /* LoginPasswordPresent.m in Sources */,
E8E70D7726F2F15100F03460 /* XPMineViewController.m in Sources */,
@@ -4067,6 +4094,7 @@
189DD56526DE465A00AB55B1 /* LoginViewController.m in Sources */,
E824544B26F5BBB800BE8163 /* XPMineModifPayPwdViewController.m in Sources */,
E81C1B2227705F950020D1E4 /* Api+ArrangeMic.m in Sources */,
E8ACEFF527C8EF0500F66D1A /* XPHomeHotRoomViewController.m in Sources */,
E84150C227747BF700A7F548 /* FirstRechargeModel.m in Sources */,
E8A1E4512762082A00B294CA /* Api+CandyTree.m in Sources */,
E839533C276A0CCD00CF2F24 /* XPMineCarTableViewCell.m in Sources */,
@@ -4074,7 +4102,7 @@
E839532A276A002800CF2F24 /* XPMineDressUpViewController.m in Sources */,
E88B5CAD26FB16A800DA9178 /* XPMineTeenagerDesView.m in Sources */,
E896EF972771AAE400AD2CC1 /* XPMineAttentionPresenter.m in Sources */,
E8E5E19127C369F000F457D8 /* XPHomeRecommendHeadView.m in Sources */,
E8E5E19127C369F000F457D8 /* XPHomeRecommendListView.m in Sources */,
E8C6FFDA2754BE81004DC9F0 /* ThemeColor+Home.m in Sources */,
E824545126F5CE6E00BE8163 /* XPMineModifPayPwdPresenter.m in Sources */,
E8EEB90F26FC6AB8007C6EBA /* XPMineUserInfoEditPresenter.m in Sources */,
@@ -4159,9 +4187,11 @@
E84150BF27747BD300A7F548 /* Api+FirstRecharge.m in Sources */,
E84B0E422727EE0A008818C6 /* XPRoomMessageHeaderView.m in Sources */,
E8C6FFDD2754CF5D004DC9F0 /* HomeRecommendRoomModel.m in Sources */,
E8ACEFEC27C8C22C00F66D1A /* XPHomeHappyViewController.m in Sources */,
E890BC10273D23F00007C46B /* GiftInfoModel.m in Sources */,
E84BF7E0277C869A00EF8877 /* XPRoomOnLineViewController.m in Sources */,
186A534826FC6ED900D67B2C /* TTAlertButtonConfig.m in Sources */,
E8ACEFF827C9034C00F66D1A /* XPHomeListEmptyTableViewCell.m in Sources */,
E89D60BA271D643A001F8895 /* Api+Room.m in Sources */,
E872308926E89BE000B90D4F /* LoginPhoneViewController.m in Sources */,
E8C6FFEA2755040B004DC9F0 /* XPHomeSearchNavView.m in Sources */,

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 299 B

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 670 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 557 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 954 B

View File

@@ -4,6 +4,7 @@
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19144"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
@@ -19,6 +20,7 @@
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
</imageView>
</subviews>
<viewLayoutGuide key="safeArea" id="uVf-aP-EuO"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="saT-Dw-TKR" firstAttribute="trailing" secondItem="Ze5-6b-2t3" secondAttribute="trailing" id="Pfd-Eo-1XS"/>

View File

@@ -56,10 +56,21 @@ NS_ASSUME_NONNULL_BEGIN
/// @param uid 用户的uid
+ (void)homeRecommendRoomList:(HttpRequestHelperCompletion)completion uid:(NSString *)uid;
/// 请求热门房间列表
/// 请求个播房间列表
/// @param completion 完成
+ (void)homeHotRoomList:(HttpRequestHelperCompletion)completion;
/// 请求热门房间列表
/// @param completion 完成
+ (void)homePersonalRoomList:(HttpRequestHelperCompletion)completion uid:(NSString *)uid;
/// 请求组队开黑房间列表
/// @param completion 完成
/// @param uid 用户的uid
/// @param pageNum 当前页数
/// @param pageSize 一页多少个
+ (void)homePlayGameTeam:(HttpRequestHelperCompletion)completion uid:(NSString *)uid pageNum:(NSString *)pageNum pageSize:(NSString *)pageSize;
@end
NS_ASSUME_NONNULL_END

View File

@@ -59,9 +59,24 @@
[self makeRequest:@"home/tab/homeV2" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, uid, nil];
}
///
///
/// @param completion
+ (void)homeHotRoomList:(HttpRequestHelperCompletion)completion {
[self makeRequest:@"single/broadcast/getMainPopularityAnchorList" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, nil];
}
///
/// @param completion
+ (void)homePersonalRoomList:(HttpRequestHelperCompletion)completion uid:(NSString *)uid {
[self makeRequest:@"home/hotRoom" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__,uid, nil];
}
///
/// @param completion
/// @param uid uid
/// @param pageNum
/// @param pageSize
+ (void)homePlayGameTeam:(HttpRequestHelperCompletion)completion uid:(NSString *)uid pageNum:(NSString *)pageNum pageSize:(NSString *)pageSize {
[self makeRequest:@"home/playV2" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__,uid , pageNum, pageSize,nil];
}
@end

View File

@@ -0,0 +1,51 @@
//
// HomePlayRoomModel.h
// xplan-ios
//
// Created by 冯硕 on 2022/2/25.
//
#import <Foundation/Foundation.h>
#import "XPEnum.h"
#import "HomeBannerInfoModel.h"
NS_ASSUME_NONNULL_BEGIN
@class HomePlayMicUserModel;
@interface HomePlayRoomModel : NSObject
///头像
@property (nonatomic, copy) NSString *avatar;
///是否在跨房PK中
@property (nonatomic, assign) BOOL crossPking;
///平台号
@property(nonatomic, copy) NSString *erbanNo;
///是否有列表中的banner
@property (nonatomic, assign) BOOL isBanner;
///小游戏ID
@property(nonatomic, copy) NSString *mgId;
///小游戏名称
@property(nonatomic, copy) NSString *mgName;
///麦上用户
@property (nonatomic, strong) NSArray<HomePlayMicUserModel *> *micUsers;
///在线人数
@property (nonatomic, assign) NSInteger onlineNum;
///标签图片地址
@property (nonatomic, strong) NSString *tagPict;
///房间标题
@property (nonatomic, copy) NSString *title;
///房主的uid
@property (nonatomic,copy) NSString *uid;
///列表中的banner信息
@property (nonatomic, strong) NSArray<HomeBannerInfoModel *> *bannerVoList;
@end
@interface HomePlayMicUserModel : NSObject
///头像
@property (nonatomic, copy) NSString *avatar;
///性别
@property (nonatomic,assign) GenderType gender;
///姓名
@property (nonatomic,copy) NSString *nick;
///用户的uid
@property (nonatomic,copy) NSString *uid;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,26 @@
//
// HomePlayRoomModel.m
// xplan-ios
//
// Created by on 2022/2/25.
//
#import "HomePlayRoomModel.h"
@implementation HomePlayRoomModel
///
///
+ (NSDictionary *)objectClassInArray {
return @{
@"micUsers": [HomePlayMicUserModel class],
@"bannerVoList": [HomeBannerInfoModel class]
};
}
@end
@implementation HomePlayMicUserModel
@end

View File

@@ -30,8 +30,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,copy) NSString *roomId;
///房主的uid
@property (nonatomic,copy) NSString *uid;
///用户简介
@property(nonatomic, copy) NSString *userDesc;
///房间简介
@property(nonatomic, copy) NSString *roomDesc;
@end
NS_ASSUME_NONNULL_END

View File

@@ -12,12 +12,15 @@ NS_ASSUME_NONNULL_BEGIN
@interface XPHomeRecommendPresenter : BaseMvpPresenter
/// 获取首页顶部的轮播图
- (void)getHomeTopBannerList;
/// 获取首页资源列表
- (void)getHomeMenuList;
/// 获取首页推荐列表
- (void)getHomeRecommendRoomList;
/// 获取首页热门房间列表
- (void)getHomeHotRoomList;
/// 热门房间(个人房)列表
- (void)getHomePersonalRoomList;
/// 组队开黑房间列表
/// @param pageNum 当前的页数
- (void)getPlayGameWithTeam:(int)pageNum;
@end
NS_ASSUME_NONNULL_END

View File

@@ -6,33 +6,48 @@
//
#import "XPHomeRecommendPresenter.h"
#import <ReactiveObjC/ReactiveObjC.h>
#import "Api+Home.h"
#import "AccountInfoStorage.h"
#import "HomeMenuInfoModel.h"
#import "HomeRecommendRoomModel.h"
#import "HomeBannerInfoModel.h"
#import "HomePlayRoomModel.h"
#import "XPHomeRecommendProtocol.h"
@implementation XPHomeRecommendPresenter
///
- (void)getHomeTopBannerList {
RACSubject* banner = [RACSubject subject];
RACSubject* menu = [RACSubject subject];
[[RACSignal combineLatest:@[banner, menu] reduce:^id(NSArray* bannerList, NSArray* menuList){
[[self getView] getHomeTopBannerListSuccess:bannerList menuList:menuList];
return nil;
}] subscribeError:^(NSError * _Nullable error) {
}];
NSString * uid = [AccountInfoStorage instance].getUid;
[Api homeBannerList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
NSArray * array = [HomeBannerInfoModel modelsWithArray:data.data];
[[self getView] getHomeTopBannerListSuccess:array];
[banner sendNext:array];
[banner sendCompleted];
}fail:^(NSInteger code, NSString * _Nullable msg) {
[banner sendNext:nil];
[banner sendCompleted];
}] uid:uid type:@"9"];
}
///
- (void)getHomeMenuList {
NSString * uid = [AccountInfoStorage instance].getUid;
[Api homeMenuList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
NSArray * array = [HomeMenuInfoModel modelsWithArray:data.data];
[[self getView] getHomeMenuListSuccess:array];
[menu sendNext:array];
[menu sendCompleted];
} fail:^(NSInteger code, NSString * _Nullable msg) {
[menu sendNext:nil];
[menu sendCompleted];
}] uid:uid];
}
///
- (void)getHomeRecommendRoomList {
NSString * uid = [AccountInfoStorage instance].getUid;
@@ -46,8 +61,30 @@
- (void)getHomeHotRoomList {
[Api homeHotRoomList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
NSArray * array = [HomeRecommendRoomModel modelsWithArray:data.data];
// [[self getView] getHomeHotRoomListSuccess:array];
[[self getView] getHomeHotRoomListSuccess:array];
}]];
}
///
/// @param pageNum
- (void)getPlayGameWithTeam:(int)pageNum {
NSString * uid = [AccountInfoStorage instance].getUid;
NSString * pageNumStr = [NSString stringWithFormat:@"%d", pageNum];
[Api homePlayGameTeam:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
NSArray * array = [HomePlayRoomModel modelsWithArray:data.data];
[[self getView] getPlayGameWithTeamSuccess:array];
}] uid:uid pageNum:pageNumStr pageSize:@"20"];
}
///
- (void)getHomePersonalRoomList {
NSString * uid = [AccountInfoStorage instance].getUid;
[Api homePersonalRoomList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
NSArray * array = [HomePlayRoomModel modelsWithArray:data.data];
[[self getView] getHomePersonalRoomListSuccess:array];
}] uid:uid];
}
@end

View File

@@ -11,13 +11,15 @@ NS_ASSUME_NONNULL_BEGIN
@protocol XPHomeRecommendProtocol <NSObject>
///获取首页轮播图列表成功
- (void)getHomeTopBannerListSuccess:(NSArray*)list;
///获取首页菜单列表成功
- (void)getHomeMenuListSuccess:(NSArray *)list;
- (void)getHomeTopBannerListSuccess:(NSArray*)list menuList:(NSArray *)memuList;
///获取首页推荐列表成功
- (void)getHomeRecommendRoomListSuccess:(NSArray *)list;
///获取首页热门房列表成功
- (void)getHomeHotRoomListSuccess:(NSArray *)list;
///获取个人房列表成功
- (void)getHomePersonalRoomListSuccess:(NSArray *)list;
///获取组队开黑房间列表成功
- (void)getPlayGameWithTeamSuccess:(NSArray *)list;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,16 @@
//
// XPHomeHapppyRoomTableViewCell.h
// xplan-ios
//
// Created by 冯硕 on 2022/2/25.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@class HomePlayRoomModel;
@interface XPHomeHapppyRoomTableViewCell : UITableViewCell
@property (nonatomic,strong) HomePlayRoomModel *roomInfo;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,259 @@
//
// XPHomeHapppyRoomTableViewCell.m
// xplan-ios
//
// Created by on 2022/2/25.
//
#import "XPHomeHapppyRoomTableViewCell.h"
///Third
#import <Masonry/Masonry.h>
///Tool
#import "ThemeColor.h"
#import "NetImageView.h"
///Model
#import "HomePlayRoomModel.h"
@interface XPHomeHapppyRoomTableViewCell ()
///
@property (nonatomic,strong) NetImageView *avatarImageView;
///
@property (nonatomic,strong) UIImageView *backView;
///
@property (nonatomic,strong) UILabel *roomTitleLabel;
///
@property (nonatomic,strong) NetImageView *roomTagImageView;
///
@property (nonatomic,strong) UIStackView *stackView;
///
@property (nonatomic,strong) NetImageView *firstImageView;
///
@property (nonatomic,strong) NetImageView *secondImageView;
///
@property (nonatomic,strong) NetImageView *thirdImageView;
///logo
@property (nonatomic,strong) UIImageView *logoImageView;
///
@property (nonatomic,strong) UILabel *numberLabel;
@end
@implementation XPHomeHapppyRoomTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
[self initSubViews];
[self initSubViewConstraints];
}
return self;
}
#pragma mark - Private Method
- (void)initSubViews {
self.backgroundColor = [UIColor clearColor];
self.selectionStyle = UITableViewCellSelectionStyleNone;
[self.contentView addSubview:self.backView];
[self.contentView addSubview:self.avatarImageView];
[self.backView addSubview:self.roomTitleLabel];
[self.backView addSubview:self.roomTagImageView];
[self.backView addSubview:self.stackView];
[self.backView addSubview:self.logoImageView];
[self.backView addSubview:self.numberLabel];
[self.stackView addArrangedSubview:self.firstImageView];
[self.stackView addArrangedSubview:self.secondImageView];
[self.stackView addArrangedSubview:self.thirdImageView];
}
- (void)initSubViewConstraints {
[self.backView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.mas_equalTo(self.contentView).inset(15);
make.top.mas_equalTo(self.contentView).offset(8);
make.height.mas_equalTo(86);
}];
[self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(70, 70));
make.right.mas_equalTo(self.contentView).offset(-15);
make.top.mas_equalTo(self.contentView);
}];
[self.roomTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.backView).offset(34);
make.top.mas_equalTo(self.backView).offset(13);
make.right.mas_lessThanOrEqualTo(self.avatarImageView);
}];
[self.roomTagImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(38, 16));
make.left.mas_equalTo(self.roomTitleLabel);
make.top.mas_equalTo(self.roomTitleLabel.mas_bottom).offset(3);
}];
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.roomTagImageView.mas_right).offset(8);
make.height.mas_equalTo(16);
make.centerY.mas_equalTo(self.roomTagImageView);
}];
[self.firstImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(16);
}];
[self.secondImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(16);
}];
[self.thirdImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(16);
}];
[self.logoImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(12, 13));
make.centerY.mas_equalTo(self.roomTagImageView);
make.left.mas_equalTo(self.stackView.mas_right).offset(11);
}];
[self.numberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self.roomTagImageView);
make.left.mas_equalTo(self.logoImageView.mas_right).offset(2);
}];
}
#pragma mark - Getters And Setters
- (void)setRoomInfo:(HomePlayRoomModel *)roomInfo {
_roomInfo = roomInfo;
if (_roomInfo) {
self.roomTitleLabel.text = _roomInfo.title;
self.roomTagImageView.imageUrl = _roomInfo.tagPict;
self.numberLabel.text = [NSString stringWithFormat:@"%ld", _roomInfo.onlineNum];
self.avatarImageView.imageUrl = _roomInfo.avatar;
if (_roomInfo.micUsers.count > 3) {
_roomInfo.micUsers = [_roomInfo.micUsers subarrayWithRange:NSMakeRange(0, 3)];
}
for (int i = 0; i < self.stackView.subviews.count; i++) {
NetImageView * imageView = [self.stackView.subviews objectAtIndex:i];
if (i < _roomInfo.micUsers.count) {
HomePlayMicUserModel * userInfo = [_roomInfo.micUsers objectAtIndex:i];
imageView.imageUrl = userInfo.avatar;
imageView.hidden = NO;
} else {
imageView.hidden = YES;
}
}
}
}
- (UIImageView *)backView {
if (!_backView) {
_backView = [[UIImageView alloc] init];
_backView.contentMode = UIViewContentModeScaleAspectFill;
_backView.image = [UIImage imageNamed:@"home_recommend_play_list_bg"];
}
return _backView;
}
- (NetImageView *)avatarImageView {
if (!_avatarImageView) {
NetImageConfig * config = [[NetImageConfig alloc]init];
config.imageType = ImageTypeUserIcon;
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
_avatarImageView = [[NetImageView alloc] initWithConfig:config];
_avatarImageView.layer.masksToBounds = YES;
_avatarImageView.layer.cornerRadius = 20;
_avatarImageView.layer.borderWidth = 1.5;
_avatarImageView.layer.borderColor = UIColorFromRGB(0xCCD7FF).CGColor;
}
return _avatarImageView;
}
- (UILabel *)roomTitleLabel {
if (!_roomTitleLabel) {
_roomTitleLabel = [[UILabel alloc] init];
_roomTitleLabel.font = [UIFont systemFontOfSize:14];
_roomTitleLabel.textColor = [ThemeColor mainTextColor];
}
return _roomTitleLabel;
}
- (NetImageView *)roomTagImageView {
if (!_roomTagImageView) {
_roomTagImageView = [[NetImageView alloc] init];
_roomTagImageView.userInteractionEnabled = YES;
}
return _roomTagImageView;
}
- (UIStackView *)stackView {
if (!_stackView) {
_stackView = [[UIStackView alloc] init];
_stackView.axis = UILayoutConstraintAxisHorizontal;
_stackView.distribution = UIStackViewDistributionFill;
_stackView.alignment = UIStackViewAlignmentFill;
_stackView.spacing = 2;
}
return _stackView;
}
- (NetImageView *)firstImageView {
if (!_firstImageView) {
NetImageConfig * config = [[NetImageConfig alloc]init];
config.imageType = ImageTypeUserIcon;
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
_firstImageView = [[NetImageView alloc] initWithConfig:config];
_firstImageView.layer.masksToBounds = YES;
_firstImageView.layer.cornerRadius = 8;
_firstImageView.layer.borderWidth = 1;
_firstImageView.layer.borderColor = [UIColor whiteColor].CGColor;
}
return _firstImageView;
}
- (NetImageView *)secondImageView {
if (!_secondImageView) {
NetImageConfig * config = [[NetImageConfig alloc]init];
config.imageType = ImageTypeUserIcon;
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
_secondImageView = [[NetImageView alloc] initWithConfig:config];
_secondImageView.layer.masksToBounds = YES;
_secondImageView.layer.cornerRadius = 8;
_secondImageView.layer.borderWidth = 1;
_secondImageView.layer.borderColor = [UIColor whiteColor].CGColor;
}
return _secondImageView;
}
- (NetImageView *)thirdImageView {
if (!_thirdImageView) {
NetImageConfig * config = [[NetImageConfig alloc]init];
config.imageType = ImageTypeUserIcon;
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
_thirdImageView = [[NetImageView alloc] initWithConfig:config];
_thirdImageView.layer.masksToBounds = YES;
_thirdImageView.layer.cornerRadius = 8;
_thirdImageView.layer.borderWidth = 1;
_thirdImageView.layer.borderColor = [UIColor whiteColor].CGColor;
}
return _thirdImageView;
}
- (UIImageView *)logoImageView {
if (!_logoImageView) {
_logoImageView = [[UIImageView alloc] init];
_logoImageView.userInteractionEnabled = YES;
_logoImageView.image = [UIImage imageNamed:@"home_recommend_play_person_logo"];
}
return _logoImageView;
}
- (UILabel *)numberLabel {
if (!_numberLabel) {
_numberLabel = [[UILabel alloc] init];
_numberLabel.font = [UIFont systemFontOfSize:12];
_numberLabel.textColor = [ThemeColor secondTextColor];
}
return _numberLabel;
}
@end

View File

@@ -11,6 +11,8 @@ NS_ASSUME_NONNULL_BEGIN
@class HomeRecommendRoomModel;
@interface XPHomeHotRoomCollectionViewCell : UICollectionViewCell
@property (nonatomic,strong) HomeRecommendRoomModel * hotRoomInfo;
///当前是第几个
@property (nonatomic,assign) NSInteger indexPathRow;
@end
NS_ASSUME_NONNULL_END

View File

@@ -16,24 +16,23 @@
#import "HomeRecommendRoomModel.h"
@interface XPHomeHotRoomCollectionViewCell ()
///
@property (nonatomic,strong) NetImageView *backImageView;
///
@property (nonatomic,strong) NetImageView *avatarImageView;
///
@property (nonatomic,strong) UILabel *roomTitleLabel;
///
@property (nonatomic,strong) UILabel *nickLabel;
///
@property (nonatomic,strong) UIImageView *sexImageView;
///
@property (nonatomic,strong) UIView * roomDesView;
///
@property (nonatomic,strong) UIImageView *backImageView;
///
@property (nonatomic,strong) NetImageView *roomTagImageView;
///
@property (nonatomic,strong) UILabel *roomDesLabel;
///
@property (nonatomic,strong) UIImageView *coverImageView;
///note
@property (nonatomic,strong) UIImageView *notImageView;
///
@property (nonatomic,strong) UILabel *roomTitleLabel;
///
@property (nonatomic,strong) NetImageView *avatarImageView;
///
@property (nonatomic,strong) UIImageView *sexImageView;
///
@property (nonatomic,strong) UILabel *nickLabel;
@end
@implementation XPHomeHotRoomCollectionViewCell
@@ -51,65 +50,59 @@
#pragma mark - Private Method
- (void)initSubViews {
[self.contentView addSubview:self.backImageView];
[self.contentView addSubview:self.coverImageView];
[self.contentView addSubview:self.avatarImageView];
[self.contentView addSubview:self.roomTitleLabel];
[self.contentView addSubview:self.nickLabel];
[self.contentView addSubview:self.sexImageView];
[self.contentView addSubview:self.roomDesView];
[self.roomDesView addSubview:self.roomTagImageView];
[self.roomDesView addSubview:self.roomDesLabel];
[self.backImageView addSubview:self.roomTagImageView];
[self.backImageView addSubview:self.roomDesLabel];
[self.backImageView addSubview:self.notImageView];
[self.backImageView addSubview:self.roomTitleLabel];
[self.backImageView addSubview:self.avatarImageView];
[self.backImageView addSubview:self.sexImageView];
[self.backImageView addSubview:self.nickLabel];
}
- (void)initSubViewConstraints {
[self.backImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.contentView);
}];
[self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(48, 48));
make.top.left.mas_equalTo(self.contentView).offset(9);
}];
[self.coverImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.backImageView);
}];
[self.roomTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.avatarImageView.mas_right).offset(7);
make.top.mas_equalTo(self.avatarImageView);
make.right.mas_lessThanOrEqualTo(self.contentView);
}];
[self.nickLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.roomTitleLabel);
make.top.mas_equalTo(self.roomTitleLabel.mas_bottom).offset(2);
}];
[self.sexImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.nickLabel.mas_right).offset(4);
make.centerY.mas_equalTo(self.nickLabel);
make.size.mas_equalTo(CGSizeMake(14, 14));
}];
[self.roomDesView mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(self.contentView).offset(10);
make.left.mas_equalTo(self.contentView).offset(9);
make.height.mas_equalTo(28);
make.bottom.mas_equalTo(self.contentView).offset(-8);
make.left.right.top.mas_equalTo(self.contentView);
make.bottom.mas_equalTo(self.contentView).offset(-4);
}];
[self.roomTagImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(38, 18));
make.left.mas_equalTo(self.roomDesView).offset(8);
make.centerY.mas_equalTo(self.roomDesView);
make.left.top.mas_equalTo(self.backImageView);
}];
[self.roomDesLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.roomDesView.mas_right).offset(4);
make.centerY.mas_equalTo(self.roomDesView);
make.left.mas_equalTo(self.backImageView).offset(13);
make.right.mas_equalTo(self.backImageView).offset(-4);
make.top.mas_equalTo(self.backImageView).offset(22);
}];
[self.notImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(13, 9.6));
make.top.mas_equalTo(self.roomDesLabel.mas_bottom).offset(3);
make.left.mas_equalTo(self.roomDesLabel);
}];
[self.roomTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.notImageView.mas_right).offset(5);
make.centerY.mas_equalTo(self.notImageView);
make.right.mas_lessThanOrEqualTo(self.backImageView);
}];
[self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(50, 50));
make.centerX.mas_equalTo(self.backImageView);
make.top.mas_equalTo(self.notImageView.mas_bottom).offset(9);
}];
[self.nickLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.mas_equalTo(self.backImageView);
make.top.mas_equalTo(self.avatarImageView.mas_bottom).offset(3);
}];
[self.sexImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.bottom.mas_equalTo(self.avatarImageView);
make.size.mas_equalTo(CGSizeMake(14, 14));
}];
}
#pragma mark - Getters And Setters
@@ -117,21 +110,31 @@
_hotRoomInfo = hotRoomInfo;
if (_hotRoomInfo) {
self.avatarImageView.imageUrl = _hotRoomInfo.avatar;
self.backImageView.imageUrl = _hotRoomInfo.avatar;
self.roomTitleLabel.text = _hotRoomInfo.title;
self.roomTagImageView.imageUrl = _hotRoomInfo.tagPict;
self.nickLabel.text = _hotRoomInfo.nick;
self.sexImageView.image = _hotRoomInfo.gender == GenderType_Female ? [UIImage imageNamed:@"common_female"] : [UIImage imageNamed:@"common_male"];
self.roomDesLabel.text = _hotRoomInfo.userDesc;
self.roomDesLabel.text = _hotRoomInfo.roomDesc;
}
}
- (NetImageView *)backImageView {
- (void)setIndexPathRow:(NSInteger)indexPathRow {
_indexPathRow = (indexPathRow + 1);
if (_indexPathRow % 2 != 0) {
self.backImageView.image = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0xC0C9FF), UIColorFromRGB(0xFEDAFF)] gradientType:GradientTypeTopToBottom imgSize:CGSizeMake(10, 10)];
} else {
self.backImageView.image = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0xFFF8D9), UIColorFromRGB(0xEAFFD8)] gradientType:GradientTypeTopToBottom imgSize:CGSizeMake(10, 10)];
}
}
- (UIImageView *)backImageView {
if (!_backImageView) {
_backImageView = [[NetImageView alloc] init];
_backImageView = [[UIImageView alloc] init];
_backImageView.contentMode = UIViewContentModeScaleAspectFill;
_backImageView.layer.masksToBounds = YES;
_backImageView.layer.cornerRadius = 8;
_backImageView.layer.shadowOffset = CGSizeMake(4, 4);
_backImageView.layer.shadowColor = UIColorRGBAlpha(0xEBEEF3, 0.7).CGColor;
}
return _backImageView;
}
@@ -144,6 +147,8 @@
_avatarImageView = [[NetImageView alloc] initWithConfig:config];
_avatarImageView.layer.masksToBounds = YES;
_avatarImageView.layer.cornerRadius = 48/2;
_avatarImageView.layer.borderColor = [UIColor whiteColor].CGColor;
_avatarImageView.layer.borderWidth = 1.1;
}
return _avatarImageView;
}
@@ -162,6 +167,7 @@
_nickLabel = [[UILabel alloc] init];
_nickLabel.font = [UIFont systemFontOfSize:12];
_nickLabel.textColor = [ThemeColor mainTextColor];
_nickLabel.textAlignment = NSTextAlignmentCenter;
}
return _nickLabel;
}
@@ -174,16 +180,6 @@
return _sexImageView;
}
- (UIView *)roomDesView {
if (!_roomDesView) {
_roomDesView = [[UIView alloc] init];
_roomDesView.backgroundColor = UIColorRGBAlpha(0x9DADFF, 0.3);
_roomDesView.layer.masksToBounds = YES;
_roomDesView.layer.cornerRadius = 14;
}
return _roomDesView;
}
- (NetImageView *)roomTagImageView {
if (!_roomTagImageView) {
_roomTagImageView = [[NetImageView alloc] init];
@@ -194,19 +190,19 @@
- (UILabel *)roomDesLabel {
if (!_roomDesLabel) {
_roomDesLabel = [[UILabel alloc] init];
_roomDesLabel.font = [UIFont systemFontOfSize:12];
_roomDesLabel.textColor = [ThemeColor mainTextColor];
_roomDesLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium];
_roomDesLabel.textColor = UIColorFromRGB(0x000000);
_roomDesLabel.numberOfLines = 0.2;
}
return _roomDesLabel;
}
- (UIImageView *)coverImageView {
if (!_coverImageView) {
_coverImageView = [[UIImageView alloc] init];
_coverImageView.userInteractionEnabled = YES;
_coverImageView.image = [UIImage imageNamed:@"home_recommend_hot_cover_bg"];
- (UIImageView *)notImageView {
if (!_notImageView) {
_notImageView = [[UIImageView alloc] init];
_notImageView.image = [UIImage imageNamed:@"home_recommend_hot_note"];
}
return _coverImageView;
return _notImageView;
}
@end

View File

@@ -44,7 +44,7 @@
#pragma mark - UICollectionViewDelegate And UICollectionViewDatasource
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
return CGSizeMake(188, 96);
return CGSizeMake(156, 162);
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
@@ -55,6 +55,7 @@
XPHomeHotRoomCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPHomeHotRoomCollectionViewCell class]) forIndexPath:indexPath];
HomeRecommendRoomModel * info = [self.hotAnchorList objectAtIndex:indexPath.row];
cell.hotRoomInfo = info;
cell.indexPathRow = indexPath.row;
return cell;
}
@@ -62,7 +63,6 @@
[collectionView deselectItemAtIndexPath:indexPath animated:YES];
}
#pragma mark - Getters And Setters
- (void)setHotAnchorList:(NSArray *)hotAnchorList {
_hotAnchorList = hotAnchorList;

View File

@@ -0,0 +1,16 @@
//
// XPHomeListEmptyTableViewCell.h
// xplan-ios
//
// Created by 冯硕 on 2022/2/25.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface XPHomeListEmptyTableViewCell : UITableViewCell
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,70 @@
//
// XPHomeListEmptyTableViewCell.m
// xplan-ios
//
// Created by on 2022/2/25.
//
#import "XPHomeListEmptyTableViewCell.h"
///Third
#import <Masonry/Masonry.h>
///Tool
#import "ThemeColor.h"
#import "UIImageConstant.h"
@interface XPHomeListEmptyTableViewCell ()
@property (nonatomic,strong) UIImageView *emptyImageView;
@property (nonatomic,strong) UILabel *titleLabel;
@end
@implementation XPHomeListEmptyTableViewCell
- (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.contentView addSubview:self.emptyImageView];
[self.contentView addSubview:self.titleLabel];
}
- (void)initSubViewConstraints {
[self.emptyImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self.contentView);
make.top.mas_equalTo(self.contentView).offset(150);
make.size.mas_equalTo(CGSizeMake(100, 100));
}];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.emptyImageView.mas_bottom).offset(20);
make.left.right.mas_equalTo(self.contentView);
}];
}
#pragma mark - Getters And Setters
- (UIImageView *)emptyImageView {
if (!_emptyImageView) {
_emptyImageView = [[UIImageView alloc] init];
_emptyImageView.userInteractionEnabled = YES;
_emptyImageView.image = [UIImageConstant defalutEmptyPlaceholder];
_emptyImageView.layer.masksToBounds = YES;
_emptyImageView.contentMode = UIViewContentModeScaleAspectFit;
}
return _emptyImageView;
}
- (UILabel *)titleLabel {
if (!_titleLabel) {
_titleLabel = [[UILabel alloc] init];
_titleLabel.text = @"暂无数据";
_titleLabel.font = [UIFont systemFontOfSize:16];
_titleLabel.textAlignment = NSTextAlignmentCenter;
_titleLabel.textColor = [ThemeColor secondTextColor];
}
return _titleLabel;
}
@end

View File

@@ -16,6 +16,8 @@
#import "HomeMenuInfoModel.h"
@interface XPHomeMenuTableViewCell ()
///
@property (nonatomic,strong) UIStackView *stackView;
@property (nonatomic,strong) NetImageView *firstMenuView;
@property (nonatomic,strong) NetImageView *secondMenuView;
@property (nonatomic,strong) NetImageView *thirdMenuView;
@@ -37,32 +39,29 @@
- (void)initSubViews {
self.backgroundColor = [UIColor clearColor];
self.selectionStyle = UITableViewCellSelectionStyleNone;
[self.contentView addSubview:self.firstMenuView];
[self.contentView addSubview:self.secondMenuView];
[self.contentView addSubview:self.thirdMenuView];
[self.contentView addSubview:self.stackView];
[self.stackView addArrangedSubview:self.firstMenuView];
[self.stackView addArrangedSubview:self.secondMenuView];
[self.stackView addArrangedSubview:self.thirdMenuView];
self.menuViewList = @[self.firstMenuView, self.secondMenuView, self.thirdMenuView];
}
- (void)initSubViewConstraints {
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.mas_equalTo(self.contentView).inset(15);
make.top.bottom.mas_equalTo(self.contentView);
}];
CGFloat width1 = (KScreenWidth - 30 - 8) * 176 / (176 + 82 + 80);
CGFloat width2 = (KScreenWidth - 30 - 8) * 82 / (176 + 82 + 80);
CGFloat width3 = (KScreenWidth - 30 - 8) * 80 / (176 + 82 + 80);
[self.firstMenuView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(15);
make.bottom.mas_equalTo(0);
make.height.mas_equalTo(60);
make.width.mas_equalTo(width1);
}];
[self.secondMenuView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.firstMenuView.mas_right).mas_offset(4);
make.bottom.mas_equalTo(0);
make.height.mas_equalTo(60);
make.width.mas_equalTo(width2);
}];
[self.thirdMenuView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.secondMenuView.mas_right).mas_offset(4);
make.bottom.mas_equalTo(0);
make.height.mas_equalTo(60);
make.width.mas_equalTo(width3);
}];
}
@@ -131,5 +130,16 @@
return _thirdMenuView;
}
- (UIStackView *)stackView {
if (!_stackView) {
_stackView = [[UIStackView alloc] init];
_stackView.axis = UILayoutConstraintAxisHorizontal;
_stackView.distribution = UIStackViewDistributionFillProportionally;
_stackView.alignment = UIStackViewAlignmentFill;
_stackView.spacing = 4;
}
return _stackView;
}
@end

View File

@@ -11,11 +11,23 @@
///Tool
#import "XPMacro.h"
///View
#import "XPHomeRecommendCollectionViewCell.h"
#import "XPHomeRecommendListView.h"
@interface XPHomeRecommendTableViewCell ()<UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout>
///
@property (nonatomic,strong) UICollectionView *collectionView;
@interface XPHomeRecommendTableViewCell ()
///
@property (nonatomic,strong) XPHomeRecommendListView *firstView;
///
@property (nonatomic,strong) XPHomeRecommendListView *secondView;
///
@property (nonatomic,strong) XPHomeRecommendListView *thirdView;
///
@property (nonatomic,strong) XPHomeRecommendListView *fourthView;
///
@property (nonatomic,strong) XPHomeRecommendListView *fiftView;
///
@property (nonatomic,strong) XPHomeRecommendListView *sixView;
@property (nonatomic,strong) NSArray<XPHomeRecommendListView *> *viewList;
@end
@implementation XPHomeRecommendTableViewCell
@@ -32,59 +44,142 @@
- (void)initSubViews {
self.backgroundColor = [UIColor clearColor];
self.selectionStyle = UITableViewCellSelectionStyleNone;
[self.contentView addSubview:self.collectionView];
[self.contentView addSubview:self.firstView];
[self.contentView addSubview:self.secondView];
[self.contentView addSubview:self.thirdView];
[self.contentView addSubview:self.fourthView];
[self.contentView addSubview:self.fiftView];
[self.contentView addSubview:self.sixView];
self.viewList = @[self.firstView, self.secondView, self.thirdView,self.fourthView, self.fiftView, self.sixView];
}
- (void)initSubViewConstraints {
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.mas_equalTo(self.contentView).inset(15);
make.top.bottom.mas_equalTo(self.contentView);
CGFloat spaceWidth = 11 * kScreenScale;
[self.firstView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(226 * kScreenScale, 230 * kScreenScale));
make.left.mas_equalTo(self.contentView).offset(15);
make.top.mas_equalTo(self.contentView);
}];
[self.secondView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(108 * kScreenScale, 108 * kScreenScale));
make.left.mas_equalTo(self.firstView.mas_right).offset(spaceWidth);
make.top.mas_equalTo(self.contentView);
}];
[self.thirdView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.left.mas_equalTo(self.secondView);
make.top.mas_equalTo(self.secondView.mas_bottom).offset(spaceWidth);
}];
[self.fourthView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(self.secondView);
make.left.mas_equalTo(self.firstView);
make.top.mas_equalTo(self.firstView.mas_bottom).offset(spaceWidth);
}];
[self.fiftView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(self.secondView);
make.top.mas_equalTo(self.fourthView);
make.left.mas_equalTo(self.fourthView.mas_right).offset(spaceWidth);
}];
[self.sixView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(self.secondView);
make.left.mas_equalTo(self.fiftView.mas_right).offset(spaceWidth);
make.top.mas_equalTo(self.fourthView);
}];
}
#pragma mark - Event Response
- (void)tapRecognizer:(UITapGestureRecognizer *)tap {
#pragma mark - UICollectionViewDelegate And UICollectionViewDatasource
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
CGFloat itemWidth = (CGFloat)(KScreenWidth - 15 * 2 - 8 * 2 - 4) / (CGFloat)3;
return CGSizeMake(itemWidth, itemWidth+ 22);
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
return 6;
}
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
XPHomeRecommendCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPHomeRecommendCollectionViewCell class]) forIndexPath:indexPath];
if (indexPath.row <= (self.recommendList.count -1)) {
HomeRecommendRoomModel * info = [self.recommendList objectAtIndex:indexPath.row];
cell.recommendRoomInfo = info;
} else {
cell.recommendRoomInfo = nil;
}
return cell;
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
[collectionView deselectItemAtIndexPath:indexPath animated:YES];
}
#pragma mark - Getters And Setters
- (void)setRecommendList:(NSArray *)recommendList {
_recommendList = recommendList;
[self.collectionView reloadData];
if (_recommendList.count > 6) {
_recommendList = [_recommendList subarrayWithRange:NSMakeRange(0, 6)];
}
for (int i = 0; i < self.viewList.count; i++) {
XPHomeRecommendListView * recommendView = [self.viewList objectAtIndex:i];
if (i < _recommendList.count) {
HomeRecommendRoomModel * recommend = [_recommendList objectAtIndex:i];
recommendView.recommendRoomInfo = recommend;
} else {
recommendView.recommendRoomInfo = nil;
}
}
}
- (UICollectionView *)collectionView{
if (!_collectionView) {
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
layout.minimumLineSpacing = 16;
layout.minimumInteritemSpacing = 8;
_collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
_collectionView.dataSource = self;
_collectionView.delegate = self;
_collectionView.backgroundColor = [UIColor clearColor];
[_collectionView registerClass:[XPHomeRecommendCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([XPHomeRecommendCollectionViewCell class])];
- (XPHomeRecommendListView *)firstView {
if (!_firstView) {
_firstView = [[XPHomeRecommendListView alloc] init];
_firstView.isLarge = YES;
_firstView.tag = 1001;
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapRecognizer:)];
[_firstView addGestureRecognizer:tap];
}
return _collectionView;
return _firstView;
}
- (XPHomeRecommendListView *)secondView {
if (!_secondView) {
_secondView = [[XPHomeRecommendListView alloc] init];
_secondView.isLarge = NO;
_secondView.tag = 1002;
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapRecognizer:)];
[_secondView addGestureRecognizer:tap];
}
return _secondView;
}
- (XPHomeRecommendListView *)thirdView {
if (!_thirdView) {
_thirdView = [[XPHomeRecommendListView alloc] init];
_thirdView.isLarge = NO;
_thirdView.tag = 1003;
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapRecognizer:)];
[_thirdView addGestureRecognizer:tap];
}
return _thirdView;
}
- (XPHomeRecommendListView *)fourthView {
if (!_fourthView) {
_fourthView = [[XPHomeRecommendListView alloc] init];
_fourthView.isLarge = NO;
_fourthView.tag = 1004;
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapRecognizer:)];
[_fourthView addGestureRecognizer:tap];
}
return _fourthView;
}
- (XPHomeRecommendListView *)fiftView {
if (!_fiftView) {
_fiftView = [[XPHomeRecommendListView alloc] init];
_fiftView.isLarge = NO;
_fiftView.tag = 1005;
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapRecognizer:)];
[_fiftView addGestureRecognizer:tap];
}
return _fiftView;
}
- (XPHomeRecommendListView *)sixView {
if (!_sixView) {
_sixView = [[XPHomeRecommendListView alloc] init];
_sixView.isLarge = NO;
_sixView.tag = 1006;
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapRecognizer:)];
[_sixView addGestureRecognizer:tap];
}
return _sixView;
}
@end

View File

@@ -1,16 +0,0 @@
//
// XPHomeRecommendHeadView.h
// xplan-ios
//
// Created by 冯硕 on 2022/2/21.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface XPHomeRecommendHeadView : UIView
@end
NS_ASSUME_NONNULL_END

View File

@@ -1,38 +0,0 @@
//
// XPHomeRecommendHeadView.m
// xplan-ios
//
// Created by on 2022/2/21.
//
#import "XPHomeRecommendHeadView.h"
@interface XPHomeRecommendHeadView ()
///
@property (nonatomic,strong) UITableView *tableView;
@end
@implementation XPHomeRecommendHeadView
- (instancetype)initWithFrame:(CGRect)frame {
if (self= [super initWithFrame:frame]) {
[self initSubViews];
[self initSubViewConstraints];
}
return self;
}
#pragma mark - Private Method
- (void)initSubViews {
}
- (void)initSubViewConstraints {
}
#pragma mark - Getters And Setters
@end

View File

@@ -0,0 +1,27 @@
//
// XPHomeRecommendHeaderView.h
// xplan-ios
//
// Created by 冯硕 on 2022/2/25.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@class HomeMenuInfoModel,HomeBannerInfoModel,HomeRecommendRoomModel;
@interface XPHomeRecommendHeaderView : UIView
///当前的控制器
@property (nonatomic,weak) UIViewController *currenViewController;
///获取当前View的高度
+ (CGFloat)getHomeRecommendHeaderViewHeight:(NSArray *)bannerList menuList:(NSArray *)menuList recommendList:(NSArray *)recommendList hotRoomList:(NSArray *)hotRoomList;
///菜单列表
@property (nonatomic,strong) NSArray<HomeMenuInfoModel *> *menuList;
///轮播图
@property (nonatomic,strong) NSArray<HomeBannerInfoModel *> *bannerList;
///推荐房
@property (nonatomic,strong) NSArray<HomeRecommendRoomModel *> *recommendList;
///热门房
@property (nonatomic,strong) NSArray<HomeRecommendRoomModel *> *hotRoomList;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,267 @@
//
// XPHomeRecommendHeaderView.m
// xplan-ios
//
// Created by on 2022/2/25.
//
#import "XPHomeRecommendHeaderView.h"
///Third
#import <Masonry/Masonry.h>
///Tool
#import "XPMacro.h"
///View
#import "XPHomeBannerTableViewCell.h"
#import "XPHomeMenuTableViewCell.h"
#import "XPHomeRecommendTableViewCell.h"
#import "XPHomeHotRoomTableViewCell.h"
#import "XPHomeSectionView.h"
///Model
#import "HomeMenuInfoModel.h"
#import "HomeBannerInfoModel.h"
#import "HomeRecommendRoomModel.h"
///VC
#import "XPWebViewController.h"
#import "XPRoomViewController.h"
#define bannerHeight 140
#define menuHeight 60
#define recommendHeight (230 + 11 +108) * kScreenScale
#define hotRoomHeight (162 + 4)
#define sectionHeight 38
@interface XPHomeRecommendHeaderView ()<UITableViewDelegate, UITableViewDataSource, XPHomeMenuTableViewCellDelegate, XPHomeBannerTableViewCellDelegate>
///
@property (nonatomic,strong) UITableView *tableView;
@end
@implementation XPHomeRecommendHeaderView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self initSubViews];
[self initSubViewConstraints];
}
return self;
}
#pragma mark - Public Method
+ (CGFloat)getHomeRecommendHeaderViewHeight:(NSArray *)bannerList menuList:(NSArray *)menuList recommendList:(NSArray *)recommendList hotRoomList:(NSArray *)hotRoomList{
CGFloat totaHeight = 0;
totaHeight = bannerHeight + menuHeight + sectionHeight + recommendHeight + sectionHeight + hotRoomHeight + 10;
if (bannerList.count <= 0) {
totaHeight-= bannerHeight;
}
if (menuList.count <= 0) {
totaHeight-= menuHeight;
}
if (recommendList.count <= 0) {
totaHeight-= recommendHeight;
totaHeight-= sectionHeight;
}
if (hotRoomList.count <= 0) {
totaHeight-= hotRoomHeight;
totaHeight-= sectionHeight;
}
return totaHeight;
}
#pragma mark - Private Method
- (void)initSubViews {
[self addSubview:self.tableView];
}
- (void)initSubViewConstraints {
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self).offset(10);
make.left.right.bottom.mas_equalTo(self);
}];
}
#pragma mark - UITableViewDelegate And UITableViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 4;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
if (section == 0) {
return self.bannerList.count >0 ? 1 : 0;
} else if(section == 1) {
return self.menuList.count > 0 ? 1 : 0;
} else if(section == 2) {
return self.recommendList.count > 0 ? 1 : 0;
} else if(section == 3) {
return self.hotRoomList.count > 0 ? 1 : 0;
}
return 0;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.section == 0) {
return bannerHeight;
} else if(indexPath.section == 1) {
return menuHeight;
} else if(indexPath.section == 2) {
return recommendHeight;
} else if(indexPath.section == 3) {
return hotRoomHeight;
}
return 0;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
if (section == 2) {
return self.recommendList.count > 0 ? sectionHeight : 0;
} else if(section == 3) {
return self.hotRoomList.count > 0 ? sectionHeight : 0;
}
return 0.01f;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
if (section == 2) {
XPHomeSectionView * sectionView = [[XPHomeSectionView alloc] init];
sectionView.frame = CGRectMake(0, 0, KScreenWidth, sectionHeight);
sectionView.imageName = @"home_recommend_section_logo";
sectionView.title = @"最新推荐";
return sectionView;
} else if (section == 3) {
XPHomeSectionView * sectionView = [[XPHomeSectionView alloc] init];
sectionView.frame = CGRectMake(0, 0, KScreenWidth, sectionHeight);
sectionView.imageName = @"home_hot_section_logo";
sectionView.title = @"人气主播";
return sectionView;
}
return [UIView new];
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
return 0.01f;
}
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
return [[UIView alloc]init];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.section == 0) {
XPHomeBannerTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPHomeBannerTableViewCell class])];
if (cell == nil) {
cell = [[XPHomeBannerTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPHomeBannerTableViewCell class])];
}
cell.delegate = self;
cell.bannerList = self.bannerList;
return cell;
} else if(indexPath.section == 1) {
XPHomeMenuTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPHomeMenuTableViewCell class])];
if (cell == nil) {
cell = [[XPHomeMenuTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPHomeMenuTableViewCell class])];
}
cell.delegate = self;
cell.menuList = self.menuList;
return cell;
} else if(indexPath.section == 2) {
XPHomeRecommendTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPHomeRecommendTableViewCell class])];
if (cell == nil) {
cell = [[XPHomeRecommendTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPHomeRecommendTableViewCell class])];
}
cell.recommendList = self.recommendList;
return cell;
} else {
XPHomeHotRoomTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPHomeHotRoomTableViewCell class])];
if (cell == nil) {
cell = [[XPHomeHotRoomTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPHomeHotRoomTableViewCell class])];
}
cell.hotAnchorList = self.hotRoomList;
return cell;
}
}
//UItableview headerview
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
CGFloat sectionHeaderHeight = sectionHeight;
if (scrollView.contentOffset.y<=sectionHeaderHeight&&scrollView.contentOffset.y>=0) {
scrollView.contentInset = UIEdgeInsetsMake(-scrollView.contentOffset.y, 0, 0, 0);
} else if (scrollView.contentOffset.y>=sectionHeaderHeight) {
scrollView.contentInset = UIEdgeInsetsMake(-sectionHeaderHeight, 0, 0, 0);
}
}
#pragma mark - XPHomeMenuTableViewCellDelegate
- (void)xPHomeMenuTableViewCell:(XPHomeMenuTableViewCell *)view didClickMenuInfo:(HomeMenuInfoModel *)info {
if (info.resourceType == HomeMenuResourceType_H5) {
XPWebViewController * webVC = [[ XPWebViewController alloc] init];
webVC.url = info.resourceContent;
[self.currenViewController.navigationController pushViewController:webVC animated:YES];
} else {
if (info.hid.length > 0) {
[XPRoomViewController openRoom:info.hid viewController:self.currenViewController];
}
}
}
#pragma mark - XPHomeBannerTableViewCellDelegate
- (void)xPHomeBannerTableViewCell:(XPHomeBannerTableViewCell *)view didClickBanner:(HomeBannerInfoModel *)info {
switch (info.skipType) {
case HomeBannerInfoSkipType_Room:
{
if (info.skipUri.length > 0) {
[XPRoomViewController openRoom:info.skipUri viewController:self.currenViewController];
}
}
break;
case HomeBannerInfoSkipType_Web:
{
XPWebViewController *vc = [[XPWebViewController alloc]init];
vc.url = info.skipUri;
[self.currenViewController.navigationController pushViewController:vc animated:YES];
}
break;
default:
break;
}
}
#pragma mark - Getters And Setters
- (void)setBannerList:(NSArray<HomeBannerInfoModel *> *)bannerList {
_bannerList = bannerList;
[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationNone];
}
- (void)setMenuList:(NSArray<HomeMenuInfoModel *> *)menuList {
_menuList = menuList;
[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:1] withRowAnimation:UITableViewRowAnimationNone];
}
- (void)setRecommendList:(NSArray<HomeRecommendRoomModel *> *)recommendList {
_recommendList = recommendList;
[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:2] withRowAnimation:UITableViewRowAnimationNone];
}
- (void)setHotRoomList:(NSArray<HomeRecommendRoomModel *> *)hotRoomList {
_hotRoomList = hotRoomList;
[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:3] withRowAnimation:UITableViewRowAnimationNone];
}
- (UITableView *)tableView {
if (!_tableView) {
_tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped];
_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 registerClass:[XPHomeBannerTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPHomeBannerTableViewCell class])];
[_tableView registerClass:[XPHomeMenuTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPHomeMenuTableViewCell class])];
[_tableView registerClass:[XPHomeRecommendTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPHomeRecommendTableViewCell class])];
[_tableView registerClass:[XPHomeHotRoomTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPHomeHotRoomTableViewCell class])];
}
return _tableView;
}
@end

View File

@@ -1,5 +1,5 @@
//
// XPHomeRecommendCollectionViewCell.h
// XPHomeRecommendHeadView.h
// xplan-ios
//
// Created by 冯硕 on 2022/2/21.
@@ -9,8 +9,10 @@
NS_ASSUME_NONNULL_BEGIN
@class HomeRecommendRoomModel;
@interface XPHomeRecommendCollectionViewCell : UICollectionViewCell
@interface XPHomeRecommendListView : UIView
@property (nonatomic,strong, nullable) HomeRecommendRoomModel *recommendRoomInfo;
///是否是最大的那个
@property (nonatomic,assign) BOOL isLarge;
@end
NS_ASSUME_NONNULL_END

View File

@@ -1,11 +1,11 @@
//
// XPHomeRecommendCollectionViewCell.m
// XPHomeRecommendHeadView.m
// xplan-ios
//
// Created by on 2022/2/21.
//
#import "XPHomeRecommendCollectionViewCell.h"
#import "XPHomeRecommendListView.h"
///Third
#import <Masonry/Masonry.h>
///Tool
@@ -14,7 +14,7 @@
///Model
#import "HomeRecommendRoomModel.h"
@interface XPHomeRecommendCollectionViewCell ()
@interface XPHomeRecommendListView ()
///
@property (nonatomic,strong) UIView * backView;
///
@@ -25,11 +25,15 @@
@property (nonatomic,strong) UIImageView *hotImageView;
///线
@property (nonatomic,strong) UILabel *numberLabel;
///
@property (nonatomic,strong) UIImageView *shadowImageView;
///
@property (nonatomic,strong) UILabel *nickLabel;
///
@property (nonatomic,strong) NetImageView *tagImageView;
@end
@implementation XPHomeRecommendCollectionViewCell
@implementation XPHomeRecommendListView
- (instancetype)initWithFrame:(CGRect)frame
{
@@ -43,12 +47,13 @@
#pragma mark - Private Method
- (void)initSubViews {
self.backgroundColor = [UIColor clearColor];
[self.contentView addSubview:self.backView];
[self addSubview:self.backView];
[self.backView addSubview:self.avatarImageView];
[self.backView addSubview:self.personContainerView];
[self.backView addSubview:self.shadowImageView];
[self.backView addSubview:self.nickLabel];
[self.backView addSubview:self.tagImageView];
[self.personContainerView addSubview:self.hotImageView];
[self.personContainerView addSubview:self.numberLabel];
@@ -56,37 +61,33 @@
- (void)initSubViewConstraints {
[self.backView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.contentView);
make.edges.mas_equalTo(self);
}];
[self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.top.mas_equalTo(self.backView);
make.height.mas_equalTo(self.avatarImageView.mas_width);
}];
[self.personContainerView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.backView).offset(6);
make.height.mas_equalTo(16);
make.bottom.mas_equalTo(self.avatarImageView.mas_bottom).offset(-3);
make.right.mas_equalTo(self.numberLabel.mas_right).offset(3);
make.edges.mas_equalTo(self);
}];
[self.hotImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(13, 13));
make.left.mas_equalTo(self.personContainerView).offset(3);
make.right.mas_equalTo(self.numberLabel.mas_left).offset(-2);
make.centerY.mas_equalTo(self.personContainerView);
}];
[self.numberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.hotImageView.mas_right).offset(2);
make.right.mas_equalTo(self.personContainerView.mas_right).offset(-4);
make.centerY.mas_equalTo(self.personContainerView);
}];
[self.nickLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.backView).offset(3);
make.right.mas_equalTo(self.backView);
make.height.mas_equalTo(22);
make.top.mas_equalTo(self.avatarImageView.mas_bottom);
[self.shadowImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.mas_equalTo(self.backView);
make.height.mas_equalTo(48);
make.bottom.mas_equalTo(self.backView);
}];
[self.tagImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.mas_equalTo(self.backView);
make.size.mas_equalTo(CGSizeMake(52, 24));
}];
}
@@ -98,6 +99,7 @@
self.numberLabel.text = [NSString stringWithFormat:@"%ld", _recommendRoomInfo.onlineNum];
self.nickLabel.text = _recommendRoomInfo.title;
self.personContainerView.hidden = NO;
self.tagImageView.imageUrl = _recommendRoomInfo.tagPict;
} else {
self.avatarImageView.image = [UIImage imageNamed:@"home_recommend_room_placeholder"];
self.nickLabel.text = @"虚位以待";
@@ -105,19 +107,59 @@
}
}
- (void)setIsLarge:(BOOL)isLarge {
_isLarge = isLarge;
if (_isLarge) {
[self.nickLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.backView).offset(10);
make.right.mas_lessThanOrEqualTo(self.personContainerView.mas_left).offset(-2);
make.centerY.mas_equalTo(self.shadowImageView);
}];
[self.personContainerView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.hotImageView.mas_left).offset(-4);
make.height.mas_equalTo(16);
make.centerY.mas_equalTo(self.shadowImageView);
make.right.mas_equalTo(self.backView).offset(-11);
}];
[self.shadowImageView mas_updateConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(48);
}];
self.nickLabel.font = [UIFont boldSystemFontOfSize:18];
} else {
[self.nickLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.backView).offset(6);
make.right.mas_equalTo(self.backView).inset(-2);
make.centerY.mas_equalTo(self.shadowImageView);
}];
[self.personContainerView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.hotImageView.mas_left).offset(-4);
make.height.mas_equalTo(16);
make.top.mas_equalTo(self.backView).offset(4);
make.right.mas_equalTo(self.backView).offset(-4);
}];
[self.shadowImageView mas_updateConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(28);
}];
self.nickLabel.font = [UIFont boldSystemFontOfSize:12];
}
}
- (UIView *)backView {
if (!_backView) {
_backView = [[UIView alloc] init];
_backView.backgroundColor = [ThemeColor appCellBackgroundColor];
_backView.backgroundColor = [UIColor clearColor];
_backView.layer.masksToBounds = YES;
_backView.layer.cornerRadius = 8;
_backView.layer.shadowColor = UIColorRGBAlpha(0xE5E5F2, 0.34).CGColor;
_backView.layer.shadowOffset = CGSizeMake(5, 5);
_backView.layer.shadowOffset = CGSizeMake(3, 3);
}
return _backView;
}
- (NetImageView *)avatarImageView {
if (!_avatarImageView) {
NetImageConfig * config = [[NetImageConfig alloc]init];
@@ -130,10 +172,17 @@
return _avatarImageView;
}
- (NetImageView *)tagImageView {
if (!_tagImageView) {
_tagImageView = [[NetImageView alloc] init];
}
return _tagImageView;
}
- (UIView *)personContainerView {
if (!_personContainerView) {
_personContainerView = [[UIView alloc] init];
_personContainerView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.2];
_personContainerView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.29];
_personContainerView.layer.masksToBounds = YES;
_personContainerView.layer.cornerRadius = 8;
}
@@ -152,8 +201,8 @@
- (UILabel *)nickLabel {
if (!_nickLabel) {
_nickLabel = [[UILabel alloc] init];
_nickLabel.font = [UIFont systemFontOfSize:12];
_nickLabel.textColor = [ThemeColor mainTextColor];
_nickLabel.font = [UIFont boldSystemFontOfSize:12];
_nickLabel.textColor = [UIColor whiteColor];
}
return _nickLabel;
}
@@ -167,4 +216,13 @@
return _numberLabel;
}
- (UIImageView *)shadowImageView {
if (!_shadowImageView) {
_shadowImageView = [[UIImageView alloc] init];
_shadowImageView.userInteractionEnabled = YES;
_shadowImageView.image = [UIImage imageNamed:@"home_recommend_nick_shadow_bg"];
}
return _shadowImageView;
}
@end

View File

@@ -0,0 +1,15 @@
//
// XPHomeHappyViewController.h
// xplan-ios
//
// Created by 冯硕 on 2022/2/25.
//
#import "MvpViewController.h"
#import <JXPagingView/JXPagerView.h>
NS_ASSUME_NONNULL_BEGIN
@interface XPHomeHappyViewController : MvpViewController<JXPagerViewListViewDelegate>
- (void)configPlayGameRoomList:(NSArray *)list;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,203 @@
//
// XPHomeHappyViewController.m
// xplan-ios
//
// Created by on 2022/2/25.
//
#import "XPHomeHappyViewController.h"
///Third
#import <Masonry/Masonry.h>
#import <MJRefresh/MJRefresh.h>
///Tool
#import "ThemeColor.h"
///View
#import "XPHomeHapppyRoomTableViewCell.h"
#import "XPHomeBannerTableViewCell.h"
#import "XPHomeListEmptyTableViewCell.h"
///P
#import "XPHomeRecommendPresenter.h"
#import "XPHomeRecommendProtocol.h"
///Model
#import "HomePlayRoomModel.h"
///VC
#import "XPWebViewController.h"
#import "XPRoomViewController.h"
@interface XPHomeHappyViewController ()<UITableViewDelegate, UITableViewDataSource, XPHomeBannerTableViewCellDelegate, XPHomeRecommendProtocol>
///
@property (nonatomic,strong) UITableView *tableView;
@property (nonatomic, copy) void(^scrollCallback)(UIScrollView *scrollView);
///
@property (nonatomic,strong) NSMutableArray *roomList;
///
@property (nonatomic,assign) int page;
@end
@implementation XPHomeHappyViewController
- (XPHomeRecommendPresenter *)createPresenter {
return [[XPHomeRecommendPresenter alloc] init];
}
- (void)viewDidLoad {
[super viewDidLoad];
[self initHeaderAndFooterRrfresh];
[self initSubViews];
[self initSubViewConstraints];
}
- (BOOL)isHiddenNavBar {
return YES;
}
- (void)configPlayGameRoomList:(NSArray *)list {
self.page = 1;
[self.roomList removeAllObjects];
[self.roomList addObjectsFromArray:list];;
[self.tableView reloadData];
}
#pragma mark - Private Method
- (void)initSubViews {
self.view.backgroundColor = [UIColor clearColor];
[self.view addSubview:self.tableView];
}
- (void)initHeaderAndFooterRrfresh {
MJRefreshBackNormalFooter *footer = [MJRefreshBackNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(footerRefresh)];
footer.stateLabel.textColor = [ThemeColor secondTextColor];
footer.stateLabel.font = [UIFont systemFontOfSize:10.0];
self.tableView.mj_footer = footer;
}
- (void)initSubViewConstraints {
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.view);
}];
}
- (void)footerRefresh {
self.page ++;
[self.presenter getPlayGameWithTeam:self.page];
}
#pragma mark - UITableViewDelegate And UITableViewDataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.roomList.count > 0 ? self.roomList.count : 1;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if (self.roomList.count > 0) {
HomePlayRoomModel * model = [self.roomList objectAtIndex:indexPath.row];
if (model.isBanner) {
return 80;
}
return 94;
}
return 300;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if (self.roomList.count > 0) {
HomePlayRoomModel * model = [self.roomList objectAtIndex:indexPath.row];
if (model.isBanner) {
XPHomeBannerTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPHomeBannerTableViewCell class])];
if (cell == nil) {
cell = [[XPHomeBannerTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPHomeBannerTableViewCell class])];
}
cell.delegate = self;
cell.bannerList = model.bannerVoList;
return cell;
}
XPHomeHapppyRoomTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPHomeHapppyRoomTableViewCell class])];
if (cell == nil) {
cell = [[XPHomeHapppyRoomTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPHomeHapppyRoomTableViewCell class])];
}
cell.roomInfo = model;
return cell;
}
XPHomeListEmptyTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPHomeListEmptyTableViewCell class])];
if (cell == nil) {
cell = [[XPHomeListEmptyTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPHomeListEmptyTableViewCell class])];
}
return cell;
}
#pragma mark - XPHomeBannerTableViewCellDelegate
- (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 - XPHomeRecommendProtocol
- (void)getPlayGameWithTeamSuccess:(NSArray *)list {
[self.tableView.mj_footer endRefreshing];
if (list.count <=0) {
[self.tableView.mj_footer endRefreshingWithNoMoreData];
}
[self.roomList addObjectsFromArray:list];
[self.tableView reloadData];
}
#pragma mark - JXPagingViewListViewDelegate
- (UIView *)listView {
return self.view;
}
- (UIScrollView *)listScrollView {
return self.tableView;
}
- (void)listViewDidScrollCallback:(void (^)(UIScrollView *))callback {
self.scrollCallback = callback;
}
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
self.scrollCallback(scrollView);
}
#pragma mark - Getters And Setters
- (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 registerClass:[XPHomeHapppyRoomTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPHomeHapppyRoomTableViewCell class])];
[_tableView registerClass:[XPHomeBannerTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPHomeBannerTableViewCell class])];
[_tableView registerClass:[XPHomeListEmptyTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPHomeListEmptyTableViewCell class])];
}
return _tableView;
}
- (NSMutableArray *)roomList {
if (!_roomList) {
_roomList = [NSMutableArray array];
}
return _roomList;
}
@end

View File

@@ -0,0 +1,17 @@
//
// XPHomeHotRoomViewController.h
// xplan-ios
//
// Created by 冯硕 on 2022/2/25.
//
#import "BaseViewController.h"
#import <JXPagingView/JXPagerView.h>
NS_ASSUME_NONNULL_BEGIN
@interface XPHomeHotRoomViewController : BaseViewController<JXPagerViewListViewDelegate>
///房间列表
@property (nonatomic,strong) NSArray *roomList;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,118 @@
//
// XPHomeHotRoomViewController.m
// xplan-ios
//
// Created by on 2022/2/25.
//
#import "XPHomeHotRoomViewController.h"
///Third
#import <Masonry/Masonry.h>
///View
#import "XPHomeHapppyRoomTableViewCell.h"
#import "XPHomeListEmptyTableViewCell.h"
///VC
#import "XPWebViewController.h"
#import "XPRoomViewController.h"
@interface XPHomeHotRoomViewController ()<UITableViewDelegate, UITableViewDataSource>
///
@property (nonatomic,strong) UITableView *tableView;
@property (nonatomic, copy) void(^scrollCallback)(UIScrollView *scrollView);
@end
@implementation XPHomeHotRoomViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self initSubViews];
[self initSubViewConstraints];
}
- (BOOL)isHiddenNavBar {
return YES;
}
#pragma mark - Private Method
- (void)initSubViews {
self.view.backgroundColor = [UIColor clearColor];
[self.view addSubview:self.tableView];
}
- (void)initSubViewConstraints {
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.view);
}];
}
#pragma mark - UITableViewDelegate And UITableViewDataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.roomList.count > 0 ? self.roomList.count : 1;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if (self.roomList.count > 0) {
return 94;
}
return 300;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if (self.roomList.count > 0) {
HomePlayRoomModel * model = [self.roomList objectAtIndex:indexPath.row];
XPHomeHapppyRoomTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPHomeHapppyRoomTableViewCell class])];
if (cell == nil) {
cell = [[XPHomeHapppyRoomTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPHomeHapppyRoomTableViewCell class])];
}
cell.roomInfo = model;
return cell;
}
XPHomeListEmptyTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPHomeListEmptyTableViewCell class])];
if (cell == nil) {
cell = [[XPHomeListEmptyTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPHomeListEmptyTableViewCell class])];
}
return cell;
}
#pragma mark - JXPagingViewListViewDelegate
- (UIView *)listView {
return self.view;
}
- (UIScrollView *)listScrollView {
return self.tableView;
}
- (void)listViewDidScrollCallback:(void (^)(UIScrollView *))callback {
self.scrollCallback = callback;
}
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
self.scrollCallback(scrollView);
}
#pragma mark - Getters And Setters
- (void)setRoomList:(NSArray *)roomList {
_roomList = roomList;
[self.tableView reloadData];
}
- (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 registerClass:[XPHomeHapppyRoomTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPHomeHapppyRoomTableViewCell class])];
[_tableView registerClass:[XPHomeListEmptyTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPHomeListEmptyTableViewCell class])];
}
return _tableView;
}
@end

View File

@@ -8,27 +8,30 @@
#import "XPHomeRecommendViewController.h"
///Third
#import <Masonry/Masonry.h>
#import <JXPagingView/JXPagerView.h>
#import <JXPagingView/JXPagerListRefreshView.h>
#import <JXCategoryView/JXCategoryView.h>
#import <MJRefresh/MJRefresh.h>
///Tool
#import "XPMacro.h"
#import "ThemeColor.h"
#import "UIImage+Utils.h"
///View
#import "XPHomeBannerTableViewCell.h"
#import "XPHomeMenuTableViewCell.h"
#import "XPHomeRecommendTableViewCell.h"
#import "XPHomeHotRoomTableViewCell.h"
#import "XPHomeSectionView.h"
///Model
#import "HomeMenuInfoModel.h"
#import "HomeBannerInfoModel.h"
#import "HomeRecommendRoomModel.h"
#import "XPHomeRecommendHeaderView.h"
///P
#import "XPHomeRecommendPresenter.h"
#import "XPHomeRecommendProtocol.h"
///VC
#import "XPWebViewController.h"
#import "XPRoomViewController.h"
@interface XPHomeRecommendViewController ()<UITableViewDelegate, UITableViewDataSource, XPHomeRecommendProtocol, XPHomeMenuTableViewCellDelegate, XPHomeBannerTableViewCellDelegate>
///
@property (nonatomic,strong) UITableView *tableView;
#import "XPHomeHappyViewController.h"
#import "XPHomeHotRoomViewController.h"
@class HomeMenuInfoModel,HomeBannerInfoModel,HomeRecommendRoomModel, HomePlayRoomModel;
@interface XPHomeRecommendViewController ()<JXCategoryViewDelegate,JXPagerViewDelegate, XPHomeRecommendProtocol,JXPagerMainTableViewGestureDelegate>
@property (nonatomic, strong) JXCategoryTitleView *titleView;
@property (nonatomic, strong) JXCategoryIndicatorLineView *lineView;
@property (nonatomic, strong) JXPagerView *pagingView;
@property (nonatomic, strong) NSArray<NSString *> *titles;
///
@property (nonatomic,strong) XPHomeRecommendHeaderView *headerView;
///
@property (nonatomic,strong) NSArray<HomeMenuInfoModel *> *menuList;
///
@@ -37,7 +40,14 @@
@property (nonatomic,strong) NSArray<HomeRecommendRoomModel *> *recommendList;
///
@property (nonatomic,strong) NSArray<HomeRecommendRoomModel *> *hotRoomList;
///
@property (nonatomic,strong) NSArray<HomePlayRoomModel *> *playTeamList;
///
@property (nonatomic,strong) NSArray<HomePlayRoomModel *> *personalRoomList;
///
@property (nonatomic,strong) XPHomeHappyViewController *personalRoomVC;
///
@property (nonatomic,strong) XPHomeHotRoomViewController *hotRoomVC;
@end
@implementation XPHomeRecommendViewController
@@ -50,200 +60,197 @@
- (void)viewDidLoad {
[super viewDidLoad];
[self initHttpRequest];
[self initHeaderAndFooterRrfresh];
[self initSubViews];
[self initSubViewConstraints];
}
- (void)viewDidLayoutSubviews {
[super viewDidLayoutSubviews];
self.pagingView.frame = self.view.bounds;
}
#pragma mark - InitHttp
- (void)initHttpRequest {
- (void)headerRefresh {
[self.presenter getHomeTopBannerList];
[self.presenter getHomeMenuList];
[self.presenter getHomeRecommendRoomList];
[self.presenter getHomeHotRoomList];
[self.presenter getPlayGameWithTeam:1];
[self.presenter getHomePersonalRoomList];
}
- (void)initHeaderAndFooterRrfresh {
MJRefreshNormalHeader *header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(headerRefresh)];
header.stateLabel.font = [UIFont systemFontOfSize:10.0];
header.lastUpdatedTimeLabel.font = [UIFont systemFontOfSize:10.0];
header.stateLabel.textColor = [ThemeColor secondTextColor];
header.lastUpdatedTimeLabel.textColor = [ThemeColor secondTextColor];
self.pagingView.mainTableView.mj_header = header;
[self headerRefresh];
}
#pragma mark - Private Method
- (void)initSubViews {
self.view.backgroundColor = [UIColor clearColor];
[self.view addSubview:self.tableView];
}
- (void)initSubViewConstraints {
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.view);
}];
}
#pragma mark - UITableViewDelegate And UITableViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 4;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
if (section == 0) {
return self.bannerList.count >0 ? 1 : 0;
} else if(section == 1) {
return self.menuList.count > 0 ? 1 : 0;
} else if(section == 2) {
return self.recommendList.count > 0 ? 1 : 0;
} else if(section == 3) {
return self.hotRoomList.count > 0 ? 1 : 0;
}
return 0;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.section == 0) {
return 140;
} else if(indexPath.section == 1) {
return 60;
} else if(indexPath.section == 2) {
CGFloat itemHeight = (CGFloat)(KScreenWidth - 15 * 2 - 8 * 2 - 4) / (CGFloat)3 + 22;
return itemHeight * 2 + 16;
} else if(indexPath.section == 3) {
return 96;
}
return 0;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
if (section == 2) {
return self.recommendList.count > 0 ? 38 : 0;
} else if(section == 3) {
return self.hotRoomList.count > 0 ? 38 : 0;
}
return 0;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
if (section == 2) {
XPHomeSectionView * sectionView = [[XPHomeSectionView alloc] init];
sectionView.frame = CGRectMake(0, 0, KScreenWidth, 38);
sectionView.imageName = @"home_recommend_section_logo";
sectionView.title = @"最新推荐";
return sectionView;
} else if (section == 3) {
XPHomeSectionView * sectionView = [[XPHomeSectionView alloc] init];
sectionView.frame = CGRectMake(0, 0, KScreenWidth, 38);
sectionView.isHiddenLogo = YES;
sectionView.title = @"人气主播";
return sectionView;
}
return [UIView new];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.section == 0) {
XPHomeBannerTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPHomeBannerTableViewCell class])];
if (cell == nil) {
cell = [[XPHomeBannerTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPHomeBannerTableViewCell class])];
}
cell.delegate = self;
cell.bannerList = self.bannerList;
return cell;
} else if(indexPath.section == 1) {
XPHomeMenuTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPHomeMenuTableViewCell class])];
if (cell == nil) {
cell = [[XPHomeMenuTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPHomeMenuTableViewCell class])];
}
cell.delegate = self;
cell.menuList = self.menuList;
return cell;
} else if(indexPath.section == 2) {
XPHomeRecommendTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPHomeRecommendTableViewCell class])];
if (cell == nil) {
cell = [[XPHomeRecommendTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPHomeRecommendTableViewCell class])];
}
cell.recommendList = self.recommendList;
return cell;
} else {
XPHomeHotRoomTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPHomeHotRoomTableViewCell class])];
if (cell == nil) {
cell = [[XPHomeHotRoomTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPHomeHotRoomTableViewCell class])];
}
cell.hotAnchorList = self.hotRoomList;
return cell;
}
[self.view addSubview:self.pagingView];
}
#pragma mark - XPHomeRecommendProtocol
- (void)getHomeMenuListSuccess:(NSArray *)list {
self.menuList = list;
[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:1] withRowAnimation:UITableViewRowAnimationNone];
}
- (void)getHomeTopBannerListSuccess:(NSArray *)list {
- (void)getHomeTopBannerListSuccess:(NSArray *)list menuList:(NSArray *)list1{
[self.pagingView.mainTableView.mj_header endRefreshing];
self.bannerList = list;
[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationNone];
self.menuList = list1;
self.headerView.bannerList = list;
self.headerView.menuList = list1;
[self.pagingView reloadData];
}
- (void)getHomeRecommendRoomListSuccess:(NSArray *)list {
[self.pagingView.mainTableView.mj_header endRefreshing];
self.recommendList= list;
[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:2] withRowAnimation:UITableViewRowAnimationNone];
[self getHomeHotRoomListSuccess:list];
self.headerView.recommendList = list;
[self.pagingView reloadData];
}
- (void)getHomeHotRoomListSuccess:(NSArray *)list {
[self.pagingView.mainTableView.mj_header endRefreshing];
self.hotRoomList = list;
[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:3] withRowAnimation:UITableViewRowAnimationNone];
self.headerView.hotRoomList = list;
[self.pagingView reloadData];
}
#pragma mark - XPHomeMenuTableViewCellDelegate
- (void)xPHomeMenuTableViewCell:(XPHomeMenuTableViewCell *)view didClickMenuInfo:(HomeMenuInfoModel *)info {
if (info.resourceType == HomeMenuResourceType_H5) {
XPWebViewController * webVC = [[ XPWebViewController alloc] init];
webVC.url = info.resourceContent;
[self.navigationController pushViewController:webVC animated:YES];
} else {
if (info.hid.length > 0) {
[XPRoomViewController openRoom:info.hid viewController:self];
}
}
- (void)getHomePersonalRoomListSuccess:(NSArray *)list {
[self.pagingView.mainTableView.mj_header endRefreshing];
self.personalRoomList = list;
self.hotRoomVC.roomList = list;
}
#pragma mark - XPHomeBannerTableViewCellDelegate
- (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;
}
- (void)getPlayGameWithTeamSuccess:(NSArray *)list {
[self.pagingView.mainTableView.mj_header endRefreshing];
self.playTeamList = list;
[self.personalRoomVC configPlayGameRoomList:list];
}
#pragma mark - JXCategoryListContentViewDelegate
- (UIView *)listView {
return self.view;
}
#pragma mark - JXCategoryViewDelegate
- (NSUInteger)tableHeaderViewHeightInPagerView:(JXPagerView *)pagerView {
return [XPHomeRecommendHeaderView getHomeRecommendHeaderViewHeight:self.bannerList menuList:self.menuList recommendList:self.recommendList hotRoomList:self.hotRoomList];
}
- (UIView *)tableHeaderViewInPagerView:(JXPagerView *)pagerView {
return self.headerView;
}
- (NSUInteger)heightForPinSectionHeaderInPagerView:(JXPagerView *)pagerView {
return 50;
}
- (UIView *)viewForPinSectionHeaderInPagerView:(JXPagerView *)pagerView {
return self.titleView;
}
- (NSInteger)numberOfListsInPagerView:(JXPagerView *)pagerView {
return self.titles.count;
}
- (id<JXPagerViewListViewDelegate>)pagerView:(JXPagerView *)pagerView initListAtIndex:(NSInteger)index {
UIViewController *viewController;
switch (index) {
case 0:
{
viewController = self.personalRoomVC;
}
break;
case 1:
{
viewController = self.hotRoomVC;
}
break;
}
return (id <JXPagerViewListViewDelegate>)viewController;
}
#pragma mark - JXPagerMainTableViewGestureDelegate
- (BOOL)mainTableViewGestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
//categoryView
if (otherGestureRecognizer == self.titleView.collectionView.panGestureRecognizer) {
return NO;
}
return [gestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]] && [otherGestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]];
}
#pragma mark - Getters And Setters
- (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;
- (JXCategoryTitleView *)titleView {
if (!_titleView) {
_titleView = [[JXCategoryTitleView alloc] init];
_titleView.delegate = self;
_titleView.backgroundColor = [UIColor clearColor];
_titleView.titleColor = [ThemeColor textThirdColor];
_titleView.titleSelectedColor = [ThemeColor mainTextColor];
_titleView.titleFont = [UIFont fontWithName:@"PingFang-SC-Medium" size:12];
_titleView.titleSelectedFont = [UIFont fontWithName:@"PingFang-SC-Medium" size:16];
_titleView.titleLabelAnchorPointStyle = JXCategoryTitleLabelAnchorPointStyleCenter;
_titleView.contentScrollViewClickTransitionAnimationEnabled = NO;
_titleView.defaultSelectedIndex = 0;
_titleView.averageCellSpacingEnabled = NO;
_titleView.titles = self.titles;
_titleView.cellSpacing = 20;
_titleView.titles = self.titles;
_titleView.listContainer = (id<JXCategoryViewListContainer>)self.pagingView.listContainerView;
JXCategoryIndicatorImageView *lineView = [[JXCategoryIndicatorImageView alloc] init];
lineView.indicatorWidth = 41;
lineView.indicatorHeight = 10;
lineView.indicatorCornerRadius = 5;
lineView.verticalMargin = 10;
lineView.indicatorImageView.image = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0xFFD15A), UIColorFromRGB(0xFFC000)] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(41, 10)];
_titleView.indicators = @[lineView];
}
[_tableView registerClass:[XPHomeBannerTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPHomeBannerTableViewCell class])];
[_tableView registerClass:[XPHomeMenuTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPHomeMenuTableViewCell class])];
[_tableView registerClass:[XPHomeRecommendTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPHomeRecommendTableViewCell class])];
[_tableView registerClass:[XPHomeHotRoomTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPHomeHotRoomTableViewCell class])];
return _titleView;
}
return _tableView;
- (JXPagerView *)pagingView {
if (!_pagingView) {
_pagingView = [[JXPagerView alloc] initWithDelegate:self];
_pagingView.backgroundColor = [UIColor clearColor];
_pagingView.listContainerView.backgroundColor = [UIColor clearColor];
_pagingView.mainTableView.backgroundColor = [UIColor clearColor];
_pagingView.listContainerView.listCellBackgroundColor = UIColor.clearColor;
}
return _pagingView;
}
- (NSArray<NSString *> *)titles {
if (!_titles) {
_titles = @[@"开黑畅聊", @"热门房间"];
}
return _titles;
}
- (XPHomeRecommendHeaderView *)headerView {
if (!_headerView) {
_headerView = [[XPHomeRecommendHeaderView alloc] init];
_headerView.backgroundColor = [UIColor clearColor];
_headerView.currenViewController = self;
}
return _headerView;
}
- (XPHomeHotRoomViewController *)hotRoomVC {
if (!_hotRoomVC) {
_hotRoomVC = [[XPHomeHotRoomViewController alloc] init];
}
return _hotRoomVC;
}
- (XPHomeHappyViewController *)personalRoomVC {
if (!_personalRoomVC) {
_personalRoomVC = [[XPHomeHappyViewController alloc] init];
}
return _personalRoomVC;
}
@end

View File

@@ -102,6 +102,8 @@
- (JXCategoryListContainerView *)listContainerView {
if (!_listContainerView) {
_listContainerView = [[JXCategoryListContainerView alloc] initWithType:JXCategoryListContainerType_ScrollView delegate:self];
_listContainerView.scrollView.scrollEnabled = NO;
_listContainerView.listCellBackgroundColor = [UIColor clearColor];
}
return _listContainerView;
}