首页派对里面喜欢

This commit is contained in:
fengshuo
2022-03-02 19:18:08 +08:00
parent 66de1ae1d2
commit e784fee8da
57 changed files with 1619 additions and 22 deletions

View File

@@ -205,4 +205,4 @@ SPEC CHECKSUMS:
PODFILE CHECKSUM: 8120dbc8eb506e124ccb97e8ce2ecf2420ac8b5f
COCOAPODS: 1.11.2
COCOAPODS: 1.11.0

View File

@@ -334,6 +334,13 @@
E8A1E460276220DA00B294CA /* candyTree_banner.svga in Resources */ = {isa = PBXBuildFile; fileRef = E8A1E45D276220DA00B294CA /* candyTree_banner.svga */; };
E8A1E461276220DA00B294CA /* candyTree.svga in Resources */ = {isa = PBXBuildFile; fileRef = E8A1E45E276220DA00B294CA /* candyTree.svga */; };
E8A1E462276220DA00B294CA /* candyTree_light.svga in Resources */ = {isa = PBXBuildFile; fileRef = E8A1E45F276220DA00B294CA /* candyTree_light.svga */; };
E8A6C28C27CF436300AC7442 /* XPHomeLikeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8A6C28B27CF436300AC7442 /* XPHomeLikeViewController.m */; };
E8A6C28F27CF43D600AC7442 /* XPHomeAttentionTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8A6C28E27CF43D600AC7442 /* XPHomeAttentionTableViewCell.m */; };
E8A6C29527CF441200AC7442 /* XPHomeAttentionCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8A6C29427CF441200AC7442 /* XPHomeAttentionCollectionViewCell.m */; };
E8A6C29827CF448700AC7442 /* XPHomeCollectRoomTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8A6C29727CF448700AC7442 /* XPHomeCollectRoomTableViewCell.m */; };
E8A6C29B27CF53BF00AC7442 /* XPHomeLikePresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E8A6C29A27CF53BF00AC7442 /* XPHomeLikePresenter.m */; };
E8A6C29F27CF5FE500AC7442 /* HomeLiveRoomModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E8A6C29E27CF5FE500AC7442 /* HomeLiveRoomModel.m */; };
E8A6C2A227CF856E00AC7442 /* HomeCollectRoomModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E8A6C2A127CF856E00AC7442 /* HomeCollectRoomModel.m */; };
E8AC721026F43955007D6E91 /* UIImageConstant.m in Sources */ = {isa = PBXBuildFile; fileRef = E8AC720F26F43955007D6E91 /* UIImageConstant.m */; };
E8AC721326F46ADD007D6E91 /* XPMineSettingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8AC721226F46ADD007D6E91 /* XPMineSettingViewController.m */; };
E8AC721626F46B06007D6E91 /* XPMineSettingTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8AC721526F46B06007D6E91 /* XPMineSettingTableViewCell.m */; };
@@ -1102,6 +1109,21 @@
E8A1E45D276220DA00B294CA /* candyTree_banner.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = candyTree_banner.svga; sourceTree = "<group>"; };
E8A1E45E276220DA00B294CA /* candyTree.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = candyTree.svga; sourceTree = "<group>"; };
E8A1E45F276220DA00B294CA /* candyTree_light.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = candyTree_light.svga; sourceTree = "<group>"; };
E8A6C28A27CF436300AC7442 /* XPHomeLikeViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeLikeViewController.h; sourceTree = "<group>"; };
E8A6C28B27CF436300AC7442 /* XPHomeLikeViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPHomeLikeViewController.m; sourceTree = "<group>"; };
E8A6C28D27CF43D600AC7442 /* XPHomeAttentionTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeAttentionTableViewCell.h; sourceTree = "<group>"; };
E8A6C28E27CF43D600AC7442 /* XPHomeAttentionTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPHomeAttentionTableViewCell.m; sourceTree = "<group>"; };
E8A6C29327CF441200AC7442 /* XPHomeAttentionCollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeAttentionCollectionViewCell.h; sourceTree = "<group>"; };
E8A6C29427CF441200AC7442 /* XPHomeAttentionCollectionViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPHomeAttentionCollectionViewCell.m; sourceTree = "<group>"; };
E8A6C29627CF448700AC7442 /* XPHomeCollectRoomTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeCollectRoomTableViewCell.h; sourceTree = "<group>"; };
E8A6C29727CF448700AC7442 /* XPHomeCollectRoomTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPHomeCollectRoomTableViewCell.m; sourceTree = "<group>"; };
E8A6C29927CF53BF00AC7442 /* XPHomeLikePresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeLikePresenter.h; sourceTree = "<group>"; };
E8A6C29A27CF53BF00AC7442 /* XPHomeLikePresenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPHomeLikePresenter.m; sourceTree = "<group>"; };
E8A6C29C27CF53E100AC7442 /* XPHomeLikeProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeLikeProtocol.h; sourceTree = "<group>"; };
E8A6C29D27CF5FE500AC7442 /* HomeLiveRoomModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HomeLiveRoomModel.h; sourceTree = "<group>"; };
E8A6C29E27CF5FE500AC7442 /* HomeLiveRoomModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HomeLiveRoomModel.m; sourceTree = "<group>"; };
E8A6C2A027CF856E00AC7442 /* HomeCollectRoomModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HomeCollectRoomModel.h; sourceTree = "<group>"; };
E8A6C2A127CF856E00AC7442 /* HomeCollectRoomModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HomeCollectRoomModel.m; sourceTree = "<group>"; };
E8AC720E26F43955007D6E91 /* UIImageConstant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UIImageConstant.h; sourceTree = "<group>"; };
E8AC720F26F43955007D6E91 /* UIImageConstant.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UIImageConstant.m; sourceTree = "<group>"; };
E8AC721126F46ADD007D6E91 /* XPMineSettingViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineSettingViewController.h; sourceTree = "<group>"; };
@@ -3288,6 +3310,8 @@
E87A26F827587C62002DDC7A /* XPHomeContainerPresenter.m */,
E8E5E1AD27C3920100F457D8 /* XPHomeRecommendPresenter.h */,
E8E5E1AE27C3920100F457D8 /* XPHomeRecommendPresenter.m */,
E8A6C29927CF53BF00AC7442 /* XPHomeLikePresenter.h */,
E8A6C29A27CF53BF00AC7442 /* XPHomeLikePresenter.m */,
);
path = Presenter;
sourceTree = "<group>";
@@ -3299,6 +3323,7 @@
E8C6FFE72754FE66004DC9F0 /* XPHomeSearchProtocol.h */,
E87A26FA27587C83002DDC7A /* XPHomeContainerProtocol.h */,
E8E5E1B027C3920E00F457D8 /* XPHomeRecommendProtocol.h */,
E8A6C29C27CF53E100AC7442 /* XPHomeLikeProtocol.h */,
);
path = Protocol;
sourceTree = "<group>";
@@ -3318,6 +3343,10 @@
E8E5E1B227C397A400F457D8 /* HomeMenuInfoModel.m */,
E8ACEFF027C8E8F000F66D1A /* HomePlayRoomModel.h */,
E8ACEFF127C8E8F000F66D1A /* HomePlayRoomModel.m */,
E8A6C29D27CF5FE500AC7442 /* HomeLiveRoomModel.h */,
E8A6C29E27CF5FE500AC7442 /* HomeLiveRoomModel.m */,
E8A6C2A027CF856E00AC7442 /* HomeCollectRoomModel.h */,
E8A6C2A127CF856E00AC7442 /* HomeCollectRoomModel.m */,
);
path = Model;
sourceTree = "<group>";
@@ -3329,6 +3358,8 @@
E8C6FFD12754AA6A004DC9F0 /* SubViews */,
E8C6FFC627548120004DC9F0 /* XPHomePartyViewController.h */,
E8C6FFC527548120004DC9F0 /* XPHomePartyViewController.m */,
E8A6C28A27CF436300AC7442 /* XPHomeLikeViewController.h */,
E8A6C28B27CF436300AC7442 /* XPHomeLikeViewController.m */,
E87A26F427587C48002DDC7A /* XPHomePartyContainerViewController.h */,
E87A26F527587C48002DDC7A /* XPHomePartyContainerViewController.m */,
E8E5E18927C332EE00F457D8 /* XPHomeViewController.h */,
@@ -3379,6 +3410,12 @@
E8E5E1A827C3850400F457D8 /* XPHomeHotRoomCollectionViewCell.m */,
E8ACEFED27C8C45100F66D1A /* XPHomeHapppyRoomTableViewCell.h */,
E8ACEFEE27C8C45100F66D1A /* XPHomeHapppyRoomTableViewCell.m */,
E8A6C28D27CF43D600AC7442 /* XPHomeAttentionTableViewCell.h */,
E8A6C28E27CF43D600AC7442 /* XPHomeAttentionTableViewCell.m */,
E8A6C29327CF441200AC7442 /* XPHomeAttentionCollectionViewCell.h */,
E8A6C29427CF441200AC7442 /* XPHomeAttentionCollectionViewCell.m */,
E8A6C29627CF448700AC7442 /* XPHomeCollectRoomTableViewCell.h */,
E8A6C29727CF448700AC7442 /* XPHomeCollectRoomTableViewCell.m */,
);
path = Cell;
sourceTree = "<group>";
@@ -3882,6 +3919,7 @@
E8E70D7E26F2F19D00F03460 /* Api+Mine.m in Sources */,
E8E5E19427C36BA600F457D8 /* XPHomeBannerTableViewCell.m in Sources */,
E824543D26F58C3A00BE8163 /* XPLoginBindSuccessView.m in Sources */,
E8A6C29527CF441200AC7442 /* XPHomeAttentionCollectionViewCell.m in Sources */,
E8EEB8F726FC2673007C6EBA /* UserPhoto.m in Sources */,
E81C27A226EF23490031E639 /* XPEnum.h in Sources */,
E88B5CB526FB20B800DA9178 /* XPMineTeenagerPwdView.m in Sources */,
@@ -3893,6 +3931,7 @@
E81C1B1F27705F7A0020D1E4 /* XPArrangeMicViewController.m in Sources */,
E8B825C726EA0D9A009E8E9F /* LoginVerifCodeProtocol.h in Sources */,
E824544E26F5BC1A00BE8163 /* XPMineModifPayPwdView.m in Sources */,
E8A6C2A227CF856E00AC7442 /* HomeCollectRoomModel.m in Sources */,
E8A03DE22762FA000098D9EA /* XPCandyTreeMoreView.m in Sources */,
E8B825CA26EA1231009E8E9F /* LoginVerifCodeViewController.m in Sources */,
189DD76226E60DDC00AB55B1 /* Api+Login.m in Sources */,
@@ -3949,6 +3988,7 @@
E82325FC274E4735003A3332 /* XPUserCardItemModel.m in Sources */,
E80DE4102775C34E00BE5BCB /* XPFirstRechargeSuccessView.m in Sources */,
E8412FB32779E285006E1101 /* Api+RoomSetting.m in Sources */,
E8A6C29827CF448700AC7442 /* XPHomeCollectRoomTableViewCell.m in Sources */,
E8EEB8F226FC2050007C6EBA /* SDPhotoBrowser.m in Sources */,
E81C27AB26EF2D920031E639 /* ThirdUserInfo.m in Sources */,
E8788950273A699900BF1D57 /* ThemeColor+SendGift.m in Sources */,
@@ -3990,6 +4030,7 @@
18F404C927609A4300A6C548 /* MessagePresenter.m in Sources */,
E81366E326F0A1FC0076364C /* LoginBindPhoneViewController.m in Sources */,
189DD68426E1FDBB00AB55B1 /* XCHUDTool.m in Sources */,
E8A6C29B27CF53BF00AC7442 /* XPHomeLikePresenter.m in Sources */,
189DD73F26E21C3F00AB55B1 /* YYUtility+Carrier.m in Sources */,
E87AE7F9277AABE50037823A /* XPRoomTagListViewController.m in Sources */,
18E7B26926E8D5D60064BC9B /* XCCurrentVCStackManager.m in Sources */,
@@ -4019,6 +4060,7 @@
E878893C273A54C300BF1D57 /* Api+Gift.m in Sources */,
E81C279026EB314D0031E639 /* LoginForgetEditView.m in Sources */,
E8DEC9A82764A68B0078CB70 /* Api+MoreMenu.m in Sources */,
E8A6C28F27CF43D600AC7442 /* XPHomeAttentionTableViewCell.m in Sources */,
E8E5E19D27C36C3500F457D8 /* XPHomeMenuTableViewCell.m in Sources */,
E8AC721026F43955007D6E91 /* UIImageConstant.m in Sources */,
E81C27A026EEF83D0031E639 /* XPHtmlUrl.m in Sources */,
@@ -4056,6 +4098,7 @@
E8680718271967B00024F48F /* MicroView.m in Sources */,
E896EF942771AAC100AD2CC1 /* XPMineFansPresenter.m in Sources */,
E8B825CD26EA18C8009E8E9F /* ThemeColor.m in Sources */,
E8A6C29F27CF5FE500AC7442 /* HomeLiveRoomModel.m in Sources */,
E84150B827747B8B00A7F548 /* XPFirstRechargeViewController.m in Sources */,
E88B5CBD26FB3BDF00DA9178 /* XPTeenagerAlertView.m in Sources */,
E82D5C70276AE60000858D6D /* HeadwearModel.m in Sources */,
@@ -4168,6 +4211,7 @@
189DD74026E21C3F00AB55B1 /* YYUtility+App.m in Sources */,
189DD74526E21CCC00AB55B1 /* YYReachability.m in Sources */,
E82109AD26F1C8A000FC3319 /* CountDownHelper.m in Sources */,
E8A6C28C27CF436300AC7442 /* XPHomeLikeViewController.m in Sources */,
E8E70D8F26F2F5DB00F03460 /* XPMineMenuTableViewCell.m in Sources */,
E8E5E1A927C3850400F457D8 /* XPHomeHotRoomCollectionViewCell.m in Sources */,
187EEEE126E89BFB002833B2 /* AccountModel.m in Sources */,

