Commit 93d0c87d0b4fbe8b58deadc9091f68eb555b8708
1 parent
1538f1cb
刷新
Showing
4 changed files
with
20 additions
and
23 deletions
LiveVideoCloud/LiveVideoCloud.xcodeproj/project.pbxproj
| @@ -210,6 +210,8 @@ | @@ -210,6 +210,8 @@ | ||
| 210 | D2D236B41E88F8E600B7C517 /* CNLiveChatManager.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D2D236B21E88F8E600B7C517 /* CNLiveChatManager.framework */; }; | 210 | D2D236B41E88F8E600B7C517 /* CNLiveChatManager.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D2D236B21E88F8E600B7C517 /* CNLiveChatManager.framework */; }; |
| 211 | D2D236B51E88F8E600B7C517 /* CNLiveMsgTools.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D2D236B31E88F8E600B7C517 /* CNLiveMsgTools.framework */; }; | 211 | D2D236B51E88F8E600B7C517 /* CNLiveMsgTools.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D2D236B31E88F8E600B7C517 /* CNLiveMsgTools.framework */; }; |
| 212 | D2D7D18D1E8A581000217771 /* timg.jpeg in Resources */ = {isa = PBXBuildFile; fileRef = D2D7D18C1E8A581000217771 /* timg.jpeg */; }; | 212 | D2D7D18D1E8A581000217771 /* timg.jpeg in Resources */ = {isa = PBXBuildFile; fileRef = D2D7D18C1E8A581000217771 /* timg.jpeg */; }; |
| 213 | + D2F69E8C1E8E5DBF00BA0CE6 /* 纯白.jpeg in Resources */ = {isa = PBXBuildFile; fileRef = D2F69E8B1E8E5DBF00BA0CE6 /* 纯白.jpeg */; }; | ||
| 214 | + D2F69E8E1E8E635500BA0CE6 /* 透明.jpeg in Resources */ = {isa = PBXBuildFile; fileRef = D2F69E8D1E8E635500BA0CE6 /* 透明.jpeg */; }; | ||
| 213 | /* End PBXBuildFile section */ | 215 | /* End PBXBuildFile section */ |
| 214 | 216 | ||
| 215 | /* Begin PBXContainerItemProxy section */ | 217 | /* Begin PBXContainerItemProxy section */ |
| @@ -655,6 +657,8 @@ | @@ -655,6 +657,8 @@ | ||
| 655 | D2D236B21E88F8E600B7C517 /* CNLiveChatManager.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = CNLiveChatManager.framework; sourceTree = "<group>"; }; | 657 | D2D236B21E88F8E600B7C517 /* CNLiveChatManager.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = CNLiveChatManager.framework; sourceTree = "<group>"; }; |
| 656 | D2D236B31E88F8E600B7C517 /* CNLiveMsgTools.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = CNLiveMsgTools.framework; sourceTree = "<group>"; }; | 658 | D2D236B31E88F8E600B7C517 /* CNLiveMsgTools.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = CNLiveMsgTools.framework; sourceTree = "<group>"; }; |
| 657 | D2D7D18C1E8A581000217771 /* timg.jpeg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = timg.jpeg; sourceTree = "<group>"; }; | 659 | D2D7D18C1E8A581000217771 /* timg.jpeg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = timg.jpeg; sourceTree = "<group>"; }; |
| 660 | + D2F69E8B1E8E5DBF00BA0CE6 /* 纯白.jpeg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "纯白.jpeg"; sourceTree = "<group>"; }; | ||
| 661 | + D2F69E8D1E8E635500BA0CE6 /* 透明.jpeg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "透明.jpeg"; sourceTree = "<group>"; }; | ||
| 658 | /* End PBXFileReference section */ | 662 | /* End PBXFileReference section */ |
| 659 | 663 | ||
| 660 | /* Begin PBXFrameworksBuildPhase section */ | 664 | /* Begin PBXFrameworksBuildPhase section */ |
| @@ -1608,6 +1612,8 @@ | @@ -1608,6 +1612,8 @@ | ||
| 1608 | D25BF88C1E7F7F77007FB138 /* Images */ = { | 1612 | D25BF88C1E7F7F77007FB138 /* Images */ = { |
| 1609 | isa = PBXGroup; | 1613 | isa = PBXGroup; |
| 1610 | children = ( | 1614 | children = ( |
| 1615 | + D2F69E8D1E8E635500BA0CE6 /* 透明.jpeg */, | ||
| 1616 | + D2F69E8B1E8E5DBF00BA0CE6 /* 纯白.jpeg */, | ||
| 1611 | D2D7D18C1E8A581000217771 /* timg.jpeg */, | 1617 | D2D7D18C1E8A581000217771 /* timg.jpeg */, |
| 1612 | D25BF88F1E7F7F8F007FB138 /* UGCLoading.jpeg */, | 1618 | D25BF88F1E7F7F8F007FB138 /* UGCLoading.jpeg */, |
| 1613 | D25BF8A41E80EC76007FB138 /* 头像.jpg */, | 1619 | D25BF8A41E80EC76007FB138 /* 头像.jpg */, |
| @@ -1888,6 +1894,7 @@ | @@ -1888,6 +1894,7 @@ | ||
| 1888 | isa = PBXResourcesBuildPhase; | 1894 | isa = PBXResourcesBuildPhase; |
| 1889 | buildActionMask = 2147483647; | 1895 | buildActionMask = 2147483647; |
| 1890 | files = ( | 1896 | files = ( |
| 1897 | + D2F69E8E1E8E635500BA0CE6 /* 透明.jpeg in Resources */, | ||
| 1891 | D2029C971E6EADE10027CD92 /* Info.plist in Resources */, | 1898 | D2029C971E6EADE10027CD92 /* Info.plist in Resources */, |
| 1892 | D2575C7F1E76A4F300E3A8FC /* NHPlaneViews.xib in Resources */, | 1899 | D2575C7F1E76A4F300E3A8FC /* NHPlaneViews.xib in Resources */, |
| 1893 | D2575C7B1E76A4F300E3A8FC /* NHCarViews.xib in Resources */, | 1900 | D2575C7B1E76A4F300E3A8FC /* NHCarViews.xib in Resources */, |
| @@ -1899,6 +1906,7 @@ | @@ -1899,6 +1906,7 @@ | ||
| 1899 | D2029B911E6EAAA50027CD92 /* animation.xcassets in Resources */, | 1906 | D2029B911E6EAAA50027CD92 /* animation.xcassets in Resources */, |
| 1900 | D2D7D18D1E8A581000217771 /* timg.jpeg in Resources */, | 1907 | D2D7D18D1E8A581000217771 /* timg.jpeg in Resources */, |
| 1901 | D2029CB01E6EADE10027CD92 /* MJRefresh.bundle in Resources */, | 1908 | D2029CB01E6EADE10027CD92 /* MJRefresh.bundle in Resources */, |
| 1909 | + D2F69E8C1E8E5DBF00BA0CE6 /* 纯白.jpeg in Resources */, | ||
| 1902 | D2575C7C1E76A4F300E3A8FC /* NHFighterView.nib in Resources */, | 1910 | D2575C7C1E76A4F300E3A8FC /* NHFighterView.nib in Resources */, |
| 1903 | D25BF87D1E7B8C78007FB138 /* KSYGPUResource.bundle in Resources */, | 1911 | D25BF87D1E7B8C78007FB138 /* KSYGPUResource.bundle in Resources */, |
| 1904 | ); | 1912 | ); |
LiveVideoCloud/LiveVideoCloud/Classes/Sections/homeSections/Controller/HomeViewController.m
| @@ -173,7 +173,6 @@ | @@ -173,7 +173,6 @@ | ||
| 173 | liveListView = [[LVCUGCLiveListView alloc] initWithFrame:CGRectMake(0, 64, SCREEN_WIDTH, SCREEN_HEIGHT - 114)]; | 173 | liveListView = [[LVCUGCLiveListView alloc] initWithFrame:CGRectMake(0, 64, SCREEN_WIDTH, SCREEN_HEIGHT - 114)]; |
| 174 | } else { | 174 | } else { |
| 175 | [liveListView isNeedToRefresh]; | 175 | [liveListView isNeedToRefresh]; |
| 176 | - [liveListView stopAutoRefresh]; | ||
| 177 | } | 176 | } |
| 178 | liveListView.scrollToTop = YES; | 177 | liveListView.scrollToTop = YES; |
| 179 | return liveListView; | 178 | return liveListView; |
LiveVideoCloud/LiveVideoCloud/Classes/Sections/homeSections/Controller/LVCUGCLiveListView.h
LiveVideoCloud/LiveVideoCloud/Classes/Sections/homeSections/Controller/LVCUGCLiveListView.m
| @@ -19,13 +19,13 @@ static NSString *cellId = @"cellId"; | @@ -19,13 +19,13 @@ static NSString *cellId = @"cellId"; | ||
| 19 | 19 | ||
| 20 | NSMutableArray *_arrayM; | 20 | NSMutableArray *_arrayM; |
| 21 | long long _timestamp; | 21 | long long _timestamp; |
| 22 | - NSTimer *_autoRefreshTimer; | ||
| 23 | - CGFloat _refreshTime; | ||
| 24 | } | 22 | } |
| 25 | 23 | ||
| 26 | @property (nonatomic, strong) UICollectionView *collectionView; | 24 | @property (nonatomic, strong) UICollectionView *collectionView; |
| 27 | 25 | ||
| 28 | - | 26 | +@property (nonatomic, strong)UIButton *reloadBtn; |
| 27 | +@property (nonatomic, strong)UIImageView *reloadImg; | ||
| 28 | +@property (nonatomic, strong)UILabel *reloadLab; | ||
| 29 | 29 | ||
| 30 | @end | 30 | @end |
| 31 | 31 | ||
| @@ -41,6 +41,7 @@ static NSString *cellId = @"cellId"; | @@ -41,6 +41,7 @@ static NSString *cellId = @"cellId"; | ||
| 41 | 41 | ||
| 42 | [self addSubview:self.collectionView]; | 42 | [self addSubview:self.collectionView]; |
| 43 | 43 | ||
| 44 | + _timestamp = [[self timestamp] longLongValue]; | ||
| 44 | [self.collectionView.header beginRefreshing]; | 45 | [self.collectionView.header beginRefreshing]; |
| 45 | } | 46 | } |
| 46 | return self; | 47 | return self; |
| @@ -51,20 +52,18 @@ static NSString *cellId = @"cellId"; | @@ -51,20 +52,18 @@ static NSString *cellId = @"cellId"; | ||
| 51 | [LiveLIstService getLiveListWithHandler:^(id data, NSError *error) { | 52 | [LiveLIstService getLiveListWithHandler:^(id data, NSError *error) { |
| 52 | 53 | ||
| 53 | if (error) { | 54 | if (error) { |
| 54 | - NSLog(@"error:%@",error); | 55 | + NSLog(@"失败===>error:%@",error); |
| 56 | + | ||
| 57 | + _timestamp = [[self timestamp] longLongValue]; | ||
| 55 | return ; | 58 | return ; |
| 56 | } | 59 | } |
| 57 | - NSLog(@"data%@",data); | 60 | + NSLog(@"成功===>data%@",data); |
| 58 | 61 | ||
| 59 | LVCUGCLiveListModel *model = [LVCUGCLiveListModel modelWithDic:data]; | 62 | LVCUGCLiveListModel *model = [LVCUGCLiveListModel modelWithDic:data]; |
| 60 | _arrayM = model.activityList.mutableCopy; | 63 | _arrayM = model.activityList.mutableCopy; |
| 61 | 64 | ||
| 62 | _timestamp = [[self timestamp] longLongValue]; | 65 | _timestamp = [[self timestamp] longLongValue]; |
| 63 | - if (_refreshTime != 0) { | ||
| 64 | - [_autoRefreshTimer invalidate]; | ||
| 65 | - _autoRefreshTimer = nil; | ||
| 66 | - _autoRefreshTimer = [NSTimer scheduledTimerWithTimeInterval:_refreshTime target:self selector:@selector(autoRefresh) userInfo:nil repeats:YES]; | ||
| 67 | - } | 66 | + |
| 68 | [self.collectionView.header endRefreshing]; | 67 | [self.collectionView.header endRefreshing]; |
| 69 | [self.collectionView reloadData]; | 68 | [self.collectionView reloadData]; |
| 70 | }]; | 69 | }]; |
| @@ -97,6 +96,9 @@ static NSString *cellId = @"cellId"; | @@ -97,6 +96,9 @@ static NSString *cellId = @"cellId"; | ||
| 97 | - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { | 96 | - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { |
| 98 | 97 | ||
| 99 | LVCUGCLivePlayerController *player = [[LVCUGCLivePlayerController alloc] init]; | 98 | LVCUGCLivePlayerController *player = [[LVCUGCLivePlayerController alloc] init]; |
| 99 | + player.index = indexPath.row; | ||
| 100 | + player.playArray = _arrayM; | ||
| 101 | + player.model = _arrayM[indexPath.row]; | ||
| 100 | [self.viewController.navigationController pushViewController:player animated:YES]; | 102 | [self.viewController.navigationController pushViewController:player animated:YES]; |
| 101 | } | 103 | } |
| 102 | 104 | ||
| @@ -143,23 +145,12 @@ static NSString *cellId = @"cellId"; | @@ -143,23 +145,12 @@ static NSString *cellId = @"cellId"; | ||
| 143 | 145 | ||
| 144 | - (void)isNeedToRefresh { | 146 | - (void)isNeedToRefresh { |
| 145 | 147 | ||
| 146 | - if (_refreshTime != 0) { | ||
| 147 | - [_autoRefreshTimer invalidate]; | ||
| 148 | - _autoRefreshTimer = nil; | ||
| 149 | - _autoRefreshTimer = [NSTimer scheduledTimerWithTimeInterval:_refreshTime target:self selector:@selector(autoRefresh) userInfo:nil repeats:YES]; | ||
| 150 | - } | ||
| 151 | long long timestamp = [[self timestamp] longLongValue]; | 148 | long long timestamp = [[self timestamp] longLongValue]; |
| 152 | if (timestamp-_timestamp > 180000) { | 149 | if (timestamp-_timestamp > 180000) { |
| 153 | [self.collectionView.header beginRefreshing]; | 150 | [self.collectionView.header beginRefreshing]; |
| 154 | } | 151 | } |
| 155 | } | 152 | } |
| 156 | 153 | ||
| 157 | -- (void)stopAutoRefresh { | ||
| 158 | - | ||
| 159 | - [_autoRefreshTimer invalidate]; | ||
| 160 | - _autoRefreshTimer = nil; | ||
| 161 | -} | ||
| 162 | - | ||
| 163 | - (void)setScrollToTop:(BOOL)scrollToTop { | 154 | - (void)setScrollToTop:(BOOL)scrollToTop { |
| 164 | 155 | ||
| 165 | _scrollToTop = scrollToTop; | 156 | _scrollToTop = scrollToTop; |