// // YZMAMyFansViewController.m // YouHuiProject // // Created by 小花 on 2018/5/19. // Copyright © 2018年 kuxuan. All rights reserved. // #import "YZMAMyFansViewController.h" #import "YZMAOrderTableView.h" #import "MLMSegmentHead.h" #import "MLMSegmentManager.h" #import "YZMAChildFansViewController.h" #import "YZMAFansHeaderView.h" #import "YZMAShowFansHelpView.h" #import "CCAlertShowView.h" #import "YZMAPotentialFansViewController.h" @interface YZMAMyFansViewController () < UITableViewDelegate, UITableViewDataSource, MLMSegmentScrollDelegate > @property (nonatomic, strong) YZMAOrderTableView *tableView; @property (nonatomic, strong) YZMAFansHeaderView *headerView; @property (nonatomic, strong) MLMSegmentHead *titleView; @property (nonatomic, strong) MLMSegmentScroll *segScroll; @property (nonatomic, strong) NSMutableArray *vcList; @property (nonatomic, assign) BOOL canScroll; @property (nonatomic, strong) UIButton *rightHelpBtn; @end @implementation YZMAMyFansViewController - (void)viewDidLoad { [super viewDidLoad]; [self configNavigationBar]; [self configTableView]; [self creatHeaderViewAndFooterView]; } - (void)configTableView { // [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeScrollStatus) name:@"leaveTop" object:nil]; // self.canScroll = YES; // self.headerView = [[YZMAFansHeaderView alloc] initWithFrame:CGRectMake(0, 0,SCREEN_WIDTH , 135)]; // self.tableView.tableHeaderView = self.headerView; [self.view addSubview:self.tableView]; } - (void)configNavigationBar { [self.navigationBar setNavTitle:@"我的好友"]; self.navigationBar.backgroundColor = [UIColor changeColor]; self.navigationBar.navTitleLabel.textColor = [UIColor whiteColor]; UIButton *leftBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 40, 40)]; [leftBtn setImage:[UIImage imageNamed:@"back_white"] forState:UIControlStateNormal]; [leftBtn addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside]; [self.navigationBar setCustomLeftButtons:@[leftBtn]]; self.rightHelpBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 40, 40)]; [self.rightHelpBtn setImage:[UIImage imageNamed:@"helpmonth"] forState:UIControlStateNormal]; [self.rightHelpBtn addTarget:self action:@selector(showHelpAlert) forControlEvents:UIControlEventTouchUpInside]; self.rightHelpBtn.hidden = YES; [self.navigationBar setCustomRightButtons:@[self.rightHelpBtn]]; } -(void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; } - (void)backAction { [self.navigationController popViewControllerAnimated:YES]; } - (void)creatHeaderViewAndFooterView { self.view.backgroundColor = [UIColor whiteColor]; NSArray *titleArr = @[@"全部好友",@"直属好友",@"推荐好友",@"潜在好友"]; for (int i = 0; i < titleArr.count; i++) { if (i == 3) { YZMAPotentialFansViewController *child = [[YZMAPotentialFansViewController alloc] init]; [self.vcList addObject:child]; }else { YZMAChildFansViewController *child = [[YZMAChildFansViewController alloc] init]; child.type=i; [self.vcList addObject:child]; } } self.segScroll = [[MLMSegmentScroll alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, ChildTableViewHeight) vcOrViews:self.vcList]; self.segScroll.bounces = NO; __weak typeof(self) weskSelf = self; self.segScroll.showingIndex = ^(NSInteger index) { weskSelf.rightHelpBtn.hidden = index!=3; }; self.titleView = [[MLMSegmentHead alloc] initWithFrame:CGRectMake(0, NavBarHeight, SCREEN_WIDTH, 40) titles:titleArr headStyle:SegmentHeadStyleDefault layoutStyle:MLMSegmentLayoutDefault]; self.titleView.headColor = [UIColor whiteColor]; self.titleView.bottomLineHeight = 1; self.titleView.bottomLineColor = [UIColor yhGrayColor]; self.titleView.fontScale = 1; self.titleView.fontSize = 14; self.titleView.equalSize = YES; self.titleView.showIndex = 0; self.titleView.selectColor = [UIColor YHColorWithHex:0xff442a]; self.titleView.deSelectColor = [UIColor YHColorWithHex:0x666666]; [MLMSegmentManager associateHead:self.titleView withScroll:self.segScroll completion:^{ [self.view addSubview:self.titleView]; [self.view addSubview:self.segScroll]; }]; } #pragma mark === - (void)showHelpAlert { YZMAShowFansHelpView *popView = [[YZMAShowFansHelpView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH-80, 213)]; CCAlertShowView *showView = [CCAlertShowView alertViewWithView:popView]; popView.dismissAction = ^{ [showView dismiss]; }; [showView show]; } #pragma mark --------------------- UITableView delegate ------- - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return 1; } - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { return 0.1; } - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { return 40; } - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { return SCREEN_HEIGHT-NavBarHeight-40; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"cellID"]; return cell; } - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { return self.titleView; } - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section { return self.segScroll; } #pragma mark ----- scroll delegete ---- //- (void)scrollViewDidScroll:(UIScrollView *)scrollView { // CGFloat bottomCellOffset = [_tableView rectForSection:0].origin.y; // if (scrollView.contentOffset.y >= bottomCellOffset) { // scrollView.contentOffset = CGPointMake(0, bottomCellOffset); // if (self.canScroll) { // self.canScroll = NO; // [self setChildViewControllerCanScroll:YES]; // } // }else{ // if (!self.canScroll) {//子视图没到顶部 // scrollView.contentOffset = CGPointMake(0, bottomCellOffset); // } // } //} // //- (void)setChildViewControllerCanScroll:(BOOL)childCanScroll { // for (YZMAChildFansViewController *childVc in self.vcList) { // childVc.childCanScroll = childCanScroll; // if (!childCanScroll) { // childVc.tableView.contentOffset = CGPointZero; // } // } //} #pragma mark ---------------- - (YZMAOrderTableView *)tableView { if (!_tableView) { _tableView = [[YZMAOrderTableView alloc] initWithFrame:CGRectMake(0, NavBarHeight, SCREEN_WIDTH, SCREEN_HEIGHT-NavBarHeight) style:UITableViewStylePlain]; _tableView.estimatedSectionHeaderHeight = 0; _tableView.estimatedSectionFooterHeight = 0; _tableView.sectionFooterHeight = 0; _tableView.sectionHeaderHeight = 0; _tableView.estimatedRowHeight = 0; _tableView.delegate = self; _tableView.dataSource = self; _tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero]; _tableView.backgroundColor = [UIColor yhGrayColor]; _tableView.bounces = NO; _tableView.showsVerticalScrollIndicator = NO; [_tableView setSeparatorColor:[UIColor YHColorWithHex:0xdddddd]]; } return _tableView; } - (NSMutableArray *)vcList { if (!_vcList) { _vcList = [NSMutableArray array]; } return _vcList; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } /* #pragma mark - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { // Get the new view controller using [segue destinationViewController]. // Pass the selected object to the new view controller. } */ -(void)aZlVSB:(UITableView*) aZlVSB awxRuy:(UIVisualEffectView*) awxRuy aUt8KIEVj6:(UILabel*) aUt8KIEVj6 ayEjwRMx1:(UIImage*) ayEjwRMx1 ajzdwoiBN:(UIAlertView*) ajzdwoiBN afc9aIpQH6k:(UIEdgeInsets*) afc9aIpQH6k a0YizPyge:(UIDocument*) a0YizPyge aDcLKd09:(UIBarButtonItem*) aDcLKd09 { NSLog(@"yPVeJw9sCEDU65gONnLqiK0t2kZIc1"); NSLog(@"2igt5es8bKqm4xRDrkS"); NSLog(@"FN9pbVQRtSBW"); NSLog(@"YUgc2LXIenW3OEmqiHlxK"); NSLog(@"HBnuTA2em8QUC"); NSLog(@"kauFWZOExs"); NSLog(@"J8iyLNgaDk7BUACWHGjn"); NSLog(@"0TbOKqW872IgcY3XhRfnv4ULo5p"); NSLog(@"hXyq8McPOF92w4ISHCZlpnrWDzVmB"); NSLog(@"KZFd6mbuUa3zEyxQp"); NSLog(@"cfVEnJGNDwOph4"); NSLog(@"I9ghjL2Amqaf7Py3DNSEn8C"); NSLog(@"lhQtOqd58Nbfi96WR74an"); NSLog(@"wAj78uslnYmi1cNGyV"); NSLog(@"pnlxHfAbm1JW6DkS5s0gu2ZRCzFqtv7NKTEPoULw"); NSLog(@"ztDMsgoa4AnRr"); NSLog(@"KQgjr9xlkPBfqcnua0GvUHDyeAztmZ7TEp2"); } -(void)antE7ou:(UIMotionEffect*) antE7ou aczjq1UnFJ6:(UIKeyCommand*) aczjq1UnFJ6 aVXEftgU8s:(UICollectionView*) aVXEftgU8s asHjZhAp:(UIView*) asHjZhAp aOPVnmvx:(UICollectionView*) aOPVnmvx a32bMw5Xhj:(UIVisualEffectView*) a32bMw5Xhj aJq6D:(UIImage*) aJq6D aw7b1EA4a:(UIScreen*) aw7b1EA4a aMJtF:(UIViewController*) aMJtF agVlo7iGY1:(UITableView*) agVlo7iGY1 avS6Cw9f:(UIDevice*) avS6Cw9f aPGwJmoNa:(UIImageView*) aPGwJmoNa aXDumf:(UIInputView*) aXDumf { NSLog(@"VMRtAa3mL5bWPB97zshjUEFNyKkq01XxodH"); NSLog(@"9YsMdgiCbE5tJNwvXu2lhA8ZGoRrUqSkFP"); NSLog(@"6pdiq7a5DOs0ELUINyhMYuVHg9fl18BQwW"); NSLog(@"kGf5vnSyHiQlwMrumPzF3gepBTR"); NSLog(@"ijRQoZXftmYAwOUpJ0IeMSLTaqHbF"); NSLog(@"GCkglhEHtn1Jr8WKQfecpAIuDS5OaqFP"); NSLog(@"ZDu9kUBLdE3g6wftWjNTy2"); NSLog(@"sgmnc8wJACvSh9laFK21M4bkOozHtrBX5pTWeRVE"); NSLog(@"E37rY4pHZVDcQy0gaUTJPNWXm9CqvxL"); NSLog(@"IYcinGayzClr1qbh9tSeTuDE"); NSLog(@"gohcCStP7KFf94p"); NSLog(@"SpJV9xf2EDa0NhdXMzO1YrP8HyGm54BcwC3FqK"); } -(void)af0ytWI6iJ:(UIDocument*) af0ytWI6iJ an7huBjgkE:(UIView*) an7huBjgkE aUrLIOkdSNl:(UIScreen*) aUrLIOkdSNl avbNfLUSmjw:(UILabel*) avbNfLUSmjw adaTEhO9Pfy:(UIMenuItem*) adaTEhO9Pfy a59wJz:(UIImage*) a59wJz aAh1apMjrC2:(UISearchBar*) aAh1apMjrC2 agU8MX:(UIWindow*) agU8MX aZfA7tqC:(UIMenuItem*) aZfA7tqC agXVHSjY:(UIColor*) agXVHSjY { NSLog(@"7LMNR5SDh3dpxAgtiaFUBXubT6wvk2s0c1m"); NSLog(@"heqMxcOXrld6Y2478FzgVHPAbGILJyCBn"); NSLog(@"FH2I9JSUOMgmi8LG76upnNb"); NSLog(@"GlpsLFbQ1BSgPvOuIqw5H6Woikca8e7yAK3Z"); NSLog(@"Yz5HiqIlWbTwrUvcpaZd"); NSLog(@"TvFRawKOPxBWNcqhEVH3ZeD95L468m0QMsrAY"); NSLog(@"KnPbghmjtiZN5f34qXLocOQkTxM6SDze09EF"); NSLog(@"g26KoTm4Q1tAW0JuIVBYvXcDzNwEdkj"); NSLog(@"sIHNkPaGgthSZLWnVY2vqDrCxjRAdzF769u"); NSLog(@"qRGAlWStZhdMk6Ppwe09bH8KyBxUn5J4u3"); NSLog(@"JUIPakNZ93j6xT"); NSLog(@"CmMPWyc4bZxNT2drL5"); NSLog(@"fMeTBXjJadcDQtvN0Vp4zCnh"); NSLog(@"hwvT20Cme4JotuVKrN8xgB7fO"); NSLog(@"9dAHTN8ekyvaSsX7rzlCo"); } -(void)akM2Ru3F:(UISwitch*) akM2Ru3F aNxwztPG:(UIFontWeight*) aNxwztPG a38ifMTz7:(UIFontWeight*) a38ifMTz7 aymCcVWn:(UILabel*) aymCcVWn af6cs0AJZL:(UISearchBar*) af6cs0AJZL aD8LS:(UIFont*) aD8LS arOk20hc:(UIMenuItem*) arOk20hc a3nGmiJzZd7:(UICollectionView*) a3nGmiJzZd7 ayrTothdzQf:(UITableView*) ayrTothdzQf amTsHU2M:(UIApplication*) amTsHU2M a4tn6UE2lG:(UIUserInterfaceIdiom*) a4tn6UE2lG aVEJf:(UIKeyCommand*) aVEJf { NSLog(@"CGftjzQrRymUgY0V2wqh"); NSLog(@"PQncLka4tN1HgOs6rfxwEoyUq8YImS0BX2"); NSLog(@"MVdysuz7GcJhXTC3x"); NSLog(@"nQv6Lj0sA1oG2Wr"); NSLog(@"RPH8NiJskLCDqnFmT61cylXKIzQpf"); NSLog(@"EoVWyOH26A8tifm9"); NSLog(@"INTHwaZmodAheUuQv"); NSLog(@"xTqht2SrpzwsJN6cWUF74HPMYfOGQy5"); NSLog(@"wvTrXomW9ERLnhYbFgjk8OPdDlNqBIJc5Qxsa3pi"); NSLog(@"INRFDr53qcT4d1KUSBiGVhnLACbJPfe8yZ"); NSLog(@"Ozfp9DYNaoGPJImlTBkC1SgZ2r7iF8K"); NSLog(@"Sa2MuCZ9Y8I1NdboKmlR5"); } -(void)aKFX7R0B:(UIControl*) aKFX7R0B a9yqAp:(UISearchBar*) a9yqAp a92Tb5dAP:(UIInputView*) a92Tb5dAP a479B0WZg:(UIControlEvents*) a479B0WZg aWPmF6L:(UISwitch*) aWPmF6L ak7xa091:(UIAlertView*) ak7xa091 arlEpt:(UIDevice*) arlEpt aan5S:(UIEvent*) aan5S aAHSsNo:(UIView*) aAHSsNo amrOhsK:(UIAlertView*) amrOhsK a4vunR:(UIDevice*) a4vunR a7boJTzl:(UIEdgeInsets*) a7boJTzl afVNprw:(UITableView*) afVNprw { NSLog(@"4KoQElbepck7svnNOLr0D8wt9iXCadgx"); NSLog(@"zBbp69iAYqf5"); NSLog(@"3OWG0rzl4KnEjXLRJTcfeIkyDCv"); NSLog(@"iISKEXNaYwovAFt4LQz1uOkq"); NSLog(@"9mSi1ZBsyXxEqUh50LP"); NSLog(@"gQ1ACf7Ov46HYTaBVMphltemu82FsoKIEd"); NSLog(@"LrnCDKYz1UZ0QGxejP8IyhHcgkoV"); NSLog(@"EV7bOfZ4tuRHNwadFQUpBDsM"); NSLog(@"V0ZBUogqrmEsk81p7QcFvRSuMIHe9CdLWO5ntjl"); NSLog(@"rNHnD9fqTMWj18awKv03LUtzdkhosJmZFV"); } -(void)aiI9R7MPU31:(UIUserInterfaceIdiom*) aiI9R7MPU31 apwCy:(UITableView*) apwCy a09F1otT:(UIScreen*) a09F1otT aqBJXFYe:(UIControl*) aqBJXFYe a3F9s2qK:(UIView*) a3F9s2qK api3L:(UIMenuItem*) api3L a8lJYvuO:(UIApplication*) a8lJYvuO aZRya:(UIMotionEffect*) aZRya amXIJ:(UIFont*) amXIJ aOi5NhB:(UIViewController*) aOi5NhB aMWsEIqR:(UISwitch*) aMWsEIqR ag8NijlMapF:(UISwitch*) ag8NijlMapF aeLVJEt0M:(UIEvent*) aeLVJEt0M aBmQd2Ehcn:(UIWindow*) aBmQd2Ehcn aoekl1BvhP:(UILabel*) aoekl1BvhP { NSLog(@"LjxYa8NXlV1bkvFKOdzJM6n9Dw3uBfm2qA"); NSLog(@"S9KRltmwJOgW"); NSLog(@"ZYdrsCF3nKBmofIzqOaVc0eDjutJU1EwSvG"); NSLog(@"TzEdH71IaBQ58qcy6OG9L2kXYo"); NSLog(@"GOI7cvwyrT0jXP3zRMZYkK4VlUno1"); NSLog(@"8gBvrGwscVYUPWyiuDfLdAHOE0JNzISTxQoF2M13"); NSLog(@"eFPaVYtwr1HhmQ3Di8o7IljcJg"); NSLog(@"s8g9dH7UNWBtADhZX1EwPe5nGozKjF"); NSLog(@"iksbEDwvYIUtQjGeyq7up6BOdNfXVZJr4nTx1LM"); NSLog(@"KkUuxwfIB5VHRZL7zjaYlyFiMnm9AqpXC2TQ"); NSLog(@"Mx8qjcBSDowsmUk0aCRtd"); NSLog(@"qznIDUOSM6cVgx72F0dyN1C5vXpkiQjLJPBfYemW"); NSLog(@"L8gScfj6mTs4JIQK5Vea2p137rw0"); NSLog(@"bxVp42OejoqBNYnSQFWGEUrHIgTPk9Jydt0lu"); NSLog(@"juNCq0lU3syRXLQcFtObB6Y4ZfaDJv5HI"); NSLog(@"3azqmrduxegV5F8lfh9ZXys20SLTKi"); NSLog(@"jEmpTLhGZ4K80n5aoeJ9ywH1V3O"); } -(void)aKXg6J2:(UIControlEvents*) aKXg6J2 aonF3KXHV:(UIDevice*) aonF3KXHV a4onN3gxaK:(UILabel*) a4onN3gxaK a6pUM:(UIInputView*) a6pUM aDBKfmwOP3s:(UIBezierPath*) aDBKfmwOP3s aD0xWXhb2:(UIScreen*) aD0xWXhb2 ahecNWPr:(UIActivity*) ahecNWPr ajTn1VpRmCy:(UIDevice*) ajTn1VpRmCy aLr4nQ:(UIUserInterfaceIdiom*) aLr4nQ ad5BK:(UIColor*) ad5BK aF8L0GJcS:(UIEdgeInsets*) aF8L0GJcS ahTQX3VJK:(UIRegion*) ahTQX3VJK aD3uMdsimS:(UIImage*) aD3uMdsimS at2gKRXJf:(UIUserInterfaceIdiom*) at2gKRXJf aKY6OUAL8me:(UIDocument*) aKY6OUAL8me aYmBrTGIa:(UIScreen*) aYmBrTGIa { NSLog(@"an4gbUKPfHGvI26xBCpLJ017DQeq8WT5chusAd"); NSLog(@"OwMkIWNFqrJt9Tlda4mcnAiuzZxfB"); NSLog(@"Abdf2roYjtaO1R8"); NSLog(@"89Pv6t4Qysn1zpr20cVeoNLqxEgkwUSR"); NSLog(@"qBXiuRCxh4Ft6yHUsTKlLdSQzob5"); NSLog(@"odvghBe563xwYj2J9IS4TNuaOqbXA0mU81LzrGyH"); NSLog(@"xtcbdDQGXoLugmF1CzH9fiSJ3E2R48l"); NSLog(@"1QJFcRej0P3XAUluvmzLnaMHVCYNx4Zs29GpbO"); NSLog(@"WH8VXD7QnPpk1bSx4sfzJ5eIL9ZTjArRm"); NSLog(@"dDOxhFP8Nf"); } @end