diff --git a/Podfile.lock b/Podfile.lock index 5a57179a..e83cf6ef 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -175,7 +175,7 @@ SPEC REPOS: - YYWebImage SPEC CHECKSUMS: - AFNetworking: 7864c38297c79aaca1500c33288e429c3451fdce + AFNetworking: 3bd23d814e976cd148d7d44c3ab78017b744cd58 AgoraRtcEngine_iOS: 8ccceaaecff2e80ab28fcd33f3dfd2b417eb5365 Base64: cecfb41a004124895a7bcee567a89bae5a89d49b Bugly: b8715e6ec4004b7f7fbffab0643ba80545aee3da diff --git a/xplan-ios.xcodeproj/project.pbxproj b/xplan-ios.xcodeproj/project.pbxproj index 22d55110..817a267b 100644 --- a/xplan-ios.xcodeproj/project.pbxproj +++ b/xplan-ios.xcodeproj/project.pbxproj @@ -7,6 +7,10 @@ objects = { /* Begin PBXBuildFile section */ + 146567D929B1D62E00A1F5B9 /* XPNewHomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 146567D829B1D62E00A1F5B9 /* XPNewHomeViewController.m */; }; + 146567DC29B1D6A900A1F5B9 /* XPNewHomeNavView.m in Sources */ = {isa = PBXBuildFile; fileRef = 146567DB29B1D6A900A1F5B9 /* XPNewHomeNavView.m */; }; + 146567E229B1E1CF00A1F5B9 /* XPNewHomeHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 146567E129B1E1CF00A1F5B9 /* XPNewHomeHeaderView.m */; }; + 146567E529B1F55200A1F5B9 /* XPFindNewFriendTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 146567E429B1F55200A1F5B9 /* XPFindNewFriendTableViewCell.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 */; }; @@ -1267,6 +1271,14 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 146567D729B1D62E00A1F5B9 /* XPNewHomeViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPNewHomeViewController.h; sourceTree = ""; }; + 146567D829B1D62E00A1F5B9 /* XPNewHomeViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPNewHomeViewController.m; sourceTree = ""; }; + 146567DA29B1D6A900A1F5B9 /* XPNewHomeNavView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPNewHomeNavView.h; sourceTree = ""; }; + 146567DB29B1D6A900A1F5B9 /* XPNewHomeNavView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPNewHomeNavView.m; sourceTree = ""; }; + 146567E029B1E1CF00A1F5B9 /* XPNewHomeHeaderView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPNewHomeHeaderView.h; sourceTree = ""; }; + 146567E129B1E1CF00A1F5B9 /* XPNewHomeHeaderView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPNewHomeHeaderView.m; sourceTree = ""; }; + 146567E329B1F55200A1F5B9 /* XPFindNewFriendTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPFindNewFriendTableViewCell.h; sourceTree = ""; }; + 146567E429B1F55200A1F5B9 /* XPFindNewFriendTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPFindNewFriendTableViewCell.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 = ""; }; @@ -8340,6 +8352,14 @@ E87A27022758BC81002DDC7A /* XPRoomSearchContainerViewController.m */, 9B88E20D28C6305400D26FBA /* XPRoomSearchRecordViewController.h */, 9B88E20E28C6305400D26FBA /* XPRoomSearchRecordViewController.m */, + 146567D729B1D62E00A1F5B9 /* XPNewHomeViewController.h */, + 146567D829B1D62E00A1F5B9 /* XPNewHomeViewController.m */, + 146567DA29B1D6A900A1F5B9 /* XPNewHomeNavView.h */, + 146567DB29B1D6A900A1F5B9 /* XPNewHomeNavView.m */, + 146567E029B1E1CF00A1F5B9 /* XPNewHomeHeaderView.h */, + 146567E129B1E1CF00A1F5B9 /* XPNewHomeHeaderView.m */, + 146567E329B1F55200A1F5B9 /* XPFindNewFriendTableViewCell.h */, + 146567E429B1F55200A1F5B9 /* XPFindNewFriendTableViewCell.m */, ); path = View; sourceTree = ""; @@ -9450,6 +9470,7 @@ 9BD9A18027A0EFC7004186FE /* XPMineVisitorTableViewCell.m in Sources */, E8A1F7A529068F500099C952 /* XPNobleMyInfoView.m in Sources */, 9BD2ECD2288F833B00F5CD9A /* XPMineFootPrintModel.m in Sources */, + 146567D929B1D62E00A1F5B9 /* XPNewHomeViewController.m in Sources */, E824546626F5FF6000BE8163 /* XPMineResetPayPasswordProtocol.h in Sources */, E800807227FD6C3D0055A8AB /* XPClanPresenter.m in Sources */, E89DA66427005932008483C1 /* XPIAPHelper.m in Sources */, @@ -9522,7 +9543,9 @@ 9B92A36327980DCC00AD168F /* Api+SkillCard.m in Sources */, E81A65342834E58A00F55894 /* XPMonentsLatestPresenter.m in Sources */, E88B5CB526FB20B800DA9178 /* XPMineTeenagerPwdView.m in Sources */, + 146567E229B1E1CF00A1F5B9 /* XPNewHomeHeaderView.m in Sources */, E8E859C128264C2300EE4857 /* MyHTTPConnection.m in Sources */, + 146567E529B1F55200A1F5B9 /* XPFindNewFriendTableViewCell.m in Sources */, 9BDA3E7A27FD43EF00517FE6 /* XPAnchorFansTeamEntranceView.m in Sources */, E81C279826EB3AC40031E639 /* LoginForgetPasswordProtocol.h in Sources */, 9BAC92F228E6A05600147DD8 /* XPRoomActivityPlayModel.m in Sources */, @@ -9860,6 +9883,7 @@ E8E20BDB281645300033B688 /* SessionInfoViewController.m in Sources */, E8AB631C28ADE30E0023B0D2 /* XPMonentsTopicLatestPresenter.m in Sources */, E8E859CA28264C2300EE4857 /* WebSocket.m in Sources */, + 146567DC29B1D6A900A1F5B9 /* XPNewHomeNavView.m in Sources */, E80A63DC28B86B9700690914 /* MessageContentMonentsAutoView.m in Sources */, E8098CB4282E97550090B9F0 /* XPMineBlackListPresenter.m in Sources */, E8E859CC28264C2300EE4857 /* MultipartFormDataParser.m in Sources */, diff --git a/xplan-ios/Assets.xcassets/Home/home_head_game.imageset/Contents.json b/xplan-ios/Assets.xcassets/Home/home_head_game.imageset/Contents.json new file mode 100644 index 00000000..af18f963 --- /dev/null +++ b/xplan-ios/Assets.xcassets/Home/home_head_game.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "home_head_game@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "home_head_game@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Home/home_head_game.imageset/home_head_game@2x.png b/xplan-ios/Assets.xcassets/Home/home_head_game.imageset/home_head_game@2x.png new file mode 100644 index 00000000..d51aac1b Binary files /dev/null and b/xplan-ios/Assets.xcassets/Home/home_head_game.imageset/home_head_game@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Home/home_head_game.imageset/home_head_game@3x.png b/xplan-ios/Assets.xcassets/Home/home_head_game.imageset/home_head_game@3x.png new file mode 100644 index 00000000..015ab9f2 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Home/home_head_game.imageset/home_head_game@3x.png differ diff --git a/xplan-ios/Assets.xcassets/Home/home_head_match.imageset/Contents.json b/xplan-ios/Assets.xcassets/Home/home_head_match.imageset/Contents.json new file mode 100644 index 00000000..d2510b25 --- /dev/null +++ b/xplan-ios/Assets.xcassets/Home/home_head_match.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "home_head_match@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "home_head_match@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Home/home_head_match.imageset/home_head_match@2x.png b/xplan-ios/Assets.xcassets/Home/home_head_match.imageset/home_head_match@2x.png new file mode 100644 index 00000000..bc06f7e6 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Home/home_head_match.imageset/home_head_match@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Home/home_head_match.imageset/home_head_match@3x.png b/xplan-ios/Assets.xcassets/Home/home_head_match.imageset/home_head_match@3x.png new file mode 100644 index 00000000..259389e8 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Home/home_head_match.imageset/home_head_match@3x.png differ diff --git a/xplan-ios/Assets.xcassets/Home/home_head_party.imageset/Contents.json b/xplan-ios/Assets.xcassets/Home/home_head_party.imageset/Contents.json new file mode 100644 index 00000000..0f59758f --- /dev/null +++ b/xplan-ios/Assets.xcassets/Home/home_head_party.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "home_head_party@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "home_head_party@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Home/home_head_party.imageset/home_head_party@2x.png b/xplan-ios/Assets.xcassets/Home/home_head_party.imageset/home_head_party@2x.png new file mode 100644 index 00000000..ee888a8d Binary files /dev/null and b/xplan-ios/Assets.xcassets/Home/home_head_party.imageset/home_head_party@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Home/home_head_party.imageset/home_head_party@3x.png b/xplan-ios/Assets.xcassets/Home/home_head_party.imageset/home_head_party@3x.png new file mode 100644 index 00000000..36e622fa Binary files /dev/null and b/xplan-ios/Assets.xcassets/Home/home_head_party.imageset/home_head_party@3x.png differ diff --git a/xplan-ios/Assets.xcassets/Home/home_head_radio.imageset/Contents.json b/xplan-ios/Assets.xcassets/Home/home_head_radio.imageset/Contents.json new file mode 100644 index 00000000..2527b4fb --- /dev/null +++ b/xplan-ios/Assets.xcassets/Home/home_head_radio.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "home_head_radio@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "home_head_radio@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Home/home_head_radio.imageset/home_head_radio@2x.png b/xplan-ios/Assets.xcassets/Home/home_head_radio.imageset/home_head_radio@2x.png new file mode 100644 index 00000000..8f77e9ca Binary files /dev/null and b/xplan-ios/Assets.xcassets/Home/home_head_radio.imageset/home_head_radio@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Home/home_head_radio.imageset/home_head_radio@3x.png b/xplan-ios/Assets.xcassets/Home/home_head_radio.imageset/home_head_radio@3x.png new file mode 100644 index 00000000..4530c794 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Home/home_head_radio.imageset/home_head_radio@3x.png differ diff --git a/xplan-ios/Assets.xcassets/Home/home_hot_bg.imageset/Contents.json b/xplan-ios/Assets.xcassets/Home/home_hot_bg.imageset/Contents.json new file mode 100644 index 00000000..e7a83aec --- /dev/null +++ b/xplan-ios/Assets.xcassets/Home/home_hot_bg.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "home_hot_bg@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "home_hot_bg@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Home/home_hot_bg.imageset/home_hot_bg@2x.png b/xplan-ios/Assets.xcassets/Home/home_hot_bg.imageset/home_hot_bg@2x.png new file mode 100644 index 00000000..73cc8ec1 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Home/home_hot_bg.imageset/home_hot_bg@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Home/home_hot_bg.imageset/home_hot_bg@3x.png b/xplan-ios/Assets.xcassets/Home/home_hot_bg.imageset/home_hot_bg@3x.png new file mode 100644 index 00000000..f8d3b06a Binary files /dev/null and b/xplan-ios/Assets.xcassets/Home/home_hot_bg.imageset/home_hot_bg@3x.png differ diff --git a/xplan-ios/Assets.xcassets/Home/navigation/home_nav_rank.imageset/home_nav_rank@2x.png b/xplan-ios/Assets.xcassets/Home/navigation/home_nav_rank.imageset/home_nav_rank@2x.png index 8361610d..3f1ce33a 100644 Binary files a/xplan-ios/Assets.xcassets/Home/navigation/home_nav_rank.imageset/home_nav_rank@2x.png and b/xplan-ios/Assets.xcassets/Home/navigation/home_nav_rank.imageset/home_nav_rank@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Home/navigation/home_nav_rank.imageset/home_nav_rank@3x.png b/xplan-ios/Assets.xcassets/Home/navigation/home_nav_rank.imageset/home_nav_rank@3x.png index f9c7168a..6cacac19 100644 Binary files a/xplan-ios/Assets.xcassets/Home/navigation/home_nav_rank.imageset/home_nav_rank@3x.png and b/xplan-ios/Assets.xcassets/Home/navigation/home_nav_rank.imageset/home_nav_rank@3x.png differ diff --git a/xplan-ios/Assets.xcassets/Home/navigation/home_nav_search.imageset/home_nav_search@2x.png b/xplan-ios/Assets.xcassets/Home/navigation/home_nav_search.imageset/home_nav_search@2x.png index cd466fa0..5e2de62e 100644 Binary files a/xplan-ios/Assets.xcassets/Home/navigation/home_nav_search.imageset/home_nav_search@2x.png and b/xplan-ios/Assets.xcassets/Home/navigation/home_nav_search.imageset/home_nav_search@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Home/navigation/home_nav_search.imageset/home_nav_search@3x.png b/xplan-ios/Assets.xcassets/Home/navigation/home_nav_search.imageset/home_nav_search@3x.png index 63112bfa..aa477dd6 100644 Binary files a/xplan-ios/Assets.xcassets/Home/navigation/home_nav_search.imageset/home_nav_search@3x.png and b/xplan-ios/Assets.xcassets/Home/navigation/home_nav_search.imageset/home_nav_search@3x.png differ diff --git a/xplan-ios/Base/UI/ThemeColor.m b/xplan-ios/Base/UI/ThemeColor.m index a820e178..f00a6021 100644 --- a/xplan-ios/Base/UI/ThemeColor.m +++ b/xplan-ios/Base/UI/ThemeColor.m @@ -31,7 +31,7 @@ /* ------页面相关颜色 START------ */ /// view的背景色 0xF3F5FA + (UIColor *)appBackgroundColor { - return UIColorFromRGB(0xF3F5FA); + return UIColorFromRGB(0xF8F8FB); } /// cell的背景色 0xFFFFFF + (UIColor *)appCellBackgroundColor { @@ -39,15 +39,15 @@ } ///正文颜色 0x333333 + (UIColor *)mainTextColor { - return UIColorFromRGB(0x161958); + return UIColorFromRGB(0x282828); } /// 二级文字颜色 0x666666 + (UIColor *)secondTextColor { - return UIColorFromRGB(0x8A8CAB); + return UIColorFromRGB(0x878B9C); } ///三级文字的颜色 0x999999 + (UIColor *)textThirdColor { - return UIColorFromRGB(0xBABBCD); + return UIColorFromRGB(0xBDBFD0); } ///分割线的颜色 0xE8E8E8 + (UIColor *)dividerColor { diff --git a/xplan-ios/Main/Home/View/XPFindNewFriendTableViewCell.h b/xplan-ios/Main/Home/View/XPFindNewFriendTableViewCell.h new file mode 100644 index 00000000..5c6d79f9 --- /dev/null +++ b/xplan-ios/Main/Home/View/XPFindNewFriendTableViewCell.h @@ -0,0 +1,16 @@ +// +// XPFindNewFriendTableViewCell.h +// xplan-ios +// +// Created by XY on 2023/3/3. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface XPFindNewFriendTableViewCell : UITableViewCell + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Home/View/XPFindNewFriendTableViewCell.m b/xplan-ios/Main/Home/View/XPFindNewFriendTableViewCell.m new file mode 100644 index 00000000..261c0e6a --- /dev/null +++ b/xplan-ios/Main/Home/View/XPFindNewFriendTableViewCell.m @@ -0,0 +1,39 @@ +// +// XPFindNewFriendTableViewCell.m +// xplan-ios +// +// Created by XY on 2023/3/3. +// + +#import "XPFindNewFriendTableViewCell.h" +/// Third +#import +/// Tool +#import "NetImageView.h" +#import "ThemeColor.h" + +@interface XPFindNewFriendTableViewCell() +/// 头像 +@property (nonatomic, strong) NetImageView *avatarImageView; +/// 昵称 +@property (nonatomic, strong) UILabel *nickLabel; +@property (nonatomic, strong) UIStackView *stackView; + +@property (nonatomic, strong) UILabel *introduceLabel; + +@end + +@implementation XPFindNewFriendTableViewCell + +- (void)awakeFromNib { + [super awakeFromNib]; + // Initialization code +} + +- (void)setSelected:(BOOL)selected animated:(BOOL)animated { + [super setSelected:selected animated:animated]; + + // Configure the view for the selected state +} + +@end diff --git a/xplan-ios/Main/Home/View/XPNewHomeHeaderView.h b/xplan-ios/Main/Home/View/XPNewHomeHeaderView.h new file mode 100644 index 00000000..2101229a --- /dev/null +++ b/xplan-ios/Main/Home/View/XPNewHomeHeaderView.h @@ -0,0 +1,36 @@ +// +// XPNewHomeHeaderView.h +// xplan-ios +// +// Created by XY on 2023/3/3. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@protocol XPNewHomeHeaderViewDelegate + +/// 点击交友派对 +- (void)homeHeaderViewPartyAction; +/// 点击小游戏 +- (void)homeHeaderViewGameAction; +/// 点击听电台 +- (void)homeHeaderViewRadioAction; +/// 点击一键匹配 +- (void)homeHeaderViewMatchAction; +/// 点击热门 +- (void)homeHeaderViewHotAction; + +@end + +@interface XPNewHomeHeaderView : UIView + +@property (nonatomic, weak) id delegate; + +/// 获取headerView的高度 ++ (NSUInteger)getHeaderViewHeight; + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Home/View/XPNewHomeHeaderView.m b/xplan-ios/Main/Home/View/XPNewHomeHeaderView.m new file mode 100644 index 00000000..9d75543e --- /dev/null +++ b/xplan-ios/Main/Home/View/XPNewHomeHeaderView.m @@ -0,0 +1,217 @@ +// +// XPNewHomeHeaderView.m +// xplan-ios +// +// Created by XY on 2023/3/3. +// + +#import "XPNewHomeHeaderView.h" +///Third +#import +///Tool +#import "XPMacro.h" +#import "ThemeColor.h" + +@interface XPNewHomeHeaderView() + +/// 交友派对 +@property (nonatomic, strong) UIButton *partyView; +/// 小游戏 +@property (nonatomic, strong) UIButton *gameView; +/// 听电台 +@property (nonatomic, strong) UIButton *radioView; +/// 一键匹配 +@property (nonatomic, strong) UIButton *matchView; + +/// 热门 +@property (nonatomic, strong) UIImageView *hotView; +@property (nonatomic, strong) UILabel *hotTextLabel; +@property (nonatomic, strong) UIView *messageView; + +@end + +@implementation XPNewHomeHeaderView + +- (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 addSubview:self.partyView]; + [self addSubview:self.gameView]; + [self addSubview:self.radioView]; + [self addSubview:self.matchView]; + [self addSubview:self.hotView]; + [self.hotView addSubview:self.hotTextLabel]; + [self.hotView addSubview:self.messageView]; +} + +- (void)initSubViewConstraints { + CGFloat partyWidth = 94.0*kScreenScale; + CGFloat partyHeight = 120.0/94.0*partyWidth; + [self.partyView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(15); + make.top.mas_equalTo(15); + make.width.mas_equalTo(partyWidth); + make.height.mas_equalTo(partyHeight); + }]; + + CGFloat gameWidth = (KScreenWidth - 15 -partyWidth - 8 - 3 -15)/2.0; + CGFloat gameHeight = 56.0/120.0*gameWidth; + [self.gameView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.partyView.mas_right).offset(15); + make.top.mas_equalTo(self.partyView); + make.width.mas_equalTo(gameWidth); + make.height.mas_equalTo(gameHeight); + }]; + + [self.radioView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.gameView.mas_right).offset(3); + make.top.mas_equalTo(self.partyView); + make.width.mas_equalTo(gameWidth); + make.height.mas_equalTo(gameHeight); + }]; + + CGFloat matchWidth = KScreenWidth - 15 - partyWidth - 8 - 15; + CGFloat matchHeight = 56.0/243.0*matchWidth; + [self.matchView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.gameView); + make.bottom.mas_equalTo(self.partyView); + make.width.mas_equalTo(matchWidth); + make.height.mas_equalTo(matchHeight); + }]; + + CGFloat hotHeight = 72.0*kScreenScale; + [self.hotView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(15); + make.right.mas_equalTo(-15); + make.height.mas_equalTo(hotHeight); + make.top.mas_equalTo(self.partyView.mas_bottom).offset(20); + }]; + + [self.hotTextLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.left.mas_equalTo(0); + make.width.mas_equalTo(70); + make.height.mas_equalTo(self.hotView.mas_height).multipliedBy(0.5); + }]; + + [self.messageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.bottom.mas_equalTo(0); + make.height.mas_equalTo(self.hotView.mas_height).multipliedBy(0.5); + }]; + +} + +/// 获取headerView的高度 ++ (NSUInteger)getHeaderViewHeight { + CGFloat height = 15; + CGFloat partyWidth = 94.0*kScreenScale; + CGFloat partyHeight = 120.0/94.0*partyWidth; + height += partyHeight; + height += 20; + CGFloat hotHeight = 72.0*kScreenScale; + height += hotHeight; + height += 15; + return (NSUInteger)height; +} + +#pragma mark - Event Response + +- (void)partyViewAction { + if (self.delegate && [self.delegate respondsToSelector:@selector(homeHeaderViewPartyAction)]) { + [self.delegate homeHeaderViewPartyAction]; + } +} + +- (void)gameViewAction { + if (self.delegate && [self.delegate respondsToSelector:@selector(homeHeaderViewGameAction)]) { + [self.delegate homeHeaderViewGameAction]; + } +} + +- (void)radioViewAction { + if (self.delegate && [self.delegate respondsToSelector:@selector(homeHeaderViewRadioAction)]) { + [self.delegate homeHeaderViewRadioAction]; + } +} + +- (void)matchViewAction { + if (self.delegate && [self.delegate respondsToSelector:@selector(homeHeaderViewMatchAction)]) { + [self.delegate homeHeaderViewMatchAction]; + } +} + +#pragma mark - Getters And Setters + +- (UIButton *)partyView { + if (!_partyView) { + _partyView = [UIButton buttonWithType:UIButtonTypeCustom]; + [_partyView setBackgroundImage:[UIImage imageNamed:@"home_head_party"] forState:UIControlStateNormal]; + [_partyView addTarget:self action:@selector(partyViewAction) forControlEvents:UIControlEventTouchUpInside]; + } + return _partyView; +} + +- (UIButton *)gameView { + if (!_gameView) { + _gameView = [UIButton buttonWithType:UIButtonTypeCustom]; + [_gameView setBackgroundImage:[UIImage imageNamed:@"home_head_game"] forState:UIControlStateNormal]; + [_gameView addTarget:self action:@selector(gameViewAction) forControlEvents:UIControlEventTouchUpInside]; + } + return _gameView; +} + +- (UIButton *)radioView { + if (!_radioView) { + _radioView = [UIButton buttonWithType:UIButtonTypeCustom]; + [_radioView setBackgroundImage:[UIImage imageNamed:@"home_head_radio"] forState:UIControlStateNormal]; + [_radioView addTarget:self action:@selector(radioViewAction) forControlEvents:UIControlEventTouchUpInside]; + } + return _radioView; +} + +- (UIButton *)matchView { + if (!_matchView) { + _matchView = [UIButton buttonWithType:UIButtonTypeCustom]; + [_matchView setBackgroundImage:[UIImage imageNamed:@"home_head_match"] forState:UIControlStateNormal]; + [_matchView addTarget:self action:@selector(matchViewAction) forControlEvents:UIControlEventTouchUpInside]; + } + return _matchView; +} + +- (UIImageView *)hotView { + if (!_hotView) { + _hotView = [[UIImageView alloc] init]; + _hotView.image = [UIImage imageNamed:@"home_hot_bg"]; + _hotView.userInteractionEnabled = YES; + } + return _hotView; +} + +- (UILabel *)hotTextLabel { + if (_hotTextLabel) { + _hotTextLabel = [[UILabel alloc] init]; + _hotTextLabel.textColor = [ThemeColor mainTextColor]; + _hotTextLabel.text = @"热门"; + _hotTextLabel.textAlignment = NSTextAlignmentCenter; + _hotTextLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightBold]; + } + return _hotTextLabel; +} + +- (UIView *)messageView { + if (!_messageView) { + _messageView = [[UIView alloc] init]; + } + return _messageView; +} + +@end diff --git a/xplan-ios/Main/Home/View/XPNewHomeNavView.h b/xplan-ios/Main/Home/View/XPNewHomeNavView.h new file mode 100644 index 00000000..b2c3fc00 --- /dev/null +++ b/xplan-ios/Main/Home/View/XPNewHomeNavView.h @@ -0,0 +1,28 @@ +// +// XPNewHomeNavView.h +// xplan-ios +// +// Created by XY on 2023/3/3. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class XPNewHomeNavView; +@protocol XPNewHomeNavViewDelegate +///点击了搜索房间 +- (void)xPNewHomeNavView:(XPNewHomeNavView *)view didClickSearch:(UIButton *)sender; +///点击了榜单按钮 +- (void)xPNewHomeNavView:(XPNewHomeNavView *)view didClickRank:(UIButton *)sender; + +@end + +@interface XPNewHomeNavView : UIView + +///代理 +@property (nonatomic,weak) id delegate; + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Home/View/XPNewHomeNavView.m b/xplan-ios/Main/Home/View/XPNewHomeNavView.m new file mode 100644 index 00000000..4a9ac4ac --- /dev/null +++ b/xplan-ios/Main/Home/View/XPNewHomeNavView.m @@ -0,0 +1,105 @@ +// +// XPNewHomeNavView.m +// xplan-ios +// +// Created by XY on 2023/3/3. +// + +#import "XPNewHomeNavView.h" +///Third +#import + +///Tool +#import "ThemeColor+Home.h" +#import "XPMacro.h" +#import "UIImage+Utils.h" + +@interface XPNewHomeNavView() + +///排行榜 +@property (nonatomic,strong) UIButton *rankButton; +///搜索 +@property (nonatomic,strong) UIButton *searchButton; + +@end + +@implementation XPNewHomeNavView + +- (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 addSubview:self.rankButton]; + [self addSubview:self.searchButton]; +} + +- (void)initSubViewConstraints { + + [self.rankButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.size.mas_equalTo(CGSizeMake(30, 30)); + make.right.mas_equalTo(-15); + make.top.mas_equalTo(kStatusBarHeight+7); + }]; + + [self.searchButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerY.mas_equalTo(self.rankButton); + make.right.mas_equalTo(self.rankButton.mas_left).offset(-15); + make.height.mas_equalTo(32); + make.left.mas_equalTo(15); + }]; +} + + +#pragma mark - Event Response +- (void)searchButtonAction:(UIButton *)sender { + if (self.delegate && [self.delegate respondsToSelector:@selector(xPNewHomeNavView:didClickSearch:)]) { + [self.delegate xPNewHomeNavView:self didClickSearch:sender]; + } +} + +- (void)rankButtonAction:(UIButton *)sender { + if (self.delegate && [self.delegate respondsToSelector:@selector(xPNewHomeNavView:didClickRank:)]) { + [self.delegate xPNewHomeNavView:self didClickRank:sender]; + } +} + +#pragma mark - Getters And Setters + +- (UIButton *)rankButton { + if (!_rankButton) { + _rankButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_rankButton setImage:[UIImage imageNamed:@"home_nav_rank"] forState:UIControlStateNormal]; + [_rankButton setImage:[UIImage imageNamed:@"home_nav_rank"] forState:UIControlStateSelected]; + [_rankButton addTarget:self action:@selector(rankButtonAction:) forControlEvents:UIControlEventTouchUpInside]; + } + return _rankButton; +} + +- (UIButton *)searchButton { + if (!_searchButton) { + _searchButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_searchButton setImage:[UIImage imageNamed:@"home_nav_search"] forState:UIControlStateNormal]; + [_searchButton addTarget:self action:@selector(searchButtonAction:) forControlEvents:UIControlEventTouchUpInside]; + _searchButton.layer.masksToBounds = YES; + _searchButton.layer.cornerRadius = 16; + [_searchButton setTitle:@"搜索房间/昵称/ID" forState:UIControlStateNormal]; + _searchButton.titleLabel.font = [UIFont systemFontOfSize:12]; + [_searchButton setTitleColor:[ThemeColor colorWithHexString:@"#9EB5C5"] forState:UIControlStateNormal]; + _searchButton.backgroundColor = UIColor.whiteColor; + [_searchButton setImageEdgeInsets:UIEdgeInsetsMake(0, 8, 0, 0)]; + [_searchButton setTitleEdgeInsets:UIEdgeInsetsMake(0, 8, 0, 0)]; + _searchButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft; + } + return _searchButton; +} + +@end diff --git a/xplan-ios/Main/Home/View/XPNewHomeViewController.h b/xplan-ios/Main/Home/View/XPNewHomeViewController.h new file mode 100644 index 00000000..29c08d90 --- /dev/null +++ b/xplan-ios/Main/Home/View/XPNewHomeViewController.h @@ -0,0 +1,16 @@ +// +// XPNewHomeViewController.h +// xplan-ios +// +// Created by XY on 2023/3/3. +// + +#import "MvpViewController.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XPNewHomeViewController : MvpViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Home/View/XPNewHomeViewController.m b/xplan-ios/Main/Home/View/XPNewHomeViewController.m new file mode 100644 index 00000000..ace55d8d --- /dev/null +++ b/xplan-ios/Main/Home/View/XPNewHomeViewController.m @@ -0,0 +1,391 @@ +// +// XPNewHomeViewController.m +// xplan-ios +// +// Created by XY on 2023/3/3. +// + +#import "XPNewHomeViewController.h" +///Third +#import +#import +#import +#import +#import +///Tool +#import "ThemeColor+Home.h" +#import "XPMacro.h" +#import "XPHtmlURL.h" +#import "XPConstant.h" +#import "Api+Room.h" +#import "AccountInfoStorage.h" +#import "TTPopup.h" +#import "StatisticsServiceHelper.h" +#import "XPWeakTimer.h" +#import "ClientConfig.h" +#import "NSArray+Safe.h" +#import "UIImage+Utils.h" +///View +#import "XPNewHomeNavView.h" +#import "XPHomeRecommendViewController.h" +#import "XPRoomSearchContainerViewController.h" +#import "XPHomePartyContainerViewController.h" +#import "XPHomePartyViewController.h" +#import "XPWebViewController.h" +#import "XPHomeHotRoomViewController.h" +#import "XPRoomViewController.h" +#import "XPLittleGameRoomOpenView.h" +#import "XPHomeLivesViewController.h" +#import "XPTeenagerHomeView.h" +#import "XPNewHomeHeaderView.h" +#import "XPRoomSearchContainerViewController.h" +///P +#import "XPHomeRecommendPresenter.h" +#import "XPHomeRecommendProtocol.h" +///VC +#import "XPHomeHappyViewController.h" +#import "XPHomeHotRoomViewController.h" + +@class HomeMenuInfoModel,HomeBannerInfoModel,HomeRecommendRoomModel, HomePlayRoomModel; + +@interface XPNewHomeViewController () +{ + NSTimer * timer; +} + +@property (nonatomic, strong) UIImageView *topGradientImageView; +///导航栏 +@property (nonatomic, strong) XPNewHomeNavView *homeNavView; +///分页控制器 +@property (nonatomic, strong) JXCategoryTitleView *titleView; +@property (nonatomic, strong) JXCategoryIndicatorLineView *lineView; +@property (nonatomic, strong) JXPagerView *pagingView; +@property (nonatomic, strong) NSArray *titles; +///分页控制器头部 +@property (nonatomic,strong) XPNewHomeHeaderView *headerView; +///菜单列表 +@property (nonatomic,strong) NSArray *menuList; +///轮播图 +@property (nonatomic,strong) NSArray *bannerList; +///推荐房 +@property (nonatomic,strong) NSArray *recommendList; +///热门房 +@property (nonatomic,strong) NSArray *hotRoomList; +///组队开黑 +@property (nonatomic,strong) NSArray *playTeamList; +///个人房列表数据 +@property (nonatomic,strong) NSArray *personalRoomList; +///个人房 +@property (nonatomic,strong) XPHomeHappyViewController *personalRoomVC; +///热门房 +@property (nonatomic,strong) XPHomeHotRoomViewController *hotRoomVC; + +@end + +@implementation XPNewHomeViewController + +- (XPHomeRecommendPresenter *)createPresenter { + return [[XPHomeRecommendPresenter alloc] init]; +} +- (BOOL)isHiddenNavBar { + return YES; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + [self initHeaderAndFooterRrfresh]; + [self initSubViews]; + [self addTimer]; +} + +- (void)viewDidLayoutSubviews { + [super viewDidLayoutSubviews]; + CGRect frame = self.view.bounds; + frame.origin.y = kNavigationHeight; + frame.size.height = frame.size.height - frame.origin.y; + self.pagingView.frame = frame; +} + +- (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]]; //很远的将来 + } +} + +#pragma mark - InitHttp +- (void)addTimer { + timer = [XPWeakTimer scheduledTimerWithTimeInterval:15 block:^(id userInfo) { + [self headerRefresh]; + } userInfo:nil repeats:YES]; +} + +- (void)headerRefresh { + [self.presenter getHomeTopBannerList]; + [self.presenter getHomeRecommendRoomList]; + [self.presenter getHomeHotRoomList]; + [self.presenter getPlayGameWithTeam:1]; + [self.presenter getHomePersonalRoomList]; +} + +- (void)initHeaderAndFooterRrfresh { + MJRefreshNormalHeader *header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(headerRefresh)]; + header.stateLabel.font = [UIFont systemFontOfSize:10.0]; + header.lastUpdatedTimeLabel.font = [UIFont systemFontOfSize:10.0]; + header.stateLabel.textColor = [ThemeColor secondTextColor]; + header.lastUpdatedTimeLabel.textColor = [ThemeColor secondTextColor]; + self.pagingView.mainTableView.mj_header = header; + [self headerRefresh]; +} + +#pragma mark - Private Method +- (void)initSubViews { + [self.view addSubview:self.topGradientImageView]; + [self.view addSubview:self.homeNavView]; + [self.view addSubview:self.pagingView]; + ///首页tab 根据服务端的配置 + [RACObserve([ClientConfig shareConfig], configInfo) subscribeNext:^(id _Nullable x) { + ClientDataModel * model = x; + if (model.homeTabList.count > 0) { + if ([model.homeTabList containsObject:@"组队开黑"]) { + NSMutableArray * temArray = [NSMutableArray arrayWithArray:model.homeTabList]; + NSInteger index = [temArray indexOfObject:@"组队开黑"]; + [temArray replaceObjectAtIndex:index withObject:@"开黑畅聊"]; + model.homeTabList = temArray.copy; + } + self.titles = model.homeTabList; + self.titleView.titles = self.titles; + [self.titleView reloadData]; + } + }]; + + [self.topGradientImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.top.right.mas_equalTo(0); + make.top.mas_equalTo(125); + }]; + [self.homeNavView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.top.right.mas_equalTo(0); + make.height.mas_equalTo(kNavigationHeight); + }]; +} + +#pragma mark - XPHomeRecommendProtocol +- (void)getHomeTopBannerListSuccess:(NSArray *)list menuList:(NSArray *)list1{ + [self.pagingView.mainTableView.mj_header endRefreshing]; + self.bannerList = list; + self.menuList = list1; + [self.pagingView resizeTableHeaderViewHeightWithAnimatable:NO duration:0 curve:0]; +} + +- (void)getHomeRecommendRoomListSuccess:(NSArray *)list { + [self.pagingView.mainTableView.mj_header endRefreshing]; + self.recommendList= list; + [self.pagingView resizeTableHeaderViewHeightWithAnimatable:NO duration:0 curve:0]; +} + +- (void)getHomeHotRoomListSuccess:(NSArray *)list { + [self.pagingView.mainTableView.mj_header endRefreshing]; + self.hotRoomList = list; + [self.pagingView resizeTableHeaderViewHeightWithAnimatable:NO duration:0 curve:0]; +} + +- (void)getHomePersonalRoomListSuccess:(NSArray *)list { + [self.pagingView.mainTableView.mj_header endRefreshing]; + self.personalRoomList = list; + self.hotRoomVC.roomList = list; +} + +- (void)getPlayGameWithTeamSuccess:(NSArray *)list{ + [self.pagingView.mainTableView.mj_header endRefreshing]; + self.playTeamList = list; + [self.personalRoomVC configPlayGameRoomList:list]; +} + +- (void)getHomeRecommendDataFail { + [self.pagingView.mainTableView.mj_header endRefreshing]; + [self.pagingView.mainTableView.mj_footer endRefreshing]; +} + +#pragma mark - XPNewHomeNavViewDelegate + +- (void)xPNewHomeNavView:(XPNewHomeNavView *)view didClickSearch:(UIButton *)sender { + XPRoomSearchContainerViewController * searchVC = [[XPRoomSearchContainerViewController alloc] init]; + searchVC.modalPresentationStyle = UIModalPresentationFullScreen; + [self.navigationController presentViewController:searchVC animated:YES completion:nil]; +} + +- (void)xPNewHomeNavView:(XPNewHomeNavView *)view didClickRank:(UIButton *)sender { + XPWebViewController * webVC =[[XPWebViewController alloc] init]; + webVC.url = URLWithType(kHomeRankURL); + [self.navigationController pushViewController:webVC animated:YES]; +} + +#pragma mark - XPNewHomeHeaderViewDelegate + +/// 点击交友派对 +- (void)homeHeaderViewPartyAction { + +} +/// 点击小游戏 +- (void)homeHeaderViewGameAction { + +} +/// 点击听电台 +- (void)homeHeaderViewRadioAction { + +} +/// 点击一键匹配 +- (void)homeHeaderViewMatchAction { + +} +/// 点击热门 +- (void)homeHeaderViewHotAction { + +} + +#pragma mark - JXCategoryViewDelegate +- (NSUInteger)tableHeaderViewHeightInPagerView:(JXPagerView *)pagerView { + return [XPNewHomeHeaderView getHeaderViewHeight]; +} + +- (UIView *)tableHeaderViewInPagerView:(JXPagerView *)pagerView { + return self.headerView; +} + +- (NSUInteger)heightForPinSectionHeaderInPagerView:(JXPagerView *)pagerView { + return 50; +} + +- (UIView *)viewForPinSectionHeaderInPagerView:(JXPagerView *)pagerView { + return self.titleView; +} + +- (NSInteger)numberOfListsInPagerView:(JXPagerView *)pagerView { + return self.titles.count; +} + +- (id)pagerView:(JXPagerView *)pagerView initListAtIndex:(NSInteger)index { + UIViewController *viewController; + NSString * title= [self.titles safeObjectAtIndex1:index]; + if ([title isEqualToString:@"开黑畅聊"]) { + viewController = self.personalRoomVC; + } else { + viewController = self.hotRoomVC; + } + return (id )viewController; +} + +- (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index { + NSString * title= [self.titles safeObjectAtIndex1:index]; + if ([title isEqualToString:@"开黑畅聊"]) { + [self.presenter getPlayGameWithTeam:1]; + } else { + [self.presenter getHomePersonalRoomList]; + } +} + +#pragma mark - JXPagerMainTableViewGestureDelegate + +- (BOOL)mainTableViewGestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer { + ///1000是外部的scrollView 1001是人气主播中的collectionView 9999是 开黑畅聊的轮播图 + if (otherGestureRecognizer.view.tag == 1000 || otherGestureRecognizer.view == self.headerView || otherGestureRecognizer.view.tag == 1001 || otherGestureRecognizer.view.tag == 9999) { + return NO; + } + return [gestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]] && [otherGestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]]; +} +#pragma mark - Getters And Setters + +- (UIImageView *)topGradientImageView { + if (!_topGradientImageView) { + _topGradientImageView = [[UIImageView alloc] init]; + _topGradientImageView.image = [UIImage gradientColorImageFromColors:@[[ThemeColor colorWithHexString:@"#DCF6FF"], [ThemeColor colorWithHexString:@"#F8F8FA"]] gradientType:GradientTypeTopToBottom imgSize:CGSizeMake(KScreenWidth, 125)]; + _topGradientImageView.contentMode = UIViewContentModeScaleToFill; + } + return _topGradientImageView; +} + +- (XPNewHomeNavView *)homeNavView { + if (!_homeNavView) { + _homeNavView = [[XPNewHomeNavView alloc] init]; + _homeNavView.delegate = self; + } + return _homeNavView; +} + +- (JXCategoryTitleView *)titleView { + if (!_titleView) { + _titleView = [[JXCategoryTitleView alloc] init]; + _titleView.delegate = self; + _titleView.backgroundColor = [UIColor clearColor]; + _titleView.titleColor = [ThemeColor textThirdColor]; + _titleView.titleSelectedColor = [ThemeColor mainTextColor]; + _titleView.titleFont = [UIFont fontWithName:@"PingFang-SC-Medium" size:12]; + _titleView.titleSelectedFont = [UIFont fontWithName:@"PingFang-SC-Medium" size:16]; + _titleView.titleLabelAnchorPointStyle = JXCategoryTitleLabelAnchorPointStyleCenter; + _titleView.contentScrollViewClickTransitionAnimationEnabled = NO; + _titleView.defaultSelectedIndex = 0; + _titleView.averageCellSpacingEnabled = NO; + _titleView.titles = self.titles; + _titleView.cellSpacing = 20; + _titleView.titles = self.titles; + _titleView.listContainer = (id)self.pagingView.listContainerView; + + JXCategoryIndicatorImageView *lineView = [[JXCategoryIndicatorImageView alloc] init]; + lineView.indicatorImageViewSize = CGSizeMake(41, 10); + lineView.verticalMargin = 14; + lineView.indicatorImageView.image = [UIImage imageNamed:@"home_recommend_indicator_room"]; + _titleView.indicators = @[lineView]; + } + return _titleView; +} + +- (JXPagerView *)pagingView { + if (!_pagingView) { + _pagingView = [[JXPagerView alloc] initWithDelegate:self]; + _pagingView.backgroundColor = [UIColor clearColor]; + _pagingView.listContainerView.backgroundColor = [UIColor clearColor]; + _pagingView.mainTableView.backgroundColor = [UIColor clearColor]; + _pagingView.mainTableView.gestureDelegate = self; + _pagingView.listContainerView.listCellBackgroundColor = UIColor.clearColor; + } + return _pagingView; +} + +- (NSArray *)titles { + if (!_titles) { + _titles = @[@"热门房间", @"开黑畅聊"]; + } + return _titles; +} + +- (XPNewHomeHeaderView *)headerView { + if (!_headerView) { + _headerView = [[XPNewHomeHeaderView alloc] init]; + _headerView.backgroundColor = [UIColor clearColor]; + _headerView.delegate = self; + } + return _headerView; +} + +- (XPHomeHotRoomViewController *)hotRoomVC { + if (!_hotRoomVC) { + _hotRoomVC = [[XPHomeHotRoomViewController alloc] init]; + } + return _hotRoomVC; +} + +- (XPHomeHappyViewController *)personalRoomVC { + if (!_personalRoomVC) { + _personalRoomVC = [[XPHomeHappyViewController alloc] init]; + } + return _personalRoomVC; +} +@end diff --git a/xplan-ios/Main/Tabbar/View/TabbarViewController.m b/xplan-ios/Main/Tabbar/View/TabbarViewController.m index 8fb87760..ca66903f 100644 --- a/xplan-ios/Main/Tabbar/View/TabbarViewController.m +++ b/xplan-ios/Main/Tabbar/View/TabbarViewController.m @@ -75,6 +75,7 @@ #import "XPReceiveRedPacketView.h" #import "XPRoomYearActivityView.h" #import "XPUpgradeView.h" +#import "XPNewHomeViewController.h" ///Present #import "MainPresenter.h" #import "MainProtocol.h" @@ -522,7 +523,8 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey; msg = [[SessionListViewController alloc] init]; me = [[XPMineViewController alloc] init]; - home = [[XPHomeViewController alloc] init]; +// home = [[XPHomeViewController alloc] init]; + home = [[XPNewHomeViewController alloc] init]; monents = [[XPMonentsViewController alloc] init]; } else { game = [[BaseViewController alloc]init];