View File

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

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 551 B

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 560 B

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 526 B

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 532 B

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 530 B

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 535 B

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 543 B

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 561 B

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 548 B

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 B

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 555 B

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 563 B

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 748 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -71,6 +71,18 @@ NS_ASSUME_NONNULL_BEGIN
/// @param pageSize 一页多少个
+ (void)homePlayGameTeam:(HttpRequestHelperCompletion)completion uid:(NSString *)uid pageNum:(NSString *)pageNum pageSize:(NSString *)pageSize;
/// 请求首页关注列表
/// @param completion 完成
/// @param uid 用户的uid
+ (void)homeAttentionList:(HttpRequestHelperCompletion)completion uid:(NSString *)uid;
/// 请求收藏房间列表
/// @param completion 完成
/// @param uid 用户的uid
/// @param page 当前页数
/// @param pageSize 一页多少个
+ (void)homeCollectRoomList:(HttpRequestHelperCompletion)completion uid:(NSString *)uid page:(NSString *)page pageSize:(NSString *)pageSize;
@end
NS_ASSUME_NONNULL_END

View File

@@ -14,7 +14,7 @@
/// @param complection
/// @param uid uid
+ (void)homeTagComplection:(HttpRequestHelperCompletion)complection uid:(NSString *)uid {
[self makeRequest:@"home/tag" method:HttpRequestHelperMethodGET completion:complection, __FUNCTION__, uid, nil];
[self makeRequest:@"home/tagV2" method:HttpRequestHelperMethodGET completion:complection, __FUNCTION__, uid, nil];
}
///
@@ -79,4 +79,21 @@
+ (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];
}
///
/// @param completion
/// @param uid uid
+ (void)homeAttentionList:(HttpRequestHelperCompletion)completion uid:(NSString *)uid {
[self makeRequest:@"fans/partTabFollowList" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__,uid ,nil];
}
///
/// @param completion
/// @param uid uid
/// @param page
/// @param pageSize
+ (void)homeCollectRoomList:(HttpRequestHelperCompletion)completion uid:(NSString *)uid page:(NSString *)page pageSize:(NSString *)pageSize {
[self makeRequest:@"fans/fansRoomList" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__,uid , page, pageSize,nil];
}
@end

