Parcourir la source

HMLG Scan Order 1.38
Add apn function

Ray Zhang il y a 2 ans
Parent
commit
eb240342e2
67 fichiers modifiés avec 946 ajouts et 740 suppressions
  1. 4 4
      Ants Contract/Granite Expo eSign/Granite Expo eSign.xcodeproj/project.pbxproj
  2. 2 2
      RA TradeFiling/RA TradeFiling.xcodeproj/project.pbxproj
  3. BIN
      RA TradeFiling/RA TradeFiling.xcodeproj/project.xcworkspace/xcuserdata/ruizhang.xcuserdatad/UserInterfaceState.xcuserstate
  4. 5 0
      RA TradeFiling/RA TradeFiling/CustomFields/CustomizeFieldViewController.m
  5. 2 2
      RA TradeFiling/RA TradeFiling/DataProvider/OnlineDataProvider.h
  6. 2 2
      RA TradeFiling/RA TradeFiling/DataProvider/OnlineDataProvider.m
  7. 15 9
      RA TradeFiling/RA TradeFiling/DataProvider/RADataProvider.m
  8. 123 53
      RA TradeFiling/RA TradeFiling/Detail/DetailPageViewController.m
  9. 2 1
      RA TradeFiling/RA TradeFiling/Detail/DetailTabBarController.m
  10. 1 0
      RA TradeFiling/RA TradeFiling/Home/CompanySelectViewController.m
  11. 1 1
      RA TradeFiling/RA TradeFiling/Home/FunctionSettingViewController.h
  12. 2 1
      RA TradeFiling/RA TradeFiling/Home/FunctionSettingViewController.m
  13. 2 2
      RA TradeFiling/RA TradeFiling/Home/RAHomeHeaderView.h
  14. 3 3
      RA TradeFiling/RA TradeFiling/Home/RAHomeViewController.h
  15. 3 1
      RA TradeFiling/RA TradeFiling/Home/RAHomeViewController.m
  16. 22 10
      RA TradeFiling/RA TradeFiling/Login/LoginViewController.m
  17. 1 1
      RA TradeFiling/RA TradeFiling/My/ChangePasswordViewController.m
  18. 5 2
      RA TradeFiling/RA TradeFiling/My/SavedDetailViewController.m
  19. 5 2
      RA TradeFiling/RA TradeFiling/My/SavedSearchViewController.m
  20. 5 5
      RA TradeFiling/RA TradeFiling/RASingleton.h
  21. 6 6
      RA TradeFiling/RA TradeFiling/Result/ResultACICell.h
  22. 6 6
      RA TradeFiling/RA TradeFiling/Result/ResultACICell.m
  23. 4 4
      RA TradeFiling/RA TradeFiling/Result/ResultCustomerCell.h
  24. 7 7
      RA TradeFiling/RA TradeFiling/Result/ResultISFCell.h
  25. 1 1
      RA TradeFiling/RA TradeFiling/Result/ResultPresenter.m
  26. 1 1
      RA TradeFiling/RA TradeFiling/Result/ResultViewController+QuickLook.m
  27. 1 0
      RA TradeFiling/RA TradeFiling/Result/ResultViewController+TableDataSource.m
  28. 5 3
      RA TradeFiling/RA TradeFiling/Search/MyAutocompleteView.m
  29. 1 1
      RA TradeFiling/RA TradeFiling/Search/SearchTableAdapterJson.m
  30. 1 1
      RA TradeFiling/RA TradeFiling/Search/SearchViewController.m
  31. 4 4
      RA TradeFiling/RA TradeFiling/SignUp/SignupViewController.m
  32. 4 4
      RA TradeFiling/RA TradeFiling/TFEditor/TFEditorViewController.m
  33. 0 91
      RedAnt ERP Mobile/HMLG Mobile.xcodeproj/xcuserdata/Ray.xcuserdatad/xcschemes/HMLG Mobile.xcscheme
  34. 0 22
      RedAnt ERP Mobile/HMLG Mobile.xcodeproj/xcuserdata/Ray.xcuserdatad/xcschemes/xcschememanagement.plist
  35. 0 98
      RedAnt ERP Mobile/HMLG Mobile.xcodeproj/xcuserdata/macmini1.xcuserdatad/xcschemes/HMLG Mobile.xcscheme
  36. 0 22
      RedAnt ERP Mobile/HMLG Mobile.xcodeproj/xcuserdata/macmini1.xcuserdatad/xcschemes/xcschememanagement.plist
  37. 6 2
      RedAnt ERP Mobile/HMLG Scan Order.xcodeproj/project.pbxproj
  38. 1 1
      RedAnt ERP Mobile/HMLG Scan Order.xcodeproj/xcuserdata/ruizhang.xcuserdatad/xcschemes/xcschememanagement.plist
  39. 2 2
      RedAnt ERP Mobile/HMLG Scan Order/AppDelegate.h
  40. 225 0
      RedAnt ERP Mobile/HMLG Scan Order/AppDelegate.m
  41. 52 30
      RedAnt ERP Mobile/HMLG Scan Order/Base.lproj/Main.storyboard
  42. 2 4
      RedAnt ERP Mobile/HMLG Scan Order/HMLG Scan Order.entitlements
  43. 17 17
      RedAnt ERP Mobile/HMLG Scan Order/QRCode.storyboard
  44. 1 1
      RedAnt ERP Mobile/HMLG Scan Order/SO.storyboard
  45. 14 1
      RedAnt ERP Mobile/HMLG Scan Order/ScanListCell.m
  46. 1 1
      RedAnt ERP Mobile/HMLG Scan Order/ScanOrderModelListViewController.m
  47. 65 65
      RedAnt ERP Mobile/HMLG Scan Order/StockViewController.m
  48. 2 2
      RedAnt ERP Mobile/HMLG Scan Order/config.h
  49. 0 25
      RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcshareddata/RedAnt ERP Mobile.xcscmblueprint
  50. 0 25
      RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcshareddata/RedAnt ERP Mobile_NPD.xcscmblueprint
  51. 1 1
      RedAnt ERP Mobile/common/AppDelegateBase.h
  52. 9 0
      RedAnt ERP Mobile/common/Functions/camscan/ScannerViewController.m
  53. 1 0
      RedAnt ERP Mobile/common/Functions/offline/OLDataProvider.m
  54. 4 1
      RedAnt ERP Mobile/common/Functions/order/CreateOrderViewController.m
  55. 3 0
      RedAnt ERP Mobile/common/RASingleton.h
  56. 9 9
      RedAnt ERP Mobile/common/customUI/MDHTMLLabel.m
  57. 1 1
      RedAnt ERP Mobile/common/data_provider/RADataProvider.m
  58. 16 9
      RedAnt ERP Mobile/common/data_provider/RANetwork.m
  59. 1 1
      RedAnt ERP Mobile/iSales-CONTRAST.xcodeproj/xcuserdata/ruizhang.xcuserdatad/xcschemes/xcschememanagement.plist
  60. 223 137
      RedAnt ERP Mobile/iSales-NPD/Base.lproj/OLM.storyboard
  61. 8 1
      common/RAUtils.m
  62. 1 1
      common/Tab Based Framework/RootViewController.m
  63. 4 2
      common/customUI/CustomIOSAlertView.m
  64. 10 8
      common/customUI/commoneditor/CommonEditorBannerCell.m
  65. 1 1
      common/customUI/commoneditor/EnumSelectOnlineViewController.h
  66. 2 1
      common/customUI/commoneditor/EnumSelectOnlineViewController.m
  67. 18 19
      common/customUI/commoneditor/Phone_Web_Cell.xib

+ 4 - 4
Ants Contract/Granite Expo eSign/Granite Expo eSign.xcodeproj/project.pbxproj

@@ -949,7 +949,7 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
-				CURRENT_PROJECT_VERSION = 54088;
+				CURRENT_PROJECT_VERSION = 54100;
 				DEVELOPMENT_TEAM = HXWLAA5YN5;
 				INFOPLIST_FILE = "Granite Expo eSign/Info.plist";
 				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
@@ -957,7 +957,7 @@
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				MARKETING_VERSION = 1.75;
+				MARKETING_VERSION = 1.76;
 				PRODUCT_BUNDLE_IDENTIFIER = "usai.redant.Granite-Expo-eSign";
 				PRODUCT_NAME = "$(TARGET_NAME)";
 			};
@@ -967,7 +967,7 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
-				CURRENT_PROJECT_VERSION = 54088;
+				CURRENT_PROJECT_VERSION = 54100;
 				DEVELOPMENT_TEAM = HXWLAA5YN5;
 				INFOPLIST_FILE = "Granite Expo eSign/Info.plist";
 				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
@@ -975,7 +975,7 @@
 					"$(inherited)",
 					"@executable_path/Frameworks",
 				);
-				MARKETING_VERSION = 1.75;
+				MARKETING_VERSION = 1.76;
 				PRODUCT_BUNDLE_IDENTIFIER = "usai.redant.Granite-Expo-eSign";
 				PRODUCT_NAME = "$(TARGET_NAME)";
 			};

+ 2 - 2
RA TradeFiling/RA TradeFiling.xcodeproj/project.pbxproj

@@ -2081,7 +2081,7 @@
 				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
 				GCC_WARN_UNUSED_FUNCTION = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
-				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 13.0;
 				MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
 				MTL_FAST_MATH = YES;
 				ONLY_ACTIVE_ARCH = YES;
@@ -2135,7 +2135,7 @@
 				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
 				GCC_WARN_UNUSED_FUNCTION = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
-				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 13.0;
 				MTL_ENABLE_DEBUG_INFO = NO;
 				MTL_FAST_MATH = YES;
 				SDKROOT = iphoneos;

BIN
RA TradeFiling/RA TradeFiling.xcodeproj/project.xcworkspace/xcuserdata/ruizhang.xcuserdatad/UserInterfaceState.xcuserstate


+ 5 - 0
RA TradeFiling/RA TradeFiling/CustomFields/CustomizeFieldViewController.m

@@ -9,6 +9,7 @@
 #import "CustomizeFieldViewController.h"
 #import "RAConvertor.h"
 #import "RADataProvider.h"
+#import "RAUtils.h"
 @interface CustomizeFieldViewController ()
 
 @end
@@ -168,6 +169,10 @@
     
     bool result =[json writeToFile:[docDir stringByAppendingPathComponent:[NSString stringWithFormat:@"%@_%@_%@.json",_type,_subtype,RASingleton.sharedInstance.user]]  atomically:true];
     
+    if(result)
+    DebugLog(@"true");
+    else
+        DebugLog(@"false");
 //    if(self.onSave)
 //        self.onSave(self.active_functions);
 //    [self.navigationController popViewControllerAnimated:TRUE];

+ 2 - 2
RA TradeFiling/RA TradeFiling/DataProvider/OnlineDataProvider.h

@@ -15,11 +15,11 @@ NS_ASSUME_NONNULL_BEGIN
 + (void)request_signup : (NSString*) user password:(NSString*) password completionHandler:(resultHandler)result;
 + (void)request_changepassword:(NSString*) newpassword completionHandler:(resultHandler)result;
 + (void)request_logout : (resultHandler)result;
-+ (void)request_home :(NSMutableDictionary *)params completionHandler:(resultHandler)result;
++ (void)request_home :(nullable NSMutableDictionary *)params completionHandler:(resultHandler)result;
 + (void)request_result:(NSMutableDictionary *)params completionHandler:(resultHandler)result;
 + (void) request_detail: (NSMutableDictionary *) params completionHandler:(resultHandler)result;
 + (void)request_retrievepassword: (NSString*)user  email:(NSString*)email completionHandler:(resultHandler)result;
-+ (void)request_fastdownload:(NSMutableDictionary *)params url:(NSString *)url completionHandler:(resultHandler)result;
++ (void)request_fastdownload:(nullable NSMutableDictionary *)params url:(NSString *)url completionHandler:(resultHandler)result;
 +(void)request_save_editor:(NSMutableDictionary*)params completionHandler:(resultHandler)result;
 +(void)request_commoneditor_partialrefresh: (NSMutableDictionary*)params url:(NSString*)url completionHandler:(resultHandler)result;
 +(void) request_editor: (NSMutableDictionary *) params completionHandler:(resultHandler)result;

+ 2 - 2
RA TradeFiling/RA TradeFiling/DataProvider/OnlineDataProvider.m

@@ -84,7 +84,7 @@
     [self request_interface:URL_LOGOUT parameters:params err_record_url:nil completionHandler:result retry:0];
 }
 
-+ (void)request_home :(NSMutableDictionary *)params completionHandler:(resultHandler)result
++ (void)request_home :(nullable NSMutableDictionary *)params completionHandler:(resultHandler)result
 {
 //    params = [self prepare_addtional_params:params];
     if(params==nil)
@@ -218,7 +218,7 @@
 }
 
 
-+ (void)request_fastdownload:(NSMutableDictionary *)params url:(NSString *)url completionHandler:(resultHandler)result
++ (void)request_fastdownload:(nullable NSMutableDictionary *)params url:(NSString *)url completionHandler:(resultHandler)result
 {
     
 #ifdef test_server

+ 15 - 9
RA TradeFiling/RA TradeFiling/DataProvider/RADataProvider.m

@@ -213,10 +213,12 @@
 + (bool)saveDetailParameters:(NSMutableDictionary *)param forModule:(NSString *)module withName:(NSString *)name actions:(NSString*)actions
 {
     if (param==nil || module==nil) {
-        return @{
-                 @"result" : @RESULT_FALSE,
-                 @"err_msg" : @"Sorry, cannot save search, please contact admin."
-                 };
+//
+//        return @{
+//                 @"result" : @RESULT_FALSE,
+//                 @"err_msg" : @"Sorry, cannot save search, please contact admin."
+//                 };
+        return false;
     }
     
  
@@ -363,7 +365,8 @@
 //            dict_user[@"user_hide"] = user_hide;
             json_user =[RAConvertor dict2data:dict];
             
-            bool result =[json_user writeToFile:[docDir stringByAppendingPathComponent:[NSString stringWithFormat:@"%@_%@_%@.json",type,subtype,RASingleton.sharedInstance.user]]  atomically:true];
+//            bool result =
+            [json_user writeToFile:[docDir stringByAppendingPathComponent:[NSString stringWithFormat:@"%@_%@_%@.json",type,subtype,RASingleton.sharedInstance.user]]  atomically:true];
         }
 
         return json_user;
@@ -374,7 +377,8 @@
         NSData* json = [RAConvertor dict2data:RASingleton.sharedInstance.fields[type][subtype] ];
         
 //        json=[NSData dataWithContentsOfFile:[[NSBundle mainBundle]  pathForResource:@"FunctionPanel" ofType:@"json" ]];
-        bool result =[json writeToFile:[docDir stringByAppendingPathComponent:[NSString stringWithFormat:@"%@_%@_%@.json",type,subtype,RASingleton.sharedInstance.user]]  atomically:true];
+//        bool result =
+        [json writeToFile:[docDir stringByAppendingPathComponent:[NSString stringWithFormat:@"%@_%@_%@.json",type,subtype,RASingleton.sharedInstance.user]]  atomically:true];
         
 //        NSDictionary* dict = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:nil] ;
         return json;
@@ -423,7 +427,8 @@
 //            dict_user[@"deactive_functions"] = user_deactive;
 //            dict_user[@"active_functions"] = user_active;
             json_user =[RAConvertor dict2data:dict_user];
-            bool result =[json_user writeToFile:[docDir stringByAppendingPathComponent:[NSString stringWithFormat:@"FunctionPanel_%@.json",RASingleton.sharedInstance.user]]  atomically:true];
+//            bool result =
+            [json_user writeToFile:[docDir stringByAppendingPathComponent:[NSString stringWithFormat:@"FunctionPanel_%@.json",RASingleton.sharedInstance.user]]  atomically:true];
         }
 
         return json_user;
@@ -433,9 +438,10 @@
         json=[RAConvertor dict2data:RASingleton.sharedInstance.functionPanel];
         
 //        json=[NSData dataWithContentsOfFile:[[NSBundle mainBundle]  pathForResource:@"FunctionPanel" ofType:@"json" ]];
-        bool result =[json writeToFile:[docDir stringByAppendingPathComponent:[NSString stringWithFormat:@"FunctionPanel_%@.json",RASingleton.sharedInstance.user]]  atomically:true];
+//        bool result =
+        [json writeToFile:[docDir stringByAppendingPathComponent:[NSString stringWithFormat:@"FunctionPanel_%@.json",RASingleton.sharedInstance.user]]  atomically:true];
         
-        NSDictionary* dict = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:nil] ;
+//        NSDictionary* dict = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:nil] ;
         return json;
     }
     

+ 123 - 53
RA TradeFiling/RA TradeFiling/Detail/DetailPageViewController.m

@@ -25,6 +25,7 @@
 #import "MyQLPreviewController.h"
 #import "LPShareActivity.h"
 #import "RADataProvider.h"
+#import "RAUtils.h"
 //#import "AMCommEditCell.h"
 //#import "AMCommHeadCell.h"
 //#import "AMCommContentCell.h"
@@ -203,7 +204,7 @@
 
 - (void)viewWillAppear:(BOOL)animated {
     [super viewWillAppear:animated];
-    NSString *action_type = [self.params objectForKey:@"action_type"];
+//    NSString *action_type = [self.params objectForKey:@"action_type"];
 //    if ([action_type isEqualToString:@"Detail"]) { // 避免Tap与Tacking中Cell点击冲突
 //        [self startListenKeyboard];
 //    }
@@ -318,14 +319,22 @@
     //    self.nextpageButton.enabled=false;
     self.mum.center = self.view.center;
     __weak typeof(self) weakSelf = self;
-    NSTimeInterval animationDuration = 0.30f;
-    [UIView beginAnimations:@"ResizeView" context:nil];
-    [UIView setAnimationDuration:animationDuration];
     
-    self.mum.hidden = false;
-    self.table.hidden = true;
     
-    [UIView commitAnimations];
+    
+    [UIView animateWithDuration:0.3 animations:^{
+        self.mum.hidden = false;
+        self.table.hidden = true;
+    }];
+    
+    
+//    NSTimeInterval animationDuration = 0.30f;
+//    [UIView beginAnimations:@"ResizeView" context:nil];
+//    [UIView setAnimationDuration:animationDuration];
+//
+//
+//
+//    [UIView commitAnimations];
     
 //    if (self.showMap) {
 //        [self.params setObject:@(YES) forKey:@"request_location"];
@@ -340,11 +349,9 @@
         
          self.content=[RADataProvider json2DetailContent:result];
         
-        NSTimeInterval animationDuration = 0.30f;
-            [UIView beginAnimations:@"ResizeView" context:nil];
-            [UIView setAnimationDuration:animationDuration];
-            
-            
+        
+        
+        [UIView animateWithDuration:0.3 animations:^{
             self.mum.hidden = true;
             if(self.content.result_code!=RESULT_TRUE)
             {
@@ -399,7 +406,69 @@
                 self.email_subject = [self.content.originContent objectForKey:@"email_subject"];
                 self.email_content = [self.content.originContent objectForKey:@"email_content"];
             }
-            [UIView commitAnimations];
+        }];
+        
+        
+//        NSTimeInterval animationDuration = 0.30f;
+//            [UIView beginAnimations:@"ResizeView" context:nil];
+//            [UIView setAnimationDuration:animationDuration];
+//
+//
+//            self.mum.hidden = true;
+//            if(self.content.result_code!=RESULT_TRUE)
+//            {
+//
+//                self.table.hidden =false;
+//                [self.table reloadData];
+//                UIAlertController *alertVC = [UIAlertController alertControllerWithTitle: @"Warning"
+//                                                                                              message: self.content.err_msg
+//                                                                                       preferredStyle: UIAlertControllerStyleAlert];
+//                UIAlertAction *action_back = [UIAlertAction actionWithTitle:@"Back" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
+//                    [weakSelf.navigationController popViewControllerAnimated:false];
+//                }];
+//                UIAlertAction *action_reload = [UIAlertAction actionWithTitle:@"Reload" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+//                    [weakSelf ReloadData];
+//                }];
+//                [alertVC addAction:action_back];
+//                [alertVC addAction:action_reload];
+//                [weakSelf presentViewController:alertVC animated:YES completion:nil];
+//            }
+//            else
+//            if([self.content get_segmentcount]==0)
+//            {
+//
+//
+//                self.table.hidden =true;
+//                self.norecordLabel.hidden=false;
+//
+//                if(self.tabBarController.childViewControllers.count==1)
+//                {
+//                    UIAlertController *alertVC = [UIAlertController alertControllerWithTitle: @"Warning"
+//                                                                                                  message: @"No Search Result."
+//                                                                                           preferredStyle: UIAlertControllerStyleAlert];
+//                    UIAlertAction *action = [UIAlertAction actionWithTitle:@"Back" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+//                        [weakSelf.navigationController popViewControllerAnimated:false];
+//                    }];
+//                    [alertVC addAction:action];
+//                    [weakSelf presentViewController:alertVC animated:YES completion:nil];
+//
+//                }
+//
+//
+//
+//            }
+//            else
+//            {
+//
+//                self.page_menu = result[@"page_menu"];
+//                self.table.hidden =false;
+//                [self.table reloadData];
+//
+//                self.email = [self.content.originContent objectForKey:@"email"];
+//                self.email_subject = [self.content.originContent objectForKey:@"email_subject"];
+//                self.email_content = [self.content.originContent objectForKey:@"email_content"];
+//            }
+//            [UIView commitAnimations];
             
 //            NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
 //            bool autologin =[defaults boolForKey:@"autologin"];
@@ -411,18 +480,18 @@
 //                }];
 //            }
             // 设置默认选中第一个Container
-            for (NSInteger i = 0; i < self.content.segments.count; i++) {
-                
-                NSMutableDictionary* segment = [self.content.segments[i] mutableCopy];
-                NSString* type =[segment valueForKey:@"_type"];
-                
-//                if([type isEqualToString:@"tracking"]) {
-//                    NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:i];
-//                    [self.table selectRowAtIndexPath:indexPath animated:NO scrollPosition:UITableViewScrollPositionNone];
-//                    [self tableView:self.table didSelectRowAtIndexPath:indexPath];
-//                    break;
-//                }
-            }
+//            for (NSInteger i = 0; i < self.content.segments.count; i++) {
+//
+//                NSMutableDictionary* segment = [self.content.segments[i] mutableCopy];
+//                NSString* type =[segment valueForKey:@"_type"];
+//
+////                if([type isEqualToString:@"tracking"]) {
+////                    NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:i];
+////                    [self.table selectRowAtIndexPath:indexPath animated:NO scrollPosition:UITableViewScrollPositionNone];
+////                    [self tableView:self.table didSelectRowAtIndexPath:indexPath];
+////                    break;
+////                }
+//            }
     }];
     
     
@@ -588,7 +657,7 @@
     UIViewController *customVC     = [[UIViewController alloc] init];
     
     
-    UIActivityIndicatorView* spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
+    UIActivityIndicatorView* spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleLarge];
     spinner.color = [UIColor darkGrayColor];
     [spinner startAnimating];
     [customVC.view addSubview:spinner];
@@ -814,28 +883,28 @@
 
 #pragma mark - Section Switch
 
