diff --git a/xplan-ios.xcodeproj/project.pbxproj b/xplan-ios.xcodeproj/project.pbxproj index 666ba5de..907206e9 100644 --- a/xplan-ios.xcodeproj/project.pbxproj +++ b/xplan-ios.xcodeproj/project.pbxproj @@ -22,6 +22,9 @@ 14F9795F29B6D03B004BBFEB /* ZBCycleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 14F9795D29B6D03B004BBFEB /* ZBCycleView.m */; }; 14F9796229B6E1DE004BBFEB /* XPMomentTopicHeaderCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 14F9796129B6E1DE004BBFEB /* XPMomentTopicHeaderCell.m */; }; 14F9796529B71189004BBFEB /* XPMonentsEmptyCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 14F9796429B71189004BBFEB /* XPMonentsEmptyCollectionViewCell.m */; }; + 14F9796829B71E94004BBFEB /* XPPartyListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 14F9796729B71E94004BBFEB /* XPPartyListViewController.m */; }; + 14F9796B29B71EC9004BBFEB /* XPPartyListCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 14F9796A29B71EC9004BBFEB /* XPPartyListCollectionViewCell.m */; }; + 14F9796E29B72810004BBFEB /* XPPartyHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 14F9796D29B72810004BBFEB /* XPPartyHeaderView.m */; }; 180116F9279E8C4C00F2CBC0 /* PLTimeUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 180116F8279E8C4C00F2CBC0 /* PLTimeUtil.m */; }; 180116FC279E8CCE00F2CBC0 /* NVDate.m in Sources */ = {isa = PBXBuildFile; fileRef = 180116FA279E8CCE00F2CBC0 /* NVDate.m */; }; 180806D827293794001FD836 /* NSObject+MJExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = 180806D727293794001FD836 /* NSObject+MJExtension.m */; }; @@ -1312,6 +1315,12 @@ 14F9796129B6E1DE004BBFEB /* XPMomentTopicHeaderCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMomentTopicHeaderCell.m; sourceTree = ""; }; 14F9796329B71189004BBFEB /* XPMonentsEmptyCollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMonentsEmptyCollectionViewCell.h; sourceTree = ""; }; 14F9796429B71189004BBFEB /* XPMonentsEmptyCollectionViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMonentsEmptyCollectionViewCell.m; sourceTree = ""; }; + 14F9796629B71E94004BBFEB /* XPPartyListViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPPartyListViewController.h; sourceTree = ""; }; + 14F9796729B71E94004BBFEB /* XPPartyListViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPPartyListViewController.m; sourceTree = ""; }; + 14F9796929B71EC9004BBFEB /* XPPartyListCollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPPartyListCollectionViewCell.h; sourceTree = ""; }; + 14F9796A29B71EC9004BBFEB /* XPPartyListCollectionViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPPartyListCollectionViewCell.m; sourceTree = ""; }; + 14F9796C29B72810004BBFEB /* XPPartyHeaderView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPPartyHeaderView.h; sourceTree = ""; }; + 14F9796D29B72810004BBFEB /* XPPartyHeaderView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPPartyHeaderView.m; sourceTree = ""; }; 180116F7279E8C4C00F2CBC0 /* PLTimeUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PLTimeUtil.h; sourceTree = ""; }; 180116F8279E8C4C00F2CBC0 /* PLTimeUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PLTimeUtil.m; sourceTree = ""; }; 180116FA279E8CCE00F2CBC0 /* NVDate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NVDate.m; sourceTree = ""; }; @@ -8423,6 +8432,12 @@ 14EDBBA929B5935F001D3E16 /* XPFindNewFriendViewController.m */, 14EDBBC029B60FFE001D3E16 /* XPPartyViewController.h */, 14EDBBC129B60FFE001D3E16 /* XPPartyViewController.m */, + 14F9796C29B72810004BBFEB /* XPPartyHeaderView.h */, + 14F9796D29B72810004BBFEB /* XPPartyHeaderView.m */, + 14F9796629B71E94004BBFEB /* XPPartyListViewController.h */, + 14F9796729B71E94004BBFEB /* XPPartyListViewController.m */, + 14F9796929B71EC9004BBFEB /* XPPartyListCollectionViewCell.h */, + 14F9796A29B71EC9004BBFEB /* XPPartyListCollectionViewCell.m */, ); path = View; sourceTree = ""; @@ -9849,6 +9864,7 @@ E8AC721326F46ADD007D6E91 /* XPMineSettingViewController.m in Sources */, 18E7B32126F098650064BC9B /* UserInfoSkillVo.m in Sources */, E8AC722726F482A4007D6E91 /* XPMineFeedbackPresenter.m in Sources */, + 14F9796829B71E94004BBFEB /* XPPartyListViewController.m in Sources */, E86B911A28102AF90007DEE7 /* SessionToolbarView.m in Sources */, 9BD6E435289A48E3007DCF42 /* XPNewUserRechargePresentTrasition.m in Sources */, 18AAF3F0279EA59300CD7DAD /* MessageContentTextClickable.m in Sources */, @@ -10205,6 +10221,7 @@ E8001648280426CB00D6D17A /* XPMineAnchorIncomeStatisViewController.m in Sources */, E8F9168427EC913C00F10D8F /* XPHomeLittleGameViewController.m in Sources */, E8E5E1B327C397A400F457D8 /* HomeMenuInfoModel.m in Sources */, + 14F9796B29B71EC9004BBFEB /* XPPartyListCollectionViewCell.m in Sources */, E8AEAEF027141C430017FCE0 /* XPRoomMenuContainerView.m in Sources */, 9B85F3532806AB9A006EDF51 /* XPAnchorPKResultView.m in Sources */, E81AF32527F1D5B8003B9E43 /* XPRoomPKProgressView.m in Sources */, @@ -10343,6 +10360,7 @@ 9B64BCB028E2A3D900778F13 /* XPMineHeadTeenagerView.m in Sources */, 9BD2ECCE288F829600F5CD9A /* XPMineFootPrintViewController.m in Sources */, 9B4E920028E57A620033419E /* XPGiftHeadTypeView.m in Sources */, + 14F9796E29B72810004BBFEB /* XPPartyHeaderView.m in Sources */, E86A16BF2856D4D5004228B8 /* XPSessionFindNewGreetListView.m in Sources */, E8E70D8F26F2F5DB00F03460 /* XPMineMenuTableViewCell.m in Sources */, E80016422804228100D6D17A /* XPGuildIncomePresenter.m in Sources */, diff --git a/xplan-ios/Assets.xcassets/Home/home_party_cell_bg.imageset/Contents.json b/xplan-ios/Assets.xcassets/Home/home_party_cell_bg.imageset/Contents.json new file mode 100644 index 00000000..df900042 --- /dev/null +++ b/xplan-ios/Assets.xcassets/Home/home_party_cell_bg.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "home_party_cell_bg@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "home_party_cell_bg@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Home/home_party_cell_bg.imageset/home_party_cell_bg@2x.png b/xplan-ios/Assets.xcassets/Home/home_party_cell_bg.imageset/home_party_cell_bg@2x.png new file mode 100644 index 00000000..0cb98014 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Home/home_party_cell_bg.imageset/home_party_cell_bg@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Home/home_party_cell_bg.imageset/home_party_cell_bg@3x.png b/xplan-ios/Assets.xcassets/Home/home_party_cell_bg.imageset/home_party_cell_bg@3x.png new file mode 100644 index 00000000..96b15d72 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Home/home_party_cell_bg.imageset/home_party_cell_bg@3x.png differ diff --git a/xplan-ios/Assets.xcassets/Home/home_party_fire.imageset/Contents.json b/xplan-ios/Assets.xcassets/Home/home_party_fire.imageset/Contents.json new file mode 100644 index 00000000..65636101 --- /dev/null +++ b/xplan-ios/Assets.xcassets/Home/home_party_fire.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "home_party_fire@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "home_party_fire@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Home/home_party_fire.imageset/home_party_fire@2x.png b/xplan-ios/Assets.xcassets/Home/home_party_fire.imageset/home_party_fire@2x.png new file mode 100644 index 00000000..94b14522 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Home/home_party_fire.imageset/home_party_fire@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Home/home_party_fire.imageset/home_party_fire@3x.png b/xplan-ios/Assets.xcassets/Home/home_party_fire.imageset/home_party_fire@3x.png new file mode 100644 index 00000000..4026db65 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Home/home_party_fire.imageset/home_party_fire@3x.png differ diff --git a/xplan-ios/Main/Home/Presenter/XPHomePresenter.h b/xplan-ios/Main/Home/Presenter/XPHomePresenter.h index aea48f08..8ae26ca4 100644 --- a/xplan-ios/Main/Home/Presenter/XPHomePresenter.h +++ b/xplan-ios/Main/Home/Presenter/XPHomePresenter.h @@ -21,6 +21,9 @@ NS_ASSUME_NONNULL_BEGIN /// 获取更多的个播房间 - (void)getHomeMoreAnchorRoomList; +/// 获取派对推荐列表 +- (void)getPartyRecommendRoomList; + @end NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Home/Presenter/XPHomePresenter.m b/xplan-ios/Main/Home/Presenter/XPHomePresenter.m index 291eba0b..958670fc 100644 --- a/xplan-ios/Main/Home/Presenter/XPHomePresenter.m +++ b/xplan-ios/Main/Home/Presenter/XPHomePresenter.m @@ -41,4 +41,41 @@ }] singleRoomSortId:@""]; } +/// 获取派对推荐列表 +- (void)getPartyRecommendRoomList { + NSString * uid = [AccountInfoStorage instance].getUid; + [Api homeRecommendRoomList:[self createHttpCompletion:^(BaseModel * _Nonnull data) { + NSArray * array = [HomeRecommendRoomModel modelsWithArray:data.data]; + if (array.count > 1) { + ///排列顺序 1 - 6 0 + NSArray * newArray = [array sortedArrayUsingComparator:^NSComparisonResult(id _Nonnull obj1, id _Nonnull obj2) { + HomeRecommendRoomModel * model1 = obj1; + HomeRecommendRoomModel * model2 = obj2; + return [model1.seq compare:model2.seq]; + }]; + if (newArray.count > 0) { + NSMutableArray * array = [NSMutableArray arrayWithArray:newArray]; + NSMutableArray * temAray = [NSMutableArray array]; + [newArray enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { + HomeRecommendRoomModel * model = obj; + if (model.seq.intValue == 0) { + [temAray addObject:model]; + [array removeObject:model]; + } + }]; + if (temAray.count > 0) { + [array addObjectsFromArray:temAray]; + } + newArray = array.copy; + } + array = newArray; + } + + [[self getView] getPartyRecommendRoomListSuccess:array]; + + }fail:^(NSInteger code, NSString * _Nullable msg) { + [[self getView] getPartyRecommendDataFail]; + }] uid:uid]; +} + @end diff --git a/xplan-ios/Main/Home/Protocol/XPHomeProtocol.h b/xplan-ios/Main/Home/Protocol/XPHomeProtocol.h index fd7a8c48..22c75b60 100644 --- a/xplan-ios/Main/Home/Protocol/XPHomeProtocol.h +++ b/xplan-ios/Main/Home/Protocol/XPHomeProtocol.h @@ -18,6 +18,11 @@ NS_ASSUME_NONNULL_BEGIN - (void)getHomeMoreAnchorRoomListSuccess:(NSArray *)list; ///请求更多个播房失败 - (void)getHomeMoreAnchorRoomListFail:(NSString *)messag; +///获取派对推荐列表成功 +- (void)getPartyRecommendRoomListSuccess:(NSArray *)list; +///获取派对数据失败 +- (void)getPartyRecommendDataFail; + @end NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Home/View/XPHomePartyViewController.m b/xplan-ios/Main/Home/View/XPHomePartyViewController.m index 4a0e00e3..00b0be55 100644 --- a/xplan-ios/Main/Home/View/XPHomePartyViewController.m +++ b/xplan-ios/Main/Home/View/XPHomePartyViewController.m @@ -29,7 +29,7 @@ @property (nonatomic,strong) NSMutableArray *datasource; ///列表 @property (nonatomic,strong) UICollectionView *collectionView; -@property (nonatomic, copy) void(^scrollCallback)(UIScrollView *scrollView); + ///当前的页数 @property (nonatomic,assign) int page; ///没有新的数据了 @@ -188,18 +188,6 @@ return self.view; } -- (UIScrollView *)listScrollView { - return self.collectionView; -} - -- (void)listViewDidScrollCallback:(void (^)(UIScrollView *))callback { - self.scrollCallback = callback; -} - -- (void)scrollViewDidScroll:(UIScrollView *)scrollView { - self.scrollCallback(scrollView); -} - #pragma mark - Getters And Setters - (void)setIsAnchor:(BOOL)isAnchor { diff --git a/xplan-ios/Main/Home/View/XPPartyHeaderView.h b/xplan-ios/Main/Home/View/XPPartyHeaderView.h new file mode 100644 index 00000000..77794250 --- /dev/null +++ b/xplan-ios/Main/Home/View/XPPartyHeaderView.h @@ -0,0 +1,30 @@ +// +// XPPartyHeaderView.h +// xplan-ios +// +// Created by XY on 2023/3/7. +// + +#import +#import "HomeBannerInfoModel.h" + +NS_ASSUME_NONNULL_BEGIN + +@protocol XPPartyHeaderViewDelegate +/// 点击banner +- (void)partyHeaderViewClickBanner:(HomeBannerInfoModel *)banner; + +@end + +@interface XPPartyHeaderView : UIView + +@property (nonatomic, strong) NSArray *bannerList; + +@property (nonatomic, weak) id delegate; + +/// 获取头部高度 ++ (CGFloat)getPartyHeaderViewHeight; + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Home/View/XPPartyHeaderView.m b/xplan-ios/Main/Home/View/XPPartyHeaderView.m new file mode 100644 index 00000000..5a7bdecc --- /dev/null +++ b/xplan-ios/Main/Home/View/XPPartyHeaderView.m @@ -0,0 +1,116 @@ +// +// XPPartyHeaderView.m +// xplan-ios +// +// Created by XY on 2023/3/7. +// + +#import "XPPartyHeaderView.h" +///Third +#import +#import +/// Tool +#import "ThemeColor.h" +#import "XPMacro.h" +#import "NSArray+Safe.h" + +@interface XPPartyHeaderView() +/// 背景 +@property (nonatomic, strong) UIView *bgView; +/// 轮播图 +@property (nonatomic, strong) SDCycleScrollView *cycleScrollView; + +@end + +@implementation XPPartyHeaderView + +- (instancetype)initWithFrame:(CGRect)frame { + self = [super initWithFrame:frame]; + if (self) { + [self initSubViews]; + [self initSubViewConstraints]; + } + return self; +} + ++ (CGFloat)getPartyHeaderViewHeight { + CGFloat width = KScreenWidth-15*2; + CGFloat height = 74.0/345.0*width; + return height+20; +} + +#pragma mark - Private Method +- (void)initSubViews { + [self addSubview:self.bgView]; + [self.bgView addSubview:self.cycleScrollView]; +} + +- (void)initSubViewConstraints { + [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(10); + make.left.mas_equalTo(15); + make.right.mas_equalTo(-15); + make.bottom.mas_equalTo(-10); + }]; + [self.cycleScrollView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.left.right.bottom.mas_equalTo(0); + }]; +} + ++ (CGFloat)getTopicHeaderViewHeight { + CGFloat width = KScreenWidth-15*2; + CGFloat height = 74.0/345.0*width; + return height+20; +} + +#pragma mark - SDCycleScrollViewDelegate +- (void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didSelectItemAtIndex:(NSInteger)index { + HomeBannerInfoModel * bannerInfo = [self.bannerList safeObjectAtIndex1:index]; + if (self.delegate && [self.delegate respondsToSelector:@selector(partyHeaderViewClickBanner:)]) { + [self.delegate partyHeaderViewClickBanner:bannerInfo]; + } +} + +#pragma mark - Getters And Setters + +- (void)setBannerList:(NSArray *)bannerList { + _bannerList = bannerList; + if (_bannerList.count > 0) { + NSMutableArray * array = [NSMutableArray array]; + [_bannerList enumerateObjectsUsingBlock:^(HomeBannerInfoModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { + if (obj.bannerPic.length > 0) { + [array addObject:obj.bannerPic]; + } + }]; + if (array.count > 0) { + self.cycleScrollView.imageURLStringsGroup = array; + [self.cycleScrollView autoScroll]; + } + } +} + +- (UIView *)bgView { + if (!_bgView) { + _bgView = [[UIView alloc] init]; + _bgView.backgroundColor = [ThemeColor appCellBackgroundColor]; + _bgView.layer.cornerRadius = 12; + _bgView.clipsToBounds = YES; + } + return _bgView; +} + +- (SDCycleScrollView *)cycleScrollView { + if (!_cycleScrollView) { + _cycleScrollView = [[SDCycleScrollView alloc] init]; + _cycleScrollView.backgroundColor = [UIColor clearColor]; + _cycleScrollView.layer.cornerRadius = 10; + _cycleScrollView.layer.masksToBounds = YES; + _cycleScrollView.delegate = self; + _cycleScrollView.showPageControl = NO; + _cycleScrollView.autoScrollTimeInterval = 5.0; + _cycleScrollView.tag = 9999; + } + return _cycleScrollView; +} + +@end diff --git a/xplan-ios/Main/Home/View/XPPartyListCollectionViewCell.h b/xplan-ios/Main/Home/View/XPPartyListCollectionViewCell.h new file mode 100644 index 00000000..743a9db9 --- /dev/null +++ b/xplan-ios/Main/Home/View/XPPartyListCollectionViewCell.h @@ -0,0 +1,19 @@ +// +// XPPartyListCollectionViewCell.h +// xplan-ios +// +// Created by XY on 2023/3/7. +// + +#import + +@class HomeRecommendRoomModel; +NS_ASSUME_NONNULL_BEGIN + +@interface XPPartyListCollectionViewCell : UICollectionViewCell + +@property (nonatomic, strong) HomeRecommendRoomModel *roomModel; + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Home/View/XPPartyListCollectionViewCell.m b/xplan-ios/Main/Home/View/XPPartyListCollectionViewCell.m new file mode 100644 index 00000000..8a4337c4 --- /dev/null +++ b/xplan-ios/Main/Home/View/XPPartyListCollectionViewCell.m @@ -0,0 +1,336 @@ +// +// XPPartyListCollectionViewCell.m +// xplan-ios +// +// Created by XY on 2023/3/7. +// + +#import "XPPartyListCollectionViewCell.h" +///Third +#import +///Tool +#import "ThemeColor.h" +#import "NetImageView.h" +#import "XPHomeGradientLabel.h" +#import "NSArray+Safe.h" +///Model +#import "HomeRecommendRoomModel.h" + +@interface XPPartyListCollectionViewCell() + +///头像 +@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; +///第四个人的头像 +@property (nonatomic,strong) NetImageView *fourthImageView; +///第五个人的头像 +@property (nonatomic,strong) NetImageView *fifImageView; +///个数的logo +@property (nonatomic,strong) UIImageView *logoImageView; +///房间的人的个数 +@property (nonatomic,strong) UILabel *numberLabel; + +@end + +@implementation XPPartyListCollectionViewCell + +- (instancetype)initWithFrame:(CGRect)frame { + self = [super initWithFrame:frame]; + if (self) { + [self initSubViews]; + [self initSubViewConstraints]; + } + return self; +} + +#pragma mark - Private Method +- (void)initSubViews { + self.backgroundColor = [UIColor clearColor]; + self.contentView.backgroundColor = [UIColor clearColor]; + [self.contentView addSubview:self.backView]; + [self.backView 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]; + [self.stackView addArrangedSubview:self.fourthImageView]; + [self.stackView addArrangedSubview:self.fifImageView]; +} + +- (void)initSubViewConstraints { + [self.backView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.mas_equalTo(self.contentView).inset(15); + make.top.mas_equalTo(0); + make.height.mas_equalTo(102); + }]; + + [self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.size.mas_equalTo(CGSizeMake(70, 70)); + make.left.mas_equalTo(12); + make.centerY.mas_equalTo(self.backView); + }]; + + [self.roomTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.avatarImageView.mas_right).offset(10); + make.top.mas_equalTo(self.avatarImageView); + make.right.mas_lessThanOrEqualTo(-70); + }]; + + [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(6); + }]; + + [self.stackView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.roomTitleLabel); + make.height.mas_equalTo(20); + make.bottom.mas_equalTo(self.avatarImageView); + }]; + + [self.firstImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.mas_equalTo(20); + }]; + + [self.secondImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.mas_equalTo(20); + }]; + + [self.thirdImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.mas_equalTo(20); + }]; + + [self.fourthImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.mas_equalTo(20); + }]; + + [self.fifImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.mas_equalTo(20); + }]; + + [self.logoImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.size.mas_equalTo(CGSizeMake(12, 12)); + make.centerY.mas_equalTo(self.stackView); + make.right.mas_equalTo(self.numberLabel.mas_left).offset(-2); + }]; + + [self.numberLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerY.mas_equalTo(self.stackView); + make.right.mas_equalTo(-12); + }]; +} +#pragma mark - Getters And Setters +//- (void)setRoomInfo:(HomePlayRoomModel *)roomInfo { +// _roomInfo = roomInfo; +// if (_roomInfo) { +// self.roomTitleLabel.text = _roomInfo.title; +// if (roomInfo.mgName.length) { +// self.gamenameLabel.text = roomInfo.mgName; +// _gamenameLabel.gradientColor = @[(id)UIColorFromRGB(0x61C4FE).CGColor, (id)UIColorFromRGB(0xA979FF).CGColor]; +// } else { +// self.gamenameLabel.text = @"扩列交友"; +// _gamenameLabel.gradientColor = @[(id)UIColorFromRGB(0xFF969B).CGColor, (id)UIColorFromRGB(0x8C5FFF).CGColor]; +// } +// self.roomTagImageView.imageUrl = _roomInfo.tagPict; +// self.numberLabel.text = [NSString stringWithFormat:@"%ld", _roomInfo.onlineNum]; +// self.avatarImageView.imageUrl = _roomInfo.avatar; +// if (_roomInfo.micUsers.count > 5) { +// _roomInfo.micUsers = [_roomInfo.micUsers subarrayWithRange:NSMakeRange(0, 5)]; +// } +// +// for (int i = 0; i < self.stackView.subviews.count; i++) { +// NetImageView * imageView = [self.stackView.subviews safeObjectAtIndex1:i]; +// if (i < _roomInfo.micUsers.count) { +// HomePlayMicUserModel * userInfo = [_roomInfo.micUsers safeObjectAtIndex1:i]; +// imageView.imageUrl = userInfo.avatar; +// imageView.hidden = NO; +// } else { +// imageView.hidden = YES; +// } +// } +// self.broadCastLabel.text = roomInfo.broadMsg ? roomInfo.broadMsg : @""; +// if (roomInfo.broadMsg.length) { +// [self.roomTitleLabel mas_updateConstraints:^(MASConstraintMaker *make) { +// make.top.mas_equalTo(self.backView).mas_offset(8); +// }]; +// [self.roomTagImageView mas_updateConstraints:^(MASConstraintMaker *make) { +// make.top.mas_equalTo(self.broadCastLabel.mas_bottom).mas_offset(6); +// }]; +// } else { +// [self.roomTitleLabel mas_updateConstraints:^(MASConstraintMaker *make) { +// make.top.mas_equalTo(self.backView).mas_offset(10); +// }]; +// [self.roomTagImageView mas_updateConstraints:^(MASConstraintMaker *make) { +// make.top.mas_equalTo(self.roomTitleLabel.mas_bottom).mas_offset(8); +// }]; +// } +// self.acrossPkButton.hidden = !_roomInfo.crossPking; +// } +//} + +- (void)setRoomModel:(HomeRecommendRoomModel *)roomModel { + _roomModel = roomModel; + if (_roomModel) { + self.avatarImageView.imageUrl = _roomModel.avatar; + self.roomTitleLabel.text = _roomModel.title.length > 0 ? _roomModel.title : @""; + self.numberLabel.text = [NSString stringWithFormat:@"%ld", _roomModel.onlineNum]; + self.roomTagImageView.imageUrl = _roomModel.tagPict; + } +} + +- (UIImageView *)backView { + if (!_backView) { + _backView = [[UIImageView alloc] init]; + _backView.contentMode = UIViewContentModeScaleAspectFill; + _backView.image = [UIImage imageNamed:@"home_party_cell_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 = 10; + } + return _avatarImageView; +} + +- (UILabel *)roomTitleLabel { + if (!_roomTitleLabel) { + _roomTitleLabel = [[UILabel alloc] init]; + _roomTitleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium]; + _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 = 10; + _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 = 10; + _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 = 10; + _thirdImageView.layer.borderWidth = 1; + _thirdImageView.layer.borderColor = [UIColor whiteColor].CGColor; + } + return _thirdImageView; +} + +- (NetImageView *)fourthImageView { + if (!_fourthImageView) { + NetImageConfig * config = [[NetImageConfig alloc]init]; + config.imageType = ImageTypeUserIcon; + config.placeHolder = [UIImageConstant defaultAvatarPlaceholder]; + _fourthImageView = [[NetImageView alloc] initWithConfig:config]; + _fourthImageView.layer.masksToBounds = YES; + _fourthImageView.layer.cornerRadius = 10; + _fourthImageView.layer.borderWidth = 1; + _fourthImageView.layer.borderColor = [UIColor whiteColor].CGColor; + } + return _fourthImageView; +} + +- (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 = 10; + _fifImageView.layer.borderWidth = 1; + _fifImageView.layer.borderColor = [UIColor whiteColor].CGColor; + } + return _fifImageView; +} + +- (UIImageView *)logoImageView { + if (!_logoImageView) { + _logoImageView = [[UIImageView alloc] init]; + _logoImageView.userInteractionEnabled = YES; + _logoImageView.image = [UIImage imageNamed:@"home_party_fire"]; + } + return _logoImageView; +} + +- (UILabel *)numberLabel { + if (!_numberLabel) { + _numberLabel = [[UILabel alloc] init]; + _numberLabel.font = [UIFont systemFontOfSize:12]; + _numberLabel.textColor = [ThemeColor secondTextColor]; + } + return _numberLabel; +} + +@end diff --git a/xplan-ios/Main/Home/View/XPPartyListViewController.h b/xplan-ios/Main/Home/View/XPPartyListViewController.h new file mode 100644 index 00000000..fae25f55 --- /dev/null +++ b/xplan-ios/Main/Home/View/XPPartyListViewController.h @@ -0,0 +1,19 @@ +// +// XPPartyListViewController.h +// xplan-ios +// +// Created by XY on 2023/3/7. +// + +#import "MvpViewController.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XPPartyListViewController : MvpViewController + +///模块的 ID +@property (nonatomic,copy) NSString *tabId; + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Home/View/XPPartyListViewController.m b/xplan-ios/Main/Home/View/XPPartyListViewController.m new file mode 100644 index 00000000..312b533e --- /dev/null +++ b/xplan-ios/Main/Home/View/XPPartyListViewController.m @@ -0,0 +1,232 @@ +// +// XPPartyListViewController.m +// xplan-ios +// +// Created by XY on 2023/3/7. +// + +#import "XPPartyListViewController.h" +///Third +#import +#import +///Tool +#import "XPMacro.h" +#import "XCHUDTool.h" +#import "NSArray+Safe.h" +#import "ThemeColor.h" +///View +#import "XPPartyListCollectionViewCell.h" +///P +#import "XPHomePresenter.h" +#import "XPHomeProtocol.h" +/// VC +#import "XPRoomViewController.h" +/// Model +#import "HomeRecommendRoomModel.h" + +@interface XPPartyListViewController () + +@property (nonatomic, strong) UICollectionView *collectionView; +@property (nonatomic, copy) void(^scrollCallback)(UIScrollView *scrollView); +/// 数据源 +@property (nonatomic, strong) NSMutableArray *dataSource; + +///当前的页数 +@property (nonatomic,assign) int page; +/// 没有新的数据了 +@property (nonatomic,assign) BOOL hasNoMoreData; + +@property (nonatomic, assign) BOOL hadLoad; + +@end + +@implementation XPPartyListViewController + +- (XPHomePresenter *)createPresenter { + return [[XPHomePresenter alloc] init]; +} + +- (BOOL)isHiddenNavBar { + return YES; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + [self initSubViews]; + [self initSubViewConstraints]; + [self initHeaderAndFooterRrfresh]; +} + +- (void)viewWillAppear:(BOOL)animated { + [super viewWillAppear:animated]; + if (!self.hadLoad) { + self.hadLoad = YES; + [XCHUDTool showAnchorLoading]; + } + [self headerRefresh]; +} + +- (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.collectionView.mj_header = header; + + MJRefreshBackNormalFooter *footer = [MJRefreshBackNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(footerRefresh)]; + footer.stateLabel.textColor = [ThemeColor secondTextColor]; + footer.stateLabel.font = [UIFont systemFontOfSize:10.0]; + self.collectionView.mj_footer = footer; + +} + +#pragma mark - 刷新的fangfa +- (void)headerRefresh { + if ([self.tabId isEqualToString:@"recommend"]) { + [self.presenter getPartyRecommendRoomList]; + }else{ + self.page = 1; + [self.presenter getRecommendRoomList:self.tabId page:self.page pageSize:20 state:0]; + } +} + +- (void)footerRefresh { + if (self.hasNoMoreData) { + [self showErrorToast:@"没有更多房间了"]; + [self.collectionView.mj_footer endRefreshing]; + return; + } + if ([self.tabId isEqualToString:@"recommend"]) { + + }else{ + self.page++; + [self.presenter getRecommendRoomList:self.tabId page:self.page pageSize:20 state:1]; + } + +} + +#pragma mark - Private Method +- (void)initSubViews { + self.view.backgroundColor = [UIColor clearColor]; + [self.view addSubview:self.collectionView]; +} + +- (void)initSubViewConstraints { + [self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.mas_equalTo(self.view); + }]; +} + +#pragma mark - XPHomeProtocol +- (void)getHomeRecommendRoomListSuccess:(NSArray *)list state:(BOOL)state { + if (state == 0) { + self.hasNoMoreData = NO; + [self.dataSource removeAllObjects]; + [self.collectionView.mj_header endRefreshing]; + } else { + [self.collectionView.mj_footer endRefreshing]; + } + if (list.count > 0) { + self.hasNoMoreData = NO; + [self.dataSource addObjectsFromArray:list]; + } else { + self.hasNoMoreData = YES; + } + [self.collectionView reloadData]; + [XCHUDTool hideHUD]; +} + +- (void)getHomeRecommendRoomListFail:(NSString *)message state:(BOOL)state { + if (state == 0) { + [self.collectionView.mj_header endRefreshing]; + } else { + [self.collectionView.mj_footer endRefreshing]; + } + [XCHUDTool hideHUD]; +} + +- (void)getPartyRecommendRoomListSuccess:(NSArray *)list { + self.hasNoMoreData = YES; + [self.dataSource removeAllObjects]; + [self.dataSource addObjectsFromArray:list]; + [self.collectionView reloadData]; + [self.collectionView.mj_header endRefreshing]; + [self.collectionView.mj_footer endRefreshing]; + [XCHUDTool hideHUD]; +} + +- (void)getPartyRecommendDataFail { + [self.collectionView.mj_footer endRefreshing]; + [XCHUDTool hideHUD]; +} + +#pragma mark - UICollectionViewDelegate + +- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { + return self.dataSource.count; +} + +- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { + XPPartyListCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPPartyListCollectionViewCell class]) forIndexPath:indexPath]; + HomeRecommendRoomModel *model = [self.dataSource safeObjectAtIndex1:indexPath.row]; + cell.roomModel = model; + return cell; +} + +- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { + if (self.dataSource.count > 0) { + HomeRecommendRoomModel * model = [self.dataSource safeObjectAtIndex1:indexPath.item]; + NSString *roomUid = model.roomUid; + if (roomUid.length > 0) { + [XPRoomViewController openRoom:roomUid viewController:self]; + } + } + +} + +#pragma mark - JXCategoryListContentViewDelegate +- (UIView *)listView { + return self.view; +} + +- (UIScrollView *)listScrollView { + return self.collectionView; +} + +- (void)listViewDidScrollCallback:(void (^)(UIScrollView *))callback { + self.scrollCallback = callback; +} + +- (void)scrollViewDidScroll:(UIScrollView *)scrollView { + self.scrollCallback(scrollView); +} + +#pragma mark - Getters And Setters + +- (UICollectionView *)collectionView { + if (!_collectionView) { + UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; + layout.scrollDirection = UICollectionViewScrollDirectionVertical; + layout.itemSize = CGSizeMake(KScreenWidth, 102); + layout.minimumLineSpacing = 12; + layout.minimumInteritemSpacing = 12; + + _collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout]; + _collectionView.backgroundColor = UIColor.clearColor; + _collectionView.delegate = self; + _collectionView.dataSource = self; + [_collectionView registerClass:[XPPartyListCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([XPPartyListCollectionViewCell class])]; + } + return _collectionView; +} + +- (NSMutableArray *)dataSource { + if (!_dataSource) { + _dataSource = [NSMutableArray array]; + } + return _dataSource; +} + + +@end diff --git a/xplan-ios/Main/Home/View/XPPartyViewController.m b/xplan-ios/Main/Home/View/XPPartyViewController.m index 9a72f9c2..fb8a7990 100644 --- a/xplan-ios/Main/Home/View/XPPartyViewController.m +++ b/xplan-ios/Main/Home/View/XPPartyViewController.m @@ -10,28 +10,45 @@ #import #import #import +#import ///Tool #import "ThemeColor.h" #import "XPMacro.h" +#import "XPWeakTimer.h" +#import "NSArray+Safe.h" /// View -#import "XPMomentTopicHeaderView.h" +#import "XPPartyHeaderView.h" /// VC -#import "XPHomePartyViewController.h" +#import "XPPartyListViewController.h" +///P +#import "XPHomeContainerPresenter.h" +#import "XPHomeContainerProtocol.h" +///Model +#import "HomeTagModel.h" -@interface XPPartyViewController () +@interface XPPartyViewController () +{ + NSTimer * timer; +} ///分页控制器 @property (nonatomic, strong) JXCategoryTitleView *titleView; @property (nonatomic, strong) JXPagerView *pagingView; @property (nonatomic, strong) NSArray *titles; ///分页控制器头部 -@property (nonatomic,strong) XPMomentTopicHeaderView *headerView; +@property (nonatomic, strong) XPPartyHeaderView *headerView; +///tag的列表 +@property (nonatomic,copy) NSArray *tagList; @end @implementation XPPartyViewController +- (XPHomeContainerPresenter *)createPresenter { + return [[XPHomeContainerPresenter alloc] init]; +} + - (BOOL)isHiddenNavBar { return YES; } @@ -39,6 +56,49 @@ - (void)viewDidLoad { [super viewDidLoad]; [self initSubViews]; + [self addTimer]; + [self initHeaderAndFooterRrfresh]; + + /// 测试数据 + HomeBannerInfoModel *model = [[HomeBannerInfoModel alloc] init]; + model.bannerPic = @"http://img.uat.lecheng163.com/Fk4qijdmBCqkcIsNtCpVuML2Dahq?imageslim"; + self.headerView.bannerList = @[model]; + +} + +- (void)viewWillAppear:(BOOL)animated { + [super viewWillAppear:animated]; + if (timer) { + [timer setFireDate:[NSDate distantPast]]; //很远的过去 + } +} + +- (void)viewWillDisappear:(BOOL)animated { + [super viewWillDisappear:animated]; + if (timer) { + //关闭定时器 + [timer setFireDate:[NSDate distantFuture]]; //很远的将来 + } +} + +- (void)addTimer { + timer = [XPWeakTimer scheduledTimerWithTimeInterval:15 block:^(id userInfo) { + [self headerRefresh]; + } userInfo:nil repeats:YES]; +} + +#pragma mark - InitHttp +- (void)headerRefresh { + [self.presenter getHomeTagList]; +} + +- (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; } #pragma mark - Private Method @@ -55,9 +115,38 @@ self.pagingView.frame = frame; } +#pragma mark - XPHomeContainerProtocol +- (void)getHomeTagListSuccess:(NSArray *)array { + [self.pagingView.mainTableView.mj_header endRefreshing]; + NSMutableArray *tempArr = [array mutableCopy]; + if (tempArr.count > 0 && [tempArr.firstObject.name isEqualToString:@"喜欢"]) { + HomeTagModel *recommend = [[HomeTagModel alloc] init]; + recommend.name = @"推荐"; + recommend.tid = @"recommend"; + [tempArr replaceObjectAtIndex:0 withObject:recommend]; + } + self.tagList = tempArr; + NSMutableArray * titles = [NSMutableArray array]; + [self.tagList enumerateObjectsUsingBlock:^(HomeTagModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { + if (obj.name.length > 0) { + [titles addObject:obj.name]; + } + }]; + self.titles = titles.copy; + self.titleView.titles = self.titles; + [self.titleView reloadData]; +} + +#pragma mark - XPPartyHeaderViewDelegate +/// 点击banner +- (void)partyHeaderViewClickBanner:(HomeBannerInfoModel *)banner { + +} + + #pragma mark - JXCategoryViewDelegate - (NSUInteger)tableHeaderViewHeightInPagerView:(JXPagerView *)pagerView { - return 100; + return [XPPartyHeaderView getPartyHeaderViewHeight]; } - (UIView *)tableHeaderViewInPagerView:(JXPagerView *)pagerView { @@ -77,11 +166,10 @@ } - (id)pagerView:(JXPagerView *)pagerView initListAtIndex:(NSInteger)index { - - XPHomePartyViewController *viewController = [[XPHomePartyViewController alloc] init]; - viewController.tabId = @"1"; - viewController.isAnchor = YES; - return (id )viewController; + XPPartyListViewController *listVC = [[XPPartyListViewController alloc] init]; + HomeTagModel *tag = [self.tagList safeObjectAtIndex1:index]; + listVC.tabId = tag.tid; + return (id )listVC; } - (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index { @@ -128,16 +216,10 @@ return _pagingView; } -- (NSArray *)titles { - if (!_titles) { - _titles = @[@"推荐", @"男神", @"女神"]; - } - return _titles; -} - -- (XPMomentTopicHeaderView *)headerView { +- (XPPartyHeaderView *)headerView { if (!_headerView) { - _headerView = [[XPMomentTopicHeaderView alloc] init]; + _headerView = [[XPPartyHeaderView alloc] init]; + _headerView.delegate = self; } return _headerView; }