Commit a804643a5124261a5a39dfce93962019a1fee5aa

Authored by 王军波
1 parent a626ee2a

listVC替换为listView

LiveVideoCloud/LiveVideoCloud.xcodeproj/project.pbxproj
... ... @@ -188,6 +188,7 @@
188 188 D2888DB11E6EC05F003A77C8 /* TempViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D2888DB01E6EC05F003A77C8 /* TempViewController.m */; };
189 189 D2888DB41E6EC154003A77C8 /* HomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D2888DB31E6EC154003A77C8 /* HomeViewController.m */; };
190 190 D2888DB71E6EC1B8003A77C8 /* LVCMyViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D2888DB61E6EC1B8003A77C8 /* LVCMyViewController.m */; };
  191 + D28F5FFF1E8BC7EF00914142 /* LVCUGCLiveListView.m in Sources */ = {isa = PBXBuildFile; fileRef = D28F5FFE1E8BC7EF00914142 /* LVCUGCLiveListView.m */; };
191 192 D29D88481E88C53300543A03 /* LVCUGCLivePrepareView.m in Sources */ = {isa = PBXBuildFile; fileRef = D29D88471E88C53300543A03 /* LVCUGCLivePrepareView.m */; };
192 193 D29E81ED1E88DC5B008C9906 /* PriChatCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D29E81EC1E88DC5B008C9906 /* PriChatCell.m */; };
193 194 D2A089E81E89FA720071412C /* LVCUGCLivePlayerCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D2A089E71E89FA720071412C /* LVCUGCLivePlayerCell.m */; };
... ... @@ -203,7 +204,6 @@
203 204 D2B7B2511E8247D400ED084E /* ChatBarrageManager.m in Sources */ = {isa = PBXBuildFile; fileRef = D2B7B2501E8247D400ED084E /* ChatBarrageManager.m */; };
204 205 D2B7B2541E824B2D00ED084E /* ChatBarrageView.m in Sources */ = {isa = PBXBuildFile; fileRef = D2B7B2531E824B2D00ED084E /* ChatBarrageView.m */; };
205 206 D2B7B2571E8261EF00ED084E /* ChatBarrOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = D2B7B2561E8261EF00ED084E /* ChatBarrOperation.m */; };
206   - D2CC7B871E891AA50034B8BF /* LVCUGCLiveListController.m in Sources */ = {isa = PBXBuildFile; fileRef = D2CC7B861E891AA50034B8BF /* LVCUGCLiveListController.m */; };
207 207 D2D236B41E88F8E600B7C517 /* CNLiveChatManager.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D2D236B21E88F8E600B7C517 /* CNLiveChatManager.framework */; };
208 208 D2D236B51E88F8E600B7C517 /* CNLiveMsgTools.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D2D236B31E88F8E600B7C517 /* CNLiveMsgTools.framework */; };
209 209 D2D7D18D1E8A581000217771 /* timg.jpeg in Resources */ = {isa = PBXBuildFile; fileRef = D2D7D18C1E8A581000217771 /* timg.jpeg */; };
... ... @@ -618,6 +618,8 @@
618 618 D2888DB31E6EC154003A77C8 /* HomeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HomeViewController.m; sourceTree = "<group>"; };
619 619 D2888DB51E6EC1B8003A77C8 /* LVCMyViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCMyViewController.h; sourceTree = "<group>"; };
620 620 D2888DB61E6EC1B8003A77C8 /* LVCMyViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCMyViewController.m; sourceTree = "<group>"; };
  621 + D28F5FFD1E8BC7EF00914142 /* LVCUGCLiveListView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCUGCLiveListView.h; sourceTree = "<group>"; };
  622 + D28F5FFE1E8BC7EF00914142 /* LVCUGCLiveListView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCUGCLiveListView.m; sourceTree = "<group>"; };
621 623 D29D88461E88C53300543A03 /* LVCUGCLivePrepareView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCUGCLivePrepareView.h; sourceTree = "<group>"; };
622 624 D29D88471E88C53300543A03 /* LVCUGCLivePrepareView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCUGCLivePrepareView.m; sourceTree = "<group>"; };
623 625 D29E81EB1E88DC5B008C9906 /* PriChatCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PriChatCell.h; sourceTree = "<group>"; };
... ... @@ -640,8 +642,6 @@
640 642 D2B7B2531E824B2D00ED084E /* ChatBarrageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ChatBarrageView.m; sourceTree = "<group>"; };
641 643 D2B7B2551E8261EF00ED084E /* ChatBarrOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChatBarrOperation.h; sourceTree = "<group>"; };
642 644 D2B7B2561E8261EF00ED084E /* ChatBarrOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ChatBarrOperation.m; sourceTree = "<group>"; };
643   - D2CC7B851E891AA50034B8BF /* LVCUGCLiveListController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LVCUGCLiveListController.h; sourceTree = "<group>"; };
644   - D2CC7B861E891AA50034B8BF /* LVCUGCLiveListController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LVCUGCLiveListController.m; sourceTree = "<group>"; };
645 645 D2D236B21E88F8E600B7C517 /* CNLiveChatManager.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = CNLiveChatManager.framework; sourceTree = "<group>"; };
646 646 D2D236B31E88F8E600B7C517 /* CNLiveMsgTools.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = CNLiveMsgTools.framework; sourceTree = "<group>"; };
647 647 D2D7D18C1E8A581000217771 /* timg.jpeg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = timg.jpeg; sourceTree = "<group>"; };
... ... @@ -1653,8 +1653,8 @@
1653 1653 810B64E21E779AFE00133E15 /* LVCLivePlayerController.m */,
1654 1654 810B65081E77B39D00133E15 /* LVCFullScreenPlayerController.h */,
1655 1655 810B65091E77B39D00133E15 /* LVCFullScreenPlayerController.m */,
1656   - D2CC7B851E891AA50034B8BF /* LVCUGCLiveListController.h */,
1657   - D2CC7B861E891AA50034B8BF /* LVCUGCLiveListController.m */,
  1656 + D28F5FFD1E8BC7EF00914142 /* LVCUGCLiveListView.h */,
  1657 + D28F5FFE1E8BC7EF00914142 /* LVCUGCLiveListView.m */,
