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