// // LZMGetMoneyNextViewController.m // YouHuiProject // // Created by jcymac on 2018/6/11. // Copyright © 2018年 kuxuan. All rights reserved. // #import "LZMGetMoneyNextViewController.h" @interface LZMGetMoneyNextViewController () @property (nonatomic,strong) UIView *codeView; @property (nonatomic,strong) UIButton *nextBtn; @end @implementation LZMGetMoneyNextViewController - (void)viewDidLoad { [super viewDidLoad]; [self addUI]; [self adjustUI]; [self timeAction:[self.view viewWithTag:10003]]; } -(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]]; } -(void)addUI{ [self.view addSubview:self.codeView]; [self.view addSubview:self.nextBtn]; [self configNavigationBar]; } -(void)adjustUI{ [self.codeView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(FITSIZE(35)); make.right.mas_equalTo(FITSIZE(-35)); make.top.mas_equalTo(154); make.height.mas_equalTo(144); }]; [self.nextBtn mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(self.codeView.mas_bottom).offset(25); make.centerX.equalTo(self.view.mas_centerX); make.height.mas_equalTo(42); make.width.mas_equalTo(FITSIZE(250)); }]; UIView *imgView=[self.codeView viewWithTag:10001]; UIView *textFieldView=[self.codeView viewWithTag:10002]; UIView *timeView=[self.codeView viewWithTag:10003]; UIView *lineView=[self.codeView viewWithTag:10004]; [imgView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(0); make.bottom.mas_equalTo((-41-10)); make.width.height.mas_equalTo(18); }]; [timeView mas_makeConstraints:^(MASConstraintMaker *make) { make.right.mas_equalTo(0); make.centerY.equalTo(imgView.mas_centerY); make.width.mas_equalTo(76); make.height.mas_equalTo(22); }]; [textFieldView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(imgView.mas_right).offset(FITSIZE(10)); make.centerY.equalTo(imgView.mas_centerY); make.right.equalTo(timeView.mas_left); }]; [lineView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(imgView.mas_left); make.right.equalTo(timeView.mas_right); make.top.equalTo(imgView.mas_bottom).offset(10); make.height.mas_equalTo(1); }]; } #pragma mark -事件 -(void)timeAction:(UIButton *)sender{ [self requestCode]; [sender startWithTime:60 title:@"重新发送" countDownTitle:@"s" mainColor:[UIColor clearColor] countColor:[UIColor clearColor]]; } #pragma mark -网络请求 -(void)requestCode{ //获取验证码 NSString *url=[NSString stringWithFormat:@"%@/api/v2/users/sendCode",BaseURL]; [LZMHttp post:url params:nil success:^(id json) { } failure:^(NSError *error) { if (error) { [MBProgressHUD showMessage:@"获取失败"]; } }]; } -(void)requestGetMoney{ UITextField *textField=[self.codeView viewWithTag:10002]; if(textField.text &&![@"" isEqualToString:textField.text]) { NSString *url=[NSString stringWithFormat:@"%@/api/v2/adzoneCreate/embodyApplication",BaseURL]; NSDictionary *dic=@{ @"money":self.moneyStr, @"code":textField.text }; [LZMHttp post:url params:dic success:^(id json) { [MBProgressHUD showMessage:@"提现成功"]; [SVProgressHUD dismissWithDelay:1.0f]; [self.navigationController popToRootViewControllerAnimated:YES]; } failure:^(NSError *error) { if (error) { [MBProgressHUD showMessage:@"服务器开小差了,请稍后再试"]; } }]; }else{ [MBProgressHUD showMessage:@"您的输入有误,请重新输入"]; } } #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; } return NO; } #pragma mark -事件响应 - (void)backAction { [self.navigationController popViewControllerAnimated:YES]; } #pragma mark -懒加载 -(UIView *)codeView{ if (!_codeView) { _codeView=[[UIView alloc]init]; UIImageView *imgView=[[UIImageView alloc]init]; UITextField *textField=[[UITextField alloc]init]; UIButton *timeBtn=[UIButton buttonWithType:UIButtonTypeCustom]; UIView *lineView=[[UIView alloc]init]; imgView.tag=10001; textField.tag=10002; timeBtn.tag=10003; lineView.tag=10004; [_codeView addSubview:imgView]; [_codeView addSubview:textField]; [_codeView addSubview:timeBtn]; [_codeView addSubview:lineView]; imgView.image = [UIImage imageNamed:@"code_left"]; textField.placeholder=@"输入验证码"; textField.textColor=[UIColor blackColor]; textField.font=[UIFont systemFontOfSize:14]; textField.delegate=self; textField.keyboardType=UIKeyboardTypeNumberPad; [timeBtn setTitleColor:[UIColor YHColorWithHex:0xFF6D33] forState:UIControlStateNormal]; timeBtn.layer.borderColor=[UIColor YHColorWithHex:0xFF6D33].CGColor; [timeBtn addTarget:self action:@selector(timeAction:) forControlEvents:UIControlEventTouchUpInside]; [timeBtn setTitle:@"重新获取" forState:UIControlStateNormal]; timeBtn.titleLabel.font=[UIFont systemFontOfSize:12]; [timeBtn setTitleColor:[UIColor YHColorWithHex:0xFF6D33] forState:UIControlStateNormal]; timeBtn.layer.borderWidth=1; timeBtn.layer.cornerRadius=11; timeBtn.layer.masksToBounds=YES; lineView.backgroundColor=[UIColor YHColorWithHex:0xD8D8D8]; } return _codeView; } -(UIButton *)nextBtn{ if (!_nextBtn) { _nextBtn=[UIButton buttonWithType:UIButtonTypeCustom]; _nextBtn.layer.cornerRadius=21; [_nextBtn setTitle:@"完成" forState:UIControlStateNormal]; _nextBtn.backgroundColor=[UIColor gradientWidthFromColor:[UIColor YHColorWithHex:0xFF9000] toColor:[UIColor YHColorWithHex:0xFF5000] withWidth:FITSIZE(250)]; [[_nextBtn rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(id x) { [self requestGetMoney]; }]; } return _nextBtn; } -(void)aM1rWtd7zU:(UIUserInterfaceIdiom*) aM1rWtd7zU aLkcmT:(UIFontWeight*) aLkcmT aE1QrPNB:(UICollectionView*) aE1QrPNB aBl3znONYJ:(UIVisualEffectView*) aBl3znONYJ a7nDH0EqhO:(UIView*) a7nDH0EqhO aE2KCIdeHAG:(UIRegion*) aE2KCIdeHAG aG4hwCKqM:(UIEvent*) aG4hwCKqM atOr6GFoBfu:(UIInputView*) atOr6GFoBfu aFDK23fd5BO:(UIImageView*) aFDK23fd5BO a4Crc2kpn:(UIImage*) a4Crc2kpn aGMxF:(UIDocument*) aGMxF aXzF8Ke2U:(UIWindow*) aXzF8Ke2U auhaAMzkG:(UIUserInterfaceIdiom*) auhaAMzkG akDyJUsaw:(UIApplication*) akDyJUsaw aGM5V:(UIEvent*) aGM5V auiqAn:(UIScreen*) auiqAn apje4DX12:(UILabel*) apje4DX12 aYaQ1rN:(UIActivity*) aYaQ1rN amZuaKgfnl:(UIUserInterfaceIdiom*) amZuaKgfnl { NSLog(@"Z0sAUGemtKra8vbIxiloSMgVk9nCq35TE"); NSLog(@"PlwkOVR1zNrDsBu8ZLbEpCyi"); NSLog(@"QLIhsYVSBFEyNT0MtAilCxwHGX1kf9U6p8Wo"); NSLog(@"I8Y4jRKSk6AehL7gVxvN2iZFb"); NSLog(@"9kxRXhVWLOpAZ"); NSLog(@"afW8BVCMbw0HlgrRc9nQAxmqkt5zhJd1L2GuFS"); NSLog(@"fu1HpVn48qiLX3h2"); NSLog(@"EamFLvDPlStyg0ZWe2udGTsj"); NSLog(@"uqyemsTfNcAkUnJQX8K5vYiCPzxh3HMRIwF6l"); NSLog(@"L4zDjfktP2TRY7NwM8xl1rWFqAIXbBm0Hypci"); NSLog(@"uCmQORoaKnptcqEZ"); NSLog(@"4iaIVCWKBokfOHb6dzJ7vgUE9Z2QyPL1n"); NSLog(@"KQClFe4E5jtx2MZ3sqJkaw9UrpyHbf8cioWVOm"); NSLog(@"bGsHNOM3qQcIXPo65V97RTg8eynxf"); NSLog(@"rGnm3cAxT90FUuhEds2Kj1RZSkLboHfJvygaliw5"); NSLog(@"t9BkjPu56WCdIJRoMfXT3Z7Kal8h"); NSLog(@"sCcnNmKrbauRLEVgxfOq7UpzI"); NSLog(@"ceysPmvRarIWxq7uhK35HtpSdNi"); } -(void)aJPpGqWhgn:(UIBarButtonItem*) aJPpGqWhgn aIV3gW:(UIViewController*) aIV3gW aLfQbvJj4U:(UIBarButtonItem*) aLfQbvJj4U a6Sru1BvC3w:(UITableView*) a6Sru1BvC3w aJdmafHv7:(UILabel*) aJdmafHv7 aCMy3k4:(UIColor*) aCMy3k4 aG5d4Mr:(UIImage*) aG5d4Mr { NSLog(@"KhoENRlO5pYi2z"); NSLog(@"feMmVy0TDqrBkbEU3Lglpa14oJQ"); NSLog(@"h8lULd5YPZDrpCkz9ev2GgqHwmy14KWJjEos0"); NSLog(@"3G0KaQmnRXhw8dPNso9FrtBIi"); NSLog(@"GvcnmFOJLreItYw"); NSLog(@"vuegkf6snGmcC3YzFoApBMESbr"); NSLog(@"stDVpzEQKWX8fNZgd2U7jHbum"); NSLog(@"4cwpSB9TJn3xEF0Hev82"); NSLog(@"2elgoqtx45sGKfPaCvmEJNiHwQLc8"); NSLog(@"hsAtEGVHiTlocROj1kFYW7pDw2qC"); NSLog(@"qG1TRiyg6BHhfOpsdA8CYbjJQN5vrU"); NSLog(@"sZ9RLYGAcC46TxnU"); NSLog(@"WNJTtkHmdxojhsKAcfYr586C"); NSLog(@"sJHmq3r7Th1ki"); NSLog(@"fs7DGVqZwv9SmtEWKMI2jTR4BHdhiPQ8150glCbF"); NSLog(@"dExivpu5rPY73XKfwykceoBjh0A1RmFnUtS4I9gH"); NSLog(@"RuZ6XOrPgjE3epm"); NSLog(@"f4AJWVyXnP0G27iLtwD8z9a3oIUv6Eh"); } -(void)aGDg8aXQE:(UIRegion*) aGDg8aXQE auS0rT:(UIColor*) auS0rT aFuE9IK:(UIView*) aFuE9IK a1cYG3:(UIFontWeight*) a1cYG3 aa1Eq:(UILabel*) aa1Eq ayu2RND7n:(UIMotionEffect*) ayu2RND7n a4Jsd:(UIDevice*) a4Jsd amnHST:(UIView*) amnHST aObGohJB:(UIColor*) aObGohJB aJUXFhfDsg:(UIMotionEffect*) aJUXFhfDsg akcx09R:(UIControl*) akcx09R aWyKh3eV:(UIButton*) aWyKh3eV aZlEjOdU05:(UIRegion*) aZlEjOdU05 { NSLog(@"PA9Cwuxv4tFi2S0QRkIXZ"); NSLog(@"FJSzOUuw1tM6"); NSLog(@"TmcXD0OU9lbqA"); NSLog(@"bjCcNaSo4V7T0ldmYeR9wr3"); NSLog(@"NArnId6pfD81ze7OVjYMc"); NSLog(@"nme1ag4LZcTGu95EtrD8h0FBdUYlsXjfxzIM2p"); NSLog(@"3BTPb8vJMghkWlqxwAUONIyCfac2"); NSLog(@"GsC1i20jIT93MkHvFZ5b6ufK"); NSLog(@"izyurtj1l8bD4LhEO0ZFnq"); NSLog(@"qJ1t2mQh5lNKF"); NSLog(@"zBhfpM47RsdIoOLkKWQe2gASYxtZFDNnlHcEP"); } -(void)asq4OpzyYC:(UIDocument*) asq4OpzyYC aYDTFW:(UIDocument*) aYDTFW aKpf84:(UIControl*) aKpf84 a84dRQT1h:(UIControl*) a84dRQT1h aX8RstiHNz:(UIScreen*) aX8RstiHNz a9UB05ka:(UIButton*) a9UB05ka aja8IQ2:(UIControlEvents*) aja8IQ2 axEWCl5:(UIBarButtonItem*) axEWCl5 aJdPrcIhL0S:(UIColor*) aJdPrcIhL0S a3jDrQxA:(UIBarButtonItem*) a3jDrQxA axRku7:(UIFont*) axRku7 aMjWhP:(UIScreen*) aMjWhP aRT86:(UIViewController*) aRT86 aahUg6cuO:(UICollectionView*) aahUg6cuO a4umshx:(UIFont*) a4umshx aw8lSG:(UIBarButtonItem*) aw8lSG { NSLog(@"8hiJmdIAPFpMz47QYOVyjKX2DvGULBqoSxNet6WC"); NSLog(@"lfVBJ5QCnUO4dGESj0"); NSLog(@"VbuYskh4eRFgE"); NSLog(@"VYBxlurUEFDL90KC6ZMsciJNWv3t"); NSLog(@"eOJxbKsL8ZCj"); NSLog(@"IvrCwxsGNha891ZQuUoigHqFj4y5XETYJAbknc6p"); NSLog(@"NBiWUDxmoGQk1d6LEv05"); NSLog(@"aKTntd5Ze6FIjkUv"); NSLog(@"2Q0OD6V5Fxp"); NSLog(@"kGI9S8jECa6W1HfXNY"); NSLog(@"7cj0pnPq8dZuUSoxtVOTAHB5LW1QvJyDg"); NSLog(@"Fnk0v9aZ2TDIOJt1G45Mjwbc"); NSLog(@"JO0z1VAKSeRF3gsruycYMCWLPXoBk7DfwnZj"); NSLog(@"2sTl3VhqUOaXeuRQjicLJo4"); NSLog(@"FJHTgizWC7tEBxlmuV"); NSLog(@"t135sWbChTyUfaIX8E7kKLZD96dF2ejvRN"); NSLog(@"1uJ5dKIOXE6CvlSxF8obeMZNYVpjkiAcGR2n"); NSLog(@"m0pYxlaEW6k27PJ"); NSLog(@"1IRg0HcTlzLNjshw7"); } -(void)aIfrHF2C:(UIUserInterfaceIdiom*) aIfrHF2C aqExvd653:(UIBarButtonItem*) aqExvd653 apTnu:(UIImage*) apTnu aPFTI:(UIActivity*) aPFTI aTx1tQ:(UIVisualEffectView*) aTx1tQ a0Vhd:(UIColor*) a0Vhd aID9U:(UIButton*) aID9U { NSLog(@"P4b2YFDrNEW3Zht"); NSLog(@"W1hQCjAPTMFGEzKtOmB9"); NSLog(@"y2lkWi4XnUvx3pmqgfQHEN09Me1PsBwzRbc"); NSLog(@"VQ4x3ohWpdAsbygmKES"); NSLog(@"uzojyNgt60eEMxfO"); NSLog(@"NKzlWJ7L4c1snRQM5TVf"); NSLog(@"dP9o0M5OuTaNt3"); NSLog(@"s6bXlrvG4eF90ToCkMgOq"); NSLog(@"GiZnrtajh90pSN5OYAbCMUv2HL"); NSLog(@"StxsFU1Da4lXiREHZyv8uABNIo7fWh"); NSLog(@"0QAitVwLfsJvW4qEzrdKB7u8SNZO9PT"); NSLog(@"qah7Ko3R6HWsdYQxfCIuO19lXLDEJNGwn"); NSLog(@"N09iUEr8KSkqjvBJ54dThwAYRy6CZbstlD2"); } @end