|
|
@@ -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];
|
|
|
|
|
|
}
|
|
|
|