Commit 915a7a69dccdc5fe641959f7fb394ec57f07ceaa
1 parent
9ac59be1
修复已知问题
Showing
3 changed files
with
33 additions
and
35 deletions
CNLiveVideoClassifyKit/Classes/ClassifyCategory/Controller/CNLiveClassifySegmentController.m
| ... | ... | @@ -85,9 +85,6 @@ static CGFloat moveHeight = 50; |
| 85 | 85 | self.myCategoryView.cellWidthZoomEnabled = YES; |
| 86 | 86 | self.myCategoryView.cellWidthZoomScale = 1.3; |
| 87 | 87 | self.myCategoryView.imageSize = CGSizeMake(56, 18); |
| 88 | - if (!self.isLoading) { | |
| 89 | - [self uploadSubViews]; | |
| 90 | - } | |
| 91 | 88 | if (![CNUserShareManager isLogin]) { |
| 92 | 89 | NSString *showGuide = [[NSUserDefaults standardUserDefaults] objectForKey:CNLiveNetAddShowGuideKey]; |
| 93 | 90 | if ([showGuide isEqualToString:@"1"] && ![BHConfig boolValue:ChannelsShowGuide]) { |
| ... | ... | @@ -110,17 +107,18 @@ static CGFloat moveHeight = 50; |
| 110 | 107 | if (!CNLiveStringIsEmpty(channelId)) { |
| 111 | 108 | selectChannelId = [self containsWithChannelId:channelId]; |
| 112 | 109 | if (selectChannelId != -1) { |
| 110 | + self.ld_currentIndex = selectChannelId; | |
| 113 | 111 | self.isLoginIndex = selectChannelId; |
| 114 | 112 | } |
| 115 | 113 | } |
| 116 | 114 | if ([CNWebRedirectHandle manager].isClickedIntegral) { |
| 117 | 115 | [CNWebRedirectHandle manager].isClickedIntegral = NO; |
| 118 | - [self categoryView:self.myCategoryView didSelectedItemAtIndex:[CNWebRedirectHandle manager].channelId]; | |
| 116 | + self.ld_currentIndex = [CNWebRedirectHandle manager].channelId; | |
| 119 | 117 | NSNumber *key = @([CNWebRedirectHandle manager].classifyId); |
| 120 | 118 | CNLiveSubSegmentController *svc = (CNLiveSubSegmentController *)self.listContainerView.validListDict[key]; |
| 121 | 119 | if([svc isKindOfClass:[CNLiveSubSegmentController class]]){ |
| 122 | 120 | //目击者 - 今日要闻 - 中国冰雪 |
| 123 | - [svc categoryView:svc.categoryView didSelectedItemAtIndex:[CNWebRedirectHandle manager].classifyId]; | |
| 121 | + [svc categoryViewSelectedItemAtIndex:[CNWebRedirectHandle manager].classifyId]; | |
| 124 | 122 | } |
| 125 | 123 | [CNWebRedirectHandle manager].channelId = 0; |
| 126 | 124 | [CNWebRedirectHandle manager].classifyId = 0; |
| ... | ... | @@ -130,11 +128,8 @@ static CGFloat moveHeight = 50; |
| 130 | 128 | self.contentLogin = YES; |
| 131 | 129 | if(selectChannelId == -1){ |
| 132 | 130 | //我的频道中没有这个频道 |
| 133 | - [self categoryView:self.myCategoryView didSelectedItemAtIndex:self.ld_currentIndex]; | |
| 134 | 131 | self.fuzzyView = [CNLiveClassifyJumpBridge showViewOrPushVCWithCurrentVC:self pushType:CNLiveClassifyJumpShowFuzzyView]; |
| 135 | 132 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(touristsLoginTipsViewIsClassify:) name:TouristloginTipsViewActionNotification object:nil]; |
| 136 | - } else { | |
| 137 | - [self categoryView:self.myCategoryView didSelectedItemAtIndex:selectChannelId]; | |
| 138 | 133 | } |
| 139 | 134 | //最后判断是否有url// |
| 140 | 135 | NSString *url = [BHConfig get:LoginPrepositionUrl]; |
| ... | ... | @@ -159,10 +154,12 @@ static CGFloat moveHeight = 50; |
| 159 | 154 | } |
| 160 | 155 | } |
| 161 | 156 | } |
| 162 | - } else { | |
| 163 | - [self categoryView:self.myCategoryView didSelectedItemAtIndex:self.ld_currentIndex]; | |
| 164 | 157 | } |
| 165 | 158 | } |
| 159 | + self.categoryView.defaultSelectedIndex = self.ld_currentIndex; | |
| 160 | + if (!self.isLoading) { | |
| 161 | + [self uploadSubViews]; | |
| 162 | + } | |
| 166 | 163 | if ([CNUserShareManager isLogin]) { |
| 167 | 164 | [self.view addSubview:self.customChannelsBtn]; |
| 168 | 165 | }else |
| ... | ... | @@ -393,7 +390,6 @@ static CGFloat moveHeight = 50; |
| 393 | 390 | -(void)updateSelectColors:(NSInteger)index |
| 394 | 391 | { |
| 395 | 392 | self.ld_currentIndex = index; |
| 396 | - self.myCategoryView.defaultSelectedIndex = index; | |
| 397 | 393 | NSString *backgroundImage = [self.bgImages safetyObjectAtIndex:index]; |
| 398 | 394 | weakself |
| 399 | 395 | [self.topBgImg sd_setImageWithURL:[NSURL URLWithString:backgroundImage] completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) { |
| ... | ... | @@ -834,22 +830,22 @@ static CGFloat moveHeight = 50; |
| 834 | 830 | } |
| 835 | 831 | self.contentLogin = NO; |
| 836 | 832 | }else{ |
| 837 | - NSDictionary *paramDic = nil; | |
| 838 | - if ([model.pageType isEqualToString:@"4"] || [model.pageType isEqualToString:@"5"]){ | |
| 839 | - paramDic= @{ | |
| 840 | - @"bgColor": model.backgroundColor?model.backgroundColor:@"", | |
| 841 | - @"backgroundImg": model.backgroundImgH5?model.backgroundImgH5:@"", | |
| 842 | - @"channelId":model.channelId?model.channelId:@"", | |
| 843 | - @"channelName":model.id?model.id:@"", | |
| 844 | - @"pageId":model.pageId?model.pageId:@"", | |
| 833 | + NSDictionary *paramDic = nil; | |
| 834 | + if ([model.pageType isEqualToString:@"4"] || [model.pageType isEqualToString:@"5"]){ | |
| 835 | + paramDic= @{ | |
| 836 | + @"bgColor": model.backgroundColor?model.backgroundColor:@"", | |
| 837 | + @"backgroundImg": model.backgroundImgH5?model.backgroundImgH5:@"", | |
| 838 | + @"channelId":model.channelId?model.channelId:@"", | |
| 839 | + @"channelName":model.id?model.id:@"", | |
| 840 | + @"pageId":model.pageId?model.pageId:@"", | |
| 841 | + @"isHiddenFirst":@(self.isHiddenFirst) | |
| 842 | + }; | |
| 843 | + }else{ | |
| 844 | + paramDic= @{ | |
| 845 | 845 | @"isHiddenFirst":@(self.isHiddenFirst) |
| 846 | - }; | |
| 847 | - }else{ | |
| 848 | - paramDic= @{ | |
| 849 | - @"isHiddenFirst":@(self.isHiddenFirst) | |
| 850 | - }; | |
| 851 | - } | |
| 852 | - NSTimeInterval time = 300; | |
| 846 | + }; | |
| 847 | + } | |
| 848 | + NSTimeInterval time = 300; | |
| 853 | 849 | if ([model.id isEqualToString:@"1"]) { |
| 854 | 850 | time = 60; |
| 855 | 851 | } | ... | ... |
CNLiveVideoClassifyKit/Classes/ClassifyCategory/Controller/CNLiveSubSegmentController.m
| ... | ... | @@ -81,6 +81,7 @@ |
| 81 | 81 | } |
| 82 | 82 | }]; |
| 83 | 83 | } |
| 84 | + [self handleDateWithChannelsArray]; | |
| 84 | 85 | if (self.selectChannelId != -1) { |
| 85 | 86 | NSString *classifyId = [BHConfig get:ChannelsSelectSecond]; |
| 86 | 87 | [BHConfig set:ChannelsSelectSecond value:@""]; |
| ... | ... | @@ -89,12 +90,11 @@ |
| 89 | 90 | if(selectChannelId == -1){ |
| 90 | 91 | //我的频道中没有这个频道 |
| 91 | 92 | } else { |
| 92 | - self.myCategoryView.defaultSelectedIndex = selectChannelId; | |
| 93 | 93 | self.ld_currentIndex = selectChannelId; |
| 94 | 94 | } |
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | - [self handleDateWithChannelsArray]; | |
| 97 | + | |
| 98 | 98 | // 添加二级频道右侧的搜索按钮 |
| 99 | 99 | [self.view addSubview:self.searchBtn]; |
| 100 | 100 | self.view.backgroundColor = [UIColor clearColor]; |
| ... | ... | @@ -113,7 +113,10 @@ |
| 113 | 113 | lineView.indicatorWidth = 18; |
| 114 | 114 | lineView.indicatorColor = self.textColor; |
| 115 | 115 | self.myCategoryView.indicators = @[lineView]; |
| 116 | - [self.categoryView reloadData]; | |
| 116 | + if (!self.ld_currentIndex) { | |
| 117 | + self.ld_currentIndex = 0; | |
| 118 | + } | |
| 119 | + self.categoryView.defaultSelectedIndex = self.ld_currentIndex; | |
| 117 | 120 | |
| 118 | 121 | if ([self.channelId isEqualToString:@"219"]) { |
| 119 | 122 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updatePlayingStatus:) name:WjjAudioPlayerStatusNotification object:nil]; |
| ... | ... | @@ -196,7 +199,7 @@ |
| 196 | 199 | self.historyBtn.centerY = self.myCategoryView.height/2; |
| 197 | 200 | width = self.historyBtn.left; |
| 198 | 201 | } |
| 199 | - self.myCategoryView.width = width; | |
| 202 | + self.myCategoryView.width = width-10; | |
| 200 | 203 | } |
| 201 | 204 | #pragma mark - Notification |
| 202 | 205 | - (void)updatePlayingStatus:(NSNotification *)notifi { |
| ... | ... | @@ -289,7 +292,6 @@ |
| 289 | 292 | [self.titles addObject:model.name]; |
| 290 | 293 | [array addObject:model]; |
| 291 | 294 | if (!CNLiveStringIsEmpty(model.defaultPage) && [model.defaultPage isEqualToString:@"1"]) { |
| 292 | - self.myCategoryView.defaultSelectedIndex = [self.pageListArr indexOfObject:model]; | |
| 293 | 295 | self.ld_currentIndex = [self.pageListArr indexOfObject:model]; |
| 294 | 296 | } |
| 295 | 297 | } |
| ... | ... | @@ -324,7 +326,7 @@ |
| 324 | 326 | width = self.historyBtn.left; |
| 325 | 327 | } |
| 326 | 328 | |
| 327 | - self.myCategoryView.width = width; | |
| 329 | + self.myCategoryView.width = width-10; | |
| 328 | 330 | } else { |
| 329 | 331 | // 变窄 |
| 330 | 332 | |
| ... | ... | @@ -339,7 +341,7 @@ |
| 339 | 341 | } else if ([self.channelId isEqualToString:@"11"]) { |
| 340 | 342 | self.historyBtn.right = self.searchBtn.left - 15; |
| 341 | 343 | } |
| 342 | - self.myCategoryView.width = self.searchBtn.left; | |
| 344 | + self.myCategoryView.width = self.searchBtn.left-10; | |
| 343 | 345 | } |
| 344 | 346 | } |
| 345 | 347 | |
| ... | ... | @@ -510,13 +512,13 @@ |
| 510 | 512 | #pragma mark - JXCategoryListContentViewDelegate |
| 511 | 513 | -(UIView *)listView |
| 512 | 514 | { |
| 515 | + [self refreshCurrentVCData]; | |
| 513 | 516 | return self.view; |
| 514 | 517 | } |
| 515 | 518 | #pragma mark - JXCategoryViewDelegate |
| 516 | 519 | - (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index |
| 517 | 520 | { |
| 518 | 521 | self.navigationController.interactivePopGestureRecognizer.enabled = (index ==0); |
| 519 | - self.myCategoryView.defaultSelectedIndex = index; | |
| 520 | 522 | self.ld_currentIndex = index; |
| 521 | 523 | if (index != self.myCategoryView.selectedIndex) { |
| 522 | 524 | [[NSNotificationCenter defaultCenter] postNotificationName:WjjH5StopVideoPlayerNotification object:nil]; | ... | ... |
Example/CNLiveVideoClassifyKit/CNLIVEViewController.m
| ... | ... | @@ -44,7 +44,7 @@ |
| 44 | 44 | [BHConfig set:ChannelsSelectFirst value:@"0"]; |
| 45 | 45 | [CNTools GetClassifyChannelsUrlsAndSave]; |
| 46 | 46 | self.title = @"首页"; |
| 47 | - segArr = @[@"分类",@"百度小程序"]; | |
| 47 | + segArr = @[@"分类"]; | |
| 48 | 48 | [self.view addSubview:self.collectionView]; |
| 49 | 49 | } |
| 50 | 50 | -(void)viewDidAppear:(BOOL)animated | ... | ... |