Commit 85997a7c491413cadc3d9a7c2830d224ac204890
1 parent
da2663f3
交互问题修改提交
Showing
10 changed files
with
112 additions
and
62 deletions
CNLiveVideoClassifyKit.podspec
CNLiveVideoClassifyKit/Classes/Controller/CNCategoryBaseViewController.h
| ... | ... | @@ -13,8 +13,8 @@ NS_ASSUME_NONNULL_BEGIN |
| 13 | 13 | |
| 14 | 14 | @property (nonatomic, strong) JXCategoryBaseView *categoryView; |
| 15 | 15 | @property (nonatomic, strong) UIPageViewController *pageViewController; |
| 16 | -@property (nonatomic, strong) UIScrollView *findScrollView; | |
| 17 | -@property (nonatomic, strong) NSMutableArray *titles; | |
| 16 | +@property (nonatomic, strong) UIScrollView *findScrollView;//控制器的scrollView | |
| 17 | +@property (nonatomic, strong) NSMutableArray *titles;//标题 | |
| 18 | 18 | @property (nonatomic, strong) NSMutableArray *controllersArr;/// 控制器数组 |
| 19 | 19 | |
| 20 | 20 | @property (nonatomic, assign) NSInteger ld_currentIndex; //当前选中 | ... | ... |
CNLiveVideoClassifyKit/Classes/Controller/CNLiveClassifySegmentController.h
| ... | ... | @@ -11,7 +11,6 @@ NS_ASSUME_NONNULL_BEGIN |
| 11 | 11 | |
| 12 | 12 | @interface CNLiveClassifySegmentController : CNCategoryBaseViewController |
| 13 | 13 | @property (nonatomic, assign) BOOL isLoad; |
| 14 | -- (void)dataDivideIntoNormalAndOtherWithFirst:(BOOL)first; | |
| 15 | 14 | // 点击定制频道按钮进入定制 |
| 16 | 15 | - (void)customAction:(UIButton *)sender; |
| 17 | 16 | @end | ... | ... |
CNLiveVideoClassifyKit/Classes/Controller/CNLiveClassifySegmentController.m
| ... | ... | @@ -20,13 +20,12 @@ static const CGFloat animationHeight = 15; |
| 20 | 20 | @interface CNLiveClassifySegmentController ()<JXCategoryViewDelegate,CNCustomChannelListViewDelegate,CNSubClassifySegmentControllerDelegate> |
| 21 | 21 | |
| 22 | 22 | @property (nonatomic, strong)JXCategoryTitleImageView *myCategoryView; //选择器 |
| 23 | -@property (nonatomic, strong) UIButton *customChannelsBtn; | |
| 24 | -@property (nonatomic, strong) UIButton *loginBtn; | |
| 25 | -@property (nonatomic, strong) CNCustomChannelListView *customChannelsV; | |
| 23 | +@property (nonatomic, strong) UIButton *customChannelsBtn;//频道按钮 | |
| 24 | +@property (nonatomic, strong) UIButton *loginBtn;//登录按钮 | |
| 25 | +@property (nonatomic, strong) CNCustomChannelListView *customChannelsV;//频道控制器窗口 | |
| 26 | 26 | @property (nonatomic, strong) UIView *fuzzyView;//游客登录弹框 |
| 27 | 27 | @property (nonatomic, strong) UIImageView *topBgImg; //头部图片 |
| 28 | 28 | @property (nonatomic, assign) CGFloat topBgImgHeight;//头部图片高度 |
| 29 | -@property (nonatomic, assign) CGFloat lastOffsetY; | |
| 30 | 29 | |
| 31 | 30 | @property (nonatomic, assign) NSInteger isLoginIndex; |
| 32 | 31 | |
| ... | ... | @@ -143,7 +142,7 @@ static CGFloat moveHeight = 50; |
| 143 | 142 | } |
| 144 | 143 | else if ([url isEqualToString:@"judgeGiftUrl"]) { |
| 145 | 144 | NSURL *otherUrl = [BHConfig get:ActivityNewUrl]; |
| 146 | - if (otherUrl && [CNUserShareManager isLogin]) { | |
| 145 | + if (otherUrl&&![otherUrl isEqual:[NSURL URLWithString:@""]] && [CNUserShareManager isLogin]) { | |
| 147 | 146 | [CNLiveClassifyJumpBridge checkForloginTurnToWithURL:otherUrl]; |
| 148 | 147 | } |
| 149 | 148 | } |
| ... | ... | @@ -153,7 +152,7 @@ static CGFloat moveHeight = 50; |
| 153 | 152 | } else { |
| 154 | 153 | if ([CNUserShareManager isLogin]) { |
| 155 | 154 | NSURL *otherUrl = [BHConfig get:ActivityNewUrl]; |
| 156 | - if (otherUrl) { | |
| 155 | + if (otherUrl &&![otherUrl isEqual:[NSURL URLWithString:@""]]) { | |
| 157 | 156 | [CNLiveClassifyJumpBridge checkForloginTurnToWithURL:otherUrl]; |
| 158 | 157 | } |
| 159 | 158 | } |
| ... | ... | @@ -413,7 +412,10 @@ static CGFloat moveHeight = 50; |
| 413 | 412 | if ([locaVersion compare:guide options:NSNumericSearch]==NSOrderedAscending) { |
| 414 | 413 | //show |
| 415 | 414 | [BHConfig set:ChannelsShowGuide boolValue:YES]; |
| 416 | - [CNLiveClassifyJumpBridge showViewOrPushVCWithCurrentVC:self pushType:CNLiveClassifyJumpShowGuideView]; | |
| 415 | + NSDictionary *paramDic = @{ | |
| 416 | + @"guide":guide | |
| 417 | + }; | |
| 418 | + [CNLiveClassifyJumpBridge showViewOrPushVCWithCurrentVC:self pushType:CNLiveClassifyJumpShowGuideView pageType:0 param:paramDic]; | |
| 417 | 419 | return YES; |
| 418 | 420 | } else { |
| 419 | 421 | return NO; |
| ... | ... | @@ -747,32 +749,36 @@ static CGFloat moveHeight = 50; |
| 747 | 749 | @"showName":model.showName?model.showName:@"", |
| 748 | 750 | @"backgroundColor":model.backgroundColor?model.backgroundColor:@"" |
| 749 | 751 | }; |
| 750 | - }else if([model.pageType isEqualToString:@"4"] || [model.pageType isEqualToString:@"5"]){ | |
| 751 | - paramDic= @{ | |
| 752 | - @"bgColor": model.backgroundColor?model.backgroundColor:@"", | |
| 753 | - @"channelId":model.channelId?model.channelId:@"", | |
| 754 | - @"channelName":model.id?model.id:@"", | |
| 755 | - @"pageId":model.pageId?model.pageId:@"", | |
| 756 | - }; | |
| 757 | - }else if ([model.pageType isEqualToString:@"2"]) {//电商中国 | |
| 758 | - paramDic = @{ | |
| 759 | - @"showName":model.showName?model.showName:@"" | |
| 760 | - }; | |
| 761 | - }else | |
| 762 | - { | |
| 763 | - BOOL isBlack = NO; | |
| 764 | - if (CNLiveStringIsEmpty(model.statusBarColor)) { | |
| 765 | - isBlack = YES; | |
| 766 | - } else { | |
| 767 | - isBlack = [model.statusBarColor boolValue];//1 黑色 | |
| 752 | + [CNLiveClassifyJumpBridge showViewOrPushVCWithCurrentVC:self pushType:CNLiveClassifyJumpPushOtherSegmentVC pageType:model.pageType.integerValue param:paramDic]; | |
| 753 | + | |
| 754 | + }else{ | |
| 755 | + if([model.pageType isEqualToString:@"4"] || [model.pageType isEqualToString:@"5"]){ | |
| 756 | + paramDic= @{ | |
| 757 | + @"bgColor": model.backgroundColor?model.backgroundColor:@"", | |
| 758 | + @"channelId":model.channelId?model.channelId:@"", | |
| 759 | + @"channelName":model.id?model.id:@"", | |
| 760 | + @"pageId":model.pageId?model.pageId:@"", | |
| 761 | + }; | |
| 762 | + }else if ([model.pageType isEqualToString:@"2"]) {//电商中国 | |
| 763 | + paramDic = @{ | |
| 764 | + @"showName":model.showName?model.showName:@"" | |
| 765 | + }; | |
| 766 | + }else | |
| 767 | + { | |
| 768 | + BOOL isBlack = NO; | |
| 769 | + if (CNLiveStringIsEmpty(model.statusBarColor)) { | |
| 770 | + isBlack = YES; | |
| 771 | + } else { | |
| 772 | + isBlack = [model.statusBarColor boolValue];//1 黑色 | |
| 773 | + } | |
| 774 | + paramDic= @{ | |
| 775 | + @"title": model.showName?model.showName:@"", | |
| 776 | + @"isBlack":@(isBlack), | |
| 777 | + @"thirdUrl":model.thirdUrl?model.thirdUrl:@"" | |
| 778 | + }; | |
| 779 | + } | |
| 780 | + [CNLiveClassifyJumpBridge showViewOrPushVCWithCurrentVC:self pushType:CNLiveClassifyJumpPushCustomVC pageType:model.pageType.integerValue param:paramDic]; | |
| 768 | 781 | } |
| 769 | - paramDic= @{ | |
| 770 | - @"title": model.showName?model.showName:@"", | |
| 771 | - @"isBlack":@(isBlack), | |
| 772 | - @"thirdUrl":model.thirdUrl?model.thirdUrl:@"" | |
| 773 | - }; | |
| 774 | - } | |
| 775 | - [CNLiveClassifyJumpBridge showViewOrPushVCWithCurrentVC:self pushType:CNLiveClassifyJumpPushCustomVC pageType:model.pageType.integerValue param:paramDic]; | |
| 776 | 782 | } |
| 777 | 783 | |
| 778 | 784 | - (void)closeCustomChannelsView { |
| ... | ... | @@ -835,7 +841,7 @@ static CGFloat moveHeight = 50; |
| 835 | 841 | if ([model.pageType isEqualToString:@"4"] || [model.pageType isEqualToString:@"5"]){ |
| 836 | 842 | paramDic= @{ |
| 837 | 843 | @"bgColor": model.backgroundColor?model.backgroundColor:@"", |
| 838 | - @"backgroundImg": model.backgroundImg?model.backgroundImg:@"", | |
| 844 | + @"backgroundImg": model.backgroundImgH5?model.backgroundImgH5:@"", | |
| 839 | 845 | @"channelId":model.channelId?model.channelId:@"", |
| 840 | 846 | @"channelName":model.id?model.id:@"", |
| 841 | 847 | @"pageId":model.pageId?model.pageId:@"", | ... | ... |
CNLiveVideoClassifyKit/Classes/Controller/CNLiveSubSegmentController.m
| ... | ... | @@ -456,7 +456,6 @@ |
| 456 | 456 | #pragma mark - TODO 历史 |
| 457 | 457 | - (void)historyAction:(UIButton *)sender { |
| 458 | 458 | if (![CNUserShareManager isLogin]) { |
| 459 | - [BHConfig set:LoginPrepositionUrl value:@""]; | |
| 460 | 459 | [CNLiveClassifyJumpBridge showViewOrPushVCWithCurrentVC:self pushType:CNLiveClassifyJumpPushLoginVC]; |
| 461 | 460 | return; |
| 462 | 461 | } |
| ... | ... | @@ -481,7 +480,6 @@ |
| 481 | 480 | #pragma mark - TODO 听见中国-更多 |
| 482 | 481 | - (void)moreAction:(UIButton *)sender event:(UIEvent *)event{ |
| 483 | 482 | if (![CNUserShareManager isLogin]) { |
| 484 | - [BHConfig set:LoginPrepositionUrl value:@""]; | |
| 485 | 483 | [CNLiveClassifyJumpBridge showViewOrPushVCWithCurrentVC:self pushType:CNLiveClassifyJumpPushLoginVC]; |
| 486 | 484 | return; |
| 487 | 485 | } | ... | ... |
CNLiveVideoClassifyKit/Classes/Header/CNLiveCommonDefines.h
CNLiveVideoClassifyKit/Classes/Manager/CNLiveClassifyJumpBridge.h
| ... | ... | @@ -14,26 +14,47 @@ NS_ASSUME_NONNULL_BEGIN |
| 14 | 14 | @property (nonatomic, strong) id<CNLiveVideoClassifyProtocol> protocol; |
| 15 | 15 | |
| 16 | 16 | + (instancetype)shareInstance; |
| 17 | - | |
| 17 | +/** | |
| 18 | + *返回需要加载的VC | |
| 19 | + *pageType加载页面类型 | |
| 20 | + *param 传给View的参数 | |
| 21 | + */ | |
| 18 | 22 | + (UIViewController *)ListViewWithPageType:(NSInteger)pageType param:(NSDictionary *_Nullable)param; |
| 19 | 23 | |
| 24 | +/** | |
| 25 | + *刷新当时显示VC | |
| 26 | + *currentVC当前展示的页面VC | |
| 27 | + *pageType加载页面类型 | |
| 28 | + *param 传给View的参数 | |
| 29 | + *refreshTime刷新间隔时间 | |
| 30 | + */ | |
| 20 | 31 | + (void)listViewRefreshWithVC:(UIViewController *)currentVC pageType:(NSInteger)pageType param:(NSDictionary * _Nullable)param refreshTime:(NSTimeInterval)time; |
| 21 | - | |
| 32 | +/** | |
| 33 | + *返回需要返回的VC和处理push操作 | |
| 34 | + *currentVC当前控制器 | |
| 35 | + *pushType 操作类型 | |
| 36 | + */ | |
| 22 | 37 | + (UIView *)showViewOrPushVCWithCurrentVC:(UIViewController *)currentVC pushType:(CNLiveClassifyJumpType)type; |
| 23 | 38 | |
| 39 | +/** | |
| 40 | + *返回需要返回的VC和处理push操作 | |
| 41 | + *currentVC当前控制器 | |
| 42 | + *pushType 操作类型 | |
| 43 | + *pageType加载页面类型 | |
| 44 | + *param 传给View的参数 | |
| 45 | + */ | |
| 24 | 46 | + (UIView *)showViewOrPushVCWithCurrentVC:(UIViewController *)currentVC pushType:(CNLiveClassifyJumpType)type pageType:(NSInteger)pageType param:(NSDictionary * _Nullable)param; |
| 25 | - | |
| 47 | +//加载FTPopOverMenuConfiguration需要 | |
| 26 | 48 | +(void)popOverShowEvent:(UIEvent *)event |
| 27 | 49 | imageDone:(FTPopDoneBlock)doneBlock |
| 28 | 50 | dismissBlock:(FTPopDismissBlock)dismissBlock; |
| 29 | -+(void)showGuideShadeViewType:(NSInteger)type cellFrame:(CGRect)cellFrame cancelBlock:(FTPopDismissBlock)cancelBlock; | |
| 30 | 51 | |
| 31 | 52 | + (void)checkForloginTurnToWithURL:(NSURL *)url; |
| 32 | 53 | |
| 33 | 54 | + (void)checkWithFunctionForShareURL:(NSString *)shareUrl; |
| 34 | 55 | |
| 35 | 56 | + (void)bringCenterLoginViewToFront; |
| 36 | - | |
| 57 | +//获取播放状态 | |
| 37 | 58 | + (BOOL)audioPlayerIsplaying; |
| 38 | 59 | @end |
| 39 | 60 | ... | ... |
CNLiveVideoClassifyKit/Classes/Manager/CNLiveClassifyJumpBridge.m
| ... | ... | @@ -35,7 +35,7 @@ |
| 35 | 35 | |
| 36 | 36 | +(void)listViewRefreshWithVC:(UIViewController *)currentVC pageType:(NSInteger)pageType param:(NSDictionary *)param refreshTime:(NSTimeInterval)time |
| 37 | 37 | { |
| 38 | - | |
| 38 | + [[CNLiveClassifyJumpBridge shareInstance].protocol listViewRefreshWithVC:currentVC pageType:pageType param:param refreshTime:time]; | |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | +(UIView *)showViewOrPushVCWithCurrentVC:(UIViewController *)currentVC pushType:(CNLiveClassifyJumpType)type |
| ... | ... | @@ -52,28 +52,18 @@ |
| 52 | 52 | } |
| 53 | 53 | +(void)checkForloginTurnToWithURL:(NSURL *)url |
| 54 | 54 | { |
| 55 | - Class class = NSClassFromString(@"CNLiveSkipActionManager"); | |
| 56 | - SEL sel = NSSelectorFromString(@"checkForloginTurnToWithURL"); | |
| 57 | - if (class && sel) { | |
| 58 | - [class performSelector:sel withObject:url]; | |
| 59 | - } | |
| 55 | + [[CNLiveClassifyJumpBridge shareInstance].protocol checkForloginTurnToWithURL:url]; | |
| 60 | 56 | } |
| 61 | 57 | |
| 62 | 58 | +(void)checkWithFunctionForShareURL:(NSString *)shareUrl |
| 63 | 59 | { |
| 64 | - Class class = NSClassFromString(@"CNLiveSkipActionManager"); | |
| 65 | - SEL sel = NSSelectorFromString(@"checkWithFunctionForShareURL"); | |
| 66 | - if (class && sel) { | |
| 67 | - [class performSelector:sel withObject:shareUrl]; | |
| 68 | - } | |
| 60 | + [[CNLiveClassifyJumpBridge shareInstance].protocol checkWithFunctionForShareURL:shareUrl]; | |
| 69 | 61 | |
| 70 | 62 | } |
| 71 | 63 | |
| 72 | 64 | + (void)bringCenterLoginViewToFront |
| 73 | 65 | { |
| 74 | - Class class = NSClassFromString(@"CNTouristsLoginView"); | |
| 75 | - SEL sel = NSSelectorFromString(@"bringCenterLoginViewToFront"); | |
| 76 | - [class performSelector:sel]; | |
| 66 | + [[CNLiveClassifyJumpBridge shareInstance].protocol bringCenterLoginViewToFront]; | |
| 77 | 67 | } |
| 78 | 68 | + (BOOL)audioPlayerIsplaying |
| 79 | 69 | { | ... | ... |
CNLiveVideoClassifyKit/Classes/Manager/CNLiveVideoClassifyProtocol.h
| ... | ... | @@ -14,16 +14,42 @@ typedef void(^FTPopDismissBlock)(void); |
| 14 | 14 | NS_ASSUME_NONNULL_BEGIN |
| 15 | 15 | @protocol CNLiveVideoClassifyProtocol <NSObject> |
| 16 | 16 | /** |
| 17 | - *返回需要加载的View | |
| 17 | + *返回需要加载的VC | |
| 18 | 18 | *pageType加载页面类型 |
| 19 | 19 | *param 传给View的参数 |
| 20 | 20 | */ |
| 21 | 21 | -(UIViewController *)listViewShowPageType:(NSUInteger)pageType |
| 22 | 22 | param:(NSDictionary *)param; |
| 23 | +/** | |
| 24 | + *返回需要返回的VC和处理push操作 | |
| 25 | + *currentVC当前控制器 | |
| 26 | + *pushType 操作类型 | |
| 27 | + *pageType加载页面类型 | |
| 28 | + *param 传给View的参数 | |
| 29 | + */ | |
| 23 | 30 | -(UIView *)showViewOrPushVCWithCurrentVC:(UIViewController *)currentVC |
| 24 | 31 | pushType:(CNLiveClassifyJumpType)type pageType:(NSInteger)pageType param:(NSDictionary *_Nullable)param; |
| 32 | + | |
| 33 | +/** | |
| 34 | + *刷新当时显示VC | |
| 35 | + *currentVC当前展示的页面VC | |
| 36 | + *pageType加载页面类型 | |
| 37 | + *param 传给View的参数 | |
| 38 | + *refreshTime刷新间隔时间 | |
| 39 | + */ | |
| 40 | +-(void)listViewRefreshWithVC:(UIViewController *)currentVC | |
| 41 | + pageType:(NSInteger)pageType | |
| 42 | + param:(NSDictionary *)param | |
| 43 | + refreshTime:(NSTimeInterval)time; | |
| 44 | + | |
| 25 | 45 | -(BOOL)audioPlayerIsplaying; |
| 46 | +- (void)checkForloginTurnToWithURL:(NSURL *)url; | |
| 47 | + | |
| 48 | +- (void)checkWithFunctionForShareURL:(NSString *)shareUrl; | |
| 49 | + | |
| 50 | +- (void)bringCenterLoginViewToFront; | |
| 26 | 51 | |
| 52 | +//加载FTPopOverMenuConfiguration需要 | |
| 27 | 53 | -(void)popOverShowEvent:(UIEvent *)event |
| 28 | 54 | imageDone:(FTPopDoneBlock)doneBlock |
| 29 | 55 | dismissBlock:(FTPopDismissBlock)dismissBlock; | ... | ... |
Example/CNLiveVideoClassifyKit/CNLiveClassifyKitImpl.m
| ... | ... | @@ -50,13 +50,22 @@ |
| 50 | 50 | { |
| 51 | 51 | return YES; |
| 52 | 52 | } |
| 53 | +-(void)listViewRefreshWithVC:(UIViewController *)currentVC | |
| 54 | + pageType:(NSInteger)pageType | |
| 55 | + param:(NSDictionary *)param | |
| 56 | + refreshTime:(NSTimeInterval)time{ | |
| 57 | + | |
| 58 | +} | |
| 59 | +- (void)checkForloginTurnToWithURL:(NSURL *)url{} | |
| 60 | + | |
| 61 | +- (void)checkWithFunctionForShareURL:(NSString *)shareUrl{} | |
| 62 | + | |
| 63 | +- (void)bringCenterLoginViewToFront{} | |
| 53 | 64 | |
| 54 | 65 | -(void)popOverShowEvent:(UIEvent *)event |
| 55 | 66 | imageDone:(FTPopDoneBlock)doneBlock |
| 56 | 67 | dismissBlock:(FTPopDismissBlock)dismissBlock{ |
| 57 | 68 | |
| 58 | 69 | } |
| 59 | --(void)showGuideShadeViewType:(NSInteger)type cellFrame:(CGRect)cellFrame cancelBlock:(FTPopDismissBlock)cancelBlock{ | |
| 60 | - | |
| 61 | -} | |
| 70 | + | |
| 62 | 71 | @end | ... | ... |