View File

@@ -0,0 +1,33 @@
//
// HomeCollectRoomModel.h
// xplan-ios
//
// Created by 冯硕 on 2022/3/2.
//
#import <Foundation/Foundation.h>
#import "HomePlayRoomModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface HomeCollectRoomModel : NSObject
///昵称
@property (nonatomic,copy) NSString *nick;
///头像
@property (nonatomic,copy) NSString *roomAvatar;
///昵称
@property (nonatomic,copy) NSString *roomName;
///f在线人数
@property (nonatomic,copy) NSString *roomOnlineNum;
///是否跨房Pk
@property (nonatomic,assign) BOOL crossPking;
///平台id
@property (nonatomic,copy) NSString *erbanNo;
///tag
@property (nonatomic,copy) NSString *tagPict;
///房主的uid
@property (nonatomic,copy) NSString *roomUid;
///麦上用户
@property (nonatomic, strong) NSArray<HomePlayMicUserModel *> *micUsers;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,12 @@
//
// HomeCollectRoomModel.m
// xplan-ios
//
// Created by on 2022/3/2.
//
#import "HomeCollectRoomModel.h"
@implementation HomeCollectRoomModel
@end

View File

@@ -0,0 +1,23 @@
//
// HomeLiveRoomModel.h
// xplan-ios
//
// Created by 冯硕 on 2022/3/2.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface HomeLiveRoomModel : NSObject
///昵称
@property (nonatomic, copy) NSString *nick;
///头像
@property (nonatomic, copy) NSString *avatar;
///用户的id
@property (nonatomic,assign) NSInteger uid;
///在房间中用户的uid
@property (nonatomic, assign) NSInteger roomUid;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,12 @@
//
// HomeLiveRoomModel.m
// xplan-ios
//
// Created by on 2022/3/2.
//
#import "HomeLiveRoomModel.h"
@implementation HomeLiveRoomModel
@end

View File

@@ -0,0 +1,20 @@
//
// XPHomeLikePresenter.h
// xplan-ios
//
// Created by 冯硕 on 2022/3/2.
//
#import "BaseMvpPresenter.h"
NS_ASSUME_NONNULL_BEGIN
@interface XPHomeLikePresenter : BaseMvpPresenter
/// 获取关注房间列表
- (void)getHomeAttectionList;
/// 获取收藏房间列表
/// @param page 当前页数
- (void)getHomeCollectRoomList:(int)page state:(int)state;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,43 @@
//
// XPHomeLikePresenter.m
// xplan-ios
//
// Created by on 2022/3/2.
//
#import "XPHomeLikePresenter.h"
#import "Api+Home.h"
#import "XPHomeLikeProtocol.h"
#import "AccountInfoStorage.h"
#import "HomePlayRoomModel.h"
#import "HomeLiveRoomModel.h"
#import "HomeCollectRoomModel.h"
@implementation XPHomeLikePresenter
///
- (void)getHomeAttectionList {
NSString * uid = [AccountInfoStorage instance].getUid;
[Api homeAttentionList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
NSArray * array = [HomeLiveRoomModel modelsWithArray:data.data];
[[self getView] getHomeAttentionListSuccess:array];
}fail:^(NSInteger code, NSString * _Nullable msg) {
[[self getView] getHomeAttentionListFail:msg];
}] uid:uid];
}
///
/// @param page
- (void)getHomeCollectRoomList:(int)page state:(int)state{
NSString * uid = [AccountInfoStorage instance].getUid;
NSString * pageStr = [NSString stringWithFormat:@"%d", page];
[Api homeCollectRoomList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
NSArray * array = [HomeCollectRoomModel modelsWithArray:data.data[@"fansRoomList"]];
[[self getView] getHomeCollectRoomListSuccess:array state:state];
}fail:^(NSInteger code, NSString * _Nullable msg) {
[[self getView] getHomeCollectRoomListFail:msg state:state];
}] uid:uid page:pageStr pageSize:@"20"];
}
@end

View File

