Commit bf3232cb4df4863a965b820c3d00201152327d9c

Authored by 王军波
1 parent 366c0b8f

请求点播列表数据

LiveVideoCloud.xcodeproj/project.pbxproj
@@ -271,6 +271,8 @@ @@ -271,6 +271,8 @@
271 D2B7B2571E8261EF00ED084E /* ChatBarrOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = D2B7B2561E8261EF00ED084E /* ChatBarrOperation.m */; }; 271 D2B7B2571E8261EF00ED084E /* ChatBarrOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = D2B7B2561E8261EF00ED084E /* ChatBarrOperation.m */; };
272 D2CBC13B1ECC157A00E00279 /* LVCVerifyLiveAuthService.m in Sources */ = {isa = PBXBuildFile; fileRef = D2CBC13A1ECC157A00E00279 /* LVCVerifyLiveAuthService.m */; }; 272 D2CBC13B1ECC157A00E00279 /* LVCVerifyLiveAuthService.m in Sources */ = {isa = PBXBuildFile; fileRef = D2CBC13A1ECC157A00E00279 /* LVCVerifyLiveAuthService.m */; };
273 D2D7D18D1E8A581000217771 /* timg.jpeg in Resources */ = {isa = PBXBuildFile; fileRef = D2D7D18C1E8A581000217771 /* timg.jpeg */; }; 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 D2F0486A1EE54E860011E39C /* LVCLiveActivityInfoService.m in Sources */ = {isa = PBXBuildFile; fileRef = D2F048691EE54E860011E39C /* LVCLiveActivityInfoService.m */; }; 276 D2F0486A1EE54E860011E39C /* LVCLiveActivityInfoService.m in Sources */ = {isa = PBXBuildFile; fileRef = D2F048691EE54E860011E39C /* LVCLiveActivityInfoService.m */; };
275 /* End PBXBuildFile section */ 277 /* End PBXBuildFile section */
276 278
@@ -842,6 +844,10 @@ @@ -842,6 +844,10 @@
842 D2CBC1391ECC157A00E00279 /* LVCVerifyLiveAuthService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LVCVerifyLiveAuthService.h; path = ../LVCVerifyLiveAuthService.h; sourceTree = "<group>"; }; 844 D2CBC1391ECC157A00E00279 /* LVCVerifyLiveAuthService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LVCVerifyLiveAuthService.h; path = ../LVCVerifyLiveAuthService.h; sourceTree = "<group>"; };
843 D2CBC13A1ECC157A00E00279 /* LVCVerifyLiveAuthService.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = LVCVerifyLiveAuthService.m; path = ../LVCVerifyLiveAuthService.m; sourceTree = "<group>"; }; 845 D2CBC13A1ECC157A00E00279 /* LVCVerifyLiveAuthService.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = LVCVerifyLiveAuthService.m; path = ../LVCVerifyLiveAuthService.m; sourceTree = "<group>"; };
844 D2D7D18C1E8A581000217771 /* timg.jpeg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = timg.jpeg; sourceTree = "<group>"; }; 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 D2F048681EE54E860011E39C /* LVCLiveActivityInfoService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCLiveActivityInfoService.h; sourceTree = "<group>"; }; 851 D2F048681EE54E860011E39C /* LVCLiveActivityInfoService.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCLiveActivityInfoService.h; sourceTree = "<group>"; };
846 D2F048691EE54E860011E39C /* LVCLiveActivityInfoService.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCLiveActivityInfoService.m; sourceTree = "<group>"; }; 852 D2F048691EE54E860011E39C /* LVCLiveActivityInfoService.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCLiveActivityInfoService.m; sourceTree = "<group>"; };
847 /* End PBXFileReference section */ 853 /* End PBXFileReference section */
@@ -1166,6 +1172,8 @@ @@ -1166,6 +1172,8 @@
1166 D2A089F01E8A41120071412C /* LVCUGCLiveListModel.m */, 1172 D2A089F01E8A41120071412C /* LVCUGCLiveListModel.m */,
1167 D2A089E91E8A09CB0071412C /* LVCUGCLivePlayerModel.h */, 1173 D2A089E91E8A09CB0071412C /* LVCUGCLivePlayerModel.h */,
1168 D2A089EA1E8A09CB0071412C /* LVCUGCLivePlayerModel.m */, 1174 D2A089EA1E8A09CB0071412C /* LVCUGCLivePlayerModel.m */,
  1175 + D2EBC8551F01FF9200F198FB /* LVCCommentModel.h */,
  1176 + D2EBC8561F01FF9200F198FB /* LVCCommentModel.m */,
