Commit bf3232cb4df4863a965b820c3d00201152327d9c
1 parent
366c0b8f
请求点播列表数据
Showing
7 changed files
with
116 additions
and
24 deletions
LiveVideoCloud.xcodeproj/project.pbxproj
| ... | ... | @@ -271,6 +271,8 @@ |
| 271 | 271 | D2B7B2571E8261EF00ED084E /* ChatBarrOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = D2B7B2561E8261EF00ED084E /* ChatBarrOperation.m */; }; |
| 272 | 272 | D2CBC13B1ECC157A00E00279 /* LVCVerifyLiveAuthService.m in Sources */ = {isa = PBXBuildFile; fileRef = D2CBC13A1ECC157A00E00279 /* LVCVerifyLiveAuthService.m */; }; |
| 273 | 273 | D2D7D18D1E8A581000217771 /* timg.jpeg in Resources */ = {isa = PBXBuildFile; fileRef = D2D7D18C1E8A581000217771 /* timg.jpeg */; }; |
| 274 | + D2EBC8571F01FF9200F198FB /* LVCCommentModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D2EBC8561F01FF9200F198FB /* LVCCommentModel.m */; }; | |
| 275 | + D2EBC85A1F02011400F198FB /* LVCVodPlayerTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D2EBC8591F02011400F198FB /* LVCVodPlayerTableViewCell.m */; }; | |
| 274 | 276 | D2F0486A1EE54E860011E39C /* LVCLiveActivityInfoService.m in Sources */ = {isa = PBXBuildFile; fileRef = D2F048691EE54E860011E39C /* LVCLiveActivityInfoService.m */; }; |
| 275 | 277 | /* End PBXBuildFile section */ |
| 276 | 278 | |
| ... | ... | @@ -842,6 +844,10 @@ |
| 842 | 844 | D2CBC1391ECC157A00E00279 /* LVCVerifyLiveAuthService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LVCVerifyLiveAuthService.h; path = ../LVCVerifyLiveAuthService.h; sourceTree = "<group>"; }; |
| 843 | 845 | D2CBC13A1ECC157A00E00279 /* LVCVerifyLiveAuthService.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = LVCVerifyLiveAuthService.m; path = ../LVCVerifyLiveAuthService.m; sourceTree = "<group>"; }; |
| 844 | 846 | D2D7D18C1E8A581000217771 /* timg.jpeg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = timg.jpeg; sourceTree = "<group>"; }; |
| 847 | + D2EBC8551F01FF9200F198FB /* LVCCommentModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCCommentModel.h; sourceTree = "<group>"; }; | |
| 848 | + D2EBC8561F01FF9200F198FB /* LVCCommentModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCCommentModel.m; sourceTree = "<group>"; }; | |
| 849 | + D2EBC8581F02011400F198FB /* LVCVodPlayerTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCVodPlayerTableViewCell.h; sourceTree = "<group>"; }; | |
| 850 | + D2EBC8591F02011400F198FB /* LVCVodPlayerTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCVodPlayerTableViewCell.m; sourceTree = "<group>"; }; | |
| 845 | 851 | D2F048681EE54E860011E39C /* LVCLiveActivityInfoService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCLiveActivityInfoService.h; sourceTree = "<group>"; }; |
| 846 | 852 | D2F048691EE54E860011E39C /* LVCLiveActivityInfoService.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCLiveActivityInfoService.m; sourceTree = "<group>"; }; |
| 847 | 853 | /* End PBXFileReference section */ |
| ... | ... | @@ -1166,6 +1172,8 @@ |
| 1166 | 1172 | D2A089F01E8A41120071412C /* LVCUGCLiveListModel.m */, |
| 1167 | 1173 | D2A089E91E8A09CB0071412C /* LVCUGCLivePlayerModel.h */, |
| 1168 | 1174 | D2A089EA1E8A09CB0071412C /* LVCUGCLivePlayerModel.m */, |
| 1175 | + D2EBC8551F01FF9200F198FB /* LVCCommentModel.h */, | |
| 1176 | + D2EBC8561F01FF9200F198FB /* LVCCommentModel.m */, | |
| 1169 | 1177 | ); |
| 1170 | 1178 | path = Model; |
| 1171 | 1179 | sourceTree = "<group>"; |
| ... | ... | @@ -2148,6 +2156,8 @@ |
| 2148 | 2156 | D28F5FFE1E8BC7EF00914142 /* LVCUGCLiveListView.m */, |
| 2149 | 2157 | D219E86C1F01002400650F38 /* LVCVodPlayerListView.h */, |
| 2150 | 2158 | D219E86D1F01002400650F38 /* LVCVodPlayerListView.m */, |
| 2159 | + D2EBC8581F02011400F198FB /* LVCVodPlayerTableViewCell.h */, | |
| 2160 | + D2EBC8591F02011400F198FB /* LVCVodPlayerTableViewCell.m */, | |
| 2151 | 2161 | D2A089E61E89FA720071412C /* LVCUGCLivePlayerCell.h */, |
| 2152 | 2162 | D2A089E71E89FA720071412C /* LVCUGCLivePlayerCell.m */, |
| 2153 | 2163 | D25BF8811E7F775F007FB138 /* LVCUGCPlayerLoadingView.h */, |
| ... | ... | @@ -2350,6 +2360,7 @@ |
| 2350 | 2360 | D2029C9C1E6EADE10027CD92 /* MJPropertyType.m in Sources */, |
| 2351 | 2361 | 81A4830E1E88B8300097A80A /* LVCChannelsModel.m in Sources */, |
| 2352 | 2362 | D22831091E77D8D500627701 /* GiftModel.m in Sources */, |
| 2363 | + D2EBC85A1F02011400F198FB /* LVCVodPlayerTableViewCell.m in Sources */, | |
| 2353 | 2364 | D23BBDBE1EF8ED4A002FE0B8 /* LVCChannelDetailModel.m in Sources */, |
| 2354 | 2365 | D2029CCD1E6EADE10027CD92 /* SearchModel.m in Sources */, |
| 2355 | 2366 | 4BD8560F1EBACEF80082061D /* CNLiveWebView.m in Sources */, |
| ... | ... | @@ -2421,6 +2432,7 @@ |
| 2421 | 2432 | 4BD856181EBAD35C0082061D /* NSDictionary+Safety.m in Sources */, |
| 2422 | 2433 | 4BD856011EBACD530082061D /* AFURLResponseSerialization.m in Sources */, |
| 2423 | 2434 | D2575C4A1E7685DE00E3A8FC /* UIView+Bubbling.m in Sources */, |
| 2435 | + D2EBC8571F01FF9200F198FB /* LVCCommentModel.m in Sources */, | |
| 2424 | 2436 | D23BBDB81EF8D15D002FE0B8 /* LVCMainHeaderCollectionReusableView.m in Sources */, |
| 2425 | 2437 | D2029CA61E6EADE10027CD92 /* MJRefreshHeader.m in Sources */, |
| 2426 | 2438 | D2029CC41E6EADE10027CD92 /* UIImageView+WebCache.m in Sources */, | ... | ... |
LiveVideoCloud/Classes/Sections/homeSections/Model/LVCCommentModel.h
0 → 100644
| 1 | +// | |
| 2 | +// LVCCommentModel.h | |
| 3 | +// LiveVideoCloud | |
| 4 | +// | |
| 5 | +// Created by cnliveJunBo on 17/6/27. | |
| 6 | +// Copyright © 2017年 cnlive. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import "BaseModel.h" | |
| 10 | + | |
| 11 | +@interface LVCCommentModel : BaseModel | |
| 12 | + | |
| 13 | +@property (nonatomic, strong)NSString *content; | |
| 14 | +@property (nonatomic, strong)NSString *uid; | |
| 15 | +@property (nonatomic, strong)NSString *facepath; | |
| 16 | +@property (nonatomic, strong)NSString *nick; | |
| 17 | + | |
| 18 | +@end | ... | ... |
LiveVideoCloud/Classes/Sections/homeSections/Model/LVCCommentModel.m
0 → 100644
LiveVideoCloud/Classes/Sections/homeSections/View/LVCVodPlayerListView.m
| ... | ... | @@ -7,10 +7,14 @@ |
| 7 | 7 | // |
| 8 | 8 | |
| 9 | 9 | #import "LVCVodPlayerListView.h" |
| 10 | +#import "LVCVodPlayerTableViewCell.h" | |
| 11 | + | |
| 12 | +static NSString *vodCellId = @"vodCellId"; | |
| 10 | 13 | |
| 11 | 14 | @interface LVCVodPlayerListView()<UITableViewDelegate, UITableViewDataSource> { |
| 12 | 15 | |
| 13 | 16 | AFHTTPRequestOperation *_operation; |
| 17 | + NSMutableArray *_programArrayM; | |
| 14 | 18 | } |
| 15 | 19 | |
| 16 | 20 | @property (nonatomic, strong)UITableView *tableView; |
| ... | ... | @@ -23,7 +27,8 @@ |
| 23 | 27 | { |
| 24 | 28 | self = [super initWithFrame:frame]; |
| 25 | 29 | if (self) { |
| 26 | - self.backgroundColor = [UIColor orangeColor]; | |
| 30 | + self.backgroundColor = [UIColor whiteColor]; | |
| 31 | + _programArrayM = [[NSMutableArray alloc] init]; | |
| 27 | 32 | [self requestVodPlayerList]; |
| 28 | 33 | } |
| 29 | 34 | return self; |
| ... | ... | @@ -39,7 +44,7 @@ |
| 39 | 44 | } |
| 40 | 45 | NSString *tm = [NSString stringWithFormat:@"%u_%@", arc4random()%10, uid]; |
| 41 | 46 | |
| 42 | - NSDictionary *parameter = @{@"cid": @"news", | |
| 47 | + NSDictionary *parameter = @{@"cid": @"82_news/", | |
| 43 | 48 | @"page": [NSString stringWithFormat:@"%d", 1], |
| 44 | 49 | @"pagesize": @"15", |
| 45 | 50 | @"tm": tm}; |
| ... | ... | @@ -47,34 +52,41 @@ |
| 47 | 52 | [[AFHTTPRequestOperationManager manager] GET:Newslist parameters:[self addParameters:parameter] success:^(AFHTTPRequestOperation *operation, id responseObject) { |
| 48 | 53 | |
| 49 | 54 | responseObject = [responseObject validatedDictionary]; |
| 50 | - NSLog(@"%@",responseObject); | |
| 51 | 55 | |
| 52 | - } failure:^(AFHTTPRequestOperation *operation, NSError *error) { | |
| 56 | + if (responseObject[@"programs"] && [responseObject[@"programs"] isKindOfClass:[NSArray class]]) { | |
| 57 | + | |
| 58 | + for (NSDictionary *dic in responseObject[@"programs"]) { | |
| 59 | + ProgramModel *programModel = [ProgramModel modelWithDic:dic]; | |
| 60 | + [_programArrayM addObject:programModel]; | |
| 61 | + if (dic[@"comments"] && [dic[@"comments"] isKindOfClass:[NSArray class]] && [dic[@"comments"] count] > 0) { | |
| 62 | + NSMutableArray *comments = [[NSMutableArray alloc] init]; | |
| 63 | + for (NSDictionary *commentDic in dic[@"comments"]) { | |
| 64 | + LVCCommentModel *commentModel = [LVCCommentModel modelWithDic:commentDic]; | |
| 65 | + [comments addObject:commentModel]; | |
| 66 | + } | |
| 67 | + [_programArrayM addObject:comments]; | |
| 68 | + } | |
| 69 | + } | |
| 70 | + } | |
| 71 | + [self.tableView reloadData]; | |
| 53 | 72 | |
| 73 | + } failure:^(AFHTTPRequestOperation *operation, NSError *error) { | |
| 54 | 74 | |
| 75 | + NSLog(@"点播列表请求失败!"); | |
| 55 | 76 | }]; |
| 56 | 77 | } |
| 57 | 78 | |
| 58 | -//- (void)requestVideoInfoWithMediaId:(NSString *)mediaId { | |
| 59 | -// | |
| 60 | -// [_operation cancel]; | |
| 61 | -// _operation = nil; | |
| 62 | -// NSString *urlString = [NSString stringWithFormat:@"%@%@/%@/%@.json",@"http://data.cnlive.com/epg/",[mediaId substringToIndex:2],[mediaId substringFromIndex:mediaId.length - 2],mediaId]; | |
| 63 | -// _operation = [[AFHTTPRequestOperationManager manager] GET:urlString parameters:[NSDictionary CommonParameters] success:^(AFHTTPRequestOperation *operation, id responseObject) { | |
| 64 | -// | |
| 65 | -// responseObject = [responseObject validatedDictionary]; | |
| 66 | -// | |
| 67 | -// | |
| 68 | -// | |
| 69 | -// } failure:^(AFHTTPRequestOperation *operation, NSError *error) { | |
| 70 | -// | |
| 71 | -// NSLog(@"%@",error); | |
| 72 | -// }]; | |
| 73 | -//} | |
| 74 | - | |
| 75 | 79 | #pragma mark - UITableViewDelegate !!!!!!!!!!!!!!!!!!!!!!!! |
| 76 | 80 | |
| 77 | 81 | #pragma mark - UITableViewDataSource !!!!!!!!!!!!!!!!!!!!!!!! |
| 82 | +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { | |
| 83 | + return _programArrayM.count; | |
| 84 | +} | |
| 85 | + | |
| 86 | +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { | |
| 87 | + | |
| 88 | + return nil; | |
| 89 | +} | |
| 78 | 90 | |
| 79 | 91 | #pragma mark - GetMethod !!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 80 | 92 | - (UITableView *)tableView { |
| ... | ... | @@ -88,9 +100,8 @@ |
| 88 | 100 | UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, -KScreenHeight, KScreenWidth, KScreenHeight)]; |
| 89 | 101 | view.backgroundColor = [UIColor backgroundColor]; |
| 90 | 102 | [_tableView addSubview:view]; |
| 91 | - | |
| 92 | -// _tableView.header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(refresh)]; | |
| 93 | -// _tableView.footer = [MJRefreshAutoNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(loadMore)]; | |
| 103 | + | |
| 104 | + [_tableView registerClass:[LVCVodPlayerTableViewCell class] forCellReuseIdentifier:vodCellId]; | |
| 94 | 105 | } |
| 95 | 106 | return _tableView; |
| 96 | 107 | } | ... | ... |
LiveVideoCloud/Classes/Sections/homeSections/View/LVCVodPlayerTableViewCell.h
0 → 100644
LiveVideoCloud/Classes/Sections/homeSections/View/LVCVodPlayerTableViewCell.m
0 → 100644
| 1 | +// | |
| 2 | +// LVCVodPlayerTableViewCell.m | |
| 3 | +// LiveVideoCloud | |
| 4 | +// | |
| 5 | +// Created by cnliveJunBo on 17/6/27. | |
| 6 | +// Copyright © 2017年 cnlive. All rights reserved. | |
| 7 | +// | |
| 8 | + | |
| 9 | +#import "LVCVodPlayerTableViewCell.h" | |
| 10 | + | |
| 11 | +@implementation LVCVodPlayerTableViewCell | |
| 12 | + | |
| 13 | +- (void)awakeFromNib { | |
| 14 | + [super awakeFromNib]; | |
| 15 | + // Initialization code | |
| 16 | +} | |
| 17 | + | |
| 18 | +- (void)setSelected:(BOOL)selected animated:(BOOL)animated { | |
| 19 | + [super setSelected:selected animated:animated]; | |
| 20 | + | |
| 21 | + // Configure the view for the selected state | |
| 22 | +} | |
| 23 | + | |
| 24 | +@end | ... | ... |
LiveVideoCloud/PrefixHeader.pch