@@ -0,0 +1,26 @@
//
// XPHomeLikeProtocol.h
// xplan-ios
//
// Created by 冯硕 on 2022/3/2.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@protocol XPHomeLikeProtocol <NSObject>
///获取首页关注列表成功
- (void)getHomeAttentionListSuccess:(NSArray *)liveList;
///获取首页关注列表失败
- (void)getHomeAttentionListFail:(NSString *)message;
///获取首页收藏房间列表成功
- (void)getHomeCollectRoomListSuccess:(NSArray *)roomList state:(int)state;
///获取首页收藏房间列表失败
- (void)getHomeCollectRoomListFail:(NSString *)message state:(int)state;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,16 @@
//
// XPHomeAttentionCollectionViewCell.h
// xplan-ios
//
// Created by 冯硕 on 2022/3/2.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@class HomeLiveRoomModel;
@interface XPHomeAttentionCollectionViewCell : UICollectionViewCell
@property (nonatomic,strong) HomeLiveRoomModel *liveRoom;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,153 @@
//
// XPHomeAttentionCollectionViewCell.m
// xplan-ios
//
// Created by on 2022/3/2.
//
#import "XPHomeAttentionCollectionViewCell.h"
///Third
#import <Masonry/Masonry.h>
///Tool
#import "NetImageView.h"
#import "ThemeColor.h"
///Model
#import "HomeLiveRoomModel.h"
@interface XPHomeAttentionCollectionViewCell ()
///
@property (nonatomic,strong) NetImageView *avatarImageView;
///
@property (nonatomic,strong) UILabel *nickLabel;
///
@property (nonatomic, strong) UIVisualEffectView *blurView;
///
@property (nonatomic,strong) UIImageView *noteImageView;
///
@property (nonatomic,strong) NSArray *animationArray;
@end
@implementation XPHomeAttentionCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self initSubViews];
[self initSubViewConstraints];
}
return self;
}
#pragma mark - Private Method
- (void)initSubViews {
[self.contentView addSubview:self.avatarImageView];
[self.contentView addSubview:self.nickLabel];
[self.avatarImageView addSubview:self.blurView];
[self.avatarImageView addSubview:self.noteImageView];
}
- (void)initSubViewConstraints {
[self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(56, 56));
make.centerX.mas_equalTo(self.contentView);
make.top.mas_equalTo(self.contentView);
}];
[self.blurView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.bottom.mas_equalTo(self.avatarImageView);
make.height.mas_equalTo(14);
}];
[self.noteImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.centerY.mas_equalTo(self.blurView);
make.height.mas_equalTo(10);
make.width.mas_equalTo(24);
}];
[self.nickLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.mas_equalTo(self.avatarImageView);
make.top.mas_equalTo(self.avatarImageView.mas_bottom).offset(4);
}];
}
#pragma mark - Getters And Setters
- (void)setLiveRoom:(HomeLiveRoomModel *)liveRoom {
_liveRoom = liveRoom;
if (_liveRoom) {
self.avatarImageView.imageUrl = _liveRoom.avatar;
self.nickLabel.text = _liveRoom.nick;
self.blurView.hidden = _liveRoom.roomUid <=0;
self.noteImageView.hidden = _liveRoom.roomUid <=0;
if (_liveRoom.roomUid > 0) {
self.noteImageView.animationImages = self.animationArray;
[self.noteImageView startAnimating];
}else {
self.noteImageView.animationImages = nil;
[self.noteImageView stopAnimating];
}
}
}
- (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 = 56/2;
_avatarImageView.layer.borderColor = [UIColor whiteColor].CGColor;
}
return _avatarImageView;
}
- (UILabel *)nickLabel {
if (!_nickLabel) {
_nickLabel = [[UILabel alloc] init];
_nickLabel.font = [UIFont systemFontOfSize:12];
_nickLabel.textColor = [ThemeColor mainTextColor];
}
return _nickLabel;
}
- (UIVisualEffectView *)blurView {
if (!_blurView) {
UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];
_blurView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];
_blurView.alpha = 0.3;
}
return _blurView;
}
- (UIImageView *)noteImageView {
if (!_noteImageView) {
_noteImageView = [[UIImageView alloc] init];
_noteImageView.userInteractionEnabled = YES;
_noteImageView.animationRepeatCount = HUGE;
_noteImageView.image = [UIImage imageNamed:@"home_note_0000"];
}
return _noteImageView;
}
- (NSArray *)animationArray {
if (!_animationArray) {
NSMutableArray * array = [NSMutableArray array];
for (int i = 0; i < 12; i++) {
NSString * imageName;
if (i> 9) {
imageName = [NSString stringWithFormat:@"home_note_000%d",i];
} else {
imageName = [NSString stringWithFormat:@"home_note_0000%d",i];
}
UIImage * image = [UIImage imageNamed:imageName];
[array addObject:image];
}
_animationArray = [array copy];
}
return _animationArray;
}
@end

View File

