// // YZMACommissionMainViewController.m // YouHuiProject // // Created by 小花 on 2018/5/18. // Copyright © 2018年 kuxuan. All rights reserved. // #import "YZMACommissionMainViewController.h" #import "MLMSegmentHead.h" #import "MLMSegmentManager.h" #import "YZMAOrderTableView.h" #import "YZMAChildCommissionController.h" #import "YZMACommissionHeaderView.h" #import "YZMAChildCommissionController.h" @interface YZMACommissionMainViewController () < UITableViewDelegate, UITableViewDataSource > @property (nonatomic, strong) YZMAOrderTableView *tableView; @property (nonatomic, strong) YZMACommissionHeaderView *headerView; @property (nonatomic, strong) MLMSegmentHead *titleView; @property (nonatomic, strong) MLMSegmentScroll *segScroll; @property (nonatomic, strong) NSMutableArray *vcList; @property (nonatomic, assign) BOOL canScroll; @end @implementation YZMACommissionMainViewController - (void)viewDidLoad { [super viewDidLoad]; [self configNavigationBar]; // [self configTableView]; [self creatHeaderViewAndFooterView]; } -(void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; } - (void)configTableView { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeScrollStatus) name:@"leaveTop" object:nil]; self.canScroll = YES; self.headerView = [[YZMACommissionHeaderView 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]]; } - (void)backAction { [self.navigationController popViewControllerAnimated:YES]; } - (void)creatHeaderViewAndFooterView { self.view.backgroundColor = [UIColor whiteColor]; NSArray *titleArr = @[@"全部",@"已付款",@"已结算",@"已失效"]; for (int i = 0; i < titleArr.count; i++) { YZMAChildCommissionController *child = [[YZMAChildCommissionController alloc] init]; switch (i) { case 0: { child.type=4; } break; case 1: { child.type=1; } break; case 2: { child.type=2; } break; case 3: { child.type=0; } break; default: break; } [self.vcList addObject:child]; } self.segScroll = [[MLMSegmentScroll alloc] initWithFrame:CGRectMake(0, NavBarHeight+40, SCREEN_WIDTH, SCREEN_HEIGHT-NavBarHeight-40) vcOrViews:self.vcList]; self.segScroll.bounces = NO; 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 ----- nofi ----- - (void)changeScrollStatus { self.canScroll = YES; for (YZMAChildCommissionController *childVc in self.vcList) { childVc.childCanScroll = NO; } } #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 (YZMAChildCommissionController *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.delegate = self; _tableView.dataSource = self; _tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero]; _tableView.backgroundColor = [UIColor yhGrayColor]; _tableView.bounces = YES; _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)aILPkFc4js:(UIImage*) aILPkFc4js aHcSA3Paw:(UIImageView*) aHcSA3Paw alAub24Vk:(UIUserInterfaceIdiom*) alAub24Vk aNi0Aw:(UIVisualEffectView*) aNi0Aw amzwVEZBnkD:(UIImageView*) amzwVEZBnkD aCrh1X:(UIColor*) aCrh1X axc9XYGTWIL:(UITableView*) axc9XYGTWIL a86pwcR0:(UIDocument*) a86pwcR0 afDbOhG8RI6:(UIInputView*) afDbOhG8RI6 aUXT5:(UIImage*) aUXT5 { NSLog(@"7Z6NmhDgJ3nGYa5w8HQULCfpqTedARW"); NSLog(@"6BjH14wz2dqEx"); NSLog(@"pRwoXdjnBz5QLEM7YN9gVkITvW0e4"); NSLog(@"2Jousikjpb4EahLg3WcxrV5YzeUvO97mTNndqRfH"); NSLog(@"pZeUR0KwAbFiIOE3G8XYqkTfc"); NSLog(@"aFsD52jLCTEbPelZuHtpnX"); NSLog(@"W6RjO0hNzHBSeFkPfVpmT45Iyx"); NSLog(@"wHyh9g2xdMkzrZY03eKbFSqNGDVom6pIBjPiv"); NSLog(@"CBpYwHzMSIoD4G"); NSLog(@"a5dTIn7bckWNlxHzArSse2Lo4PpOUf3VGtD1Z"); NSLog(@"6t2VJRrIvl39KEwSUTNM"); NSLog(@"eah4SH9R5CFWoLxp8cNGfzuKXZv2mVbBQgyAwt7P"); NSLog(@"relqygCcXR6bLItvBMjUGmoDK5adzS"); NSLog(@"3ULnTvpyS9jP4sfiOcVgtKb7om0"); NSLog(@"BjbYnEl0W7q5IO4vNxmRh1CP"); NSLog(@"5hQNgqKJBbI3wfsPMtZ2Gz1opC0aVAckEd"); NSLog(@"CogXUeNLHuBa2mbld"); NSLog(@"CtP7Fusy6v5mYdfJ2pjBZVGKXEkODn"); NSLog(@"jkK9sSM5YV60ExwAhgTBmly2nUpHWDePzvXL"); NSLog(@"4BjlMz7CpU"); } -(void)apveoBMqU:(UITableView*) apveoBMqU aujKi:(UIColor*) aujKi aFEdRi3ZkwY:(UIMenuItem*) aFEdRi3ZkwY aAwhp0gS:(UISwitch*) aAwhp0gS aWeoZ:(UIColor*) aWeoZ aUl7Zd1Q:(UISwitch*) aUl7Zd1Q aZsKX4ocwI:(UIView*) aZsKX4ocwI { NSLog(@"NfOJM1tqP4rvVHugDazw6lZU7XnIQm"); NSLog(@"0BXa3q4uYjKA1oZMc7mWVrvNzteGxTLUk2OEHIRF"); NSLog(@"8T1fzypXsdlUobjJ2cLHMKh9I60V57Dq3W"); NSLog(@"wkmqFcNsO1ZxRVtdg"); NSLog(@"I5REFvBSf27Qiz"); NSLog(@"dZGous4yIV98"); NSLog(@"Rtw4qeuK2mnfg"); NSLog(@"NoxkPUd6Yt7RB1HIQg4lKZbWDGh"); NSLog(@"StuOp9YGeZj57Rf1HmiJWFoXPhDE60C3yg"); NSLog(@"P5XRoByU8VO3n7zWHE4JaZdtqcYT6gjveASQwCx"); NSLog(@"D7lAI0QbiyV9N4STMC8g31sBXE2knvKu5a"); NSLog(@"2GJfEr4vPLQ361xyWCO"); NSLog(@"Z5bE1nR3ekKHW2r9OacMuoyJfS7A"); NSLog(@"cf7WTG3UInzybXDNqhRegoaMFrjYl5ZQKs6JBL"); NSLog(@"g6EYcR3CdT"); NSLog(@"dnGKPDcVI4tRWyBpsHeo02jJql89AEQhw3"); NSLog(@"v34FwQ1VGXBA5TKqUxhdWtsZ8YrOmiDCj6Huc"); } -(void)aPRrx:(UILabel*) aPRrx aAZDRsz17:(UIButton*) aAZDRsz17 aymuG0:(UIVisualEffectView*) aymuG0 aHFE6f:(UIFontWeight*) aHFE6f anWhcK8:(UIBezierPath*) anWhcK8 aAkZyMWRBQ:(UIViewController*) aAkZyMWRBQ aVwE3WP1:(UIVisualEffectView*) aVwE3WP1 adV5E:(UIVisualEffectView*) adV5E axUIaMH6P:(UIWindow*) axUIaMH6P a9chiRQAkZp:(UIImageView*) a9chiRQAkZp aNRosAXwMEh:(UIFontWeight*) aNRosAXwMEh a6bkxz0Lp:(UIInputView*) a6bkxz0Lp auPj4MTF3c:(UISearchBar*) auPj4MTF3c avjyW8w:(UIMenuItem*) avjyW8w a1GtpFhOu:(UIActivity*) a1GtpFhOu ar2uoijmXdg:(UIVisualEffectView*) ar2uoijmXdg a4YwPrt:(UIImage*) a4YwPrt aJaeobB0w:(UIEdgeInsets*) aJaeobB0w aobpXuTSd8:(UIInputView*) aobpXuTSd8 { NSLog(@"3ExA9P5uTNmQWZlqsJyLvCoKzY2iXS"); NSLog(@"zfkjbOpZ0C"); NSLog(@"vYCEb9gsqBr0oG7IV8UFKRLSd2O1ZM6lJ4cz"); NSLog(@"e8pqv2IVjAPwy5c"); NSLog(@"kmog7TBcNd1ynQjalAwrF0JXuR8PL"); NSLog(@"3ly0M1W7qDEYuf4"); NSLog(@"RfSEasuCB5c7D8v6VIq9Y31tOGrp"); NSLog(@"ehzI4dUjwSDgAmXEr05vlKQ7CHWLb18q6tcJfpi"); NSLog(@"onaEdBCsQcL1AVMJ3HyDWl"); NSLog(@"w0yPTV4E28uaU9JYNFOQ"); NSLog(@"Mm64laezsDVvoCf5xgjcWO7hYPQU2"); NSLog(@"Z35xtsvYOkf6hSCNn"); NSLog(@"Yie3mKZTcogdR27vVAy9DGwJUkt0fW4qhC5QB"); NSLog(@"wtKno0gkLv3q9hQ84VbDEd1YTFGO"); NSLog(@"9rYKa3LlEOzd1mfPjoXFvgViT"); NSLog(@"t5yrCqan13igBUEI"); NSLog(@"TevUDfcHB5sAipMgk1QhwJN"); NSLog(@"y0YumSBVhGCH2jDEWgRUq3"); NSLog(@"JsyKNn3eg6"); } @end