-- (void)sectionSwitchClick:(UIButton *)sender {
-    NSInteger section = sender.tag - 1020;
-    
-    NSMutableArray *segments = [self.content.segments mutableCopy];
-    NSMutableDictionary* segment = [self.content.segments[section] mutableCopy];
-    NSString* type =[segment valueForKey:@"_type"];
-//    if([type isEqualToString:@"tracking"])
-//    {
-//        BOOL close = [[segment objectForKey:@"close"] boolValue];
+//- (void)sectionSwitchClick:(UIButton *)sender {
+////    NSInteger section = sender.tag - 1020;
 //
-//        if (!close) {
-//            close = YES;
-//        } else {
-//            close = NO;
-//        }
-//        [segment setValue:@(close) forKey:@"close"];
-//        segments[section] = segment;
-//        self.content.segments = segments;
-////        [self.table reloadSections:[NSIndexSet indexSetWithIndex:section] withRowAnimation:UITableViewRowAnimationNone];
-//        [self.table reloadData];
-//    }
-}
+////    NSMutableArray *segments = [self.content.segments mutableCopy];
+////    NSMutableDictionary* segment = [self.content.segments[section] mutableCopy];
+////    NSString* type =[segment valueForKey:@"_type"];
+////    if([type isEqualToString:@"tracking"])
+////    {
+////        BOOL close = [[segment objectForKey:@"close"] boolValue];
+////
+////        if (!close) {
+////            close = YES;
+////        } else {
+////            close = NO;
+////        }
+////        [segment setValue:@(close) forKey:@"close"];
+////        segments[section] = segment;
+////        self.content.segments = segments;
+//////        [self.table reloadSections:[NSIndexSet indexSetWithIndex:section] withRowAnimation:UITableViewRowAnimationNone];
+////        [self.table reloadData];
+////    }
+//}
 
 - (void)copyTap:(UITapGestureRecognizer *)tap {
     UILabel *lb = (UILabel *)tap.view;
@@ -1217,8 +1286,8 @@
 
 - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
     
-    NSMutableDictionary* segment = [self.content.segments[section] mutableCopy];
-    NSString* type =[segment valueForKey:@"_type"];
+//    NSMutableDictionary* segment = [self.content.segments[section] mutableCopy];
+//    NSString* type =[segment valueForKey:@"_type"];
 
     CGFloat w = tableView.frame.size.width;
     UIView *header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, w, 30)];
@@ -1925,7 +1994,8 @@
     UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:@[share]];
     //    _activityViewController = activityViewController;
     //    activityViewController.excludedActivityTypes = @[UIActivityTypeMail];
-    activityViewController.modalInPopover = true;
+//    activityViewController.modalInPopover = true;
+    activityViewController.modalInPresentation = true;
     [self presentViewController:activityViewController animated:YES completion:nil];
     
     // 选中分享类型
@@ -1948,9 +2018,9 @@
     UIAlertController *menuAlert = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
     
     __weak typeof(self) weakSelf = self;
-    UIAlertAction *saveAction = [UIAlertAction actionWithTitle:@"Save Document" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
-        [weakSelf saveDocument];
-    }];
+//    UIAlertAction *saveAction = [UIAlertAction actionWithTitle:@"Save Document" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+//        [weakSelf saveDocument];
+//    }];
     UIAlertAction *shareAction = [UIAlertAction actionWithTitle:@"Share Document" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
         [weakSelf shareDocument];
     }];

+ 2 - 1
RA TradeFiling/RA TradeFiling/Detail/DetailTabBarController.m

@@ -546,7 +546,8 @@
     // 服务类型控制器
     UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:@[detailItem] applicationActivities:@[share]];
     activityViewController.excludedActivityTypes = @[UIActivityTypeMail];
-    activityViewController.modalInPopover = true;
+//    activityViewController.modalInPopover = true;
+    activityViewController.modalInPresentation = true;
     [self presentViewController:activityViewController animated:YES completion:nil];
     
     // 选中分享类型

+ 1 - 0
RA TradeFiling/RA TradeFiling/Home/CompanySelectViewController.m

@@ -8,6 +8,7 @@
 #import "CompanySelectViewController.h"
 #import "RASingleton.h"
 #import "const.h"
+#import "RAUtils.h"
 @interface CompanySelectViewController ()
 
 @end

+ 1 - 1
RA TradeFiling/RA TradeFiling/Home/FunctionSettingViewController.h

@@ -15,7 +15,7 @@ NS_ASSUME_NONNULL_BEGIN
 @property (strong,nonatomic) NSMutableArray * active_functions;
 @property (strong,nonatomic) NSMutableArray * deactive_functions;
 @property NSUInteger taptime;
-@property NSIndexPath* lasttap;
+@property (strong,nonatomic,nullable)NSIndexPath* lasttap;
 
 
 @property (nonatomic , copy) void (^onSave)(NSArray* functions);

+ 2 - 1
RA TradeFiling/RA TradeFiling/Home/FunctionSettingViewController.m

@@ -145,7 +145,8 @@
     
     json=[RAConvertor dict2data:dict];
     
-    bool result =[json writeToFile:[docDir stringByAppendingPathComponent:[NSString stringWithFormat:@"FunctionPanel_%@.json",RASingleton.sharedInstance.user]]  atomically:true];
+//    bool result =
+    [json writeToFile:[docDir stringByAppendingPathComponent:[NSString stringWithFormat:@"FunctionPanel_%@.json",RASingleton.sharedInstance.user]]  atomically:true];
     
     if(self.onSave)
         self.onSave(self.active_functions);

+ 2 - 2
RA TradeFiling/RA TradeFiling/Home/RAHomeHeaderView.h

@@ -8,7 +8,7 @@
 
 #import <UIKit/UIKit.h>
 
-@protocol RAHomeHeaderDelegate <NSObject,UICollectionViewDelegate,UICollectionViewDataSource>
+@protocol RAHomeHeaderDelegate <NSObject>
 
 @optional
 //- (void)signoutClick:(UIButton *)sender;
@@ -23,7 +23,7 @@
 
 @end
 
-@interface RAHomeHeaderView : UIView
+@interface RAHomeHeaderView : UIView<UICollectionViewDelegate,UICollectionViewDataSource>
 @property (weak, nonatomic) IBOutlet UIButton *btnCompany;
 
 @property (weak, nonatomic) IBOutlet UILabel *labelTotal;

+ 3 - 3
RA TradeFiling/RA TradeFiling/Home/RAHomeViewController.h

@@ -66,13 +66,13 @@
 - (ResultBaseModel *)dashModelForIndexPath:(NSIndexPath *)indexPath ;
 - (NSString *)titleForSection:(NSInteger)section;
 - (BOOL)hasMoreOrderForSection:(NSInteger)section;
-- (NSInteger)backendCountForSection:(NSInteger)section;
+//- (NSInteger)backendCountForSection:(NSInteger)section;
 
 #pragma mark - Set/Update
 
-- (void)setBackendFlagCount:(NSInteger)count forSection:(NSInteger)section;
+//- (void)setBackendFlagCount:(NSInteger)count forSection:(NSInteger)section;
 
-- (void)decreaseBackendFlagCountForSection:(NSInteger)section;
+//- (void)decreaseBackendFlagCountForSection:(NSInteger)section;
 
 - (void)setHeaderDelegate:(id<RAHomeSectionModelDelegate>) delegate forSection:(NSInteger)section;
 

+ 3 - 1
RA TradeFiling/RA TradeFiling/Home/RAHomeViewController.m

@@ -383,9 +383,11 @@
 //    {
 //        [self.tableView reloadData];
 //    };
+    
+    __block typeof(self) blockself = self;
     self.headerView.onSetCompany=^(void)
     {
-        [self loadData];
+        [blockself loadData];
     };
     self.headerView.delegate = self;
     self.tableView.tableHeaderView = self.headerView;

+ 22 - 10
RA TradeFiling/RA TradeFiling/Login/LoginViewController.m

@@ -14,6 +14,7 @@
 #import "RASingleton.h"
 #import "SignupViewController.h"
 #import "TFNavigationController.h"
+#import "RAUtils.h"
 @interface LoginViewController ()
 @property (strong, nonatomic) IBOutlet UILabel *verLabel;
 
@@ -267,12 +268,12 @@
     
     NSString *docDir = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject];
 
-    NSLog(docDir);
+    NSLog(@"%@",docDir);
     
     
     NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
     NSString *documents = [paths objectAtIndex:0];
-    NSLog(documents);
+    NSLog(@"%@",documents);
     
     
     [self.checkSavePassword setImage:[UIImage imageNamed:@"checkbox_unchecked_30.png"] forState:UIControlStateNormal];
@@ -379,10 +380,16 @@
         frame.origin.y -=self.ioffset;//view的Y轴上移
         frame.size.height +=self.ioffset; //View的高度增加
         self.view.frame = frame;
-        [UIView beginAnimations:@"ResizeView" context:nil];
-        [UIView setAnimationDuration:animationDuration];
-        self.view.frame = frame;
-        [UIView commitAnimations];//设置调整界面的动画效果
+        
+        
+        [UIView animateWithDuration:animationDuration animations:^{
+            self.view.frame = frame;
+        }];
+        
+//        [UIView beginAnimations:@"ResizeView" context:nil];
+//        [UIView setAnimationDuration:animationDuration];
+//        self.view.frame = frame;
+//        [UIView commitAnimations];//设置调整界面的动画效果
     }
 }
 
@@ -409,10 +416,15 @@
         self.view.frame = frame;
         //    }
         //self.view移回原位置
-        [UIView beginAnimations:@"ResizeView" context:nil];
-        [UIView setAnimationDuration:animationDuration];
-        self.view.frame = frame;
-        [UIView commitAnimations];
+        
+        [UIView animateWithDuration:animationDuration animations:^{
+            self.view.frame = frame;
+        }];
+        
+//        [UIView beginAnimations:@"ResizeView" context:nil];
+//        [UIView setAnimationDuration:animationDuration];
+//        self.view.frame = frame;
+//        [UIView commitAnimations];
         [textField resignFirstResponder];
         self.ioffset=0;
     }

+ 1 - 1
RA TradeFiling/RA TradeFiling/My/ChangePasswordViewController.m

@@ -58,7 +58,7 @@
     NSString* newpass = self.editNew.text;
     NSString* confirmpass = self.editConfirm.text;
 //    AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
-    NSString* user = RASingleton.sharedInstance.user;
+//    NSString* user = RASingleton.sharedInstance.user;
     if(oldpass.length==0||oldpass.length==0||confirmpass.length==0)
     {
         

+ 5 - 2
RA TradeFiling/RA TradeFiling/My/SavedDetailViewController.m

@@ -11,6 +11,7 @@
 #import "RASingleton.h"
 #import "const.h"
 #import "DetailTabBarController.h"
+#import "RAUtils.h"
 @interface SavedDetailViewController ()
 
 @end
@@ -105,7 +106,8 @@
         NSString *docDir = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject];
            
            NSData* json_user =[RAConvertor arr2data:self.data];
-           bool result =[json_user writeToFile:[docDir stringByAppendingPathComponent:[NSString stringWithFormat:@"%@_%@.json",@"saved_detail",RASingleton.sharedInstance.user]]  atomically:true];
+//           bool result =
+        [json_user writeToFile:[docDir stringByAppendingPathComponent:[NSString stringWithFormat:@"%@_%@.json",@"saved_detail",RASingleton.sharedInstance.user]]  atomically:true];
            
         
         
@@ -243,7 +245,8 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle  forRowAtIndexPath:
     NSString *docDir = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject];
        
        NSData* json_user =[RAConvertor arr2data:self.data];
-       bool result =[json_user writeToFile:[docDir stringByAppendingPathComponent:[NSString stringWithFormat:@"%@_%@.json",@"saved_detail",RASingleton.sharedInstance.user]]  atomically:true];
+//       bool result =
+    [json_user writeToFile:[docDir stringByAppendingPathComponent:[NSString stringWithFormat:@"%@_%@.json",@"saved_detail",RASingleton.sharedInstance.user]]  atomically:true];
        
     
     

+ 5 - 2
RA TradeFiling/RA TradeFiling/My/SavedSearchViewController.m

@@ -12,6 +12,7 @@
 #import "RAConvertor.h"
 #import "RASingleton.h"
 #import "const.h"
+#import "RAUtils.h"
 @interface SavedSearchViewController ()
 
 @end
@@ -109,7 +110,8 @@
         NSString *docDir = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject];
            
            NSData* json_user =[RAConvertor arr2data:self.data];
-           bool result =[json_user writeToFile:[docDir stringByAppendingPathComponent:[NSString stringWithFormat:@"%@_%@.json",@"saved_search",RASingleton.sharedInstance.user]]  atomically:true];
+//           bool result =
+        [json_user writeToFile:[docDir stringByAppendingPathComponent:[NSString stringWithFormat:@"%@_%@.json",@"saved_search",RASingleton.sharedInstance.user]]  atomically:true];
            
         
         
@@ -255,7 +257,8 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle  forRowAtIndexPath:
     NSString *docDir = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject];
        
        NSData* json_user =[RAConvertor arr2data:self.data];
-       bool result =[json_user writeToFile:[docDir stringByAppendingPathComponent:[NSString stringWithFormat:@"%@_%@.json",@"saved_search",RASingleton.sharedInstance.user]]  atomically:true];
+//       bool result =
+    [json_user writeToFile:[docDir stringByAppendingPathComponent:[NSString stringWithFormat:@"%@_%@.json",@"saved_search",RASingleton.sharedInstance.user]]  atomically:true];
     [tableView reloadData];
     
 }

+ 5 - 5
RA TradeFiling/RA TradeFiling/RASingleton.h