1169 ); 1177 );
1170 path = Model; 1178 path = Model;
1171 sourceTree = "<group>"; 1179 sourceTree = "<group>";
@@ -2148,6 +2156,8 @@ @@ -2148,6 +2156,8 @@
2148 D28F5FFE1E8BC7EF00914142 /* LVCUGCLiveListView.m */, 2156 D28F5FFE1E8BC7EF00914142 /* LVCUGCLiveListView.m */,
2149 D219E86C1F01002400650F38 /* LVCVodPlayerListView.h */, 2157 D219E86C1F01002400650F38 /* LVCVodPlayerListView.h */,
2150 D219E86D1F01002400650F38 /* LVCVodPlayerListView.m */, 2158 D219E86D1F01002400650F38 /* LVCVodPlayerListView.m */,
  2159 + D2EBC8581F02011400F198FB /* LVCVodPlayerTableViewCell.h */,
  2160 + D2EBC8591F02011400F198FB /* LVCVodPlayerTableViewCell.m */,
2151 D2A089E61E89FA720071412C /* LVCUGCLivePlayerCell.h */, 2161 D2A089E61E89FA720071412C /* LVCUGCLivePlayerCell.h */,
2152 D2A089E71E89FA720071412C /* LVCUGCLivePlayerCell.m */, 2162 D2A089E71E89FA720071412C /* LVCUGCLivePlayerCell.m */,
2153 D25BF8811E7F775F007FB138 /* LVCUGCPlayerLoadingView.h */, 2163 D25BF8811E7F775F007FB138 /* LVCUGCPlayerLoadingView.h */,
@@ -2350,6 +2360,7 @@ @@ -2350,6 +2360,7 @@
2350 D2029C9C1E6EADE10027CD92 /* MJPropertyType.m in Sources */, 2360 D2029C9C1E6EADE10027CD92 /* MJPropertyType.m in Sources */,
2351 81A4830E1E88B8300097A80A /* LVCChannelsModel.m in Sources */, 2361 81A4830E1E88B8300097A80A /* LVCChannelsModel.m in Sources */,
2352 D22831091E77D8D500627701 /* GiftModel.m in Sources */, 2362 D22831091E77D8D500627701 /* GiftModel.m in Sources */,
  2363 + D2EBC85A1F02011400F198FB /* LVCVodPlayerTableViewCell.m in Sources */,
2353 D23BBDBE1EF8ED4A002FE0B8 /* LVCChannelDetailModel.m in Sources */, 2364 D23BBDBE1EF8ED4A002FE0B8 /* LVCChannelDetailModel.m in Sources */,
2354 D2029CCD1E6EADE10027CD92 /* SearchModel.m in Sources */, 2365 D2029CCD1E6EADE10027CD92 /* SearchModel.m in Sources */,
2355 4BD8560F1EBACEF80082061D /* CNLiveWebView.m in Sources */, 2366 4BD8560F1EBACEF80082061D /* CNLiveWebView.m in Sources */,
@@ -2421,6 +2432,7 @@ @@ -2421,6 +2432,7 @@
2421 4BD856181EBAD35C0082061D /* NSDictionary+Safety.m in Sources */, 2432 4BD856181EBAD35C0082061D /* NSDictionary+Safety.m in Sources */,
2422 4BD856011EBACD530082061D /* AFURLResponseSerialization.m in Sources */, 2433 4BD856011EBACD530082061D /* AFURLResponseSerialization.m in Sources */,
2423 D2575C4A1E7685DE00E3A8FC /* UIView+Bubbling.m in Sources */, 2434 D2575C4A1E7685DE00E3A8FC /* UIView+Bubbling.m in Sources */,
  2435 + D2EBC8571F01FF9200F198FB /* LVCCommentModel.m in Sources */,
2424 D23BBDB81EF8D15D002FE0B8 /* LVCMainHeaderCollectionReusableView.m in Sources */, 2436 D23BBDB81EF8D15D002FE0B8 /* LVCMainHeaderCollectionReusableView.m in Sources */,
2425 D2029CA61E6EADE10027CD92 /* MJRefreshHeader.m in Sources */, 2437 D2029CA61E6EADE10027CD92 /* MJRefreshHeader.m in Sources */,
2426 D2029CC41E6EADE10027CD92 /* UIImageView+WebCache.m in Sources */, 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
  1 +//
  2 +// LVCCommentModel.m
  3 +// LiveVideoCloud
  4 +//
  5 +// Created by cnliveJunBo on 17/6/27.
  6 +// Copyright © 2017年 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import "LVCCommentModel.h"
  10 +
  11 +@implementation LVCCommentModel
  12 +
  13 +@end
LiveVideoCloud/Classes/Sections/homeSections/View/LVCVodPlayerListView.m
@@ -7,10 +7,14 @@ @@ -7,10 +7,14 @@
7 // 7 //
8 8
9 #import "LVCVodPlayerListView.h" 9 #import "LVCVodPlayerListView.h"
  10 +#import "LVCVodPlayerTableViewCell.h"
  11 +
  12 +static NSString *vodCellId = @"vodCellId";