1658 1658 D25BF87E1E7BD266007FB138 /* LVCUGCLivePlayerController.h */,
1659 1659 D25BF87F1E7BD266007FB138 /* LVCUGCLivePlayerController.m */,
1660 1660 81A483151E88BED00097A80A /* LVCTVLiveViewController.h */,
... ... @@ -1902,6 +1902,7 @@
1902 1902 D2029CB81E6EADE10027CD92 /* SDImageCache.m in Sources */,
1903 1903 D2029CBB1E6EADE10027CD92 /* SDWebImageDownloader.m in Sources */,
1904 1904 D2029CA71E6EADE10027CD92 /* MJRefreshAutoGifFooter.m in Sources */,
  1905 + D28F5FFF1E8BC7EF00914142 /* LVCUGCLiveListView.m in Sources */,
1905 1906 D2029CC11E6EADE10027CD92 /* UIImage+MultiFormat.m in Sources */,
1906 1907 D245715F1E83B09900AA85D6 /* userInfoModel.m in Sources */,
1907 1908 D2029C861E6EADE10027CD92 /* Tools.m in Sources */,
... ... @@ -2034,7 +2035,6 @@
2034 2035 D2029D081E6EAE2E0027CD92 /* ZXDeviceInfo.m in Sources */,
2035 2036 D24571631E83C40B00AA85D6 /* PrivateView.m in Sources */,
2036 2037 D2029CC21E6EADE10027CD92 /* UIImage+WebP.m in Sources */,
2037   - D2CC7B871E891AA50034B8BF /* LVCUGCLiveListController.m in Sources */,
2038 2038 D2029BCD1E6EADD70027CD92 /* BaseViewController.m in Sources */,
2039 2039 810B64E01E779AE900133E15 /* LVCPlayer.m in Sources */,
2040 2040 810B64FF1E779B1F00133E15 /* MASConstraint.m in Sources */,
... ...
LiveVideoCloud/LiveVideoCloud/Classes/Sections/homeSections/Controller/LVCUGCLiveListController.h renamed to LiveVideoCloud/LiveVideoCloud/Classes/Sections/homeSections/Controller/LVCUGCLiveListView.h
1 1 //
2   -// LVCUGCLiveListController.h
  2 +// LVCUGCLiveListView.h
3 3 // LiveVideoCloud
4 4 //
5   -// Created by cnliveJunBo on 17/3/27.
  5 +// Created by cnliveJunBo on 17/3/29.
6 6 // Copyright © 2017年 cnlive. All rights reserved.
7 7 //
8 8  
9 9 #import <UIKit/UIKit.h>
10 10  
11   -@interface LVCUGCLiveListController : UIViewController
  11 +@interface LVCUGCLiveListView : UIView
12 12  
13 13 @end
... ...
LiveVideoCloud/LiveVideoCloud/Classes/Sections/homeSections/Controller/LVCUGCLiveListController.m renamed to LiveVideoCloud/LiveVideoCloud/Classes/Sections/homeSections/Controller/LVCUGCLiveListView.m
1 1 //
2   -// LVCUGCLiveListController.m
  2 +// LVCUGCLiveListView.m
