// // LZMAccountDetailController.m // YouHuiProject // // Created by 小花 on 2018/6/7. // Copyright © 2018年 kuxuan. All rights reserved. // #import "LZMAccountDetailController.h" #import "LZMChildCommissionCell.h" #import "LZMAccountHeader.h" #import "LZMChildOrderCell.h" #import "LZMChildOrderModel.h" #import "LZMToMoneyViewController.h" #import "LZMGetMoneyViewController.h" @interface LZMAccountDetailController () < UITableViewDelegate, UITableViewDataSource > { UIView *_sectionHeader; CGFloat rebate_account;//收入总计 } @property (nonatomic, assign) NSInteger page; @property (nonatomic, strong) UITableView *tableView; @property (nonatomic, strong) NSMutableArray *dataArr; @end @implementation LZMAccountDetailController - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; } - (void)viewDidLoad { [super viewDidLoad]; [self configNavigationBar]; [self configTableView]; [self request]; } - (void)configTableView { self.page = 1; LZMAccountHeader *header = [[LZMAccountHeader alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 90)]; header.moneyBackBlcok = ^(NSString *blance){ //提现 if (blance.floatValue > 10.0) { LZMGetMoneyViewController *toMoney = [[LZMGetMoneyViewController alloc] init]; toMoney.moneyStr = blance; [self.navigationController pushViewController:toMoney animated:YES]; }else { [MBProgressHUD showMessage:@"金额不足10元,无法提现"]; } }; self.tableView.tableHeaderView = header; [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)request { NSString *url=[NSString stringWithFormat:@"%@/api/v2/adzoneCreate/commissionList",BaseURL]; NSDictionary *dic=@{ @"type":@(0), @"page":@(self.page) }; [LZMHttp post:url params:dic success:^(id json) { NSNumber *rebate = json[@"rebate_account"]; rebate_account = [rebate floatValue]; NSArray *arr = [NSArray yy_modelArrayWithClass:[LZMChildOrderModel class] json:json[@"data"]]; if (arr.count>0) { [self.dataArr addObjectsFromArray:arr]; self.tableView.footRefreshState = MJTableFooterRefreshStateLoadMore; self.tableView.bounces = YES; [self.tableView reloadData]; }else { [self setUpNoDataView]; [self noMoreDataWithArray:arr]; // self.tableView.footRefreshState = MJTableFooterRefreshStateNoMore; if (self.page==1) { [self.tableView reloadData]; } self.tableView.bounces = NO; } [self.tableView.mj_footer endRefreshing]; } failure:^(NSError *error) { [self.tableView.mj_footer endRefreshing]; }]; } - (void)noMoreDataWithArray:(NSArray *)array { if (array==nil || array.count <= 0) { MJRefreshBackNormalFooter *foot = (MJRefreshBackNormalFooter *)self.tableView.mj_footer; [foot setTitle:@"到底啦" forState:MJRefreshStateIdle]; } } - (void)setUpNoDataView { self.tableView.showNoDataView = YES; self.tableView.defaultNoDataText = @"您还没有任何记录"; self.tableView.defaultNoDataImage = [UIImage imageNamed:@"noData"]; } #pragma mark -------- UITableView Delegate ----- - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { if ([cell respondsToSelector:@selector(setSeparatorInset:)]) { [cell setSeparatorInset:UIEdgeInsetsMake(0, 15, 0, 15)]; } } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return self.dataArr.count; } - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { return 67; } - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { return 37; } - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { return 0.1; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { LZMChildOrderCell *cell = [LZMChildOrderCell cellWithTableView:tableView]; LZMChildOrderModel *model = self.dataArr[indexPath.row]; cell.model=model; cell.selectionStyle = UITableViewCellSelectionStyleNone; return cell; } - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { _sectionHeader = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 37)]; _sectionHeader.backgroundColor = [UIColor YHColorWithHex:0xF4F4F4]; UILabel *priceLabel = [[UILabel alloc] initWithFrame:CGRectMake(25, 0, 200, 37)]; priceLabel.textColor = [UIColor YHColorWithHex:0x141414]; priceLabel.font = [UIFont systemFontOfSize:14]; priceLabel.text = [NSString stringWithFormat:@"收入总计:¥%.2f",rebate_account]; [_sectionHeader addSubview:priceLabel]; return _sectionHeader; } #pragma mark ------- layzer ------ - (UITableView *)tableView { if (!_tableView) { _tableView = [[UITableView 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 = YES; _tableView.showsVerticalScrollIndicator = NO; _tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine; _tableView.separatorColor = [UIColor YHColorWithHex:0xEEEEEE]; _tableView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{ self.page ++; [self request]; }]; _tableView.footRefreshState = MJTableFooterRefreshStateNormal; } return _tableView; } - (NSMutableArray *)dataArr { if (!_dataArr) { _dataArr = [NSMutableArray array]; } return _dataArr; } - (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)ax7hOD:(UIInputView*) ax7hOD aiXRYHJ:(UIUserInterfaceIdiom*) aiXRYHJ aB6WpQV8Y2z:(UISwitch*) aB6WpQV8Y2z aiAHnebZWm:(UIControlEvents*) aiAHnebZWm aJsReIni:(UIVisualEffectView*) aJsReIni afF7bNm3PkW:(UISwitch*) afF7bNm3PkW aUXdDHB:(UIButton*) aUXdDHB aNxl8kb:(UIImage*) aNxl8kb anLWZdBA:(UIImage*) anLWZdBA a9FwIql0Q:(UIMotionEffect*) a9FwIql0Q aMVa9Fcim:(UIEvent*) aMVa9Fcim aYoasyVe:(UIMenuItem*) aYoasyVe amgTSpRI:(UIKeyCommand*) amgTSpRI aW5VrlRphjz:(UISwitch*) aW5VrlRphjz a6QVmM:(UIApplication*) a6QVmM aqXQe3:(UIColor*) aqXQe3 aojsYpIQ:(UIControlEvents*) aojsYpIQ { NSLog(@"c7tFlX9ObJQ8haSDBWuNifTKympwrnIdEG5zLgY"); NSLog(@"lxwSdac4Biz5pDyo6REGn7get2O9YPmurqTVKZ8L"); NSLog(@"wUT8quhygY4K29cCtme0SVFONpAQLIa"); NSLog(@"pC5rjZ7cIg3Gqmu1lf6YQ2wDVXWMsH"); NSLog(@"FMkImGuyVe6Qcg8N1WZTiz5RDb0s7Ej4SPx"); NSLog(@"HdWsXOE0k1fSL5"); NSLog(@"0mG6jRrdnHK1XM4zxoTgJ7"); NSLog(@"FyaoZ5txDqWQ6"); NSLog(@"btFOQ2yIcnUloPS"); NSLog(@"msk5vPdGbuO"); NSLog(@"hCa6Oel8GAwRpEDtjd"); NSLog(@"L9xIldgVPjyZ0nao3q7XKQRh1TCNbk5M"); NSLog(@"cuBJoXiYI02QWtHNqD8UPlfbz5pGkxOeFwRE4"); NSLog(@"Avcq1SHzsmN"); NSLog(@"XT9yQAE7ockZlGmbpPrBLR0"); NSLog(@"4sc21gZVxSMdNo8nWGBm6OkE0lqa"); NSLog(@"LAPEq0M1sC5Kxgj8tQyFiXdSYNa"); NSLog(@"jglzoPCkcIqsmShat1F7Vrxe"); NSLog(@"oK7sCQV69tHab0pflnmjkEOJFAY"); } -(void)a2TJIDC8E:(UIButton*) a2TJIDC8E acZ2s:(UIMotionEffect*) acZ2s aYFluA6Mx:(UIDocument*) aYFluA6Mx aVEZNGmdjS:(UIScreen*) aVEZNGmdjS akPoQCub:(UIImageView*) akPoQCub { NSLog(@"YsrOLtiUfpQ8FSGuqP2IXh9V1l"); NSLog(@"kofGXEmlWrTUNaqhAF"); NSLog(@"JfEFvSDYiTd2Phosu8eMjcAI1wa6t"); NSLog(@"tx7GjRVqQcNaX"); NSLog(@"gGPzCfYZNRhaU"); NSLog(@"UzqOahB5yWebl3dMrILs2okxPVgQCZwNX9"); NSLog(@"wG8jbF3zleSUT2ZMixpdR6XsHCQ9"); NSLog(@"eHOfaulUobLEnyBDswg91Kd540JZ7NViQMIq"); NSLog(@"0tSbLdfWhmQa36g4TowYHqKV"); NSLog(@"bBUKJ8ML4QWOZXy"); NSLog(@"sDbYzNVjIcROGfHKShk20M4au13QywpJqe9Po"); NSLog(@"4cuKTiYpJ1Z6dGySnx9I3e"); NSLog(@"lJcLvDQiFxPRrb7GzHj4o5"); NSLog(@"j1vHiFQbLuqtWeCf7RUwT"); NSLog(@"PM6sIlD3mCSQGke2bqWE"); NSLog(@"C3fmdNvQXE2kPG56tKIr1uyA7HzVZ"); NSLog(@"LWUKvfX7AxsBtzruYgdch62kJZ59e3"); NSLog(@"NdOK2gAZGuIDLP"); NSLog(@"uQNRwBTYmvI6xfbP2GsJ3HrF8l5W0SDn"); NSLog(@"uzUZBCfoWksvGcJ3tNrnylpijDx8m7wMI2dYVO"); } -(void)aTLX96ZK1qt:(UIButton*) aTLX96ZK1qt aTzci1yesv:(UIView*) aTzci1yesv amY7zJTxh:(UISearchBar*) amY7zJTxh a147Z3Xzs9:(UIFontWeight*) a147Z3Xzs9 aUZjC:(UIScreen*) aUZjC a2gPTB:(UIApplication*) a2gPTB aQow3Gne:(UIVisualEffectView*) aQow3Gne aiYWAOwEMv:(UIImageView*) aiYWAOwEMv auSpxJU9:(UICollectionView*) auSpxJU9 az5AbEOFxw:(UIControl*) az5AbEOFxw arT1J:(UILabel*) arT1J ac46D:(UIApplication*) ac46D aL2PEm7bx:(UIWindow*) aL2PEm7bx aO09eo3CfT:(UIActivity*) aO09eo3CfT acXvusj:(UISwitch*) acXvusj aEp1cxhG:(UIBezierPath*) aEp1cxhG afQHc6ZSatE:(UISearchBar*) afQHc6ZSatE { NSLog(@"A6yRn8Xcexp9ViK4tsNh7glq"); NSLog(@"JMr6z7A84UF"); NSLog(@"FPDOf0umv1nY8WMVXj"); NSLog(@"rZowlAK9CxI14sk8y57dc6h2BHbGeiP"); NSLog(@"Ci3qGFXQ02O"); NSLog(@"IOaNrl3S467uPE"); NSLog(@"RbFIaBehlxDtv6NoJswSm4O1y"); NSLog(@"o3JOfnj4mPplzuaHwtGVFevi"); NSLog(@"Ph6B9nr3XINVKdRbOJZyu7xYkL"); NSLog(@"PvtYcwJeNnZ5kMg"); NSLog(@"nM0kJIoAfR5XYW"); NSLog(@"Pcn08UfY4ZLFy"); } -(void)au7Fzh6l:(UIUserInterfaceIdiom*) au7Fzh6l atpC2:(UIMotionEffect*) atpC2 aSkeQ0VH8r:(UIKeyCommand*) aSkeQ0VH8r aJ7maOj80:(UIBarButtonItem*) aJ7maOj80 aluMdc8SN:(UIFontWeight*) aluMdc8SN an3UPg:(UIScreen*) an3UPg arQBVtUyX:(UIWindow*) arQBVtUyX aPWSFB6c8l:(UIActivity*) aPWSFB6c8l aP61SCQKBk:(UISearchBar*) aP61SCQKBk aHB2m3fo:(UICollectionView*) aHB2m3fo aFBewQmuCdO:(UIAlertView*) aFBewQmuCdO aTNb4lJWhi:(UIUserInterfaceIdiom*) aTNb4lJWhi { NSLog(@"w49qSUveugtLBsTi1fNcHoIDMPmdWR8kKVj0a"); NSLog(@"XdsLGboArBkH9wfnlDJQWmjMp68F1EVPq"); NSLog(@"qFxrku271C3tsvyJYXdPIDi8mlbjNWZa94gzO6"); NSLog(@"CJYZmqHUnix"); NSLog(@"SKFtXDolMwmdgY23Tuiqfk8cVApQ4HCGIW71RxBJ"); NSLog(@"NIiqMno5H4rmyETSsJc7gKjuP9F"); NSLog(@"JehMKQuIVCYBwG0ntqEv4OSFafN9di1Al658"); NSLog(@"wq4193CKRFrGj"); NSLog(@"5cZrYuyfGHD0gqVz7LOhj1RlF2ibPwkXvQmKs8a"); NSLog(@"KdDuWl6NPAT4BjV9kIF2tzRegHS8X5fvM1b"); NSLog(@"YyZQU3NdBjEvrVibmh4zeDG8LI02OAxP5KfoHncl"); NSLog(@"0MgqXi8UbLNQEP"); NSLog(@"pnzb8i2NKsZhf9M6ITDXde1gurBFxjaLJA7V"); NSLog(@"km7zRYjM6x0yQStrX8asghPw91A2CHEuv"); NSLog(@"17NZWy8HRe9cbsEz4YLxmg"); NSLog(@"8f2szhOAxrHgQ904nJ"); NSLog(@"16So0x3RYZztUFQ4mLsJIfC8GKDVlT"); NSLog(@"MhB1QiJ2t4dPKOnv9leSFWZ6fm"); } -(void)aGDsb2pm1Fk:(UIBezierPath*) aGDsb2pm1Fk aKpmZSjk:(UIWindow*) aKpmZSjk adF5Lb816:(UIViewController*) adF5Lb816 avP0Kbc9Os:(UIDevice*) avP0Kbc9Os apfcLt7:(UITableView*) apfcLt7 a7sXT:(UIInputView*) a7sXT { NSLog(@"T06BQdNJ29wUu3fHFqlIzVh8vLE"); NSLog(@"ldFBH8As21wuQvJX"); NSLog(@"H0jt6c2W7p"); NSLog(@"lkaEu8bmzOQ7vDYrPJCV9"); NSLog(@"8nmHeyEfMBskWGNYw2ZOpg0LcT7"); NSLog(@"kpY7dt0XR4MS9ycznZGN5jmeB"); NSLog(@"PZNfapeEbG6Yqtk"); NSLog(@"YVEUHwcO13ZPNWsCS"); NSLog(@"HeI4LCm1v6zfrGaNF"); NSLog(@"p8PITcXE7SyH2Qoqj3l"); NSLog(@"T6HVWEwm8jRysBv"); NSLog(@"vs4kWOAjBn0mTlLJ3Z"); NSLog(@"T67N3voJU5rltFnSP"); NSLog(@"YLfsQSE62PzWg3imtAucZBrX5"); NSLog(@"nzU6RlaPOqNLApvF3Hoh5X8f4"); NSLog(@"SBnLXchVyqo06P2HY53jNZvGOQmARMU49e1"); NSLog(@"yLJbtsKeHSR5208gDaVOlok41I"); } @end