소스 검색

修改部分bug

刘云鸽 7 년 전
부모
커밋
a1f8624636

+ 1 - 1
Haishenghai-master.xcodeproj/project.pbxproj

@@ -845,6 +845,7 @@
 		C615004C21D7083F00FEBA22 /* Haishenghai-master */ = {
 			isa = PBXGroup;
 			children = (
+				C618482F224B684D006A586B /* fireAlarm.mp3 */,
 				C60E3F76225B1CBE003C1541 /* MBProgressHUD.h */,
 				C60E3F77225B1CCA003C1541 /* MBProgressHUD.m */,
 				C68433132240EBF9001D789D /* Haishenghai-master.entitlements */,
@@ -1045,7 +1046,6 @@
 		C659D93921EC1F2200B147EE /* hsh-Image */ = {
 			isa = PBXGroup;
 			children = (
-				C618482F224B684D006A586B /* fireAlarm.mp3 */,
 				C6FD309F21EC37C100E57DBE /* person_image */,
 				C6FD308621EC375B00E57DBE /* message_image */,
 				C6FD302821EC2C4C00E57DBE /* home_images */,

+ 16 - 30
Haishenghai-master/ViewControllers/Login/ResetPassword_VC.m

@@ -34,18 +34,7 @@
     /** 设置背景 */
     self.view.backgroundColor = [UIColor whiteColor];
     
-    /** 设置返回 */
-//    self.backBtn.frame = CGRectMake(10, 20, 30, 30);
-//    [self.backBtn setBackgroundImage:[UIImage imageNamed:@"hsh_register_return"] forState:UIControlStateNormal];
-//    [self.backBtn addTarget:self action:@selector(backBtnClick) forControlEvents:UIControlEventTouchUpInside];
-//    [self.view addSubview:self.backBtn];
-    /**返回label */
-//    self.backLabel.frame = CGRectMake(40, 20, 60, 30);
-//    self.backLabel.text = @"返回";
-////    self.backLabel.textAlignment = NSTextAlignmentCenter;
-//    self.backLabel.font = [UIFont systemFontOfSize:18];
-//    [self.view addSubview:self.backLabel];
-    
+
     /** 设置logo */
     [self.logoImageView setImage:[UIImage imageNamed:@"logo"]];
     self.logoImageView.frame = CGRectMake(WIDTH/2-55, HEIGHT/4-75, 110, 110);
@@ -191,9 +180,10 @@
 }
 
 -(void)getSMSCodeBtnClick:(UIButton *)codeBtn{
-//    if (self.accountTF.text==nil||self.accountTF.text.length<11||self.accountTF.text.length>11) {
-//        ALERTSHOW(@"手机号有误,请重新输入");
-//    }
+    if (self.accountTF.text.length ==0||self.accountTF.text.length<11||self.accountTF.text.length>11) {
+        ALERTSHOW(@"请输入正确的手机号");
+        return;
+    }
     [self startTime];
 }
 -(void)startTime{
@@ -237,25 +227,16 @@
 
 }
 -(void)comitBtnClick:(UIButton *)comitBtn{
-    [self show];
-    //提交修改
-    [DataSourceManager updatePasswordWithUrlPhone:self.accountTF.text code:self.smsCodeTF.text Password1:self.passwordTF.text Password2:self.confirmPasswordTf.text completionBlock:^(NSDictionary *dic) {
-        ALERTSHOW(@"修改密码成功");
-
-    }];
-}
-#pragma mark------用户名密码校验
--(void)show{
-    if (self.accountTF.text ==nil||self.accountTF.text.length<11||self.accountTF.text.length >11) {
-        [self.loginButton setEnabled:NO];
-        [self.registButton setEnabled:NO];
+    if (self.accountTF.text.length ==0 ||self.accountTF.text.length<11||self.accountTF.text.length >11) {
         ALERTSHOW(@"手机号输入有误");
         return;
     }
+    if (self.smsCodeTF.text.length ==0 ||self.smsCodeTF.text.length !=6) {
+        ALERTSHOW(@"请输入有效的验证码");
+        return;
+    }
     
-    if (self.passwordTF.text ==nil||self.passwordTF.text.length>8){
-        [self.loginButton setEnabled:NO];
-        [self.registButton setEnabled:NO];
+    if (self.passwordTF.text.length == 0||self.passwordTF.text.length<6||self.phoneTf.text.length >20){
         ALERTSHOW(@"密码输入有误");
         return;
     }
@@ -263,6 +244,11 @@
         ALERTSHOW(@"两次输入密码不相同");
         return;
     }
+    //提交修改
+    [DataSourceManager updatePasswordWithUrlPhone:self.accountTF.text code:self.smsCodeTF.text Password1:self.passwordTF.text Password2:self.confirmPasswordTf.text completionBlock:^(NSDictionary *dic) {
+        ALERTSHOW(@"修改密码成功");
+
+    }];
 }
 #pragma mark - Delegate methods
 

+ 10 - 1
Haishenghai-master/ViewControllers/Login/UserLogin_VC.m

@@ -255,7 +255,16 @@
 //    return strUUID;
 //}
 -(void)loginButtonClick:(UIButton *)loginBtn{
-    [self show];
+
+    if (self.accountTF.text.length ==0||self.accountTF.text.length<11||self.accountTF.text.length >11) {
+        ALERTSHOW(@"请输入正确的手机号");
+        return;
+    }
+    
+    if (self.passwordTF.text.length ==0 ||self.passwordTF.text.length<6 || self.passwordTF.text.length >20){
+        ALERTSHOW(@"密码输入有误");
+        return;
+    }
     NSString *identifierStr = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
     NSLog(@"手机标识%@",identifierStr);
     [DataSourceManager setLoginWithUrlPhone:self.accountTF.text Password:self.passwordTF.text ClientId:identifierStr AppType:@"3" completionBlock:^(NSDictionary *dic) {

+ 21 - 25
Haishenghai-master/ViewControllers/Login/UserRegister_VC.m

@@ -30,7 +30,6 @@
     backBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
     self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:backBtn];
 
-    
     //
     [self setupUI];
 }
@@ -38,13 +37,6 @@
 -(void)setupUI{
     /** 设置背景 */
     self.view.backgroundColor = [UIColor whiteColor];
-    /** 设置返回 */
-//    self.backBtn.frame = CGRectMake(10, 20, 30, 30);
-//    [self.backBtn setBackgroundImage:[UIImage imageNamed:@"hsh_register_return"] forState:UIControlStateNormal];
-//    [self.backBtn setTitle:@"返回" forState:UIControlStateNormal];
-//    [self.backBtn addTarget:self action:@selector(backBtnClick) forControlEvents:UIControlEventTouchUpInside];
-//    [self.view addSubview:self.backBtn];
-    
     
     /** 设置logo */
     [self.logoImageView setImage:[UIImage imageNamed:@"logo"]];
@@ -256,7 +248,12 @@
     [self.navigationController popViewControllerAnimated:YES];
 }
 -(void)getSMSCodeBtnClick:(UIButton *)codeBtn{
-    if (self.phoneTf.text ==nil||self.phoneTf.text.length<11) {
+    NSString *inputText = [self.accountTF.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
+    if (inputText.length==0) {
+        ALERTSHOW(@"请输入昵称");
+        return;
+    }
+    if (self.phoneTf.text.length==0||self.phoneTf.text.length<11||self.phoneTf.text.length>11) {
         ALERTSHOW(@"手机号输入错误");
         return;
     }
@@ -304,25 +301,21 @@
     }];
 }
 -(void)registeBtnClick:(UIButton *)registBtn{
-    [self show];
-    [DataSourceManager setRegisterWithUrlPhoneNumber:self.phoneTf.text code:self.smsCodeTF.text UserName:self.accountTF.text PassWord1:self.passwordTF.text PassWord2:self.confirmPasswordTf.text completionBlock:^(NSDictionary *dic) {
-        ALERTSHOW(@"注册成功");
-
-    }];
-}
-#pragma mark------用户名密码校验
--(void)show{
-    //这里校验有问题
-    if (self.accountTF.text ==nil/*||self.accountTF.text.length<11||self.accountTF.text.length >11*/) {
-        [self.loginButton setEnabled:NO];
-        [self.registButton setEnabled:NO];
-        ALERTSHOW(@"手机号不能为空");
+    NSString *inputText = [self.accountTF.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
+    if (inputText.length==0) {
+        ALERTSHOW(@"请输入昵称");
+        return;
+    }
+    if (self.phoneTf.text.length ==0||self.phoneTf.text.length<11||self.phoneTf.text.length>11) {
+        ALERTSHOW(@"手机号输入错误");
+        return;
+    }
+    if (self.smsCodeTF.text.length ==0 ||self.smsCodeTF.text.length !=6) {
+        ALERTSHOW(@"请输入有效的验证码");
         return;
     }
     
-    if (self.passwordTF.text ==nil||self.passwordTF.text.length>8){
-        [self.loginButton setEnabled:NO];
-        [self.registButton setEnabled:NO];
+    if (self.passwordTF.text.length == 0||self.passwordTF.text.length<6||self.phoneTf.text.length >20){
         ALERTSHOW(@"密码输入有误");
         return;
     }
@@ -330,6 +323,9 @@
         ALERTSHOW(@"两次输入密码不相同");
         return;
     }
+    [DataSourceManager setRegisterWithUrlPhoneNumber:self.phoneTf.text code:self.smsCodeTF.text UserName:self.accountTF.text PassWord1:self.passwordTF.text PassWord2:self.confirmPasswordTf.text completionBlock:^(NSDictionary *dic) {
+        ALERTSHOW(@"注册成功");
+    }];
 }
 #pragma mark - Delegate methods
 

+ 6 - 5
Haishenghai-master/ViewControllers/Message/SubmitInformation_VC.m

@@ -490,10 +490,12 @@ didFinishPickingMediaWithInfo:(NSDictionary<NSString *,id> *)info {
 }
 #pragma mark-----提交的请求
 -(void)commitBtnClick:(UIButton *)btn{
-    if (textTF.text.length==0) {
-        ALERTSHOW(@"请添加描述");
-    }else{
-        
+    
+    NSString *inputText = [textTF.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
+    if (inputText.length ==0) {
+        ALERTSHOW(@"输入不能为空");
+        return;
+    }
         [DataSourceManager processDeviceTroubleWithAudioIDS:@"" Explain:textTF.text movieIDS:@"" pictureIDS:@"" ProType:@"1" ProcessId:_processID completionBlock:^(NSDictionary *dic) {
             UIViewController *appRootVC = [UIApplication sharedApplication].keyWindow.rootViewController;
             UIViewController *topVC = appRootVC;
@@ -512,7 +514,6 @@ didFinishPickingMediaWithInfo:(NSDictionary<NSString *,id> *)info {
             [hud hideAnimated:YES afterDelay:1];
             [self.navigationController popViewControllerAnimated:YES];
         }];
-    }
 }
 - (void)didReceiveMemoryWarning {
     [super didReceiveMemoryWarning];

+ 5 - 5
Haishenghai-master/ViewControllers/Place/EditLocationVC.m

@@ -71,7 +71,7 @@
         NSArray *titleArray =@[@"设备编号:",@"设备名称:",@"安装位置:",@"所属场所:"];
         UILabel *deveceLabel = [[UILabel alloc]init];
         deveceLabel.text = [titleArray objectAtIndex:i];
-        deveceLabel.frame = CGRectMake(20+(100)*(i/4), 70+(40)*(i%4), 100, 40);
+        deveceLabel.frame = CGRectMake(20+(100)*(i/4), kTopHeight+(40)*(i%4), 100, 40);
         deveceLabel.textAlignment = NSTextAlignmentLeft;
         deveceLabel.font = [UIFont systemFontOfSize:18];
         deveceLabel.textColor = [UIColor blackColor];
@@ -80,7 +80,7 @@
     
     for (int i =0; i<2; i++) {
         UILabel *detailLabel = [[UILabel alloc]init];
-        detailLabel.frame = CGRectMake(110+(200)*(i/2), 70+(40)*(i%2), WIDTH-130, 40);
+        detailLabel.frame = CGRectMake(110+(200)*(i/2), kTopHeight+(40)*(i%2), WIDTH-130, 40);
         detailLabel.tag = i;
         if (i==0) {
             detailLabel.text = _deveceNumber;
@@ -93,7 +93,7 @@
         [self.view addSubview:detailLabel];
     }
     _locationTF = [[UITextField alloc]init];
-    _locationTF.frame = CGRectMake(110, 150, WIDTH-130, 40);
+    _locationTF.frame = CGRectMake(110, kTopHeight+80, WIDTH-130, 40);
     _locationTF.delegate = self;
 
     _locationTF.textAlignment = NSTextAlignmentLeft;
@@ -103,7 +103,7 @@
     
     _siteTF = [[UITextField alloc]init];
     _siteTF.userInteractionEnabled =YES;
-    _siteTF.frame = CGRectMake(110, 190, WIDTH-130, 40);
+    _siteTF.frame = CGRectMake(110, kTopHeight+120, WIDTH-130, 40);
     _siteTF.textAlignment = NSTextAlignmentLeft;
     _siteTF.font = [UIFont systemFontOfSize:18];
     _siteTF.delegate =self;
@@ -119,7 +119,7 @@
     
     for (int i =0; i<2; i++) {
         UIView *line = [[UIView alloc]init];
-        line.frame = CGRectMake(110+200*(i/2), 189+(39)*(i%2), WIDTH-130, 1);
+        line.frame = CGRectMake(110+200*(i/2), (kTopHeight+119)+(39)*(i%2), WIDTH-130, 1);
         line.backgroundColor = [UIColor lightGrayColor];
         [self.view addSubview:line];
     }

+ 8 - 2
Haishenghai-master/ViewControllers/Place/ScanViewController.m

@@ -366,9 +366,15 @@
     }]];
     //确定按钮
     [alert addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
-        EditLocationVC *editVc = [[EditLocationVC alloc]init];
         UITextField *nameTF = alert.textFields.firstObject;
-        editVc.deveceNumber =nameTF.text;
+        NSString *inputText = [nameTF.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
+
+        if (inputText.length == 0) {
+            ALERTSHOW(@"请输入设备编号");
+            return ;
+        }
+        EditLocationVC *editVc = [[EditLocationVC alloc]init];
+        editVc.deveceNumber =inputText;
         editVc.deveceName = self.deveceName;
         editVc.typeID = self.typeId;
         [self.navigationController pushViewController:editVc animated:YES];