Skip to content

Commit 0e1271f

Browse files
committed
(手机 & 邮箱)绑定页面,如果什么都没绑定过,那么不需要输入密码项
1 parent 6e02164 commit 0e1271f

File tree

5 files changed

+14
-3
lines changed

5 files changed

+14
-3
lines changed

Coding_iOS/Controllers/MeSetting/SettingEmailViewController.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ - (UIView *)customFooterView{
7474
RACObserve(self, j_captcha),
7575
RACObserve(self, two_factor_code)]
7676
reduce:^id(NSString *email, NSString *j_captcha, NSString *two_factor_code){
77-
return @(email.length > 0 && j_captcha.length > 0 && two_factor_code.length > 0);
77+
return @(email.length > 0 && j_captcha.length > 0 && (two_factor_code.length > 0 || [Login curLoginUser].hasNoEamilAndPhone));
7878
}];
7979

8080
[footerV addSubview:_footerBtn];
@@ -114,6 +114,9 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
114114
}
115115

116116
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
117+
if (indexPath.row == 1 && [Login curLoginUser].hasNoEamilAndPhone) {
118+
return 0;
119+
}
117120
return 50;
118121
}
119122

Coding_iOS/Controllers/MeSetting/SettingPhoneViewController.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
107107
}
108108

109109
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
110+
if (indexPath.row == 2 && [Login curLoginUser].hasNoEamilAndPhone) {
111+
return 0;
112+
}
110113
return 50;
111114
}
112115

@@ -204,7 +207,7 @@ - (void)doneBtnClicked:(id)sender{
204207
tipStr = @"手机号码格式有误";
205208
}else if (_code.length <= 0){
206209
tipStr = @"请填写手机验证码";
207-
}else if (_verifyStr.length <= 0){
210+
}else if (_verifyStr.length <= 0 && ![Login curLoginUser].hasNoEamilAndPhone){
208211
tipStr = _verifyType == VerifyTypePassword? @"请填写密码": @"请填写两步验证码";
209212
}
210213
if (tipStr.length > 0) {

Coding_iOS/Models/User.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
@property (strong, nonatomic, readonly) NSString *skills_str, *degree_str, *vipName;
2828

29-
@property (assign, nonatomic, readonly) BOOL isUserInfoCompleted, canUpgradeByCompleteUserInfo, willExpired;
29+
@property (assign, nonatomic, readonly) BOOL isUserInfoCompleted, canUpgradeByCompleteUserInfo, willExpired, hasNoEamilAndPhone;
3030

3131
+ (User *)userWithGlobalKey:(NSString *)global_key;
3232

Coding_iOS/Models/User.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,10 @@ - (BOOL)willExpired{
236236
return (self.vip.integerValue >= 3 && (timeInterval < 3 * 24 * 60 * 60));
237237
}
238238

239+
- (BOOL)hasNoEamilAndPhone{
240+
return YES;
241+
return self.email.length <= 0 && self.phone.length <= 0;
242+
}
239243

240244
- (NSString *)changePasswordTips{
241245
NSString *tipStr = nil;

Coding_iOS/Views/Cell/Input_OnlyText_Cell.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
3636
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
3737
if (self) {
3838
// Initialization code
39+
self.clipsToBounds = YES;
3940
self.selectionStyle = UITableViewCellSelectionStyleNone;
4041
if (!_textField) {
4142
_textField = [UITextField new];

0 commit comments

Comments
 (0)