|
@@ -21,6 +21,7 @@
|
|
|
#import "CustomerEditViewController.h"
|
|
#import "CustomerEditViewController.h"
|
|
|
#import "CreateOrderViewController.h"
|
|
#import "CreateOrderViewController.h"
|
|
|
#import "OrderDetailViewController.h"
|
|
#import "OrderDetailViewController.h"
|
|
|
|
|
+#import "AddressEditorViewController.h"
|
|
|
|
|
|
|
|
#define UNZIP_OPEN_FAILED 0
|
|
#define UNZIP_OPEN_FAILED 0
|
|
|
#define UNZIP_SUCCESS 1
|
|
#define UNZIP_SUCCESS 1
|
|
@@ -466,11 +467,8 @@ void UncaughtExceptionHandler(NSException *exception) {
|
|
|
|
|
|
|
|
[iSalesDB execSql:sql];
|
|
[iSalesDB execSql:sql];
|
|
|
|
|
|
|
|
- NSString *cachePath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject];
|
|
|
|
|
- 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];
|
|
|
|
|
|
|
+ [appDelegate writeUrgencyCache];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- (void)handleErrorLog {
|
|
- (void)handleErrorLog {
|
|
@@ -563,11 +561,11 @@ void UncaughtExceptionHandler(NSException *exception) {
|
|
|
CustomerEditViewController * cuseditVC =[mainStoryBoard instantiateViewControllerWithIdentifier:@"CustomerEditViewController"];
|
|
CustomerEditViewController * cuseditVC =[mainStoryBoard instantiateViewControllerWithIdentifier:@"CustomerEditViewController"];
|
|
|
|
|
|
|
|
cuseditVC.bnewcustomer=false;
|
|
cuseditVC.bnewcustomer=false;
|
|
|
- cuseditVC.url_type = URL_REMOTE;
|
|
|
|
|
|
|
+ cuseditVC.url_type = URL_RESTORE;
|
|
|
cuseditVC.request_url=URL_EDIT_CUSTOMER;
|
|
cuseditVC.request_url=URL_EDIT_CUSTOMER;
|
|
|
|
|
|
|
|
cuseditVC.params = params;
|
|
cuseditVC.params = params;
|
|
|
- cuseditVC.changed_data = changed_data;
|
|
|
|
|
|
|
+ cuseditVC.content_data_download = changed_data;
|
|
|
|
|
|
|
|
// cuseditVC.delegate=self;
|
|
// cuseditVC.delegate=self;
|
|
|
|
|
|
|
@@ -623,43 +621,85 @@ void UncaughtExceptionHandler(NSException *exception) {
|
|
|
CreateOrderViewController * orderinfoVC =[mainStoryBoard instantiateViewControllerWithIdentifier:@"CreateOrderViewController"];
|
|
CreateOrderViewController * orderinfoVC =[mainStoryBoard instantiateViewControllerWithIdentifier:@"CreateOrderViewController"];
|
|
|
|
|
|
|
|
orderinfoVC.disable_dropdown_refresh=true;
|
|
orderinfoVC.disable_dropdown_refresh=true;
|
|
|
- orderinfoVC.url_type = URL_REMOTE;
|
|
|
|
|
|
|
+ orderinfoVC.url_type = URL_RESTORE;
|
|
|
orderinfoVC.request_url=URL_CARTDELIVERY;
|
|
orderinfoVC.request_url=URL_CARTDELIVERY;
|
|
|
orderinfoVC.params = params;
|
|
orderinfoVC.params = params;
|
|
|
- orderinfoVC.changed_data = changed_data;
|
|
|
|
|
|
|
+ orderinfoVC.content_data_download = changed_data;
|
|
|
orderinfoVC.resumeOrder = YES;
|
|
orderinfoVC.resumeOrder = YES;
|
|
|
|
|
|
|
|
[mainVC.navigationController pushViewController:orderinfoVC animated:true];
|
|
[mainVC.navigationController pushViewController:orderinfoVC animated:true];
|
|
|
|
|
|
|
|
|
|
|
|
|
- } else if ([firstClassName isEqualToString:@"AddressEditorViewController"]) {
|
|
|
|
|
- // AddressEditorViewController
|
|
|
|
|
|
|
+ NSString *second_class_name = [self.urgencyDic objectForKey:@"second_class_name"];
|
|
|
|
|
+ NSString *second_changed_data_key = [NSString stringWithFormat:@"%@_changed_data",second_class_name];
|
|
|
|
|
+ NSMutableDictionary *second_changed_data = [self.urgencyDic objectForKey:second_changed_data_key];
|
|
|
|
|
+
|
|
|
|
|
+ if ([second_class_name isEqualToString:@"AddressEditorViewController"]) {
|
|
|
|
|
+ // AddressEditorViewController
|
|
|
|
|
+
|
|
|
|
|
+ AddressEditorViewController * addressVC =[mainStoryBoard instantiateViewControllerWithIdentifier:@"AddressEditorViewController"];
|
|
|
|
|
+
|
|
|
|
|
+ addressVC.url_type = URL_RESTORE;
|
|
|
|
|
+ addressVC.request_url=URL_ADDRESS_EDOTOR;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ NSMutableDictionary * params= [[NSMutableDictionary alloc] init];
|
|
|
|
|
+
|
|
|
|
|
+ params[@"is_subaction"]=@"true";
|
|
|
|
|
+// params[@"subaction_tag"]= [NSString stringWithFormat:@"%ld",(long)sender.tag];
|
|
|
|
|
+ addressVC.params = params;
|
|
|
|
|
+ addressVC.content_data_download = second_changed_data;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+// addressVC.from = indexPath;
|
|
|
|
|
+
|
|
|
|
|
+ [mainVC.navigationController pushViewController:addressVC animated:true];
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ } else {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-- (void)initialExceptionHandler {
|
|
|
|
|
- NSSetUncaughtExceptionHandler(&UncaughtExceptionHandler);
|
|
|
|
|
|
|
+- (void)writeUrgencyCache {
|
|
|
|
|
+ if (!self.user) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ NSString *cachePath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject];
|
|
|
|
|
+ NSString *urgencyFile = [cachePath stringByAppendingPathComponent:[NSString stringWithFormat:@"%@_urgency",self.user]];
|
|
|
|
|
+
|
|
|
|
|
+ [NSKeyedArchiver archiveRootObject:self.urgencyDic toFile:urgencyFile];
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+- (void)readUrgencyCache {
|
|
|
// 检查本地urgency文件,存在则加载进_urgencyDic
|
|
// 检查本地urgency文件,存在则加载进_urgencyDic
|
|
|
NSFileManager *manager = [NSFileManager defaultManager];
|
|
NSFileManager *manager = [NSFileManager defaultManager];
|
|
|
NSString *cachePath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject];
|
|
NSString *cachePath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject];
|
|
|
- NSString *urgencyFile = [cachePath stringByAppendingPathComponent:@"urgency"];
|
|
|
|
|
|
|
+ NSString *urgencyFile = [cachePath stringByAppendingPathComponent:[NSString stringWithFormat:@"%@_urgency",self.user]];
|
|
|
|
|
|
|
|
if ([manager fileExistsAtPath:urgencyFile]) {
|
|
if ([manager fileExistsAtPath:urgencyFile]) {
|
|
|
|
|
|
|
|
_urgencyDic = [NSKeyedUnarchiver unarchiveObjectWithFile:urgencyFile];
|
|
_urgencyDic = [NSKeyedUnarchiver unarchiveObjectWithFile:urgencyFile];
|
|
|
|
|
+ [manager removeItemAtPath:urgencyFile error:nil];
|
|
|
|
|
|
|
|
-// _urgencyDic = [NSMutableDictionary dictionaryWithContentsOfFile:urgencyFile];
|
|
|
|
|
} else {
|
|
} else {
|
|
|
_urgencyDic = [NSMutableDictionary dictionary];
|
|
_urgencyDic = [NSMutableDictionary dictionary];
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+- (void)initialExceptionHandler {
|
|
|
|
|
+ NSSetUncaughtExceptionHandler(&UncaughtExceptionHandler);
|
|
|
|
|
+ [self readUrgencyCache];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- (void)becomeObserver {
|
|
- (void)becomeObserver {
|