@@ -0,0 +1,23 @@
//
// XPHomeAttentionTableViewCell.h
// xplan-ios
//
// Created by 冯硕 on 2022/3/2.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@class XPHomeAttentionTableViewCell, HomeLiveRoomModel;
@protocol XPHomeAttentionTableViewCellDelegate <NSObject>
///点击了某个item
- (void)xPHomeAttentionTableViewCell:(XPHomeAttentionTableViewCell *)view didClickItem:(HomeLiveRoomModel *)model;
@end
@interface XPHomeAttentionTableViewCell : UITableViewCell
@property (nonatomic,strong) NSArray *attentionList;
///代理
@property (nonatomic,weak) id<XPHomeAttentionTableViewCellDelegate> delegate;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,86 @@
//
// XPHomeAttentionTableViewCell.m
// xplan-ios
//
// Created by on 2022/3/2.
//
#import "XPHomeAttentionTableViewCell.h"
///Third
#import <Masonry/Masonry.h>
///View
#import "XPHomeAttentionCollectionViewCell.h"
@interface XPHomeAttentionTableViewCell ()<UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout>
///
@property (nonatomic,strong) UICollectionView *collectionView;
@end
@implementation XPHomeAttentionTableViewCell
- (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.collectionView];
}
- (void)initSubViewConstraints {
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.contentView);
}];
}
#pragma mark - UICollectionViewCellDelegate And UICollectionViewDatasource
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
XPHomeAttentionCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPHomeAttentionCollectionViewCell class]) forIndexPath:indexPath];
cell.liveRoom = [self.attentionList objectAtIndex:indexPath.item];
return cell;
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
return self.attentionList.count;
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
[collectionView deselectItemAtIndexPath:indexPath animated:YES];
if (self.attentionList.count > 0) {
HomeLiveRoomModel * liveModel = [self.attentionList objectAtIndex:indexPath.item];
if (self.delegate && [self.delegate respondsToSelector:@selector(xPHomeAttentionTableViewCell:didClickItem:)]) {
[self.delegate xPHomeAttentionTableViewCell:self didClickItem:liveModel];
}
}
}
#pragma mark - Getters And Setters
- (void)setAttentionList:(NSArray *)attentionList {
_attentionList = attentionList;
[self.collectionView reloadData];
}
- (UICollectionView *)collectionView{
if (!_collectionView) {
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
layout.minimumLineSpacing = 8;
layout.itemSize = CGSizeMake(56, 56+ 24);
layout.sectionInset = UIEdgeInsetsMake(12, 15, 12, 15);
_collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
_collectionView.dataSource = self;
_collectionView.delegate = self;
_collectionView.backgroundColor = [UIColor clearColor];
[_collectionView registerClass:[XPHomeAttentionCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([XPHomeAttentionCollectionViewCell class])];
}
return _collectionView;
}
@end

View File

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

View File

@@ -0,0 +1,367 @@
//
// XPHomeCollectRoomTableViewCell.m
// xplan-ios
//
// Created by on 2022/3/2.
//
#import "XPHomeCollectRoomTableViewCell.h"
///Third
#import <Masonry/Masonry.h>
///Tool
#import "ThemeColor.h"
#import "NetImageView.h"
#import "UIImage+Utils.h"
///Model
#import "HomeCollectRoomModel.h"
@interface XPHomeCollectRoomTableViewCell ()
///PK
@property (nonatomic,strong) UIButton *pkButton;
///
@property (nonatomic,strong) NetImageView *avatarImageView;
///
@property (nonatomic,strong) UIImageView *backImageView;
///
@property (nonatomic,strong) UILabel *nickLabel;
///tag
@property (nonatomic,strong) NetImageView *tagImageView;
///id
@property (nonatomic,strong) UILabel *idLabel;
///
@property (nonatomic,strong) UIView * personContainerView;
///🔥
@property (nonatomic,strong) UIImageView *hotImageView;
///线
@property (nonatomic,strong) UILabel *numberLabel;
///线
@property (nonatomic,strong) UIView *micContainerView;
///
@property (nonatomic,strong) NetImageView *firstImageView;
///
@property (nonatomic,strong) NetImageView *secondImageView;
///
@property (nonatomic,strong) NetImageView *thirdImageView;
///
@property (nonatomic,strong) NetImageView *fourImageView;
///
@property (nonatomic,strong) NetImageView *fifImageView;
@end
@implementation XPHomeCollectRoomTableViewCell
- (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.backImageView];
[self.contentView addSubview:self.avatarImageView];
[self.backImageView addSubview:self.nickLabel];
[self.backImageView addSubview:self.tagImageView];
[self.backImageView addSubview:self.idLabel];
[self.backImageView addSubview:self.personContainerView];
[self.backImageView addSubview:self.micContainerView];
[self.personContainerView addSubview:self.hotImageView];
[self.personContainerView addSubview:self.numberLabel];
[self.avatarImageView addSubview:self.pkButton];
[self.micContainerView addSubview:self.firstImageView];
[self.micContainerView addSubview:self.secondImageView];
[self.micContainerView addSubview:self.thirdImageView];
[self.micContainerView addSubview:self.fourImageView];
[self.micContainerView addSubview:self.fifImageView];
}
- (void)initSubViewConstraints {
[self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(74, 74));
make.left.mas_equalTo(self.contentView).offset(15);
make.top.mas_equalTo(self.contentView);
}];
[self.backImageView 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(66);
}];
[self.pkButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(44, 16));
make.left.top.mas_equalTo(self.avatarImageView);
}];
[self.nickLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.backImageView).offset(82);
make.top.mas_equalTo(self.backImageView).offset(12);
make.right.mas_lessThanOrEqualTo(self.personContainerView.mas_left).offset(-5);
}];
[self.tagImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(38, 14));
make.left.mas_equalTo(self.nickLabel);
make.top.mas_equalTo(self.nickLabel.mas_bottom).offset(13);
}];
[self.idLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self.tagImageView);
make.left.mas_equalTo(self.tagImageView.mas_right).offset(8);
}];
[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.backImageView).offset(3);
make.right.mas_equalTo(self.backImageView).offset(-3);
}];
[self.hotImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(13, 13));
make.right.mas_equalTo(self.numberLabel.mas_left).offset(-2);
make.centerY.mas_equalTo(self.personContainerView);
}];
[self.numberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(self.personContainerView.mas_right).offset(-4);
make.centerY.mas_equalTo(self.personContainerView);
}];
[self.micContainerView mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(self.backImageView).offset(-13);
make.height.mas_equalTo(16);
make.centerY.mas_equalTo(self.tagImageView);
make.left.mas_equalTo(self.fifImageView.mas_left).offset(-5);
}];
[self.firstImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(16, 16));
make.right.mas_equalTo(self.micContainerView);
make.centerY.mas_equalTo(self.micContainerView);
}];
[self.secondImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.centerY.mas_equalTo(self.firstImageView);
make.right.mas_equalTo(self.firstImageView.mas_left).offset(-3);
}];
[self.thirdImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.centerY.mas_equalTo(self.firstImageView);
make.right.mas_equalTo(self.secondImageView.mas_left).offset(-3);
}];
[self.fourImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.centerY.mas_equalTo(self.firstImageView);
make.right.mas_equalTo(self.thirdImageView.mas_left).offset(-3);
}];
[self.fifImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.centerY.mas_equalTo(self.firstImageView);
make.right.mas_equalTo(self.fourImageView.mas_left).offset(-3);
}];
}
#pragma mark - Getters And Setters
- (void)setRoomInfo:(HomeCollectRoomModel *)roomInfo {
_roomInfo = roomInfo;
if (_roomInfo) {
self.avatarImageView.imageUrl = _roomInfo.roomAvatar;
self.nickLabel.text = _roomInfo.roomName;
self.tagImageView.imageUrl = _roomInfo.tagPict;
self.idLabel.text = [NSString stringWithFormat:@"ID:%@", _roomInfo.erbanNo];
self.numberLabel.text = _roomInfo.roomOnlineNum;
self.pkButton.hidden = !_roomInfo.crossPking;
for (int i = 0; i< self.micContainerView.subviews.count; i++) {
NetImageView * imageView = [self.micContainerView.subviews objectAtIndex:i];
if (i< _roomInfo.micUsers.count) {
HomePlayMicUserModel * micUserInfo = [_roomInfo.micUsers objectAtIndex:i];
imageView.imageUrl = micUserInfo.avatar;
imageView.hidden = NO;
} else {
imageView.hidden = YES;
}
}
}
}
- (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 = 8;
_avatarImageView.layer.borderColor = [ThemeColor appMainColor].CGColor;
}
return _avatarImageView;
}
- (UIButton *)pkButton {
if (!_pkButton) {
_pkButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_pkButton setTitle:@"pk中" forState:UIControlStateNormal];
[_pkButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
_pkButton.titleLabel.font = [UIFont systemFontOfSize:12];
[_pkButton setBackgroundImage:[UIImage imageNamed:@"home_like_across_pk_bg"] forState:UIControlStateNormal];
_pkButton.layer.masksToBounds = YES;
_pkButton.layer.cornerRadius = 10;
}
return _pkButton;
}
- (UIImageView *)backImageView {
if (!_backImageView) {
_backImageView = [[UIImageView alloc] init];
_backImageView.userInteractionEnabled = YES;
_backImageView.layer.masksToBounds = YES;
_backImageView.layer.shadowColor = UIColorRGBAlpha(0xE5E5F2, 0.34).CGColor;
_backImageView.layer.cornerRadius = 12;
_backImageView.layer.shadowOffset = CGSizeMake(4, 4);
_backImageView.image = [UIImage imageWithColor:[ThemeColor appCellBackgroundColor]];
}
return _backImageView;
}
- (UILabel *)nickLabel {
if (!_nickLabel) {
_nickLabel = [[UILabel alloc] init];
_nickLabel.font = [UIFont systemFontOfSize:14];
_nickLabel.textColor = [ThemeColor mainTextColor];
}
return _nickLabel;
}
- (NetImageView *)tagImageView {
if (!_tagImageView) {
_tagImageView = [[NetImageView alloc] init];
}
return _tagImageView;
}
- (UILabel *)idLabel {
if (!_idLabel) {
_idLabel = [[UILabel alloc] init];
_idLabel.font = [UIFont systemFontOfSize:12];
_idLabel.textColor = [ThemeColor secondTextColor];
}
return _idLabel;
}
- (UIView *)personContainerView {
if (!_personContainerView) {
_personContainerView = [[UIView alloc] init];
_personContainerView.backgroundColor = [UIColor clearColor];
_personContainerView.layer.masksToBounds = YES;
_personContainerView.layer.cornerRadius = 8;
}
return _personContainerView;
}
- (UIImageView *)hotImageView {
if (!_hotImageView) {
_hotImageView = [[UIImageView alloc] init];
_hotImageView.userInteractionEnabled = YES;
_hotImageView.image = [UIImage imageNamed:@"room_like_collect_room_hot"];
}
return _hotImageView;
}
- (UILabel *)numberLabel {
if (!_numberLabel) {
_numberLabel = [[UILabel alloc] init];
_numberLabel.font = [UIFont boldSystemFontOfSize:12];
_numberLabel.textColor = [ThemeColor mainTextColor];
}
return _numberLabel;
}
- (UIView *)micContainerView {
if (!_micContainerView) {
_micContainerView = [[UIView alloc] init];
_micContainerView.backgroundColor = [UIColor clearColor];
}
return _micContainerView;
}
- (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.borderColor = [UIColor whiteColor].CGColor;
_firstImageView.layer.borderWidth = 1;
}
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.borderColor = [UIColor whiteColor].CGColor;
_secondImageView.layer.borderWidth = 1;
}
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.borderColor = [UIColor whiteColor].CGColor;
_thirdImageView.layer.borderWidth = 1;
}
return _thirdImageView;
}
- (NetImageView *)fourImageView {
if (!_fourImageView) {
NetImageConfig * config = [[NetImageConfig alloc]init];
config.imageType = ImageTypeUserIcon;
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
_fourImageView = [[NetImageView alloc] initWithConfig:config];
_fourImageView.layer.masksToBounds = YES;
_fourImageView.layer.cornerRadius = 8;
_fourImageView.layer.borderColor = [UIColor whiteColor].CGColor;
_fourImageView.layer.borderWidth = 1;
}
return _fourImageView;
}
- (NetImageView *)fifImageView {
if (!_fifImageView) {
NetImageConfig * config = [[NetImageConfig alloc]init];
config.imageType = ImageTypeUserIcon;
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
_fifImageView = [[NetImageView alloc] initWithConfig:config];
_fifImageView.layer.masksToBounds = YES;
_fifImageView.layer.cornerRadius = 8;
_fifImageView.layer.borderColor = [UIColor whiteColor].CGColor;
_fifImageView.layer.borderWidth = 1;
}
return _fifImageView;
}
@end

