// // LZMGetMoneyViewController.m // YouHuiProject // // Created by jcymac on 2018/6/5. // Copyright © 2018年 kuxuan. All rights reserved. // #import "LZMGetMoneyViewController.h" #import "LZMGetMoneyNextViewController.h" #import "LZMToMoneyViewController.h" @interface LZMGetMoneyViewController () @property(nonatomic,strong)UIView *userView; @property(nonatomic,strong)UIView *moneyView; @property(nonatomic,strong)UIButton *getMoneyBtn; @property(nonatomic,strong)UILabel *bottomLabel; @end @implementation LZMGetMoneyViewController - (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 { LZMToMoneyViewController *money = [[LZMToMoneyViewController 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) { LZMGetMoneyNextViewController *vc=[[LZMGetMoneyNextViewController 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)a7cm4lIq:(UIBarButtonItem*) a7cm4lIq aMijCaq:(UIBarButtonItem*) aMijCaq az5r3cCxh:(UIDevice*) az5r3cCxh aDwgVisbql:(UIInputView*) aDwgVisbql a8aq2wye:(UITableView*) a8aq2wye a2JECPFz:(UIRegion*) a2JECPFz aMiKgQ:(UIApplication*) aMiKgQ aZRLQxujz:(UIColor*) aZRLQxujz amAfgNt12:(UIBarButtonItem*) amAfgNt12 aI5pX3:(UIEvent*) aI5pX3 aKIVtf8Zhw:(UILabel*) aKIVtf8Zhw { NSLog(@"Xi9muY58UsdORq6CpDlbWAE2SZIj"); NSLog(@"yWXilKCAUFaSnTEsDfM9dHucwbr2O86tLvQ5"); NSLog(@"EwVPjRJh8vi2oGTc64QkOC0LAKd"); NSLog(@"TZeGntECqkLOl6gd8aJz9x"); NSLog(@"gPsb5wl4KDX8IEW7juaf"); NSLog(@"26TR1yaQwMDdWLlSZG8Fc"); NSLog(@"fRQxCFhHD5uMePYqb0gdcSky473arWltmBV69s"); NSLog(@"cfrzxbR2qQZpBJ46Etn"); NSLog(@"Crek61oydRnTDhYucpv0NxZEMUQH5XtIz2S"); NSLog(@"uoBMCs9JaE0QOZlwVdh"); NSLog(@"DHTfZO7b5RN14XsMLgGFP3WoYiUmK9jA"); NSLog(@"j9FAGIHl56av1TNYsqSrug8Lf"); NSLog(@"H59m6MtI3Zg8"); NSLog(@"7s0NpHqSfnJa6BbLMtxyC"); } -(void)aknRj1VtEvS:(UIEvent*) aknRj1VtEvS asTyZUwXb:(UIInputView*) asTyZUwXb a2PzZE:(UICollectionView*) a2PzZE a32MuVr4df5:(UIBezierPath*) a32MuVr4df5 a1hHBOwq:(UIBezierPath*) a1hHBOwq aLHkS:(UIRegion*) aLHkS aUE9Fj:(UIMotionEffect*) aUE9Fj apSwDNaE:(UIUserInterfaceIdiom*) apSwDNaE aZdHQuOkxM:(UIDocument*) aZdHQuOkxM akq8IRS:(UICollectionView*) akq8IRS aDuHq9yS:(UIActivity*) aDuHq9yS afa7k3VNrnP:(UIMenuItem*) afa7k3VNrnP a2vF0NIr67m:(UIVisualEffectView*) a2vF0NIr67m aeipd:(UIButton*) aeipd aXvCWAlO:(UIKeyCommand*) aXvCWAlO { NSLog(@"f0POEosrn3d6lNKb4AtweBvqWVcH5kTzYGZ7h"); NSLog(@"nhOrGlSPsxd1Qy08wWM6aZVYL"); NSLog(@"74lq0ILSHvU6NjhWgsAOZrf3ubm8i1QGp"); NSLog(@"gKLnfyJG6bAmXZzvVwt7RT8SFpxdUqo3"); NSLog(@"UoabKt4Jj3riIpd0RkWMYSAD9V18OzB5Q2f"); NSLog(@"LtVd91efrUTjsnucHQgk2BKPm"); NSLog(@"NYtKJZGwWkab8gC"); NSLog(@"JSRplOyj41t7FK0w"); NSLog(@"OF3hPWXrfdLHIyqYE4c0eQ295tpo"); NSLog(@"CSGuAhU6OzFiRrV8EYLNmQ"); NSLog(@"wVhJqgdYcl6"); NSLog(@"ZSF26b8gw1zKLXiWs5hQBjlaqtOTxHA4ryERcd7"); NSLog(@"vP4B0r1mbpEHykWfN5V6etdaTXGQgoKhZxDuz"); NSLog(@"BTJ0SVRhsrzev94QuCLMH8jlEkIZAxNfnUd"); NSLog(@"JKsVPB5TRFf0bc7xgW"); NSLog(@"a5cHZGYAzMdSFv9q83oLgQpwb2NuklI71ih"); } -(void)aCzbruB7f:(UISwitch*) aCzbruB7f a0F4bHBw:(UIImage*) a0F4bHBw anvYjXk:(UIFont*) anvYjXk aCwsHQz:(UICollectionView*) aCwsHQz aRTANEwb:(UIInputView*) aRTANEwb atKwR6zGN:(UIScreen*) atKwR6zGN aYePULNiM:(UIEvent*) aYePULNiM almfaVq3:(UICollectionView*) almfaVq3 a9fWHuLUb2:(UIImage*) a9fWHuLUb2 acYI13B2tV:(UIView*) acYI13B2tV { NSLog(@"XUehRSAmjoQVdYrgtynKfwzuO17kl4E3"); NSLog(@"WlzZKV32ygSB7bfGePLAU"); NSLog(@"C2Bu8N3G70SZlfyK96FHkxJQjaM5osb4WiUnc"); NSLog(@"9zLT4ij1JXIu8vt0Fo5wlZEAspnmKP2Va7yUN3GS"); NSLog(@"wqHvrAIzYVTJDl5uUPBWx7"); NSLog(@"C65bzLk0H9Va3YQf"); NSLog(@"U4b5PRXL3NyDiKGx"); NSLog(@"9xHknAz2pvwtWrG0S"); NSLog(@"DjIdPArbL80CkwUEphlntX"); NSLog(@"v894nsWr1h"); NSLog(@"if4Mu1oBm7LIdHKnZ6tkQNwrvYJDehyES"); NSLog(@"2NYX0iHzTvAp5x8ZwFsPInjMOlUEQ"); NSLog(@"e0OWjrgXzmwa2"); NSLog(@"gXYfVmk7xsPW0qMbET63yvSBA"); NSLog(@"F9HYEXAGbD1pgrJtS0TNwm5jqPfCysoV3nL"); NSLog(@"S2pLOyHeabYqBvIZCNtmx0j"); } -(void)aGzdO3y:(UIMotionEffect*) aGzdO3y axbsSKpm:(UIEvent*) axbsSKpm aKAY4GH5O9:(UILabel*) aKAY4GH5O9 akZlrMK8:(UIBarButtonItem*) akZlrMK8 ag0nFNlt:(UIButton*) ag0nFNlt aN7mzWKd:(UISearchBar*) aN7mzWKd aRnq2OYoHb4:(UIUserInterfaceIdiom*) aRnq2OYoHb4 aYftiL:(UIApplication*) aYftiL aSmRk:(UIAlertView*) aSmRk ay6lkfT031:(UIApplication*) ay6lkfT031 amaBGsy:(UIButton*) amaBGsy avRLN9u:(UIKeyCommand*) avRLN9u aNclATHVqE:(UIApplication*) aNclATHVqE { NSLog(@"aquvYX9g3BG4IQWVfxPL"); NSLog(@"B4WZXunIxY8GPLNjwgAVOHFvy5hsJ7S"); NSLog(@"kAupeigL3fVhvy5o4DQzKjaCsUJMrd"); NSLog(@"XAIlFDOp5jLf2oiEB7vZ0kszeStbCTwu91rQU"); NSLog(@"wn6DvFXyehWB895LZKirgN"); NSLog(@"VGM5smC6qaQIFpEhTcJ8d1UKbOxg7keNZLwSHvWi"); NSLog(@"S2MZ0mhV8iOEFd96JsQB"); NSLog(@"14kBLYQWt3V"); NSLog(@"bxJM3KE8z2OFZshvYyBaQWeGn0T1uPpkLHV"); NSLog(@"pmJvfytOPoG7"); NSLog(@"mORt5KPlNkduMgHh71T8QpybEq4GzovsnA"); NSLog(@"sYVozPhce4kjdg6alA"); NSLog(@"OAMzjRCtpLaEHTXsf"); } @end