Procházet zdrojové kódy

1.修改和设置的第二个界面首位都不能输入0

huangxiaodong před 1 rokem
rodič
revize
a802ed6576

+ 6 - 1
创维盒子/双子星云手机/Class/Guide/SetPWDSecondViewController.m

@@ -19,6 +19,7 @@
     UILabel *pointView3;
     
     UILabel *topLabel;
+    UIButton *keyBoardBtn0;
 }
 
 @end
@@ -185,12 +186,14 @@
     }];
     
     /*0*/
-    UIButton *keyBoardBtn0 = [[UIButton alloc] init];
+    keyBoardBtn0 = [[UIButton alloc] init];
     [keyBoardBtn0 setBackgroundColor:[UIColor clearColor]];
     [keyBoardBtn0 setTitleColor:HW0A132BColor forState:(UIControlStateNormal)];
+    [keyBoardBtn0 setTitleColor:COLOR_PACEHOLDER forState:(UIControlStateDisabled)];
     [keyBoardBtn0.titleLabel setFont:[UIFont boldSystemFontOfSize:40.f]];
     [keyBoardBtn0 setTitle:@"0" forState:(UIControlStateNormal)];
     [keyBoardBtn0 addTarget:self action:@selector(keyBoardBtnPressed:) forControlEvents:(UIControlEventTouchUpInside)];
+    keyBoardBtn0.enabled = NO;
     [bgViewForNumberBoard addSubview:keyBoardBtn0];
     [keyBoardBtn0 mas_makeConstraints:^(MASConstraintMaker *make) {
         make.left.mas_equalTo(w_key_btn);
@@ -221,6 +224,7 @@
         if (numberLength == 1){
             [pointView0 setText:@""];
             [pointView0 setBackgroundColor:HWE3E8F1Color];
+            self->keyBoardBtn0.enabled = NO;
         }else if (numberLength == 2){
             [pointView1 setText:@""];
             [pointView1 setBackgroundColor:HWE3E8F1Color];
@@ -280,6 +284,7 @@
             [pointView0 setText:selectNumberStr];
             dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
                 [self->pointView0 setBackgroundColor:HW0A132BColor];
+                self->keyBoardBtn0.enabled = YES;
             });
         }else if (numberLength == 1){
             [pointView1 setText:selectNumberStr];

+ 1 - 0
创维盒子/双子星云手机/Class/Set/ModifyPWD/ModifyPWDFirstViewController.m

@@ -219,6 +219,7 @@
         if (numberLength == 1){
             [pointView0 setText:@""];
             [pointView0 setBackgroundColor:HWE3E8F1Color];
+            self->keyBoardBtn0.enabled = NO;
         }else if (numberLength == 2){
             [pointView1 setText:@""];
             [pointView1 setBackgroundColor:HWE3E8F1Color];

+ 6 - 1
创维盒子/双子星云手机/Class/Set/ModifyPWD/ModifyPWDSecondViewController.m

@@ -18,6 +18,7 @@
     UILabel *pointView3;
     
     UILabel *topLabel;
+    UIButton *keyBoardBtn0;
 }
 
 @end
@@ -200,12 +201,14 @@
     }];
     
     /*0*/
-    UIButton *keyBoardBtn0 = [[UIButton alloc] init];
+    keyBoardBtn0 = [[UIButton alloc] init];
     [keyBoardBtn0 setBackgroundColor:[UIColor clearColor]];
     [keyBoardBtn0 setTitleColor:HW0A132BColor forState:(UIControlStateNormal)];
+    [keyBoardBtn0 setTitleColor:COLOR_PACEHOLDER forState:(UIControlStateDisabled)];
     [keyBoardBtn0.titleLabel setFont:[UIFont boldSystemFontOfSize:40.f]];
     [keyBoardBtn0 setTitle:@"0" forState:(UIControlStateNormal)];
     [keyBoardBtn0 addTarget:self action:@selector(keyBoardBtnPressed:) forControlEvents:(UIControlEventTouchUpInside)];
+    keyBoardBtn0.enabled = NO;
     [bgViewForNumberBoard addSubview:keyBoardBtn0];
     [keyBoardBtn0 mas_makeConstraints:^(MASConstraintMaker *make) {
         make.left.mas_equalTo(w_key_btn);
@@ -236,6 +239,7 @@
         if (numberLength == 1){
             [pointView0 setText:@""];
             [pointView0 setBackgroundColor:HWE3E8F1Color];
+            self->keyBoardBtn0.enabled = NO;
         }else if (numberLength == 2){
             [pointView1 setText:@""];
             [pointView1 setBackgroundColor:HWE3E8F1Color];
@@ -309,6 +313,7 @@
             [pointView0 setText:selectNumberStr];
             dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
                 [self->pointView0 setBackgroundColor:HW0A132BColor];
+                self->keyBoardBtn0.enabled = YES;
             });
         }else if (numberLength == 1){
             [pointView1 setText:selectNumberStr];