@@ -54,9 +54,9 @@ typedef enum {
 
 - (void)saveUserInfo;
 
-- (NSString *)savedUser;
+//- (NSString *)savedUser;
 
-- (NSString *)savedPassword;
+//- (NSString *)savedPassword;
 
 - (void)login:(NSString *)user password:(NSString *)password firstName:(NSString *)firstName companyList:(NSArray*) companylist functions:(NSDictionary*)function_panel active:(bool) active;
 - (void)changePassword:(NSString *)newpassword ;
@@ -65,15 +65,15 @@ typedef enum {
 
 - (void)logout;
 
-- (void)loadSavedReuqiredLocation;
+//- (void)loadSavedReuqiredLocation;
 
 - (NSString *)encryptString:(NSString *)str;
 
 - (NSString *)decryptString:(NSString *)str;
 
-- (void)writeLog:(NSString *)log;
+//- (void)writeLog:(NSString *)log;
 
-- (void)saveLogs;
+//- (void)saveLogs;
 
 - (id)globalParameterForKey:(NSString *)key;
 

+ 6 - 6
RA TradeFiling/RA TradeFiling/Result/ResultACICell.h

@@ -12,12 +12,12 @@ NS_ASSUME_NONNULL_BEGIN
 @interface ResultACICell : UITableViewCell
 @property (nonatomic,class,readonly,copy) NSString *identifier;
 
-- (instancetype)setHBCCN:(NSString *)hbccn;
-- (instancetype)setPrimaryCCN:(NSString *)primary_ccn;
-- (instancetype)setTime:(NSString *)time;
-- (instancetype)setLastAction:(NSString *)desc;
-- (instancetype)setLog:(NSString *)log;
-- (instancetype)setIcon:(NSString *)icon;
+- (instancetype)setHBCCN:(nullable NSString *)hbccn;
+- (instancetype)setPrimaryCCN:(nullable NSString *)primary_ccn;
+- (instancetype)setTime:(nullable NSString *)time;
+- (instancetype)setLastAction:(nullable NSString *)desc;
+- (instancetype)setLog:(nullable NSString *)log;
+- (instancetype)setIcon:(nullable NSString *)icon;
 - (instancetype)setIconSelect:(BOOL)select;
 //- (instancetype)setConsignee:(NSString *)consignee;
 

+ 6 - 6
RA TradeFiling/RA TradeFiling/Result/ResultACICell.m

@@ -80,32 +80,32 @@
 
 #pragma mark - Setter
 
-- (instancetype)setHBCCN:(NSString *)hbccn{
+- (instancetype)setHBCCN:(nullable NSString *)hbccn{
     self.hbolLabel.text = hbccn;
     return self;
 }
 
-- (instancetype)setPrimaryCCN:(NSString *)primary_ccn{
+- (instancetype)setPrimaryCCN:(nullable NSString *)primary_ccn{
     self.mbolLabel.text = primary_ccn;
     return self;
 }
 
-- (instancetype)setTime:(NSString *)time {
+- (instancetype)setTime:(nullable NSString *)time {
     self.timeLabel.text = time;
     return self;
 }
 
-- (instancetype)setLastAction:(NSString *)desc {
+- (instancetype)setLastAction:(nullable NSString *)desc {
     self.lastactionLabel.text = desc;
     return self;
 }
 
-- (instancetype)setLog:(NSString *)log {
+- (instancetype)setLog:(nullable NSString *)log {
     self.logLabel.text = [log stringByReplacingOccurrencesOfString:@"," withString:@", "];
     return self;
 }
 
-- (instancetype)setIcon:(NSString *)icon {
+- (instancetype)setIcon:(nullable NSString *)icon {
     
     if (icon) {
         self.iconView.image = [[UIImage imageNamed:icon] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

+ 4 - 4
RA TradeFiling/RA TradeFiling/Result/ResultCustomerCell.h

@@ -13,10 +13,10 @@ NS_ASSUME_NONNULL_BEGIN
 
 @property (nonatomic,class,readonly,copy) NSString *identifier;
 
-- (instancetype)setCompany:(NSString *)company;
-- (instancetype)setContactID:(NSString *)contactid;
-- (instancetype)setAddress:(NSString *)address;
-- (instancetype)setIcon:(NSString *)icon;
+- (instancetype)setCompany:(nullable NSString *)company;
+- (instancetype)setContactID:(nullable NSString *)contactid;
+- (instancetype)setAddress:(nullable NSString *)address;
+- (instancetype)setIcon:(nullable NSString *)icon;
 - (instancetype)setIconSelect:(BOOL)select;
 - (instancetype)addAdditionName:(NSString *)name value:(NSString *)value;
 @end

+ 7 - 7
RA TradeFiling/RA TradeFiling/Result/ResultISFCell.h

@@ -12,15 +12,15 @@ NS_ASSUME_NONNULL_BEGIN
 @interface ResultISFCell : UITableViewCell
 @property (nonatomic,class,readonly,copy) NSString *identifier;
 
-- (instancetype)setBOL:(NSString *)bol;
-- (instancetype)setISFType:(NSString *)isftype;
+- (instancetype)setBOL:(nullable NSString *)bol;
+- (instancetype)setISFType:(nullable NSString *)isftype;
 //- (instancetype)setTime:(NSString *)time;
-- (instancetype)setTransactionNo:(NSString *)transactionno;
-- (instancetype)setLog:(NSString *)log;
-- (instancetype)setIcon:(NSString *)icon;
+- (instancetype)setTransactionNo:(nullable NSString *)transactionno;
+- (instancetype)setLog:(nullable NSString *)log;
+- (instancetype)setIcon:(nullable NSString *)icon;
 - (instancetype)setIconSelect:(BOOL)select;
-- (instancetype)setConsignee:(NSString *)consignee;
-- (instancetype)setImportNo:(NSString *)import_no;
+- (instancetype)setConsignee:(nullable NSString *)consignee;
+- (instancetype)setImportNo:(nullable NSString *)import_no;
 - (instancetype)addAdditionName:(NSString *)name value:(NSString *)value;
 @end
 

+ 1 - 1
RA TradeFiling/RA TradeFiling/Result/ResultPresenter.m

@@ -408,7 +408,7 @@ static const NSInteger detal = 20;
 
 - (void)saveSearchParameters:(NSString *)name {
 //    AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
-    NSString* user = RASingleton.sharedInstance.user;
+//    NSString* user = RASingleton.sharedInstance.user;
     
     
     NSString *module_name = [self.params objectForKey:@"sub_type"];

+ 1 - 1
RA TradeFiling/RA TradeFiling/Result/ResultViewController+QuickLook.m

@@ -154,7 +154,7 @@
     UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:@[share]];
 //    _activityViewController = activityViewController;
 //    activityViewController.excludedActivityTypes = @[UIActivityTypeMail];
-    activityViewController.modalInPopover = true;
+    activityViewController.modalInPresentation = true;
     
     // 选中分享类型
     [activityViewController setCompletionWithItemsHandler:^(NSString * __nullable activityType, BOOL completed, NSArray * __nullable returnedItems, NSError * __nullable activityError){

+ 1 - 0
RA TradeFiling/RA TradeFiling/Result/ResultViewController+TableDataSource.m

@@ -190,6 +190,7 @@
 //            [[[[cell setFileName:docModel.fileName] setFileType:docModel.fileType] setFilePO:docModel.po] setFileBOL:docModel.bol];
 //            return cell;
 //        }
+        default:
             break;
     }
     

+ 5 - 3
RA TradeFiling/RA TradeFiling/Search/MyAutocompleteView.m

@@ -1,7 +1,7 @@
 
 
 #import "MyAutocompleteView.h"
-
+#import "RAUtils.h"
 
 @interface MyAutocompleteView () <UITableViewDelegate, UITableViewDataSource>
 
@@ -101,12 +101,14 @@ parentView:(UIView*) view
 
     CGFloat contextViewHeight = 0;
     CGFloat kbHeight = 0;
-    if (UIInterfaceOrientationIsPortrait([UIApplication sharedApplication].statusBarOrientation))
+    UIInterfaceOrientation orientation =[RAUtils query_orientation:[RAUtils getViewController:self]];//
+    
+    if (UIInterfaceOrientationIsPortrait(orientation))
     {
         contextViewHeight = _parentView.frame.size.height;//_contextController.view.frame.size.height;
         kbHeight = kbSize.height;
     }
-    else if (UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation))
+    else if (UIInterfaceOrientationIsLandscape(orientation))
     {
         contextViewHeight =_parentView.frame.size.width;// _contextController.view.frame.size.width;
         kbHeight = kbSize.width;

+ 1 - 1
RA TradeFiling/RA TradeFiling/Search/SearchTableAdapterJson.m

@@ -42,7 +42,7 @@
 -(void)initfields : (NSString*)type subtype:(NSString*)subtype
 {
     
-    NSString *docDir = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject];
+//    NSString *docDir = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject];
     
 //    NSData* json_user =[NSData dataWithContentsOfFile:[docDir stringByAppendingPathComponent:[NSString stringWithFormat:@"%@_%@_%@.json",type,subtype,RASingleton.sharedInstance.user]]];
 //

+ 1 - 1
RA TradeFiling/RA TradeFiling/Search/SearchViewController.m

@@ -17,7 +17,7 @@
 #import "MyAutocompleteView.h"
 //#import "AMResultViewController.h"
 #import "ResultViewController.h"
-
+#import "RAUtils.h"
 @interface SearchViewController () <UISearchBarDelegate>
 @property (strong,nonatomic) SearchTableAdapterJson* adapter ;
 @property (strong, nonatomic) IBOutlet UISearchBar *searchaBar;

+ 4 - 4
RA TradeFiling/RA TradeFiling/SignUp/SignupViewController.m

@@ -76,8 +76,8 @@
     
     
     NSError *error = nil;
-    NSDataDetector *detector =
-       [NSDataDetector dataDetectorWithTypes:NSTextCheckingTypeLink error:&error];
+//    NSDataDetector *detector =
+//       [NSDataDetector dataDetectorWithTypes:NSTextCheckingTypeLink error:&error];
 
     NSString *email = self.tf_email.text.lowercaseString;
    
@@ -257,7 +257,7 @@
     keyboardRect = [self.view convertRect:keyboardRect fromView:self.view.window];//获取键盘相对于self.view的frame ,传window和传nil是一样的
     CGFloat keyboardTop = keyboardRect.origin.y;
     NSNumber * animationDurationValue = [userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey];//获取键盘弹出动画时间值
-    NSTimeInterval animationDuration = [animationDurationValue doubleValue];
+//    NSTimeInterval animationDuration = [animationDurationValue doubleValue];
     if (keyboardTop < CGRectGetMaxY(rect)) {//如果键盘盖住了输入框
         CGFloat gap = keyboardTop - CGRectGetMaxY(rect) - 10;//计算需要网上移动的偏移量(输入框底部离键盘顶部为10的间距)
         _offset = _offset+gap;
@@ -272,7 +272,7 @@
 - (void)keyboardWillHide:(NSNotification *)notification{
     NSDictionary *userInfo = [notification userInfo];
     NSNumber * animationDurationValue = [userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey];//获取键盘隐藏动画时间值
-    NSTimeInterval animationDuration = [animationDurationValue doubleValue];
+//    NSTimeInterval animationDuration = [animationDurationValue doubleValue];
     if (self.view.frame.origin.y < 0) {//如果有偏移,当影藏键盘的时候就复原
         _offset = 0;
         self.view.frame = CGRectMake(self.view.frame.origin.x, self.y, self.view.frame.size.width, self.view.frame.size.height);

+ 4 - 4
RA TradeFiling/RA TradeFiling/TFEditor/TFEditorViewController.m

@@ -389,13 +389,13 @@
     UITableViewCell *cell =(UITableViewCell*)v;//(UITableViewCell *) sender.superview.superview.superview;
     NSIndexPath *   indexPath = [self.editorTable indexPathForCell:cell];
 //    int refresh =0;
-    NSMutableDictionary* section_json=nil;
+//    NSMutableDictionary* section_json=nil;
 
     NSMutableDictionary* item_json =[((NSMutableArray*)self.content_data_control[indexPath.section])[indexPath.row] mutableCopy];
-    NSString* subid=[item_json valueForKey:@"subid"];
-    NSString* refresh_trigger = [item_json valueForKey:@"name"];
+//    NSString* subid=[item_json valueForKey:@"subid"];
+//    NSString* refresh_trigger = [item_json valueForKey:@"name"];
     NSDictionary* sub_action = [item_json objectForKey:[NSString stringWithFormat:@"item_%ld",(long)sender.tag]];
-    NSString* type = [sub_action valueForKey:@"type"];
+//    NSString* type = [sub_action valueForKey:@"type"];
     {
         
         NSDictionary * item_json = sub_action;

+ 0 - 91
RedAnt ERP Mobile/HMLG Mobile.xcodeproj/xcuserdata/Ray.xcuserdatad/xcschemes/HMLG Mobile.xcscheme

@@ -1,91 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<Scheme
-   LastUpgradeVersion = "1020"
-   version = "1.3">
-   <BuildAction
-      parallelizeBuildables = "YES"
-      buildImplicitDependencies = "YES">
-      <BuildActionEntries>
-         <BuildActionEntry
-            buildForTesting = "YES"
-            buildForRunning = "YES"
-            buildForProfiling = "YES"
-            buildForArchiving = "YES"
-            buildForAnalyzing = "YES">
-            <BuildableReference
-               BuildableIdentifier = "primary"
-               BlueprintIdentifier = "7183E8431CF2913E00524787"
-               BuildableName = "HMLG Mobile.app"
-               BlueprintName = "HMLG Mobile"
-               ReferencedContainer = "container:HMLG Mobile.xcodeproj">
-            </BuildableReference>
-         </BuildActionEntry>
-      </BuildActionEntries>
-   </BuildAction>
-   <TestAction
-      buildConfiguration = "Debug"
-      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
-      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
-      shouldUseLaunchSchemeArgsEnv = "YES">
-      <Testables>
-      </Testables>
-      <MacroExpansion>
-         <BuildableReference
-            BuildableIdentifier = "primary"
-            BlueprintIdentifier = "7183E8431CF2913E00524787"
-            BuildableName = "HMLG Mobile.app"
-            BlueprintName = "HMLG Mobile"
-            ReferencedContainer = "container:HMLG Mobile.xcodeproj">
-         </BuildableReference>
-      </MacroExpansion>
-      <AdditionalOptions>
-      </AdditionalOptions>
-   </TestAction>
-   <LaunchAction
-      buildConfiguration = "Debug"
-      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
-      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
-      launchStyle = "0"
-      useCustomWorkingDirectory = "NO"
-      ignoresPersistentStateOnLaunch = "NO"
-      debugDocumentVersioning = "YES"
-      debugServiceExtension = "internal"
-      allowLocationSimulation = "YES">
-      <BuildableProductRunnable
-         runnableDebuggingMode = "0">
-         <BuildableReference
-            BuildableIdentifier = "primary"
-            BlueprintIdentifier = "7183E8431CF2913E00524787"
-            BuildableName = "HMLG Mobile.app"
-            BlueprintName = "HMLG Mobile"
-            ReferencedContainer = "container:HMLG Mobile.xcodeproj">
-         </BuildableReference>
-      </BuildableProductRunnable>
-      <AdditionalOptions>
-      </AdditionalOptions>
-   </LaunchAction>
-   <ProfileAction
-      buildConfiguration = "Release"
-      shouldUseLaunchSchemeArgsEnv = "YES"
-      savedToolIdentifier = ""
-      useCustomWorkingDirectory = "NO"
-      debugDocumentVersioning = "YES">
-      <BuildableProductRunnable
-         runnableDebuggingMode = "0">
-         <BuildableReference
-            BuildableIdentifier = "primary"
-            BlueprintIdentifier = "7183E8431CF2913E00524787"
-            BuildableName = "HMLG Mobile.app"
-            BlueprintName = "HMLG Mobile"
-            ReferencedContainer = "container:HMLG Mobile.xcodeproj">
-         </BuildableReference>
-      </BuildableProductRunnable>
-   </ProfileAction>
-   <AnalyzeAction
-      buildConfiguration = "Debug">
-   </AnalyzeAction>
-   <ArchiveAction
-      buildConfiguration = "Release"
-      revealArchiveInOrganizer = "YES">
-   </ArchiveAction>
-</Scheme>

+ 0 - 22
RedAnt ERP Mobile/HMLG Mobile.xcodeproj/xcuserdata/Ray.xcuserdatad/xcschemes/xcschememanagement.plist

@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>SchemeUserState</key>
-	<dict>
-		<key>HMLG Mobile.xcscheme</key>
-		<dict>
-			<key>orderHint</key>
-			<integer>1</integer>
-		</dict>
-	</dict>
-	<key>SuppressBuildableAutocreation</key>
-	<dict>
-		<key>7183E8431CF2913E00524787</key>
-		<dict>
-			<key>primary</key>
-			<true/>
-		</dict>
-	</dict>
-</dict>
-</plist>

+ 0 - 98
RedAnt ERP Mobile/HMLG Mobile.xcodeproj/xcuserdata/macmini1.xcuserdatad/xcschemes/HMLG Mobile.xcscheme

@@ -1,98 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<Scheme
-   LastUpgradeVersion = "0730"
-   version = "1.3">
-   <BuildAction
-      parallelizeBuildables = "YES"
-      buildImplicitDependencies = "YES">
-      <BuildActionEntries>
-         <BuildActionEntry
-            buildForTesting = "YES"
-            buildForRunning = "YES"
-            buildForProfiling = "YES"
-            buildForArchiving = "YES"
-            buildForAnalyzing = "YES">
-            <BuildableReference
-               BuildableIdentifier = "primary"
-               BlueprintIdentifier = "7183E8431CF2913E00524787"
-               BuildableName = "HMLG Mobile.app"
-               BlueprintName = "HMLG Mobile"
-               ReferencedContainer = "container:HMLG Mobile.xcodeproj">
-            </BuildableReference>
-         </BuildActionEntry>
-      </BuildActionEntries>
-   </BuildAction>
-   <TestAction
-      buildConfiguration = "Debug"
-      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
-      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
-      shouldUseLaunchSchemeArgsEnv = "YES">
-      <Testables>
-      </Testables>
-      <MacroExpansion>
-         <BuildableReference
-            BuildableIdentifier = "primary"
-            BlueprintIdentifier = "7183E8431CF2913E00524787"
-            BuildableName = "HMLG Mobile.app"
-            BlueprintName = "HMLG Mobile"
-            ReferencedContainer = "container:HMLG Mobile.xcodeproj">
-         </BuildableReference>
-      </MacroExpansion>
-      <AdditionalOptions>
-      </AdditionalOptions>
-   </TestAction>
-   <LaunchAction
-      buildConfiguration = "Debug"
-      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
-      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
-      launchStyle = "0"
-      useCustomWorkingDirectory = "NO"
-      ignoresPersistentStateOnLaunch = "NO"
-      debugDocumentVersioning = "YES"
-      debugServiceExtension = "internal"
-      allowLocationSimulation = "YES">
-      <BuildableProductRunnable
-         runnableDebuggingMode = "0">
-         <BuildableReference
-            BuildableIdentifier = "primary"
-            BlueprintIdentifier = "7183E8431CF2913E00524787"
-            BuildableName = "HMLG Mobile.app"
-            BlueprintName = "HMLG Mobile"
-            ReferencedContainer = "container:HMLG Mobile.xcodeproj">
-         </BuildableReference>
-      </BuildableProductRunnable>
-      <EnvironmentVariables>
-         <EnvironmentVariable
-            key = "OS_ACTIVITY_MODE"
-            value = "disable"
-            isEnabled = "YES">
-         </EnvironmentVariable>
-      </EnvironmentVariables>
-      <AdditionalOptions>
-      </AdditionalOptions>
-   </LaunchAction>
-   <ProfileAction
-      buildConfiguration = "Release"
-      shouldUseLaunchSchemeArgsEnv = "YES"
-      savedToolIdentifier = ""
-      useCustomWorkingDirectory = "NO"
-      debugDocumentVersioning = "YES">
-      <BuildableProductRunnable
-         runnableDebuggingMode = "0">
-         <BuildableReference
-            BuildableIdentifier = "primary"
-            BlueprintIdentifier = "7183E8431CF2913E00524787"
-            BuildableName = "HMLG Mobile.app"
-            BlueprintName = "HMLG Mobile"
-            ReferencedContainer = "container:HMLG Mobile.xcodeproj">
-         </BuildableReference>
-      </BuildableProductRunnable>
-   </ProfileAction>
-   <AnalyzeAction
-      buildConfiguration = "Debug">
-   </AnalyzeAction>
-   <ArchiveAction
-      buildConfiguration = "Release"
-      revealArchiveInOrganizer = "YES">
-   </ArchiveAction>
-</Scheme>

+ 0 - 22
RedAnt ERP Mobile/HMLG Mobile.xcodeproj/xcuserdata/macmini1.xcuserdatad/xcschemes/xcschememanagement.plist

@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-	<key>SchemeUserState</key>
-	<dict>
-		<key>HMLG Mobile.xcscheme</key>
-		<dict>
-			<key>orderHint</key>
-			<integer>0</integer>
-		</dict>
-	</dict>
-	<key>SuppressBuildableAutocreation</key>
-	<dict>
-		<key>7183E8431CF2913E00524787</key>
-		<dict>
-			<key>primary</key>
-			<true/>
-		</dict>
-	</dict>
-</dict>
-</plist>

+ 6 - 2
RedAnt ERP Mobile/HMLG Scan Order.xcodeproj/project.pbxproj

@@ -483,6 +483,7 @@
 		3CD54A78282CF21D0073A15D /* ScanHomeViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ScanHomeViewController.m; sourceTree = "<group>"; };
 		3CD54A7A282CF4930073A15D /* ScanHomeCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ScanHomeCell.h; sourceTree = "<group>"; };
 		3CD54A7B282CF4930073A15D /* ScanHomeCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ScanHomeCell.m; sourceTree = "<group>"; };
+		3CD79F072A8B520A001751C2 /* HMLG Scan Order.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "HMLG Scan Order.entitlements"; sourceTree = "<group>"; };
 		3CDDB25A273A564200681F78 /* DefaultTableHeaderView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DefaultTableHeaderView.m; path = ../../common/customUI/commoneditor/DefaultTableHeaderView.m; sourceTree = "<group>"; };
 		3CDDB25B273A564200681F78 /* DefaultTableHeaderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DefaultTableHeaderView.h; path = ../../common/customUI/commoneditor/DefaultTableHeaderView.h; sourceTree = "<group>"; };
 		3CDDB25F273A597B00681F78 /* const.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = const.h; path = common/const.h; sourceTree = SOURCE_ROOT; };
@@ -1300,6 +1301,7 @@
 		713F76AF1929F4A7006A7305 /* HMLG Scan Order */ = {
 			isa = PBXGroup;
 			children = (
+				3CD79F072A8B520A001751C2 /* HMLG Scan Order.entitlements */,
 				3CBC872A2A4EBEDC00978758 /* ScanRefreshStock.h */,
 				3C4DA61D27B50199001EB44E /* Main.storyboard */,
 				3C7D31F127882A5F005EB380 /* OLO */,
@@ -2518,6 +2520,7 @@
 			buildSettings = {
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = NO;
+				CODE_SIGN_ENTITLEMENTS = "HMLG Scan Order/HMLG Scan Order.entitlements";
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				CURRENT_PROJECT_VERSION = 53397;
@@ -2537,7 +2540,7 @@
 					"$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib",
 					"$(PROJECT_DIR)/GoogleAnalytics/GoogleAnalytics/Libraries",
 				);
-				MARKETING_VERSION = 1.36;
+				MARKETING_VERSION = 1.38;
 				OTHER_LDFLAGS = (
 					"$(inherited)",
 					"-ObjC",
@@ -2567,6 +2570,7 @@
 			buildSettings = {
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = NO;
+				CODE_SIGN_ENTITLEMENTS = "HMLG Scan Order/HMLG Scan Order.entitlements";
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				CURRENT_PROJECT_VERSION = 53397;
@@ -2586,7 +2590,7 @@
 					"$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib",
 					"$(PROJECT_DIR)/GoogleAnalytics/GoogleAnalytics/Libraries",
 				);
-				MARKETING_VERSION = 1.36;
+				MARKETING_VERSION = 1.38;
 				OTHER_LDFLAGS = (
 					"$(inherited)",
 					"-ObjC",

+ 1 - 1
RedAnt ERP Mobile/HMLG Scan Order.xcodeproj/xcuserdata/ruizhang.xcuserdatad/xcschemes/xcschememanagement.plist

@@ -7,7 +7,7 @@
 		<key>HMLG Scan Order.xcscheme_^#shared#^_</key>
 		<dict>
 			<key>orderHint</key>
-			<integer>4</integer>
+			<integer>3</integer>
 		</dict>
 	</dict>
 </dict>

+ 2 - 2
RedAnt ERP Mobile/HMLG Scan Order/AppDelegate.h

@@ -8,9 +8,9 @@
 
 #import <UIKit/UIKit.h>
 #import "AppDelegateBase.h"
+#import <UserNotifications/UserNotifications.h>
 
-
-@interface AppDelegate : AppDelegateBase
+@interface AppDelegate : AppDelegateBase<UNUserNotificationCenterDelegate>
 
 
 @end

+ 225 - 0
RedAnt ERP Mobile/HMLG Scan Order/AppDelegate.m

@@ -7,11 +7,236 @@
 //
 
 #import "AppDelegate.h"
+#import "RAUtils.h"
+#import "RADataProvider.h"
+
 @implementation AppDelegate
 
 
 
 //@synthesize devices;
+-(void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
+{
+    RASingleton.sharedInstance.duid = [[[[NSString stringWithFormat:@"%@",deviceToken] substringWithRange:NSMakeRange(0, 72)] substringWithRange:NSMakeRange(1, 71)] stringByReplacingOccurrencesOfString:@" " withString:@""];
+    NSLog(@"regisger success:%@",RASingleton.sharedInstance.duid);
+    
+    
+    
+    
+    const unsigned *tokenBytes = (const unsigned *)[deviceToken bytes];
+           NSString *strToken = [NSString stringWithFormat:@"%08x%08x%08x%08x%08x%08x%08x%08x",
+                                 ntohl(tokenBytes[0]), ntohl(tokenBytes[1]), ntohl(tokenBytes[2]),
+                                 ntohl(tokenBytes[3]), ntohl(tokenBytes[4]), ntohl(tokenBytes[5]),
+                                 ntohl(tokenBytes[6]), ntohl(tokenBytes[7])];
+    NSLog(@">=ios13 My FINAL TOKEN is:%@", strToken);
+           
+    RASingleton.sharedInstance.duid =strToken;
+    //注册成功,将deviceToken保存到应用服务器数据库中
+}
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
+{
+    
+    BOOL RET= [super application:application didFinishLaunchingWithOptions:launchOptions];
+    //消息推送注册
+    UNUserNotificationCenter * center = [UNUserNotificationCenter currentNotificationCenter];
+    [center setDelegate:self];
+    UNAuthorizationOptions type = UNAuthorizationOptionBadge|UNAuthorizationOptionSound|UNAuthorizationOptionAlert;
+    [center requestAuthorizationWithOptions:type completionHandler:^(BOOL granted, NSError * _Nullable error) {
+        if (granted) {
+            NSLog(@"推送通知授权成功");
+        }else{
+            NSLog(@"推送通知授权失败");
+        }
+    }];
+    [application registerForRemoteNotifications];
+
+    
+    return RET;
+}
+
+- (void)application:(UIApplication*)application didFailToRegisterForRemoteNotificationsWithError:(NSError*)error
+{
+    NSLog(@"Failed to get token, error: %@", error);
+}
+
+
+- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
+    
+    
+    if(application.applicationState == UIApplicationStateInactive)
+    {
+        completionHandler(UIBackgroundFetchResultNoData);
+        return; // 不处理后台时的推送,避免重复推送
+    }
+    
+    UIViewController *vc = [RAUtils getCurrentVC];
+    
+    NSString * name=NSStringFromClass(vc.class);
+    
+    
+    bool blogin = true;
+    if(self.user.length==0||[self.user.lowercaseString isEqualToString:@"guest"])
+        blogin = false;
+    
+//    int a=0;
+    
+    bool bupdate = false; //是否有更新按钮
+    if([name isEqualToString:@"CreateOrderViewController"]||[name isEqualToString:@"StockViewController"])
+    {
+        bupdate = false;
+    }
+    else
+    {
+        bupdate = true;
+    }
+    
+    bool berp = false; //是否是erp用户
+    NSString* servername =nil;
+    NSDictionary *addressDic = [[NSUserDefaults standardUserDefaults] valueForKey:@"ScanAddress"];;
+    if (addressDic) {
+        berp=[addressDic[@"has_erp_site"] boolValue];
+        
+        servername=addressDic[@"name"];
+    }
+    
+    if(![userInfo[@"aps"][@"server"] isEqualToString:servername])
+    {
+        completionHandler(UIBackgroundFetchResultNoData);
+        return; // 只处理来自当前server的消息,不是当前服务器,返回。
+    }
+    
+    
+    
+    UIAlertController *alertControl = [UIAlertController alertControllerWithTitle:@"Local Data Update Required" message:nil preferredStyle:UIAlertControllerStyleAlert];
+    //block代码块取代了delegate
+
+
+
+    UIAlertAction *actionOne = [UIAlertAction actionWithTitle:@"Update Local Data" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
+
+
+        [RADataProvider updateTemplate:vc];
+
+
+
+      
+
+
+    }];
+
+    UIAlertAction *alertthree = [UIAlertAction actionWithTitle:@"Update Local Data and Inventory" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
+
+        [RADataProvider updateTemplate:vc];
+        
+        [RADataProvider updateStock:vc];
+
+        
+    }];
+    if(bupdate)
+        [alertControl addAction:actionOne];
+    if(bupdate && berp && blogin)
+        [alertControl addAction:alertthree];
+
+    UIAlertAction *alertcancel = [UIAlertAction actionWithTitle:@"Update Later" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
+    }];
+    [alertControl addAction:alertcancel];
+
+    //UIAlertControllerStyle类型为UIAlertControllerStyleAlert可以添加addTextFieldWithConfigurationHandler:^(UITextField *textField)
+
 
+    [vc presentViewController:alertControl animated:YES completion:nil];
+
+    completionHandler(UIBackgroundFetchResultNewData);
+    
+    
+    
+//
+////    [RASingleton.sharedInstance writeLog:[NSString stringWithFormat:@"isActive: %ld %s",application.applicationState,__func__]];
+//    /**
+//     静默推送alert为空
+//     {
+//        "aps" : {
+//        "alert" : "",
+//        "content-available" : 1
+//        }
+//     }
+//     */
+//
+//    // "content-available" : 1 收到通知
+//    NSLog(@"收到静默推送: %@",userInfo);
+//    if (userInfo) {
+//
+//        NSDictionary *aps = [userInfo objectForKey:@"aps"];
+////        [UIApplication sharedApplication].applicationIconBadgeNumber = [aps[@"badge"] intValue];
+//        NSInteger report_location = [[aps objectForKey:@"report-location"] integerValue];
+//        if (report_location == 1) {
+//
+//            NSString *orderID = [aps objectForKey:@"order-id"];
+//            BOOL tracing = [[aps objectForKey:@"tracing"] boolValue];
+//            NSString *locationId = [aps objectForKey:@"location-id"];
+//
+//            if (tracing) {
+//
+//                if (RASingleton.sharedInstance.backgroundReportType == RABackgroundReportTypeAllow) {
+//
+//                    [self reportLastLocation:[RASingleton sharedInstance].lastLocation forOrder:orderID locationID:locationId];
+//
+//                } else {
+//
+//                    [self rejectReportLocationWithReason:[NSString stringWithFormat:@"Reject tracing by app setting Driver: %@",RASingleton.sharedInstance.user] forOrder:orderID locationID:locationId];
+//                }
+//
+//                return;
+//            }
+//
+//            if (RASingleton.sharedInstance.backgroundReportType == RABackgroundReportTypeAllow) {
+//
+//                [self reportLastLocation:[RASingleton sharedInstance].lastLocation forOrder:orderID locationID:locationId];
+//
+//            } else if (RASingleton.sharedInstance.backgroundReportType == RABackgroundReportTypeAlwaysAsk) {
+//
+//                [self askForReportLastLocation:orderID locationID:locationId];
+//            } else if (RASingleton.sharedInstance.backgroundReportType == RABackgroundReportTypeReject) {
+//
+//                [self rejectReportLocationWithReason:[NSString stringWithFormat:@"Reject ping by  app setting,driver: %@",RASingleton.sharedInstance.user] forOrder:orderID locationID:locationId];
+//            }
+//            completionHandler(UIBackgroundFetchResultNewData);
+//        } else {
+//            /**
+//             {
+//                "aps" : {
+//                    "alert" : {
+//                    "title" : "Notification",
+//                    "body" : "You have a new order"
+//                    },
+//                "is-order" : 1,
+//                "order-id" : "AFS20180530001200",
+//                "order-type2" : "Pick Up",
+//                "order-type" : 2,
+//                "sound" : "default",
+//                "content-available" : 1
+//                }
+//             }
+//             */
+//
+//            NSInteger is_order = [[aps objectForKey:@"is-order"] integerValue];
+//            if (is_order) {
+//
+//                // 程序在前台,弹窗提示
+//                if ([UIApplication sharedApplication].applicationState == UIApplicationStateActive) {
+//
+//                    [[NSNotificationCenter defaultCenter] postNotificationName:RANotificationHandleOrder object:nil userInfo:userInfo];
+//
+//                } else {
+//                    // 程序在后台,记录下来。当程序重新进入前台时弹窗提示(没有点击通知打开程序的情况)
+//                    self.currentOrderNotification = userInfo;
+//                }
+//            }
+//            completionHandler(UIBackgroundFetchResultNewData);
+//        }
+//    } else {
+//        completionHandler(UIBackgroundFetchResultNoData);
+//    }
+}
 
 @end

+ 52 - 30
RedAnt ERP Mobile/HMLG Scan Order/Base.lproj/Main.storyboard

@@ -2,7 +2,7 @@
 <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="jsC-F8-zYF">
     <device id="ipad7_9" orientation="portrait" layout="fullscreen" appearance="light"/>
     <dependencies>
-        <deployment version="4864" identifier="iOS"/>
+        <deployment version="5696" identifier="iOS"/>
         <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21678"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
@@ -1124,46 +1124,57 @@
                         <rect key="frame" x="0.0" y="0.0" width="744" height="1133"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
-                            <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="f2s-mC-wXH">
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="f2s-mC-wXH">
                                 <rect key="frame" x="60" y="262" width="250" height="30"/>
-                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                 <state key="normal" title="Background print"/>
                                 <connections>
                                     <action selector="onBackgroundprintClick:" destination="kPm-vh-Xir" eventType="touchUpInside" id="ADx-Bs-IY1"/>
                                 </connections>
                             </button>
-                            <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="3Vw-af-LUM">
-                                <rect key="frame" x="60" y="201" width="250" height="30"/>
-                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="3Vw-af-LUM">
+                                <rect key="frame" x="60" y="201" width="99" height="30"/>
                                 <state key="normal" title="Printer Setting"/>
                                 <connections>
                                     <action selector="onPrintersettingClick:" destination="kPm-vh-Xir" eventType="touchUpInside" id="ign-k9-WDe"/>
                                 </connections>
                             </button>
-                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="printer will show here" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hx4-8E-afz">
-                                <rect key="frame" x="342" y="210" width="190" height="21"/>
-                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="printer will show here" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hx4-8E-afz">
+                                <rect key="frame" x="191" y="210" width="161.5" height="21"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                 <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <nil key="highlightedColor"/>
                             </label>
-                            <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="4aT-F9-r30">
-                                <rect key="frame" x="94" y="388" width="183" height="30"/>
-                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="4aT-F9-r30">
+                                <rect key="frame" x="169" y="388" width="32" height="30"/>
                                 <state key="normal" title="Print"/>
                                 <connections>
                                     <action selector="OnPrintParamsClick:" destination="kPm-vh-Xir" eventType="touchUpInside" id="5NP-He-9AA"/>
                                 </connections>
                             </button>
-                            <textField opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="abcd" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="hMR-gf-tjy">
+                            <textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="abcd" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="hMR-gf-tjy">
                                 <rect key="frame" x="232" y="585" width="97" height="34"/>
-                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="14"/>
                                 <textInputTraits key="textInputTraits" autocapitalizationType="allCharacters"/>
                             </textField>
                         </subviews>
                         <viewLayoutGuide key="safeArea" id="TDE-LW-r8Y"/>
                         <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                        <constraints>
+                            <constraint firstItem="4aT-F9-r30" firstAttribute="top" secondItem="f2s-mC-wXH" secondAttribute="bottom" constant="96" id="7cg-OO-WBt"/>
+                            <constraint firstItem="TDE-LW-r8Y" firstAttribute="trailing" secondItem="f2s-mC-wXH" secondAttribute="trailing" constant="434" id="BPI-IV-lF4"/>
+                            <constraint firstItem="hx4-8E-afz" firstAttribute="bottom" secondItem="3Vw-af-LUM" secondAttribute="bottom" id="BlS-gO-NNk"/>
+                            <constraint firstItem="TDE-LW-r8Y" firstAttribute="trailing" secondItem="hMR-gf-tjy" secondAttribute="trailing" constant="415" id="KjC-ve-rhV"/>
+                            <constraint firstItem="hMR-gf-tjy" firstAttribute="top" secondItem="4aT-F9-r30" secondAttribute="bottom" constant="167" id="KkF-2m-9Bp"/>
+                            <constraint firstItem="f2s-mC-wXH" firstAttribute="top" secondItem="3Vw-af-LUM" secondAttribute="bottom" constant="31" id="Lbe-oB-lk5"/>
+                            <constraint firstItem="hx4-8E-afz" firstAttribute="leading" secondItem="3Vw-af-LUM" secondAttribute="trailing" constant="32" id="M1F-TW-5EU"/>
+                            <constraint firstItem="hMR-gf-tjy" firstAttribute="leading" secondItem="TDE-LW-r8Y" secondAttribute="leading" constant="232" id="PaL-3A-8FN"/>
+                            <constraint firstItem="TDE-LW-r8Y" firstAttribute="bottom" secondItem="hMR-gf-tjy" secondAttribute="bottom" constant="494" id="SkD-CT-xhz"/>
+                            <constraint firstItem="3Vw-af-LUM" firstAttribute="top" secondItem="TDE-LW-r8Y" secondAttribute="top" constant="177" id="UXP-lk-3YF"/>
+                            <constraint firstItem="f2s-mC-wXH" firstAttribute="leading" secondItem="3Vw-af-LUM" secondAttribute="leading" id="rNR-eq-MgM"/>
+                            <constraint firstItem="TDE-LW-r8Y" firstAttribute="trailing" secondItem="hx4-8E-afz" secondAttribute="trailing" constant="391.5" id="vhA-f7-ouW"/>
+                            <constraint firstItem="3Vw-af-LUM" firstAttribute="leading" secondItem="TDE-LW-r8Y" secondAttribute="leading" constant="60" id="w1C-lj-pYo"/>
+                            <constraint firstItem="f2s-mC-wXH" firstAttribute="centerX" secondItem="4aT-F9-r30" secondAttribute="centerX" id="yrO-gd-NRl"/>
+                        </constraints>
                     </view>
                     <connections>
                         <outlet property="labelPrintername" destination="hx4-8E-afz" id="Uu8-1I-s5L"/>
@@ -1795,6 +1806,7 @@ Email: redantsupport@united-us.net</string>
                             <constraint firstItem="FCL-qH-QSG" firstAttribute="leading" secondItem="bfy-vf-LnP" secondAttribute="leading" constant="20" id="BDA-hU-vBJ"/>
                             <constraint firstItem="4W6-zK-jjF" firstAttribute="top" secondItem="95h-K5-jjG" secondAttribute="bottom" constant="10" id="BT9-aP-Y1U"/>
                             <constraint firstItem="AJR-m5-lKB" firstAttribute="trailing" secondItem="95h-K5-jjG" secondAttribute="trailing" id="Ee7-jx-Qdl"/>
+                            <constraint firstItem="0UZ-jt-A5O" firstAttribute="leading" secondItem="FCL-qH-QSG" secondAttribute="trailing" constant="293" id="M0g-ON-PYT"/>
                             <constraint firstItem="zc7-Q1-EQZ" firstAttribute="top" secondItem="4W6-zK-jjF" secondAttribute="bottom" constant="10" id="MpJ-Zm-2sy"/>
                             <constraint firstItem="bfy-vf-LnP" firstAttribute="trailing" secondItem="95h-K5-jjG" secondAttribute="trailing" constant="60" id="O7p-Cn-J5A"/>
                             <constraint firstAttribute="bottom" secondItem="FCL-qH-QSG" secondAttribute="bottom" constant="30" id="RRS-dU-b5M"/>
@@ -1874,6 +1886,7 @@ Email: redantsupport@united-us.net</string>
                         <constraints>
                             <constraint firstItem="5dt-h8-yFx" firstAttribute="leading" secondItem="AOH-KD-dBj" secondAttribute="leading" id="3Tl-rl-hb7"/>
                             <constraint firstItem="Ufh-nh-7nX" firstAttribute="trailing" secondItem="AOH-KD-dBj" secondAttribute="trailing" constant="60" id="3yD-OX-Z6u"/>
+                            <constraint firstItem="Mct-GI-24g" firstAttribute="leading" secondItem="L1z-x1-ESN" secondAttribute="trailing" constant="294" id="88C-It-1jg"/>
                             <constraint firstItem="cSJ-9f-dpe" firstAttribute="top" secondItem="AOH-KD-dBj" secondAttribute="bottom" constant="10" id="EZD-vb-KyV"/>
                             <constraint firstAttribute="bottom" secondItem="Mct-GI-24g" secondAttribute="bottom" constant="30" id="Ile-3U-wfa"/>
                             <constraint firstItem="AOH-KD-dBj" firstAttribute="leading" secondItem="Ufh-nh-7nX" secondAttribute="leading" constant="60" id="NXA-pg-W2U"/>
@@ -1919,6 +1932,9 @@ Email: redantsupport@united-us.net</string>
                             </button>
                             <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="tM1-3D-HDl">
                                 <rect key="frame" x="292.5" y="625" width="159.5" height="34.5"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="159.5" id="2R6-vU-Cai"/>
+                                </constraints>
                                 <state key="normal" title="Button"/>
                                 <buttonConfiguration key="configuration" style="plain" title="Submitted Orders"/>
                                 <connections>
@@ -1947,30 +1963,30 @@ Email: redantsupport@united-us.net</string>
                                 </constraints>
                                 <prototypes>
                                     <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" restorationIdentifier="ScanHomeCell" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="ScanHomeCell" id="dw7-MG-fSB" customClass="ScanHomeCell">
-                                        <rect key="frame" x="0.0" y="50" width="684" height="43.5"/>
+                                        <rect key="frame" x="0.0" y="50" width="684" height="44.5"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="dw7-MG-fSB" id="6ok-87-DrJ">
-                                            <rect key="frame" x="0.0" y="0.0" width="684" height="43.5"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="684" height="44.5"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xBk-1n-UFG">
-                                                    <rect key="frame" x="16" y="11.5" width="456" height="21"/>
+                                                    <rect key="frame" x="0.0" y="0.5" width="430" height="42.5"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                                     <nil key="textColor"/>
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ahn-8c-uI7">
-                                                    <rect key="frame" x="598" y="4.5" width="70" height="34.5"/>
+                                                    <rect key="frame" x="598" y="4.5" width="70" height="35.5"/>
                                                     <constraints>
-                                                        <constraint firstAttribute="width" constant="70" id="zVr-eW-EQc"/>
+                                                        <constraint firstAttribute="width" relation="lessThanOrEqual" constant="70" id="ejL-Yc-kW2"/>
                                                     </constraints>
                                                     <state key="normal" title="Button"/>
                                                     <buttonConfiguration key="configuration" style="plain" title="View"/>
                                                 </button>
-                                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="2022-12-30" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="oBw-iB-pSQ">
-                                                    <rect key="frame" x="492" y="12" width="90" height="19.5"/>
+                                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="2022-12-30" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="oBw-iB-pSQ">
+                                                    <rect key="frame" x="462" y="12" width="120" height="20"/>
                                                     <constraints>
-                                                        <constraint firstAttribute="width" constant="90" id="xA4-EQ-Cx1"/>
+                                                        <constraint firstAttribute="width" constant="120" id="HVl-hR-hzU"/>
                                                     </constraints>
                                                     <fontDescription key="fontDescription" type="system" pointSize="16"/>
                                                     <nil key="textColor"/>
@@ -1978,13 +1994,16 @@ Email: redantsupport@united-us.net</string>
                                                 </label>
                                             </subviews>
                                             <constraints>
-                                                <constraint firstItem="oBw-iB-pSQ" firstAttribute="leading" secondItem="xBk-1n-UFG" secondAttribute="trailing" constant="20" id="1ca-iQ-1Il"/>
-                                                <constraint firstItem="xBk-1n-UFG" firstAttribute="leading" secondItem="6ok-87-DrJ" secondAttribute="leadingMargin" id="8re-vX-Sgw"/>
-                                                <constraint firstItem="ahn-8c-uI7" firstAttribute="leading" secondItem="oBw-iB-pSQ" secondAttribute="trailing" constant="16" id="LOW-dv-ci6"/>
-                                                <constraint firstItem="oBw-iB-pSQ" firstAttribute="centerY" secondItem="6ok-87-DrJ" secondAttribute="centerY" id="RLm-Yw-gr9"/>
-                                                <constraint firstAttribute="trailing" secondItem="ahn-8c-uI7" secondAttribute="trailing" constant="16" id="ewY-9F-5fn"/>
-                                                <constraint firstItem="xBk-1n-UFG" firstAttribute="centerY" secondItem="6ok-87-DrJ" secondAttribute="centerY" id="gRa-Fh-1ac"/>
-                                                <constraint firstItem="ahn-8c-uI7" firstAttribute="centerY" secondItem="6ok-87-DrJ" secondAttribute="centerY" id="xxF-Ka-BVt"/>
+                                                <constraint firstAttribute="bottom" secondItem="xBk-1n-UFG" secondAttribute="bottom" constant="1.5" id="6QS-4Z-sz3"/>
+                                                <constraint firstItem="ahn-8c-uI7" firstAttribute="left" secondItem="oBw-iB-pSQ" secondAttribute="right" constant="16" id="73e-wJ-gvV"/>
+                                                <constraint firstItem="oBw-iB-pSQ" firstAttribute="left" secondItem="xBk-1n-UFG" secondAttribute="right" constant="32" id="L2t-Ga-VMD"/>
+                                                <constraint firstItem="oBw-iB-pSQ" firstAttribute="top" secondItem="6ok-87-DrJ" secondAttribute="topMargin" constant="1" id="PWC-zN-L4O"/>
+                                                <constraint firstAttribute="trailing" secondItem="ahn-8c-uI7" secondAttribute="trailing" constant="16" id="g0e-vx-HYM"/>
+                                                <constraint firstAttribute="bottom" secondItem="ahn-8c-uI7" secondAttribute="bottom" constant="4.5" id="jc1-nn-AWw"/>
+                                                <constraint firstItem="xBk-1n-UFG" firstAttribute="top" secondItem="6ok-87-DrJ" secondAttribute="top" constant="0.5" id="jhX-tI-J2i"/>
+                                                <constraint firstAttribute="bottomMargin" secondItem="oBw-iB-pSQ" secondAttribute="bottom" constant="1.5" id="kb8-gI-GN0"/>
+                                                <constraint firstItem="ahn-8c-uI7" firstAttribute="top" secondItem="6ok-87-DrJ" secondAttribute="top" constant="4.5" id="v00-PB-08h"/>
+                                                <constraint firstItem="xBk-1n-UFG" firstAttribute="leading" secondItem="6ok-87-DrJ" secondAttribute="leading" id="xNk-LU-pfL"/>
                                             </constraints>
                                         </tableViewCellContentView>
                                         <connections>
@@ -2004,12 +2023,15 @@ Email: redantsupport@united-us.net</string>
                         <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                         <constraints>
                             <constraint firstItem="4aE-ib-gZl" firstAttribute="top" secondItem="MX7-kc-9FV" secondAttribute="bottom" constant="10" id="515-Zg-XqX"/>
-                            <constraint firstItem="ybY-eH-YB2" firstAttribute="trailing" secondItem="4aE-ib-gZl" secondAttribute="trailing" id="AtJ-sO-usD"/>
+                            <constraint firstItem="ybY-eH-YB2" firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="4aE-ib-gZl" secondAttribute="trailing" id="AtJ-sO-usD"/>
                             <constraint firstItem="MX7-kc-9FV" firstAttribute="top" secondItem="jYV-1f-hJ3" secondAttribute="top" constant="10" id="C1k-SF-SLW"/>
                             <constraint firstItem="WiH-ii-7Rw" firstAttribute="leading" secondItem="4aE-ib-gZl" secondAttribute="leading" id="FhZ-UM-k0w"/>
+                            <constraint firstItem="jYV-1f-hJ3" firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="MX7-kc-9FV" secondAttribute="trailing" symbolic="YES" id="GCF-vV-qzh"/>
                             <constraint firstItem="MX7-kc-9FV" firstAttribute="leading" secondItem="jYV-1f-hJ3" secondAttribute="leading" constant="30" id="HTQ-r8-JWF"/>
                             <constraint firstItem="tM1-3D-HDl" firstAttribute="top" secondItem="4aE-ib-gZl" secondAttribute="bottom" constant="60" id="Xgs-gM-Aeh"/>
                             <constraint firstItem="WiH-ii-7Rw" firstAttribute="top" secondItem="tM1-3D-HDl" secondAttribute="top" id="Y45-XP-iTu"/>
+                            <constraint firstItem="tM1-3D-HDl" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="WiH-ii-7Rw" secondAttribute="trailing" constant="8" symbolic="YES" id="Yrs-7S-HNK"/>
+                            <constraint firstItem="ybY-eH-YB2" firstAttribute="leading" secondItem="tM1-3D-HDl" secondAttribute="trailing" constant="139" id="bNC-I7-Ufw"/>
                             <constraint firstItem="4aE-ib-gZl" firstAttribute="leading" secondItem="jYV-1f-hJ3" secondAttribute="leading" constant="30" id="hAx-BB-pvk"/>
                             <constraint firstItem="tM1-3D-HDl" firstAttribute="centerX" secondItem="4kl-uG-nDU" secondAttribute="centerX" id="kZC-Nf-Uzn"/>
                             <constraint firstItem="ybY-eH-YB2" firstAttribute="top" secondItem="tM1-3D-HDl" secondAttribute="top" id="lnu-p6-F36"/>

+ 2 - 4
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings → RedAnt ERP Mobile/HMLG Scan Order/HMLG Scan Order.entitlements

@@ -2,9 +2,7 @@
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
 <dict>
-	<key>BuildSystemType</key>
-	<string>Latest</string>
-	<key>PreviewsEnabled</key>
-	<false/>
+	<key>aps-environment</key>
+	<string>development</string>
 </dict>
 </plist>

+ 17 - 17
RedAnt ERP Mobile/HMLG Scan Order/QRCode.storyboard

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="19529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
-    <device id="retina5_5" orientation="landscape" appearance="light"/>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+    <device id="ipad10_9rounded" orientation="portrait" layout="fullscreen" appearance="light"/>
     <dependencies>
-        <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19519"/>
+        <deployment version="5696" identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21678"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -13,19 +13,19 @@
             <objects>
                 <viewController storyboardIdentifier="RAQRCodeScannerViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="41J-NQ-wiU" customClass="RAQRCodeScannerViewController" sceneMemberID="viewController">
                     <view key="view" contentMode="scaleToFill" id="aiT-qZ-M5f">
-                        <rect key="frame" x="0.0" y="0.0" width="736" height="414"/>
+                        <rect key="frame" x="0.0" y="0.0" width="820" height="1180"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
                             <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="D8z-rA-Qpf">
-                                <rect key="frame" x="0.0" y="0.0" width="736" height="414"/>
+                                <rect key="frame" x="0.0" y="0.0" width="820" height="1180"/>
                                 <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                             </view>
                             <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="4DJ-GK-9l9">
-                                <rect key="frame" x="0.0" y="0.0" width="736" height="414"/>
+                                <rect key="frame" x="0.0" y="0.0" width="820" height="1180"/>
                                 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                             </view>
                             <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="vCI-Zm-N7X">
-                                <rect key="frame" x="121" y="60" width="294" height="294"/>
+                                <rect key="frame" x="260" y="330" width="300" height="300"/>
                                 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                 <constraints>
                                     <constraint firstAttribute="width" secondItem="vCI-Zm-N7X" secondAttribute="height" multiplier="1:1" id="8cj-iq-wvr"/>
@@ -43,7 +43,7 @@
                                 </variation>
                             </view>
                             <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="0ig-dn-iSa">
-                                <rect key="frame" x="596" y="177" width="60" height="60"/>
+                                <rect key="frame" x="380" y="1020" width="60" height="60"/>
                                 <constraints>
                                     <constraint firstAttribute="width" constant="60" id="OkG-xs-m3c"/>
                                     <constraint firstAttribute="width" secondItem="0ig-dn-iSa" secondAttribute="height" multiplier="1:1" id="ZrC-2n-5ix"/>
@@ -56,7 +56,7 @@
                                 </connections>
                             </button>
                             <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="5fS-uQ-uh4">
-                                <rect key="frame" x="10" y="20" width="30" height="30"/>
+                                <rect key="frame" x="10" y="44" width="30" height="30"/>
                                 <state key="normal" image="qr_back_btn"/>
                                 <connections>
                                     <action selector="backBtnClick:" destination="41J-NQ-wiU" eventType="touchUpInside" id="ifJ-hi-DTG"/>
@@ -181,23 +181,23 @@
             <objects>
                 <viewController storyboardIdentifier="RAQRCodeScannerViewControllerAuto" useStoryboardIdentifierAsRestorationIdentifier="YES" id="T5n-Ld-InS" customClass="RAQRCodeScannerViewController" sceneMemberID="viewController">
                     <view key="view" contentMode="scaleToFill" id="XG1-BH-5Yn">
-                        <rect key="frame" x="0.0" y="0.0" width="736" height="414"/>
+                        <rect key="frame" x="0.0" y="0.0" width="820" height="1180"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
                             <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Ada-GD-fnS">
-                                <rect key="frame" x="0.0" y="0.0" width="736" height="414"/>
+                                <rect key="frame" x="0.0" y="0.0" width="820" height="234"/>
                                 <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                             </view>
                             <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="OxG-xD-O68">
-                                <rect key="frame" x="0.0" y="0.0" width="736" height="414"/>
+                                <rect key="frame" x="0.0" y="0.0" width="820" height="234"/>
                                 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                             </view>
-                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="RQP-kc-U9i">
-                                <rect key="frame" x="0.0" y="0.0" width="736" height="414"/>
+                            <view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="RQP-kc-U9i">
+                                <rect key="frame" x="0.0" y="0.0" width="820" height="414"/>
                                 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                             </view>
                             <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ZVa-fu-Anm">
-                                <rect key="frame" x="596" y="177" width="60" height="60"/>
+                                <rect key="frame" x="393" y="100" width="34" height="34"/>
                                 <constraints>
                                     <constraint firstAttribute="width" secondItem="ZVa-fu-Anm" secondAttribute="height" multiplier="1:1" id="EVk-AS-ca9"/>
                                     <constraint firstAttribute="width" constant="60" id="OR3-hA-sW8"/>
@@ -210,7 +210,7 @@
                                 </connections>
                             </button>
                             <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="GaA-2B-enV">
-                                <rect key="frame" x="10" y="20" width="30" height="30"/>
+                                <rect key="frame" x="10" y="44" width="30" height="30"/>
                                 <state key="normal" image="qr_back_btn"/>
                                 <connections>
                                     <action selector="backBtnClick:" destination="T5n-Ld-InS" eventType="touchUpInside" id="bcH-Wf-Geh"/>

+ 1 - 1
RedAnt ERP Mobile/HMLG Scan Order/SO.storyboard

@@ -2,7 +2,7 @@
 <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
     <device id="ipad10_2" orientation="portrait" layout="fullscreen" appearance="light"/>
     <dependencies>
-        <deployment identifier="iOS"/>
+        <deployment version="5696" identifier="iOS"/>
         <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21678"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
         <capability name="System colors in document resources" minToolsVersion="11.0"/>

+ 14 - 1
RedAnt ERP Mobile/HMLG Scan Order/ScanListCell.m

@@ -75,6 +75,12 @@
                 litem[@"count"]=@([litem[@"count"] intValue] +[jitem[@"count"] intValue]);
                 litem[@"cuft"]=@([litem[@"count"] intValue] * [litem[@"unit_cuft"] doubleValue]);
                 
+                // 计算subtotal
+                double discount = [litem[@"discount"] doubleValue];
+                int qty = [litem[@"count"] intValue];
+                double unit_price = [litem[@"unit_price"] doubleValue];
+                litem[@"subtotal_price"]= [NSString stringWithFormat:@"%f",unit_price*qty*(1-discount/100.0)];
+                
                 section[[NSString stringWithFormat:@"item_%i",i]] = litem;
                 break;
                 
@@ -112,11 +118,18 @@
                 unit_price = [NSString stringWithFormat:@"%.2f", [unit_price doubleValue]];
             }
             
-            
+//            [jitem[@"subtotal_price"]= [NSString stringWithFormat:@"%f",unit_price*qty*(1-discount/100.0)];
             jitem[@"unit_price"] = unit_price;
             jitem[@"erp_unit_price"] = unit_price;
             
             
+            // 计算subtotal
+            double discount = [jitem[@"discount"] doubleValue];
+            int qty = [jitem[@"count"] intValue];
+            double dunit_price = [jitem[@"unit_price"] doubleValue];
+            jitem[@"subtotal_price"]= [NSString stringWithFormat:@"%f",dunit_price*qty*(1-discount/100.0)];
+            
+            
             section[[NSString stringWithFormat:@"item_%i",count]] = jitem;
             section[@"count"]= @(count+1);
             count++;

+ 1 - 1
RedAnt ERP Mobile/HMLG Scan Order/ScanOrderModelListViewController.m

@@ -221,7 +221,7 @@
             jitem[@"count"]=@"0";
         else
             jitem[@"count"] = mpack;
-        jitem[@"subtotal_price"] = @([mpack intValue]* [cell_price doubleValue]);//@([mpack intValue]* [jitem[@"unit_price"] doubleValue]);
+        jitem[@"subtotal_price"] = @([mpack intValue]* [unit_price doubleValue]);//@([mpack intValue]* [jitem[@"unit_price"] doubleValue]);
 
 //        jitem[@"dimension"] = dimension;
 //        jitem[@"unit_cuft"] = unit_cuft;

+ 65 - 65
RedAnt ERP Mobile/HMLG Scan Order/StockViewController.m

@@ -139,76 +139,76 @@
 
 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
 {
-    
-    return;
-    //如果两次点击的时间间隔小于1秒,则断定为双击事件
-    
-//    if(tableView.editing==false)
-//        return;
-    
-//    if(self.forNewResult)
+//    
+//    return;
+//    //如果两次点击的时间间隔小于1秒,则断定为双击事件
+//    
+////    if(tableView.editing==false)
+////        return;
+//    
+////    if(self.forNewResult)
+////    {
+////         if(indexPath.section==1&&[tableView numberOfRowsInSection:0]>=3)
+////             return;
+////    }
+////    else
+////    {
+////        if(indexPath.section==0&&[tableView numberOfRowsInSection:indexPath.section]<=1)
+////            return;
+////    }
+////    int between = 1;
+//    NSUInteger curr = [[NSDate date] timeIntervalSince1970];
+//    
+//    if(indexPath.row==self.lasttap.row&&indexPath.section==self.lasttap.section)
 //    {
-//         if(indexPath.section==1&&[tableView numberOfRowsInSection:0]>=3)
-//             return;
+//        if (curr-self.taptime<1) {
+//              DebugLog(@"double click!");
+//            self.lasttap =nil;
+//            
+//            NSMutableArray * from;
+//            NSMutableArray * to ;
+//            int section;
+//            if(indexPath.section==0)
+//            {
+//                from  = self.idata;
+//                to = self.bdata;
+//                section = 1;
+//            }
+//            else
+//            {
+//            
+//                from  = self.bdata;
+//                to = self.idata;
+//                section = 0;
+//            }
+//            NSIndexPath * toIndexPath = [NSIndexPath indexPathForRow:0 inSection:section];
+////            NSIndexPath * headerIndexPath = [NSIndexPath indexPathForRow:0 inSection:indexPath.section];
+////            NSIndexPath * headerIndexPath1 = toIndexPath;
+//            
+//            id content=from[indexPath.row];
+//            [tableView beginUpdates];
+//            [from removeObjectAtIndex:indexPath.row];
+//            [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
+//
+//            [to insertObject:content atIndex:0];
+//            [tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:toIndexPath] withRowAnimation:UITableViewRowAnimationFade];
+//            [tableView endUpdates];
+//            
+////            [tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:headerIndexPath] withRowAnimation:UITableViewRowAnimationFade];
+////            [tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:headerIndexPath1] withRowAnimation:UITableViewRowAnimationFade];
+//            [tableView reloadData];
+//            
+//
+//        }
+//        self.taptime = curr;
+//        
+//        
 //    }
 //    else
 //    {
-//        if(indexPath.section==0&&[tableView numberOfRowsInSection:indexPath.section]<=1)
-//            return;
+//        self.taptime = curr;
+//        self.lasttap = indexPath;
 //    }
-//    int between = 1;
-    NSUInteger curr = [[NSDate date] timeIntervalSince1970];
-    
-    if(indexPath.row==self.lasttap.row&&indexPath.section==self.lasttap.section)
-    {
-        if (curr-self.taptime<1) {
-              DebugLog(@"double click!");
-            self.lasttap =nil;
-            
-            NSMutableArray * from;
-            NSMutableArray * to ;
-            int section;
-            if(indexPath.section==0)
-            {
-                from  = self.idata;
-                to = self.bdata;
-                section = 1;
-            }
-            else
-            {
-            
-                from  = self.bdata;
-                to = self.idata;
-                section = 0;
-            }
-            NSIndexPath * toIndexPath = [NSIndexPath indexPathForRow:0 inSection:section];
-//            NSIndexPath * headerIndexPath = [NSIndexPath indexPathForRow:0 inSection:indexPath.section];
-//            NSIndexPath * headerIndexPath1 = toIndexPath;
-            
-            id content=from[indexPath.row];
-            [tableView beginUpdates];
-            [from removeObjectAtIndex:indexPath.row];
-            [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
-
-            [to insertObject:content atIndex:0];
-            [tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:toIndexPath] withRowAnimation:UITableViewRowAnimationFade];
-            [tableView endUpdates];
-            
-//            [tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:headerIndexPath] withRowAnimation:UITableViewRowAnimationFade];
-//            [tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:headerIndexPath1] withRowAnimation:UITableViewRowAnimationFade];
-            [tableView reloadData];
-            
-
-        }
-        self.taptime = curr;
-        
-        
-    }
-    else
-    {
-        self.taptime = curr;
-        self.lasttap = indexPath;
-    }
 }
 
 //

+ 2 - 2
RedAnt ERP Mobile/HMLG Scan Order/config.h

@@ -68,7 +68,7 @@
 
 
 
-#define BASE_URL @"http://192.168.0.133:8088/wm_postgresql/"
+#define BASE_URL @"http://192.168.0.142:8088/wm_postgresql/"
 
 //------------------- chen server-----------------------
 
@@ -216,7 +216,7 @@
 #define URL_SCAN_NEWS @"offlineorder_isales.php"
 
 
-#define URL_SCAN_STOCK @"offlineorder_isales.php"
+//#define URL_SCAN_STOCK @"offlineorder_isales.php"
 #define URL_SERVER_CHECK @"offlineorder_isales.php"
 #define URL_SIGN_UP @"offlineorder_isales.php"
 #define URL_CHECK_STOCK @"offlineorder_isales.php"

+ 0 - 25
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcshareddata/RedAnt ERP Mobile.xcscmblueprint

@@ -1,25 +0,0 @@
-{
-  "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "67e474b5-b905-4d42-b5e5-8f9a51e6c439++7411",
-  "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : {
-    "67e474b5-b905-4d42-b5e5-8f9a51e6c439++7411" : {
-
-    }
-  },
-  "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : {
-    "67e474b5-b905-4d42-b5e5-8f9a51e6c439++7411" : 0
-  },
-  "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "9C4A4D7A-2E75-41D2-8060-938555E0EB8B",
-  "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : {
-    "67e474b5-b905-4d42-b5e5-8f9a51e6c439++7411" : "RedAnt%20ERP%20Mobile\/"
-  },
-  "DVTSourceControlWorkspaceBlueprintNameKey" : "RedAnt ERP Mobile",
-  "DVTSourceControlWorkspaceBlueprintVersion" : 204,
-  "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "RedAnt ERP Mobile.xcworkspace",
-  "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [
-    {
-      "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "svn:\/\/rui.zhang@209.49.111.29",
-      "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Subversion",
-      "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "67e474b5-b905-4d42-b5e5-8f9a51e6c439++7411"
-    }
-  ]
-}

+ 0 - 25
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcshareddata/RedAnt ERP Mobile_NPD.xcscmblueprint

@@ -1,25 +0,0 @@
-{
-  "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "67e474b5-b905-4d42-b5e5-8f9a51e6c439++6455",
-  "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : {
-    "67e474b5-b905-4d42-b5e5-8f9a51e6c439++6455" : {
-
-    }
-  },
-  "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : {
-    "67e474b5-b905-4d42-b5e5-8f9a51e6c439++6455" : 0
-  },
-  "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "614332C1-B9E3-42F4-8AED-94B76BF36D2A",
-  "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : {
-    "67e474b5-b905-4d42-b5e5-8f9a51e6c439++6455" : "ERPSuiteIOS\/"
-  },
-  "DVTSourceControlWorkspaceBlueprintNameKey" : "RedAnt ERP Mobile_NPD",
-  "DVTSourceControlWorkspaceBlueprintVersion" : 204,
-  "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "RedAnt ERP Suite\/RedAnt ERP Mobile_NPD.xcworkspace",
-  "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [
-    {
-      "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "svn:\/\/209.49.111.29",
-      "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Subversion",
-      "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "67e474b5-b905-4d42-b5e5-8f9a51e6c439++6455"
-    }
-  ]
-}

+ 1 - 1
RedAnt ERP Mobile/common/AppDelegateBase.h

@@ -96,7 +96,7 @@ typedef enum {
 @property (strong,nonatomic) NSString * password;
 @property (strong,nonatomic) NSString * user_icon;
 //@property (strong,nonatomic) NSString * sessionid;
-@property (strong,nonatomic) NSString * duid;
+//@property (strong,nonatomic) NSString * duid;
 @property bool bLogin;
 
 @property (nonatomic) long user_type;

+ 9 - 0
RedAnt ERP Mobile/common/Functions/camscan/ScannerViewController.m

@@ -913,6 +913,15 @@
                         litem[@"count"]=@([litem[@"count"] intValue] +[jitem[@"count"] intValue]);
                         litem[@"cuft"]=@([litem[@"count"] intValue] * [litem[@"unit_cuft"] doubleValue]);
                         section[[NSString stringWithFormat:@"item_%i",i]] = litem;
+                        
+                        
+                        
+                        double discount = [litem[@"discount"] doubleValue];
+                        int qty = [litem[@"count"] intValue];
+                        double unit_price = [litem[@"unit_price"] doubleValue];
+                        litem[@"subtotal_price"]= [NSString stringWithFormat:@"%f",unit_price*qty*(1-discount/100.0)];
+                        
+                        
                         break;
                         
                         

+ 1 - 0
RedAnt ERP Mobile/common/Functions/offline/OLDataProvider.m

@@ -2412,6 +2412,7 @@
         NSMutableDictionary* cartitem = [[self scanmodel2cartitem:[modeljson mutableCopy]] mutableCopy];
         cartitem[@"note"]=item[@"note"];
         cartitem[@"discount"]=item[@"discount"];
+        cart[@"count"]=item[@"count"];
 //        [item removeObjectForKey:@"discount"];
 //        [item removeObjectForKey:@"note"];
         newsection[[NSString stringWithFormat:@"item_%d",newcount]]=cartitem;

+ 4 - 1
RedAnt ERP Mobile/common/Functions/order/CreateOrderViewController.m

@@ -2910,8 +2910,11 @@
     
     NSMutableDictionary* saveorder = [[NSMutableDictionary dictionaryWithDictionary:self.content_data_download] mutableCopy];
     if(newmodel)
+    {
         saveorder[@"section_0"]=newmodel;
-    
+        NSString *ocartpath = [orderdir stringByAppendingPathComponent:@"original_cart.json"];
+        [RAUtils dicttofile:ocartpath dict:RASingleton.sharedInstance.scan_cart];
+    }
     NSMutableDictionary* cart_section = [saveorder[@"section_0"] mutableCopy];
     for(int ci=0;ci<[cart_section[@"count"] intValue];ci++ )
     {

+ 3 - 0
RedAnt ERP Mobile/common/RASingleton.h

@@ -50,6 +50,9 @@ typedef enum {
 @property (nonatomic,  copy) NSString *user;///替代appdelegate里的user访问
 ///
 ///
+@property (strong,nonatomic) NSString * duid; //推送令牌
+///
+///
 ///
 #pragma mark - Global Param Begin
 

+ 9 - 9
RedAnt ERP Mobile/common/customUI/MDHTMLLabel.m

@@ -49,10 +49,10 @@ static inline CTTextAlignment CTTextAlignmentFromMDTextAlignment(MDTextAlignment
 {
     switch (alignment)
     {
-		case NSTextAlignmentLeft: return kCTLeftTextAlignment;
-		case NSTextAlignmentCenter: return kCTCenterTextAlignment;
-		case NSTextAlignmentRight: return kCTRightTextAlignment;
-		default: return kCTNaturalTextAlignment;
+		case NSTextAlignmentLeft: return kCTTextAlignmentLeft;
+		case NSTextAlignmentCenter: return kCTTextAlignmentCenter;
+		case NSTextAlignmentRight: return kCTTextAlignmentRight;
+		default: return kCTTextAlignmentNatural;
 	}
 }
 
@@ -963,19 +963,19 @@ static inline CGSize CTFramesetterSuggestFrameSizeForAttributedStringWithConstra
 		{
 			if ([value caseInsensitiveCompare:@"left"] == NSOrderedSame)
 			{
-				textAlignment = kCTLeftTextAlignment;
+				textAlignment = kCTTextAlignmentLeft;
 			}
 			else if ([value caseInsensitiveCompare:@"right"] == NSOrderedSame)
 			{
-				textAlignment = kCTRightTextAlignment;
+				textAlignment = kCTTextAlignmentRight;
 			}
 			else if ([value caseInsensitiveCompare:@"justify"] == NSOrderedSame)
 			{
-				textAlignment = kCTJustifiedTextAlignment;
+				textAlignment = kCTTextAlignmentJustified;
 			}
 			else if ([value caseInsensitiveCompare:@"center"] == NSOrderedSame)
 			{
-				textAlignment = kCTCenterTextAlignment;
+				textAlignment = kCTTextAlignmentCenter;
 			}
 		}
 		else if ([key caseInsensitiveCompare:@"indent"] == NSOrderedSame)
@@ -1058,7 +1058,7 @@ static inline CGSize CTFramesetterSuggestFrameSizeForAttributedStringWithConstra
         lineBreakMode = CTLineBreakModeFromMDLineBreakMode(self.lineBreakMode);
     }
 
-    CTTextAlignment textAlignment = kCTCenterTextAlignment;
+    CTTextAlignment textAlignment = kCTTextAlignmentCenter;
 
 	CTParagraphStyleSetting settings[] =
     {

+ 1 - 1
RedAnt ERP Mobile/common/data_provider/RADataProvider.m

@@ -169,7 +169,7 @@
 //    2022-07-14。1.17
     //    2022-07-14。1.19
     
-NSDate * ddate =[dateFormatter dateFromString:@"2023-4-18"];
+NSDate * ddate =[dateFormatter dateFromString:@"2023-08-01"];
     
 //    bool review=[cdate earlierDate:ddate];
     NSTimeInterval secondsInterval= [cdate timeIntervalSinceDate:ddate];

+ 16 - 9
RedAnt ERP Mobile/common/data_provider/RANetwork.m

@@ -98,8 +98,12 @@ NSString *const ScreenCodeOfflineSync = @"Offline Sync Screen";
     //    [params setValue:uuid.UUIDString forKey:@"deviceid"];
     //#endif
     
-    
-    
+    if(RASingleton.sharedInstance.duid!=nil && params[@"udid"]==nil)
+        params[@"udid"]=RASingleton.sharedInstance.duid;
+
+# ifdef DEBUG
+    [params setValue:@"true" forKey:@"is_debug"];
+# endif
     if(appDelegate.user!=nil && params[@"user"]==nil)
         [params setValue:appDelegate.user forKey:@"user"];
     if(appDelegate.password!=nil&& params[@"password"]==nil)
@@ -3664,8 +3668,8 @@ NSString *const ScreenCodeOfflineSync = @"Offline Sync Screen";
         //some UI methods ej
         appDelegate=(AppDelegate*)[[UIApplication sharedApplication] delegate];
     });
-    if(appDelegate.duid !=nil)
-        [params setValue:appDelegate.duid forKey:@"udid"];
+    if(RASingleton.sharedInstance.duid !=nil)
+        [params setValue:RASingleton.sharedInstance.duid forKey:@"udid"];
     [params setValue:@"handset_login" forKey:@"action"];
     //    [headers setValue:[NSString stringWithFormat:@"%d",dataLength] forKey:@"Content-Length"];
     
@@ -4832,8 +4836,8 @@ NSString *const ScreenCodeOfflineSync = @"Offline Sync Screen";
     
     appDelegate=(AppDelegate*)[[UIApplication sharedApplication] delegate];
     
-    if(appDelegate.duid !=nil)
-        [params setValue:appDelegate.duid forKey:@"udid"];
+    if(RASingleton.sharedInstance.duid !=nil)
+        [params setValue:RASingleton.sharedInstance.duid forKey:@"udid"];
     [params setValue:@"handset_login" forKey:@"action"];
     //    [headers setValue:[NSString stringWithFormat:@"%d",dataLength] forKey:@"Content-Length"];
     
@@ -6568,7 +6572,7 @@ NSString *const ScreenCodeOfflineSync = @"Offline Sync Screen";
             NSMutableDictionary* item = [section[[NSString stringWithFormat:@"item_%d",i]] mutableCopy];
             
             long index  = [arr indexOfObject:item[@"cart_item_id"]] ;
-            if(index <0)
+            if(index ==NSNotFound)
             {
                 newsection[[NSString stringWithFormat:@"item_%d",newcount]] = item;
                 newcount ++;
@@ -9928,7 +9932,9 @@ NSMutableDictionary* section = [RASingleton.sharedInstance.scan_cart[@"section_0
         int item_count = [item[@"count"] intValue];
         float price=[item[@"unit_price"] floatValue] ;
         item[@"discount"] =@(discount);
-        item[@"subtotal_price"] =@(price*item_count);
+//        item[@"subtotal_price"] =@(price*item_count);
+        
+        item[@"subtotal_price"]= [NSString stringWithFormat:@"%f",price*item_count*(1-discount/100.0)];
         if(discount>0)
             item[@"note"] =[NSString stringWithFormat:@"Note: discount %d%% off.",(int)discount];
         else
@@ -9976,7 +9982,8 @@ NSMutableDictionary* section = [RASingleton.sharedInstance.scan_cart[@"section_0
                 int item_count = [item[@"count"] intValue];
                 item[@"unit_price"] =@(price);
                 item[@"discount"] =@(discount);
-                item[@"subtotal_price"] =@(price*item_count);
+//                item[@"subtotal_price"] =@(price*item_count);
+                item[@"subtotal_price"]= [NSString stringWithFormat:@"%f",price*item_count*(1-discount/100.0)];
                 if(discount>0)
                     item[@"note"] =[NSString stringWithFormat:@"Note: discount %d%% off.",(int)discount];
                 else

+ 1 - 1
RedAnt ERP Mobile/iSales-CONTRAST.xcodeproj/xcuserdata/ruizhang.xcuserdatad/xcschemes/xcschememanagement.plist

@@ -7,7 +7,7 @@
 		<key>iSales-CONTRAST.xcscheme_^#shared#^_</key>
 		<dict>
 			<key>orderHint</key>
-			<integer>1</integer>
+			<integer>4</integer>
 		</dict>
 	</dict>
 </dict>

+ 223 - 137
RedAnt ERP Mobile/iSales-NPD/Base.lproj/OLM.storyboard

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES" useSafeAreas="YES" colorMatched="YES">
     <device id="ipad9_7" orientation="portrait" layout="fullscreen" appearance="light"/>
     <dependencies>
         <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21678"/>
@@ -11,116 +11,156 @@
         <scene sceneID="Zkb-7X-Ajq">
             <objects>
                 <viewController storyboardIdentifier="OfflineSettingViewController" title="Offline Setting" useStoryboardIdentifierAsRestorationIdentifier="YES" id="FG7-WW-Z5X" customClass="OfflineSettingViewController" sceneMemberID="viewController">
-                    <layoutGuides>
-                        <viewControllerLayoutGuide type="top" id="KQN-V1-5y5"/>
-                        <viewControllerLayoutGuide type="bottom" id="oKp-7s-9cn"/>
-                    </layoutGuides>
                     <view key="view" contentMode="scaleToFill" id="fxo-pq-FSo">
                         <rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
-                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Enable offline mode" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="iMj-3v-3eE">
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Enable offline mode" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="iMj-3v-3eE">
                                 <rect key="frame" x="20" y="57" width="181" height="21"/>
-                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="181" id="soF-U9-hAf"/>
+                                </constraints>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                 <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <nil key="highlightedColor"/>
                             </label>
-                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Use internal address" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Baf-ru-Ueq">
-                                <rect key="frame" x="20" y="108" width="173" height="21"/>
-                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Use internal address" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Baf-ru-Ueq">
+                                <rect key="frame" x="20" y="108" width="156.5" height="21"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                 <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <nil key="highlightedColor"/>
                             </label>
-                            <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="9fI-uo-0D5">
+                            <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="9fI-uo-0D5">
                                 <rect key="frame" x="217" y="52" width="51" height="31"/>
-                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                 <connections>
                                     <action selector="onChangeOfflineSwitch:" destination="FG7-WW-Z5X" eventType="valueChanged" id="F0c-jb-lQb"/>
                                 </connections>
                             </switch>
-                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Last sync" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="o7T-n9-rhA">
-                                <rect key="frame" x="20" y="151" width="91" height="21"/>
-                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Last sync" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="o7T-n9-rhA">
+                                <rect key="frame" x="20" y="151" width="72.5" height="21"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                 <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <nil key="highlightedColor"/>
                             </label>
-                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mAv-YK-pnD">
-                                <rect key="frame" x="217" y="151" width="179" height="21"/>
-                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mAv-YK-pnD">
+                                <rect key="frame" x="217" y="161.5" width="300" height="0.0"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="300" id="mmY-wc-u3z"/>
+                                </constraints>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                 <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <nil key="highlightedColor"/>
                             </label>
-                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Cache size" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4VN-I0-qDk">
-                                <rect key="frame" x="20" y="200" width="91" height="21"/>
-                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Cache size" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4VN-I0-qDk">
+                                <rect key="frame" x="20" y="200" width="83" height="21"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                 <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <nil key="highlightedColor"/>
                             </label>
-                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Version" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="kcI-2q-g1r">
-                                <rect key="frame" x="20" y="249" width="91" height="21"/>
-                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Version" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="kcI-2q-g1r">
+                                <rect key="frame" x="20" y="249" width="57" height="21"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                 <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <nil key="highlightedColor"/>
                             </label>
-                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Unlock offline" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="MNF-V6-2fB">
-                                <rect key="frame" x="20" y="298" width="106" height="21"/>
-                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Unlock offline" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="MNF-V6-2fB">
+                                <rect key="frame" x="20" y="298" width="105" height="21"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                 <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <nil key="highlightedColor"/>
                             </label>
-                            <button hidden="YES" opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Kdt-hI-Mna">
-                                <rect key="frame" x="661" y="244" width="86" height="30"/>
-                                <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
+                            <button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Kdt-hI-Mna">
+                                <rect key="frame" x="661" y="244.5" width="86" height="30"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="86" id="QoE-cu-Mls"/>
+                                </constraints>
                                 <state key="normal" title="Submit local"/>
                             </button>
-                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="3.22GB" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="J6c-cK-Ihd">
-                                <rect key="frame" x="217" y="200" width="111" height="21"/>
-                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="3.22GB" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="J6c-cK-Ihd">
+                                <rect key="frame" x="217" y="200" width="57" height="21"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                 <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <nil key="highlightedColor"/>
                             </label>
-                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="20160228231919" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Avj-sE-gE6">
-                                <rect key="frame" x="217" y="249" width="147" height="21"/>
-                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="20160228231919" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Avj-sE-gE6">
+                                <rect key="frame" x="217" y="249" width="134.5" height="21"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="134.5" id="oeu-Ya-C5D"/>
+                                </constraints>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                 <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <nil key="highlightedColor"/>
                             </label>
-                            <button hidden="YES" opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Vzg-50-bc2">
-                                <rect key="frame" x="664" y="196" width="83" height="30"/>
-                                <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
+                            <button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Vzg-50-bc2">
+                                <rect key="frame" x="664" y="195.5" width="83" height="30"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="83" id="V7f-LX-p8n"/>
+                                </constraints>
                                 <state key="normal" title="Clear cache"/>
                             </button>
-                            <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="jns-5C-X4w">
-                                <rect key="frame" x="614" y="147" width="133" height="30"/>
-                                <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="jns-5C-X4w">
+                                <rect key="frame" x="664" y="146.5" width="83" height="30"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="83" id="7nT-h7-42G"/>
+                                </constraints>
                                 <state key="normal" title="Sync"/>
                                 <connections>
                                     <action selector="OnCheckUpdate:" destination="FG7-WW-Z5X" eventType="touchUpInside" id="2zt-3T-WH7"/>
                                 </connections>
                             </button>
-                            <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="lgu-mf-cTC">
+                            <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="lgu-mf-cTC">
                                 <rect key="frame" x="217" y="103" width="51" height="31"/>
-                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                             </switch>
-                            <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="cIN-uF-BHa">
-                                <rect key="frame" x="664" y="294" width="83" height="30"/>
-                                <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="cIN-uF-BHa">
+                                <rect key="frame" x="664" y="293.5" width="83" height="30"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="83" id="fLN-hg-aLl"/>
+                                </constraints>
                                 <state key="normal" title="Unlock"/>
                                 <connections>
                                     <action selector="onUnlockClicked:" destination="FG7-WW-Z5X" eventType="touchUpInside" id="kED-gf-S3K"/>
                                 </connections>
                             </button>
                         </subviews>
+                        <viewLayoutGuide key="safeArea" id="Dy8-hn-8hv"/>
                         <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                        <constraints>
+                            <constraint firstItem="Kdt-hI-Mna" firstAttribute="centerY" secondItem="Avj-sE-gE6" secondAttribute="centerY" id="0XT-Ja-S72"/>
+                            <constraint firstItem="jns-5C-X4w" firstAttribute="leading" secondItem="o7T-n9-rhA" secondAttribute="trailing" constant="571.5" id="2Fw-gN-kVu"/>
+                            <constraint firstItem="Avj-sE-gE6" firstAttribute="leading" secondItem="kcI-2q-g1r" secondAttribute="trailing" constant="140" id="3dj-yW-zAc"/>
+                            <constraint firstItem="Baf-ru-Ueq" firstAttribute="leading" secondItem="iMj-3v-3eE" secondAttribute="leading" id="51q-cI-NUO"/>
+                            <constraint firstItem="mAv-YK-pnD" firstAttribute="leading" secondItem="o7T-n9-rhA" secondAttribute="trailing" constant="124.5" id="5N5-OY-Olz"/>
+                            <constraint firstItem="J6c-cK-Ihd" firstAttribute="leading" secondItem="4VN-I0-qDk" secondAttribute="trailing" constant="114" id="5wT-gF-qaq"/>
+                            <constraint firstItem="Avj-sE-gE6" firstAttribute="centerY" secondItem="kcI-2q-g1r" secondAttribute="centerY" id="6mu-OR-3PX"/>
+                            <constraint firstItem="o7T-n9-rhA" firstAttribute="leading" secondItem="iMj-3v-3eE" secondAttribute="leading" id="8kP-0d-qg8"/>
+                            <constraint firstItem="iMj-3v-3eE" firstAttribute="leading" secondItem="Dy8-hn-8hv" secondAttribute="leading" constant="20" id="B4Q-Da-EF2"/>
+                            <constraint firstItem="4VN-I0-qDk" firstAttribute="top" secondItem="o7T-n9-rhA" secondAttribute="bottom" constant="28" id="CZv-qW-ORA"/>
+                            <constraint firstItem="9fI-uo-0D5" firstAttribute="centerY" secondItem="iMj-3v-3eE" secondAttribute="centerY" id="DZp-4t-8ZO"/>
+                            <constraint firstItem="Vzg-50-bc2" firstAttribute="centerY" secondItem="J6c-cK-Ihd" secondAttribute="centerY" id="FIS-zF-1En"/>
+                            <constraint firstItem="4VN-I0-qDk" firstAttribute="leading" secondItem="iMj-3v-3eE" secondAttribute="leading" id="FWf-XI-w2t"/>
+                            <constraint firstItem="jns-5C-X4w" firstAttribute="centerY" secondItem="o7T-n9-rhA" secondAttribute="centerY" id="HT0-VQ-26B"/>
+                            <constraint firstItem="iMj-3v-3eE" firstAttribute="top" secondItem="Dy8-hn-8hv" secondAttribute="top" constant="37" id="M83-f8-Ku6"/>
+                            <constraint firstItem="cIN-uF-BHa" firstAttribute="leading" secondItem="MNF-V6-2fB" secondAttribute="trailing" constant="539" id="NIb-s3-3jb"/>
+                            <constraint firstItem="Kdt-hI-Mna" firstAttribute="leading" secondItem="Avj-sE-gE6" secondAttribute="trailing" constant="309.5" id="Q1K-g6-cd6"/>
+                            <constraint firstItem="kcI-2q-g1r" firstAttribute="leading" secondItem="iMj-3v-3eE" secondAttribute="leading" id="QCF-p3-h9f"/>
+                            <constraint firstItem="Vzg-50-bc2" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="J6c-cK-Ihd" secondAttribute="trailing" constant="8" symbolic="YES" id="QzQ-hA-MDW"/>
+                            <constraint firstItem="kcI-2q-g1r" firstAttribute="top" secondItem="4VN-I0-qDk" secondAttribute="bottom" constant="28" id="Sge-sp-Ia1"/>
+                            <constraint firstItem="Vzg-50-bc2" firstAttribute="trailing" secondItem="jns-5C-X4w" secondAttribute="trailing" id="Txv-6t-cq0"/>
+                            <constraint firstItem="lgu-mf-cTC" firstAttribute="leading" secondItem="Baf-ru-Ueq" secondAttribute="trailing" constant="40.5" id="WUI-jk-vkj"/>
+                            <constraint firstItem="J6c-cK-Ihd" firstAttribute="centerY" secondItem="4VN-I0-qDk" secondAttribute="centerY" id="XFX-zx-zZp"/>
+                            <constraint firstItem="MNF-V6-2fB" firstAttribute="top" secondItem="kcI-2q-g1r" secondAttribute="bottom" constant="28" id="Xgt-t9-2Od"/>
+                            <constraint firstItem="MNF-V6-2fB" firstAttribute="leading" secondItem="iMj-3v-3eE" secondAttribute="leading" id="ZPj-6Q-Ykk"/>
+                            <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="mAv-YK-pnD" secondAttribute="trailing" constant="20" symbolic="YES" id="a9d-ab-upE"/>
+                            <constraint firstItem="o7T-n9-rhA" firstAttribute="top" secondItem="Baf-ru-Ueq" secondAttribute="bottom" constant="22" id="aNM-CJ-uAh"/>
+                            <constraint firstItem="9fI-uo-0D5" firstAttribute="leading" secondItem="iMj-3v-3eE" secondAttribute="trailing" constant="16" id="aV4-BM-SNA"/>
+                            <constraint firstItem="mAv-YK-pnD" firstAttribute="centerY" secondItem="o7T-n9-rhA" secondAttribute="centerY" id="gmv-9s-eJL"/>
+                            <constraint firstItem="lgu-mf-cTC" firstAttribute="centerY" secondItem="Baf-ru-Ueq" secondAttribute="centerY" id="kpa-5n-mEv"/>
+                            <constraint firstItem="cIN-uF-BHa" firstAttribute="centerY" secondItem="MNF-V6-2fB" secondAttribute="centerY" id="piv-Qz-fxc"/>
+                            <constraint firstItem="cIN-uF-BHa" firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="jns-5C-X4w" secondAttribute="trailing" id="tfu-1n-jjJ"/>
+                            <constraint firstItem="Kdt-hI-Mna" firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="jns-5C-X4w" secondAttribute="trailing" id="uJN-PJ-JDu"/>
+                            <constraint firstItem="Baf-ru-Ueq" firstAttribute="top" secondItem="iMj-3v-3eE" secondAttribute="bottom" constant="30" id="ut7-Oj-tMm"/>
+                            <constraint firstItem="Dy8-hn-8hv" firstAttribute="trailing" secondItem="jns-5C-X4w" secondAttribute="trailing" constant="21" id="wJw-bV-knu"/>
+                        </constraints>
                     </view>
                     <connections>
                         <outlet property="btn_checkupdate" destination="jns-5C-X4w" id="TPE-6V-eWn"/>
@@ -141,13 +181,10 @@
         <scene sceneID="ikc-XA-PRq">
             <objects>
                 <viewController storyboardIdentifier="SortItemViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="KGB-4A-pg4" customClass="SortItemViewController" sceneMemberID="viewController">
-                    <layoutGuides>
-                        <viewControllerLayoutGuide type="top" id="y8m-zw-iWb"/>
-                        <viewControllerLayoutGuide type="bottom" id="vT0-iS-BrY"/>
-                    </layoutGuides>
                     <view key="view" contentMode="scaleToFill" id="pae-Dr-xbo">
                         <rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <viewLayoutGuide key="safeArea" id="P2G-om-1bN"/>
                         <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                     </view>
                 </viewController>
@@ -159,25 +196,19 @@
         <scene sceneID="bQH-p8-91A">
             <objects>
                 <viewController storyboardIdentifier="ModelDescriptionController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="cfs-SS-G2Z" customClass="ModelDescriptionController" sceneMemberID="viewController">
-                    <layoutGuides>
-                        <viewControllerLayoutGuide type="top" id="8OY-Jl-IVz"/>
-                        <viewControllerLayoutGuide type="bottom" id="Els-NW-lDN"/>
-                    </layoutGuides>
                     <view key="view" contentMode="scaleToFill" id="vB2-Se-iLa">
                         <rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
-                            <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" fixedFrame="YES" textAlignment="justified" translatesAutoresizingMaskIntoConstraints="NO" id="VRj-M1-sDm">
-                                <rect key="frame" x="3" y="-2" width="759" height="985"/>
-                                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                            <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" textAlignment="justified" translatesAutoresizingMaskIntoConstraints="NO" id="VRj-M1-sDm">
+                                <rect key="frame" x="3" y="0.0" width="759" height="983"/>
                                 <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                                 <string key="text">Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda.</string>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                 <textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
                             </textView>
-                            <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="yLy-4Y-3J0">
-                                <rect key="frame" x="-2" y="987" width="769" height="30"/>
-                                <autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES"/>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="yLy-4Y-3J0">
+                                <rect key="frame" x="364.5" y="987" width="39" height="30"/>
                                 <state key="normal" title="Close">
                                     <color key="titleColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
                                 </state>
@@ -186,7 +217,16 @@
                                 </connections>
                             </button>
                         </subviews>
+                        <viewLayoutGuide key="safeArea" id="Siy-AD-EVk"/>
                         <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                        <constraints>
+                            <constraint firstItem="yLy-4Y-3J0" firstAttribute="top" secondItem="VRj-M1-sDm" secondAttribute="bottom" constant="4" id="2cu-u8-9P4"/>
+                            <constraint firstItem="VRj-M1-sDm" firstAttribute="top" secondItem="vB2-Se-iLa" secondAttribute="top" id="8s6-qr-d84"/>
+                            <constraint firstItem="VRj-M1-sDm" firstAttribute="leading" secondItem="Siy-AD-EVk" secondAttribute="leading" constant="3" id="AfV-vy-Iuz"/>
+                            <constraint firstItem="Siy-AD-EVk" firstAttribute="bottom" secondItem="yLy-4Y-3J0" secondAttribute="bottom" constant="7" id="Fuz-g4-JdW"/>
+                            <constraint firstItem="Siy-AD-EVk" firstAttribute="trailing" secondItem="VRj-M1-sDm" secondAttribute="trailing" constant="6" id="p4y-HK-xsD"/>
+                            <constraint firstItem="yLy-4Y-3J0" firstAttribute="centerX" secondItem="vB2-Se-iLa" secondAttribute="centerX" id="six-Ui-ZTL"/>
+                        </constraints>
                     </view>
                     <connections>
                         <outlet property="desc_tv" destination="VRj-M1-sDm" id="4ou-i7-w86"/>
@@ -200,60 +240,77 @@
         <scene sceneID="INA-Kf-FWJ">
             <objects>
                 <viewController storyboardIdentifier="SyncControlPanelViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="Kn8-15-Yzp" customClass="SyncControlPanelViewController" sceneMemberID="viewController">
-                    <layoutGuides>
-                        <viewControllerLayoutGuide type="top" id="Jhv-HE-YuQ"/>
-                        <viewControllerLayoutGuide type="bottom" id="hKb-eE-BE7"/>
-                    </layoutGuides>
                     <view key="view" contentMode="scaleToFill" id="3kg-RW-dkB">
                         <rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
-                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Progress" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="k2H-8o-P97">
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Progress" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="k2H-8o-P97">
                                 <rect key="frame" x="20" y="64" width="68" height="21"/>
-                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                 <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <nil key="highlightedColor"/>
                             </label>
-                            <progressView opaque="NO" contentMode="scaleToFill" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="qll-0O-PAI">
-                                <rect key="frame" x="18" y="93" width="729" height="2"/>
-                                <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
+                            <progressView opaque="NO" contentMode="scaleToFill" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="qll-0O-PAI">
+                                <rect key="frame" x="18" y="93" width="729" height="4"/>
                             </progressView>
-                            <progressView opaque="NO" contentMode="scaleToFill" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="jJD-lt-Uuj">
-                                <rect key="frame" x="18" y="132" width="729" height="2"/>
-                                <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
+                            <progressView opaque="NO" contentMode="scaleToFill" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="jJD-lt-Uuj">
+                                <rect key="frame" x="18" y="132" width="729" height="4"/>
                             </progressView>
-                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Overall progress" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6P9-Se-W27">
-                                <rect key="frame" x="20" y="103" width="126" height="21"/>
-                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Overall progress" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6P9-Se-W27">
+                                <rect key="frame" x="20" y="103" width="125" height="21"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                 <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <nil key="highlightedColor"/>
                             </label>
-                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="sEa-AW-QiJ">
-                                <rect key="frame" x="219" y="20" width="329" height="24"/>
-                                <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="sEa-AW-QiJ">
+                                <rect key="frame" x="219" y="20" width="330" height="24"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="20"/>
                                 <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <nil key="highlightedColor"/>
                             </label>
-                            <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="right" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="0lX-Gd-bGG">
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="right" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="0lX-Gd-bGG">
                                 <rect key="frame" x="639" y="972" width="108" height="30"/>
-                                <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
                                 <state key="normal" title="Send log"/>
                                 <connections>
                                     <action selector="onSendlogClick:" destination="Kn8-15-Yzp" eventType="touchUpInside" id="OYC-bp-Xth"/>
                                 </connections>
                             </button>
-                            <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" fixedFrame="YES" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="e3H-tp-xCS">
+                            <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="e3H-tp-xCS">
                                 <rect key="frame" x="18" y="149" width="729" height="816"/>
-                                <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                 <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="816" id="9HB-QO-q3o"/>
+                                </constraints>
                                 <fontDescription key="fontDescription" type="system" pointSize="14"/>
                                 <textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
                             </textView>
                         </subviews>
+                        <viewLayoutGuide key="safeArea" id="Mei-7N-AuH"/>
                         <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                        <constraints>
+                            <constraint firstItem="sEa-AW-QiJ" firstAttribute="centerX" secondItem="3kg-RW-dkB" secondAttribute="centerX" id="1qQ-wL-YiJ"/>
+                            <constraint firstItem="qll-0O-PAI" firstAttribute="top" secondItem="sEa-AW-QiJ" secondAttribute="bottom" constant="49" id="2R3-Cr-zbm"/>
+                            <constraint firstItem="k2H-8o-P97" firstAttribute="leading" secondItem="3kg-RW-dkB" secondAttribute="leadingMargin" id="59X-Q1-7cl"/>
+                            <constraint firstItem="Mei-7N-AuH" firstAttribute="bottom" secondItem="0lX-Gd-bGG" secondAttribute="bottom" constant="22" id="9Gc-iq-cAK"/>
+                            <constraint firstItem="qll-0O-PAI" firstAttribute="leading" secondItem="jJD-lt-Uuj" secondAttribute="leading" id="E4W-LQ-FIl"/>
+                            <constraint firstItem="qll-0O-PAI" firstAttribute="leading" secondItem="Mei-7N-AuH" secondAttribute="leading" constant="18" id="FyB-Ni-yGZ"/>
+                            <constraint firstItem="qll-0O-PAI" firstAttribute="trailing" secondItem="0lX-Gd-bGG" secondAttribute="trailing" id="GnS-kn-HRL"/>
+                            <constraint firstItem="sEa-AW-QiJ" firstAttribute="leading" secondItem="Mei-7N-AuH" secondAttribute="leading" constant="219" id="Jk9-Sy-fXM"/>
+                            <constraint firstItem="Mei-7N-AuH" firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="k2H-8o-P97" secondAttribute="trailing" symbolic="YES" id="LZ2-00-57A"/>
+                            <constraint firstItem="e3H-tp-xCS" firstAttribute="top" secondItem="jJD-lt-Uuj" secondAttribute="bottom" constant="13" id="Lo3-p3-9oP"/>
+                            <constraint firstItem="k2H-8o-P97" firstAttribute="top" secondItem="Mei-7N-AuH" secondAttribute="top" constant="44" id="TYp-ej-wKg"/>
+                            <constraint firstItem="qll-0O-PAI" firstAttribute="top" secondItem="k2H-8o-P97" secondAttribute="bottom" constant="8" symbolic="YES" id="UR9-1P-reJ"/>
+                            <constraint firstItem="Mei-7N-AuH" firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="6P9-Se-W27" secondAttribute="trailing" symbolic="YES" id="VGU-Ez-MZv"/>
+                            <constraint firstItem="qll-0O-PAI" firstAttribute="trailing" secondItem="jJD-lt-Uuj" secondAttribute="trailing" id="Vtp-Pi-Va9"/>
+                            <constraint firstItem="sEa-AW-QiJ" firstAttribute="top" secondItem="Mei-7N-AuH" secondAttribute="top" id="Zru-2A-GRo"/>
+                            <constraint firstItem="Mei-7N-AuH" firstAttribute="trailing" secondItem="qll-0O-PAI" secondAttribute="trailing" constant="21" id="aMC-GE-Glh"/>
+                            <constraint firstItem="k2H-8o-P97" firstAttribute="leading" secondItem="6P9-Se-W27" secondAttribute="leading" id="bsW-qb-D5g"/>
+                            <constraint firstItem="0lX-Gd-bGG" firstAttribute="top" secondItem="e3H-tp-xCS" secondAttribute="bottom" constant="7" id="btN-0y-fTT"/>
+                            <constraint firstItem="qll-0O-PAI" firstAttribute="trailing" secondItem="e3H-tp-xCS" secondAttribute="trailing" id="d54-t9-VU0"/>
+                            <constraint firstItem="qll-0O-PAI" firstAttribute="leading" secondItem="e3H-tp-xCS" secondAttribute="leading" id="eFN-Cu-yoT"/>
+                            <constraint firstItem="0lX-Gd-bGG" firstAttribute="leading" secondItem="Mei-7N-AuH" secondAttribute="leading" constant="639" id="gcb-LI-7SH"/>
+                            <constraint firstItem="6P9-Se-W27" firstAttribute="top" secondItem="qll-0O-PAI" secondAttribute="bottom" constant="6" id="q4U-gw-d5L"/>
+                        </constraints>
                     </view>
                     <connections>
                         <outlet property="progress_current" destination="qll-0O-PAI" id="vAK-WH-4Z0"/>
@@ -269,10 +326,6 @@
         <scene sceneID="krL-Pg-Xlc">
             <objects>
                 <viewController storyboardIdentifier="SelectUploadOrderViewController" title="Select order to submit" useStoryboardIdentifierAsRestorationIdentifier="YES" id="c5p-Fv-SY7" customClass="SelectUploadOrderViewController" sceneMemberID="viewController">
-                    <layoutGuides>
-                        <viewControllerLayoutGuide type="top" id="ico-qj-nmu"/>
-                        <viewControllerLayoutGuide type="bottom" id="C5Q-Vh-7Ds"/>
-                    </layoutGuides>
                     <view key="view" contentMode="scaleToFill" id="eim-dc-VXV">
                         <rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@@ -289,37 +342,60 @@
                                             <rect key="frame" x="0.0" y="0.0" width="768" height="86"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
-                                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="AIn-eK-sCn">
+                                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="AIn-eK-sCn">
                                                     <rect key="frame" x="20" y="15" width="712" height="21"/>
-                                                    <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                                    <constraints>
+                                                        <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="712" id="5g9-dy-uLz"/>
+                                                    </constraints>
                                                     <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                                     <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                                     <nil key="highlightedColor"/>
                                                 </label>
-                                                <button hidden="YES" opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="hrK-DY-RbO">
-                                                    <rect key="frame" x="10" y="32" width="21" height="21"/>
-                                                    <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                                <button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="hrK-DY-RbO">
+                                                    <rect key="frame" x="10" y="32" width="21" height="22"/>
+                                                    <constraints>
+                                                        <constraint firstAttribute="width" constant="21" id="hbc-1I-70J"/>
+                                                    </constraints>
                                                     <state key="normal" image="button:hrK-DY-RbO:image"/>
-                                                    <state key="selected" image="4FBFC13B-0677-4DBA-9B05-450167191EDC"/>
+                                                    <state key="selected" image="F17C886C-7962-461C-99C6-0B7F61677DD1"/>
                                                     <connections>
                                                         <action selector="checkButtonClick:" destination="XXr-fU-67o" eventType="touchUpInside" id="KeU-ld-H4J"/>
                                                     </connections>
                                                 </button>
-                                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="v9S-8N-eqS">
+                                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="v9S-8N-eqS">
                                                     <rect key="frame" x="19" y="48" width="749" height="21"/>
-                                                    <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES"/>
+                                                    <constraints>
+                                                        <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="749" id="zHK-DK-kLR"/>
+                                                    </constraints>
                                                     <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                                     <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                                     <nil key="highlightedColor"/>
                                                 </label>
-                                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="11/08/2016 17:55:32 PST" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="efa-f8-yHS">
+                                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="11/08/2016 17:55:32 PST" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="efa-f8-yHS">
                                                     <rect key="frame" x="567" y="48" width="201" height="21"/>
-                                                    <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
+                                                    <constraints>
+                                                        <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="201" id="U8n-vC-VMI"/>
+                                                    </constraints>
                                                     <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                                     <nil key="textColor"/>
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                             </subviews>
+                                            <constraints>
+                                                <constraint firstItem="efa-f8-yHS" firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="v9S-8N-eqS" secondAttribute="trailing" id="1RN-A7-iuA"/>
+                                                <constraint firstItem="v9S-8N-eqS" firstAttribute="leading" secondItem="Ohn-hG-mj9" secondAttribute="leading" constant="19" id="DYh-mJ-eVk"/>
+                                                <constraint firstItem="v9S-8N-eqS" firstAttribute="top" secondItem="AIn-eK-sCn" secondAttribute="bottom" constant="12" id="IAt-dl-Up1"/>
+                                                <constraint firstItem="v9S-8N-eqS" firstAttribute="baseline" secondItem="efa-f8-yHS" secondAttribute="baseline" id="PSl-Vc-tvC"/>
+                                                <constraint firstAttribute="bottomMargin" secondItem="v9S-8N-eqS" secondAttribute="bottom" constant="6" id="TZq-fG-6py"/>
+                                                <constraint firstAttribute="trailing" secondItem="v9S-8N-eqS" secondAttribute="trailing" id="WJn-ry-GSJ"/>
+                                                <constraint firstItem="hrK-DY-RbO" firstAttribute="leading" secondItem="Ohn-hG-mj9" secondAttribute="leadingMargin" constant="-6" id="a3T-1Y-KnI"/>
+                                                <constraint firstItem="AIn-eK-sCn" firstAttribute="leading" secondItem="Ohn-hG-mj9" secondAttribute="leadingMargin" constant="4" id="bCw-W5-8Md"/>
+                                                <constraint firstItem="hrK-DY-RbO" firstAttribute="top" secondItem="Ohn-hG-mj9" secondAttribute="topMargin" constant="21" id="m9h-d6-bTz"/>
+                                                <constraint firstItem="efa-f8-yHS" firstAttribute="leading" secondItem="hrK-DY-RbO" secondAttribute="trailing" constant="536" id="p28-v8-dJv"/>
+                                                <constraint firstItem="hrK-DY-RbO" firstAttribute="centerY" secondItem="Ohn-hG-mj9" secondAttribute="centerY" id="rN3-ml-z03"/>
+                                                <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="AIn-eK-sCn" secondAttribute="trailing" constant="20" symbolic="YES" id="sZo-UL-SIU"/>
+                                                <constraint firstItem="v9S-8N-eqS" firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="efa-f8-yHS" secondAttribute="trailing" id="vFl-WP-y4P"/>
+                                            </constraints>
                                         </tableViewCellContentView>
                                         <connections>
                                             <outlet property="checkedButton" destination="hrK-DY-RbO" id="AcK-F0-dz8"/>
@@ -343,6 +419,7 @@
                                 </connections>
                             </button>
                         </subviews>
+                        <viewLayoutGuide key="safeArea" id="B6p-00-z8m"/>
                         <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                     </view>
                     <connections>
@@ -358,10 +435,6 @@
         <scene sceneID="Iag-oy-jaN">
             <objects>
                 <viewController storyboardIdentifier="OfflineUnlockViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="38J-Bm-huX" userLabel="Unlock offline" customClass="OfflineUnlockViewController" sceneMemberID="viewController">
-                    <layoutGuides>
-                        <viewControllerLayoutGuide type="top" id="gur-LG-w64"/>
-                        <viewControllerLayoutGuide type="bottom" id="DTK-XA-Cl4"/>
-                    </layoutGuides>
                     <view key="view" contentMode="scaleToFill" id="gyO-SO-Q7G">
                         <rect key="frame" x="0.0" y="0.0" width="480" height="320"/>
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
@@ -404,17 +477,20 @@
                                 </connections>
                             </button>
                         </subviews>
+                        <viewLayoutGuide key="safeArea" id="wkb-gO-A6l"/>
                         <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         <constraints>
+                            <constraint firstItem="wkb-gO-A6l" firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="DWa-JA-ah5" secondAttribute="trailing" symbolic="YES" id="28K-15-zSY"/>
                             <constraint firstItem="l8b-7U-g6s" firstAttribute="top" secondItem="OGq-ht-S8t" secondAttribute="bottom" constant="10" id="7ga-5U-cOL"/>
-                            <constraint firstItem="DTK-XA-Cl4" firstAttribute="top" secondItem="06f-pS-V71" secondAttribute="bottom" constant="17" id="9jU-wp-9Ni"/>
-                            <constraint firstAttribute="trailing" secondItem="OGq-ht-S8t" secondAttribute="trailing" constant="60" id="Blc-ti-3Dj"/>
-                            <constraint firstItem="DWa-JA-ah5" firstAttribute="top" secondItem="gur-LG-w64" secondAttribute="bottom" constant="47" id="ERJ-vA-lyj"/>
-                            <constraint firstItem="OGq-ht-S8t" firstAttribute="leading" secondItem="gyO-SO-Q7G" secondAttribute="leading" constant="60" id="GHo-4f-apZ"/>
-                            <constraint firstAttribute="trailing" secondItem="l8b-7U-g6s" secondAttribute="trailing" constant="60" id="GmQ-TV-ISv"/>
-                            <constraint firstAttribute="trailing" secondItem="06f-pS-V71" secondAttribute="trailing" constant="40" id="Ms4-Wq-8ZN"/>
-                            <constraint firstItem="DWa-JA-ah5" firstAttribute="leading" secondItem="gyO-SO-Q7G" secondAttribute="leading" constant="60" id="aSB-G7-Hwz"/>
-                            <constraint firstItem="l8b-7U-g6s" firstAttribute="leading" secondItem="gyO-SO-Q7G" secondAttribute="leading" constant="60" id="d4D-tG-YnZ"/>
+                            <constraint firstItem="wkb-gO-A6l" firstAttribute="bottom" secondItem="06f-pS-V71" secondAttribute="bottom" constant="17" id="9jU-wp-9Ni"/>
+                            <constraint firstItem="wkb-gO-A6l" firstAttribute="trailing" secondItem="OGq-ht-S8t" secondAttribute="trailing" constant="60" id="Blc-ti-3Dj"/>
+                            <constraint firstItem="DWa-JA-ah5" firstAttribute="top" secondItem="wkb-gO-A6l" secondAttribute="top" constant="47" id="ERJ-vA-lyj"/>
+                            <constraint firstItem="OGq-ht-S8t" firstAttribute="leading" secondItem="wkb-gO-A6l" secondAttribute="leading" constant="60" id="GHo-4f-apZ"/>
+                            <constraint firstItem="wkb-gO-A6l" firstAttribute="trailing" secondItem="l8b-7U-g6s" secondAttribute="trailing" constant="60" id="GmQ-TV-ISv"/>
+                            <constraint firstItem="wkb-gO-A6l" firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="06f-pS-V71" secondAttribute="trailing" id="Ms4-Wq-8ZN"/>
+                            <constraint firstItem="06f-pS-V71" firstAttribute="leading" secondItem="wkb-gO-A6l" secondAttribute="leading" constant="378" id="VKp-oE-HE4"/>
+                            <constraint firstItem="DWa-JA-ah5" firstAttribute="leading" secondItem="wkb-gO-A6l" secondAttribute="leading" constant="60" id="aSB-G7-Hwz"/>
+                            <constraint firstItem="l8b-7U-g6s" firstAttribute="leading" secondItem="wkb-gO-A6l" secondAttribute="leading" constant="60" id="d4D-tG-YnZ"/>
                             <constraint firstItem="OGq-ht-S8t" firstAttribute="top" secondItem="DWa-JA-ah5" secondAttribute="bottom" constant="12" id="oXL-5K-6bd"/>
                         </constraints>
                     </view>
@@ -479,7 +555,7 @@
                             <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Z2w-2n-SST">
                                 <rect key="frame" x="296" y="220" width="124" height="22"/>
                                 <constraints>
-                                    <constraint firstAttribute="width" constant="124" id="LKL-kP-Bug"/>
+                                    <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="124" id="LKL-kP-Bug"/>
                                     <constraint firstAttribute="height" constant="22" id="x3I-Ae-w2r"/>
                                 </constraints>
                                 <inset key="contentEdgeInsets" minX="4" minY="0.0" maxX="0.0" maxY="0.0"/>
@@ -492,7 +568,7 @@
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Sign in" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="knf-cd-xPX">
                                 <rect key="frame" x="60" y="87" width="60" height="26"/>
                                 <constraints>
-                                    <constraint firstAttribute="width" constant="60" id="7Xc-eA-JbQ"/>
+                                    <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="60" id="7Xc-eA-JbQ"/>
                                     <constraint firstAttribute="height" constant="26" id="qI6-Ph-C1i"/>
                                 </constraints>
                                 <fontDescription key="fontDescription" type="system" pointSize="20"/>
@@ -502,7 +578,7 @@
                             <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="right" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="vs9-qY-X1G">
                                 <rect key="frame" x="294" y="85.5" width="126" height="30"/>
                                 <constraints>
-                                    <constraint firstAttribute="width" constant="126" id="C2c-Wg-Ei7"/>
+                                    <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="126" id="C2c-Wg-Ei7"/>
                                     <constraint firstAttribute="height" constant="30" id="W9d-yI-RqE"/>
                                 </constraints>
                                 <state key="normal" title="Retrieve password">
@@ -516,7 +592,7 @@
                             <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="DaC-RK-NlU" customClass="DefaultImageButton">
                                 <rect key="frame" x="358" y="270" width="102" height="30"/>
                                 <constraints>
-                                    <constraint firstAttribute="width" constant="102" id="0lT-dg-F5n"/>
+                                    <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="102" id="0lT-dg-F5n"/>
                                     <constraint firstAttribute="height" constant="30" id="gJ1-E9-Fym"/>
                                 </constraints>
                                 <fontDescription key="fontDescription" type="system" pointSize="20"/>
@@ -564,7 +640,7 @@
                                 <rect key="frame" x="228" y="270" width="100" height="30"/>
                                 <constraints>
                                     <constraint firstAttribute="height" constant="30" id="rPG-uF-CCj"/>
-                                    <constraint firstAttribute="width" constant="100" id="vqp-gO-Dk7"/>
+                                    <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="100" id="vqp-gO-Dk7"/>
                                 </constraints>
                                 <fontDescription key="fontDescription" type="system" pointSize="15"/>
                                 <state key="normal" title="Request Login">
@@ -580,20 +656,23 @@
                         <constraints>
                             <constraint firstItem="Z2w-2n-SST" firstAttribute="bottom" secondItem="Elo-d8-kBi" secondAttribute="bottom" id="0w6-7l-11T"/>
                             <constraint firstItem="bSE-AA-Y8D" firstAttribute="leading" secondItem="knf-cd-xPX" secondAttribute="leading" id="Cym-sh-7VV"/>
+                            <constraint firstItem="vs9-qY-X1G" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="knf-cd-xPX" secondAttribute="trailing" constant="8" symbolic="YES" id="DnM-oF-wPN"/>
                             <constraint firstItem="UVr-TH-Sj9" firstAttribute="trailing" secondItem="0P5-Qd-woU" secondAttribute="trailing" id="Dsf-Yk-R4t"/>
                             <constraint firstItem="Imi-b7-qNe" firstAttribute="bottom" secondItem="DaC-RK-NlU" secondAttribute="bottom" constant="20" id="Efo-FP-hqH"/>
                             <constraint firstItem="Z2w-2n-SST" firstAttribute="top" secondItem="bSE-AA-Y8D" secondAttribute="bottom" constant="24" id="JkK-SA-AzT"/>
                             <constraint firstItem="DaC-RK-NlU" firstAttribute="centerY" secondItem="Vbx-y3-E15" secondAttribute="centerY" id="MPP-Sg-SOw"/>
-                            <constraint firstItem="Z2w-2n-SST" firstAttribute="trailing" secondItem="0P5-Qd-woU" secondAttribute="trailing" id="OXN-IK-iQw"/>
+                            <constraint firstItem="Z2w-2n-SST" firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="0P5-Qd-woU" secondAttribute="trailing" id="OXN-IK-iQw"/>
+                            <constraint firstItem="Vbx-y3-E15" firstAttribute="leading" secondItem="Imi-b7-qNe" secondAttribute="leading" constant="228" id="QI1-Go-nJ8"/>
                             <constraint firstItem="bSE-AA-Y8D" firstAttribute="top" secondItem="0P5-Qd-woU" secondAttribute="bottom" constant="9" id="Qy0-Hq-eHL"/>
                             <constraint firstItem="vs9-qY-X1G" firstAttribute="firstBaseline" secondItem="knf-cd-xPX" secondAttribute="firstBaseline" id="RpH-X6-o1o"/>
                             <constraint firstItem="bSE-AA-Y8D" firstAttribute="trailing" secondItem="0P5-Qd-woU" secondAttribute="trailing" id="UUN-kC-FJJ"/>
                             <constraint firstItem="Imi-b7-qNe" firstAttribute="trailing" secondItem="DaC-RK-NlU" secondAttribute="trailing" constant="20" id="bsS-oV-fW2"/>
                             <constraint firstItem="Elo-d8-kBi" firstAttribute="leading" secondItem="knf-cd-xPX" secondAttribute="leading" id="c0i-0M-4Ao"/>
                             <constraint firstItem="knf-cd-xPX" firstAttribute="top" secondItem="Imi-b7-qNe" secondAttribute="top" constant="67" id="e0X-AG-gSZ"/>
+                            <constraint firstItem="Z2w-2n-SST" firstAttribute="leading" secondItem="Imi-b7-qNe" secondAttribute="leading" constant="296" id="euJ-fr-PzB"/>
                             <constraint firstItem="0P5-Qd-woU" firstAttribute="top" secondItem="knf-cd-xPX" secondAttribute="bottom" constant="10" id="fQ1-00-fRl"/>
                             <constraint firstItem="0P5-Qd-woU" firstAttribute="leading" secondItem="Imi-b7-qNe" secondAttribute="leading" constant="60" id="hcU-PI-SL1"/>
-                            <constraint firstItem="DaC-RK-NlU" firstAttribute="leading" secondItem="Vbx-y3-E15" secondAttribute="trailing" constant="30" id="hkc-us-NRg"/>
+                            <constraint firstItem="DaC-RK-NlU" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Vbx-y3-E15" secondAttribute="trailing" constant="8" symbolic="YES" id="hkc-us-NRg"/>
                             <constraint firstItem="Elo-d8-kBi" firstAttribute="trailing" secondItem="0P5-Qd-woU" secondAttribute="trailing" id="l5B-8G-GBe"/>
                             <constraint firstItem="0P5-Qd-woU" firstAttribute="leading" secondItem="knf-cd-xPX" secondAttribute="leading" id="nLu-l0-5MW"/>
                             <constraint firstItem="Imi-b7-qNe" firstAttribute="trailing" secondItem="0P5-Qd-woU" secondAttribute="trailing" constant="60" id="pto-Ob-rbv"/>
@@ -632,10 +711,6 @@
         <scene sceneID="udc-on-3hE">
             <objects>
                 <viewController storyboardIdentifier="OLOSettingViewController" title="Offline Order Setting" useStoryboardIdentifierAsRestorationIdentifier="YES" id="lfk-1f-lmJ" customClass="OLOSettingViewController" sceneMemberID="viewController">
-                    <layoutGuides>
-                        <viewControllerLayoutGuide type="top" id="1Ax-TN-3w1"/>
-                        <viewControllerLayoutGuide type="bottom" id="9cM-4f-S8t"/>
-                    </layoutGuides>
                     <view key="view" contentMode="scaleToFill" id="yhb-rw-zyA">
                         <rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@@ -717,14 +792,17 @@
                                 </connections>
                             </button>
                         </subviews>
+                        <viewLayoutGuide key="safeArea" id="vVc-jN-g4M"/>
                         <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                         <constraints>
                             <constraint firstItem="aNw-mP-oBD" firstAttribute="leading" secondItem="yhb-rw-zyA" secondAttribute="leadingMargin" constant="24" id="1VK-eQ-0Ex"/>
                             <constraint firstAttribute="trailingMargin" secondItem="Fzf-aI-cFn" secondAttribute="trailing" constant="24" id="33g-WI-ag3"/>
                             <constraint firstItem="aBL-8I-Mqn" firstAttribute="leading" secondItem="aeH-Kl-T6M" secondAttribute="leading" id="4bc-tE-q2o"/>
+                            <constraint firstItem="vVc-jN-g4M" firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="Kh8-il-Vgk" secondAttribute="trailing" symbolic="YES" id="4nx-s2-tyg"/>
                             <constraint firstItem="URz-TP-ORX" firstAttribute="centerY" secondItem="9O1-4j-aHK" secondAttribute="centerY" id="6fa-f6-j63"/>
                             <constraint firstItem="xNv-rw-rP8" firstAttribute="centerY" secondItem="EZe-UB-PAW" secondAttribute="centerY" id="8SM-QG-jYU"/>
                             <constraint firstItem="dRO-ry-Snw" firstAttribute="top" secondItem="aNw-mP-oBD" secondAttribute="bottom" constant="20" id="Aw5-gL-Ksl"/>
+                            <constraint firstItem="vVc-jN-g4M" firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="UTp-Ah-jRN" secondAttribute="trailing" symbolic="YES" id="F26-Ev-wam"/>
                             <constraint firstItem="UTp-Ah-jRN" firstAttribute="leading" secondItem="Kh8-il-Vgk" secondAttribute="leading" id="N88-AW-jjm"/>
                             <constraint firstItem="aeH-Kl-T6M" firstAttribute="leading" secondItem="dRO-ry-Snw" secondAttribute="trailing" constant="20" id="Nrs-pn-l1B"/>
                             <constraint firstItem="9O1-4j-aHK" firstAttribute="leading" secondItem="Kh8-il-Vgk" secondAttribute="leading" id="O8Q-pe-2AK"/>
@@ -733,14 +811,18 @@
                             <constraint firstItem="jCN-CG-uWi" firstAttribute="top" secondItem="dRO-ry-Snw" secondAttribute="bottom" constant="20" id="R2A-ax-b4f"/>
                             <constraint firstItem="EZe-UB-PAW" firstAttribute="top" secondItem="UTp-Ah-jRN" secondAttribute="bottom" constant="20" id="Ukp-p6-zbi"/>
                             <constraint firstItem="dRO-ry-Snw" firstAttribute="leading" secondItem="yhb-rw-zyA" secondAttribute="leadingMargin" constant="24" id="YFh-DK-QUT"/>
-                            <constraint firstItem="Fzf-aI-cFn" firstAttribute="trailing" secondItem="URz-TP-ORX" secondAttribute="trailing" id="cpr-GF-2qV"/>
+                            <constraint firstItem="Fzf-aI-cFn" firstAttribute="leading" secondItem="aNw-mP-oBD" secondAttribute="trailing" constant="506.5" id="ZFp-o1-iHo"/>
+                            <constraint firstItem="xNv-rw-rP8" firstAttribute="leading" secondItem="EZe-UB-PAW" secondAttribute="trailing" constant="403.5" id="cNI-7i-eBA"/>
+                            <constraint firstItem="Fzf-aI-cFn" firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="URz-TP-ORX" secondAttribute="trailing" id="cpr-GF-2qV"/>
                             <constraint firstItem="aeH-Kl-T6M" firstAttribute="centerY" secondItem="dRO-ry-Snw" secondAttribute="centerY" id="fN6-In-Lok"/>
                             <constraint firstItem="9O1-4j-aHK" firstAttribute="top" secondItem="Kh8-il-Vgk" secondAttribute="bottom" constant="20" id="gdr-xh-g2y"/>
+                            <constraint firstItem="aBL-8I-Mqn" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="jCN-CG-uWi" secondAttribute="trailing" constant="8" symbolic="YES" id="h6y-u5-lXH"/>
                             <constraint firstItem="aBL-8I-Mqn" firstAttribute="centerY" secondItem="jCN-CG-uWi" secondAttribute="centerY" id="i6f-21-OUc"/>
-                            <constraint firstItem="Fzf-aI-cFn" firstAttribute="trailing" secondItem="xNv-rw-rP8" secondAttribute="trailing" id="m3B-Ks-c2L"/>
+                            <constraint firstItem="Fzf-aI-cFn" firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="xNv-rw-rP8" secondAttribute="trailing" id="m3B-Ks-c2L"/>
                             <constraint firstItem="aBL-8I-Mqn" firstAttribute="trailing" secondItem="aeH-Kl-T6M" secondAttribute="trailing" id="nR3-TZ-6SM"/>
                             <constraint firstItem="jCN-CG-uWi" firstAttribute="leading" secondItem="yhb-rw-zyA" secondAttribute="leadingMargin" constant="24" id="ny4-8l-9kw"/>
-                            <constraint firstItem="aNw-mP-oBD" firstAttribute="top" secondItem="1Ax-TN-3w1" secondAttribute="bottom" constant="24" id="oKm-4d-K4O"/>
+                            <constraint firstItem="aNw-mP-oBD" firstAttribute="top" secondItem="vVc-jN-g4M" secondAttribute="top" constant="24" id="oKm-4d-K4O"/>
+                            <constraint firstItem="URz-TP-ORX" firstAttribute="leading" secondItem="9O1-4j-aHK" secondAttribute="trailing" constant="345.5" id="pBw-G9-6Wm"/>
                             <constraint firstItem="Kh8-il-Vgk" firstAttribute="top" secondItem="jCN-CG-uWi" secondAttribute="bottom" constant="48" id="pJY-hA-dpe"/>
                             <constraint firstItem="EZe-UB-PAW" firstAttribute="leading" secondItem="UTp-Ah-jRN" secondAttribute="leading" id="uiL-Qi-fC7"/>
                             <constraint firstItem="Kh8-il-Vgk" firstAttribute="leading" secondItem="jCN-CG-uWi" secondAttribute="leading" id="w2g-iC-dtc"/>
@@ -760,10 +842,6 @@
         <scene sceneID="odL-0Z-JNt">
             <objects>
                 <viewController storyboardIdentifier="ServerSettingViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="4E6-80-nis" customClass="ServerSettingViewController" sceneMemberID="viewController">
-                    <layoutGuides>
-                        <viewControllerLayoutGuide type="top" id="auC-0B-URb"/>
-                        <viewControllerLayoutGuide type="bottom" id="5EI-0x-Aa2"/>
-                    </layoutGuides>
                     <view key="view" contentMode="scaleToFill" id="7d3-Km-gpZ">
                         <rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@@ -939,22 +1017,26 @@
                                 </connections>
                             </button>
                         </subviews>
+                        <viewLayoutGuide key="safeArea" id="sS1-WY-yfR"/>
                         <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                         <constraints>
                             <constraint firstItem="OM7-ch-z2g" firstAttribute="trailing" secondItem="yzC-7l-hc0" secondAttribute="trailing" id="1Be-LR-7i0"/>
                             <constraint firstItem="I4e-nd-eUd" firstAttribute="top" secondItem="R0K-zW-L9z" secondAttribute="bottom" constant="20" id="2Xj-Ia-usW"/>
+                            <constraint firstItem="sS1-WY-yfR" firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="zhm-2h-vLW" secondAttribute="trailing" symbolic="YES" id="2Zh-Py-Dnj"/>
                             <constraint firstItem="3vw-sE-OsA" firstAttribute="trailing" secondItem="tKv-XG-Ugr" secondAttribute="trailing" id="2qA-D9-mfJ"/>
                             <constraint firstItem="nFJ-HW-wWn" firstAttribute="centerY" secondItem="pjl-GE-L5s" secondAttribute="centerY" id="3DR-8Q-Axe"/>
                             <constraint firstItem="R0K-zW-L9z" firstAttribute="leading" secondItem="7d3-Km-gpZ" secondAttribute="leadingMargin" constant="10" id="4v2-eO-gar"/>
                             <constraint firstItem="bSV-E3-6Kl" firstAttribute="leading" secondItem="Xvn-bA-km7" secondAttribute="leading" id="6Sa-Bg-YcR"/>
                             <constraint firstItem="bt3-RG-tEN" firstAttribute="leading" secondItem="R0K-zW-L9z" secondAttribute="leading" id="8G9-nm-TnI"/>
                             <constraint firstItem="TQb-CN-2tn" firstAttribute="leading" secondItem="R0K-zW-L9z" secondAttribute="leading" id="8a7-Qp-xjJ"/>
-                            <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="yuq-p9-cMU" secondAttribute="trailing" constant="20" symbolic="YES" id="AOj-cR-SdM"/>
+                            <constraint firstItem="BqX-sY-rTI" firstAttribute="leading" secondItem="sS1-WY-yfR" secondAttribute="leading" constant="490.5" id="9mK-k3-0C6"/>
+                            <constraint firstItem="sS1-WY-yfR" firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="yuq-p9-cMU" secondAttribute="trailing" constant="20" symbolic="YES" id="AOj-cR-SdM"/>
+                            <constraint firstItem="sS1-WY-yfR" firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="Xvn-bA-km7" secondAttribute="trailing" symbolic="YES" id="B9s-0g-eQp"/>
                             <constraint firstItem="Obj-1G-kcW" firstAttribute="leading" secondItem="yuq-p9-cMU" secondAttribute="leading" id="Bn2-8S-64c"/>
                             <constraint firstItem="TJI-TK-yrX" firstAttribute="centerY" secondItem="Obj-1G-kcW" secondAttribute="centerY" id="EXA-Sq-gml"/>
                             <constraint firstItem="pjl-GE-L5s" firstAttribute="leading" secondItem="R0K-zW-L9z" secondAttribute="leading" id="FVr-34-x7y"/>
                             <constraint firstItem="veN-AT-j6e" firstAttribute="trailing" secondItem="3vw-sE-OsA" secondAttribute="trailing" id="HEf-Tu-qFb"/>
-                            <constraint firstItem="R0K-zW-L9z" firstAttribute="top" secondItem="auC-0B-URb" secondAttribute="bottom" constant="36" id="HFw-4H-pIJ"/>
+                            <constraint firstItem="R0K-zW-L9z" firstAttribute="top" secondItem="sS1-WY-yfR" secondAttribute="top" constant="36" id="HFw-4H-pIJ"/>
                             <constraint firstItem="Vel-ZT-H2H" firstAttribute="leading" secondItem="R0K-zW-L9z" secondAttribute="leading" id="HQS-3n-bCN"/>
                             <constraint firstItem="TJI-TK-yrX" firstAttribute="trailing" secondItem="3vw-sE-OsA" secondAttribute="trailing" id="HRD-fh-HR7"/>
                             <constraint firstItem="OM7-ch-z2g" firstAttribute="centerY" secondItem="BqX-sY-rTI" secondAttribute="centerY" id="HUv-gz-KVD"/>
@@ -962,7 +1044,7 @@
                             <constraint firstItem="ao6-r1-uXr" firstAttribute="leading" secondItem="R0K-zW-L9z" secondAttribute="leading" id="Mdq-Ji-FxD"/>
                             <constraint firstItem="TJI-TK-yrX" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Obj-1G-kcW" secondAttribute="trailing" constant="8" symbolic="YES" id="P60-Yg-CB1"/>
                             <constraint firstItem="Xvn-bA-km7" firstAttribute="top" secondItem="Obj-1G-kcW" secondAttribute="bottom" constant="36" id="QTy-BO-nXN"/>
-                            <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="I4e-nd-eUd" secondAttribute="trailing" constant="20" symbolic="YES" id="Quu-V1-6oq"/>
+                            <constraint firstItem="sS1-WY-yfR" firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="I4e-nd-eUd" secondAttribute="trailing" constant="20" symbolic="YES" id="Quu-V1-6oq"/>
                             <constraint firstItem="Thl-1o-t2R" firstAttribute="centerY" secondItem="ao6-r1-uXr" secondAttribute="centerY" id="SW9-ph-XOP"/>
                             <constraint firstItem="I4e-nd-eUd" firstAttribute="leading" secondItem="R0K-zW-L9z" secondAttribute="leading" id="TFg-oq-D04"/>
                             <constraint firstItem="Obj-1G-kcW" firstAttribute="leading" secondItem="R0K-zW-L9z" secondAttribute="leading" id="U5C-06-qZ9"/>
@@ -972,12 +1054,13 @@
                             <constraint firstItem="bSV-E3-6Kl" firstAttribute="top" secondItem="Xvn-bA-km7" secondAttribute="bottom" constant="20" id="Xnd-6C-RgU"/>
                             <constraint firstItem="ao6-r1-uXr" firstAttribute="top" secondItem="zhm-2h-vLW" secondAttribute="bottom" constant="20" id="YLl-pj-Cd7"/>
                             <constraint firstItem="i1w-0J-KZf" firstAttribute="leading" secondItem="R0K-zW-L9z" secondAttribute="leading" id="ZUW-IV-Lwd"/>
-                            <constraint firstItem="Hrq-La-ta7" firstAttribute="centerX" secondItem="7d3-Km-gpZ" secondAttribute="centerX" id="b52-iN-T1G"/>
-                            <constraint firstItem="5EI-0x-Aa2" firstAttribute="top" secondItem="pjl-GE-L5s" secondAttribute="bottom" constant="321" id="buo-Y2-8Dj"/>
+                            <constraint firstItem="Hrq-La-ta7" firstAttribute="centerX" secondItem="sS1-WY-yfR" secondAttribute="centerX" id="b52-iN-T1G"/>
+                            <constraint firstItem="sS1-WY-yfR" firstAttribute="bottom" secondItem="pjl-GE-L5s" secondAttribute="bottom" constant="321" id="buo-Y2-8Dj"/>
+                            <constraint firstItem="tKv-XG-Ugr" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Vel-ZT-H2H" secondAttribute="trailing" constant="8" symbolic="YES" id="cUi-Z8-aez"/>
                             <constraint firstItem="tKv-XG-Ugr" firstAttribute="centerY" secondItem="Vel-ZT-H2H" secondAttribute="centerY" id="d4b-Fa-8gv"/>
                             <constraint firstItem="Thl-1o-t2R" firstAttribute="trailing" secondItem="veN-AT-j6e" secondAttribute="trailing" id="dFo-jW-Qya"/>
                             <constraint firstItem="nFJ-HW-wWn" firstAttribute="trailing" secondItem="3vw-sE-OsA" secondAttribute="trailing" id="ddH-L0-dQH"/>
-                            <constraint firstItem="SRC-EL-dQp" firstAttribute="centerX" secondItem="7d3-Km-gpZ" secondAttribute="centerX" id="fOb-y7-QHB"/>
+                            <constraint firstItem="SRC-EL-dQp" firstAttribute="centerX" secondItem="sS1-WY-yfR" secondAttribute="centerX" id="fOb-y7-QHB"/>
                             <constraint firstItem="yuq-p9-cMU" firstAttribute="top" secondItem="i1w-0J-KZf" secondAttribute="bottom" constant="36" id="fQF-nn-k42"/>
                             <constraint firstItem="TQb-CN-2tn" firstAttribute="leading" secondItem="yuq-p9-cMU" secondAttribute="leading" id="g0N-k3-cqN"/>
                             <constraint firstItem="pjl-GE-L5s" firstAttribute="leading" secondItem="TQb-CN-2tn" secondAttribute="leading" id="hcZ-c0-Ctj"/>
@@ -989,14 +1072,17 @@
                             <constraint firstItem="3vw-sE-OsA" firstAttribute="trailing" secondItem="i1w-0J-KZf" secondAttribute="trailing" id="neN-ot-wfg"/>
                             <constraint firstItem="zhm-2h-vLW" firstAttribute="leading" secondItem="TQb-CN-2tn" secondAttribute="leading" id="ogE-Y1-fHv"/>
                             <constraint firstItem="Xvn-bA-km7" firstAttribute="leading" secondItem="yuq-p9-cMU" secondAttribute="leading" id="oze-Sv-irq"/>
-                            <constraint firstItem="OM7-ch-z2g" firstAttribute="leading" secondItem="BqX-sY-rTI" secondAttribute="trailing" constant="48" id="qFU-BW-R9Y"/>
+                            <constraint firstItem="OM7-ch-z2g" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="BqX-sY-rTI" secondAttribute="trailing" symbolic="YES" id="qFU-BW-R9Y"/>
                             <constraint firstItem="i1w-0J-KZf" firstAttribute="top" secondItem="I4e-nd-eUd" secondAttribute="bottom" constant="10" id="qfP-6Q-JBd"/>
+                            <constraint firstItem="Thl-1o-t2R" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="ao6-r1-uXr" secondAttribute="trailing" constant="8" symbolic="YES" id="qy4-Tq-PnS"/>
+                            <constraint firstItem="veN-AT-j6e" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="bSV-E3-6Kl" secondAttribute="trailing" constant="8" symbolic="YES" id="rBb-T8-TO3"/>
                             <constraint firstAttribute="trailingMargin" secondItem="3vw-sE-OsA" secondAttribute="trailing" constant="10" id="rDV-kc-ko1"/>
                             <constraint firstItem="SRC-EL-dQp" firstAttribute="top" secondItem="Hrq-La-ta7" secondAttribute="bottom" constant="10" id="raN-Nz-TAV"/>
+                            <constraint firstItem="yzC-7l-hc0" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="bt3-RG-tEN" secondAttribute="trailing" constant="8" symbolic="YES" id="sjz-L3-RMo"/>
                             <constraint firstItem="zhm-2h-vLW" firstAttribute="top" secondItem="bSV-E3-6Kl" secondAttribute="bottom" constant="36" id="unc-R7-Kw8"/>
                             <constraint firstItem="Vel-ZT-H2H" firstAttribute="top" secondItem="bt3-RG-tEN" secondAttribute="bottom" constant="20" id="vwp-Tm-MLJ"/>
-                            <constraint firstItem="5EI-0x-Aa2" firstAttribute="top" secondItem="OM7-ch-z2g" secondAttribute="bottom" constant="36" id="wob-ev-E1S"/>
-                            <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="TQb-CN-2tn" secondAttribute="trailing" constant="20" symbolic="YES" id="x3D-8R-lg2"/>
+                            <constraint firstItem="sS1-WY-yfR" firstAttribute="bottom" secondItem="OM7-ch-z2g" secondAttribute="bottom" constant="36" id="wob-ev-E1S"/>
+                            <constraint firstItem="sS1-WY-yfR" firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="TQb-CN-2tn" secondAttribute="trailing" constant="20" symbolic="YES" id="x3D-8R-lg2"/>
                             <constraint firstItem="nFJ-HW-wWn" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="pjl-GE-L5s" secondAttribute="trailing" constant="8" symbolic="YES" id="yc1-RV-uTJ"/>
                             <constraint firstItem="pjl-GE-L5s" firstAttribute="top" secondItem="TQb-CN-2tn" secondAttribute="bottom" constant="20" id="zrU-DR-xHf"/>
                         </constraints>
@@ -1019,7 +1105,7 @@
         </scene>
     </scenes>
     <resources>
-        <image name="4FBFC13B-0677-4DBA-9B05-450167191EDC" width="24" height="24">
+        <image name="F17C886C-7962-461C-99C6-0B7F61677DD1" width="24" height="24">
             <mutableData key="keyedArchiveRepresentation">
 YnBsaXN0MDDUAQIDBAUGBwpYJHZlcnNpb25ZJGFyY2hpdmVyVCR0b3BYJG9iamVjdHMSAAGGoF8QD05T
 S2V5ZWRBcmNoaXZlctEICVRyb290gAGuCwwZGh8UJCkqMTQ3PUBVJG51bGzWDQ4PEBESExQVFhcYVk5T

+ 8 - 1
common/RAUtils.m

@@ -1100,7 +1100,14 @@ done:
 
 + (UIWindow *)keyWindow
 {
-    NSArray<UIWindow *> *windows = [[UIApplication sharedApplication] windows];
+    NSArray<UIWindow *> *windows ;
+#if  __IPHONE_OS_VERSION_MIN_REQUIRED <150000
+    windows= [[UIApplication sharedApplication] windows];
+#else
+    NSArray *scenes=[[[UIApplication sharedApplication] connectedScenes] allObjects];
+    windows=[[scenes objectAtIndex:0] windows];
+#endif
+    
     for (UIWindow *window in windows) {
         if (window.isKeyWindow) {
             return window;

+ 1 - 1
common/Tab Based Framework/RootViewController.m

@@ -27,7 +27,7 @@
     [self registForNotification];
     
     
-    self.automaticallyAdjustsScrollViewInsets = NO;
+//    self.automaticallyAdjustsScrollViewInsets = NO;
 //    self.navigationItem.navi
 //     [self.navigationController setNavigationBarHidden:YES animated:YES];
     

+ 4 - 2
common/customUI/CustomIOSAlertView.m

@@ -419,8 +419,10 @@ CGFloat buttonSpacerHeight = 0;
     CGSize dialogSize = [self countDialogSize];
     CGSize keyboardSize = [[[notification userInfo] objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size;
 
-    UIInterfaceOrientation interfaceOrientation = [[UIApplication sharedApplication] statusBarOrientation];
-    if (UIInterfaceOrientationIsLandscape(interfaceOrientation) && NSFoundationVersionNumber <= NSFoundationVersionNumber_iOS_7_1) {
+//    UIInterfaceOrientation interfaceOrientation = [[UIApplication sharedApplication] statusBarOrientation];
+    
+    UIInterfaceOrientation orientation =[RAUtils query_orientation:[RAUtils getViewController:self]];
+    if (UIInterfaceOrientationIsLandscape(orientation) && NSFoundationVersionNumber <= NSFoundationVersionNumber_iOS_7_1) {
         CGFloat tmp = keyboardSize.height;
         keyboardSize.height = keyboardSize.width;
         keyboardSize.width = tmp;

+ 10 - 8
common/customUI/commoneditor/CommonEditorBannerCell.m

@@ -14,7 +14,7 @@
 
 @interface CommonEditorBannerCell () <UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout>
 {
-    NSMutableDictionary *_contentJson;
+
 }
 
 @property (weak, nonatomic) IBOutlet RAYTPlayer *ytplayerView;
@@ -22,7 +22,7 @@
 @property (strong, nonatomic) IBOutlet UIPageControl *pageControlView;
 @property (strong, nonatomic) IBOutlet UICollectionView *bannerCollectionView;
 @property (nonatomic,strong) UICollectionViewFlowLayout *flowLayout;
-
+@property (nonatomic,strong) NSMutableDictionary *contentJson;
 @end
 
 
@@ -78,23 +78,25 @@
 #pragma mark - Interface
 
 - (NSDictionary *)content {
-    return _contentJson;
+    return self.contentJson;
 }
 
 - (void)setContent:(NSDictionary *)content {
     _contentJson = [content mutableCopy];
     
-    int count = [[_contentJson objectForKey:@"count"] intValue];
+    int count = [[self.contentJson objectForKey:@"count"] intValue];
     
     self.pageControlView.numberOfPages = count;
     self.pageControlView.currentPage = 0;
     
+    __weak typeof(self) weakself = self;
+    
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
         
         for(int i=0;i<count;i++)
         {
             
-            NSDictionary* item_json=[_contentJson objectForKey:[NSString stringWithFormat:@"item_%d",i]];
+            NSDictionary* item_json=[weakself.contentJson objectForKey:[NSString stringWithFormat:@"item_%d",i]];
             
             NSString* type = item_json[@"type"];
 
@@ -121,7 +123,7 @@
             {
                 dispatch_async(dispatch_get_main_queue(), ^{
                     UIImage * img =[UIImage imageWithData:img_data];
-                    [self updateImage:img atIndex:i];
+                    [weakself updateImage:img atIndex:i];
 
                 });
             }
@@ -139,14 +141,14 @@
                         [FileCache cache_img:downloadimg_data filename:file_name saveTo:img_url];
                         
                         UIImage * img =[UIImage imageWithData:downloadimg_data];
-                        [self updateImage:img atIndex:i];
+                        [weakself updateImage:img atIndex:i];
 
                     }
                     else
                     {
 
                         UIImage * img =[UIImage imageNamed:@"notfound_l"];
-                        [self updateImage:img atIndex:i];
+                        [weakself updateImage:img atIndex:i];
 
                     }
                     

+ 1 - 1
common/customUI/commoneditor/EnumSelectOnlineViewController.h

@@ -46,7 +46,7 @@ NS_ASSUME_NONNULL_BEGIN
 @property bool hide_navibar;
 @property bool reset;
 @property int filter_count;
-@property (strong,nonatomic) NSString* keywords;
+@property (strong,nonatomic,nullable) NSString* keywords;
 
 #pragma mark 在线cadedate
 @property bool online_enum ;

+ 2 - 1
common/customUI/commoneditor/EnumSelectOnlineViewController.m

@@ -15,7 +15,8 @@
 #import "ResultPresenter.h"
 #import "JLRefreshHeader.h"
 #import "JLRefreshFooter.h"
-
+#import "RAUtils.h"
+#import "RAProgressHUD.h"
 #define  DEF_CELL_HEIGHT 44
 //#define  DEF_TABLE_HEIGHT 44
 //#define  LINE_WIDTH 0

+ 18 - 19
common/customUI/commoneditor/Phone_Web_Cell.xib

@@ -1,11 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13196" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
-    <device id="retina4_7" orientation="portrait">
-        <adaptation id="fullscreen"/>
-    </device>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+    <device id="retina4_7" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13173"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21678"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
@@ -15,28 +13,29 @@
             <rect key="frame" x="0.0" y="0.0" width="768" height="186"/>
             <autoresizingMask key="autoresizingMask"/>
             <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="8eQ-NB-syn" id="ScR-YK-gMK">
-                <rect key="frame" x="0.0" y="0.0" width="768" height="185.5"/>
+                <rect key="frame" x="0.0" y="0.0" width="768" height="186"/>
                 <autoresizingMask key="autoresizingMask"/>
                 <subviews>
-                    <webView userInteractionEnabled="NO" contentMode="scaleToFill" allowsInlineMediaPlayback="NO" mediaPlaybackRequiresUserAction="NO" mediaPlaybackAllowsAirPlay="NO" keyboardDisplayRequiresUserAction="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yhT-1o-dWH">
-                        <rect key="frame" x="0.0" y="0.0" width="768" height="185.5"/>
-                        <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-                        <dataDetectorType key="dataDetectorTypes"/>
-                        <connections>
-                            <outlet property="delegate" destination="8eQ-NB-syn" id="NHg-Y2-IC5"/>
-                        </connections>
-                    </webView>
+                    <wkWebView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="7Zb-Ou-bSY">
+                        <rect key="frame" x="0.0" y="0.0" width="768" height="186"/>
+                        <color key="backgroundColor" red="0.36078431370000003" green="0.38823529410000002" blue="0.4039215686" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                        <wkWebViewConfiguration key="configuration">
+                            <audiovisualMediaTypes key="mediaTypesRequiringUserActionForPlayback" none="YES"/>
+                            <wkPreferences key="preferences"/>
+                        </wkWebViewConfiguration>
+                    </wkWebView>
                 </subviews>
                 <constraints>
-                    <constraint firstItem="yhT-1o-dWH" firstAttribute="height" secondItem="ScR-YK-gMK" secondAttribute="height" id="6KP-m4-Tlg"/>
-                    <constraint firstItem="yhT-1o-dWH" firstAttribute="centerY" secondItem="ScR-YK-gMK" secondAttribute="centerY" id="JrV-0O-60Z"/>
-                    <constraint firstItem="yhT-1o-dWH" firstAttribute="width" secondItem="ScR-YK-gMK" secondAttribute="width" id="jxl-Ac-dHU"/>
-                    <constraint firstItem="yhT-1o-dWH" firstAttribute="centerX" secondItem="ScR-YK-gMK" secondAttribute="centerX" id="mCR-gd-B8c"/>
+                    <constraint firstItem="7Zb-Ou-bSY" firstAttribute="top" secondItem="ScR-YK-gMK" secondAttribute="top" id="5BF-O5-mfk"/>
+                    <constraint firstAttribute="bottom" secondItem="7Zb-Ou-bSY" secondAttribute="bottom" id="cr8-8M-MEX"/>
+                    <constraint firstItem="7Zb-Ou-bSY" firstAttribute="leading" secondItem="ScR-YK-gMK" secondAttribute="leading" id="cyP-YA-tpi"/>
+                    <constraint firstAttribute="trailing" secondItem="7Zb-Ou-bSY" secondAttribute="trailing" id="eVw-M8-Ayg"/>
                 </constraints>
             </tableViewCellContentView>
             <connections>
-                <outlet property="webview" destination="yhT-1o-dWH" id="MWp-VM-GX6"/>
+                <outlet property="wkwebview" destination="7Zb-Ou-bSY" id="UDd-PS-5Za"/>
             </connections>
+            <point key="canvasLocation" x="139" y="-10"/>
         </tableViewCell>
     </objects>
 </document>