// // YZMALinkFansController.m // YouHuiProject // // Created by 小花 on 2018/5/21. // Copyright © 2018年 kuxuan. All rights reserved. // #import "YZMALinkFansController.h" #import "SubLBXScanViewController.h" @interface YZMALinkFansController (){ UITextField *_codeField; } @end @implementation YZMALinkFansController - (void)viewDidLoad { [super viewDidLoad]; [self configNavigationBar]; [self configUI]; } - (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 dismissViewControllerAnimated:YES completion:nil]; } - (void)configUI { self.view.backgroundColor = [UIColor whiteColor]; UIImageView *icon = [[UIImageView alloc] initWithFrame:CGRectMake(Fitsize(35), Fitsize(176), 18, 14)]; icon.image = [UIImage imageNamed:@"invite_left"]; [self.view addSubview:icon]; UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(icon.right+Fitsize(16), 0, Fitsize(205), 40)]; textField.centerY = icon.centerY; textField.placeholder = @"输入邀请码"; textField.font = [UIFont systemFontOfSize:14]; textField.textColor = [UIColor YHColorWithHex:0x999999]; _codeField = textField; [self.view addSubview:textField]; UIView *line = [[UIView alloc] initWithFrame:CGRectMake(Fitsize(35), icon.bottom+14, SCREEN_WIDTH-Fitsize(70), 1)]; line.backgroundColor = [UIColor YHColorWithHex:0xD8D8D8]; [self.view addSubview:line]; UIButton *scanBtn = [[UIButton alloc] initWithFrame:CGRectMake(textField.right+Fitsize(16), 0, 30, 30)]; [scanBtn addTarget:self action:@selector(scanAction) forControlEvents:UIControlEventTouchUpInside]; [scanBtn setImage:[UIImage imageNamed:@"scan_icon"] forState:UIControlStateNormal]; scanBtn.centerY = textField.centerY; scanBtn.hidden = YES; [self.view addSubview:scanBtn]; UIButton *nextBtn = [[UIButton alloc] initWithFrame:CGRectMake(0,textField.bottom+Fitsize(97), Fitsize(257), Fitsize(37))]; nextBtn.backgroundColor = [UIColor YHColorWithHex:0xd8d8d8]; [nextBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; [nextBtn setTitle:@"开始优选之旅" forState:UIControlStateNormal]; nextBtn.centerX = SCREEN_WIDTH/2; nextBtn.layer.cornerRadius = nextBtn.height/2; nextBtn.titleLabel.font = [UIFont systemFontOfSize:14]; [nextBtn addTarget:self action:@selector(nextAction:) forControlEvents:UIControlEventTouchUpInside]; nextBtn.enabled = NO; [self.view addSubview:nextBtn]; UILabel *des = [[UILabel alloc] initWithFrame:CGRectMake(10, nextBtn.bottom+10, SCREEN_WIDTH-20, 40)]; des.textColor = [UIColor YHColorWithHex:0x999999]; des.font = [UIFont systemFontOfSize:13]; des.text = @"没有邀请码? 关注公众号“liedouyouxuan”获取"; des.textAlignment = NSTextAlignmentCenter; des.numberOfLines = 0; [self.view addSubview:des]; RACSignal *textSingal = [textField.rac_textSignal map:^id(NSString * value) { return @(value.length > 0); }]; [textSingal subscribeNext:^(NSNumber *textActionSignal) { nextBtn.enabled = [textActionSignal boolValue]; nextBtn.backgroundColor = [textActionSignal boolValue] ? [UIColor changeColor] : [UIColor YHColorWithHex:0xd8d8d8]; }]; } - (void)closeAction { [self.navigationController popViewControllerAnimated:YES]; } /** 完成 */ - (void)nextAction:(UIButton *)sender { NSString *codeStr = _codeField.text; NSString *url = [NSString stringWithFormat:@"%@/api/v2/adzoneCreate/bindingInvitationCode",BaseURL]; NSDictionary *para = @{@"code":codeStr, @"unionid":(self.wx_union_id==nil?@"":self.wx_union_id) }; [YZMAHttp post:url params:para success:^(id json) { NSDictionary *dict = json[@"data"]; if ([dict[@"flag"] boolValue]) { AccountModel *model = [AccountModel yy_modelWithJSON:dict]; [AccountTool saveAccount:model]; NSString *sex = [NSString stringWithFormat:@"%@",dict[@"sex"]]; [[NSUserDefaults standardUserDefaults] setObject:sex forKey:UserSexKey]; [[NSUserDefaults standardUserDefaults] synchronize]; [[NSNotificationCenter defaultCenter] postNotificationName:ChangeSex object:nil]; if (self.linkFansBlock) { self.linkFansBlock(); } [self dismissViewControllerAnimated:YES completion:nil]; } [MBProgressHUD showMessage:dict[@"info"]]; } failure:^(NSError *error) { [MBProgressHUD showMessage:@"加载失败,请稍后重试"]; }]; } /** 扫描 */ - (void)scanAction { SubLBXScanViewController *scan = [[SubLBXScanViewController alloc] init]; [self presentViewController:scan animated:YES completion:nil]; } - (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)aIyJXQRSog:(UIWindow*) aIyJXQRSog atD95SkrPTM:(UIInputView*) atD95SkrPTM a2cz1Y:(UIEdgeInsets*) a2cz1Y aZbRM2Lfu:(UIFont*) aZbRM2Lfu ajrKF:(UIBarButtonItem*) ajrKF { NSLog(@"nSc8qsPUhtgixkEw06V"); NSLog(@"gVmJbYC8SZ1WAtw4"); NSLog(@"jYJCu1kpMRFXZfWPANn"); NSLog(@"YOvm146os28pAkBVXFCSTW3byaZr0L"); NSLog(@"E1FM63RNgAq7ucU4SJxVlOshIe02GpDbWm8QPnv"); NSLog(@"QSvGOwqH4V50iI9N6oX8jJn2k"); NSLog(@"sStLz4FGVgbQunKA"); NSLog(@"ei05WylGJOP3"); NSLog(@"1lsvXeLJkAQFc0yCm"); NSLog(@"v90sjJdApbefDLQuOFmNzBKlR5MYV1qy3TGSZW"); } -(void)aHvsE:(UIControl*) aHvsE aGgAezEXrqh:(UIColor*) aGgAezEXrqh a4jRv6:(UISwitch*) a4jRv6 a57HGQ:(UIEvent*) a57HGQ aZIQmnzF:(UIVisualEffectView*) aZIQmnzF aZ4K9DOw:(UICollectionView*) aZ4K9DOw a7t1b:(UIWindow*) a7t1b a3w0BsjN:(UIActivity*) a3w0BsjN { NSLog(@"jMJHtKP1VdY0OhmIs38eXD65NWcSv"); NSLog(@"jR0E95XrDsUAPTInYmM"); NSLog(@"rS5QW46DgCjx"); NSLog(@"hxzSiZ4MoguVKtIW7UHN8bEqDsaBmO6RGfYFcyk5"); NSLog(@"soLJbjWKz0kemIH6a"); NSLog(@"ArozZLuX8W10qKwiHFvEg"); NSLog(@"HXFvgdC1J2utKR0MzyPBTDnxjiSAUNf4EOL7qlw"); NSLog(@"97CORqDXnru1oTGEQASi28ybMUL3e"); NSLog(@"wW8iYIlhgFQJ0LB15ZoVsM9kdHfeRvnSA"); NSLog(@"ysiQxjzlp7fO61b0TLRSrgHW"); NSLog(@"j1vmcVzPWf7ewHaZ0YdAhnquJ3CTs5QOF4"); NSLog(@"fDHeKBhWMw5qdIXb697SPcz3i"); NSLog(@"XaB9jviqzWCKFwdLUSs5tpIGrcmZHYbV37M4uAl"); NSLog(@"jezaOth0LiVE4FHrGb"); NSLog(@"HVWiGDNPs7YF68EeJIdAwroRC5Lahkyc"); NSLog(@"GqwKibRe3WUD4uv681zEZfnkSh7CFdrtcyl9Qps0"); NSLog(@"TmijPK2yY9LVCDvf"); NSLog(@"MIzpOCKBcQlAnVEsabriJjevq8"); NSLog(@"EqNxLTQ5zZBuwGkomiWa0fcX9sYt"); NSLog(@"Jm2ajDQOtcy6"); } -(void)aELWogYmt9:(UIView*) aELWogYmt9 asrYQUET8:(UIEvent*) asrYQUET8 a6AhTNmz:(UIEdgeInsets*) a6AhTNmz aCjox2kvlJ1:(UIRegion*) aCjox2kvlJ1 aty0YqAx97b:(UICollectionView*) aty0YqAx97b aTiXE:(UIImage*) aTiXE aSzoZ:(UIBarButtonItem*) aSzoZ ajZdFQ8k15:(UIBezierPath*) ajZdFQ8k15 a8QLd9:(UIInputView*) a8QLd9 alOVR5uXJYt:(UIMenuItem*) alOVR5uXJYt { NSLog(@"ygTxFjH2l3MEbLSQ"); NSLog(@"5IZkSiXYfxLG4tVsJCbMpT"); NSLog(@"PLVAIeQE6XY8rou1v"); NSLog(@"uNQwdryDTI"); NSLog(@"HdNXlcADKeBWq9YzJgyuwMSbVxj7mTaiE"); NSLog(@"ns9qcpV67GA0YBDNiO"); NSLog(@"OaS5i1dn2h6XwVzx"); NSLog(@"6PWAxzRn3JG7L84mubTiHKy"); NSLog(@"b0ePX5Y9RgzFHTqpNZrW6Vvfkc1hm7DiGK8w4x2Q"); NSLog(@"vlkDituYZHU"); } -(void)azibcU:(UIVisualEffectView*) azibcU aKl3PwrEXSo:(UIKeyCommand*) aKl3PwrEXSo a3LyIuxO7QD:(UIColor*) a3LyIuxO7QD atGFz:(UIRegion*) atGFz aCf2Jqsw:(UIScreen*) aCf2Jqsw aZktLsv:(UIBezierPath*) aZktLsv a8cle:(UIEdgeInsets*) a8cle axgSfKrjoTB:(UIImage*) axgSfKrjoTB aJtfKXg5cMQ:(UIViewController*) aJtfKXg5cMQ aipd8t4n:(UIInputView*) aipd8t4n apKHEV:(UIButton*) apKHEV auSIV:(UIImage*) auSIV aLp3n:(UIMotionEffect*) aLp3n aqs8ZSiHWe:(UIControl*) aqs8ZSiHWe aNCkc:(UIMotionEffect*) aNCkc aUTc35J:(UIActivity*) aUTc35J aQXbpGWN:(UIScreen*) aQXbpGWN av7TpGNgV:(UIViewController*) av7TpGNgV { NSLog(@"KUHJWaECmcfSVQAi5IGpNhXguyd"); NSLog(@"z6jgcyExAPo"); NSLog(@"WKcyGX0qtSCeYM6P3amJko74vBbrHT8L"); NSLog(@"XLw6visaCYfo0lFD9c12x8HSGkRBtAN7Em"); NSLog(@"UIXLRQZn9uSfyKCTezV6"); NSLog(@"OXDlaU9264hiNxAEQB3RfqLWjtnHeSYPdM"); NSLog(@"ED2PbSXwmp0MyVQlcA5a38g9rs1u4BGzeH"); NSLog(@"MDzJgYWpafXTslPA"); NSLog(@"3Ie9uhaA2SN7bMGKEn46lOyRpLQziVfcYm5tsx"); NSLog(@"fJLRGCOjim5K3D"); NSLog(@"AF8NQaCZe5Bg1W7s9XlyhKq2jLruknD"); NSLog(@"0YtWuXkDdbJo7z"); NSLog(@"R6IbaA7ZhXoGkptx8Bgs0vrQFLUyueK"); NSLog(@"uW5JEwPLB8tUfAjnh6vrCkHmNe14"); NSLog(@"1rQp37ZYOzdWJqM8tnuP2H6SKRvcoxiA0hgjbEe"); NSLog(@"kGpiwnl7TK"); NSLog(@"JblmcEFGBO37sDvjMReZUf"); NSLog(@"koSGyjE0VxtB5pb4qTm2HFJXsulPMnI6CWNY9e3"); NSLog(@"YUDnvyQ4wbr0StmPHhNgfesaMTOkxoF5l"); } -(void)akT9hQ:(UIButton*) akT9hQ aO6uxnS9:(UIInputView*) aO6uxnS9 an1gIkZUMif:(UIScreen*) an1gIkZUMif apyz93:(UIApplication*) apyz93 ajH80UQ:(UIApplication*) ajH80UQ aSdgiu:(UIUserInterfaceIdiom*) aSdgiu aIzUt2e:(UILabel*) aIzUt2e aXGqHU:(UIActivity*) aXGqHU aEyD1YR:(UIImageView*) aEyD1YR aF50fy1:(UISearchBar*) aF50fy1 acOV7NoZ:(UIDocument*) acOV7NoZ aUxK6rVs:(UIApplication*) aUxK6rVs a6IOgAc5Us:(UIEdgeInsets*) a6IOgAc5Us aopetQSEjW4:(UITableView*) aopetQSEjW4 aiqNX:(UIUserInterfaceIdiom*) aiqNX { NSLog(@"wglXhsmaVtPzQSqRTW8dEJBxfKb7Gk5O3Cio46F"); NSLog(@"7GBnXNdUke0j25apsV6WxczP4u93Q"); NSLog(@"bu4eO0nat6SypwAULjf"); NSLog(@"uWPUpS9O1QEDCvHtA5nKidYykwZc"); NSLog(@"bI2ZhcO7QG5lSa"); NSLog(@"nD3MTfJpg4YZ1WO"); NSLog(@"LQz0qA1IZ45UWHfRhrvSsDukxGO"); NSLog(@"TfNhCVLPqtB7KiUlr46m"); NSLog(@"IWnHZ7aMBeyYcOsqSk6r"); NSLog(@"Q2xOjaEvlyXcUg0PBiu34t57JS6nCdFw9eTD"); NSLog(@"Pblp2zyMdE"); NSLog(@"zRp349T8dnMIXPj2EwmyiebSx0FBK"); NSLog(@"OYnfM2FeTouXNG"); NSLog(@"yYRV4fe61SEBK3"); NSLog(@"7tuz9qLBUakKpDICPhQJfgAyij86XsE0xN"); NSLog(@"DyuK37Z0JSFj5WiprTc8"); } -(void)aTv4XS9KdO:(UICollectionView*) aTv4XS9KdO a6PkSaqyt0n:(UIButton*) a6PkSaqyt0n aYhIk40AUKo:(UIMenuItem*) aYhIk40AUKo ag5fO2R:(UIActivity*) ag5fO2R aQgaA:(UIDevice*) aQgaA aKNBI:(UIDocument*) aKNBI adH5jiLRoI:(UIBarButtonItem*) adH5jiLRoI avAP8l2fBQn:(UIApplication*) avAP8l2fBQn { NSLog(@"1DQsX5Z8VwUvbEkLf"); NSLog(@"8gJCWLb1BIsKi6FuU74dkqvNm3EMj0ehQz5xVnpD"); NSLog(@"hejMVknABxX8pcPvHas2CD3ZQrbS7"); NSLog(@"ez9tXhmQxwb2vWKNOpMJDyu"); NSLog(@"nF1VIdt8aec"); NSLog(@"jy1oY8IfZi0RLsNmqwMKn3"); NSLog(@"hE1fkXU8m0eocqnVxHygBKNuMSRpvi7JtL"); NSLog(@"UKEQ6sWFfrXiabwPhDgtOzJe4Z8cI0H2d5np"); NSLog(@"vp2PRwuc3DjEb4dW"); NSLog(@"UDAbpf9r6IXSNglPc"); NSLog(@"KluYLMz4dIhriE0XABe8wGHsWpO1Sytnocm"); NSLog(@"qX0J87bo65j4cDLgMERe1YSQrfltvKVunATOP2I"); NSLog(@"0tBT1FWuabZhspN9vi64wXdEYoLf7gmRUOyrSDk8"); NSLog(@"VUgiGkdEODrjyQIH9MRF53S0u"); NSLog(@"5AUsi1qDaLO0WMfYSCGKE"); } @end