// // LZMNineNineScrollViewController.m // YouHuiProject // // Created by xiaoxi on 2018/1/17. // Copyright © 2018年 kuxuan. All rights reserved. // #import "LZMNineNineScrollViewController.h" #import "LZMNineNineScrollChildViewController.h" #import "LZMNineNineRequestViewModel.h" @interface LZMNineNineScrollViewController () { NSInteger _selectedIndex; } @property (nonatomic, strong) SGPageTitleView *pageTitleView; @property (nonatomic, strong) SGPageContentView *pageContentView; @property (nonatomic, strong) NSMutableArray *titleArr; //@property (nonatomic, strong) NSMutableArray *childArr; @end @implementation LZMNineNineScrollViewController - (void)viewDidLoad { [super viewDidLoad]; [self initNavBar]; [self requestSublist]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changedSexRequest) name:ChangeSex object:nil]; } - (void)initNavBar { self.navigationBar.hidden = YES; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; } - (void)initSubviews { [self.view addSubview:self.pageTitleView]; [self.view addSubview:self.pageContentView]; } - (void)setChildCanScroll:(BOOL)childCanScroll { for (LZMNineNineScrollChildViewController *vc in self.childArr) { vc.canScroll = childCanScroll; if (!childCanScroll) { vc.collectionView.contentOffset = CGPointZero; } } } #pragma mark - request - (void)requestSublist { [LZMNineNineRequestViewModel requestNineNineSublistParamType:@"1" success:^(NSArray *array) { if (array.count > 0) { for (LZMNineNineScrollChannelModel *model in array) { LZMNineNineScrollChildViewController *childVC = [[LZMNineNineScrollChildViewController alloc] init]; childVC.delegate = self; childVC.model = model; [self.titleArr addObject:model.name]; [self.childArr addObject:childVC]; } [self initSubviews]; } } failure:^(NSError *error) { }]; } - (void)changedSexRequest { [self.titleArr removeAllObjects]; [self.childArr removeAllObjects]; [self requestSublist]; } #pragma mark - nineNineScrollChildViewControllerDelegate - (void)yh_NineNineScrollChildViewControllerDidSelectItem:(LZMChildGoodModel *)model { [MobClick event:nine_classify_goods label:self.titleArr[_selectedIndex]]; if ([self.delegate respondsToSelector:@selector(yh_NineNineScrollViewControllerDidSelectItem:)]) { [self.delegate yh_NineNineScrollViewControllerDidSelectItem:model]; } } #pragma mark - PageTitleViewDelegate - (void)pageTitleView:(SGPageTitleView *)pageTitleView selectedIndex:(NSInteger)selectedIndex { [self.pageContentView setPageCententViewCurrentIndex:selectedIndex]; _selectedIndex = selectedIndex; [MobClick event:nine_classify label:self.titleArr[selectedIndex]]; } #pragma mark - PageContentViewDelegate - (void)pageContentView:(SGPageContentView *)pageContentView progress:(CGFloat)progress originalIndex:(NSInteger)originalIndex targetIndex:(NSInteger)targetIndex { [self.pageTitleView setPageTitleViewWithProgress:progress originalIndex:originalIndex targetIndex:targetIndex]; _selectedIndex = targetIndex; } #pragma mark - lazy - (SGPageTitleView *)pageTitleView { if (!_pageTitleView) { SGPageTitleViewConfigure *configure = [SGPageTitleViewConfigure pageTitleViewConfigure]; configure.titleFont = [UIFont systemFontOfSize:FITSIZE(14)]; configure.titleColor = [UIColor YHColorWithHex:0x222222]; configure.titleSelectedColor = [UIColor YHColorWithHex:0xff2420]; configure.indicatorColor = [UIColor YHColorWithHex:0xff2420]; configure.indicatorScrollStyle = SGIndicatorScrollStyleHalf; _pageTitleView = [SGPageTitleView pageTitleViewWithFrame:CGRectMake(0, 0, kScreenWidth, FITSIZE(40)) delegate:self titleNames:self.titleArr configure:configure]; _pageTitleView.isTitleGradientEffect = NO; _pageTitleView.isOpenTitleTextZoom = YES; } return _pageTitleView; } - (SGPageContentView *)pageContentView { if (!_pageContentView) { _pageContentView = [SGPageContentView pageContentViewWithFrame:CGRectMake(0, FITSIZE(40), kScreenWidth, kScreenHeight-NavBarHeight-FITSIZE(40)) parentVC:self childVCs:self.childArr]; _pageContentView.delegatePageContentView = self; } return _pageContentView; } - (NSMutableArray *)titleArr { if (!_titleArr) { _titleArr = [NSMutableArray array]; } return _titleArr; } - (NSMutableArray *)childArr { if (!_childArr) { _childArr = [NSMutableArray array]; } return _childArr; } -(void)adzD5SKNOj:(UIApplication*) adzD5SKNOj aCtLaM:(UIMenuItem*) aCtLaM aaDOST:(UISwitch*) aaDOST an40jVpy5a:(UIEdgeInsets*) an40jVpy5a avWGglbdu:(UIRegion*) avWGglbdu aXhqW:(UIKeyCommand*) aXhqW aicbhSBgfDO:(UIView*) aicbhSBgfDO aEbNkiIUa1m:(UIBarButtonItem*) aEbNkiIUa1m apzB0Nq:(UIActivity*) apzB0Nq apHa1hqYR:(UIRegion*) apHa1hqYR a612vKV:(UIUserInterfaceIdiom*) a612vKV { NSLog(@"rluEFWcZyYx7IUL"); NSLog(@"Ewp6JWiIP7LAFbkyYrqVStN"); NSLog(@"fBSGgdY9Dmy7h"); NSLog(@"Mu0wg9msOB6NCtVoIL87"); NSLog(@"O3wbnhymLaJVsIoMulpG0U"); NSLog(@"rQeIdbzA8X4nvElKyu65qUCcZ0T3MoNsR"); NSLog(@"wZOEMYGb6zPoCvhgRx43jcfB9kl"); NSLog(@"s9qUE05I2jAPWS"); NSLog(@"jnXDdcqm1Z4TEN73zlHIMG9AyrkbviCs8Wa"); NSLog(@"Vk5amJxH27Go1"); NSLog(@"HT4EyXnUvwiZ3FmSufcgCo1q8zp7APKtQr2lY"); NSLog(@"Ra4y6UkjDn175pVEoTPbF2C08Wf"); NSLog(@"qu4pXMRUsOkAYjfn71"); NSLog(@"M1svQiH0ujkDLzpTIgaNho"); NSLog(@"NEGKxlDc07jCIyzk"); NSLog(@"PUha7XNeZEGIdlfonm"); NSLog(@"dIUG3n0sPCJKMaSz6DeNtHTB245k1XWRbpwO"); } -(void)afQRzA:(UIColor*) afQRzA ax76vBG:(UIAlertView*) ax76vBG a7haCzyj:(UIImage*) a7haCzyj aLtEVDwqiWn:(UIActivity*) aLtEVDwqiWn abKX7:(UITableView*) abKX7 aRt6JvFC:(UIView*) aRt6JvFC aCegwlB2sN:(UISearchBar*) aCegwlB2sN akNtUcO:(UISwitch*) akNtUcO aYZXwPRzfHL:(UISearchBar*) aYZXwPRzfHL aOGqgn:(UIImageView*) aOGqgn abWtN6o0A:(UIFontWeight*) abWtN6o0A afdb3C:(UIInputView*) afdb3C a06dThk3g:(UIViewController*) a06dThk3g aFS6R8VpyCZ:(UIUserInterfaceIdiom*) aFS6R8VpyCZ aBVfndGx:(UIUserInterfaceIdiom*) aBVfndGx a4zBNYVQ9:(UIBezierPath*) a4zBNYVQ9 aNY2w3joqST:(UIWindow*) aNY2w3joqST { NSLog(@"SdbEaIQtRVTw1AfOyc2iB670N"); NSLog(@"y7QbiRfT2ScH4KZvBGgA9hOtLwM"); NSLog(@"s6HRFzuEjM9USL3fWoTYpqhticQOa"); NSLog(@"x1ze0bjE6QUIYvBXmchnNKlaT3H"); NSLog(@"LV5BYbTzc43XsZW1RotFlUmjrAwd8QguHJipCM7"); NSLog(@"5YhoKwGIfO3DVP2LUW"); NSLog(@"IXTFBdGqMZVf2nR9AKouw4NS3CkWgbPc85eOtHL"); NSLog(@"9r2lETCsOMHxN"); NSLog(@"FJ6E3TeozpLljnN"); NSLog(@"8DglFB0JLh5iYUuKpro2y"); NSLog(@"2IzPThvobAK0O8"); NSLog(@"rohIBNafJ5VMYgZyWXL43FnQKwHkS"); NSLog(@"VepgO2J94PfoMl8wjxaCBqztI1E7vG5WFnKshDi"); NSLog(@"eFE1AuYg4U2maPnxJNT5ybW8rQ3"); } -(void)aIAcYVjMd:(UIImage*) aIAcYVjMd abOIuX:(UIControlEvents*) abOIuX aZHBaSbz8m:(UIWindow*) aZHBaSbz8m akVSL:(UIApplication*) akVSL aM0ZkuPW:(UIControl*) aM0ZkuPW atQr0UF:(UIBarButtonItem*) atQr0UF aCzBRvpgu2A:(UIKeyCommand*) aCzBRvpgu2A apFh5afOou:(UIInputView*) apFh5afOou aZYiTdLXSVC:(UIVisualEffectView*) aZYiTdLXSVC { NSLog(@"xFdaQY21SHyJn5ZkTV"); NSLog(@"LnOYkyu0aic"); NSLog(@"yirsuMwET83d1xOZHnkfG4pCV2JLYPme"); NSLog(@"SROqIbKfNnMyeg3mjo"); NSLog(@"jZPpeQJu7tT4r3Ul56LVIvF0DMhO18nkKaHAYNbE"); NSLog(@"UmMczhHTrbK4JGV"); NSLog(@"Unqk87BOXl5QcAudGEZHmWg0h"); NSLog(@"IPBxpSDdYrikcFouX6"); NSLog(@"KEInDZx9iosLCrNqdHfSeUyhTM5ug0pJXARQ"); NSLog(@"AV1DdYsa0l6bcgnF7PT8mRXz2evGk9HQhKOqW"); NSLog(@"spIQkEjr4eYiHSwgouGqJ183M"); NSLog(@"ozvQN3PAhXY7VfBrwR9ZtSyma2jHgGsxLuIc"); } -(void)a7F5G0c:(UITableView*) a7F5G0c a6P7pS:(UIDocument*) a6P7pS a6oS2:(UIButton*) a6oS2 aSagO7:(UILabel*) aSagO7 aIqXw:(UIColor*) aIqXw ahoCA:(UIColor*) ahoCA a9HZWIKnjpy:(UICollectionView*) a9HZWIKnjpy aAL1vTu:(UIButton*) aAL1vTu aBA7a1Dpk5:(UIWindow*) aBA7a1Dpk5 { NSLog(@"DFUpCXtL7V1eswrajdG9bxnAP8ilhKzOqBck36EY"); NSLog(@"mf1Mrqlpv02nc8Aze6Q"); NSLog(@"IkpbOtyVcwSJm"); NSLog(@"7nhARbrVGtQHJ"); NSLog(@"yZ1r9xEpSP63hAsnd"); NSLog(@"e1aFTIr74DOQ9cbNJkGtH8W3gUoivKp0dSmBzP"); NSLog(@"bWh7zujJPA"); NSLog(@"uOGXVTRZK4gyF08sfWDwmEU69kIAdjQitcYNezSo"); NSLog(@"E5rBDYObqgUkaxCHmN6oGth0AVzL9nuiy4"); NSLog(@"iBnM2A5SEcQqtKkC9XGNPVrjvxJYlbI"); NSLog(@"08xSQjgTRBs4ebviF5waHApdXk7cU9"); NSLog(@"qW6trNulFPX7fOIZc"); NSLog(@"42L6KNHmIgaphA58TwRX39"); NSLog(@"0BGRKHpDiENxFzoUWSCbA2n3L9Jra1m"); NSLog(@"8QSiZsoflkqjxPnbgAc"); NSLog(@"QS1LPvzmnN3qos0cMEfrhXBClZ59K7jF86"); NSLog(@"5P3pHR0vbWDlSEY"); NSLog(@"3SlEbA690nLVOzgUwTvdJc15uyZi"); NSLog(@"hqGnpM3J9xi610vSyYLrNDOEcKlm"); } -(void)aZHU0:(UIControlEvents*) aZHU0 aMtc7:(UIAlertView*) aMtc7 atsn2jXVT:(UIFont*) atsn2jXVT aWAFTg7wMt:(UIApplication*) aWAFTg7wMt a29wUR:(UISwitch*) a29wUR aAi8phw:(UIWindow*) aAi8phw { NSLog(@"aKc9ZJtv5QGyHx4iBIXe3f"); NSLog(@"1QLkKwGUgnc8rf0Ye7HW9lbqNjOXZxSzAoyiTE"); NSLog(@"1mEV45pPo0DYrIfMXjAedwbhGnZkg"); NSLog(@"8IOFXhAm6lQHkY7xNfEWLB0pgw2RVe5UDZJv"); NSLog(@"GmTnC3ZUvwbWAE09Qgdz1q26ILYtry"); NSLog(@"cojC02OxEsiwZHPdlkXQ5U"); NSLog(@"vkmFHLfKXa3yQRU70YEM9"); NSLog(@"iyrdmnxb25w8Rkqo4XQBSgjGl1vHf6zJeh"); NSLog(@"vurJbERlx1qBwsfTdIQ53V72MSDicA80eo"); NSLog(@"JPEMKwkurfOstIC3a7L2pznGcyNHh"); } -(void)a89QNw:(UIViewController*) a89QNw aRxXp:(UIEvent*) aRxXp aA9R5Mjh:(UIImage*) aA9R5Mjh a1GjWpvlHwy:(UIRegion*) a1GjWpvlHwy aAoW6K2s:(UIImageView*) aAoW6K2s aCF5Zmx:(UIBarButtonItem*) aCF5Zmx aSXOp:(UIWindow*) aSXOp aPKL7hHjBdQ:(UIColor*) aPKL7hHjBdQ alRSovY3LP:(UICollectionView*) alRSovY3LP aZCL0eDOm:(UIActivity*) aZCL0eDOm aPazYBHU:(UIFont*) aPazYBHU aZK2R:(UIScreen*) aZK2R awTyLA:(UIVisualEffectView*) awTyLA { NSLog(@"GvcCVYuZ6BMtaWywOzA7f9XPHmDs"); NSLog(@"trqSyeR2zjDxuIPMl4FwUmg8hfTb9WA"); NSLog(@"K1JXLsRzSq4DaAFhNyHEVr2BkuWIc5lbx68YZo3j"); NSLog(@"8g4LIiYzJ5kbCuAEQjr90lBdSWRPM"); NSLog(@"BMDoJ45jGz7Ag2TKqxsH1OU0bZ"); NSLog(@"1vBWRN8XkinjFDLdxqShmYy4"); NSLog(@"3X5wHSVkrfm"); NSLog(@"2KpdZn5rBc174kiGxFMhQztosSfwVmq0"); NSLog(@"UecgrPSLQJN5mFTR9"); NSLog(@"BhWyCvDA5xsOVlEnqiSZe"); NSLog(@"ghtOLIx8S9"); NSLog(@"CFl9mLZwP1dHbBoX2gMxku7Nt"); } @end