Commit 598c5d644bc46e75f3173a33c3bb3076696821e3

Authored by yanglingyu
1 parent debde431

二级背景图展示逻辑调整

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.39' 11 + s.version = '0.0.40'
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
@@ -113,30 +113,7 @@ @@ -113,30 +113,7 @@
113 } 113 }
114 self.categoryView.defaultSelectedIndex = self.ld_currentIndex; 114 self.categoryView.defaultSelectedIndex = self.ld_currentIndex;
115 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 - } 116 + [self refreshBgImageColor];
140 if (self.showType == CNLiveSubVCShowtypeClassify) { 117 if (self.showType == CNLiveSubVCShowtypeClassify) {
141 self.listContainerView.scrollView.scrollEnabled = NO; 118 self.listContainerView.scrollView.scrollEnabled = NO;
142 // 添加二级频道右侧的搜索按钮 119 // 添加二级频道右侧的搜索按钮
@@ -379,24 +356,8 @@ @@ -379,24 +356,8 @@
379 -(void)refreshCurrentVCData 356 -(void)refreshCurrentVCData
380 { 357 {
381 CNCategoryGetChannelModel *model = (CNCategoryGetChannelModel *)[self.pageListArr wjj_safetyObjectAtIndex:self.ld_currentIndex]; 358 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 - }  
389 - weakself  
390 - [self.bgImgView sd_setImageWithURL:[NSURL URLWithString:self.backImageH5] completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {  
391 - if (image) {  
392 - if (self.showType == CNLiveSubVCShowtypeChannel) {  
393 - weakSelf.bgImgView.height = KScreenWidth*image.size.height/image.size.width + 50;  
394 - }else{  
395 - weakSelf.bgImgView.height = KScreenWidth*image.size.height/image.size.width;  
396 - }  
397 - }  
398 - }];  
399 - 359 + [self refreshBgImageColor];
  360 +
400 if (![CNUserShareManager isLogin]) { 361 if (![CNUserShareManager isLogin]) {
401 [BHConfig set:ChannelsSelectSecond value:self.channelId]; 362 [BHConfig set:ChannelsSelectSecond value:self.channelId];
402 } 363 }
@@ -418,6 +379,40 @@ @@ -418,6 +379,40 @@
418 CNLiveListController *list = controllers[@(self.ld_currentIndex)]; 379 CNLiveListController *list = controllers[@(self.ld_currentIndex)];
419 [CNLiveClassifyJumpBridge listViewRefreshWithVC:list.childViewControllers[0] pageType:model.pageType.integerValue param:paramDic refreshTime:time]; 380 [CNLiveClassifyJumpBridge listViewRefreshWithVC:list.childViewControllers[0] pageType:model.pageType.integerValue param:paramDic refreshTime:time];
420 } 381 }
  382 +-(void)refreshBgImageColor{
  383 + CNCategoryGetChannelModel *model = (CNCategoryGetChannelModel *)[self.pageListArr wjj_safetyObjectAtIndex:self.ld_currentIndex];
  384 + NSString *backImageH5 = nil;
  385 + if (!CNLiveStringIsEmpty(model.backgroundImgH5)) {
  386 + backImageH5 = model.backgroundImgH5;
  387 + }else if (CNLiveStringIsEmpty(model.backgroundColor)){
  388 + backImageH5 = self.backImageH5;
  389 +
  390 + }
  391 + NSString *backgroundColor = nil;
  392 + if (!CNLiveStringIsEmpty(model.backgroundColor)) {
  393 + backgroundColor = model.backgroundColor;
  394 + }else{
  395 + backgroundColor = self.backgroundColor;
  396 + }
  397 + if (!CNLiveStringIsEmpty(backImageH5)) {
  398 + self.bgImgView.backgroundColor = kWhiteColor;
  399 + weakself
  400 + [self.bgImgView sd_setImageWithURL:[NSURL URLWithString:backImageH5] completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
  401 + if (image) {
  402 + if (self.showType == CNLiveSubVCShowtypeChannel) {
  403 + weakSelf.bgImgView.height = KScreenWidth*image.size.height/image.size.width + 50;
  404 + }else{
  405 + weakSelf.bgImgView.height = KScreenWidth*image.size.height/image.size.width;
  406 + }
  407 + }
  408 + }];
  409 + }else if(!CNLiveStringIsEmpty(backgroundColor)){
  410 + self.bgImgView.backgroundColor = CNLiveColorWithHexString(backgroundColor);
  411 + self.bgImgView.height = self.view.height/2;
  412 + }else{
  413 + self.bgImgView.backgroundColor = kWhiteColor;
  414 + }
  415 +}
