Commit debde431bb225e58b1e25fe783250bbb5ad60188

Authored by yanglingyu
1 parent 192a658f

其他分类页面优化

CNLiveVideoClassifyKit.podspec
@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
8 8
9 Pod::Spec.new do |s| 9 Pod::Spec.new do |s|
10 s.name = 'CNLiveVideoClassifyKit' 10 s.name = 'CNLiveVideoClassifyKit'
11 - s.version = '0.0.38' 11 + s.version = '0.0.39'
12 s.summary = '视讯头部一二级菜单组件' 12 s.summary = '视讯头部一二级菜单组件'
13 13
14 # This description is used to generate tags and improve search results. 14 # This description is used to generate tags and improve search results.
CNLiveVideoClassifyKit/Classes/ClassifyCategory/Controller/CNLiveSubSegmentController.m
@@ -17,6 +17,7 @@ @@ -17,6 +17,7 @@
17 @property (nonatomic, strong) QMUIButton *searchBtn; 17 @property (nonatomic, strong) QMUIButton *searchBtn;
18 @property (nonatomic, strong) UIButton *moreBtn; 18 @property (nonatomic, strong) UIButton *moreBtn;
19 @property (nonatomic, strong) UIImageView *bgImgView;//背景图 19 @property (nonatomic, strong) UIImageView *bgImgView;//背景图
  20 +@property (nonatomic, strong) UIImageView *topImageView;
20 @property (nonatomic, strong) CNAudioPlayProgressView *progressView;//听见中国二级频道当前播放音乐的进度 21 @property (nonatomic, strong) CNAudioPlayProgressView *progressView;//听见中国二级频道当前播放音乐的进度
21 @property (nonatomic, strong) UIButton *playingBtn;//听见中国二级频道当前播放音乐按钮 22 @property (nonatomic, strong) UIButton *playingBtn;//听见中国二级频道当前播放音乐按钮
22 @property (nonatomic, strong) UIImageView *playingImgV;//听见中国二级频道当前播放音乐背景图 23 @property (nonatomic, strong) UIImageView *playingImgV;//听见中国二级频道当前播放音乐背景图
@@ -74,23 +75,6 @@ @@ -74,23 +75,6 @@
74 // 如果后台传了背景图 就设置背景图 75 // 如果后台传了背景图 就设置背景图
75 [self.view addSubview:self.bgImgView]; 76 [self.view addSubview:self.bgImgView];
76 [self.view sendSubviewToBack:self.bgImgView]; 77 [self.view sendSubviewToBack:self.bgImgView];
77 - if (!CNLiveStringIsEmpty(self.backImageH5)) {  
78 -  
79 - weakself  
80 - [self.bgImgView sd_setImageWithURL:[NSURL URLWithString:self.backImageH5] completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {  
81 - if (image) {  
82 - if (self.showType == CNLiveSubVCShowtypeChannel) {  
83 - weakSelf.bgImgView.height = KScreenWidth*image.size.height/image.size.width + 50;  
84 - }else{  
85 - weakSelf.bgImgView.height = KScreenWidth*image.size.height/image.size.width;  
86 - }  
87 - }  
88 - }];  
89 - }else{  
90 - if (CNLiveStringIsEmpty(self.backImage)) {  
91 - self.bgImgView.backgroundColor = CNLiveColorWithHexString(self.backgroundColor);  
92 - }  
93 - }  
94 [self handleDateWithChannelsArray]; 78 [self handleDateWithChannelsArray];
95 if ([CNWebRedirectHandle manager].isClickedIntegral) { 79 if ([CNWebRedirectHandle manager].isClickedIntegral) {
96 [CNWebRedirectHandle manager].isClickedIntegral = NO; 80 [CNWebRedirectHandle manager].isClickedIntegral = NO;
@@ -128,6 +112,31 @@ @@ -128,6 +112,31 @@
128 self.ld_currentIndex = 0; 112 self.ld_currentIndex = 0;
129 } 113 }
130 self.categoryView.defaultSelectedIndex = self.ld_currentIndex; 114 self.categoryView.defaultSelectedIndex = self.ld_currentIndex;
  115 +
  116 + if (!CNLiveStringIsEmpty(self.backImageH5)) {
  117 + CNCategoryGetChannelModel *model = (CNCategoryGetChannelModel *)[self.pageListArr wjj_safetyObjectAtIndex:self.ld_currentIndex];
  118 + NSString *backImageH5 = nil;
  119 + if (model.backgroundImgH5) {
  120 + backImageH5 = model.backgroundImgH5;
  121 + }else{
  122 + backImageH5 = self.backImageH5;
  123 +
  124 + }
  125 + weakself
  126 + [self.bgImgView sd_setImageWithURL:[NSURL URLWithString:self.backImageH5] completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
  127 + if (image) {
  128 + if (self.showType == CNLiveSubVCShowtypeChannel) {
  129 + weakSelf.bgImgView.height = KScreenWidth*image.size.height/image.size.width + 50;
  130 + }else{
  131 + weakSelf.bgImgView.height = KScreenWidth*image.size.height/image.size.width;
  132 + }
  133 + }
  134 + }];
  135 + }else{
  136 + if (CNLiveStringIsEmpty(self.backImage)) {
  137 + self.bgImgView.backgroundColor = CNLiveColorWithHexString(self.backgroundColor);
  138 + }
  139 + }