View File

@@ -133,6 +133,7 @@
_titleView.averageCellSpacingEnabled = NO;
_titleView.defaultSelectedIndex = 0;
_titleView.cellSpacing = 20;
_titleView.contentEdgeInsetLeft = 15;
JXCategoryIndicatorImageView *lineView = [[JXCategoryIndicatorImageView alloc] init];
lineView.indicatorWidth = 48;

View File

@@ -249,6 +249,7 @@ UIKIT_EXTERN NSString * kHomeMoreScrollPageKey;
#pragma mark - XPHomeSectionViewDelegate
- (void)didClickXPHomeSectionView:(XPHomeSectionView *)view {
NSInteger section = view.tag - 1000;
section = 3;
NSString * sectionStr = [NSString stringWithFormat:@"%ld",section];
NSDictionary * dic = @{@"section": sectionStr};
[[NSNotificationCenter defaultCenter] postNotificationName:kHomeMoreScrollPageKey object:dic];

View File

@@ -21,7 +21,10 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,copy) NSString *imageName;
///代理
@property (nonatomic,weak) id<XPHomeSectionViewDelegate> delegate;
///是否隐藏头部的图片
@property (nonatomic,assign) BOOL isHiddenLogo;
///是否隐藏更多
@property (nonatomic,assign) BOOL isHiddenMore;
@end
NS_ASSUME_NONNULL_END

View File

