// // YZMAGetMoneyViewController.m // YouHuiProject // // Created by jcymac on 2018/6/5. // Copyright © 2018年 kuxuan. All rights reserved. // #import "YZMAGetMoneyViewController.h" #import "YZMAGetMoneyNextViewController.h" #import "YZMAToMoneyViewController.h" @interface YZMAGetMoneyViewController () @property(nonatomic,strong)UIView *userView; @property(nonatomic,strong)UIView *moneyView; @property(nonatomic,strong)UIButton *getMoneyBtn; @property(nonatomic,strong)UILabel *bottomLabel; @end @implementation YZMAGetMoneyViewController - (void)viewDidLoad { [super viewDidLoad]; // self.view.backgroundColor=[UIColor YHColorWithHex:0xF2F2F2]; self.view.backgroundColor=[UIColor whiteColor]; [self configNavigationBar]; [self addUI]; [self adjustUI]; } -(void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; } - (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]]; UIButton *rightBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 80, 40)]; [rightBtn setTitle:@"提现记录" forState:UIControlStateNormal]; [rightBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; rightBtn.titleLabel.font = [UIFont systemFontOfSize:14]; [rightBtn addTarget:self action:@selector(gotoMoneyHistory) forControlEvents:UIControlEventTouchUpInside]; [self.navigationBar setCustomRightButtons:@[rightBtn]]; } - (void)gotoMoneyHistory { YZMAToMoneyViewController *money = [[YZMAToMoneyViewController alloc] init]; [self.navigationController pushViewController:money animated:YES]; } -(void)addUI{ [self.view addSubview:self.userView]; [self.view addSubview:self.moneyView]; [self.view addSubview:self.getMoneyBtn]; [self.view addSubview:self.bottomLabel]; } -(void)adjustUI{ [self.userView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.mas_equalTo(0); make.top.mas_equalTo(74); make.height.mas_equalTo(80); }]; [self.moneyView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.mas_equalTo(0); make.top.equalTo(self.userView.mas_bottom); make.height.mas_equalTo(144); }]; [self.getMoneyBtn mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(self.moneyView.mas_bottom).offset(25); make.centerX.equalTo(self.view.mas_centerX); make.height.mas_equalTo(42); make.width.mas_equalTo(FITSIZE(250)); }]; [self.bottomLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(self.getMoneyBtn.mas_bottom).offset(15); make.left.right.mas_equalTo(0); }]; UIView *imgView=[self.userView viewWithTag:10001]; [imgView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(FITSIZE(15)); make.centerY.equalTo(self.userView.mas_centerY); make.height.width.mas_equalTo(54); }]; UIView *nameLabel=[self.userView viewWithTag:10002]; [nameLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(imgView.mas_right).offset(FITSIZE(14)); make.top.equalTo(imgView.mas_top).offset(5); }]; UIView *getFriendLabel=[self.userView viewWithTag:10003]; [getFriendLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(nameLabel.mas_left); make.bottom.equalTo(imgView.mas_bottom).offset(-3); }]; UIView *YView=[self.moneyView viewWithTag:20002]; [YView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(FITSIZE(35)); make.bottom.mas_equalTo(-41); make.width.mas_equalTo(25); }]; UIView *lineView=[self.moneyView viewWithTag:20005]; [lineView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(YView.mas_left); make.right.mas_equalTo(FITSIZE(-35)); make.top.equalTo(YView.mas_bottom); make.height.mas_equalTo(1); }]; UIView *allMoneyView=[self.moneyView viewWithTag:20004]; [allMoneyView mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(lineView.mas_bottom).offset(10.5f); make.right.mas_equalTo(lineView.mas_right); make.width.mas_equalTo(60); }]; UIView *allowGetMoneyLabel=[self.moneyView viewWithTag:20006]; [allowGetMoneyLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(YView.mas_left); make.centerY.equalTo(allMoneyView.mas_centerY); }]; UIView *textView=[self.moneyView viewWithTag:20003]; [textView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(YView.mas_right).offset(FITSIZE(5)); make.right.equalTo(allMoneyView.mas_left).offset(FITSIZE(-5)); make.height.mas_equalTo(YView.mas_height); make.top.equalTo(YView.mas_top); }]; } #pragma mark -代理 - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{ if ([@"" isEqualToString:string]) { return YES; } if ([@"0123456789" rangeOfString:string].location!= NSNotFound) { return YES; } if ([@"." isEqualToString:string]) { if (textField.text.length>0&&[textField.text rangeOfString:@"."].location==NSNotFound) { return YES; } } return NO; } #pragma mark -事件响应 - (void)backAction { [self.navigationController popViewControllerAnimated:YES]; } - (void)setMoneyStr:(NSString *)moneyStr{ _moneyStr=moneyStr; UILabel *moneyStrLabel=[self.moneyView viewWithTag:20006]; moneyStrLabel.text=[NSString stringWithFormat:@"可提现余额 ¥%@",moneyStr]; } #pragma mark -懒加载 -(UIView *)userView{ if (!_userView) { _userView=[[UIView alloc]init]; _userView.hidden=YES; _userView.backgroundColor=[UIColor whiteColor]; UIImageView *imgView=[[UIImageView alloc]init]; imgView.layer.cornerRadius=27; imgView.layer.masksToBounds=YES; imgView.backgroundColor=[UIColor redColor]; UILabel *nameLabel=[[UILabel alloc]init]; nameLabel.text=@"用户名"; [nameLabel sizeToFit]; nameLabel.textColor=[UIColor YHColorWithHex:0x343434]; nameLabel.font=[UIFont systemFontOfSize:16]; UILabel *getFriendLabel=[[UILabel alloc]init]; getFriendLabel.text=@"邀请码:------"; [getFriendLabel sizeToFit]; getFriendLabel.textColor=[UIColor YHColorWithHex:0x343434]; getFriendLabel.font=[UIFont systemFontOfSize:14]; imgView.tag=10001; nameLabel.tag=10002; getFriendLabel.tag=10003; [_userView addSubview:imgView]; [_userView addSubview:nameLabel]; [_userView addSubview:getFriendLabel]; } return _userView; } -(UIView *)moneyView{ if (!_moneyView) { _moneyView=[[UIView alloc]init]; _moneyView.backgroundColor=[UIColor clearColor]; UILabel *YLabel=[[UILabel alloc]init]; YLabel.text=@"¥"; YLabel.textColor=[UIColor YHColorWithHex:0x333333]; YLabel.font=[UIFont systemFontOfSize:20]; [YLabel sizeToFit]; UITextField *textField=[[UITextField alloc]init]; textField.placeholder=@"输入提现金额"; textField.textColor=[UIColor blackColor]; textField.font=[UIFont systemFontOfSize:14]; textField.keyboardType=UIKeyboardTypeDecimalPad; textField.delegate=self; UIButton *allMoneyBtn=[UIButton buttonWithType:UIButtonTypeCustom]; [allMoneyBtn setTitle:@"全部提现" forState:UIControlStateNormal]; [allMoneyBtn setTitleColor:[UIColor YHColorWithHex:0xFF5200] forState:UIControlStateNormal] ; [[allMoneyBtn rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(id x) { if (self.moneyStr) { UITextField *textField=[self.view viewWithTag:20003]; textField.text=self.moneyStr; } }]; allMoneyBtn.titleLabel.font=[UIFont systemFontOfSize:12]; [allMoneyBtn sizeToFit]; UIView *lineView=[[UIView alloc]init]; lineView.backgroundColor=[UIColor YHColorWithHex:0xD8D8D8]; UILabel *allowGetMoneyLabel=[[UILabel alloc]init]; allowGetMoneyLabel.textColor=[UIColor YHColorWithHex:0x717171]; allowGetMoneyLabel.font=[UIFont systemFontOfSize:12]; allowGetMoneyLabel.text=@"可提现余额 ¥-.--"; [allowGetMoneyLabel sizeToFit]; YLabel.tag=20002; textField.tag=20003; allMoneyBtn.tag=20004; lineView.tag=20005; allowGetMoneyLabel.tag=20006; [_moneyView addSubview:YLabel]; [_moneyView addSubview:textField]; [_moneyView addSubview:allMoneyBtn]; [_moneyView addSubview:lineView]; [_moneyView addSubview:allowGetMoneyLabel]; } return _moneyView; } -(UIButton *)getMoneyBtn{ if (!_getMoneyBtn) { _getMoneyBtn=[UIButton buttonWithType:UIButtonTypeCustom]; _getMoneyBtn.layer.cornerRadius=21; [_getMoneyBtn setTitle:@"申请提现" forState:UIControlStateNormal]; _getMoneyBtn.backgroundColor=[UIColor gradientWidthFromColor:[UIColor YHColorWithHex:0xFF9000] toColor:[UIColor YHColorWithHex:0xFF5000] withWidth:FITSIZE(250)]; [[_getMoneyBtn rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(id x) { YZMAGetMoneyNextViewController *vc=[[YZMAGetMoneyNextViewController alloc]init]; UITextField *textFiled=[self.view viewWithTag:20003]; vc.moneyStr=textFiled.text; if ([vc.moneyStr floatValue]>=10) { [self.navigationController pushViewController:vc animated:YES]; }else{ [MBProgressHUD showMessage:@"提现金额最低为10元哦"]; } }]; } return _getMoneyBtn; } -(UILabel *)bottomLabel{ if (!_bottomLabel) { _bottomLabel=[[UILabel alloc]init]; _bottomLabel.text=@"3个工作日内到账"; _bottomLabel.textColor=[UIColor YHColorWithHex:0x666666]; _bottomLabel.font=[UIFont systemFontOfSize:12]; _bottomLabel.textAlignment=NSTextAlignmentCenter; [_bottomLabel sizeToFit]; } return _bottomLabel; } -(void)aoOmVRfBHlr:(UIButton*) aoOmVRfBHlr aV8ptW:(UILabel*) aV8ptW aQgqCL6t:(UIDevice*) aQgqCL6t aFcWinEVR:(UIEdgeInsets*) aFcWinEVR avPhNXxCH:(UIApplication*) avPhNXxCH a0ezBYulvF:(UIFont*) a0ezBYulvF arw57Ay:(UIBarButtonItem*) arw57Ay aV43ZxCw:(UIVisualEffectView*) aV43ZxCw aQEaIuGZmTl:(UIApplication*) aQEaIuGZmTl a75hkPLA4:(UIScreen*) a75hkPLA4 au0FROJphn:(UIImageView*) au0FROJphn afoq16e:(UIActivity*) afoq16e aNhbguc:(UIImageView*) aNhbguc apiTO:(UISearchBar*) apiTO aRsAUNhz6j:(UISearchBar*) aRsAUNhz6j aYMR9ojHwK:(UIBarButtonItem*) aYMR9ojHwK aswytWvhUk:(UIWindow*) aswytWvhUk { NSLog(@"QUBZpv8GF5qKRYad7esytWTPmVrb"); NSLog(@"iEAzVFUctxN0RkWTK4jBmoY582G"); NSLog(@"Cwm4Pn8jdbeKOkyI"); NSLog(@"s4k3ht8r5l"); NSLog(@"B5tE1nypL4NxYoH7U"); NSLog(@"PT2gDqnmRckFepNtsIf0iKVo5y4Y8d"); NSLog(@"tiWUMBjykv0SmNCRs5IhezXfoHQJ2ZGEOPYpux6A"); NSLog(@"w9alI1WCv35UEZhgP"); NSLog(@"gj5bmCYeSnA6N3Dzt4EpTBMu7OhUsRWF2li"); NSLog(@"mjV85SBt7bRN0MlYPeGHhqIW2p4AZuxyw91s"); NSLog(@"ECY7LPRKv9wMpn8mdZ"); NSLog(@"6QKf1MVdgsYDn4RSjNpJtO"); } -(void)aCAWfnPhV:(UIActivity*) aCAWfnPhV aU5aSLC:(UIMotionEffect*) aU5aSLC aEF6wq9:(UIButton*) aEF6wq9 aolzS:(UIDocument*) aolzS aZvKJ:(UIEdgeInsets*) aZvKJ adp0nxKrc:(UIScreen*) adp0nxKrc ae2dYvV5tPQ:(UISwitch*) ae2dYvV5tPQ aDc20SeY4VH:(UIMotionEffect*) aDc20SeY4VH aDeEAJ:(UIFontWeight*) aDeEAJ aOLGYRgA:(UIActivity*) aOLGYRgA aKSqmY:(UIAlertView*) aKSqmY { NSLog(@"EWxrjOiHfgcw5SpZJaXkPTnGIU2oN0lb8Ru9"); NSLog(@"FbRx0Mj62Jmzw"); NSLog(@"iLs64qM7rR85FZpoJaDyh3uGfBYn"); NSLog(@"QYctxZRfbv9Tn5JG8HK"); NSLog(@"OSz68KWncGHDYAhg0IlwQxkXUdeuPij7JbR9"); NSLog(@"XiTqI1DnWPFKg9Z6jlx7A"); NSLog(@"M8xprEOJTyAXo1CkInbq"); NSLog(@"uOoPizkqpXjRSyBlKwIC"); NSLog(@"0zelbV1g9DXscvRx"); NSLog(@"Z7npvACgtOcySz1438l6FmUMWkDu0dEbHr"); NSLog(@"TLC2PsBkKvQMWZuwR8dOit4XS5hHfn"); NSLog(@"I5VbKFfqLOdwez9No4ARk72ugc"); NSLog(@"AjyMqEUxp04PYZCeNS"); NSLog(@"HWt6ELU9dvD0F"); NSLog(@"FKVvDiSpyUeC6rPg"); NSLog(@"bknmdhKitJLDXr5SQ0sAPvUEGgC"); NSLog(@"RFPfltn8BNQVx4wrCzOo"); NSLog(@"XntUZ8IxSRkNrMY30v9"); } -(void)aHgJZP:(UIBezierPath*) aHgJZP avB0hp8Rxna:(UIMenuItem*) avB0hp8Rxna aLaNPMHcef6:(UISearchBar*) aLaNPMHcef6 ayzg8QwZP:(UIWindow*) ayzg8QwZP aN64X:(UIApplication*) aN64X ab2ox:(UIDevice*) ab2ox a8eVS:(UIMotionEffect*) a8eVS aQeLAdVH:(UIDevice*) aQeLAdVH amRcP3GHNd:(UICollectionView*) amRcP3GHNd { NSLog(@"4JqZcb5NHTQhdm8lDpX"); NSLog(@"hWZHLDptTfogPO4vUMeQYj6SJ7a9zA0n8yR"); NSLog(@"u05j9VcSOTGpbhoFCtelWEJ7w"); NSLog(@"hqJL9QT7Fp"); NSLog(@"03jwB4Lbfc"); NSLog(@"bkg9pTlULMBEdrO8waZDtSxmceY0J5HV7IKivoGz"); NSLog(@"4dVEDJ9peqY5i8nhHrGl6"); NSLog(@"d0OwRISXKDj1srY"); NSLog(@"zDe1SOf5bWBM7KN9EXJjIayQrgt8ZFRTwPnq"); NSLog(@"vczJnEHY9eO0UCN1x5bfPdhyaZTVm"); NSLog(@"LhFuKnMWozC08xP23XTy"); NSLog(@"djTZ5aECXxzYKHJn2S"); NSLog(@"vQjfM2RZmxSPNVzq8cwsXHJ3F"); NSLog(@"KVR9ztI8i1c"); NSLog(@"v7CPWLqUjNyDrM8lo6kOdeztRpsZ"); NSLog(@"boMEah1jmu4Y07ywOxZI"); NSLog(@"0xJScmjOWI2C4QDRlpzqswrVM51EkL"); } -(void)aRKFd:(UIFont*) aRKFd aE0iB3C2:(UISwitch*) aE0iB3C2 aOIo5:(UIBarButtonItem*) aOIo5 aRGpyXK:(UIEvent*) aRGpyXK aza5n:(UIViewController*) aza5n aQngTy:(UIScreen*) aQngTy aUb0ZYx:(UIMotionEffect*) aUb0ZYx ajvlicLTor:(UIImage*) ajvlicLTor adtCIm:(UIBarButtonItem*) adtCIm amhpKDr:(UIKeyCommand*) amhpKDr aclkip7B:(UILabel*) aclkip7B aNudosm2C47:(UICollectionView*) aNudosm2C47 anBj5d:(UIDevice*) anBj5d a1Eu8nvTbe:(UIButton*) a1Eu8nvTbe aY9jV1n4:(UIUserInterfaceIdiom*) aY9jV1n4 a5UPqoSz8:(UIVisualEffectView*) a5UPqoSz8 aIHuja4ecWT:(UIApplication*) aIHuja4ecWT { NSLog(@"1NLQ7P45hcSa6mOT8zFv3rYHKUngM"); NSLog(@"Gh10Hc5g8yroSDsQVZxJefWPAwnvMKiRb"); NSLog(@"kCtwLIdaOYvg"); NSLog(@"XSOGDBNP8Yr3TE7n0RK9Vexfg54iMydbCawQ"); NSLog(@"HteWoLmwqClf1ZFJ98V75sd34nXM"); NSLog(@"fKwUeVsZlua9tM720Y8BopD"); NSLog(@"B9uxWR62aIrdNEcH4VjglQshzLM0Knk1w3Z7i"); NSLog(@"D1n5qp30y7ilUMosJVxfXRvbW9hY6d"); NSLog(@"H6mIGj4PyT1Cnb8zsXM9euZqN3YlvW"); NSLog(@"90F7ylkREoYavTtc5QVhLDi6gquS1P"); NSLog(@"M4Zx8drSLjI7ua1m"); NSLog(@"AJoC6y3FXTnlb8xzuDOSWeqUvp0RINGKM"); NSLog(@"zfmW8liP7wuSBVh5GKdcYoE"); NSLog(@"LCMdXWhqOjgwfpUv7Y4J"); NSLog(@"8LSem97KDH4p3QkIvcNxoUs"); NSLog(@"FBHCnOLbVZ4MhE6vs08TQPR5a"); } -(void)aCqDryuzwk:(UILabel*) aCqDryuzwk aPfwT:(UIControlEvents*) aPfwT axQrINg2DFn:(UIAlertView*) axQrINg2DFn a4oxL8ur:(UITableView*) a4oxL8ur a3xPv:(UIView*) a3xPv { NSLog(@"uJvkNOMX5Gw1eFEamgqK4Hi"); NSLog(@"RSdvs3lHJkAiu4OotDL62rG9QKfyPgTn"); NSLog(@"JcwxWkEG6bhd1NZL3809zCnoOelIDqVp5Ti"); NSLog(@"dyb8jMeoVN0vDIx5il4kfXFp3W27O6wRgG"); NSLog(@"uW2Bfs6U7NwyR5SvkZpQ1l4IqzgJjDcYbO3am0G9"); NSLog(@"Am4DJZ1r2OoceEM39kyw7t"); NSLog(@"xekgDCwtbOWUhylHY7830vc5SIVqon6FrXjA"); NSLog(@"z13Oj2snpRVrQDtBfX7uE9aYy0SdegM"); NSLog(@"ERwkI8Gaji3p7ySzoqmdCJZ0"); NSLog(@"fKChujgLDSsAQ61q7WcdGV2t9YHaRXnkPObmoTl"); NSLog(@"PlWzGIXHM5oJv8Ar2RLwYO"); NSLog(@"3dznO7NHau5ZX9kVQ4AB8ytfsqUMw"); } -(void)aVX90pyOTIY:(UISearchBar*) aVX90pyOTIY aoXRdPve:(UIEvent*) aoXRdPve aCjnDiAG0:(UIButton*) aCjnDiAG0 aeamu:(UIVisualEffectView*) aeamu aPWA1Q:(UIButton*) aPWA1Q ah6VHuQ:(UIColor*) ah6VHuQ aTWVYiP7Ktn:(UIDevice*) aTWVYiP7Ktn afkTZlMAj:(UIApplication*) afkTZlMAj azIAkld:(UIUserInterfaceIdiom*) azIAkld { NSLog(@"DLYlw4c7A8bkJHXOrz6aEVZqsR2GM"); NSLog(@"4YLr7MuT1tnFPcWpsHdU9XbDjw"); NSLog(@"CxgIRXhEHemVT1raunSc"); NSLog(@"h5TilCynENWzPsGZ"); NSLog(@"xmD45VZpGXbwBWKyQ7o83"); NSLog(@"bDGZi95H4sqUcNVP"); NSLog(@"yoTh197twUWl3g"); NSLog(@"guzOpUlGIE98tncJeV2omqRyiPBT75dhb"); NSLog(@"zjJLB1OWUdQieD8x47F5IsoyAHGE9Ygf3mah"); NSLog(@"Dp46HWOlh3ntKM7"); NSLog(@"C9LZgM0KdGSQeO4kAbYqBi3ptRsm1oXFwNul"); NSLog(@"XUDJ7IiubE6wMGxKW1cV30LHT9sFQ8zAlgv"); NSLog(@"U8IZ9pte1zYCugaTnQxoGAy2NL"); NSLog(@"woip0VgM5tEUGFDf41Y"); NSLog(@"DlKAHREWN7kZoJsdq5U8bvtGgiSPCahxunBIX"); NSLog(@"q6ksLWnrbFGyPIj7TVxe"); } @end