Sfoglia il codice sorgente

修改Notify Me提示。

Pen Li 9 anni fa
parent
commit
b6d06c0362

BIN
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/macmini1.xcuserdatad/UserInterfaceState.xcuserstate


+ 16 - 4
RedAnt ERP Mobile/common/Functions/modelDetail/DetailViewController.m

@@ -1849,7 +1849,7 @@ self.isrefreshing=false;
 
 - (void)showEmailAddrBox {
 //    AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
-    
+
     JKMessageBoxController *emailAddrVC = [JKMessageBoxController messageBoxControllerWithTip:@"E-mail not setup, please enter your default e-mail address" ContentSize:CGSizeMake(400, 150)];
     emailAddrVC.textFiled.secureTextEntry = NO;
     emailAddrVC.yesButtonTitle = @"send";
@@ -1878,9 +1878,17 @@ self.isrefreshing=false;
                         
                         [waitting_alert dismissWithClickedButtonIndex:0 animated:NO];
                         
-                        if ([[result objectForKey:@"result"] integerValue] != RESULT_TRUE) {
+                        int resultStatus = [[result objectForKey:@"result"] integerValue];
+                        if (resultStatus != RESULT_TRUE && resultStatus != RESULT_NO_EMAIL_ADDRESS) {
                             
-                            UIAlertController *errorAlertVC = [UIAlertController alertControllerWithTitle:@"Warning" message:[NSString stringWithFormat:@"The email send to %@ failed",text] preferredStyle:UIAlertControllerStyleAlert];
+                            NSString *msg = [NSString stringWithFormat:@"The email send failed"];
+                            if (resultStatus == 8) {
+                                if ([result valueForKey:@"err_msg"]) {
+                                    msg = [result valueForKey:@"err_msg"];
+                                }
+                            }
+                            
+                            UIAlertController *errorAlertVC = [UIAlertController alertControllerWithTitle:@"Warning" message:msg preferredStyle:UIAlertControllerStyleAlert];
                             UIAlertAction *action = [UIAlertAction actionWithTitle:@"ok" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
                                 
                             }];
@@ -1888,10 +1896,14 @@ self.isrefreshing=false;
                             [errorAlertVC addAction:action];
                             [weakself presentViewController:errorAlertVC animated:YES completion:nil];
                             
-                        }else {
+                        }else if(resultStatus == RESULT_TRUE){
                             
                              [RAUtils message_alert:@"Notification is sent to default email address." title:@"Message" controller:weakself];
                             
+                        } else if (resultStatus == RESULT_NO_EMAIL_ADDRESS) {
+                            
+                            [weakself showEmailAddrBox];
+                            
                         }
                         
                     });