Commit c0efbe6f509e09fdc259e7810475676fd6631f7c
1 parent
27b95679
no message
Showing
7 changed files
with
79 additions
and
40 deletions
CNLiveVideoClassifyKit/Classes/Controller/CNLiveClassifySegmentController.m
| @@ -529,14 +529,14 @@ static CGFloat moveHeight = 50; | @@ -529,14 +529,14 @@ static CGFloat moveHeight = 50; | ||
| 529 | } | 529 | } |
| 530 | self.topBgImg.frame = CGRectMake(0, 0, KScreenWidth, self.topBgImgHeight - 50); | 530 | self.topBgImg.frame = CGRectMake(0, 0, KScreenWidth, self.topBgImgHeight - 50); |
| 531 | CNLiveListManager *list = [CNLiveListManager shareListManager]; | 531 | CNLiveListManager *list = [CNLiveListManager shareListManager]; |
| 532 | - [list model:model black:isBlack bgImage:[self.bgImages safetyObjectAtIndex:index] bgColor:model.backgroundColor bgImageH5:model.backgroundImgH5]; | 532 | + UIViewController *listView = [list model:model black:isBlack bgImage:[self.bgImages safetyObjectAtIndex:index] bgColor:model.backgroundColor bgImageH5:model.backgroundImgH5]; |
| 533 | list.contentVC = self; | 533 | list.contentVC = self; |
| 534 | weakself | 534 | weakself |
| 535 | list.scrollViewDidScrollBlock = ^(BOOL isUp) { | 535 | list.scrollViewDidScrollBlock = ^(BOOL isUp) { |
| 536 | [weakSelf scrollViewUpDowm:isUp]; | 536 | [weakSelf scrollViewUpDowm:isUp]; |
| 537 | }; | 537 | }; |
| 538 | 538 | ||
| 539 | - return list; | 539 | + return listView; |
| 540 | } | 540 | } |
| 541 | #pragma mark - Public | 541 | #pragma mark - Public |
| 542 | -(JXCategoryBaseView *)preferredCategoryView | 542 | -(JXCategoryBaseView *)preferredCategoryView |
CNLiveVideoClassifyKit/Classes/Controller/CNLiveListViewController.h
0 → 100644
| 1 | +// | ||
| 2 | +// CNLiveListViewController.h | ||
| 3 | +// CNLiveVideoClassifyKit | ||
| 4 | +// | ||
| 5 | +// Created by CNLive on 2021/9/10. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import <CNLiveBaseClass/CNLiveBaseClass.h> | ||
| 9 | + | ||
| 10 | +NS_ASSUME_NONNULL_BEGIN | ||
| 11 | + | ||
| 12 | +@interface CNLiveListViewController : CNLiveBaseViewController | ||
| 13 | + | ||
| 14 | +@end | ||
| 15 | + | ||
| 16 | +NS_ASSUME_NONNULL_END |
CNLiveVideoClassifyKit/Classes/Controller/CNLiveListViewController.m
0 → 100644
| 1 | +// | ||
| 2 | +// CNLiveListViewController.m | ||
| 3 | +// CNLiveVideoClassifyKit | ||
| 4 | +// | ||
| 5 | +// Created by CNLive on 2021/9/10. | ||
| 6 | +// | ||
| 7 | + | ||
| 8 | +#import "CNLiveListViewController.h" | ||
| 9 | + | ||
| 10 | +@interface CNLiveListViewController () | ||
| 11 | + | ||
| 12 | +@end | ||
| 13 | + | ||
| 14 | +@implementation CNLiveListViewController | ||
| 15 | + | ||
| 16 | +- (void)viewDidLoad { | ||
| 17 | + [super viewDidLoad]; | ||
| 18 | + self.navigationHidden = YES; | ||
| 19 | + // Do any additional setup after loading the view. | ||
| 20 | +} | ||
| 21 | + | ||
| 22 | +/* | ||
| 23 | +#pragma mark - Navigation | ||
| 24 | + | ||
| 25 | +// In a storyboard-based application, you will often want to do a little preparation before navigation | ||
| 26 | +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { | ||
| 27 | + // Get the new view controller using [segue destinationViewController]. | ||
| 28 | + // Pass the selected object to the new view controller. | ||
| 29 | +} | ||
| 30 | +*/ | ||
| 31 | + | ||
| 32 | +@end |
CNLiveVideoClassifyKit/Classes/Controller/CNLiveSubSegmentController.m
| @@ -143,14 +143,14 @@ | @@ -143,14 +143,14 @@ | ||
| 143 | { | 143 | { |
| 144 | CNCategoryGetChannelModel *model = self.pageListArr[index]; | 144 | CNCategoryGetChannelModel *model = self.pageListArr[index]; |
| 145 | CNLiveListManager *list = [CNLiveListManager shareListManager]; | 145 | CNLiveListManager *list = [CNLiveListManager shareListManager]; |
| 146 | - [list model:model black:_isBlack bgImage:self.backImage bgColor:self.backgroundColor bgImageH5:self.backImageH5]; | 146 | + UIViewController *listView = [list model:model black:_isBlack bgImage:self.backImage bgColor:self.backgroundColor bgImageH5:self.backImageH5]; |
| 147 | list.contentVC = self; | 147 | list.contentVC = self; |
| 148 | weakself | 148 | weakself |
| 149 | list.scrollViewDidScrollBlock = ^(BOOL isUp) { | 149 | list.scrollViewDidScrollBlock = ^(BOOL isUp) { |
| 150 | !weakSelf.scrollViewDidScrollBlock ?: weakSelf.scrollViewDidScrollBlock(isUp); | 150 | !weakSelf.scrollViewDidScrollBlock ?: weakSelf.scrollViewDidScrollBlock(isUp); |
| 151 | }; | 151 | }; |
| 152 | 152 | ||
| 153 | - return list; | 153 | + return listView; |
| 154 | } | 154 | } |
| 155 | #pragma mark - JXCategoryListContentViewDelegate | 155 | #pragma mark - JXCategoryListContentViewDelegate |
| 156 | 156 |
CNLiveVideoClassifyKit/Classes/Manager/CNLiveClassifyJumpBridge.h
| @@ -11,7 +11,7 @@ | @@ -11,7 +11,7 @@ | ||
| 11 | NS_ASSUME_NONNULL_BEGIN | 11 | NS_ASSUME_NONNULL_BEGIN |
| 12 | 12 | ||
| 13 | @interface CNLiveClassifyJumpBridge : NSObject | 13 | @interface CNLiveClassifyJumpBridge : NSObject |
| 14 | -@property (nonatomic, weak) id<CNLiveVideoClassifyProtocol> protocol; | 14 | +@property (nonatomic, strong) id<CNLiveVideoClassifyProtocol> protocol; |
| 15 | 15 | ||
| 16 | +(instancetype)shareInstance; | 16 | +(instancetype)shareInstance; |
| 17 | 17 |
CNLiveVideoClassifyKit/Classes/Manager/CNLiveListManager.h
| @@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN | @@ -16,7 +16,7 @@ NS_ASSUME_NONNULL_BEGIN | ||
| 16 | 16 | ||
| 17 | +(instancetype)shareListManager; | 17 | +(instancetype)shareListManager; |
| 18 | 18 | ||
| 19 | --(void)model:(CNCategoryGetChannelModel *)model black:(BOOL)black bgImage:(NSString *)bgImage bgColor:(NSString *)bgColor bgImageH5:(NSString *)bgImageH5; | 19 | +-(UIViewController *)model:(CNCategoryGetChannelModel *)model black:(BOOL)black bgImage:(NSString *)bgImage bgColor:(NSString *)bgColor bgImageH5:(NSString *)bgImageH5; |
| 20 | 20 | ||
| 21 | - (void)requestWebViewForScrollView:(nonnull UIScrollView *)scrollView isBeginDragging:(BOOL)isBeginDragging; | 21 | - (void)requestWebViewForScrollView:(nonnull UIScrollView *)scrollView isBeginDragging:(BOOL)isBeginDragging; |
| 22 | @end | 22 | @end |
CNLiveVideoClassifyKit/Classes/Manager/CNLiveListManager.m
| @@ -7,15 +7,11 @@ | @@ -7,15 +7,11 @@ | ||
| 7 | 7 | ||
| 8 | #import "CNLiveListManager.h" | 8 | #import "CNLiveListManager.h" |
| 9 | #import "CNCategoryGetChannelModel.h" | 9 | #import "CNCategoryGetChannelModel.h" |
| 10 | -#import <CNLiveCWebViewModule/CNLiveCWebViewModule.h> | ||
| 11 | -#import <CNLiveCWebViewModule/CNLiveSubWebViewController.h> | ||
| 12 | 10 | ||
| 13 | @interface CNLiveListManager() | 11 | @interface CNLiveListManager() |
| 14 | { | 12 | { |
| 15 | - BOOL _black; | ||
| 16 | - CNCategoryGetChannelModel *_model; | 13 | + UIViewController *subVC; |
| 17 | CGFloat beginoffsetY; | 14 | CGFloat beginoffsetY; |
| 18 | - NSString *_backImage, *_backColor ,*_backImageH5; | ||
| 19 | } | 15 | } |
| 20 | @end | 16 | @end |
| 21 | 17 | ||
| @@ -31,13 +27,31 @@ | @@ -31,13 +27,31 @@ | ||
| 31 | } | 27 | } |
| 32 | 28 | ||
| 33 | 29 | ||
| 34 | --(void)model:(CNCategoryGetChannelModel *)model black:(BOOL)black bgImage:(NSString *)bgImage bgColor:(nonnull NSString *)bgColor bgImageH5:(nonnull NSString *)bgImageH5 | 30 | +-(UIViewController *)model:(CNCategoryGetChannelModel *)model black:(BOOL)black bgImage:(NSString *)bgImage bgColor:(nonnull NSString *)bgColor bgImageH5:(nonnull NSString *)bgImageH5 |
| 35 | { | 31 | { |
| 36 | - _model = model; | ||
| 37 | - _black = black; | ||
| 38 | - _backImage = bgImage; | ||
| 39 | - _backColor = bgColor; | ||
| 40 | - _backImageH5 = bgImageH5; | 32 | + NSDictionary * paramDic = nil; |
| 33 | + if ([model.pageType isEqualToString:@"4"] || [model.pageType isEqualToString:@"5"]){ | ||
| 34 | + paramDic= @{ | ||
| 35 | + @"title": model.showName?model.showName:@"", | ||
| 36 | + @"bgColor": bgColor?bgColor:@"", | ||
| 37 | + @"isBlack":@(black), | ||
| 38 | + @"backgroundImg": bgImage?bgImage:@"", | ||
| 39 | + @"channelId":model.channelId?model.channelId:@"", | ||
| 40 | + @"channelName":model.id?model.id:@"", | ||
| 41 | + @"pageId":model.pageId?model.pageId:@"" | ||
| 42 | + | ||
| 43 | + }; | ||
| 44 | + }else{ | ||
| 45 | + paramDic= @{ | ||
| 46 | + @"title": model.showName?model.showName:@"", | ||
| 47 | + @"bgColor": bgColor?bgColor:@"", | ||
| 48 | + @"isBlack":@(black), | ||
| 49 | + @"thirdUrl":model.thirdUrl?model.thirdUrl:@"", | ||
| 50 | + @"backgroundImgH5":bgImageH5?bgImageH5:@"" | ||
| 51 | + }; | ||
| 52 | + } | ||
| 53 | + subVC = [CNLiveClassifyJumpBridge ListViewWithPageType:model.pageType.integerValue param:paramDic]; | ||
| 54 | + return subVC; | ||
| 41 | } | 55 | } |
| 42 | - (void)requestWebViewForScrollView:(nonnull UIScrollView *)scrollView isBeginDragging:(BOOL)isBeginDragging | 56 | - (void)requestWebViewForScrollView:(nonnull UIScrollView *)scrollView isBeginDragging:(BOOL)isBeginDragging |
| 43 | { | 57 | { |
| @@ -60,29 +74,6 @@ | @@ -60,29 +74,6 @@ | ||
| 60 | 实现 <JXCategoryListContentViewDelegate> 协议方法,返回该视图控制器所拥有的「视图」 | 74 | 实现 <JXCategoryListContentViewDelegate> 协议方法,返回该视图控制器所拥有的「视图」 |
| 61 | */ | 75 | */ |
| 62 | - (UIView *)listView { | 76 | - (UIView *)listView { |
| 63 | - NSDictionary * paramDic = nil; | ||
| 64 | - if ([_model.pageType isEqualToString:@"4"] || [_model.pageType isEqualToString:@"5"]){ | ||
| 65 | - paramDic= @{ | ||
| 66 | - @"title": _model.showName?_model.showName:@"", | ||
| 67 | - @"bgColor": _backColor?_backColor:@"", | ||
| 68 | - @"isBlack":@(_black), | ||
| 69 | - @"backgroundImg": _backImage?_backImage:@"", | ||
| 70 | - @"channelId":_model.channelId?_model.channelId:@"", | ||
| 71 | - @"channelName":_model.id?_model.id:@"", | ||
| 72 | - @"pageId":_model.pageId?_model.pageId:@"" | ||
| 73 | - | ||
| 74 | - }; | ||
| 75 | - }else{ | ||
| 76 | - paramDic= @{ | ||
| 77 | - @"title": _model.showName, | ||
| 78 | - @"bgColor": _backColor, | ||
| 79 | - @"isBlack":@(_black), | ||
| 80 | - @"thirdUrl":_model.thirdUrl, | ||
| 81 | - @"backgroundImgH5":_backImageH5 | ||
| 82 | - }; | ||
| 83 | - } | ||
| 84 | - UIViewController *subVC = [CNLiveClassifyJumpBridge ListViewWithPageType:_model.pageType.integerValue param:paramDic]; | ||
| 85 | - [self.contentVC addChildViewController:subVC]; | ||
| 86 | return subVC.view; | 77 | return subVC.view; |
| 87 | } | 78 | } |
| 88 | @end | 79 | @end |