This commit is contained in:
lianxiang
2018-09-10 19:59:09 +08:00
parent 7685ce516e
commit 86f8824e14
21 changed files with 177 additions and 35 deletions
@@ -15,6 +15,7 @@
#import "MBProgressHUD.h"
#import "GiGaAttributedLabel.h"
#import "UINavigationBar+Custom.h"
#import "GiGaUserDefault.h"
@interface GiGaRegistViewController ()<TTTAttributedLabelDelegate>
@property (weak, nonatomic) IBOutlet UITextField *phoneNumberTextField;
@@ -212,7 +213,14 @@
-(void)regeist:(UIButton *)btn{
btn.userInteractionEnabled = NO;
NSDictionary *param = @{@"username":self.phoneNumberTextField.text,@"verifiedCode":self.codeTextField.text,@"password":self.passTexFied.text};
NSDictionary *weixinInfoDic = [GiGaUserDefault getWeiXinAccessToenDic];
NSDictionary *param = nil;
if (weixinInfoDic) {
param = @{@"username":self.phoneNumberTextField.text,@"verifiedCode":self.codeTextField.text,@"password":self.passTexFied.text,@"openid":weixinInfoDic[@"openid"]};
}else{
param = @{@"username":self.phoneNumberTextField.text,@"verifiedCode":self.codeTextField.text,@"password":self.passTexFied.text};
}
GiGaBaseAPiRequest *api = [GiGaBaseAPiRequest initWithRequestPath:@"sys/v1/phoneregister" method:RequestPostMethod parms:param];
[api requstDataWithResult:^(GiGaAPIResult *result) {
@@ -220,7 +228,9 @@
btn.userInteractionEnabled = YES;
GILog(@"注册->%@",result.message);
if (result.code == 0) {
NC_POST_NAME_OBJECT(kUserRegistSucccess,self.phoneNumberTextField.text);
NC_POST_NAME_OBJECT(kUserRegistSucccess,self.phoneNumberTextField.text);
GIGA_ShowToast(result.message);
[self.navigationController popToRootViewControllerAnimated:YES];
}else if (result.code == GiGAErrorCode_USER_EXIST){
GIGA_ShowToast(@"用户已存在");
@@ -230,7 +240,6 @@
GIGA_ShowToast(result.message);
}
}];
}
-(void)checkBtnAction:(UIButton *)btn{