421 -(void)showGuideView 416 -(void)showGuideView
422 { 417 {
423 if (![CNUserShareManager isLogin] || [BHConfig boolValue:wjjIsShowWitnessShadeKey]) { 418 if (![CNUserShareManager isLogin] || [BHConfig boolValue:wjjIsShowWitnessShadeKey]) {
@@ -553,17 +548,17 @@ @@ -553,17 +548,17 @@
553 NSString *backgroundColor = nil; 548 NSString *backgroundColor = nil;
554 NSString *backImageH5 = nil; 549 NSString *backImageH5 = nil;
555 NSString *backImage = nil; 550 NSString *backImage = nil;
556 - if (model.backgroundColor) { 551 + if (!CNLiveStringIsEmpty(model.backgroundColor)) {
557 backgroundColor = model.backgroundColor; 552 backgroundColor = model.backgroundColor;
558 }else{ 553 }else{
559 backgroundColor = self.backgroundColor; 554 backgroundColor = self.backgroundColor;
560 } 555 }
561 - if (model.backgroundImgH5) { 556 + if (!CNLiveStringIsEmpty(model.backgroundImgH5)) {
562 backImageH5 = model.backgroundImgH5; 557 backImageH5 = model.backgroundImgH5;
563 - }else{ 558 + }else if (CNLiveStringIsEmpty(model.backgroundColor)){
564 backImageH5 = self.backImageH5; 559 backImageH5 = self.backImageH5;
565 } 560 }
566 - if (model.backgroundImg) { 561 + if (!CNLiveStringIsEmpty(model.backgroundImg)) {
567 backImage = model.backgroundImg; 562 backImage = model.backgroundImg;
568 }else{ 563 }else{
569 backImage = self.backImage; 564 backImage = self.backImage;
@@ -591,8 +586,8 @@ @@ -591,8 +586,8 @@
591 NSDictionary *paramDic = nil; 586 NSDictionary *paramDic = nil;
592 if ([model.pageType isEqualToString:@"4"] || [model.pageType isEqualToString:@"5"]){ 587 if ([model.pageType isEqualToString:@"4"] || [model.pageType isEqualToString:@"5"]){
593 paramDic= @{ 588 paramDic= @{
594 - @"bgColor": model.backgroundColor?model.backgroundColor:@"",  
595 - @"backgroundImg": model.backgroundImg?model.backgroundImg:@"", 589 + @"bgColor": model.backgroundColor?model.backgroundColor:self.backgroundColor? self.backgroundColor :@"",
  590 + @"backgroundImg": model.backgroundImg?model.backgroundImg:self.backImage ? self.backImage:@"",
596 @"channelId":model.channelId?model.channelId:@"", 591 @"channelId":model.channelId?model.channelId:@"",
597 @"channelName":model.id?model.id:@"", 592 @"channelName":model.id?model.id:@"",
598 @"pageId":model.pageId?model.pageId:@"", 593 @"pageId":model.pageId?model.pageId:@"",
@@ -611,22 +606,7 @@ @@ -611,22 +606,7 @@
611 CNLiveListController *list = controllers[@(self.ld_currentIndex)]; 606 CNLiveListController *list = controllers[@(self.ld_currentIndex)];
612 [CNLiveClassifyJumpBridge listViewRefreshWithVC:list.childViewControllers[0] pageType:model.pageType.integerValue param:paramDic refreshTime:time]; 607 [CNLiveClassifyJumpBridge listViewRefreshWithVC:list.childViewControllers[0] pageType:model.pageType.integerValue param:paramDic refreshTime:time];
613 [self showGuideView]; 608 [self showGuideView];
614 - weakself  
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) {  
622 - if (image) {  
623 - if (self.showType == CNLiveSubVCShowtypeChannel) {  
624 - weakSelf.bgImgView.height = KScreenWidth*image.size.height/image.size.width + 50;  
625 - }else{  
626 - weakSelf.bgImgView.height = KScreenWidth*image.size.height/image.size.width;  
627 - }  
628 - }  
629 - }]; 609 + [self refreshBgImageColor];
630 } 610 }
631 #pragma mark - Getting&&Setting 611 #pragma mark - Getting&&Setting
632 -(JXCategoryTitleView *)myCategoryView 612 -(JXCategoryTitleView *)myCategoryView
Example/CNLiveVideoClassifyKit/CNLIVEAppDelegate.m
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
13 13
14 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
15 { 15 {
16 - [CNLiveEnvironmentManager setEnvironment:CNLiveDebugAppStore];//CNLiveDebugAppStore];//CNLiveProductionAppStore//CNLiveTestFlight 16 + [CNLiveEnvironmentManager setEnvironment:CNLiveProductionAppStore];//CNLiveDebugAppStore];//CNLiveProductionAppStore//CNLiveTestFlight
17 // Override point for customization after application launch. 17 // Override point for customization after application launch.
18 return YES; 18 return YES;
19 } 19 }
Example/CNLiveVideoClassifyKit/CNLIVEViewController.h
@@ -8,7 +8,8 @@ @@ -8,7 +8,8 @@
8 8
9 @import UIKit; 9 @import UIKit;
10 #import <QMUIKit/QMUIKit.h> 10 #import <QMUIKit/QMUIKit.h>
  11 +#import <CNLiveBusinessBaseModule/CNCommonViewController.h>
11 12
12 -@interface CNLIVEViewController : QMUICommonViewController 13 +@interface CNLIVEViewController : CNCommonViewController
13 14
14 @end 15 @end
Example/CNLiveVideoClassifyKit/CNLiveClassifyKitImpl.m
@@ -29,14 +29,14 @@ @@ -29,14 +29,14 @@
29 return demo; 29 return demo;
30 }else{ 30 }else{
31 NSString *thirdUrl = param[@"thirdUrl"]; 31 NSString *thirdUrl = param[@"thirdUrl"];
32 - NSString *backgroundColor = param[@"backgroundColor"]; 32 + NSString *backgroundColor = param[@"bgColor"];
33 NSString *backImageH5 = param[@"backgroundImgH5"]; 33 NSString *backImageH5 = param[@"backgroundImgH5"];
34 if (!CNLiveStringIsEmpty(thirdUrl)) { 34 if (!CNLiveStringIsEmpty(thirdUrl)) {
35 NSString *andStr = @"&"; 35 NSString *andStr = @"&";
36 if (![thirdUrl cn_containsString:@"?"]) { 36 if (![thirdUrl cn_containsString:@"?"]) {
37 andStr = @"?"; 37 andStr = @"?";
38 } 38 }
39 - thirdUrl = [thirdUrl stringByAppendingFormat:@"%@backgroundColor=%@&backgroundImgH5=%@",andStr,backgroundColor?[backgroundColor urlEncode]:@"",backImageH5?[backImageH5 urlEncode]:@""]; 39 + thirdUrl = [thirdUrl stringByAppendingFormat:@"%@backgroundColor=%@&backgroundImgH5=%@",andStr,backgroundColor?backgroundColor:@"",backImageH5?[backImageH5 urlEncode]:@""];
40 } 40 }
41 CNLiveSubWebViewController *subVC = (CNLiveSubWebViewController*)[CNLiveWebViewModuleImpl pushClassifyWebViewWithWebTitle:param[@"title"] url:thirdUrl intercept:YES isHiddenFirst:NO isBlack:[param boolForKey:@"isBlack"]]; 41 CNLiveSubWebViewController *subVC = (CNLiveSubWebViewController*)[CNLiveWebViewModuleImpl pushClassifyWebViewWithWebTitle:param[@"title"] url:thirdUrl intercept:YES isHiddenFirst:NO isBlack:[param boolForKey:@"isBlack"]];
42 return subVC; 42 return subVC;
Example/Podfile.lock
@@ -34,7 +34,7 @@ PODS: @@ -34,7 +34,7 @@ PODS:
34 - CNLiveBeeHive 34 - CNLiveBeeHive
35 - CNLiveBServices/Service (0.1.3.9): 35 - CNLiveBServices/Service (0.1.3.9):
36 - CNLiveBeeHive 36 - CNLiveBeeHive
37 - - CNLiveBusinessBaseModule (0.2.0): 37 + - CNLiveBusinessBaseModule (0.2.2):
38 - CNLiveBaseKit 38 - CNLiveBaseKit
39 - CNLiveBeeHive 39 - CNLiveBeeHive
40 - CNLiveBServices 40 - CNLiveBServices
@@ -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.2): 121 + - CNLiveCWebViewModule (0.2.3):
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.38): 164 + - CNLiveVideoClassifyKit (0.0.39):
165 - CNLiveBaseKit 165 - CNLiveBaseKit
166 - CNLiveBeeHive 166 - CNLiveBeeHive
167 - CNLiveBusinessBaseModule 167 - CNLiveBusinessBaseModule
@@ -582,19 +582,19 @@ SPEC CHECKSUMS: @@ -582,19 +582,19 @@ SPEC CHECKSUMS:
582 CNLiveBaseKit: 44e5fc573cbca78a86b704cf77c886ef53889807 582 CNLiveBaseKit: 44e5fc573cbca78a86b704cf77c886ef53889807
583 CNLiveBeeHive: 1e105b15b6ccaad546258fcf91231563beb853d4 583 CNLiveBeeHive: 1e105b15b6ccaad546258fcf91231563beb853d4
584 CNLiveBServices: 747c8c6c8d300c4daaeb108027c5886c66ed02ce 584 CNLiveBServices: 747c8c6c8d300c4daaeb108027c5886c66ed02ce
585 - CNLiveBusinessBaseModule: 1d2eee2e04c8db762781b7ad45278d043db56748 585 + CNLiveBusinessBaseModule: c3e34e44ea164034318e6ba4802a16961ff43ecd
586 CNLiveBusinessTools: 3cb2335316d1a330a179ea11151db0d5c203adb4 586 CNLiveBusinessTools: 3cb2335316d1a330a179ea11151db0d5c203adb4
587 CNLiveCategory: c90a01af1e20cd89f47d4f551d47d2ddc9ca96f3 587 CNLiveCategory: c90a01af1e20cd89f47d4f551d47d2ddc9ca96f3
588 CNLiveCommonCategory: 22c9842b31f2087803ae69e983b2c944fb80eae1 588 CNLiveCommonCategory: 22c9842b31f2087803ae69e983b2c944fb80eae1
589 CNLiveCustomControl: a692e47171afb799cebc210a8e77c5a4ddfc2099 589 CNLiveCustomControl: a692e47171afb799cebc210a8e77c5a4ddfc2099
590 CNLiveCustomUI: b704f07f5f734e45c06bda1877e67b5f9e5d3581 590 CNLiveCustomUI: b704f07f5f734e45c06bda1877e67b5f9e5d3581
591 - CNLiveCWebViewModule: 526a764ed102149405e42face52c7b676a48a737 591 + CNLiveCWebViewModule: 92635bbd539554f861f24857792ff36ceeb2a368
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: 8fe40083a61b7596c248405451d0cede1c96af15 597 + CNLiveVideoClassifyKit: 61ffd55d9d1e75da84d362d6e3a2097faf254181
598 FWDebug: 5a20d089a300517153de1438d8128ad4c4690951 598 FWDebug: 5a20d089a300517153de1438d8128ad4c4690951
599 JXCategoryView: 2ef9ecfd3735158d009ce02d1f29811aa822da65 599 JXCategoryView: 2ef9ecfd3735158d009ce02d1f29811aa822da65
600 Masonry: 678fab65091a9290e40e2832a55e7ab731aad201 600 Masonry: 678fab65091a9290e40e2832a55e7ab731aad201