131 if (self.showType == CNLiveSubVCShowtypeClassify) { 140 if (self.showType == CNLiveSubVCShowtypeClassify) {
132 self.listContainerView.scrollView.scrollEnabled = NO; 141 self.listContainerView.scrollView.scrollEnabled = NO;
133 // 添加二级频道右侧的搜索按钮 142 // 添加二级频道右侧的搜索按钮
@@ -178,7 +187,17 @@ @@ -178,7 +187,17 @@
178 }; 187 };
179 }else{ 188 }else{
180 [self.view addSubview:self.navigationBar]; 189 [self.view addSubview:self.navigationBar];
181 - self.bgImgView.top = 0; 190 + [self.view addSubview:self.topImageView];
  191 + [self.view sendSubviewToBack:self.topImageView];
  192 + weakself
  193 + if (!CNLiveStringIsEmpty(self.backImage)) {
  194 + [self.topImageView sd_setImageWithURL:[NSURL URLWithString:self.backImage] completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
  195 + weakSelf.topImageView.height = KScreenWidth*image.size.height/image.size.width;
  196 + }];
  197 + }else{
  198 + self.topImageView.backgroundColor = CNLiveColorWithHexString(self.backgroundColor);
  199 + }
  200 + self.view.backgroundColor = kWhiteColor;
