2023-07-14 18:50:55 +08:00
|
|
|
|
//
|
|
|
|
|
// XPNewHomeViewController.m
|
|
|
|
|
// YuMi
|
|
|
|
|
//
|
|
|
|
|
// Created by YuMi on 2023/6/18.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
#import "XPNewHomeViewController.h"
|
|
|
|
|
///Third
|
|
|
|
|
#import <Masonry/Masonry.h>
|
2023-09-01 18:58:41 +08:00
|
|
|
|
#import <JXPagingView/JXPagerView.h>
|
|
|
|
|
#import <JXPagingView/JXPagerListRefreshView.h>
|
2023-07-14 18:50:55 +08:00
|
|
|
|
#import <JXCategoryView/JXCategoryView.h>
|
|
|
|
|
///Tool
|
|
|
|
|
#import "YUMIMacroUitls.h"
|
|
|
|
|
#import "DJDKMIMOMColor.h"
|
|
|
|
|
#import "YUMIHtmlUrl.h"
|
|
|
|
|
#import "UIImage+Utils.h"
|
|
|
|
|
#import "AccountInfoStorage.h"
|
|
|
|
|
#import "Api+Room.h"
|
|
|
|
|
#import "TTPopup.h"
|
|
|
|
|
#import "NSArray+Safe.h"
|
|
|
|
|
///Model
|
|
|
|
|
#import "HomeTagModel.h"
|
2023-09-05 11:45:21 +08:00
|
|
|
|
|
2023-09-01 14:29:14 +08:00
|
|
|
|
#import "XPLittleGameRoomOpenView.h"
|
2023-09-05 11:45:21 +08:00
|
|
|
|
|
|
|
|
|
#import "PIHomeItemModel.h"
|
|
|
|
|
|
2023-07-14 18:50:55 +08:00
|
|
|
|
///View
|
|
|
|
|
#import "XPRoomSearchContainerViewController.h"
|
|
|
|
|
#import "XPHomePartyViewController.h"
|
|
|
|
|
#import "XPWebViewController.h"
|
|
|
|
|
#import "XPHomeRecommendViewController.h"
|
|
|
|
|
#import "XPNewHomeNavView.h"
|
|
|
|
|
#import "XPRoomViewController.h"
|
2023-09-01 18:58:41 +08:00
|
|
|
|
#import "XPNewHomeHeadView.h"
|
|
|
|
|
#import "PIHoemCategoryTitleView.h"
|
2023-07-14 18:50:55 +08:00
|
|
|
|
///P
|
|
|
|
|
#import "XPHomeContainerPresenter.h"
|
|
|
|
|
#import "XPHomeContainerProtocol.h"
|
2023-08-11 14:46:56 +08:00
|
|
|
|
#import "ClientConfig.h"
|
2023-08-18 10:41:30 +08:00
|
|
|
|
#import "SessionViewController.h"
|
2023-07-14 18:50:55 +08:00
|
|
|
|
|
|
|
|
|
UIKIT_EXTERN NSString * kHomeMoreScrollPageKey;
|
|
|
|
|
UIKIT_EXTERN NSString * const kOpenRoomNotification;
|
|
|
|
|
|
2023-09-05 11:45:21 +08:00
|
|
|
|
@interface XPNewHomeViewController ()<JXPagerViewDelegate,JXPagerMainTableViewGestureDelegate,JXCategoryViewDelegate, XPHomeContainerProtocol, XPNewHomeNavViewDelegate,XPNewHomeHeadViewDelegate>
|
2023-09-01 15:52:10 +08:00
|
|
|
|
///背景
|
2023-07-14 18:50:55 +08:00
|
|
|
|
@property (nonatomic,strong) UIImageView *backImageView;
|
2023-09-01 15:52:10 +08:00
|
|
|
|
///导航
|
2023-07-14 18:50:55 +08:00
|
|
|
|
@property (nonatomic,strong) XPNewHomeNavView *navView;
|
2023-09-01 18:58:41 +08:00
|
|
|
|
///头视图
|
|
|
|
|
@property(nonatomic,strong) XPNewHomeHeadView *headView;
|
2023-07-14 18:50:55 +08:00
|
|
|
|
///分页标题
|
|
|
|
|
@property (nonatomic, strong) NSArray<NSString *> *titles;
|
|
|
|
|
///分页控件
|
2023-09-01 18:58:41 +08:00
|
|
|
|
@property (nonatomic, strong) PIHoemCategoryTitleView *titleView;
|
2023-07-14 18:50:55 +08:00
|
|
|
|
///分页lineView
|
2023-09-01 18:58:41 +08:00
|
|
|
|
@property (nonatomic, strong) JXPagerView *pagingView;
|
2023-07-14 18:50:55 +08:00
|
|
|
|
///tag的列表
|
|
|
|
|
@property (nonatomic,copy) NSMutableArray<HomeTagModel *> *tagList;
|
|
|
|
|
@property (nonatomic,strong) HomeTagModel *recommendItem;
|
|
|
|
|
///解决弱网时首页底部出现一片空白bug
|
|
|
|
|
@property (nonatomic,assign) BOOL isEmpty;
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
@implementation XPNewHomeViewController
|
|
|
|
|
-(instancetype)initWithIsEmpty:(BOOL)isEmpty{
|
2023-09-01 18:58:41 +08:00
|
|
|
|
self = [super init];
|
|
|
|
|
if(self){
|
|
|
|
|
self.isEmpty = isEmpty;
|
|
|
|
|
}
|
|
|
|
|
return self;
|
2023-07-14 18:50:55 +08:00
|
|
|
|
}
|
|
|
|
|
-(void)dealloc{
|
2023-09-01 18:58:41 +08:00
|
|
|
|
[[NSNotificationCenter defaultCenter]removeObserver:self];
|
2023-07-14 18:50:55 +08:00
|
|
|
|
}
|
|
|
|
|
- (BOOL)isHiddenNavBar {
|
2023-09-01 18:58:41 +08:00
|
|
|
|
return YES;
|
2023-07-14 18:50:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (XPHomeContainerPresenter *)createPresenter {
|
2023-09-01 18:58:41 +08:00
|
|
|
|
return [[XPHomeContainerPresenter alloc] init];
|
2023-07-14 18:50:55 +08:00
|
|
|
|
}
|
|
|
|
|
- (void)viewDidLoad {
|
2023-09-01 18:58:41 +08:00
|
|
|
|
[super viewDidLoad];
|
|
|
|
|
if(self.isEmpty == NO){
|
|
|
|
|
[self initHttp];
|
|
|
|
|
[self initSubViews];
|
|
|
|
|
[self initSubViewConstraints];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2023-07-14 18:50:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#pragma mark - Private Method
|
|
|
|
|
- (void)initSubViews {
|
2023-09-01 18:58:41 +08:00
|
|
|
|
self.view.backgroundColor = [DJDKMIMOMColor colorWithHexString:@"#F3F5FA"];
|
|
|
|
|
[self.view addSubview:self.backImageView];
|
|
|
|
|
[self.view addSubview:self.navView];
|
|
|
|
|
[self.view addSubview:self.pagingView];
|
2023-08-11 14:46:56 +08:00
|
|
|
|
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(openRoomNotification:) name:kOpenRoomNotification object:nil];
|
2023-08-18 10:43:10 +08:00
|
|
|
|
if([[AccountInfoStorage instance] getUid].length == 0){
|
|
|
|
|
return;
|
|
|
|
|
}
|
2023-08-17 18:26:13 +08:00
|
|
|
|
if([ClientConfig shareConfig].roomId != nil){
|
|
|
|
|
[self opRoom:[ClientConfig shareConfig].roomId];
|
|
|
|
|
[ClientConfig shareConfig].roomId = nil;
|
|
|
|
|
}
|
2023-08-18 10:41:30 +08:00
|
|
|
|
if([ClientConfig shareConfig].chatId != nil){
|
|
|
|
|
NIMSession * session = [NIMSession session:[ClientConfig shareConfig].chatId type:NIMSessionTypeP2P];
|
|
|
|
|
SessionViewController * sessionVC = [[SessionViewController alloc] initWithSession:session];
|
2023-09-01 15:06:49 +08:00
|
|
|
|
sessionVC.isAttention = YES;
|
2023-08-18 10:41:30 +08:00
|
|
|
|
[self.navigationController pushViewController:sessionVC animated:YES];
|
|
|
|
|
[ClientConfig shareConfig].chatId = nil;
|
|
|
|
|
}
|
2023-08-11 14:46:56 +08:00
|
|
|
|
}
|
|
|
|
|
-(void)openRoomNotification:(NSNotification *)notification{
|
2023-08-18 10:43:10 +08:00
|
|
|
|
if([[AccountInfoStorage instance] getUid].length == 0){
|
|
|
|
|
return;
|
|
|
|
|
}
|
2023-08-11 14:46:56 +08:00
|
|
|
|
NSString *uid = notification.userInfo[@"uid"];
|
2023-08-18 10:41:30 +08:00
|
|
|
|
NSString *type = notification.userInfo[@"type"];
|
|
|
|
|
if([type isEqualToString:@"kOpenChat"]){
|
|
|
|
|
if (uid.length > 0) {
|
|
|
|
|
NIMSession * session = [NIMSession session:uid type:NIMSessionTypeP2P];
|
|
|
|
|
SessionViewController * sessionVC = [[SessionViewController alloc] initWithSession:session];
|
2023-09-01 15:06:49 +08:00
|
|
|
|
sessionVC.isAttention = YES;
|
2023-08-18 10:41:30 +08:00
|
|
|
|
[self.navigationController pushViewController:sessionVC animated:YES];
|
|
|
|
|
[ClientConfig shareConfig].chatId = nil;
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ClientConfig *config = [ClientConfig shareConfig];
|
|
|
|
|
config.chatId = uid;
|
2023-08-11 14:46:56 +08:00
|
|
|
|
if(uid != nil){
|
|
|
|
|
[self opRoom:uid];
|
2023-08-18 10:41:30 +08:00
|
|
|
|
[ClientConfig shareConfig].roomId = nil;
|
2023-08-11 14:46:56 +08:00
|
|
|
|
}
|
2023-07-14 18:50:55 +08:00
|
|
|
|
}
|
|
|
|
|
- (void)initSubViewConstraints {
|
2023-09-01 18:58:41 +08:00
|
|
|
|
|
|
|
|
|
[self.backImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
make.left.right.top.mas_equalTo(self.view);
|
|
|
|
|
make.height.mas_equalTo(170 + kSafeAreaTopHeight);
|
|
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
[self.navView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
make.left.right.top.mas_equalTo(self.view);
|
|
|
|
|
make.height.mas_equalTo(kNavigationHeight);
|
|
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[self.pagingView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
make.top.equalTo(self.navView.mas_bottom).mas_offset(kGetScaleWidth(10));
|
|
|
|
|
make.leading.bottom.trailing.mas_equalTo(0);
|
|
|
|
|
}];
|
|
|
|
|
|
2023-07-14 18:50:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)initHttp {
|
2023-09-01 18:58:41 +08:00
|
|
|
|
[self.presenter getHomeTagList];
|
|
|
|
|
[self.presenter getHomeTopBannerList];
|
2023-09-05 11:45:21 +08:00
|
|
|
|
[self.presenter getCurrentResourceList];
|
2023-07-14 18:50:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#pragma mark - XPNewHomeNavViewDelegate
|
|
|
|
|
- (void)xPNewHomeNavView:(XPNewHomeNavView *)view didClickRank:(UIButton *)sender {
|
2023-09-01 18:58:41 +08:00
|
|
|
|
XPWebViewController * webVC =[[XPWebViewController alloc] init];
|
|
|
|
|
webVC.url = URLWithType(kHomeRankURL);
|
|
|
|
|
[self.navigationController pushViewController:webVC animated:YES];
|
2023-07-14 18:50:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)xPNewHomeNavView:(XPNewHomeNavView *)view didClickOpenRoom:(UIButton *)sender {
|
2023-09-01 18:58:41 +08:00
|
|
|
|
NSString* roomUid = [AccountInfoStorage instance].getUid;
|
|
|
|
|
[self opRoom:roomUid];
|
|
|
|
|
|
2023-07-14 18:50:55 +08:00
|
|
|
|
}
|
|
|
|
|
-(void)opRoom:(NSString *)roomUid{
|
2023-09-01 18:58:41 +08:00
|
|
|
|
|
2023-09-01 14:29:14 +08:00
|
|
|
|
[Api getRoomInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
|
|
|
|
if (code == 200) {
|
|
|
|
|
RoomInfoModel * roomInfo = [RoomInfoModel modelWithJSON:data.data];
|
|
|
|
|
if (roomInfo.isReselect) {
|
|
|
|
|
XPLittleGameRoomOpenView * roomOpenView = [[XPLittleGameRoomOpenView alloc] init];
|
|
|
|
|
roomOpenView.roomInfo = roomInfo;
|
|
|
|
|
roomOpenView.currentVC = self;
|
|
|
|
|
[TTPopup popupView:roomOpenView style:TTPopupStyleActionSheet];
|
|
|
|
|
} else {
|
|
|
|
|
[XPRoomViewController openRoom:roomUid viewController:self];
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
[self showErrorToast:msg];
|
|
|
|
|
}
|
|
|
|
|
} uid:roomUid intoUid:roomUid];
|
|
|
|
|
|
2023-09-01 18:58:41 +08:00
|
|
|
|
|
2023-07-14 18:50:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)xPNewHomeNavView:(XPNewHomeNavView *)view didClickSearch:(UIView *)sender {
|
2023-09-01 18:58:41 +08:00
|
|
|
|
XPRoomSearchContainerViewController * searchVC = [[XPRoomSearchContainerViewController alloc] init];
|
|
|
|
|
searchVC.modalPresentationStyle = UIModalPresentationFullScreen;
|
|
|
|
|
[self.navigationController presentViewController:searchVC animated:YES completion:nil];
|
2023-07-14 18:50:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
2023-09-01 18:58:41 +08:00
|
|
|
|
#pragma mark - JXCategoryViewDelegate
|
|
|
|
|
- (NSUInteger)tableHeaderViewHeightInPagerView:(JXPagerView *)pagerView {
|
|
|
|
|
if(self.headView.bannerList.count == 0)return kGetScaleWidth(103);
|
|
|
|
|
return kGetScaleWidth(188);
|
2023-07-14 18:50:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
2023-09-01 18:58:41 +08:00
|
|
|
|
- (UIView *)tableHeaderViewInPagerView:(JXPagerView *)pagerView {
|
|
|
|
|
return self.headView;
|
|
|
|
|
}
|
|
|
|
|
- (NSUInteger)heightForPinSectionHeaderInPagerView:(JXPagerView *)pagerView {
|
|
|
|
|
return kGetScaleWidth(44);
|
|
|
|
|
}
|
|
|
|
|
- (UIView *)viewForPinSectionHeaderInPagerView:(JXPagerView *)pagerView {
|
|
|
|
|
return self.titleView;
|
2023-07-14 18:50:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
2023-09-01 18:58:41 +08:00
|
|
|
|
- (NSInteger)numberOfListsInPagerView:(JXPagerView *)pagerView {
|
|
|
|
|
return self.titles.count;
|
|
|
|
|
}
|
2023-07-14 18:50:55 +08:00
|
|
|
|
|
2023-09-01 18:58:41 +08:00
|
|
|
|
- (id<JXPagerViewListViewDelegate>)pagerView:(JXPagerView *)pagerView initListAtIndex:(NSInteger)index {
|
|
|
|
|
|
|
|
|
|
XPHomeRecommendViewController<JXPagerViewListViewDelegate> * homeV = (XPHomeRecommendViewController<JXPagerViewListViewDelegate> *)[self.pagingView.validListDict objectForKey:[NSNumber numberWithInteger:index]];
|
|
|
|
|
if (homeV) {
|
|
|
|
|
return homeV;
|
|
|
|
|
}
|
|
|
|
|
if (index == 0) {
|
|
|
|
|
XPHomePartyViewController * homeVC = [[XPHomePartyViewController alloc] init];
|
|
|
|
|
return homeVC;
|
2023-09-05 11:45:21 +08:00
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
XPHomeRecommendViewController * recommendVC = [[XPHomeRecommendViewController alloc] init];
|
|
|
|
|
return recommendVC;
|
2023-09-01 18:58:41 +08:00
|
|
|
|
}
|
|
|
|
|
|
2023-07-14 18:50:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#pragma mark - JXCategoryListContentViewDelegate
|
|
|
|
|
- (UIView *)listView {
|
2023-09-01 18:58:41 +08:00
|
|
|
|
return self.view;
|
2023-07-14 18:50:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
2023-09-01 18:58:41 +08:00
|
|
|
|
|
|
|
|
|
#pragma mark - JXPagerMainTableViewGestureDelegate
|
|
|
|
|
- (BOOL)mainTableViewGestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
|
|
|
|
|
//禁止categoryView左右滑动的时候,上下和左右都可以滚动
|
|
|
|
|
if (otherGestureRecognizer.view == self.pagingView.listContainerView) {
|
|
|
|
|
return NO;
|
|
|
|
|
}
|
|
|
|
|
if(otherGestureRecognizer.view.tag == 9000001){
|
|
|
|
|
return NO;
|
|
|
|
|
}
|
|
|
|
|
if(otherGestureRecognizer.view.tag == 9000002){
|
|
|
|
|
return NO;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return [gestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]] && [otherGestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]];
|
|
|
|
|
}
|
2023-07-14 18:50:55 +08:00
|
|
|
|
#pragma mark - XPHomeContainerProtocol
|
2023-09-01 18:58:41 +08:00
|
|
|
|
-(void)getHomeTopBannerListSuccess:(NSArray *)list{
|
|
|
|
|
self.headView.bannerList = list;
|
|
|
|
|
[self.pagingView reloadData];
|
2023-09-04 10:29:16 +08:00
|
|
|
|
[self.pagingView resizeTableHeaderViewHeightWithAnimatable:NO duration:0 curve:0];
|
2023-09-01 18:58:41 +08:00
|
|
|
|
}
|
2023-09-05 11:45:21 +08:00
|
|
|
|
- (void)getCurrentResourceListSuccess:(NSArray *)list{
|
|
|
|
|
self.headView.itemList = list;
|
|
|
|
|
}
|
2023-07-14 18:50:55 +08:00
|
|
|
|
- (void)getHomeTagListSuccess:(NSArray<HomeTagModel *> *)array {
|
2023-09-01 18:58:41 +08:00
|
|
|
|
// [self.tagList addObject:self.recommendItem];
|
|
|
|
|
// [self.tagList addObjectsFromArray:array];
|
|
|
|
|
// NSMutableArray * titles = [NSMutableArray array];
|
|
|
|
|
// [titles addObject:YMLocalizedString(@"XPNewHomeViewController2")];
|
|
|
|
|
// [array 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];
|
|
|
|
|
}
|
|
|
|
|
- (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index{
|
2023-09-04 10:29:16 +08:00
|
|
|
|
self.titleView.index = (int)index;
|
2023-09-05 11:45:21 +08:00
|
|
|
|
self.titleView.defaultSelectedIndex = index;
|
|
|
|
|
[self.titleView reloadData];
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
#pragma mark - XPNewHomeHeadViewDelegate
|
|
|
|
|
///选择
|
|
|
|
|
-(void)selectItemWithModel:(PIHomeItemModel *)model{
|
|
|
|
|
if (model.resourceType == HomeMenuResourceType_H5) {
|
|
|
|
|
XPWebViewController * webVC = [[ XPWebViewController alloc] init];
|
|
|
|
|
webVC.url = model.resourceContent;
|
|
|
|
|
[self.navigationController pushViewController:webVC animated:YES];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
-(void)selectBannerListWithModel:(HomeBannerInfoModel *)model{
|
|
|
|
|
switch (model.skipType) {
|
|
|
|
|
case HomeBannerInfoSkipType_Room:
|
|
|
|
|
{
|
|
|
|
|
if (model.skipUri.length > 0) {
|
|
|
|
|
[XPRoomViewController openRoom:model.skipUri viewController:self];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case HomeBannerInfoSkipType_Web:
|
|
|
|
|
{
|
|
|
|
|
XPWebViewController *vc = [[XPWebViewController alloc]init];
|
|
|
|
|
vc.url = model.skipUri;
|
|
|
|
|
[self.navigationController pushViewController:vc animated:YES];
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
2023-07-14 18:50:55 +08:00
|
|
|
|
}
|
|
|
|
|
#pragma mark - Getters And Setters
|
2023-09-01 18:58:41 +08:00
|
|
|
|
- (PIHoemCategoryTitleView *)titleView {
|
|
|
|
|
if (!_titleView) {
|
|
|
|
|
_titleView = [[PIHoemCategoryTitleView alloc] init];
|
|
|
|
|
_titleView.delegate = self;
|
|
|
|
|
_titleView.titles = self.titles;
|
|
|
|
|
_titleView.backgroundColor = [UIColor clearColor];
|
|
|
|
|
_titleView.titleColor = [UIColor clearColor];
|
|
|
|
|
_titleView.titleSelectedColor = [UIColor clearColor];
|
|
|
|
|
_titleView.titleFont = kFontSemibold(16);
|
|
|
|
|
_titleView.titleSelectedFont = kFontRegular(14);
|
2023-09-05 11:45:21 +08:00
|
|
|
|
_titleView.titleLabelAnchorPointStyle = JXCategoryTitleLabelAnchorPointStyleCenter;
|
2023-09-01 18:58:41 +08:00
|
|
|
|
_titleView.contentScrollViewClickTransitionAnimationEnabled = NO;
|
|
|
|
|
_titleView.defaultSelectedIndex = 0;
|
|
|
|
|
|
|
|
|
|
_titleView.cellSpacing = kGetScaleWidth(2);
|
|
|
|
|
_titleView.cellWidth = kGetScaleWidth(20);
|
|
|
|
|
_titleView.listContainer = (id<JXCategoryViewListContainer>)self.pagingView.listContainerView;
|
|
|
|
|
|
|
|
|
|
// JXCategoryIndicatorImageView * indocator = [[JXCategoryIndicatorImageView alloc] init];
|
|
|
|
|
// indocator.indicatorImageView.image = [UIImage imageNamed:@"home_slider_bg"];
|
|
|
|
|
// indocator.indicatorImageViewSize = CGSizeMake(kGetScaleWidth(36), kGetScaleWidth(8));
|
|
|
|
|
// indocator.verticalMargin = 4;
|
|
|
|
|
// indocator.contentMode = UIViewContentModeScaleAspectFit;
|
|
|
|
|
// _titleView.indicators = @[indocator];
|
|
|
|
|
}
|
|
|
|
|
return _titleView;
|
2023-07-14 18:50:55 +08:00
|
|
|
|
}
|
2023-09-01 18:58:41 +08:00
|
|
|
|
- (NSArray<NSString *> *)titles{
|
|
|
|
|
if(!_titles){
|
|
|
|
|
_titles = @[YMLocalizedString(@"XPNewHomeViewController0"),YMLocalizedString(@"XPNewHomeViewController1")];
|
|
|
|
|
}
|
|
|
|
|
return _titles;
|
|
|
|
|
}
|
|
|
|
|
- (JXPagerView *)pagingView {
|
|
|
|
|
if (!_pagingView) {
|
|
|
|
|
_pagingView = [[JXPagerView alloc] initWithDelegate:self listContainerType:0];
|
|
|
|
|
_pagingView.mainTableView.gestureDelegate = self;
|
|
|
|
|
_pagingView.backgroundColor = [UIColor clearColor];
|
|
|
|
|
_pagingView.listContainerView.backgroundColor = [UIColor clearColor];
|
|
|
|
|
_pagingView.listContainerView.listCellBackgroundColor = [UIColor clearColor];
|
|
|
|
|
_pagingView.mainTableView.backgroundColor = [UIColor clearColor];
|
|
|
|
|
}
|
|
|
|
|
return _pagingView;
|
2023-07-14 18:50:55 +08:00
|
|
|
|
}
|
|
|
|
|
- (HomeTagModel *)recommendItem {
|
2023-09-01 18:58:41 +08:00
|
|
|
|
if (!_recommendItem) {
|
|
|
|
|
_recommendItem = [[HomeTagModel alloc] init];
|
|
|
|
|
_recommendItem.name = YMLocalizedString(@"XPNewHomeViewController3");
|
|
|
|
|
}
|
|
|
|
|
return _recommendItem;
|
2023-07-14 18:50:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (NSMutableArray<HomeTagModel *> *)tagList {
|
2023-09-01 18:58:41 +08:00
|
|
|
|
if (!_tagList) {
|
|
|
|
|
_tagList = [NSMutableArray array];
|
|
|
|
|
}
|
|
|
|
|
return _tagList;
|
2023-07-14 18:50:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (XPNewHomeNavView *)navView {
|
2023-09-01 18:58:41 +08:00
|
|
|
|
if (!_navView) {
|
|
|
|
|
_navView = [[XPNewHomeNavView alloc] init];
|
|
|
|
|
_navView.delegate = self;
|
|
|
|
|
}
|
|
|
|
|
return _navView;
|
2023-07-14 18:50:55 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (UIImageView *)backImageView {
|
2023-09-01 18:58:41 +08:00
|
|
|
|
if (!_backImageView) {
|
|
|
|
|
_backImageView = [[UIImageView alloc] init];
|
|
|
|
|
_backImageView.image = [UIImage imageNamed:@"home_top_bg"];
|
|
|
|
|
_backImageView.layer.masksToBounds = YES;
|
|
|
|
|
_backImageView.contentMode = UIViewContentModeScaleAspectFill;
|
|
|
|
|
}
|
|
|
|
|
return _backImageView;
|
|
|
|
|
}
|
|
|
|
|
- (XPNewHomeHeadView *)headView{
|
|
|
|
|
if(!_headView){
|
|
|
|
|
_headView = [[XPNewHomeHeadView alloc]initWithFrame:CGRectZero];
|
2023-09-05 11:45:21 +08:00
|
|
|
|
_headView.delegate = self;
|
2023-09-01 18:58:41 +08:00
|
|
|
|
}
|
|
|
|
|
return _headView;
|
2023-07-14 18:50:55 +08:00
|
|
|
|
}
|
|
|
|
|
@end
|