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