// // JXXIuGaiJiXinHaoVc.m // shiku_im // // Created by 123 on 2020/5/26. // Copyright © 2020 Reese. All rights reserved. // #import "JXXIuGaiJiXinHaoVc.h" @interface JXXIuGaiJiXinHaoVc () @property (nonatomic,weak) UIImageView *iconIMG; @property (nonatomic,weak) UITextField *textTF; @end @implementation JXXIuGaiJiXinHaoVc - (void)viewDidLoad { [super viewDidLoad]; [self defineNavBar:@"修改即信号" andRinghtBtnImg:@""]; UIImageView *iconIMG=[[UIImageView alloc]init]; iconIMG.image=[UIImage imageNamed:@"组1"]; iconIMG.layer.cornerRadius=35; iconIMG.layer.masksToBounds=YES; [self.view addSubview:iconIMG]; self.iconIMG=iconIMG; [iconIMG mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(15); make.top.mas_equalTo(JX_SCREEN_TOP+10); make.width.mas_equalTo(70); make.height.mas_equalTo(70); }]; UILabel *titleB=[[UILabel alloc]init]; titleB.text=g_server.myself.userNickname; [self.view addSubview:titleB]; [titleB mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(iconIMG.mas_right).mas_offset(10); make.top.mas_equalTo(iconIMG.mas_top).mas_offset(15); }]; UILabel *subTitle=[[UILabel alloc]init]; NSString *messs=[[NSUserDefaults standardUserDefaults] objectForKey:@"membershipAccount_ID"]; subTitle.text=[NSString stringWithFormat:@"即信号:%@",messs]; [self.view addSubview:subTitle]; [subTitle mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(iconIMG.mas_right).mas_offset(10); make.top.mas_equalTo(titleB.mas_bottom).mas_offset(10); }]; UITextField *textTF=[[UITextField alloc]init]; textTF.text=messs; [self.view addSubview:textTF]; self.textTF=textTF; [textTF mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(20); make.right.mas_equalTo(-20); make.top.mas_equalTo(iconIMG.mas_bottom).mas_offset(20); make.height.mas_equalTo(44); }]; UIView *lineView=[[UIView alloc]init]; lineView.backgroundColor=kRGBColor(222, 29, 19); [self.view addSubview:lineView]; [lineView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(20); make.right.mas_equalTo(-20); make.top.mas_equalTo(textTF.mas_bottom).mas_offset(1); make.height.mas_equalTo(1); }]; UILabel *BtTitle=[[UILabel alloc]init]; BtTitle.text=@"请将您的ID号修改和您的吉利彩票会员账号一致,注意只能修改一次。 如果仍不小心填错请联系在线客服及时修改,已确保数据同步。"; BtTitle.numberOfLines=0; BtTitle.textColor=[UIColor grayColor]; [self.view addSubview:BtTitle]; [BtTitle mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(20); make.right.mas_equalTo(-20); make.top.mas_equalTo(lineView.mas_bottom).mas_offset(15); }]; [g_server delHeadImage:g_server.myself.userId]; [g_server getHeadImageSmall:g_server.myself.userId userName:g_server.myself.userNickname imageView:iconIMG]; UIButton *qrBtn=[[UIButton alloc]init]; [qrBtn setTitle:@"确认" forState:UIControlStateNormal]; qrBtn.layer.cornerRadius=5; qrBtn.layer.masksToBounds=YES; qrBtn.backgroundColor=kRGBColor(219, 45, 45); [self.view addSubview:qrBtn]; [qrBtn mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(30); make.right.mas_equalTo(-30); make.height.mas_equalTo(44); make.top.mas_equalTo(BtTitle.mas_bottom).mas_offset(20); }]; [qrBtn addTarget:self action:@selector(qrBtnClick) forControlEvents:UIControlEventTouchUpInside]; } /** 确认*/ -(void)qrBtnClick{ long time = (long)[[NSDate date] timeIntervalSince1970]; time = (time *1000 + g_server.timeDifference); NSString *salt = [NSString stringWithFormat:@"%ld", time]; [SVProgressHUD show]; [g_server updateShikuNum:g_server.myself salt:salt membershipAccount:_textTF.text toView:self]; } -(void) didServerResultSucces:(JXConnection*)aDownload dict:(NSDictionary*)dict array:(NSArray*)array1{ [SVProgressHUD dismiss]; //NSLog(@"dict: %@ --- arry: %@",dict ,array1 ); if([aDownload.action isEqualToString:act_UserUpdate]) { if ([dict[@""] isEqualToString:@"您已修改过即信号"]) { } [SVProgressHUD showWithStatus:dict[@"resultMsg"]]; [SVProgressHUD dismissWithDelay:1.0]; [g_navigation dismissViewController:self animated:YES]; } } -(int) didServerResultFailed:(JXConnection*)aDownload dict:(NSDictionary*)dict{ NSString * errorCode = [NSString stringWithFormat:@"%@",[dict objectForKey:@"resultMsg"]]; if([errorCode isEqualToString:@"权限验证失败"]) { if ([aDownload.action isEqualToString:act_UserUpdate]) { }else{ } } [SVProgressHUD showWithStatus:errorCode]; [SVProgressHUD dismissWithDelay:1.0]; return [errorCode intValue]; } @end