|
@@ -19,7 +19,8 @@
|
|
|
#import "iSalesNetwork.h"
|
|
#import "iSalesNetwork.h"
|
|
|
#import "NotificationNameCenter.h"
|
|
#import "NotificationNameCenter.h"
|
|
|
#import "CustomerEditViewController.h"
|
|
#import "CustomerEditViewController.h"
|
|
|
-
|
|
|
|
|
|
|
+#import "CreateOrderViewController.h"
|
|
|
|
|
+#import "OrderDetailViewController.h"
|
|
|
|
|
|
|
|
#define UNZIP_OPEN_FAILED 0
|
|
#define UNZIP_OPEN_FAILED 0
|
|
|
#define UNZIP_SUCCESS 1
|
|
#define UNZIP_SUCCESS 1
|
|
@@ -468,6 +469,7 @@ void UncaughtExceptionHandler(NSException *exception) {
|
|
|
NSString *cachePath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject];
|
|
NSString *cachePath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject];
|
|
|
NSString *urgencyFile = [cachePath stringByAppendingPathComponent:@"urgency"];
|
|
NSString *urgencyFile = [cachePath stringByAppendingPathComponent:@"urgency"];
|
|
|
AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
|
|
AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
|
|
|
|
|
+ NSLog(@"arkiver urgencyDic: %@",appDelegate.urgencyDic);
|
|
|
[NSKeyedArchiver archiveRootObject:appDelegate.urgencyDic toFile:urgencyFile];
|
|
[NSKeyedArchiver archiveRootObject:appDelegate.urgencyDic toFile:urgencyFile];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -529,16 +531,11 @@ void UncaughtExceptionHandler(NSException *exception) {
|
|
|
|
|
|
|
|
- (void)handleUrgencyFile {
|
|
- (void)handleUrgencyFile {
|
|
|
|
|
|
|
|
-// id root = self.window.rootViewController;
|
|
|
|
|
-// NSArray *child = self.window.rootViewController.childViewControllers;
|
|
|
|
|
-//
|
|
|
|
|
-// NSLog(@"rootViewController:%@",root);
|
|
|
|
|
-// NSLog(@"child: %@",child);
|
|
|
|
|
-
|
|
|
|
|
NSLog(@"urgencyDic: %@",self.urgencyDic);
|
|
NSLog(@"urgencyDic: %@",self.urgencyDic);
|
|
|
if (self.urgencyDic.allKeys.count) {
|
|
if (self.urgencyDic.allKeys.count) {
|
|
|
|
|
|
|
|
MainViewController *mainVC = [self.window.rootViewController.childViewControllers lastObject];
|
|
MainViewController *mainVC = [self.window.rootViewController.childViewControllers lastObject];
|
|
|
|
|
+ UIStoryboard *mainStoryBoard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
|
|
|
|
|
|
|
|
NSString *user = [self.urgencyDic objectForKey:@"user"];
|
|
NSString *user = [self.urgencyDic objectForKey:@"user"];
|
|
|
if (![user isEqualToString:self.user]) {
|
|
if (![user isEqualToString:self.user]) {
|
|
@@ -560,11 +557,10 @@ void UncaughtExceptionHandler(NSException *exception) {
|
|
|
|
|
|
|
|
NSString *contact_id = [self.urgencyDic objectForKey:@"contact_id"];
|
|
NSString *contact_id = [self.urgencyDic objectForKey:@"contact_id"];
|
|
|
|
|
|
|
|
- NSMutableDictionary * params= [[NSMutableDictionary alloc] init];
|
|
|
|
|
-
|
|
|
|
|
|
|
+ NSMutableDictionary *params = [NSMutableDictionary dictionary];
|
|
|
|
|
|
|
|
[params setValue:contact_id forKey:@"contact_id"];
|
|
[params setValue:contact_id forKey:@"contact_id"];
|
|
|
- CustomerEditViewController * cuseditVC =[[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"CustomerEditViewController"];
|
|
|
|
|
|
|
+ CustomerEditViewController * cuseditVC =[mainStoryBoard instantiateViewControllerWithIdentifier:@"CustomerEditViewController"];
|
|
|
|
|
|
|
|
cuseditVC.bnewcustomer=false;
|
|
cuseditVC.bnewcustomer=false;
|
|
|
cuseditVC.url_type = URL_REMOTE;
|
|
cuseditVC.url_type = URL_REMOTE;
|
|
@@ -584,8 +580,56 @@ void UncaughtExceptionHandler(NSException *exception) {
|
|
|
} else if ([firstClassName isEqualToString:@"CreateOrderViewController"]) {
|
|
} else if ([firstClassName isEqualToString:@"CreateOrderViewController"]) {
|
|
|
// CreateOrderViewController
|
|
// CreateOrderViewController
|
|
|
|
|
|
|
|
|
|
+ NSString *order_code = [self.urgencyDic objectForKey:@"order_code"];
|
|
|
|
|
+ int order_status = [[self.urgencyDic objectForKey:@"order_status"] intValue];
|
|
|
|
|
+ NSString *order_customer_id = [self.urgencyDic objectForKey:@"order_customer_id"];
|
|
|
|
|
+
|
|
|
|
|
+ self.order_customer_id = order_customer_id;
|
|
|
|
|
+
|
|
|
|
|
+ // 首先通过order code 打开订单
|
|
|
|
|
+ NSDictionary* order_json = [iSalesNetwork open_Order:order_code];
|
|
|
|
|
+
|
|
|
|
|
+ dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
|
|
+// [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
|
|
|
|
|
+ if([[order_json valueForKey:@"result"] intValue]==2)
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ self.order_code = order_code;
|
|
|
|
|
+ self.order_status = order_status;
|
|
|
|
|
+ [self SetSo:order_code];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ self.customerInfo = [iSalesNetwork request_CustomerInfo:order_customer_id].mutableCopy;
|
|
|
|
|
+
|
|
|
|
|
+ self.contact_id=[self.customerInfo valueForKey:@"customer_cid"];
|
|
|
|
|
+
|
|
|
|
|
+ [mainVC reloadOrder:true immediately:false];
|
|
|
|
|
+ [mainVC reloadCart:true immediately:false];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ [RAUtils message_alert:[order_json valueForKey:@"err_msg"] title:@"Open Order" controller:mainVC] ;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ // 再place order
|
|
|
|
|
+
|
|
|
|
|
+ NSMutableDictionary *params = [NSMutableDictionary dictionary];
|
|
|
|
|
+
|
|
|
|
|
+ CreateOrderViewController * orderinfoVC =[mainStoryBoard instantiateViewControllerWithIdentifier:@"CreateOrderViewController"];
|
|
|
|
|
|
|
|
|
|
+ orderinfoVC.disable_dropdown_refresh=true;
|
|
|
|
|
+ orderinfoVC.url_type = URL_REMOTE;
|
|
|
|
|
+ orderinfoVC.request_url=URL_CARTDELIVERY;
|
|
|
|
|
+ orderinfoVC.params = params;
|
|
|
|
|
+ orderinfoVC.changed_data = changed_data;
|
|
|
|
|
+ orderinfoVC.resumeOrder = YES;
|
|
|
|
|
|
|
|
|
|
+ [mainVC.navigationController pushViewController:orderinfoVC animated:true];
|
|
|
|
|
|
|
|
|
|
|
|
|
} else if ([firstClassName isEqualToString:@"AddressEditorViewController"]) {
|
|
} else if ([firstClassName isEqualToString:@"AddressEditorViewController"]) {
|