@@ -76,7 +76,7 @@
}
#pragma mark - Event Response
- (void)moreControlAction:(UIControl *)sender {
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickXPHomeSectionView:)]) {
if (!self.isHiddenMore && self.delegate && [self.delegate respondsToSelector:@selector(didClickXPHomeSectionView:)]) {
[self.delegate didClickXPHomeSectionView:self];
}
}
@@ -96,6 +96,15 @@
}
}
- (void)setIsHiddenLogo:(BOOL)isHiddenLogo {
_isHiddenLogo = isHiddenLogo;
self.logoImageView.hidden = _isHiddenLogo;
}
- (void)setIsHiddenMore:(BOOL)isHiddenMore {
_isHiddenMore = isHiddenMore;
self.moreStackView.hidden = _isHiddenMore;
}
- (UIStackView *)logoStackView {
if (!_logoStackView) {

View File

@@ -0,0 +1,16 @@
//
// XPHomeLikeViewController.h
// xplan-ios
//
// Created by 冯硕 on 2022/3/2.
//
#import "MvpViewController.h"
#import <JXCategoryView/JXCategoryListContainerView.h>
NS_ASSUME_NONNULL_BEGIN
@interface XPHomeLikeViewController : MvpViewController<JXCategoryListContentViewDelegate>
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,299 @@
//
// XPHomeLikeViewController.m
// xplan-ios
//
// Created by on 2022/3/2.
//
#import "XPHomeLikeViewController.h"
///Third
#import <Masonry/Masonry.h>
#import <MJRefresh/MJRefresh.h>
///Tool
#import "XPMacro.h"
#import "ThemeColor.h"
///Model
#import "HomeLiveRoomModel.h"
#import "HomeCollectRoomModel.h"
///View
#import "XPHomeAttentionTableViewCell.h"
#import "XPHomeCollectRoomTableViewCell.h"
#import "XPHomeListEmptyTableViewCell.h"
#import "XPHomeSectionView.h"
#import "XPMineAttentionViewController.h"
#import "XPRoomViewController.h"
#import "XPMineUserInfoViewController.h"
///P
#import "XPHomeLikePresenter.h"
#import "XPHomeLikeProtocol.h"
@interface XPHomeLikeViewController ()<UITableViewDataSource, UITableViewDelegate, XPHomeSectionViewDelegate, XPHomeLikeProtocol, XPHomeAttentionTableViewCellDelegate>
///
@property (nonatomic,strong) UITableView *tableView;
///
@property (nonatomic,strong) NSArray *attentionList;
///
@property (nonatomic,strong) NSMutableArray *collectRoomList;
///
@property (nonatomic,assign) int page;
@end
@implementation XPHomeLikeViewController
- (BOOL)isHiddenNavBar {
return YES;
}
- (XPHomeLikePresenter *)createPresenter {
return [[XPHomeLikePresenter alloc] init];
}
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor clearColor];
[self initHeaderAndFooterRrfresh];
[self initSubViews];
[self initSubViewConstraints];
}
#pragma mark - Private Method
- (void)initSubViews {
[self.view addSubview:self.tableView];
}
- (void)initSubViewConstraints {
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.view);
}];
}
- (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.tableView.mj_header = header;
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;
[self headerRefresh];
}
- (void)headerRefresh {
self.page = 1;
[self.presenter getHomeAttectionList];
[self.presenter getHomeCollectRoomList:self.page state:0];
}
- (void)footerRefresh {
self.page++;
[self.presenter getHomeCollectRoomList:self.page state:1];
}
//UItableview headerview
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
CGFloat sectionHeaderHeight = 38;
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 - UITableViewDelegate And UITableViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
///
return 3;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
if (section == 0) {
return self.attentionList.count > 0 ? 1 : 0;
} else if(section == 1) {
return self.collectRoomList.count> 0 ? self.collectRoomList.count : 0;
} else {
return (self.collectRoomList.count <=0 && self.attentionList.count <=0) ? 1 : 0;
}
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.section == 0) {
return 56 + 24 + 12 * 2;
} else if(indexPath.section == 1) {
return 66 + 8 + 10;
} else {
return 400;
}
}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
if (section == 0) {
return self.attentionList.count > 0 ? 38 : 0;
} else if(section == 1) {
return self.collectRoomList.count > 0 ? 38 : 0;
}
return 0.01f;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
if (section == 0) {
XPHomeSectionView * sectionView = [[XPHomeSectionView alloc] init];
sectionView.frame = CGRectMake(0, 0, KScreenWidth, 38);
sectionView.tag = 1000 + section;
sectionView.isHiddenLogo = YES;
sectionView.title = @"关注的人";
sectionView.delegate= self;
return sectionView;
} else if (section == 1) {
XPHomeSectionView * sectionView = [[XPHomeSectionView alloc] init];
sectionView.frame = CGRectMake(0, 0, KScreenWidth, 38);
sectionView.isHiddenLogo = YES;
sectionView.title = @"收藏的房间";
sectionView.tag = 1000 + section;
sectionView.isHiddenMore = YES;
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) {
XPHomeAttentionTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPHomeAttentionTableViewCell class])];
if (cell == nil) {
cell = [[XPHomeAttentionTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPHomeAttentionTableViewCell class])];
}
cell.attentionList = self.attentionList;
cell.delegate = self;
return cell;
} else if(indexPath.section == 1) {
XPHomeCollectRoomTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPHomeCollectRoomTableViewCell class])];
if (cell == nil) {
cell = [[XPHomeCollectRoomTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPHomeCollectRoomTableViewCell class])];
}
cell.roomInfo = [self.collectRoomList objectAtIndex:indexPath.row];
return cell;
} else {
XPHomeListEmptyTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPHomeListEmptyTableViewCell class])];
if (cell == nil) {
cell = [[XPHomeListEmptyTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPHomeListEmptyTableViewCell class])];
}
return cell;
}
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
if (indexPath.section == 1 && self.collectRoomList.count > 0) {
HomeCollectRoomModel * roomInfo = [self.collectRoomList objectAtIndex:indexPath.row];
if (roomInfo.roomUid.integerValue > 0) {
[XPRoomViewController openRoom:roomInfo.roomUid viewController:self];
}
}
}
#pragma mark - XPHomeLikeProtocol
- (void)getHomeCollectRoomListFail:(NSString *)message state:(int)state {
if (state == 0) {
[self.tableView.mj_header endRefreshing];
} else {
[self.tableView.mj_footer endRefreshing];
}
}
- (void)getHomeCollectRoomListSuccess:(NSArray *)roomList state:(int)state {
if (state == 9) {
[self.collectRoomList removeAllObjects];
}
if (roomList.count > 0) {
[self.collectRoomList addObjectsFromArray:roomList];
}
if (state == 0) {
[self.tableView.mj_header endRefreshing];
} else {
if (roomList.count > 0) {
[self.tableView.mj_footer endRefreshing];
} else {
[self.tableView.mj_footer endRefreshingWithNoMoreData];
}
}
[self.tableView reloadData];
}
- (void)getHomeAttentionListSuccess:(NSArray *)liveList {
self.attentionList = liveList;
[self.tableView.mj_header endRefreshing];
[self.tableView reloadData];
}
- (void)getHomeAttentionListFail:(NSString *)message {
[self.tableView.mj_header endRefreshing];
}
#pragma mark - XPHomeSectionViewDelegate
- (void)didClickXPHomeSectionView:(XPHomeSectionView *)view {
XPMineAttentionViewController * attentionVC = [[XPMineAttentionViewController alloc] init];
[self.navigationController pushViewController:attentionVC animated:YES];
}
#pragma mark - XPHomeAttentionTableViewCellDelegate
- (void)xPHomeAttentionTableViewCell:(XPHomeAttentionTableViewCell *)view didClickItem:(HomeLiveRoomModel *)model {
if (model.roomUid > 0) {
[XPRoomViewController openRoom:[NSString stringWithFormat:@"%ld", model.uid] viewController:self];
} else {
if (model.uid > 0) {
XPMineUserInfoViewController * userInfoVC = [[XPMineUserInfoViewController alloc] init];
userInfoVC.uid = model.uid;
[self.navigationController pushViewController:userInfoVC animated:YES];
}
}
}
#pragma mark - JXCategoryListContentViewDelegate
- (UIView *)listView {
return self.view;
}
#pragma mark - Getters And Setters
- (UITableView *)tableView {
if (!_tableView) {
_tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped];
_tableView.delegate = self;
_tableView.dataSource = self;
_tableView.tableHeaderView = [UIView new];
_tableView.tableFooterView = [UIView new];
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
_tableView.backgroundColor = [UIColor clearColor];
if (@available(iOS 11.0, *)) {
_tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}
[_tableView registerClass:[XPHomeAttentionTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPHomeAttentionTableViewCell class])];
[_tableView registerClass:[XPHomeCollectRoomTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPHomeCollectRoomTableViewCell class])];
[_tableView registerClass:[XPHomeListEmptyTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPHomeListEmptyTableViewCell class])];
}
return _tableView;
}
- (NSMutableArray *)collectRoomList {
if (!_collectRoomList) {
_collectRoomList = [NSMutableArray array];
}
return _collectRoomList;
}
@end

View File

@@ -10,7 +10,7 @@
NS_ASSUME_NONNULL_BEGIN
@interface XPHomePartyContainerViewController : MvpViewController<JXCategoryListContentViewDelegate>
@property (nonatomic,assign) NSInteger defaultSelectedIndex;
@end
NS_ASSUME_NONNULL_END

View File

@@ -9,6 +9,7 @@
///Third
#import <Masonry/Masonry.h>
#import <JXCategoryView/JXCategoryView.h>
#import <JXCategoryView/JXCategoryIndicatorBackgroundView.h>
#import <JXCategoryView/JXCategoryListContainerView.h>
///Tool
#import "XPMacro.h"
@@ -20,10 +21,12 @@
#import "XPRoomSearchContainerViewController.h"
#import "XPHomePartyViewController.h"
#import "XPWebViewController.h"
#import "XPHomeLikeViewController.h"
///P
#import "XPHomeContainerPresenter.h"
#import "XPHomeContainerProtocol.h"
UIKIT_EXTERN NSString * kHomeMoreScrollPageKey;
@interface XPHomePartyContainerViewController ()<JXCategoryViewDelegate, JXCategoryListContainerViewDelegate, XPHomeContainerProtocol>
///
@@ -35,7 +38,7 @@
///tag
@property (nonatomic,copy) NSArray<HomeTagModel *> *tagList;
/// init
@property (nonatomic, strong) NSMutableDictionary <NSString *, XPHomePartyViewController<JXCategoryListContentViewDelegate> *> *listCache;
@property (nonatomic, strong) NSMutableDictionary <NSString *, UIViewController<JXCategoryListContentViewDelegate> *> *listCache;
@end
@implementation XPHomePartyContainerViewController
@@ -56,6 +59,7 @@
#pragma mark - Private Method
- (void)initSubViews {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(recommendMoreNotification:) name:kHomeMoreScrollPageKey object:nil];
self.view.backgroundColor = [UIColor clearColor];
[self.view addSubview:self.titleView];
[self.view addSubview:self.contentView];
@@ -63,12 +67,13 @@
- (void)initSubViewConstraints {
[self.titleView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.top.mas_equalTo(self.view);
make.height.mas_equalTo(50);
make.top.mas_equalTo(self.view).offset(10);
make.left.right.mas_equalTo(self.view);
make.height.mas_equalTo(30);
}];
[self.contentView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.titleView.mas_bottom).offset(10);
make.top.mas_equalTo(self.titleView.mas_bottom);
make.left.right.bottom.mas_equalTo(self.view);
}];
}
@@ -84,22 +89,32 @@
- (id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index {
HomeTagModel * hometag = [self.tagList objectAtIndex:index];
XPHomePartyViewController<JXCategoryListContentViewDelegate> * list = _listCache[hometag.tid];
UIViewController<JXCategoryListContentViewDelegate> * list = _listCache[hometag.tid];
if (list) {
return list;
} else {
XPHomePartyViewController * homeVC = [[XPHomePartyViewController alloc] init];
homeVC.tabId = hometag.tid;
//
_listCache[hometag.tid] = homeVC;
return homeVC;
if ([hometag.name isEqualToString:@"喜欢"]) {
XPHomeLikeViewController * likeVC = [[XPHomeLikeViewController alloc] init];
//
_listCache[hometag.tid] = likeVC;
return likeVC;
} else {
XPHomePartyViewController * homeVC = [[XPHomePartyViewController alloc] init];
homeVC.tabId = hometag.tid;
//
_listCache[hometag.tid] = homeVC;
return homeVC;
}
}
}
- (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index {
HomeTagModel * hometag = [self.tagList objectAtIndex:index];
XPHomePartyViewController<JXCategoryListContentViewDelegate> * list = _listCache[hometag.tid];
list.tabId = hometag.tid;
if (![hometag.name isEqualToString:@"喜欢"]) {
XPHomePartyViewController * list = (XPHomePartyViewController<JXCategoryListContentViewDelegate> *)_listCache[hometag.tid];
list.tabId = hometag.tid;
}
}
#pragma mark - JXCategoryListContentViewDelegate
@@ -121,6 +136,23 @@
[self.titleView reloadData];
}
#pragma mark - Event Response
- (void)recommendMoreNotification:(NSNotification *)notification {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
if ([notification.object[@"section"] integerValue] == 3) {
__block NSUInteger index;
[self.tagList enumerateObjectsUsingBlock:^(HomeTagModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
if ([obj.name containsString:@"个播"]) {
index = idx;
*stop = YES;
}
}];
self.titleView.defaultSelectedIndex = index;
[self.titleView reloadData];
}
});
}
#pragma mark - Getters And Setters
- (JXCategoryTitleView *)titleView {
if (!_titleView) {
@@ -135,7 +167,16 @@
_titleView.titleLabelAnchorPointStyle = JXCategoryTitleLabelAnchorPointStyleCenter;
_titleView.contentScrollViewClickTransitionAnimationEnabled = NO;
_titleView.defaultSelectedIndex = 0;
_titleView.cellSpacing = 0;
_titleView.cellWidthIncrement = 20;
_titleView.listContainer = self.contentView;
JXCategoryIndicatorBackgroundView * indocator = [[JXCategoryIndicatorBackgroundView alloc] init];
indocator.indicatorColor = [ThemeColor appMainColor];
indocator.indicatorHeight = 24;
indocator.indicatorWidthIncrement = 10;
indocator.indicatorCornerRadius = 12;
_titleView.indicators = @[indocator];
}
return _titleView;
}
@@ -147,4 +188,12 @@
}
return _contentView;
}
- (NSMutableDictionary<NSString *,XPHomePartyViewController<JXCategoryListContentViewDelegate> *> *)listCache {
if (!_listCache) {
_listCache = [NSMutableDictionary dictionary];
}
return _listCache;
}
@end

View File

@@ -31,6 +31,9 @@ UIKIT_EXTERN NSString *kHomeMoreScrollPageKey;
@property (nonatomic,strong) UIImageView *topBackImageView;
///
@property (nonatomic,strong) XPHomeNavView *homeNavView;
@property (nonatomic,assign) NSInteger defaultSelectedIndex;
@property (nonatomic,strong) XPHomeRecommendViewController *recommendVC;
@property (nonatomic,strong) XPHomePartyContainerViewController *partyVC;
@end
@implementation XPHomeViewController
@@ -83,9 +86,9 @@ UIKIT_EXTERN NSString *kHomeMoreScrollPageKey;
// index `JXCategoryListContentViewDelegate`
- (id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index {
if (index == 0) {
return [[XPHomeRecommendViewController alloc] init];
return self.recommendVC;
}else if (index == 1) {
return [[XPHomePartyContainerViewController alloc] init];
return self.partyVC;
}
return nil;
}
@@ -105,9 +108,7 @@ UIKIT_EXTERN NSString *kHomeMoreScrollPageKey;
#pragma mark - Event Response
- (void)recommendMoreNotification:(NSNotification *)notification {
NSDictionary * dic = notification.object;
//TODO: tad
[self.homeNavView.titleView selectItemAtIndex:1];
[self.homeNavView.titleView selectItemAtIndex:1];
}
#pragma mark - Getters And Setters
@@ -145,6 +146,19 @@ UIKIT_EXTERN NSString *kHomeMoreScrollPageKey;
}
- (XPHomeRecommendViewController *)recommendVC {
if (!_recommendVC) {
_recommendVC = [[XPHomeRecommendViewController alloc] init];
}
return _recommendVC;
}
- (XPHomePartyContainerViewController *)partyVC {
if (!_partyVC) {
_partyVC = [[XPHomePartyContainerViewController alloc] init];
}
return _partyVC;
}
@end