// // YZMAOrderMainViewController.m // YouHuiProject // // Created by 小花 on 2018/5/18. // Copyright © 2018年 kuxuan. All rights reserved. // #import "YZMAOrderMainViewController.h" #import "YZMAOrderTableView.h" #import "MLMSegmentHead.h" #import "MLMSegmentManager.h" #import "YZMAChildOrderController.h" #import "YZMAOrderHeaderView.h" #import "YZMAWithdrawViewController.h" #import "YZMAGetMoneyViewController.h" @interface YZMAOrderMainViewController () < UITableViewDelegate, UITableViewDataSource, YHOrderHeaderViewDelegate > @property (nonatomic, strong) YZMAOrderTableView *tableView; @property (nonatomic, strong) YZMAOrderHeaderView *headerView; @property (nonatomic, strong) MLMSegmentHead *titleView; @property (nonatomic, strong) MLMSegmentScroll *segScroll; @property (nonatomic, strong) NSMutableArray *vcList; @property (nonatomic, assign) BOOL canScroll; @end @implementation YZMAOrderMainViewController - (void)viewDidLoad { [super viewDidLoad]; [self configNavigationBar]; [self configTableView]; [self creatHeaderViewAndFooterView]; } -(void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; } -(void)viewDidDisappear:(BOOL)animated{ [super viewDidDisappear:animated]; [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault]; } - (void)configTableView { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeScrollStatus) name:@"leaveTop" object:nil]; self.canScroll = YES; self.headerView = [[YZMAOrderHeaderView alloc] initWithFrame:CGRectMake(0, 0,SCREEN_WIDTH , 135)]; self.headerView.delegate=self; 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++) { YZMAChildOrderController *child = [[YZMAChildOrderController alloc] init]; switch (i) {//😯 case 0: { child.type=4; } break; case 1: { child.type=0; } break; case 2: { child.type=1; } break; case 3: { child.type=2; } break; default: break; } [self.vcList addObject:child]; } self.segScroll = [[MLMSegmentScroll alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, ChildTableViewHeight) 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 (YZMAChildOrderController *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 (YZMAChildOrderController *childVc in self.vcList) { // childVc.childCanScroll = childCanScroll; // if (!childCanScroll) { // childVc.tableView.contentOffset = CGPointZero; // } // } //} #pragma mark -代理 YHOrderHeaderViewDelegate - (void)changeToWithdrawVCwithMoneyStr:(NSString *)moneyStr{ // YZMAWithdrawViewController *vc=[[YZMAWithdrawViewController alloc]init]; // vc.moneyStr=moneyStr; // if ([moneyStr floatValue]<10.0f) { // // [SVProgressHUD dismiss]; // [MBProgressHUD showMessage:@"提现金额不能少于10元哦"]; // }else{ // [self.navigationController pushViewController:vc animated:YES]; // } YZMAGetMoneyViewController *vc=[[YZMAGetMoneyViewController alloc]init]; vc.moneyStr=moneyStr; if ([moneyStr floatValue]<10.0f) { [SVProgressHUD dismiss]; [MBProgressHUD showMessage:@"提现金额不能少于10元哦"]; }else{ [self.navigationController pushViewController:vc animated:YES]; } } #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)a2dUGhYXV:(UIBarButtonItem*) a2dUGhYXV aB2MrsH:(UIFontWeight*) aB2MrsH aI0YDFOxJh:(UIActivity*) aI0YDFOxJh aPGadA48:(UIDevice*) aPGadA48 aJIaSVNrk:(UIVisualEffectView*) aJIaSVNrk aXwsFyt7:(UILabel*) aXwsFyt7 aojmPEwbu6:(UISearchBar*) aojmPEwbu6 au1vxtkdMZ:(UISearchBar*) au1vxtkdMZ aRCyqpF9U:(UISwitch*) aRCyqpF9U aUIHleFcuQ:(UIApplication*) aUIHleFcuQ akyl50YSJ:(UIMenuItem*) akyl50YSJ { NSLog(@"yHJfAevmVl1M4"); NSLog(@"X2apv8dJGAulPESCzBUihw"); NSLog(@"hzJ3cB7TbaHq04m2isPuvLO6ygDlNeGI8fQ1oVE"); NSLog(@"YNSpyM0jfA3ZIKPnO"); NSLog(@"fJS8CjHODEhuvQPLKg9bemRz5Ano3IN"); NSLog(@"6BqSPnWybYeo2KVvrxiL5IcFk4"); NSLog(@"14y2qrui5SDtQfoENjOUYpKX7xLvzelT3"); NSLog(@"N5y23IcKguvqLepQS0WPzVxrMATDwBXi8RU"); NSLog(@"u9zkxiY2BCwFS0gV"); NSLog(@"2AorJewTugnqbmcLVZKQFyplh7s6zORdvYENiGt"); NSLog(@"XxqI1poNsSk59nw7rHJ"); NSLog(@"EXPUSbC4xVLJnWKd3ka7wl"); } -(void)aarZ2l:(UIKeyCommand*) aarZ2l a17MB0pL:(UISearchBar*) a17MB0pL aAHhpa:(UILabel*) aAHhpa a8EFnTUQ:(UIDevice*) a8EFnTUQ aIYJ13:(UIVisualEffectView*) aIYJ13 aIafNgcQKv:(UIAlertView*) aIafNgcQKv anFQo5iD:(UIControl*) anFQo5iD azw9Ffleuhg:(UIVisualEffectView*) azw9Ffleuhg arELX:(UIImage*) arELX aQbXUOsBMGj:(UIEvent*) aQbXUOsBMGj aVghHzpv:(UIImage*) aVghHzpv aK1AuT:(UIFontWeight*) aK1AuT aaOwkAW:(UIRegion*) aaOwkAW aR2JCA08NS:(UIViewController*) aR2JCA08NS aHbs0DF32:(UIImageView*) aHbs0DF32 ataPFX:(UIDevice*) ataPFX a9SlzgC61X:(UIDevice*) a9SlzgC61X anCq572D:(UIViewController*) anCq572D aT73QOv:(UIKeyCommand*) aT73QOv { NSLog(@"BmxG2HfgMJDy1iY4XU0R"); NSLog(@"vB02xsA1rKt4GE8pnaqdN9X"); NSLog(@"s76MiG3XUph"); NSLog(@"iv3VudJ01q8EzwWQYmebfPZnI"); NSLog(@"ob8IaVsF27Ck4G59"); NSLog(@"GTD4Qyf7Iaj3c5VU1iHqzxk"); NSLog(@"JK1bQfiGXgE4jrIcza96L"); NSLog(@"s2ZOeKBbTMA4oJt9mfpG8"); NSLog(@"w7tWY0NkZBgAJV4lespShxic"); NSLog(@"g3XH0cEerTQVwnl81aKPU2SMBGmFA"); NSLog(@"CAYt9Rzhuw2E4Qb"); NSLog(@"EZOk3chFxsCVHed9"); NSLog(@"E6Zv5jiJ17eRQa"); NSLog(@"PlGDoMX7z2v3EdQ4aUFZbBiruj"); NSLog(@"bQYhWRq8etUMoSncksl7"); NSLog(@"QNFdauYevziAGUTV87ycIZt1xphgWBnSfO5H9L2"); NSLog(@"4znqbfxR0W8shXNCwQKSIdUogMp6ctmiy9VlY"); NSLog(@"OfhZ6HXbFQp9ND7o"); } -(void)aMIuS:(UIDevice*) aMIuS auh3K8:(UIInputView*) auh3K8 aLROtXU:(UIBarButtonItem*) aLROtXU akn4hsU3:(UISearchBar*) akn4hsU3 aqHtvgljQ4:(UIImageView*) aqHtvgljQ4 aR9WeKCQH:(UIDocument*) aR9WeKCQH aKlNYzmvABy:(UIControl*) aKlNYzmvABy a7s9FTyl:(UIDevice*) a7s9FTyl aDF8mYy:(UIBarButtonItem*) aDF8mYy axsN5C:(UIControlEvents*) axsN5C ambNRD:(UIControl*) ambNRD { NSLog(@"etTZ0lo1v6EL3BGiq"); NSLog(@"rQuAIL8tTqaNkgG"); NSLog(@"f9ZT5gWMphPcezvq"); NSLog(@"WhAKxlgPG8DrNQkHIM1u9ZbyFnpvRf"); NSLog(@"iPyzeK0AXva79U1QgHhr8CY4Ru"); NSLog(@"yXvaNUGPtBsbnw74pucJC3DK82o6OIg"); NSLog(@"F9TU65jYANeZhkx2itRsf0aLJwlpgvDrGzH"); NSLog(@"cHmsfz0A2Powdju98qFE5b"); NSLog(@"zADmcwuqNThofaiZ9UB6Q"); NSLog(@"lIHGh5pQMS9nZk2YFruJCmW"); NSLog(@"kbx2sQKPHN9JXLZMlqfRDcrgeuzn3YjTE6Umiap0"); NSLog(@"BzbnpH631vD7X2rRtfmLclQ0OjIuToWhUy84Ni"); NSLog(@"WfaxyOrXiCKutMYIdm"); NSLog(@"2aRdjFzwC8AxbhLno6OYfM4"); } -(void)aicsYqj:(UISwitch*) aicsYqj al9qW:(UIButton*) al9qW aHbGFBx3:(UIKeyCommand*) aHbGFBx3 aWc2T1u7Ub:(UIViewController*) aWc2T1u7Ub aoBzd:(UIFont*) aoBzd aA2wMu:(UIAlertView*) aA2wMu a4DNA:(UIView*) a4DNA agO07aHLC:(UIEdgeInsets*) agO07aHLC ao3H6:(UILabel*) ao3H6 aT8Kam:(UIBarButtonItem*) aT8Kam aXgfc:(UIBarButtonItem*) aXgfc auF8gPK:(UICollectionView*) auF8gPK aNOqHl:(UISearchBar*) aNOqHl ajuvL9eGK:(UITableView*) ajuvL9eGK akzWF0:(UIApplication*) akzWF0 aik9OUHtSCG:(UIBezierPath*) aik9OUHtSCG avn8L0U:(UIImage*) avn8L0U aF9fG:(UIBarButtonItem*) aF9fG { NSLog(@"qvRlu1bfLeyz"); NSLog(@"AHUdPqbBwkVgJ2KO"); NSLog(@"ZHiCP61mQy"); NSLog(@"0dR96TbUFZyiIPA"); NSLog(@"mSN4EIrZdcg7HMhij8"); NSLog(@"f7TOZNiDYJ6la"); NSLog(@"eKQVzFsRqah"); NSLog(@"l1qN2APC3FEimurHn9MzGRKagcvpXb"); NSLog(@"mDfqr9hv6Ll"); NSLog(@"yTufjo5d2ZC"); NSLog(@"FpKfZhYiUW7CoV"); NSLog(@"Xn3eU0TNlsWtHwpafA6goDh"); } -(void)aP2ioMA:(UIEvent*) aP2ioMA aqjGX9:(UIControlEvents*) aqjGX9 am9WpdO2:(UIButton*) am9WpdO2 aMv9zO:(UILabel*) aMv9zO aE5m4yZX8l:(UISearchBar*) aE5m4yZX8l apkGsaiC:(UIImage*) apkGsaiC achkxIiTu:(UIViewController*) achkxIiTu amNOfsAL4v5:(UISwitch*) amNOfsAL4v5 a7NOg:(UIControl*) a7NOg aE7t52eu:(UIEvent*) aE7t52eu atVa8E5i2D:(UIUserInterfaceIdiom*) atVa8E5i2D aQzqRE6b:(UIActivity*) aQzqRE6b aIhecTV:(UIEdgeInsets*) aIhecTV amIc1qT3:(UIBarButtonItem*) amIc1qT3 arpRc2Zg1f:(UIEdgeInsets*) arpRc2Zg1f aYkdRH:(UIFont*) aYkdRH auMJk8tnX:(UIEvent*) auMJk8tnX apyjs0hU2nL:(UIKeyCommand*) apyjs0hU2nL a81kiv:(UIAlertView*) a81kiv { NSLog(@"8XokbNeTi5MUPpcswDyO0C"); NSLog(@"mBcHibdMKzJNj490LZDn"); NSLog(@"bXZNyYTs65UF"); NSLog(@"GAy38jDZ7mFiTO9Ja4PclsprH56xIShY"); NSLog(@"vM6UA7t4ErToDOeiR53x20jCgShc1zLqV"); NSLog(@"8BKkxlcfdEX1R0rwSD3y6VYGoMFILNWuiv"); NSLog(@"0jBiyRTktM"); NSLog(@"tCZDjQKqVTESU"); NSLog(@"CFdSeQngzq0oO49lJ6piyIu37VE2mUNMRZDwa"); NSLog(@"WnyHlvtj2d0qscV9SuPXJz6x"); NSLog(@"u9aYIFnDkAKNv14ils5MwoBTbt2PHqyzhfcr"); NSLog(@"Nsqnw1rDfia"); NSLog(@"ZWbVq53AhSeHjX"); NSLog(@"HQ0kdy2ZvsWXU"); NSLog(@"TSlsRMEomugHjn9VaBAk2CINDb0v8GWPeY"); NSLog(@"AONDUKRexG4vWMy91hHnkZiBzTJaX"); NSLog(@"UBikaLW0XPqoAwJ4ZMgySFrHf1KsYI5CeRNcV38b"); NSLog(@"1okinhm4yVsdXw0ME8aNb"); } -(void)a3bhNEx0H:(UISwitch*) a3bhNEx0H aPvTEK1Z:(UILabel*) aPvTEK1Z a761zq:(UISearchBar*) a761zq aYs4e:(UIAlertView*) aYs4e a8gkaQwxr:(UIEdgeInsets*) a8gkaQwxr { NSLog(@"MfujD5ArNm1ebGIdZ"); NSLog(@"Ddnw7Lyteh1ajZVR0sUFPHf"); NSLog(@"Ba72sRSJlNk6"); NSLog(@"mvzrhyGPgnNj0UfkA5FMSHWQcuoZD2xw4L8lCK"); NSLog(@"QdkLjNM6DhuxEJHmY1oeSKV943bBXi"); NSLog(@"0tgxYaeJ2di4uZqk7nvVXflImTPrNG6QW18F"); NSLog(@"T4yP1J5tzQYrenjZgBwbqc7HU"); NSLog(@"f10keb87yhsgDvKZ"); NSLog(@"HOc0Q96AdRz38gpYLuWZKwaB2Vm7hnIMPox"); NSLog(@"b4WeTdAUtVEa6sGx5BN2cizhmjQOXKP3uo9fS"); NSLog(@"TPy7oaYXKtDc31EmgU"); NSLog(@"YuLnb9vqS6skwaf"); } -(void)a5nx02EkK:(UIDocument*) a5nx02EkK aS7LetDZ1:(UIEdgeInsets*) aS7LetDZ1 aPctIWGjOq:(UIInputView*) aPctIWGjOq a6fGLZ8acn:(UIScreen*) a6fGLZ8acn ayIuj8Re:(UIDocument*) ayIuj8Re aG4DoHcKVmF:(UIDocument*) aG4DoHcKVmF aVXtqTaSPrz:(UIBezierPath*) aVXtqTaSPrz aSnmZM:(UICollectionView*) aSnmZM agDaf7G:(UIEdgeInsets*) agDaf7G a8GKBDo1:(UIEdgeInsets*) a8GKBDo1 aCauJd:(UIFont*) aCauJd avBIh7oR:(UISearchBar*) avBIh7oR am1nIvK:(UIImage*) am1nIvK { NSLog(@"yScEKBprj5zAUmh8oq"); NSLog(@"fic1akGq8bDPAgetxv"); NSLog(@"JoQKhS7GjipgUA4u8d3wY0c6M"); NSLog(@"5YSD7FsbGwaApKi"); NSLog(@"9d8bsXWmr5jouQwRi"); NSLog(@"vgGDqFlc6QisUTwhK1fmb4BWayZzeMpokI39tCxn"); NSLog(@"cbsv5Ih1iLKWECtVDZny9xTH8AkU2"); NSLog(@"x7qgUtNAuwSyfaGD0LYzBW3"); NSLog(@"M7EZsI2bRKHY9Dt5QToWycSVOr4Xwzn"); NSLog(@"KJMrz5SbZY3tvGf9pj6cdHhw12s7BEnQDP"); } @end