首页个播刷新逻辑
This commit is contained in:
@@ -31,7 +31,7 @@
|
|||||||
</Testables>
|
</Testables>
|
||||||
</TestAction>
|
</TestAction>
|
||||||
<LaunchAction
|
<LaunchAction
|
||||||
buildConfiguration = "Debug"
|
buildConfiguration = "Release"
|
||||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
launchStyle = "0"
|
launchStyle = "0"
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 77 KiB |
Binary file not shown.
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 141 KiB |
@@ -40,9 +40,9 @@
|
|||||||
#pragma mark - Public Method
|
#pragma mark - Public Method
|
||||||
+ (CGFloat)getHomeLiveHeaderViewHeight:(NSArray *)recommendList {
|
+ (CGFloat)getHomeLiveHeaderViewHeight:(NSArray *)recommendList {
|
||||||
CGFloat totaHeight = 0;
|
CGFloat totaHeight = 0;
|
||||||
if (recommendList.count) {
|
// if (recommendList.count) {
|
||||||
totaHeight = 127 + 8;
|
totaHeight = 127 + 8;
|
||||||
}
|
// }
|
||||||
return totaHeight;
|
return totaHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -49,7 +49,6 @@
|
|||||||
|
|
||||||
- (void)viewDidLoad {
|
- (void)viewDidLoad {
|
||||||
[super viewDidLoad];
|
[super viewDidLoad];
|
||||||
[self headerRefresh];
|
|
||||||
[self initSubViews];
|
[self initSubViews];
|
||||||
[self initSubViewConstraints];
|
[self initSubViewConstraints];
|
||||||
}
|
}
|
||||||
@@ -60,6 +59,12 @@
|
|||||||
[self.view addSubview:self.collectionView];
|
[self.view addSubview:self.collectionView];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)viewWillAppear:(BOOL)animated {
|
||||||
|
[super viewWillAppear:animated];
|
||||||
|
|
||||||
|
[self headerRefresh];
|
||||||
|
}
|
||||||
|
|
||||||
- (void)initSubViewConstraints {
|
- (void)initSubViewConstraints {
|
||||||
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.edges.mas_equalTo(self.view);
|
make.edges.mas_equalTo(self.view);
|
||||||
@@ -165,7 +170,7 @@
|
|||||||
- (void)setTabId:(NSString *)tabId {
|
- (void)setTabId:(NSString *)tabId {
|
||||||
_tabId = tabId;
|
_tabId = tabId;
|
||||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||||
[self headerRefresh];
|
// [self headerRefresh];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -18,6 +18,7 @@
|
|||||||
#import "ThemeColor.h"
|
#import "ThemeColor.h"
|
||||||
#import "XPHtmlUrl.h"
|
#import "XPHtmlUrl.h"
|
||||||
#import "StatisticsServiceHelper.h"
|
#import "StatisticsServiceHelper.h"
|
||||||
|
#import "XPWeakTimer.h"
|
||||||
///Model
|
///Model
|
||||||
#import "HomeLiveTagModel.h"
|
#import "HomeLiveTagModel.h"
|
||||||
#import "HomeLiveLookRecordModel.h"
|
#import "HomeLiveLookRecordModel.h"
|
||||||
@@ -41,6 +42,9 @@ UIKIT_EXTERN NSString * kHomeMoreScrollPageKey;
|
|||||||
|
|
||||||
|
|
||||||
@interface XPHomeLivesViewController ()<JXCategoryViewDelegate, JXPagerViewDelegate, JXPagerMainTableViewGestureDelegate, XPHomeLiveProtocol, XPHomeLiveHeadViewDelegate>
|
@interface XPHomeLivesViewController ()<JXCategoryViewDelegate, JXPagerViewDelegate, JXPagerMainTableViewGestureDelegate, XPHomeLiveProtocol, XPHomeLiveHeadViewDelegate>
|
||||||
|
{
|
||||||
|
NSTimer * timer;
|
||||||
|
}
|
||||||
|
|
||||||
///分页标题
|
///分页标题
|
||||||
@property (nonatomic, strong) NSArray<NSString *> *titles;
|
@property (nonatomic, strong) NSArray<NSString *> *titles;
|
||||||
@@ -72,6 +76,7 @@ UIKIT_EXTERN NSString * kHomeMoreScrollPageKey;
|
|||||||
[super viewDidLoad];
|
[super viewDidLoad];
|
||||||
[self initHeaderAndFooterRrfresh];
|
[self initHeaderAndFooterRrfresh];
|
||||||
[self initSubViews];
|
[self initSubViews];
|
||||||
|
[self addTimer];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)viewDidLayoutSubviews {
|
- (void)viewDidLayoutSubviews {
|
||||||
@@ -79,9 +84,29 @@ UIKIT_EXTERN NSString * kHomeMoreScrollPageKey;
|
|||||||
self.pagingView.frame = self.view.bounds;
|
self.pagingView.frame = self.view.bounds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)viewWillAppear:(BOOL)animated {
|
||||||
|
[super viewWillAppear:animated];
|
||||||
|
if (timer) {
|
||||||
|
[timer setFireDate:[NSDate distantPast]]; //很远的过去
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)viewWillDisappear:(BOOL)animated {
|
||||||
|
[super viewWillDisappear:animated];
|
||||||
|
if (timer) {
|
||||||
|
//关闭定时器
|
||||||
|
[timer setFireDate:[NSDate distantFuture]]; //很远的将来
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)addTimer {
|
||||||
|
timer = [XPWeakTimer scheduledTimerWithTimeInterval:15 block:^(id userInfo) {
|
||||||
|
[self headerRefresh];
|
||||||
|
} userInfo:nil repeats:YES];
|
||||||
|
}
|
||||||
|
|
||||||
#pragma mark - InitHttp
|
#pragma mark - InitHttp
|
||||||
- (void)headerRefresh {
|
- (void)headerRefresh {
|
||||||
self.titleView.defaultSelectedIndex = 0;
|
|
||||||
[self.presenter getOnceLookRoom];
|
[self.presenter getOnceLookRoom];
|
||||||
[self.presenter getHomeLiveTagList];
|
[self.presenter getHomeLiveTagList];
|
||||||
}
|
}
|
||||||
@@ -93,7 +118,6 @@ UIKIT_EXTERN NSString * kHomeMoreScrollPageKey;
|
|||||||
header.stateLabel.textColor = [ThemeColor secondTextColor];
|
header.stateLabel.textColor = [ThemeColor secondTextColor];
|
||||||
header.lastUpdatedTimeLabel.textColor = [ThemeColor secondTextColor];
|
header.lastUpdatedTimeLabel.textColor = [ThemeColor secondTextColor];
|
||||||
self.pagingView.mainTableView.mj_header = header;
|
self.pagingView.mainTableView.mj_header = header;
|
||||||
[self headerRefresh];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Private Method
|
#pragma mark - Private Method
|
||||||
@@ -107,7 +131,6 @@ UIKIT_EXTERN NSString * kHomeMoreScrollPageKey;
|
|||||||
self.headerView.hadHistoryRecord = data.onceLookStatus;
|
self.headerView.hadHistoryRecord = data.onceLookStatus;
|
||||||
self.headerView.roomList = [NSMutableArray arrayWithArray:data.singleRoomList];
|
self.headerView.roomList = [NSMutableArray arrayWithArray:data.singleRoomList];
|
||||||
self.roomList = data.singleRoomList;
|
self.roomList = data.singleRoomList;
|
||||||
[self.pagingView reloadData];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)getHomeLiveTagListSuccess:(NSArray<HomeLiveTagModel *> *)array {
|
- (void)getHomeLiveTagListSuccess:(NSArray<HomeLiveTagModel *> *)array {
|
||||||
@@ -122,7 +145,6 @@ UIKIT_EXTERN NSString * kHomeMoreScrollPageKey;
|
|||||||
self.titleView.titles = self.titles;
|
self.titleView.titles = self.titles;
|
||||||
[self.titleView reloadData];
|
[self.titleView reloadData];
|
||||||
[self.pagingView.mainTableView.mj_header endRefreshing];
|
[self.pagingView.mainTableView.mj_header endRefreshing];
|
||||||
[self.pagingView reloadData];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)getHomeLiveTagListFail:(NSArray<HomeLiveTagModel *> *)array {
|
- (void)getHomeLiveTagListFail:(NSArray<HomeLiveTagModel *> *)array {
|
||||||
@@ -137,7 +159,6 @@ UIKIT_EXTERN NSString * kHomeMoreScrollPageKey;
|
|||||||
self.titleView.titles = self.titles;
|
self.titleView.titles = self.titles;
|
||||||
[self.titleView reloadData];
|
[self.titleView reloadData];
|
||||||
[self.pagingView.mainTableView.mj_header endRefreshing];
|
[self.pagingView.mainTableView.mj_header endRefreshing];
|
||||||
[self.pagingView reloadData];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - JXCategoryListContentViewDelegate
|
#pragma mark - JXCategoryListContentViewDelegate
|
||||||
@@ -167,23 +188,15 @@ UIKIT_EXTERN NSString * kHomeMoreScrollPageKey;
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (id<JXPagerViewListViewDelegate>)pagerView:(JXPagerView *)pagerView initListAtIndex:(NSInteger)index {
|
- (id<JXPagerViewListViewDelegate>)pagerView:(JXPagerView *)pagerView initListAtIndex:(NSInteger)index {
|
||||||
UIViewController *viewController;
|
|
||||||
XPHomeLivePageViewController * homeVC = [[XPHomeLivePageViewController alloc] init];
|
XPHomeLivePageViewController * homeVC = [[XPHomeLivePageViewController alloc] init];
|
||||||
HomeLiveTagModel *tag = self.tagList[index];
|
HomeLiveTagModel *tag = self.tagList[index];
|
||||||
homeVC.tabId = tag.tid;
|
homeVC.tabId = tag.tid;
|
||||||
return homeVC;
|
return homeVC;
|
||||||
return (id <JXPagerViewListViewDelegate>)viewController;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index {
|
- (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index {
|
||||||
HomeLiveTagModel *tag = self.tagList[index];
|
HomeLiveTagModel *tag = self.tagList[index];
|
||||||
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventGebo_tab_click eventAttributes:@{@"geboTagName" : tag.sortName}];
|
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventGebo_tab_click eventAttributes:@{@"geboTagName" : tag.sortName}];
|
||||||
// [self.presenter getHomeMoreAnchorRoomListWithTabId:tag.tid];
|
|
||||||
// if ([title isEqualToString:@"开黑畅聊"]) {
|
|
||||||
// [self.presenter getPlayGameWithTeam:1];
|
|
||||||
// } else {
|
|
||||||
// [self.presenter getHomePersonalRoomList];
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - JXPagerMainTableViewGestureDelegate
|
#pragma mark - JXPagerMainTableViewGestureDelegate
|
||||||
|
@@ -44,7 +44,6 @@ UIKIT_EXTERN NSString *kHomeMoreScrollPageKey;
|
|||||||
@property (nonatomic,strong) XPHomeRecommendViewController *recommendVC;
|
@property (nonatomic,strong) XPHomeRecommendViewController *recommendVC;
|
||||||
@property (nonatomic,strong) XPHomePartyContainerViewController *partyVC;
|
@property (nonatomic,strong) XPHomePartyContainerViewController *partyVC;
|
||||||
///个播房的
|
///个播房的
|
||||||
//@property (nonatomic,strong) XPHomePartyViewController *anchorRoomListVC;
|
|
||||||
@property (nonatomic, strong) XPHomeLivesViewController *anchorRoomListVC;
|
@property (nonatomic, strong) XPHomeLivesViewController *anchorRoomListVC;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
Reference in New Issue
Block a user