3 3 // LiveVideoCloud
4 4 //
5   -// Created by cnliveJunBo on 17/3/27.
  5 +// Created by cnliveJunBo on 17/3/29.
6 6 // Copyright © 2017年 cnlive. All rights reserved.
7 7 //
8 8  
9   -#import "LVCUGCLiveListController.h"
  9 +#import "LVCUGCLiveListView.h"
10 10 #import "LiveLIstService.h"
11   -#import "LVCUGCLiveListModel.h"
12 11 #import "LVCUGCLivePlayerCell.h"
  12 +#import "LVCUGCLiveListModel.h"
13 13 #import "LVCUGCLivePlayerModel.h"
14 14  
15 15 static NSString *cellId = @"cellId";
16 16  
17   -@interface LVCUGCLiveListController ()<UICollectionViewDelegate, UICollectionViewDataSource>
  17 +@interface LVCUGCLiveListView()<UICollectionViewDelegate, UICollectionViewDataSource> {
  18 +
  19 + NSMutableArray *_arrayM;
  20 +}
18 21  
19 22 @property (nonatomic, strong) UICollectionView *collectionView;
20 23  
  24 +
  25 +
21 26 @end
22 27  
23   -@implementation LVCUGCLiveListController
  28 +@implementation LVCUGCLiveListView
24 29  
25   -- (void)viewDidLoad {
26   - [super viewDidLoad];
27   - self.view.backgroundColor = [UIColor whiteColor];
28   -
29   - [self loadData];
30   -
31   - [self.view addSubview:self.collectionView];
  30 +- (instancetype)initWithFrame:(CGRect)frame
  31 +{
  32 + self = [super initWithFrame:frame];
  33 + if (self) {
  34 + self.backgroundColor = [UIColor whiteColor];
  35 +
  36 + _arrayM = [[NSMutableArray alloc] init];
  37 +
  38 + [self loadData];
  39 +
  40 + [self addSubview:self.collectionView];
  41 + }
  42 + return self;
32 43 }
33 44  
34 45 - (void)loadData {
... ... @@ -44,8 +55,9 @@ static NSString *cellId = @&quot;cellId&quot;;
44 55 LVCUGCLiveListModel *model = [LVCUGCLiveListModel modelWithDic:data];
45 56  
46 57 NSLog(@"%@",model.activityList);
  58 + _arrayM = model.activityList.mutableCopy;
47 59 }];
48   -
  60 +
49 61 }
50 62  
51 63 #pragma mark - UICollectionViewDelegate, UICollectionViewDataSource !!!!!!!!!!!!!!!!!!!!!!!!!!!
... ... @@ -56,7 +68,7 @@ static NSString *cellId = @&quot;cellId&quot;;
56 68  
57 69 - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
58 70  
59   - return 6;
  71 + return _arrayM.count;
60 72 }
61 73  
62 74 - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
... ... @@ -71,6 +83,11 @@ static NSString *cellId = @&quot;cellId&quot;;
71 83 return cell;
72 84 }
73 85  
  86 +- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
  87 +
  88 +
  89 +}
  90 +
74 91 #pragma mark - GetMethod !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
75 92 - (UICollectionView *)collectionView {
76 93  
... ... @@ -78,8 +95,8 @@ static NSString *cellId = @&quot;cellId&quot;;
78 95 UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
79 96 layout.minimumLineSpacing = 10;
80 97 layout.minimumInteritemSpacing = 0;
81   - layout.itemSize = CGSizeMake(SCREEN_WIDTH, SCREEN_HEIGHT * 0.6);
82   - _collectionView = [[UICollectionView alloc] initWithFrame:self.view.bounds collectionViewLayout:layout];
  98 + layout.itemSize = CGSizeMake(SCREEN_WIDTH, SCREEN_WIDTH + 70);
  99 + _collectionView = [[UICollectionView alloc] initWithFrame:self.bounds collectionViewLayout:layout];
83 100 _collectionView.backgroundColor = [UIColor lightGrayColor];
84 101 _collectionView.showsHorizontalScrollIndicator = NO;
85 102 _collectionView.dataSource = self;
... ... @@ -89,9 +106,5 @@ static NSString *cellId = @&quot;cellId&quot;;
89 106 return _collectionView;
90 107 }
91 108  
92   -- (void)didReceiveMemoryWarning {
93   - [super didReceiveMemoryWarning];
94   - // Dispose of any resources that can be recreated.
95   -}
96 109  
97 110 @end
... ...
LiveVideoCloud/LiveVideoCloud/Classes/Sections/homeSections/Controller/LiveLIstService.m
... ... @@ -17,8 +17,8 @@
17 17 NSString *timeString = [NSString stringWithFormat:@"%ld", (long)time];
18 18 NSMutableDictionary *parameter=[@{@"platform_id": [NSBundle mainBundle].bundleIdentifier,
19 19 @"timestamp": timeString,
20   - @"appId": @"60_irn9edco29"} mutableCopy];
21   - NSString *string = [NSString stringWithFormat:@"%@&key=%@", [self sortParameters:parameter], @"69fe70bda67e059286ad509d9f5377f815955645b52f94"];
  20 + @"appId": AppId} mutableCopy];
  21 + NSString *string = [NSString stringWithFormat:@"%@&key=%@", [self sortParameters:parameter], AppKey];
