Răsfoiți Sursa

修改Notify Me邮件地址判断和提示输入。
RESULT_NO_EMAIL_ADDRESS 3

Pen Li 9 ani în urmă
părinte
comite
4bcfbf1446

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


+ 15 - 18
RedAnt ERP Mobile/common/Functions/modelDetail/DetailViewController.m

@@ -981,14 +981,6 @@ self.isrefreshing=false;
                 __weak typeof(self) weakself = self;
                 cell.notifyMeBlock = ^{
                     
-                    NSString *emailAddr = [Singleton sharedInstance].customer_email;
-                    
-                    if (!emailAddr.length) {
-                        
-                        [self showEmailAddrBox];
-                        
-                    } else {
-                        
                         UIAlertView *waitting_alert = [RAUtils waiting_alert:@"Sending Email" title:@"Waiting"];
                         dispatch_async(dispatch_get_global_queue(0,0), ^{
                             
@@ -996,11 +988,13 @@ self.isrefreshing=false;
                             
                             dispatch_async(dispatch_get_main_queue(), ^{
                                 
-                                [waitting_alert dismissWithClickedButtonIndex:0 animated:YES];
+                                [waitting_alert dismissWithClickedButtonIndex:0 animated:NO];
+                                
+                                int result = [[dic valueForKey:@"result"] integerValue];
                                 
-                                if ([[dic valueForKey:@"result"] integerValue] != RESULT_TRUE) {
+                                if (result != RESULT_TRUE && result != RESULT_NO_EMAIL_ADDRESS) {
                                     
-                                    NSString *msg = [NSString stringWithFormat:@"The email send to %@ failed",emailAddr];
+                                    NSString *msg = [NSString stringWithFormat:@"The email send failed"];
                                     if ([[dic valueForKey:@"result"] integerValue] == 8) {
                                         if ([dic valueForKey:@"err_msg"]) {
                                             msg = [dic valueForKey:@"err_msg"];
@@ -1015,17 +1009,20 @@ self.isrefreshing=false;
                                     [errorAlertVC addAction:action];
                                     [weakself presentViewController:errorAlertVC animated:YES completion:nil];
                                     
-                                } else {
+                                } else if (result == RESULT_TRUE){
                                     
                                     [RAUtils message_alert:@"Notification is sent to default email address." title:@"Message" controller:weakself];
                                     
+                                } else if (result == RESULT_NO_EMAIL_ADDRESS) {
+                                    
+                                    [self showEmailAddrBox];
+                                    
                                 }
                             });
                             
                             
                         });
-                        
-                    }
+                    
                     
                 };
                 
@@ -1851,9 +1848,9 @@ self.isrefreshing=false;
 #pragma mark - action
 
 - (void)showEmailAddrBox {
-    AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+//    AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
     
-    JKMessageBoxController *emailAddrVC = [JKMessageBoxController messageBoxControllerWithTip:@"E-mail not setup, please enter your default e-mail" ContentSize:CGSizeMake(350, 130)];
+    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";
     
@@ -1879,7 +1876,7 @@ self.isrefreshing=false;
                     DebugLog(@"email cart result: %@",result);
                     dispatch_async(dispatch_get_main_queue(), ^{
                         
-                        [waitting_alert dismissWithClickedButtonIndex:0 animated:YES];
+                        [waitting_alert dismissWithClickedButtonIndex:0 animated:NO];
                         
                         if ([[result objectForKey:@"result"] integerValue] != RESULT_TRUE) {
                             
@@ -1893,7 +1890,7 @@ self.isrefreshing=false;
                             
                         }else {
                             
-                            
+                             [RAUtils message_alert:@"Notification is sent to default email address." title:@"Message" controller:weakself];
                             
                         }
                         

+ 4 - 1
RedAnt ERP Mobile/common/JKLock/JKMessageBoxController.m

@@ -66,7 +66,10 @@
 
 - (UILabel *)titleLabel {
     if (!_titleLabel) {
-        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, self.preferredContentSize.width - 20, 25)];
+        CGFloat height = self.preferredContentSize.height > 130 ? (self.preferredContentSize.height - 130) / 2 + 25 : 25;
+        
+        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, self.preferredContentSize.width - 20, height)];
+        _titleLabel.numberOfLines = 0;
         _titleLabel.font = [UIFont systemFontOfSize:14];
         _titleLabel.textAlignment = NSTextAlignmentCenter;
     }

+ 1 - 0
RedAnt ERP Mobile/common/const.h

@@ -62,6 +62,7 @@
 
 #define RESULT_FALSE 0
 #define RESULT_TRUE		 2
+#define RESULT_NO_EMAIL_ADDRESS      3
 #define RESULT_NET_SERVER_ERR		 -1
 #define RESULT_NET_ERROR			 -3
 #define RESULT_NET_NOTAVAILABLE		  -4

+ 1 - 1
RedAnt ERP Mobile/iSales-NPD/config.h

@@ -10,7 +10,7 @@
 #define RedAnt_ERP_Mobile_config_h
 #define BUILD_NPD
 
-//#define test_server
+#define test_server
 #define exception_switch 1
 #define notifyMe_switch 1