10 13
11 @interface LVCVodPlayerListView()<UITableViewDelegate, UITableViewDataSource> { 14 @interface LVCVodPlayerListView()<UITableViewDelegate, UITableViewDataSource> {
12 15
13 AFHTTPRequestOperation *_operation; 16 AFHTTPRequestOperation *_operation;
  17 + NSMutableArray *_programArrayM;
14 } 18 }
15 19
16 @property (nonatomic, strong)UITableView *tableView; 20 @property (nonatomic, strong)UITableView *tableView;
@@ -23,7 +27,8 @@ @@ -23,7 +27,8 @@
23 { 27 {
24 self = [super initWithFrame:frame]; 28 self = [super initWithFrame:frame];
25 if (self) { 29 if (self) {
26 - self.backgroundColor = [UIColor orangeColor]; 30 + self.backgroundColor = [UIColor whiteColor];
  31 + _programArrayM = [[NSMutableArray alloc] init];
27 [self requestVodPlayerList]; 32 [self requestVodPlayerList];
28 } 33 }
29 return self; 34 return self;
@@ -39,7 +44,7 @@ @@ -39,7 +44,7 @@
39 } 44 }
40 NSString *tm = [NSString stringWithFormat:@"%u_%@", arc4random()%10, uid]; 45 NSString *tm = [NSString stringWithFormat:@"%u_%@", arc4random()%10, uid];
41 46
42 - NSDictionary *parameter = @{@"cid": @"news", 47 + NSDictionary *parameter = @{@"cid": @"82_news/",
43 @"page": [NSString stringWithFormat:@"%d", 1], 48 @"page": [NSString stringWithFormat:@"%d", 1],
44 @"pagesize": @"15", 49 @"pagesize": @"15",
45 @"tm": tm}; 50 @"tm": tm};
@@ -47,34 +52,41 @@ @@ -47,34 +52,41 @@
47 [[AFHTTPRequestOperationManager manager] GET:Newslist parameters:[self addParameters:parameter] success:^(AFHTTPRequestOperation *operation, id responseObject) { 52 [[AFHTTPRequestOperationManager manager] GET:Newslist parameters:[self addParameters:parameter] success:^(AFHTTPRequestOperation *operation, id responseObject) {
48 53
49 responseObject = [responseObject validatedDictionary]; 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 #pragma mark - UITableViewDelegate !!!!!!!!!!!!!!!!!!!!!!!! 79 #pragma mark - UITableViewDelegate !!!!!!!!!!!!!!!!!!!!!!!!
76 80
77 #pragma mark - UITableViewDataSource !!!!!!!!!!!!!!!!!!!!!!!! 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 #pragma mark - GetMethod !!!!!!!!!!!!!!!!!!!!!!!!!!!! 91 #pragma mark - GetMethod !!!!!!!!!!!!!!!!!!!!!!!!!!!!
80 - (UITableView *)tableView { 92 - (UITableView *)tableView {
@@ -88,9 +100,8 @@ @@ -88,9 +100,8 @@
88 UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, -KScreenHeight, KScreenWidth, KScreenHeight)]; 100 UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, -KScreenHeight, KScreenWidth, KScreenHeight)];
89 view.backgroundColor = [UIColor backgroundColor]; 101 view.backgroundColor = [UIColor backgroundColor];
90 [_tableView addSubview:view]; 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 return _tableView; 106 return _tableView;
96 } 107 }
LiveVideoCloud/Classes/Sections/homeSections/View/LVCVodPlayerTableViewCell.h 0 → 100644
  1 +//
  2 +// LVCVodPlayerTableViewCell.h
  3 +// LiveVideoCloud
  4 +//
  5 +// Created by cnliveJunBo on 17/6/27.
  6 +// Copyright © 2017年 cnlive. All rights reserved.
  7 +//
  8 +
  9 +#import <UIKit/UIKit.h>
  10 +
  11 +@interface LVCVodPlayerTableViewCell : UITableViewCell
  12 +
  13 +@end
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
@@ -35,6 +35,7 @@ @@ -35,6 +35,7 @@
35 #import "LVCBannerAndMarqueeModel.h" 35 #import "LVCBannerAndMarqueeModel.h"
36 #include "LVCChannelDetailModel.h" 36 #include "LVCChannelDetailModel.h"
37 #import "LVCBqWqXgModel.h" 37 #import "LVCBqWqXgModel.h"
  38 +#import "LVCCommentModel.h"
38 39
39 #import <CNLiveUserSystemSDK/CNLiveUserSystemCenter.h> 40 #import <CNLiveUserSystemSDK/CNLiveUserSystemCenter.h>
40 41