|
|
@@ -2684,7 +2684,7 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:
|
|
|
|
|
|
- (IBAction)emailButtonClick:(UIButton *)sender {
|
|
|
|
|
|
-// AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
|
|
|
+ AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
|
|
|
|
|
|
JKMessageBoxController *emailAddrVC = [JKMessageBoxController messageBoxControllerWithTip:@"Please enter email address"];
|
|
|
emailAddrVC.textFiled.secureTextEntry = NO;
|
|
|
@@ -2704,18 +2704,36 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:
|
|
|
// 验证是邮件地址,发送邮件
|
|
|
[weakVC dismissViewControllerAnimated:YES completion:^{
|
|
|
|
|
|
- NSDictionary *result = [iSalesNetwork quoteOrder:self.orderid emailAddr:text];
|
|
|
- if ([[result objectForKey:@"result"] integerValue] != RESULT_TRUE) {
|
|
|
+ UIAlertView *waitting_alert = [RAUtils waiting_alert:@"Sending Email" title:@"Waitting"];
|
|
|
+
|
|
|
+ dispatch_async(dispatch_get_global_queue(0, 0), ^{
|
|
|
+
|
|
|
+ NSDictionary *result = [iSalesNetwork quoteOrder:appDelegate.order_code emailAddr:text];
|
|
|
+ DebugLog(@"email cart result: %@",result);
|
|
|
+ dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
+
|
|
|
+ [waitting_alert dismissWithClickedButtonIndex:0 animated:YES];
|
|
|
+
|
|
|
+ if ([[result objectForKey:@"result"] integerValue] != RESULT_TRUE) {
|
|
|
+
|
|
|
+ UIAlertController *errorAlertVC = [UIAlertController alertControllerWithTitle:@"Warning" message:[NSString stringWithFormat:@"The email send to %@ failed",text] preferredStyle:UIAlertControllerStyleAlert];
|
|
|
+ UIAlertAction *action = [UIAlertAction actionWithTitle:@"ok" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
|
|
|
+
|
|
|
+ }];
|
|
|
+
|
|
|
+ [errorAlertVC addAction:action];
|
|
|
+ [weakself presentViewController:errorAlertVC animated:YES completion:nil];
|
|
|
+
|
|
|
+ }else {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ });
|
|
|
|
|
|
- UIAlertController *errorAlertVC = [UIAlertController alertControllerWithTitle:@"Warning" message:[NSString stringWithFormat:@"The email send to %@ failed",text] preferredStyle:UIAlertControllerStyleAlert];
|
|
|
- UIAlertAction *action = [UIAlertAction actionWithTitle:@"ok" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
|
|
|
-
|
|
|
- }];
|
|
|
-
|
|
|
- [errorAlertVC addAction:action];
|
|
|
- [weakself presentViewController:errorAlertVC animated:YES completion:nil];
|
|
|
-
|
|
|
- }
|
|
|
+ });
|
|
|
+
|
|
|
}];
|
|
|
|
|
|
} else {
|