首页UI
@@ -175,7 +175,7 @@ SPEC REPOS:
|
||||
- YYWebImage
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
AFNetworking: 7864c38297c79aaca1500c33288e429c3451fdce
|
||||
AFNetworking: 3bd23d814e976cd148d7d44c3ab78017b744cd58
|
||||
AgoraRtcEngine_iOS: 8ccceaaecff2e80ab28fcd33f3dfd2b417eb5365
|
||||
Base64: cecfb41a004124895a7bcee567a89bae5a89d49b
|
||||
Bugly: b8715e6ec4004b7f7fbffab0643ba80545aee3da
|
||||
|
@@ -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 = "<group>"; };
|
||||
146567D829B1D62E00A1F5B9 /* XPNewHomeViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPNewHomeViewController.m; sourceTree = "<group>"; };
|
||||
146567DA29B1D6A900A1F5B9 /* XPNewHomeNavView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPNewHomeNavView.h; sourceTree = "<group>"; };
|
||||
146567DB29B1D6A900A1F5B9 /* XPNewHomeNavView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPNewHomeNavView.m; sourceTree = "<group>"; };
|
||||
146567E029B1E1CF00A1F5B9 /* XPNewHomeHeaderView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPNewHomeHeaderView.h; sourceTree = "<group>"; };
|
||||
146567E129B1E1CF00A1F5B9 /* XPNewHomeHeaderView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPNewHomeHeaderView.m; sourceTree = "<group>"; };
|
||||
146567E329B1F55200A1F5B9 /* XPFindNewFriendTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPFindNewFriendTableViewCell.h; sourceTree = "<group>"; };
|
||||
146567E429B1F55200A1F5B9 /* XPFindNewFriendTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPFindNewFriendTableViewCell.m; sourceTree = "<group>"; };
|
||||
180116F7279E8C4C00F2CBC0 /* PLTimeUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PLTimeUtil.h; sourceTree = "<group>"; };
|
||||
180116F8279E8C4C00F2CBC0 /* PLTimeUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PLTimeUtil.m; sourceTree = "<group>"; };
|
||||
180116FA279E8CCE00F2CBC0 /* NVDate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NVDate.m; sourceTree = "<group>"; };
|
||||
@@ -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 = "<group>";
|
||||
@@ -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 */,
|
||||
|
22
xplan-ios/Assets.xcassets/Home/home_head_game.imageset/Contents.json
vendored
Normal file
@@ -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
|
||||
}
|
||||
}
|
BIN
xplan-ios/Assets.xcassets/Home/home_head_game.imageset/home_head_game@2x.png
vendored
Normal file
After Width: | Height: | Size: 7.4 KiB |
BIN
xplan-ios/Assets.xcassets/Home/home_head_game.imageset/home_head_game@3x.png
vendored
Normal file
After Width: | Height: | Size: 12 KiB |
22
xplan-ios/Assets.xcassets/Home/home_head_match.imageset/Contents.json
vendored
Normal file
@@ -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
|
||||
}
|
||||
}
|
BIN
xplan-ios/Assets.xcassets/Home/home_head_match.imageset/home_head_match@2x.png
vendored
Normal file
After Width: | Height: | Size: 5.7 KiB |
BIN
xplan-ios/Assets.xcassets/Home/home_head_match.imageset/home_head_match@3x.png
vendored
Normal file
After Width: | Height: | Size: 7.3 KiB |
22
xplan-ios/Assets.xcassets/Home/home_head_party.imageset/Contents.json
vendored
Normal file
@@ -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
|
||||
}
|
||||
}
|
BIN
xplan-ios/Assets.xcassets/Home/home_head_party.imageset/home_head_party@2x.png
vendored
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
xplan-ios/Assets.xcassets/Home/home_head_party.imageset/home_head_party@3x.png
vendored
Normal file
After Width: | Height: | Size: 16 KiB |
22
xplan-ios/Assets.xcassets/Home/home_head_radio.imageset/Contents.json
vendored
Normal file
@@ -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
|
||||
}
|
||||
}
|
BIN
xplan-ios/Assets.xcassets/Home/home_head_radio.imageset/home_head_radio@2x.png
vendored
Normal file
After Width: | Height: | Size: 7.2 KiB |
BIN
xplan-ios/Assets.xcassets/Home/home_head_radio.imageset/home_head_radio@3x.png
vendored
Normal file
After Width: | Height: | Size: 12 KiB |
22
xplan-ios/Assets.xcassets/Home/home_hot_bg.imageset/Contents.json
vendored
Normal file
@@ -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
|
||||
}
|
||||
}
|
BIN
xplan-ios/Assets.xcassets/Home/home_hot_bg.imageset/home_hot_bg@2x.png
vendored
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
xplan-ios/Assets.xcassets/Home/home_hot_bg.imageset/home_hot_bg@3x.png
vendored
Normal file
After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 579 B After Width: | Height: | Size: 685 B |
Before Width: | Height: | Size: 875 B After Width: | Height: | Size: 813 B |
@@ -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 {
|
||||
|
16
xplan-ios/Main/Home/View/XPFindNewFriendTableViewCell.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// XPFindNewFriendTableViewCell.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by XY on 2023/3/3.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPFindNewFriendTableViewCell : UITableViewCell
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
39
xplan-ios/Main/Home/View/XPFindNewFriendTableViewCell.m
Normal file
@@ -0,0 +1,39 @@
|
||||
//
|
||||
// XPFindNewFriendTableViewCell.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by XY on 2023/3/3.
|
||||
//
|
||||
|
||||
#import "XPFindNewFriendTableViewCell.h"
|
||||
/// Third
|
||||
#import <Masonry.h>
|
||||
/// 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
|
36
xplan-ios/Main/Home/View/XPNewHomeHeaderView.h
Normal file
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// XPNewHomeHeaderView.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by XY on 2023/3/3.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol XPNewHomeHeaderViewDelegate <NSObject>
|
||||
|
||||
/// 点击交友派对
|
||||
- (void)homeHeaderViewPartyAction;
|
||||
/// 点击小游戏
|
||||
- (void)homeHeaderViewGameAction;
|
||||
/// 点击听电台
|
||||
- (void)homeHeaderViewRadioAction;
|
||||
/// 点击一键匹配
|
||||
- (void)homeHeaderViewMatchAction;
|
||||
/// 点击热门
|
||||
- (void)homeHeaderViewHotAction;
|
||||
|
||||
@end
|
||||
|
||||
@interface XPNewHomeHeaderView : UIView
|
||||
|
||||
@property (nonatomic, weak) id<XPNewHomeHeaderViewDelegate> delegate;
|
||||
|
||||
/// 获取headerView的高度
|
||||
+ (NSUInteger)getHeaderViewHeight;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
217
xplan-ios/Main/Home/View/XPNewHomeHeaderView.m
Normal file
@@ -0,0 +1,217 @@
|
||||
//
|
||||
// XPNewHomeHeaderView.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by XY on 2023/3/3.
|
||||
//
|
||||
|
||||
#import "XPNewHomeHeaderView.h"
|
||||
///Third
|
||||
#import <Masonry.h>
|
||||
///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
|
28
xplan-ios/Main/Home/View/XPNewHomeNavView.h
Normal file
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// XPNewHomeNavView.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by XY on 2023/3/3.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class XPNewHomeNavView;
|
||||
@protocol XPNewHomeNavViewDelegate <NSObject>
|
||||
///点击了搜索房间
|
||||
- (void)xPNewHomeNavView:(XPNewHomeNavView *)view didClickSearch:(UIButton *)sender;
|
||||
///点击了榜单按钮
|
||||
- (void)xPNewHomeNavView:(XPNewHomeNavView *)view didClickRank:(UIButton *)sender;
|
||||
|
||||
@end
|
||||
|
||||
@interface XPNewHomeNavView : UIView
|
||||
|
||||
///代理
|
||||
@property (nonatomic,weak) id<XPNewHomeNavViewDelegate> delegate;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
105
xplan-ios/Main/Home/View/XPNewHomeNavView.m
Normal file
@@ -0,0 +1,105 @@
|
||||
//
|
||||
// XPNewHomeNavView.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by XY on 2023/3/3.
|
||||
//
|
||||
|
||||
#import "XPNewHomeNavView.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
|
||||
///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
|
16
xplan-ios/Main/Home/View/XPNewHomeViewController.h
Normal file
@@ -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
|
391
xplan-ios/Main/Home/View/XPNewHomeViewController.m
Normal file
@@ -0,0 +1,391 @@
|
||||
//
|
||||
// XPNewHomeViewController.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by XY on 2023/3/3.
|
||||
//
|
||||
|
||||
#import "XPNewHomeViewController.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
#import <JXCategoryView.h>
|
||||
#import <JXPagerView.h>
|
||||
#import <MJRefresh/MJRefresh.h>
|
||||
#import <ReactiveObjC/ReactiveObjC.h>
|
||||
///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 ()<JXCategoryViewDelegate,JXPagerViewDelegate, XPHomeRecommendProtocol,JXPagerMainTableViewGestureDelegate, XPNewHomeNavViewDelegate, XPNewHomeHeaderViewDelegate>
|
||||
{
|
||||
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<NSString *> *titles;
|
||||
///分页控制器头部
|
||||
@property (nonatomic,strong) XPNewHomeHeaderView *headerView;
|
||||
///菜单列表
|
||||
@property (nonatomic,strong) NSArray<HomeMenuInfoModel *> *menuList;
|
||||
///轮播图
|
||||
@property (nonatomic,strong) NSArray<HomeBannerInfoModel *> *bannerList;
|
||||
///推荐房
|
||||
@property (nonatomic,strong) NSArray<HomeRecommendRoomModel *> *recommendList;
|
||||
///热门房
|
||||
@property (nonatomic,strong) NSArray<HomeRecommendRoomModel *> *hotRoomList;
|
||||
///组队开黑
|
||||
@property (nonatomic,strong) NSArray<HomePlayRoomModel *> *playTeamList;
|
||||
///个人房列表数据
|
||||
@property (nonatomic,strong) NSArray<HomePlayRoomModel *> *personalRoomList;
|
||||
///个人房
|
||||
@property (nonatomic,strong) XPHomeHappyViewController *personalRoomVC;
|
||||
///热门房
|
||||
@property (nonatomic,strong) XPHomeHotRoomViewController *hotRoomVC;
|
||||
|
||||
@end
|
||||
|
||||
@implementation 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<JXPagerViewListViewDelegate>)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 <JXPagerViewListViewDelegate>)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<JXCategoryViewListContainer>)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<NSString *> *)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
|
@@ -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];
|
||||
|