Commit 356b5d11 by pierce

一些小东西

parent a002e5db
......@@ -450,7 +450,7 @@
[self fus_getVerifyCodeSucceed];
} failure:^(NSString *msg, int code) {
[_verifyCodeTimer invalidate];
[self.verifyCodeTimer invalidate];
self.verifyCodeTimer = nil;
[self setupGetVerifyCodeBtnEnable:YES];
......@@ -459,7 +459,7 @@
[FUSTalkingData fus_trackEvent:EVENT_REGIST_HAVEREGIST];
[FUSAlertView showAlertWithTitle:[NSString fus_localString:@"注册"] message:msg cancelButtonTitle:nil otherButtonTitles:@[[NSString fus_localString:@"去登录"]] clickBlock:^(NSInteger buttonIndex) {
NSString *phone = [_phoneTextField.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
NSString *phone = [self.phoneTextField.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
if ([NSString isNull:phone]) {
phone = nil;
}
......@@ -650,7 +650,7 @@
self.phoneTextField.text = nil;
self.passwordTextField.text = nil;
[_verifyCodeTimer invalidate];
[self.verifyCodeTimer invalidate];
self.verifyCodeTimer = nil;
[self setupGetVerifyCodeBtnEnable:YES];
......@@ -736,11 +736,11 @@
// 未同意使用协议
if (!_agreeBtn.selected) {
__weak typeof(self) weakSelf = self;
[FUSAlertView showAlertWithTitle:[NSString fus_localString:@"请先同意使用协议"] message:nil cancelButtonTitle:[NSString fus_localString:@"确定"] otherButtonTitles:@[[NSString fus_localString:@"取消"]] clickBlock:^(NSInteger buttonIndex) {
if (buttonIndex == 0) {
_agreeBtn.selected = YES;
weakSelf.agreeBtn.selected = YES;
// [_nextButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
}
}];
......@@ -769,12 +769,13 @@
sender.userInteractionEnabled = YES;
[FUSLoadingView fus_dismissProgressViewWithView:self.view];
if (code == -103) {
__weak typeof(self) weakSelf = self;
[FUSAlertView showAlertWithTitle:nil message:msg cancelButtonTitle:nil otherButtonTitles:@[[NSString fus_localString:@"换号注册"], [NSString fus_localString:@"登录"]] clickBlock:^(NSInteger buttonIndex) {
if (buttonIndex == 0) {
// 清空输入框文字
_phoneTextField.text = @"";
weakSelf.phoneTextField.text = @"";
// 让文本框获取焦点,弹出键盘
[_phoneTextField becomeFirstResponder];
[weakSelf.phoneTextField becomeFirstResponder];
}else{
// 点击去登录
FUSLoginViewController *loginViewCtrl = [[FUSLoginViewController alloc]init];
......@@ -939,18 +940,19 @@
CGFloat inviteCodeBgviewMaxY = CGRectGetMaxY(_inviteCodeBgView.frame);
CGFloat upConstant = height - (UIView.fus_screenH - inviteCodeBgviewMaxY);
__weak typeof(self) weakSelf = self;
[UIView animateWithDuration:0.2 animations:^{
_headeConstraint.constant = upConstant > 0?31-upConstant:31;
[_areaBgView.superview layoutIfNeeded];
weakSelf.headeConstraint.constant = upConstant > 0?31-upConstant:31;
[weakSelf.areaBgView.superview layoutIfNeeded];
}];
}
//当键退出时调用
- (void)keyboardWillHide:(NSNotification *)aNotification{
__weak typeof(self) weakSelf = self;
[UIView animateWithDuration:0.2 animations:^{
_headeConstraint.constant = 31;
[_areaBgView.superview layoutIfNeeded];
weakSelf.headeConstraint.constant = 31;
[weakSelf.areaBgView.superview layoutIfNeeded];
}];
}
......@@ -1092,18 +1094,19 @@
获取经纪人名字
*/
- (void)fus_getAgentName{
__weak typeof(self) weakSelf = self;
[FUSLoginHttpHelper fus_getAgentNameWithID:_inviteCodeTextField.text success:^(NSString *name) {
_invitePeopleNameLabel.text = [NSString stringWithFormat:@"%@:%@",[NSString fus_localString:@"邀请人昵称"],name];
weakSelf.invitePeopleNameLabel.text = [NSString stringWithFormat:@"%@:%@",[NSString fus_localString:@"邀请人昵称"],name];
// _agentResultSuccess = YES;
_agentName = name;
weakSelf.agentName = name;
} failure:^(NSString *msg, int code) {
//没有找到用户
if (code == -11) {
_invitePeopleNameLabel.text = [NSString fus_localString:@"未查询到邀请人"];
weakSelf.invitePeopleNameLabel.text = [NSString fus_localString:@"未查询到邀请人"];
}
_inviteCodeTextField.enabled = YES;
// _agentResultSuccess = NO;
weakSelf.inviteCodeTextField.enabled = YES;
// weakSelf.agentResultSuccess = NO;
}];
}
......@@ -1132,18 +1135,19 @@
_registerBtnTopConstraint.constant = -_inviteCodeBgView.height + 18;
_invitePeopleNameLabel.hidden = YES;
}else { // 没有邀请码
__weak typeof(self) weakSelf = self;
// 判断设备有没有被注册
[FUSLoginHttpHelper fus_checkDeviceRegistedStatusSuccess:^{ // 无邀请码
// 没有注册显示
_inviteCodeBgView.hidden = NO;
_registerBtnTopConstraint.constant = 28;
_invitePeopleNameLabel.hidden = NO;
_bindType = @"0";
weakSelf.inviteCodeBgView.hidden = NO;
weakSelf.registerBtnTopConstraint.constant = 28;
weakSelf.invitePeopleNameLabel.hidden = NO;
weakSelf.bindType = @"0";
} failure:^(NSString *msg, int code) {
// 注册过了不显示
_inviteCodeBgView.hidden = YES;
_registerBtnTopConstraint.constant = -_inviteCodeBgView.height + 18;
_invitePeopleNameLabel.hidden = YES;
weakSelf.inviteCodeBgView.hidden = YES;
weakSelf.registerBtnTopConstraint.constant = -weakSelf.inviteCodeBgView.height + 18;
weakSelf.invitePeopleNameLabel.hidden = YES;
}];
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment