Commit 598c5d644bc46e75f3173a33c3bb3076696821e3
1 parent
debde431
二级背景图展示逻辑调整
Showing
6 changed files
with
56 additions
and
75 deletions
CNLiveVideoClassifyKit.podspec
CNLiveVideoClassifyKit/Classes/ClassifyCategory/Controller/CNLiveSubSegmentController.m
| ... | ... | @@ -113,30 +113,7 @@ |
| 113 | 113 | } |
| 114 | 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 | 117 | if (self.showType == CNLiveSubVCShowtypeClassify) { |
| 141 | 118 | self.listContainerView.scrollView.scrollEnabled = NO; |
| 142 | 119 | // 添加二级频道右侧的搜索按钮 |
| ... | ... | @@ -379,24 +356,8 @@ |
| 379 | 356 | -(void)refreshCurrentVCData |
| 380 | 357 | { |
| 381 | 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 | 361 | if (![CNUserShareManager isLogin]) { |
| 401 | 362 | [BHConfig set:ChannelsSelectSecond value:self.channelId]; |
| 402 | 363 | } |
| ... | ... | @@ -418,6 +379,40 @@ |
| 418 | 379 | CNLiveListController *list = controllers[@(self.ld_currentIndex)]; |
| 419 | 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 | 416 | -(void)showGuideView |
| 422 | 417 | { |
| 423 | 418 | if (![CNUserShareManager isLogin] || [BHConfig boolValue:wjjIsShowWitnessShadeKey]) { |
| ... | ... | @@ -553,17 +548,17 @@ |
| 553 | 548 | NSString *backgroundColor = nil; |
| 554 | 549 | NSString *backImageH5 = nil; |
| 555 | 550 | NSString *backImage = nil; |
| 556 | - if (model.backgroundColor) { | |
| 551 | + if (!CNLiveStringIsEmpty(model.backgroundColor)) { | |
| 557 | 552 | backgroundColor = model.backgroundColor; |
| 558 | 553 | }else{ |
| 559 | 554 | backgroundColor = self.backgroundColor; |
| 560 | 555 | } |
| 561 | - if (model.backgroundImgH5) { | |
| 556 | + if (!CNLiveStringIsEmpty(model.backgroundImgH5)) { | |
| 562 | 557 | backImageH5 = model.backgroundImgH5; |
| 563 | - }else{ | |
| 558 | + }else if (CNLiveStringIsEmpty(model.backgroundColor)){ | |
| 564 | 559 | backImageH5 = self.backImageH5; |
| 565 | 560 | } |
| 566 | - if (model.backgroundImg) { | |
| 561 | + if (!CNLiveStringIsEmpty(model.backgroundImg)) { | |
| 567 | 562 | backImage = model.backgroundImg; |
| 568 | 563 | }else{ |
| 569 | 564 | backImage = self.backImage; |
| ... | ... | @@ -591,8 +586,8 @@ |
| 591 | 586 | NSDictionary *paramDic = nil; |
| 592 | 587 | if ([model.pageType isEqualToString:@"4"] || [model.pageType isEqualToString:@"5"]){ |
| 593 | 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 | 591 | @"channelId":model.channelId?model.channelId:@"", |
| 597 | 592 | @"channelName":model.id?model.id:@"", |
| 598 | 593 | @"pageId":model.pageId?model.pageId:@"", |
| ... | ... | @@ -611,22 +606,7 @@ |
| 611 | 606 | CNLiveListController *list = controllers[@(self.ld_currentIndex)]; |
| 612 | 607 | [CNLiveClassifyJumpBridge listViewRefreshWithVC:list.childViewControllers[0] pageType:model.pageType.integerValue param:paramDic refreshTime:time]; |
| 613 | 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 | 611 | #pragma mark - Getting&&Setting |
| 632 | 612 | -(JXCategoryTitleView *)myCategoryView | ... | ... |
Example/CNLiveVideoClassifyKit/CNLIVEAppDelegate.m
| ... | ... | @@ -13,7 +13,7 @@ |
| 13 | 13 | |
| 14 | 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 | 17 | // Override point for customization after application launch. |
| 18 | 18 | return YES; |
| 19 | 19 | } | ... | ... |
Example/CNLiveVideoClassifyKit/CNLIVEViewController.h
Example/CNLiveVideoClassifyKit/CNLiveClassifyKitImpl.m
| ... | ... | @@ -29,14 +29,14 @@ |
| 29 | 29 | return demo; |
| 30 | 30 | }else{ |
| 31 | 31 | NSString *thirdUrl = param[@"thirdUrl"]; |
| 32 | - NSString *backgroundColor = param[@"backgroundColor"]; | |
| 32 | + NSString *backgroundColor = param[@"bgColor"]; | |
| 33 | 33 | NSString *backImageH5 = param[@"backgroundImgH5"]; |
| 34 | 34 | if (!CNLiveStringIsEmpty(thirdUrl)) { |
| 35 | 35 | NSString *andStr = @"&"; |
| 36 | 36 | if (![thirdUrl cn_containsString:@"?"]) { |
| 37 | 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 | 41 | CNLiveSubWebViewController *subVC = (CNLiveSubWebViewController*)[CNLiveWebViewModuleImpl pushClassifyWebViewWithWebTitle:param[@"title"] url:thirdUrl intercept:YES isHiddenFirst:NO isBlack:[param boolForKey:@"isBlack"]]; |
| 42 | 42 | return subVC; | ... | ... |
Example/Podfile.lock
| ... | ... | @@ -34,7 +34,7 @@ PODS: |
| 34 | 34 | - CNLiveBeeHive |
| 35 | 35 | - CNLiveBServices/Service (0.1.3.9): |
| 36 | 36 | - CNLiveBeeHive |
| 37 | - - CNLiveBusinessBaseModule (0.2.0): | |
| 37 | + - CNLiveBusinessBaseModule (0.2.2): | |
| 38 | 38 | - CNLiveBaseKit |
| 39 | 39 | - CNLiveBeeHive |
| 40 | 40 | - CNLiveBServices |
| ... | ... | @@ -118,7 +118,7 @@ PODS: |
| 118 | 118 | - CNLiveBusinessTools |
| 119 | 119 | - CNLiveCustomUI/CNLiveGetImage |
| 120 | 120 | - CNLiveNewTripartiteManagement/MJRefresh |
| 121 | - - CNLiveCWebViewModule (0.2.2): | |
| 121 | + - CNLiveCWebViewModule (0.2.3): | |
| 122 | 122 | - CNLiveCustomUI |
| 123 | 123 | - CNLiveEnvironment |
| 124 | 124 | - CNLiveNewTripartiteManagement/Masonry |
| ... | ... | @@ -161,7 +161,7 @@ PODS: |
| 161 | 161 | - CNLiveSDK/CNLiveStat (0.3.4.8) |
| 162 | 162 | - CNLiveUserManagement (0.1.5): |
| 163 | 163 | - CNLiveNewTripartiteManagement/MJExtension |
| 164 | - - CNLiveVideoClassifyKit (0.0.38): | |
| 164 | + - CNLiveVideoClassifyKit (0.0.39): | |
| 165 | 165 | - CNLiveBaseKit |
| 166 | 166 | - CNLiveBeeHive |
| 167 | 167 | - CNLiveBusinessBaseModule |
| ... | ... | @@ -582,19 +582,19 @@ SPEC CHECKSUMS: |
| 582 | 582 | CNLiveBaseKit: 44e5fc573cbca78a86b704cf77c886ef53889807 |
| 583 | 583 | CNLiveBeeHive: 1e105b15b6ccaad546258fcf91231563beb853d4 |
| 584 | 584 | CNLiveBServices: 747c8c6c8d300c4daaeb108027c5886c66ed02ce |
| 585 | - CNLiveBusinessBaseModule: 1d2eee2e04c8db762781b7ad45278d043db56748 | |
| 585 | + CNLiveBusinessBaseModule: c3e34e44ea164034318e6ba4802a16961ff43ecd | |
| 586 | 586 | CNLiveBusinessTools: 3cb2335316d1a330a179ea11151db0d5c203adb4 |
| 587 | 587 | CNLiveCategory: c90a01af1e20cd89f47d4f551d47d2ddc9ca96f3 |
| 588 | 588 | CNLiveCommonCategory: 22c9842b31f2087803ae69e983b2c944fb80eae1 |
| 589 | 589 | CNLiveCustomControl: a692e47171afb799cebc210a8e77c5a4ddfc2099 |
| 590 | 590 | CNLiveCustomUI: b704f07f5f734e45c06bda1877e67b5f9e5d3581 |
| 591 | - CNLiveCWebViewModule: 526a764ed102149405e42face52c7b676a48a737 | |
| 591 | + CNLiveCWebViewModule: 92635bbd539554f861f24857792ff36ceeb2a368 | |
| 592 | 592 | CNLiveEnvironment: 48ba0f934399fd25fc54dc3239009754bcc1ddb3 |
| 593 | 593 | CNLiveNewTripartiteManagement: 29ddb2d23ee77bcd42ba5eaf5f1322ed37db5baa |
| 594 | 594 | CNLiveRequestBastKit: 9fe28913b94a0a072298eba3356f17b98ef0b6cd |
| 595 | 595 | CNLiveSDK: 75bafaafbb8c09dcb4420adfe0f05130405b25e7 |
| 596 | 596 | CNLiveUserManagement: ead053f2d701b01ea8fb5f1da572be788f2dd3cf |
| 597 | - CNLiveVideoClassifyKit: 8fe40083a61b7596c248405451d0cede1c96af15 | |
| 597 | + CNLiveVideoClassifyKit: 61ffd55d9d1e75da84d362d6e3a2097faf254181 | |
| 598 | 598 | FWDebug: 5a20d089a300517153de1438d8128ad4c4690951 |
| 599 | 599 | JXCategoryView: 2ef9ecfd3735158d009ce02d1f29811aa822da65 |
| 600 | 600 | Masonry: 678fab65091a9290e40e2832a55e7ab731aad201 | ... | ... |