182 self.listContainerView.scrollView.scrollEnabled = YES; 201 self.listContainerView.scrollView.scrollEnabled = YES;
183 } 202 }
184 // Do any additional setup after loading the view. 203 // Do any additional setup after loading the view.
@@ -189,6 +208,8 @@ @@ -189,6 +208,8 @@
189 [super viewDidLayoutSubviews]; 208 [super viewDidLayoutSubviews];
190 if (self.showType == CNLiveSubVCShowtypeChannel) { 209 if (self.showType == CNLiveSubVCShowtypeChannel) {
191 self.myCategoryView.top = kNavigationBarHeight; 210 self.myCategoryView.top = kNavigationBarHeight;
  211 + self.topImageView.bottom = self.myCategoryView.bottom + 10;
  212 + self.bgImgView.top = self.myCategoryView.bottom + 10;
192 }else{ 213 }else{
193 self.searchBtn.right = KScreenWidth-12; 214 self.searchBtn.right = KScreenWidth-12;
194 self.myCategoryView.top = 0; 215 self.myCategoryView.top = 0;
@@ -357,6 +378,14 @@ @@ -357,6 +378,14 @@
357 378
358 -(void)refreshCurrentVCData 379 -(void)refreshCurrentVCData
359 { 380 {
  381 + CNCategoryGetChannelModel *model = (CNCategoryGetChannelModel *)[self.pageListArr wjj_safetyObjectAtIndex:self.ld_currentIndex];
  382 + NSString *backImageH5 = nil;
  383 + if (model.backgroundImgH5) {
  384 + backImageH5 = model.backgroundImgH5;
  385 + }else{
  386 + backImageH5 = self.backImageH5;
  387 +
  388 + }
360 weakself 389 weakself
361 [self.bgImgView sd_setImageWithURL:[NSURL URLWithString:self.backImageH5] completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) { 390 [self.bgImgView sd_setImageWithURL:[NSURL URLWithString:self.backImageH5] completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
362 if (image) { 391 if (image) {
@@ -367,7 +396,7 @@ @@ -367,7 +396,7 @@
367 } 396 }
368 } 397 }
369 }]; 398 }];
370 - CNCategoryGetChannelModel *model = (CNCategoryGetChannelModel *)[self.pageListArr wjj_safetyObjectAtIndex:self.ld_currentIndex]; 399 +
371 if (![CNUserShareManager isLogin]) { 400 if (![CNUserShareManager isLogin]) {
372 [BHConfig set:ChannelsSelectSecond value:self.channelId]; 401 [BHConfig set:ChannelsSelectSecond value:self.channelId];
373 } 402 }
@@ -521,7 +550,25 @@ @@ -521,7 +550,25 @@
521 #pragma mark - JXCategoryListContainerViewDelegate 550 #pragma mark - JXCategoryListContainerViewDelegate
522 - (id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index{ 551 - (id<JXCategoryListContentViewDelegate>)listContainerView:(JXCategoryListContainerView *)listContainerView initListForIndex:(NSInteger)index{
523 CNCategoryGetChannelModel *model = self.pageListArr[index]; 552 CNCategoryGetChannelModel *model = self.pageListArr[index];
524 - return [[CNLiveListController alloc] initWithModel:model black:_isBlack bgImage:self.backImage bgColor:self.backgroundColor bgImageH5:self.backImageH5]; 553 + NSString *backgroundColor = nil;
  554 + NSString *backImageH5 = nil;
  555 + NSString *backImage = nil;
  556 + if (model.backgroundColor) {
  557 + backgroundColor = model.backgroundColor;
  558 + }else{
  559 + backgroundColor = self.backgroundColor;
  560 + }
  561 + if (model.backgroundImgH5) {
  562 + backImageH5 = model.backgroundImgH5;
  563 + }else{
  564 + backImageH5 = self.backImageH5;
  565 + }
  566 + if (model.backgroundImg) {
  567 + backImage = model.backgroundImg;
  568 + }else{
  569 + backImage = self.backImage;
  570 + }
  571 + return [[CNLiveListController alloc] initWithModel:model black:_isBlack bgImage:backImage bgColor:backgroundColor bgImageH5:backImageH5];
525 } 572 }
526 #pragma mark - JXCategoryListContentViewDelegate 573 #pragma mark - JXCategoryListContentViewDelegate
527 -(UIView *)listView 574 -(UIView *)listView
@@ -565,7 +612,13 @@ @@ -565,7 +612,13 @@
565 [CNLiveClassifyJumpBridge listViewRefreshWithVC:list.childViewControllers[0] pageType:model.pageType.integerValue param:paramDic refreshTime:time]; 612 [CNLiveClassifyJumpBridge listViewRefreshWithVC:list.childViewControllers[0] pageType:model.pageType.integerValue param:paramDic refreshTime:time];
566 [self showGuideView]; 613 [self showGuideView];
567 weakself 614 weakself
568 - [self.bgImgView sd_setImageWithURL:[NSURL URLWithString:self.backImageH5] completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) { 615 + NSString *backImageH5 = nil;
  616 + if (model.backgroundImgH5) {
  617 + backImageH5 = model.backgroundImgH5;
  618 + }else{
  619 + backImageH5 = self.backImageH5;
  620 + }
  621 + [self.bgImgView sd_setImageWithURL:[NSURL URLWithString:backImageH5] completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
569 if (image) { 622 if (image) {
570 if (self.showType == CNLiveSubVCShowtypeChannel) { 623 if (self.showType == CNLiveSubVCShowtypeChannel) {
571 weakSelf.bgImgView.height = KScreenWidth*image.size.height/image.size.width + 50; 624 weakSelf.bgImgView.height = KScreenWidth*image.size.height/image.size.width + 50;
@@ -580,6 +633,16 @@ @@ -580,6 +633,16 @@
580 { 633 {
581 return (JXCategoryTitleView *)self.categoryView; 634 return (JXCategoryTitleView *)self.categoryView;
582 } 635 }
  636 +
  637 +- (UIImageView *)topImageView
  638 +{
  639 + if (!_topImageView) {
  640 + _topImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 50, KScreenWidth, kStatusHeight + 100)];
  641 + _topImageView.backgroundColor = kWhiteColor;
  642 + }
  643 + return _topImageView;
  644 +
  645 +}
583 - (UIImageView *)bgImgView { 646 - (UIImageView *)bgImgView {
584 if (!_bgImgView) { 647 if (!_bgImgView) {
585 _bgImgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 50, KScreenWidth, self.view.height/2-50)]; 648 _bgImgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 50, KScreenWidth, self.view.height/2-50)];
Example/CNLiveVideoClassifyKit.xcodeproj/project.pbxproj
@@ -7,6 +7,8 @@ @@ -7,6 +7,8 @@
7 objects = { 7 objects = {
8 8
9 /* Begin PBXBuildFile section */ 9 /* Begin PBXBuildFile section */
  10 + 082517CB2787EA36002F28BE /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 082517C52787EA36002F28BE /* LaunchScreen.storyboard */; };
  11 + 082517CC2787EA36002F28BE /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 082517C72787EA36002F28BE /* Main.storyboard */; };
10 083CB9C326D4ED2000E21EBC /* CNliveCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 0816338E26BE298900B076D6 /* CNliveCollectionViewCell.m */; }; 12 083CB9C326D4ED2000E21EBC /* CNliveCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 0816338E26BE298900B076D6 /* CNliveCollectionViewCell.m */; };
11 08DAFBDE26E8A2660099999A /* CNTools.m in Sources */ = {isa = PBXBuildFile; fileRef = 08DAFBDC26E8A2660099999A /* CNTools.m */; }; 13 08DAFBDE26E8A2660099999A /* CNTools.m in Sources */ = {isa = PBXBuildFile; fileRef = 08DAFBDC26E8A2660099999A /* CNTools.m */; };
12 08DAFBEA26E9E99C0099999A /* CNLiveClassifyKitImpl.m in Sources */ = {isa = PBXBuildFile; fileRef = 08DAFBE926E9E99C0099999A /* CNLiveClassifyKitImpl.m */; }; 14 08DAFBEA26E9E99C0099999A /* CNLiveClassifyKitImpl.m in Sources */ = {isa = PBXBuildFile; fileRef = 08DAFBE926E9E99C0099999A /* CNLiveClassifyKitImpl.m */; };
@@ -44,6 +46,8 @@ @@ -44,6 +46,8 @@
44 /* Begin PBXFileReference section */ 46 /* Begin PBXFileReference section */
45 0816338D26BE298900B076D6 /* CNliveCollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNliveCollectionViewCell.h; sourceTree = "<group>"; }; 47 0816338D26BE298900B076D6 /* CNliveCollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNliveCollectionViewCell.h; sourceTree = "<group>"; };
46 0816338E26BE298900B076D6 /* CNliveCollectionViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CNliveCollectionViewCell.m; sourceTree = "<group>"; }; 48 0816338E26BE298900B076D6 /* CNliveCollectionViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CNliveCollectionViewCell.m; sourceTree = "<group>"; };
  49 + 082517C62787EA36002F28BE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = LaunchScreen.storyboard; sourceTree = "<group>"; };
  50 + 082517C82787EA36002F28BE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Main.storyboard; sourceTree = "<group>"; };
47 08DAFBDC26E8A2660099999A /* CNTools.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CNTools.m; sourceTree = "<group>"; }; 51 08DAFBDC26E8A2660099999A /* CNTools.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CNTools.m; sourceTree = "<group>"; };
48 08DAFBDD26E8A2660099999A /* CNTools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CNTools.h; sourceTree = "<group>"; }; 52 08DAFBDD26E8A2660099999A /* CNTools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CNTools.h; sourceTree = "<group>"; };
49 08DAFBE826E9E99C0099999A /* CNLiveClassifyKitImpl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNLiveClassifyKitImpl.h; sourceTree = "<group>"; }; 53 08DAFBE826E9E99C0099999A /* CNLiveClassifyKitImpl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CNLiveClassifyKitImpl.h; sourceTree = "<group>"; };
@@ -110,6 +114,15 @@ @@ -110,6 +114,15 @@
110 /* End PBXFrameworksBuildPhase section */ 114 /* End PBXFrameworksBuildPhase section */
111 115
112 /* Begin PBXGroup section */ 116 /* Begin PBXGroup section */
  117 + 082517C42787EA36002F28BE /* Base.lproj */ = {
  118 + isa = PBXGroup;
  119 + children = (
  120 + 082517C52787EA36002F28BE /* LaunchScreen.storyboard */,
  121 + 082517C72787EA36002F28BE /* Main.storyboard */,
  122 + );
  123 + path = Base.lproj;
  124 + sourceTree = "<group>";
  125 + };
113 6003F581195388D10070C39A = { 126 6003F581195388D10070C39A = {
114 isa = PBXGroup; 127 isa = PBXGroup;
115 children = ( 128 children = (
@@ -147,6 +160,7 @@ @@ -147,6 +160,7 @@
147 6003F593195388D20070C39A /* Example for CNLiveVideoClassifyKit */ = { 160 6003F593195388D20070C39A /* Example for CNLiveVideoClassifyKit */ = {
148 isa = PBXGroup; 161 isa = PBXGroup;
149 children = ( 162 children = (
  163 + 082517C42787EA36002F28BE /* Base.lproj */,
150 6003F59C195388D20070C39A /* CNLIVEAppDelegate.h */, 164 6003F59C195388D20070C39A /* CNLIVEAppDelegate.h */,
151 6003F59D195388D20070C39A /* CNLIVEAppDelegate.m */, 165 6003F59D195388D20070C39A /* CNLIVEAppDelegate.m */,
152 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */, 166 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */,
@@ -310,6 +324,8 @@ @@ -310,6 +324,8 @@
310 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */, 324 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */,
311 71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */, 325 71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */,
312 6003F5A9195388D20070C39A /* Images.xcassets in Resources */, 326 6003F5A9195388D20070C39A /* Images.xcassets in Resources */,
  327 + 082517CC2787EA36002F28BE /* Main.storyboard in Resources */,
  328 + 082517CB2787EA36002F28BE /* LaunchScreen.storyboard in Resources */,
313 6003F598195388D20070C39A /* InfoPlist.strings in Resources */, 329 6003F598195388D20070C39A /* InfoPlist.strings in Resources */,
314 ); 330 );
315 runOnlyForDeploymentPostprocessing = 0; 331 runOnlyForDeploymentPostprocessing = 0;
@@ -502,6 +518,22 @@ @@ -502,6 +518,22 @@
502 /* End PBXTargetDependency section */ 518 /* End PBXTargetDependency section */
503 519
504 /* Begin PBXVariantGroup section */ 520 /* Begin PBXVariantGroup section */
  521 + 082517C52787EA36002F28BE /* LaunchScreen.storyboard */ = {
  522 + isa = PBXVariantGroup;
  523 + children = (
  524 + 082517C62787EA36002F28BE /* Base */,
  525 + );
  526 + name = LaunchScreen.storyboard;
  527 + sourceTree = "<group>";
  528 + };
  529 + 082517C72787EA36002F28BE /* Main.storyboard */ = {
  530 + isa = PBXVariantGroup;
  531 + children = (
  532 + 082517C82787EA36002F28BE /* Base */,
  533 + );
  534 + name = Main.storyboard;
  535 + sourceTree = "<group>";
  536 + };
505 6003F596195388D20070C39A /* InfoPlist.strings */ = { 537 6003F596195388D20070C39A /* InfoPlist.strings */ = {
506 isa = PBXVariantGroup; 538 isa = PBXVariantGroup;
507 children = ( 539 children = (
Example/CNLiveVideoClassifyKit/CNLiveClassifyKitImpl.m
@@ -11,6 +11,7 @@ @@ -11,6 +11,7 @@
11 #import "CNLIVEViewController.h" 11 #import "CNLIVEViewController.h"
12 #import <CNLiveCWebViewModule/CNLiveCWebViewModule.h> 12 #import <CNLiveCWebViewModule/CNLiveCWebViewModule.h>
13 #import <CNLiveCWebViewModule/CNLiveSubWebViewController.h> 13 #import <CNLiveCWebViewModule/CNLiveSubWebViewController.h>
  14 +#import "CNLiveWebViewModuleImpl.h"
14 #import <CNLiveCommonCategory/NSString+CNLiveUrlEncode.h> 15 #import <CNLiveCommonCategory/NSString+CNLiveUrlEncode.h>
15 16
16 @implementation CNLiveClassifyKitImpl 17 @implementation CNLiveClassifyKitImpl
@@ -37,7 +38,7 @@ @@ -37,7 +38,7 @@
37 } 38 }
38 thirdUrl = [thirdUrl stringByAppendingFormat:@"%@backgroundColor=%@&backgroundImgH5=%@",andStr,backgroundColor?[backgroundColor urlEncode]:@"",backImageH5?[backImageH5 urlEncode]:@""]; 39 thirdUrl = [thirdUrl stringByAppendingFormat:@"%@backgroundColor=%@&backgroundImgH5=%@",andStr,backgroundColor?[backgroundColor urlEncode]:@"",backImageH5?[backImageH5 urlEncode]:@""];
39 } 40 }
40 - CNLiveSubWebViewController *subVC = [CNLiveCWebViewModule showWebVCWithLunchForWebURL:thirdUrl ParamDict:param ShowType:CNLiveWebViewLunchShowTypeHidden]; 41 + CNLiveSubWebViewController *subVC = (CNLiveSubWebViewController*)[CNLiveWebViewModuleImpl pushClassifyWebViewWithWebTitle:param[@"title"] url:thirdUrl intercept:YES isHiddenFirst:NO isBlack:[param boolForKey:@"isBlack"]];
41 return subVC; 42 return subVC;
42 } 43 }
43 44
Example/CNLiveVideoClassifyKit/CNLiveWebViewModuleImpl.h
@@ -6,14 +6,33 @@ @@ -6,14 +6,33 @@
6 // Copyright © 2021 woshiliushiyu. All rights reserved. 6 // Copyright © 2021 woshiliushiyu. All rights reserved.
7 // 7 //
8 8
9 -#import <Foundation/Foundation.h> 9 +#import <UIKit/UIKit.h>
10 #import <CNLiveCWebViewModule/CNLiveCWebViewModule.h> 10 #import <CNLiveCWebViewModule/CNLiveCWebViewModule.h>
11 #import <CNLiveCWebViewModule/CNLiveWebViewModuleHeader.h> 11 #import <CNLiveCWebViewModule/CNLiveWebViewModuleHeader.h>
  12 +
12 13
13 NS_ASSUME_NONNULL_BEGIN 14 NS_ASSUME_NONNULL_BEGIN
14 15
15 @interface CNLiveWebViewModuleImpl : NSObject<CNLiveWebViewModuleProtocol> 16 @interface CNLiveWebViewModuleImpl : NSObject<CNLiveWebViewModuleProtocol>
16 17
  18 +/// 跳转 CNBellwethersWebviewController 领头雁专用课题webView继承问题修改
  19 +/// @param title 标题
  20 ++(UIViewController * )pushClassifyWebViewWithWebTitle:(nullable NSString *)title
  21 + url:(nullable NSString *)url
  22 + intercept:(BOOL)intercept
  23 + isHiddenFirst:(BOOL)isHiddenFirst
  24 + isBlack:(BOOL)isBlack;
  25 +
  26 +
  27 +/// 跳转
  28 +/// @param type 1 返回需要有控制器的(界面暂时需要老webVC,暂时发现为直播预约界面)
  29 +///
  30 +/// 0 直接返回界面界面进行跳转
  31 ++(UIViewController *)pushDarenWebViewWithWebType:(NSInteger)type
  32 + webUrl:(NSString *)url
  33 + title:(NSString *)title
  34 + statUrl:(nullable NSString *)statUrl
  35 + shareType:(nullable NSString *)shareType;
17 @end 36 @end
18 37
19 NS_ASSUME_NONNULL_END 38 NS_ASSUME_NONNULL_END
Example/CNLiveVideoClassifyKit/CNLiveWebViewModuleImpl.m
@@ -8,88 +8,49 @@ @@ -8,88 +8,49 @@
8 8
9 #import "CNLiveWebViewModuleImpl.h" 9 #import "CNLiveWebViewModuleImpl.h"
10 #import <CNLiveCWebViewModule/CNLiveWebViewModuleEnum.h> 10 #import <CNLiveCWebViewModule/CNLiveWebViewModuleEnum.h>
11 -#import <CNLiveVideoClassifyKit/CNLiveListManager.h> 11 +#import <CNLiveCWebViewModule/CNLiveSubWebViewController.h>
  12 +#import "CNWebRedirectHandle.h"
12 13
13 @implementation CNLiveWebViewModuleImpl 14 @implementation CNLiveWebViewModuleImpl
14 15
15 -/// 调用工程中复制Appdelegate参数方法  
16 -/// @param shareTaskId 分享动作方法  
17 -/// @param shareId 分享id  
18 -/// @param shareUrl 分享链接  
19 --(void)requestWebViewShareContentShareTaskId:(NSString *)shareTaskId  
20 - ShareId:(NSString *)shareId  
21 - ShareUrl:(NSString *)shareUrl 16 +#pragma mark =
  17 +
  18 +/// 跳转
  19 +/// @param title 标题
  20 ++(UIViewController * )pushClassifyWebViewWithWebTitle:(NSString *)title url:(NSString *)url intercept:(BOOL)intercept isHiddenFirst:(BOOL)isHiddenFirst isBlack:(BOOL)isBlack
22 { 21 {
  22 +#ifdef DEBUG
  23 + [QMUIConsole logWithLevel:@"Info" name:@"liushiyu" logString:[NSString stringWithFormat:@"现在跳转的地址=>%@",url]];
  24 + [[UIPasteboard generalPasteboard] setString:@""];
  25 + [[UIPasteboard generalPasteboard] setString:url];
  26 +#else
  27 +#endif
23 28
  29 + CNLiveWebViewController * webV = [CNLiveCWebViewModule showWebVCWithLunchForWebURL:url ParamDict:@{@"isBlock":[NSNumber numberWithBool:isBlack],@"isIntercept":[NSNumber numberWithBool:intercept]} ShowType:CNLiveWebViewLunchShowTypeHidden];
  30 + webV.title = title;
  31 + return webV;
24 } 32 }
25 33
26 -/// 调用工程中分享功能  
27 -/// @param shareName 分享标题  
28 -/// @param shareDesc 分享描述  
29 -/// @param shareUrl 分享链接  
30 -/// @param shareImg 分享图片地址  
31 -/// @param imageArray 动作按钮图片集合  
32 -/// @param titleArray 动作按钮标题集合  
33 -/// @param fromType 调用平台  
34 --(void)requestWebViewShareClickWithShareName:(NSString *)shareName  
35 - ShareDesc:(NSString *)shareDesc  
36 - ShareUrl:(NSString *)shareUrl  
37 - ShareImg:(NSString *)shareImg  
38 - ImageArray:(NSArray *)imageArray  
39 - TitleArray:(NSArray *)titleArray  
40 - PlatformType:(CNLiveWebSharePlatformType)fromType  
41 -{  
42 - NSLog(@"调用分享方法");  
43 -} 34 +/// 跳转
  35 +/// @param type 跳转的各种类型
  36 +
  37 +#pragma mark - CWebViewDelegate -
44 38
45 -/// 与H5交互方法  
46 -/// @param handleName 交互key通着这个值进行点击判别  
47 -/// @param webBridge 桥接文件  
48 -/// @param resultData 交互参数  
49 --(void)requestWebViewBridgeClickWithHandlerName:(NSString *)handleName  
50 - WebBridge:(WKWebViewJavascriptBridge *)webBridge  
51 - FromVC:(CNLiveWebViewController *)fromVC  
52 - ResultData:(id)resultData  
53 - CompleterBlock:( void (^)(id _Nonnull))completerBlock  
54 -{  
55 - NSLog(@"交互方法响应了=>%@ 参数=>%@",handleName,resultData);  
56 - if ([handleName isEqualToString:kCNLiveWebForJSRegisterKWIdentifier]) {  
57 -  
58 - }  
59 -}  
60 39
61 -/// 调用主工程中支付宝支付方法  
62 -/// @param contentURL 内容url  
63 -/// @param completerBlock 完成回调  
64 --(BOOL)requestWebViewWithAlipayForContentUrl:(NSString *)contentURL  
65 - CompleterBlock:(void(^)(NSDictionary *result))completerBlock  
66 -{  
67 -  
68 - return YES;  
69 -}  
70 40
71 -/// 目击者视频下载  
72 -/// @param videoURL 下载地址  
73 --(void)requestWebViewDownLoadWitnessVideoWithVideoURL:(NSString *)videoURL  
74 -{  
75 -  
76 -}  
77 41
78 -/// 设置跳转工程中其他界面的方法  
79 -/// @param contentURL 内容URL  
80 --(void)requestWebViewSkipManagerForContentURL:(NSString *)contentURL  
81 -{  
82 -  
83 -}  
84 42
85 -/// 设置跳转工程中其他界面的方法(输入)  
86 -/// @param inputURL 内容URL  
87 --(void)requestWebViewSkipManagerForInputURL:(NSString *)inputURL 43 +
  44 +
  45 +
  46 +/// webView滚动方法回调,只有当CNLiveWebViewLunchShowType为CNLiveWebViewLunchShowTypeHidden时响应
  47 +/// @param scrollView 滚动视图
  48 +/// @param isBeginDragging 是否是初始滚动
  49 +-(void)requestWebViewForScrollView:(UIScrollView *)scrollView isBeginDragging:(BOOL)isBeginDragging
88 { 50 {
89 51
90 } 52 }
91 53
92 -/// 通过设置改方法为YES 则工程中所有调用网页入口方法都会转为 requestWebViewWithSkipWebViewForWebURL:方法进行响应  
93 -(BOOL)requestWebViewWithSkipNewWebViewOrJunBoWebView 54 -(BOOL)requestWebViewWithSkipNewWebViewOrJunBoWebView
94 { 55 {
95 return NO; 56 return NO;
@@ -100,8 +61,8 @@ @@ -100,8 +61,8 @@
100 /// @param paramDict 参数字典 61 /// @param paramDict 参数字典
101 /// @param showType 显示类型 62 /// @param showType 显示类型
102 -(CNLiveWebViewController *)requestWebViewWithSkipWebViewForWebURL:(NSString *)webUrl 63 -(CNLiveWebViewController *)requestWebViewWithSkipWebViewForWebURL:(NSString *)webUrl
103 - ParamDict:(NSDictionary *)paramDict  
104 - ShowType:(CNLiveWebViewLunchShowType)showType 64 + ParamDict:(NSDictionary *)paramDict
  65 + ShowType:(CNLiveWebViewLunchShowType)showType
105 { 66 {
106 NSLog(@"用老webView跳转到这个地址=>%@",webUrl); 67 NSLog(@"用老webView跳转到这个地址=>%@",webUrl);
107 return [CNLiveWebViewController new]; 68 return [CNLiveWebViewController new];
@@ -112,12 +73,12 @@ @@ -112,12 +73,12 @@
112 /// responseWebViewWithJavascriptBridgeToWebViewForBridgeName 73 /// responseWebViewWithJavascriptBridgeToWebViewForBridgeName
113 -(void)requestWebViewRegisterJavascriptBridgeMethod 74 -(void)requestWebViewRegisterJavascriptBridgeMethod
114 { 75 {
115 - 76 + //临时测试放在这里
  77 +// [[CNLiveCWebViewModule shareWebViewModuleDelegate] responseWebViewWithWebViewToJavascriptBridgeForBridgeName:@"wjjToSPMain" Result:^(id _Nonnull data, CNLiveResponseCallback _Nonnull callBack) {
  78 +// NSLog(@"%@",callBack);
  79 +// }];
116 } 80 }
117 81
118 -- (void)requestWebViewForScrollView:(nonnull UIScrollView *)scrollView isBeginDragging:(BOOL)isBeginDragging {  
119 -  
120 -}  
121 82
122 83
123 84
Example/Podfile.lock
@@ -118,7 +118,7 @@ PODS: @@ -118,7 +118,7 @@ PODS:
118 - CNLiveBusinessTools 118 - CNLiveBusinessTools
119 - CNLiveCustomUI/CNLiveGetImage 119 - CNLiveCustomUI/CNLiveGetImage
120 - CNLiveNewTripartiteManagement/MJRefresh 120 - CNLiveNewTripartiteManagement/MJRefresh
121 - - CNLiveCWebViewModule (0.2.1): 121 + - CNLiveCWebViewModule (0.2.2):
122 - CNLiveCustomUI 122 - CNLiveCustomUI
123 - CNLiveEnvironment 123 - CNLiveEnvironment
124 - CNLiveNewTripartiteManagement/Masonry 124 - CNLiveNewTripartiteManagement/Masonry
@@ -161,7 +161,7 @@ PODS: @@ -161,7 +161,7 @@ PODS:
161 - CNLiveSDK/CNLiveStat (0.3.4.8) 161 - CNLiveSDK/CNLiveStat (0.3.4.8)
162 - CNLiveUserManagement (0.1.5): 162 - CNLiveUserManagement (0.1.5):
163 - CNLiveNewTripartiteManagement/MJExtension 163 - CNLiveNewTripartiteManagement/MJExtension
164 - - CNLiveVideoClassifyKit (0.0.36): 164 + - CNLiveVideoClassifyKit (0.0.38):
165 - CNLiveBaseKit 165 - CNLiveBaseKit
166 - CNLiveBeeHive 166 - CNLiveBeeHive
167 - CNLiveBusinessBaseModule 167 - CNLiveBusinessBaseModule
@@ -588,13 +588,13 @@ SPEC CHECKSUMS: @@ -588,13 +588,13 @@ SPEC CHECKSUMS:
588 CNLiveCommonCategory: 22c9842b31f2087803ae69e983b2c944fb80eae1 588 CNLiveCommonCategory: 22c9842b31f2087803ae69e983b2c944fb80eae1
589 CNLiveCustomControl: a692e47171afb799cebc210a8e77c5a4ddfc2099 589 CNLiveCustomControl: a692e47171afb799cebc210a8e77c5a4ddfc2099
590 CNLiveCustomUI: b704f07f5f734e45c06bda1877e67b5f9e5d3581 590 CNLiveCustomUI: b704f07f5f734e45c06bda1877e67b5f9e5d3581
591 - CNLiveCWebViewModule: 97d40b79c45b026f72d83bf2f6501912a1148572 591 + CNLiveCWebViewModule: 526a764ed102149405e42face52c7b676a48a737
592 CNLiveEnvironment: 48ba0f934399fd25fc54dc3239009754bcc1ddb3 592 CNLiveEnvironment: 48ba0f934399fd25fc54dc3239009754bcc1ddb3
593 CNLiveNewTripartiteManagement: 29ddb2d23ee77bcd42ba5eaf5f1322ed37db5baa 593 CNLiveNewTripartiteManagement: 29ddb2d23ee77bcd42ba5eaf5f1322ed37db5baa
594 CNLiveRequestBastKit: 9fe28913b94a0a072298eba3356f17b98ef0b6cd 594 CNLiveRequestBastKit: 9fe28913b94a0a072298eba3356f17b98ef0b6cd
595 CNLiveSDK: 75bafaafbb8c09dcb4420adfe0f05130405b25e7 595 CNLiveSDK: 75bafaafbb8c09dcb4420adfe0f05130405b25e7
596 CNLiveUserManagement: ead053f2d701b01ea8fb5f1da572be788f2dd3cf 596 CNLiveUserManagement: ead053f2d701b01ea8fb5f1da572be788f2dd3cf
597 - CNLiveVideoClassifyKit: 2b21a4818b6712b9dd1703381777096a1315c670 597 + CNLiveVideoClassifyKit: 8fe40083a61b7596c248405451d0cede1c96af15
598 FWDebug: 5a20d089a300517153de1438d8128ad4c4690951 598 FWDebug: 5a20d089a300517153de1438d8128ad4c4690951
599 JXCategoryView: 2ef9ecfd3735158d009ce02d1f29811aa822da65 599 JXCategoryView: 2ef9ecfd3735158d009ce02d1f29811aa822da65
600 Masonry: 678fab65091a9290e40e2832a55e7ab731aad201 600 Masonry: 678fab65091a9290e40e2832a55e7ab731aad201