22 22 NSString *signString = [[self sha1:string] uppercaseString];
23 23 [parameter setObject:signString forKey:@"sign"];
24 24  
... ...
LiveVideoCloud/LiveVideoCloud/Classes/Sections/homeSections/View/LVCUGCLivePlayerCell.m
... ... @@ -18,6 +18,8 @@
18 18  
19 19 @property (nonatomic, strong) UILabel *countLabel;
20 20  
  21 +@property (nonatomic, strong) UILabel *lookLabel;
  22 +
21 23 @property (nonatomic, strong) UIImageView *imageView;
22 24  
23 25 @property (nonatomic, strong) UILabel *stateLabel;
... ... @@ -35,6 +37,10 @@
35 37 self.contentView.backgroundColor = [UIColor whiteColor];
36 38 [self.contentView addSubview:self.iconView];
37 39 [self.contentView addSubview:self.nameLabel];
  40 + [self.contentView addSubview:self.locationLabel];
  41 + [self.contentView addSubview:self.countLabel];
  42 + [self.contentView addSubview:self.lookLabel];
  43 + [self.contentView addSubview:self.imageView];
38 44 }
39 45 return self;
40 46 }
... ... @@ -63,29 +69,52 @@
63 69  
64 70 - (UILabel *)nameLabel {
65 71 if (!_nameLabel) {
66   - _nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(70, 10, SCREEN_WIDTH - 100, 20)];
  72 + _nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(70, 15, SCREEN_WIDTH - 140, 20)];
67 73 _nameLabel.text = @"这是我的昵称";
  74 + _nameLabel.textColor = [UIColor grayColor];
68 75 }
69 76 return _nameLabel;
70 77 }
71 78  
72 79 - (UILabel *)locationLabel {
73 80 if (!_locationLabel) {
74   -
  81 + _locationLabel = [[UILabel alloc] initWithFrame:CGRectMake(70, 40, SCREEN_WIDTH - 140, 20)];
  82 + _locationLabel.text = @"这是我的地址";
  83 + _locationLabel.font = [UIFont systemFontOfSize:13];
  84 + _locationLabel.textColor = [UIColor grayColor];
75 85 }
76 86 return _locationLabel;
77 87 }
78 88  
79 89 - (UILabel *)countLabel {
80 90 if (!_countLabel) {
81   -
  91 + _countLabel = [[UILabel alloc] initWithFrame:CGRectMake(SCREEN_WIDTH - 65, 15, 60, 20)];
  92 + _countLabel.text = @"13244";
  93 + _countLabel.textAlignment = NSTextAlignmentRight;
  94 + _countLabel.textColor = [UIColor orangeColor];
82 95 }
83 96 return _countLabel;
84 97 }
85 98  
  99 +- (UILabel *)lookLabel {
  100 + if (!_lookLabel) {
  101 + _lookLabel = [[UILabel alloc] initWithFrame:CGRectMake(SCREEN_WIDTH - 45, 35, 40, 20)];
  102 + _lookLabel.text = @"在看";
  103 + _lookLabel.font = [UIFont systemFontOfSize:13];
  104 + _lookLabel.textAlignment = NSTextAlignmentRight;
  105 + _lookLabel.textColor = [UIColor grayColor];
  106 + }
  107 + return _lookLabel;
  108 +}
  109 +
86 110 - (UIImageView *)imageView {
87 111 if (!_imageView) {
88   -
  112 + NSString *path = [[NSBundle mainBundle] pathForResource:@"timg" ofType:@"jpeg"];
  113 + UIImage *image = [UIImage imageWithContentsOfFile:path];
  114 + _imageView = [[UIImageView alloc] initWithImage:image];
  115 + _imageView.frame = CGRectMake(0, 70, SCREEN_WIDTH, SCREEN_WIDTH);
  116 + _imageView.contentMode = UIViewContentModeScaleAspectFill;
  117 + _imageView.clipsToBounds = YES;
89 118 }
90 119 return _imageView;
91 120 }
... ...