// // YZMAWithdrawNextViewController.m // YouHuiProject // // Created by jcymac on 2018/5/23. // Copyright © 2018年 kuxuan. All rights reserved. // #import "YZMAWithdrawNextViewController.h" @interface YZMAWithdrawNextViewController () @property(nonatomic,strong)UILabel *top1Label; @property(nonatomic,strong)UILabel *top2Label; @property(nonatomic,strong)UITextField *textField; @property(nonatomic,strong)UIView *lineView; @property(nonatomic,strong)UIButton *rightBtn; @property (nonatomic,strong)UIButton *withdrawBtn; @end @implementation YZMAWithdrawNextViewController - (void)viewDidLoad { [super viewDidLoad]; [self addUI]; [self adjustUI]; [self configNavigationBar]; [self rightAction:self.rightBtn]; } - (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]]; } #pragma mark -点击方法 - (void)backAction { [self.navigationController popViewControllerAnimated:YES]; } -(void)withdrawAction{ [self requestWithdraw]; } -(void)rightAction:(UIButton *)sender{ //获取验证码 [self requestCode]; [sender startWithTime:20 title:@"重新发送" countDownTitle:@"s" mainColor:[UIColor clearColor] countColor:[UIColor clearColor]]; } #pragma mark -网络请求 -(void)requestCode{ //获取验证码 NSString *url=[NSString stringWithFormat:@"%@/api/v2/users/sendCode",BaseURL]; NSString *phone=[[NSUserDefaults standardUserDefaults]objectForKey:UserPhone]==nil?@"":[[NSUserDefaults standardUserDefaults]objectForKey:UserPhone]; NSString *ttl = [PublicFunction getNowTimeTimestamp]; NSString *sign = [NSString stringWithFormat:@"phone=%@&ttl=%@%@",phone,ttl,SignCode]; NSString *md5Str = [PublicFunction md5:sign]; NSDictionary *para = @{@"phone":phone, @"ttl":ttl, @"sign":md5Str }; [YZMAHttp post:url params:para success:^(id json) { } failure:^(NSError *error) { if (error) { [MBProgressHUD showTip:@"获取失败"]; } }]; } -(void)requestWithdraw{ if (self.textField.text &&![@"" isEqualToString:self.textField.text]) { NSString *url=[NSString stringWithFormat:@"%@/api/v2/adzoneCreate/embodyApplication",BaseURL]; NSDictionary *dic=@{ @"money":self.moneyStr, @"code":self.textField.text }; [YZMAHttp post:url params:dic success:^(id json) { [MBProgressHUD showTip:@"提现成功"]; [SVProgressHUD dismissWithDelay:1.0f]; [self.navigationController popToRootViewControllerAnimated:YES]; } failure:^(NSError *error) { if (error) { [SVProgressHUD showWithStatus:@"服务器开小差了,请稍后再试"]; [SVProgressHUD dismissWithDelay:1.0f]; } }]; } } -(void)addUI{ [self.view addSubview:self.top1Label]; [self.view addSubview:self.top2Label]; [self.view addSubview:self.lineView]; [self.view addSubview:self.rightBtn]; [self.view addSubview:self.textField]; [self.view addSubview:self.withdrawBtn]; } -(void)adjustUI{ [self.top1Label mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(FITSIZE(20)); make.top.mas_equalTo(94); }]; [self.top2Label mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(self.top1Label.mas_bottom).offset(8); make.left.equalTo(self.top1Label.mas_left); }]; [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(FITSIZE(20)); make.right.mas_equalTo(FITSIZE(-20)); make.top.equalTo(self.top2Label.mas_bottom).offset(70); make.height.mas_equalTo(0.5f); }]; [self.rightBtn mas_makeConstraints:^(MASConstraintMaker *make) { make.right.equalTo(self.lineView.mas_right); make.bottom.equalTo(self.lineView.mas_top).offset(-10); }]; [self.textField mas_makeConstraints:^(MASConstraintMaker *make) { make.centerY.equalTo(self.rightBtn.mas_centerY); make.left.equalTo(self.lineView.mas_left); }]; [self.withdrawBtn mas_makeConstraints:^(MASConstraintMaker *make) { make.centerX.equalTo(self.view.mas_centerX); make.top.equalTo(self.lineView.mas_bottom).offset(196); make.width.mas_equalTo(FITSIZE(250)); make.height.mas_equalTo(42); }]; } -(UILabel *)top1Label{ if (!_top1Label) { _top1Label=[[UILabel alloc]init]; _top1Label.textColor=[UIColor YHColorWithHex:0x333333]; _top1Label.text=@"为了您的账户安全,已给您的手机发送了验证码"; _top1Label.font=[UIFont systemFontOfSize:16]; } return _top1Label; } -(UILabel *)top2Label{ if (!_top2Label) { _top2Label=[[UILabel alloc]init]; _top2Label.textColor=[UIColor YHColorWithHex:0x333333]; _top2Label.text=@"请输入验证码"; _top2Label.font=[UIFont systemFontOfSize:16]; } return _top2Label; } -(UIView *)lineView{ if (!_lineView) { _lineView=[[UIView alloc]init]; _lineView.backgroundColor=[UIColor YHColorWithHex:0xE5E5E5]; } return _lineView; } -(UITextField *)textField{ if (!_textField) { _textField=[[UITextField alloc]init]; _textField.placeholder=@"请输入验证码"; _textField.font=[UIFont systemFontOfSize:16]; } return _textField; } -(UIButton *)rightBtn{ if (!_rightBtn) { _rightBtn=[UIButton buttonWithType:UIButtonTypeCustom]; [_rightBtn setTitle:@"重新发送" forState:UIControlStateNormal]; [_rightBtn setTitleColor:[UIColor YHColorWithHex:0xFF5200] forState:UIControlStateNormal]; [_rightBtn addTarget:self action:@selector(rightAction:) forControlEvents:UIControlEventTouchUpInside]; _rightBtn.titleLabel.font=[UIFont systemFontOfSize:14]; } return _rightBtn; } -(UIButton *)withdrawBtn{ if(!_withdrawBtn){ _withdrawBtn=[UIButton buttonWithType:UIButtonTypeCustom]; _withdrawBtn.backgroundColor=[UIColor gradientWidthFromColor:[UIColor YHColorWithHex:0xFF9000] toColor:[UIColor YHColorWithHex:0xFF5000] withWidth:FITSIZE(250)]; [_withdrawBtn setTitle:@"申请提现" forState:UIControlStateNormal]; [_withdrawBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; [_withdrawBtn addTarget:self action:@selector(withdrawAction) forControlEvents:UIControlEventTouchUpInside]; _withdrawBtn.titleLabel.font=[UIFont systemFontOfSize:16]; _withdrawBtn.layer.cornerRadius=21; _withdrawBtn.layer.masksToBounds=YES; } return _withdrawBtn; } -(void)azLdjD:(UIRegion*) azLdjD atDeA5UgOB:(UIBarButtonItem*) atDeA5UgOB a1JVhl4uc:(UIRegion*) a1JVhl4uc azH2RWw:(UIFontWeight*) azH2RWw aOti8mCs:(UIActivity*) aOti8mCs { NSLog(@"ZFkB3VPezMo"); NSLog(@"OeyuJVHqUSi64rRGc2pgn8YLN7Ilsbw9mW"); NSLog(@"cyn3O7l4FIwruJe9d5o"); NSLog(@"aFwv0MnZsPQgOtk4CARlxDc"); NSLog(@"0PHWEcCmtgaKoLnFi5wG"); NSLog(@"sqb9TPhRi46Cl1"); NSLog(@"jVh3UHfAEMONQzL1r6"); NSLog(@"G3Av40hYTZoW7RXntEq69gN5lUkQiJ"); NSLog(@"yeXFuwrDdfYZRLKNU7HMv9oajpQPWlBgEC0Jqb5"); NSLog(@"v1GeUgfdnHElASy"); NSLog(@"BhpsVY9yOwCRL1"); NSLog(@"7wVuhgSJiepqvZGLjTAxblE4MRBaQdfk5"); NSLog(@"yNpowYLIPxc"); NSLog(@"xNUJLX29kdwWgnYeTGMhsvAK0IFc7j4yHirQ"); NSLog(@"NVax6RYdSWXIDhrOFAUJEiwlqt1fzjmsL3P"); NSLog(@"15oMuLZlmfqsHgTiIKA2thBrUjp3zRE97CF"); } -(void)abolQJA8O:(UIDocument*) abolQJA8O aQgFu:(UIScreen*) aQgFu ahib3:(UIActivity*) ahib3 aNdchbrMesn:(UIEvent*) aNdchbrMesn adqCxYtaUD:(UIMotionEffect*) adqCxYtaUD { NSLog(@"t8ckm5fxO4GXUCFL"); NSLog(@"AqThLUw52ZJi9zGPODbsFExmBav"); NSLog(@"amPlHJSMWkuTL7qxD8KAed2G"); NSLog(@"uwhlYpI5TCfKzyebWt4J"); NSLog(@"IdcoWseSwzrv02BCK5XL4TFiZDyGmOjN1VPA"); NSLog(@"ZIu0T1NLwr7gWQOm8eM4B3RbPqUl5"); NSLog(@"bVkXYcHJhsKpWS0xT4CLwvgZI6m2Raz7"); NSLog(@"YQyL45NfxCHwBaZkFvgV1E0himueM9p6K"); NSLog(@"eGyChb42vP7NEtdifJLuF"); NSLog(@"u5L3928vdQZM01TbaKOz7lGxgDYIWUi"); NSLog(@"kBqRTveU6GW02hPfQnCoauZNYp"); NSLog(@"RcAuqbd1KfpE9Fzkr4l3stom8jGNhH"); NSLog(@"srCqVFjIaoz34eG2TOw8LYgEUft"); NSLog(@"3nlsaA54XOgZCBwjtuxLKqH0"); NSLog(@"tINfzoACgx4"); } -(void)aAwTSEY:(UIControlEvents*) aAwTSEY a3xRVGoAj:(UIVisualEffectView*) a3xRVGoAj az1l4Qxe:(UIMenuItem*) az1l4Qxe acUYIGRi:(UISearchBar*) acUYIGRi aAwpu:(UIWindow*) aAwpu aWnwoPr6X:(UIView*) aWnwoPr6X azB4xRcFf8:(UIView*) azB4xRcFf8 aviY8kna:(UIViewController*) aviY8kna a4s3ijBd:(UIButton*) a4s3ijBd aWQleg0:(UIInputView*) aWQleg0 aZ1EFBeQ4:(UIEdgeInsets*) aZ1EFBeQ4 aoMtaw5:(UIApplication*) aoMtaw5 { NSLog(@"h9YxwIV8dgqPTkOymUCisFHWrotfLQS"); NSLog(@"RSvx8WbrdqMoYk7LIJ"); NSLog(@"YMjFqwB3p6CoNrRPxL7ygtzWu"); NSLog(@"iP23JfkXG8hmBZRYLa0H"); NSLog(@"HYzhG8SqCA5i60yBKxOkfnPRaN34eLZwcpJME"); NSLog(@"KA6BZRj4kdpXUEnrqTGO7z"); NSLog(@"HVRDZP1QBkqSgUJx6pznv9Ce"); NSLog(@"UTNZYphmewHDaA2xo1BcVM7OC6ElvfL"); NSLog(@"QYvB56aTU1DiJzV9KmZWr2xHOsGdbqlt"); NSLog(@"X12mHFRqauIDzylOLP"); NSLog(@"lw7bLxTKzdnE5MAQZi6"); NSLog(@"dvwPmShs9ZjcGlxX3Ye6btQa"); NSLog(@"C9N2B3VhsgSqeH"); NSLog(@"WAkdcz5hv1x0PiaSRXtmwbYQ"); NSLog(@"0usGz1OqANnBVLXKft3ZjWY"); NSLog(@"Rl31wvafMz5"); } -(void)afXAWD:(UIWindow*) afXAWD aY2a8Ls:(UIMotionEffect*) aY2a8Ls a5H2h:(UIInputView*) a5H2h aCDA79:(UIRegion*) aCDA79 a2prEwv9Z:(UITableView*) a2prEwv9Z a5M8We7N:(UISwitch*) a5M8We7N aexQVlnLv8t:(UIDevice*) aexQVlnLv8t awFgN:(UIDevice*) awFgN aBk1xg:(UIImageView*) aBk1xg a57xUQ:(UIUserInterfaceIdiom*) a57xUQ aV0ON:(UIBarButtonItem*) aV0ON a7nLd6sXK9:(UIEvent*) a7nLd6sXK9 amlGkwX4TgL:(UIControlEvents*) amlGkwX4TgL a5hkafg:(UIImage*) a5hkafg anI6UDxEp:(UIMenuItem*) anI6UDxEp { NSLog(@"v48DNAdtEVOliG5oxa62bpHkILZme30"); NSLog(@"Rua4q0Jxvp2IiAOldwVKEfeCPU"); NSLog(@"qIrFjTHZVYhXBMl2eON59Aim7PnsQ8CL4pxGK"); NSLog(@"IYERjsDWw2v4g6A"); NSLog(@"ZMC9atB7A3LcmkPpfVeFg01wndEW2D4Ki"); NSLog(@"tI6ywMJ0YTBc1D5avb3EL2"); NSLog(@"LRHZME1Wc4a"); NSLog(@"5aXRDsxE1YpFvCbeq"); NSLog(@"yXGOiRFYMbL3r6EDt9THmNQ1S"); NSLog(@"0PoUZq5MCNnVS6lOapdH"); NSLog(@"yK9HRZr4aePd6QBhsX2cDYUIkiA07vEp1qJSVT"); NSLog(@"kqiQOwICf4Y6EgR9NtMnv3TDrKSLpB"); NSLog(@"Nw9Uf43icLhMPjz5dvOerGRtxmnF7lH2QZC"); } -(void)aKQ0vG32qo8:(UIFont*) aKQ0vG32qo8 azhkd7CP:(UITableView*) azhkd7CP aCLMS:(UIInputView*) aCLMS a2Okx:(UIRegion*) a2Okx aEWokrbNyu:(UIBarButtonItem*) aEWokrbNyu ax2V46:(UIControl*) ax2V46 { NSLog(@"Op8QDZm2HLFtNIT5haWvMkx0"); NSLog(@"Dg8qLjHsdMOEiGQR6f"); NSLog(@"HRhp4N8QYoEPT0u7UVycIbdjqim9"); NSLog(@"HX3eabuZRJD"); NSLog(@"gfMi27relk6KBFh8jvXLsyU9V"); NSLog(@"CuHswcpUO7VFWzGM8Boiq"); NSLog(@"RlEXebtWsLCM6um70BAyU"); NSLog(@"q6DVlHbUz9jomA"); NSLog(@"jL5TI1bKid0efcNGlHonXOgr23v7"); NSLog(@"Ys9DcbQ3M0WwzjdBgnyoA"); NSLog(@"Dy8aAkJUsE6bIPref2OKSZY"); NSLog(@"lP80zRkw7vsAGL"); NSLog(@"G27SDzaNUhOrcwne3pHqLZl9K1ktsb0YXCgyo4"); NSLog(@"BmkTjCnsJpLVhq9rfINv5Ec8xy"); } @end