Kaynağa Gözat

tradefiling demo 1

Ray Zhang 5 yıl önce
ebeveyn
işleme
9a1b553775
45 değiştirilmiş dosya ile 1940 ekleme ve 1925 silme
  1. 6 6
      Apex Mobile/Apex Mobile.xcodeproj/project.pbxproj
  2. 3 3
      Apex Mobile/Apex Mobile/Main.storyboard
  3. 2 2
      RA Image/RA Image.xcodeproj/project.pbxproj
  4. BIN
      RA TradeFiling/RA TradeFiling.xcodeproj/project.xcworkspace/xcuserdata/ruizhang.xcuserdatad/UserInterfaceState.xcuserstate
  5. 7 5
      RedAnt ERP Mobile/HMLG Mobile.xcodeproj/project.pbxproj
  6. 2 2
      RedAnt ERP Mobile/common/CartUtils.m
  7. 39 25
      RedAnt ERP Mobile/common/CommonEditor/CommonEditorBannerCell.m
  8. 2 1
      RedAnt ERP Mobile/common/CommonEditor/CommonEditorViewController.h
  9. 8 10
      RedAnt ERP Mobile/common/CommonEditor/Phone_Banner_Cell.xib
  10. 2 0
      RedAnt ERP Mobile/common/ERPCommonConst.h
  11. 1 1
      RedAnt ERP Mobile/common/Functions/offline/SyncControlPanelViewController.m
  12. 0 96
      RedAnt ERP Mobile/common/RAUtils.h
  13. 0 1056
      RedAnt ERP Mobile/common/RAUtils.m
  14. 1 1
      RedAnt ERP Mobile/common/data_provider/RANetwork.h
  15. 12 12
      RedAnt ERP Mobile/common/data_provider/RANetwork.m
  16. 7 5
      RedAnt ERP Mobile/iSales-GATIT.xcodeproj/project.pbxproj
  17. 7 5
      RedAnt ERP Mobile/iSales-HOMER.xcodeproj/project.pbxproj
  18. 7 5
      RedAnt ERP Mobile/iSales-NPD.xcodeproj/project.pbxproj
  19. 7 5
      RedAnt ERP Mobile/iSales-TRADESHOW.xcodeproj/project.pbxproj
  20. 7 5
      RedAnt ERP Mobile/iSales-UNITED WAVER.xcodeproj/project.pbxproj
  21. 7 5
      RedAnt ERP Mobile/iSales-USAI.xcodeproj/project.pbxproj
  22. 37 192
      RedAnt Mobile/RedAnt Mobile.xcodeproj/project.pbxproj
  23. 142 66
      RedAnt Mobile/RedAnt Mobile/LoginSettingViewController.m
  24. 113 64
      RedAnt Mobile/RedAnt Mobile/LoginViewController.m
  25. 97 72
      RedAnt Mobile/RedAnt Mobile/RAModeListViewController.m
  26. 46 17
      RedAnt Mobile/RedAnt Mobile/RANetwork.h
  27. 672 0
      RedAnt Mobile/RedAnt Mobile/RANetwork.m
  28. 328 168
      RedAnt Mobile/RedAnt Mobile/RAResultViewController.m
  29. 48 23
      RedAnt Mobile/RedAnt Mobile/SearchSettingViewController.m
  30. 34 27
      RedAnt Mobile/RedAnt Mobile/SearchViewController.m
  31. 2 0
      RedAnt Mobile/RedAnt Mobile/config.h
  32. 7 4
      RedAnt Mobile/RedAnt Mobile/detail/OrderDetailViewController.m
  33. 2 2
      RedAnt Mobile/RedAnt Mobile/predef_query.json
  34. 2 1
      RedAnt Mobile/RedAnt Mobile/query_setting.json
  35. 1 1
      RedAnt Mobile/RedAnt Mobile/search_ui.json
  36. 2 2
      Redant Drivers/Apex And Drivers/AppDelegate.m
  37. 0 1
      Redant Drivers/Apex And Drivers/Info.plist
  38. 5 5
      common/NetworkUtils.m
  39. 2 1
      common/RAConvertor.h
  40. 17 0
      common/RAConvertor.m
  41. 25 1
      common/RAUtils.h
  42. 40 28
      common/RAUtils.m
  43. 33 0
      common/Tab Based Framework/RootViewController.h
  44. 99 0
      common/Tab Based Framework/RootViewController.m
  45. 59 0
      common/common_const.h

+ 6 - 6
Apex Mobile/Apex Mobile.xcodeproj/project.pbxproj

@@ -14,6 +14,7 @@
 		3C2D99A5239B93C8007B759E /* AMViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C2D99A4239B93C8007B759E /* AMViewController.m */; };
 		3C57169D23D186A30002E9FC /* WebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C57169A23D186A30002E9FC /* WebViewController.m */; };
 		3C57169E23D186A30002E9FC /* wkweb.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3C57169B23D186A30002E9FC /* wkweb.storyboard */; };
+		3C5F8CCB2577764700CFD26A /* RAUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C5F8CC92577764700CFD26A /* RAUtils.m */; };
 		3CA1A2DE23A212E700639FCC /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3CA1A2DD23A212E700639FCC /* Launch Screen.storyboard */; };
 		3CE1DD02251C87DC00630A4F /* ApexResultAirBookingCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CE1DCFC251C87DC00630A4F /* ApexResultAirBookingCell.m */; };
 		3CE1DD03251C87DC00630A4F /* ApexResultAirBookingCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3CE1DCFD251C87DC00630A4F /* ApexResultAirBookingCell.xib */; };
@@ -138,7 +139,6 @@
 		715643DE201C1AE600B04267 /* my.json in Resources */ = {isa = PBXBuildFile; fileRef = 715643DD201C1AE600B04267 /* my.json */; };
 		7157098E2021572600EFE5C5 /* NetworkUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 7157098C2021572600EFE5C5 /* NetworkUtils.m */; };
 		715709922021574D00EFE5C5 /* RAConvertor.m in Sources */ = {isa = PBXBuildFile; fileRef = 715709912021574D00EFE5C5 /* RAConvertor.m */; };
-		71570996202157A600EFE5C5 /* RAUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 71570995202157A600EFE5C5 /* RAUtils.m */; };
 		71570999202157BD00EFE5C5 /* RANetworkTaskDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 71570997202157BC00EFE5C5 /* RANetworkTaskDelegate.m */; };
 		715709A520215B5100EFE5C5 /* zip.c in Sources */ = {isa = PBXBuildFile; fileRef = 7157099C20215B5000EFE5C5 /* zip.c */; };
 		715709A620215B5100EFE5C5 /* unzip.c in Sources */ = {isa = PBXBuildFile; fileRef = 7157099E20215B5000EFE5C5 /* unzip.c */; };
@@ -228,6 +228,8 @@
 		3C57169A23D186A30002E9FC /* WebViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = WebViewController.m; path = "../../common/WK PDF+Web/WebViewController.m"; sourceTree = "<group>"; };
 		3C57169B23D186A30002E9FC /* wkweb.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = wkweb.storyboard; path = "../../common/WK PDF+Web/wkweb.storyboard"; sourceTree = "<group>"; };
 		3C57169C23D186A30002E9FC /* WebViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebViewController.h; path = "../../common/WK PDF+Web/WebViewController.h"; sourceTree = "<group>"; };
+		3C5F8CC92577764700CFD26A /* RAUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RAUtils.m; path = ../../common/RAUtils.m; sourceTree = "<group>"; };
+		3C5F8CCA2577764700CFD26A /* RAUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RAUtils.h; path = ../../common/RAUtils.h; sourceTree = "<group>"; };
 		3CA1A2DD23A212E700639FCC /* Launch Screen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = "<group>"; };
 		3CE1DCFC251C87DC00630A4F /* ApexResultAirBookingCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ApexResultAirBookingCell.m; sourceTree = "<group>"; };
 		3CE1DCFD251C87DC00630A4F /* ApexResultAirBookingCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ApexResultAirBookingCell.xib; sourceTree = "<group>"; };
@@ -438,8 +440,6 @@
 		715709902021574D00EFE5C5 /* RAConvertor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RAConvertor.h; path = ../../common/RAConvertor.h; sourceTree = "<group>"; };
 		715709912021574D00EFE5C5 /* RAConvertor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RAConvertor.m; path = ../../common/RAConvertor.m; sourceTree = "<group>"; };
 		715709932021576A00EFE5C5 /* const.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = const.h; sourceTree = "<group>"; };
-		71570994202157A600EFE5C5 /* RAUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RAUtils.h; path = "../../RedAnt ERP Mobile/common/RAUtils.h"; sourceTree = "<group>"; };
-		71570995202157A600EFE5C5 /* RAUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RAUtils.m; path = "../../RedAnt ERP Mobile/common/RAUtils.m"; sourceTree = "<group>"; };
 		71570997202157BC00EFE5C5 /* RANetworkTaskDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RANetworkTaskDelegate.m; path = ../../common/upload/RANetworkTaskDelegate.m; sourceTree = "<group>"; };
 		71570998202157BC00EFE5C5 /* RANetworkTaskDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RANetworkTaskDelegate.h; path = ../../common/upload/RANetworkTaskDelegate.h; sourceTree = "<group>"; };
 		7157099A2021591F00EFE5C5 /* config.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = "<group>"; };
@@ -969,10 +969,10 @@
 		7157098F2021573600EFE5C5 /* utils */ = {
 			isa = PBXGroup;
 			children = (
+				3C5F8CCA2577764700CFD26A /* RAUtils.h */,
+				3C5F8CC92577764700CFD26A /* RAUtils.m */,
 				715709AF20215DEC00EFE5C5 /* AES */,
 				7157099B20215B4100EFE5C5 /* zip */,
-				71570994202157A600EFE5C5 /* RAUtils.h */,
-				71570995202157A600EFE5C5 /* RAUtils.m */,
 				715709902021574D00EFE5C5 /* RAConvertor.h */,
 				715709912021574D00EFE5C5 /* RAConvertor.m */,
 			);
@@ -1578,6 +1578,7 @@
 				42253C94209C007700879B09 /* AMMapView.m in Sources */,
 				715709BA20215E0000EFE5C5 /* NSString+Base64.m in Sources */,
 				71AE427318C47AF900B8EC3D /* SearchViewController.m in Sources */,
+				3C5F8CCB2577764700CFD26A /* RAUtils.m in Sources */,
 				715643BE2019AA9B00B04267 /* LoginViewController.m in Sources */,
 				4225E43321E08A54009D2364 /* ApexResultContainerCell.m in Sources */,
 				7103C84B22549E7F00261926 /* CLLocation+Sino.m in Sources */,
@@ -1637,7 +1638,6 @@
 				71F67CF919065EA8004E8462 /* SimpleMenu.m in Sources */,
 				719A51BA18C5AB7B0080C075 /* SimpleGridComponent.m in Sources */,
 				42C6754E21E2F1D4001E3FF4 /* ApexResultAdditionView.m in Sources */,
-				71570996202157A600EFE5C5 /* RAUtils.m in Sources */,
 				715643BB20198A9900B04267 /* RootViewController.m in Sources */,
 				4225E42D21E08895009D2364 /* ApexResultViewController+TableDelegate.m in Sources */,
 				426E8ABA202163EC0073BA5D /* JLPresentationController.m in Sources */,

+ 3 - 3
Apex Mobile/Apex Mobile/Main.storyboard

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="YOs-rL-bRV">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17506" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="YOs-rL-bRV">
     <device id="retina5_5" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment version="4368" identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17505"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -1787,7 +1787,7 @@
                                                     <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                                     <subviews>
                                                         <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0Vu-9P-I7w" customClass="MDHTMLLabel">
-                                                            <rect key="frame" x="175" y="8" width="231" height="29"/>
+                                                            <rect key="frame" x="174" y="8" width="231" height="29"/>
                                                             <autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" heightSizable="YES"/>
                                                             <fontDescription key="fontDescription" type="system" pointSize="13"/>
                                                             <nil key="textColor"/>

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

@@ -1008,7 +1008,7 @@
 			buildSettings = {
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				CURRENT_PROJECT_VERSION = 47190;
+				CURRENT_PROJECT_VERSION = 47192;
 				DEVELOPMENT_TEAM = HXWLAA5YN5;
 				INFOPLIST_FILE = "RA Image/Info.plist";
 				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
@@ -1025,7 +1025,7 @@
 			buildSettings = {
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
-				CURRENT_PROJECT_VERSION = 47190;
+				CURRENT_PROJECT_VERSION = 47192;
 				DEVELOPMENT_TEAM = HXWLAA5YN5;
 				INFOPLIST_FILE = "RA Image/Info.plist";
 				IPHONEOS_DEPLOYMENT_TARGET = 11.0;

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


+ 7 - 5
RedAnt ERP Mobile/HMLG Mobile.xcodeproj/project.pbxproj

@@ -1878,7 +1878,7 @@
 		7183E83C1CF2913E00524787 /* Project object */ = {
 			isa = PBXProject;
 			attributes = {
-				LastUpgradeCheck = 1020;
+				LastUpgradeCheck = 1200;
 				ORGANIZATIONNAME = "United Software Applications, Inc";
 				TargetAttributes = {
 					7183E8431CF2913E00524787 = {
@@ -2228,6 +2228,7 @@
 				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
 				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
 				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
 				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
 				CLANG_WARN_STRICT_PROTOTYPES = YES;
 				CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -2257,7 +2258,7 @@
 					"$(PROJECT_DIR)/common/qrcode",
 					"$(PROJECT_DIR)/common/CommonEditor",
 				);
-				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib";
 				MTL_ENABLE_DEBUG_INFO = YES;
 				ONLY_ACTIVE_ARCH = YES;
@@ -2290,6 +2291,7 @@
 				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
 				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
 				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
 				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
 				CLANG_WARN_STRICT_PROTOTYPES = YES;
 				CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -2313,7 +2315,7 @@
 					"$(PROJECT_DIR)/common/qrcode",
 					"$(PROJECT_DIR)/common/CommonEditor",
 				);
-				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib";
 				MTL_ENABLE_DEBUG_INFO = NO;
 				SDKROOT = iphoneos;
@@ -2343,7 +2345,7 @@
 					"\"${PODS_ROOT}/Headers/Public/AFNetworking\"",
 				);
 				INFOPLIST_FILE = "HMLG Mobile/Info.plist";
-				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
 				LIBRARY_SEARCH_PATHS = (
 					"$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib",
@@ -2376,7 +2378,7 @@
 					"\"${PODS_ROOT}/Headers/Public/AFNetworking\"",
 				);
 				INFOPLIST_FILE = "HMLG Mobile/Info.plist";
-				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
 				LIBRARY_SEARCH_PATHS = (
 					"$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib",

+ 2 - 2
RedAnt ERP Mobile/common/CartUtils.m

@@ -25,8 +25,8 @@
                 [waitalert dismissViewControllerAnimated:YES completion:^{
                     if([[return_json valueForKey:@"result"] intValue]==2)
                     {
-                        int result=[[return_json valueForKey:@"result"] intValue];
-                        if(result==2)
+                        int resulti=[[return_json valueForKey:@"result"] intValue];
+                        if(resulti==2)
                         {
                             //successed.
                             

+ 39 - 25
RedAnt ERP Mobile/common/CommonEditor/CommonEditorBannerCell.m

@@ -8,7 +8,8 @@
 
 #import "CommonEditorBannerCell.h"
 #import "CommonEditorBannerItemCell.h"
-#import "YTPlayerView.h"
+
+#import "RAYTPlayer.h"
 #import "FileCache.h"
 
 @interface CommonEditorBannerCell () <UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout>
@@ -16,7 +17,8 @@
     NSMutableDictionary *_contentJson;
 }
 
-@property (weak, nonatomic) IBOutlet YTPlayerView *playerView;
+@property (weak, nonatomic) IBOutlet RAYTPlayer *ytplayerView;
+
 @property (strong, nonatomic) IBOutlet UIPageControl *pageControlView;
 @property (strong, nonatomic) IBOutlet UICollectionView *bannerCollectionView;
 @property (nonatomic,strong) UICollectionViewFlowLayout *flowLayout;
@@ -185,8 +187,9 @@
 #pragma mark - Private
 
 - (IBAction)closePlayerBtnClick:(UIButton *)sender {
-    [self.playerView stopVideo];
-    self.playerView.hidden=true;
+    [self.ytplayerView stopVideo];
+    
+    self.ytplayerView.hidden=true;
 }
 
 
@@ -235,33 +238,44 @@
     if([item[@"type"] isEqualToString:@"video"])
     {
         
-        NSString* video_code=item[@"code"];
-
-        NSString* video_id=[self.playerView Embed2VID:video_code];
-        
-        NSDictionary *playerVars = @{
-                                     @"playsinline" : @1,
-                                     @"autoplay" : @(1),
-                                     @"rel":@0,
-                                     @"showinfo": @0,
-                                     @"modestbranding":@0,
-                                     @"enablejsapi":@1
-                                     };
+//        NSString* video_code=item[@"code"];
+//
+//        NSString* video_id=[self.playerView Embed2VID:video_code];
+//
+//        NSDictionary *playerVars = @{
+//                                     @"playsinline" : @1,
+//                                     @"autoplay" : @(1),
+//                                     @"rel":@0,
+//                                     @"showinfo": @0,
+//                                     @"modestbranding":@0,
+//                                     @"enablejsapi":@1
+//                                     };
+//
+//        [self.playerView loadWithVideoId:video_id playerVars:playerVars];
+//        for(UIView *v in self.playerView.subviews)
+//        {
+//            if([v isKindOfClass:[UIButton class] ])
+//                [self.playerView bringSubviewToFront:v];
+//        }
+//        if (@available(iOS 9.0, *)) {
+//            self.playerView.webView.allowsPictureInPictureMediaPlayback=false;
+//        } else {
+//            // Fallback on earlier versions
+//        }
+//        self.playerView.hidden=false;
         
-        [self.playerView loadWithVideoId:video_id playerVars:playerVars];
-        for(UIView *v in self.playerView.subviews)
+        NSString* video_code=item[@"code"];
+        [self.ytplayerView LoadWithVid:video_code];
+        for(UIView *v in self.ytplayerView.subviews)
         {
             if([v isKindOfClass:[UIButton class] ])
-                [self.playerView bringSubviewToFront:v];
+                [self.ytplayerView bringSubviewToFront:v];
         }
-        if (@available(iOS 9.0, *)) {
-            self.playerView.webView.allowsPictureInPictureMediaPlayback=false;
-        } else {
-            // Fallback on earlier versions
-        }
-        self.playerView.hidden=false;
+        
+        self.ytplayerView.hidden=false;
         
         return;
+
     }
     else
     {

+ 2 - 1
RedAnt ERP Mobile/common/CommonEditor/CommonEditorViewController.h

@@ -12,6 +12,7 @@
 #import "MonthPickerViewController.h"
 #import "CommonEditorTableContainerView.h"
 #import "CommonEditorAutoCompleteView.h"
+#import "RANetwork.h"
 
 @interface subitem_data : NSObject
 @property (strong, nonatomic) NSMutableDictionary *params;
@@ -114,7 +115,7 @@
 @property (nonatomic,strong) IBOutlet CommonEditorTableContainerView *tableContainer;
 
 //#pragma mark - request Editor
-//-(NSDictionary*)request_Editor:(NSString*) request_url params:(NSMutableDictionary*)params;
+//-(void)request_Editor:(NSString*) request_url params:(NSMutableDictionary*)params completionHandler:(resultHandler)result;
 
 // plae order 有调用
 -(NSMutableDictionary*) enum_subitem_changed:(NSMutableDictionary *) item subid:(NSArray*) subid value:(NSMutableDictionary*)value step:(int) step;

+ 8 - 10
RedAnt ERP Mobile/common/CommonEditor/Phone_Banner_Cell.xib

@@ -1,21 +1,19 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
-    <device id="retina4_7" orientation="portrait">
-        <adaptation id="fullscreen"/>
-    </device>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
+    <device id="retina4_7" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13527"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17126"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
-        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="CommonEditorBannerCell"/>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
         <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
         <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="CommonEditorBannerCell" rowHeight="200" id="E8q-bo-mcp" customClass="CommonEditorBannerCell">
             <rect key="frame" x="0.0" y="0.0" width="597" height="195"/>
             <autoresizingMask key="autoresizingMask"/>
             <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="E8q-bo-mcp" id="sgK-xT-zL1">
-                <rect key="frame" x="0.0" y="0.0" width="597" height="194.5"/>
+                <rect key="frame" x="0.0" y="0.0" width="597" height="195"/>
                 <autoresizingMask key="autoresizingMask"/>
                 <subviews>
                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ILR-pL-388">
@@ -36,7 +34,7 @@
                                 </connections>
                             </collectionView>
                             <pageControl opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" hidesForSinglePage="YES" numberOfPages="3" translatesAutoresizingMaskIntoConstraints="NO" id="jgm-U6-Z9N">
-                                <rect key="frame" x="279" y="165" width="39" height="20"/>
+                                <rect key="frame" x="237.5" y="165" width="122.5" height="20"/>
                                 <constraints>
                                     <constraint firstAttribute="height" constant="20" id="wcZ-1d-53o"/>
                                 </constraints>
@@ -46,7 +44,7 @@
                             <view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="HOS-2H-C9K" customClass="YTPlayerView">
                                 <rect key="frame" x="0.0" y="0.0" width="597" height="200"/>
                                 <subviews>
-                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="fGW-SJ-BKG">
+                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="fGW-SJ-BKG">
                                         <rect key="frame" x="547" y="10" width="40" height="40"/>
                                         <constraints>
                                             <constraint firstAttribute="width" constant="40" id="9aV-iZ-V7l"/>
@@ -89,7 +87,7 @@
             <connections>
                 <outlet property="bannerCollectionView" destination="dim-uJ-xoH" id="zFo-4H-Sng"/>
                 <outlet property="pageControlView" destination="jgm-U6-Z9N" id="qJa-V3-1Ry"/>
-                <outlet property="playerView" destination="HOS-2H-C9K" id="plZ-PC-aQb"/>
+                <outlet property="ytplayerView" destination="HOS-2H-C9K" id="oVw-WA-Prs"/>
             </connections>
             <point key="canvasLocation" x="189.5" y="189.5"/>
         </tableViewCell>

+ 2 - 0
RedAnt ERP Mobile/common/const.h → RedAnt ERP Mobile/common/ERPCommonConst.h

@@ -5,6 +5,8 @@
 //  Created by Ray on 14-6-20.
 //  Copyright (c) 2014年 United Software Applications, Inc. All rights reserved.
 //
+
+//erp mobile
 #define DEBUGLOG 1
 #ifdef DEBUGLOG
     #ifdef DEBUG

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

@@ -124,7 +124,7 @@
     //    if(self.attachment_name.length>0)
     //        filename = self.attachment_name;
     
-    NSString* dbzippath= [RAUtils getdbzip];
+    NSString* dbzippath= [RAUtils getdbzip:DBNAME];
     NSData *data1 = [NSData dataWithContentsOfFile:dbzippath];
 //    filename=@"database.db";
     

+ 0 - 96
RedAnt ERP Mobile/common/RAUtils.h

@@ -1,96 +0,0 @@
-//
-//  RAUtils.h
-//  RedAnt ERP Mobile
-//
-//  Created by Ray on 9/17/15.
-//  Copyright (c) 2015 United Software Applications, Inc. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-#import <UIKit/UIKit.h>
-//typedef  struct {
-//    
-//    NSString* id;
-//    
-//    float  height;
-//    
-//    
-//}MyTestStruct;
-
-NS_ASSUME_NONNULL_BEGIN
-@interface RAUtils : NSObject
-
-
-+ (CGSize)sizeWithFont:(NSString*_Nonnull)string font:(UIFont *_Nonnull)font constrainedToSize:(CGSize)size lineBreakMode:(NSLineBreakMode)lineBreakMode;
-
-+ (BOOL)isNumeric:(NSString*)string;
-//+(NSData*) dict2data:(NSDictionary*) dict;
-+(NSString*) FloatFormat:(float)value;
-+(UIViewController*) getViewController:(UIView*) view;
-+ (CGRect)relativeFrameForScreenWithView:(UIView *)v;
-+(NSDictionary*) error_json :(int)code err_msg:(NSString* _Nullable)msg;
-+(UIAlertController*) message_alert :(NSString* _Nullable) msg title:(NSString*_Nullable) title controller:(UIViewController*) vc;
-
-+(UIAlertController*) message_alert :(NSString*) msg title:(NSString*) title controller:(UIViewController*) vc action_handler:(void (^ __nullable)(UIAlertAction *action))action_handler completion:(void (^ __nullable)(void))completion;
-//+(void) alert_view :(NSString*) msg title:(NSString*) title ;
-//+(UIAlertView * ) waiting_alert :(NSString*) msg title:(NSString*) title;
-//+(UIAlertController*) waiting_alert:(UIViewController*)parent title:(NSString*_Nullable) title;
-+(UIAlertController*) waiting_alert:(UIViewController*)parent title:(NSString*) title completion:(void (^ __nullable)(void))completion;
-
-//+(UIAlertController*) waiting_alert:(UIViewController*)parent message:(NSString*_Nullable)msg title:(NSString*_Nullable) title;
-+(UIAlertController*) waiting_alert:(UIViewController*)parent message:(NSString*)msg title:(NSString*) title completion:(void (^ __nullable)(void))completion;
-+ (float)fileSizeForDir:(NSString*)path;//计算文件夹下文件的总大小;
-+(void) deletefiles :(NSString*) path;
-+(UIColor*) strColor:(NSString*) color;
-
-+(NSString*) get_config_path;
-
-+(NSString*) base64en:(NSString*) string;
-+(NSString*) base64de:(NSString*) string;
-+(NSDictionary*) device_info;
-+(NSDictionary*) error_dict:(NSError*)error;
-+ (NSArray*) allFilesAtPath:(NSString*) dirString;
-//+(void) enum_font;
-+(NSDictionary*) dictfromfile:(NSString*) path;
-//+(NSArray*) expression_varable:(NSString*)content regex:(NSString*) pattern;
-//+(NSTextCheckingResult*) expression_findfistMatch:(NSString*)content regex:(NSString*) pattern;
-+(NSData*) getdbfile;
-+(NSString*) getdbzip;
-+ (UIImage *)scaleToSize:(UIImage *)img size:(CGSize)size;
-+ (CGRect)scaleToSize:(CGRect )from to:(CGSize)to;
-+ (CGRect)rectAlign:(CGRect )parent rect:(CGRect)rect hAlign:(NSString*)hAlign vAlign:(NSString*)vAlign;
-+ (CGRect)rectVAlign:(CGRect )parent rect:(CGRect)rect vAlign:(NSString*)vAlign;
-+(UIImage*)img_compress:(UIImage*)image kbsize:(float) size;
-+(NSString* )current_date;
-+(NSString*) current_date_forfile;
-+(NSMutableArray*)dictionary2array:(NSDictionary*)json count_fields:(NSString*) count_fields item_mark:(NSString*) item_mark items_mark:(NSString* _Nullable )items_mark;
-+(int)getRandomNumber:(int)from to:(int)to;
-
-//+(void) add_recent_model:(NSDictionary*) model;
-+ (long long) freeDiskSpaceInMegaBytes;
-
-//+(NSArray*) string2arr:(NSString*) string separator:(NSString*)separator;
-
-
-
-+ (bool)mergeContentsOfPath:(NSString *)srcDir intoPath:(NSString *)dstDir error:(NSError**)err;
-
-+ (BOOL)saveData:(NSData *)data toPath:(NSString *)path;
-+ (void)removeFileAtPath:(NSString *)path;
-+ (NSString *)appCacheDirectory;
-+(NSString*)md5WithFile:(NSString*)path;
-+ (BOOL)fileExistsAtPath:(NSString *)path;
-+ (NSString *)htmlForVideo:(NSString*) iframeCode template:(NSString*) path;
-+ (NSString *)htmlForImage:(UIImage *)image template:(NSString*) path;
-
-
-+ (CGRect)relativeFrame:(CGRect) frame FromView:(UIView *)v toView:(UIView*)tv;
-
-+ (nullable NSString *)md5:(nullable NSString *)str;
-
-+ (NSString *_Nullable)deviceID;
-
-+ (void)ra_showAlertTitle:(NSString *_Nullable)title message:(NSString *_Nullable)msg withViewController:(UIViewController *_Nonnull)vc;
-
-@end
-NS_ASSUME_NONNULL_END

+ 0 - 1056
RedAnt ERP Mobile/common/RAUtils.m

@@ -1,1056 +0,0 @@
-//
-//  RAUtils.m
-//  RedAnt ERP Mobile
-//
-//  Created by Ray on 9/17/15.
-//  Copyright (c) 2015 United Software Applications, Inc. All rights reserved.
-//
-
-#import "RAUtils.h"
-//#import "LoginViewController.h"
-//#import "MainViewController.h"
-#import <sys/param.h>
-#import <sys/mount.h>
-#import "const.h"
-#import "AppDelegate.h"
-//#import "Singleton.h"
-#include <CommonCrypto/CommonDigest.h>
-
-#import "ZipArchive.h"
-
-#define FileHashDefaultChunkSizeForReadingData 1024*8
-
-
-@implementation RAUtils
-
-+(int)getRandomNumber:(int)from to:(int)to
-{
-    return (int)(from + (arc4random() % (to-from + 1)));
-}
-//+(float)randomf
-//{
-//
-//    int irandom = [self getRandomNumber:0 to:5];
-//    return irandom / 100.0;
-//}
-+(NSString*) getdbzip
-{
-    
-    
-    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
-    NSString *documents = /*[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];*/[paths objectAtIndex:0];
-    NSString *database_path = [documents stringByAppendingPathComponent:DBNAME];
-    
-    
-            NSString* temp = NSTemporaryDirectory();
-    
-    NSString* uuid=[[NSUUID UUID] UUIDString];
-    
-    NSString *tempfile = [temp stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.zip",uuid]];
-    
-    ZipArchive* zip = [[ZipArchive alloc] init];
-    
-    
-    BOOL result = [zip CreateZipFile2:tempfile Password:@"usai2010"];
-    
-
-        result = [zip addFileToZip:database_path newname:[database_path lastPathComponent]];
-    return tempfile;
-    
-    
-
-}
-+(NSData*) getdbfile
-{
-    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
-    NSString *documents = /*[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];*/[paths objectAtIndex:0];
-    NSString *database_path = [documents stringByAppendingPathComponent:DBNAME];
-    return [NSData dataWithContentsOfFile:database_path];
-    
-    
-}
-+(NSDictionary*) dictfromfile:(NSString*) path
-{
-    NSData *filedata = [NSData dataWithContentsOfFile:path];
-    
-    NSError *error = nil;
-    NSDictionary *string2dic = [NSJSONSerialization JSONObjectWithData: filedata
-                                                               options: NSJSONReadingMutableContainers
-                                                                 error: &error];
-    // DebugLog(@"%@",string2dic);
-    return string2dic;
-    
-}
-+ (NSArray*) allFilesAtPath:(NSString*) dirString
-{
-    
-    NSMutableArray* array = [NSMutableArray arrayWithCapacity:10];
-    
-    NSFileManager* fileMgr = [NSFileManager defaultManager];
-    
-    NSArray* tempArray = [fileMgr contentsOfDirectoryAtPath:dirString error:nil];
-    
-    for (NSString* fileName in tempArray) {
-        
-        BOOL flag = YES;
-        
-        NSString* fullPath = [dirString stringByAppendingPathComponent:fileName];
-        
-        if ([fileMgr fileExistsAtPath:fullPath isDirectory:&flag]) {
-            
-            if (!flag) {
-                
-                [array addObject:fullPath];
-                
-            }
-            
-        }
-        
-    }
-    
-    return array;
-    
-}
-+ (bool)mergeContentsOfPath:(NSString *)srcDir intoPath:(NSString *)dstDir error:(NSError**)err {
-    
-    DebugLog(@"- mergeContentsOfPath: %@\n intoPath: %@", srcDir, dstDir);
-    
-    NSFileManager *fm = [NSFileManager defaultManager];
-    NSDirectoryEnumerator *srcDirEnum = [fm enumeratorAtPath:srcDir];
-    NSString *subPath;
-    while ((subPath = [srcDirEnum nextObject])) {
-        
-        DebugLog(@" subPath: %@", subPath);
-        NSString *srcFullPath =  [srcDir stringByAppendingPathComponent:subPath];
-        NSString *potentialDstPath = [dstDir stringByAppendingPathComponent:subPath];
-        
-        // Need to also check if file exists because if it doesn't, value of `isDirectory` is undefined.
-        BOOL isDirectory = ([[NSFileManager defaultManager] fileExistsAtPath:srcFullPath isDirectory:&isDirectory] && isDirectory);
-        
-        // Create directory, or delete existing file and move file to destination
-        if (isDirectory) {
-            DebugLog(@"   create directory");
-            [fm createDirectoryAtPath:potentialDstPath withIntermediateDirectories:YES attributes:nil error:err];
-            if (err && *err) {
-                DebugLog(@"ERROR: %@", *err);
-                return false;
-            }
-        }
-        else {
-            if ([fm fileExistsAtPath:potentialDstPath]) {
-                DebugLog(@"   removeItemAtPath");
-                [fm removeItemAtPath:potentialDstPath error:err];
-                if (err && *err) {
-                    DebugLog(@"ERROR: %@", *err);
-                    return false;
-                }
-            }
-            
-            DebugLog(@"   moveItemAtPath");
-            [fm moveItemAtPath:srcFullPath toPath:potentialDstPath error:err];
-            if (err && *err) {
-                DebugLog(@"ERROR: %@", *err);
-                return false;
-            }
-        }
-    }
-    [fm removeItemAtPath:srcDir error:err];
-    if (err && *err) {
-        DebugLog(@"ERROR: %@", *err);
-        return false;
-    }
-    return true;
-}
-//+(void) enum_font
-//{
-//    return;
-//    NSArray *familys = [UIFont familyNames];
-//    
-//    for (int i = 0; i < familys.count; i++)
-//    {
-//        NSString *family = [familys objectAtIndex:i];
-//        DebugLog(@"=====Fontfamily:%@", family);
-//        NSArray *fonts = [UIFont fontNamesForFamilyName:family];
-//        for(int j = 0; j < fonts.count; j++)
-//        {
-//            DebugLog(@"***FontName:%@", [fonts objectAtIndex:j]);
-//        }
-//    }
-//}
-
-
-//+(NSTextCheckingResult*) expression_findfistMatch:(NSString*)content regex:(NSString*) pattern
-//{
-//    NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:pattern options:0 error:nil];
-//    
-//    NSTextCheckingResult *match = [regex firstMatchInString:content options:0 range:NSMakeRange(0, content.length)];
-//    return match;
-////    if (matches) {
-////        for (NSTextCheckingResult *match in matches) {
-////            for (int i = 0; i < match.numberOfRanges; ++i) {
-////                DebugLog(@"-> %@", [content substringWithRange:[match rangeAtIndex:i]]);
-////            }
-////        }
-////    }
-////    return matches;
-//}
-//+(NSArray*) expression_varable:(NSString*)content regex:(NSString*) pattern
-//{
-//
-//    if(content==nil)
-//        return nil;
-//
-//
-//    NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:pattern options:0 error:nil];
-//
-//    NSArray *matches = [regex matchesInString:content options:0 range:NSMakeRange(0, content.length)];
-//
-//    if (matches) {
-//        for (NSTextCheckingResult *match in matches) {
-//            for (int i = 0; i < match.numberOfRanges; ++i) {
-//                DebugLog(@"-> %@", [content substringWithRange:[match rangeAtIndex:i]]);
-//            }
-//        }
-//    }
-//    return matches;
-//}
-+ (CGRect)rectAlign:(CGRect )parent rect:(CGRect)rect hAlign:(NSString*)hAlign vAlign:(NSString*)vAlign
-{
-//    double cx=parent.origin.x+parent.size.width/2;
-//    double cy=parent.origin.y+parent.size.height/2;
-    CGPoint centerpoint= CGPointMake(parent.origin.x+parent.size.width/2,parent.origin.y+parent.size.height/2);
-    if([hAlign.lowercaseString isEqualToString:@"center"])
-    {
-        rect=CGRectMake(centerpoint.x-rect.size.width/2, rect.origin.y, rect.size.width, rect.size.height);
-    }
-    else
-    if([hAlign.lowercaseString isEqualToString:@"left"])
-    {
-        rect=CGRectMake(parent.origin.x, rect.origin.y, rect.size.width, rect.size.height);
-    }
-    else
-        if([hAlign.lowercaseString isEqualToString:@"right"])
-        {
-            rect=CGRectMake(parent.origin.x+parent.size.width-rect.size.width, rect.origin.y, rect.size.width, rect.size.height);
-        }
-    if([vAlign.lowercaseString isEqualToString:@"middle"])
-    {
-        rect=CGRectMake(rect.origin.x, centerpoint.y-rect.size.height/2, rect.size.width, rect.size.height);
-    }
-    
-    return rect;
-    
-}
-
-
-+(NSString*) get_config_path
-{
-    NSString *default_path = [[NSBundle mainBundle] pathForResource:@"config" ofType:@"plist"];
-    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
-    NSString *cache_folder=[paths objectAtIndex:0];
-    
-    NSString* ver=[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
-    
-    NSString *config_path = [cache_folder stringByAppendingPathComponent:[NSString stringWithFormat: @"config_%@.plist",ver]];
-    BOOL bdir=NO;
-    NSFileManager* fileManager = [NSFileManager defaultManager];
-    if(!  [fileManager fileExistsAtPath:config_path isDirectory:&bdir])
-    {
-        NSError * error=nil;
-        
-        if(![fileManager copyItemAtPath:default_path toPath:config_path error:&error])
-        {
-            return nil;
-        }
-    }
-    
-    
-   
-    return config_path;
-}
-+ (CGRect)rectVAlign:(CGRect )parent rect:(CGRect)rect vAlign:(NSString*)vAlign
-{
-    //    double cx=parent.origin.x+parent.size.width/2;
-    //    double cy=parent.origin.y+parent.size.height/2;
-    CGPoint centerpoint= CGPointMake(parent.origin.x+parent.size.width/2,parent.origin.y+parent.size.height/2);
-    
-    if([vAlign.lowercaseString isEqualToString:@"middle"])
-    {
-        rect=CGRectMake(rect.origin.x, centerpoint.y-rect.size.height/2, rect.size.width, rect.size.height);
-    }
-    
-    return rect;
-    
-}
-+ (CGRect)scaleToSize:(CGRect )from to:(CGSize)to
-{
-    if(from.size.width/from.size.height>to.width/to.height)
-    {
-        return CGRectMake(from.origin.x, from.origin.y, to.width, to.width*from.size.height/from.size.width);
-    }
-    else
-    {
-        return CGRectMake(from.origin.x, from.origin.y, to.height*from.size.width/from.size.height, to.height);
-    }
-//    // 创建一个bitmap的context
-//    // 并把它设置成为当前正在使用的context
-//    UIGraphicsBeginImageContext(size);
-//    // 绘制改变大小的图片
-//    [img drawInRect:CGRectMake(0, 0, size.width, size.height)];
-//    // 从当前context中创建一个改变大小后的图片
-//    UIImage* scaledImage = UIGraphicsGetImageFromCurrentImageContext();
-//    // 使当前的context出堆栈
-//    UIGraphicsEndImageContext();
-//    // 返回新的改变大小后的图片
-//    
-//    //   NSData  *imageData=UIImageJPEGRepresentation(scaledImage, 1.f);
-//    return scaledImage;
-}
-+ (UIImage *)scaleToSize:(UIImage *)img size:(CGSize)size{
-    // 创建一个bitmap的context
-    // 并把它设置成为当前正在使用的context
-    UIGraphicsBeginImageContext(size);
-    // 绘制改变大小的图片
-    [img drawInRect:CGRectMake(0, 0, size.width, size.height)];
-    // 从当前context中创建一个改变大小后的图片
-    UIImage* scaledImage = UIGraphicsGetImageFromCurrentImageContext();
-    // 使当前的context出堆栈
-    UIGraphicsEndImageContext();
-    // 返回新的改变大小后的图片
-    
-    //   NSData  *imageData=UIImageJPEGRepresentation(scaledImage, 1.f);
-    return scaledImage;
-}
-
-+(UIImage*)img_compress:(UIImage*)image kbsize:(float) size
-{
-    
-    
-    
-    //UIImage *image=[UIImage imageNamed:@"xxoo.jpeg"];
-    NSData  *imageData=UIImageJPEGRepresentation(image, 1.f);
-    
-    if(size>imageData.length/1024)
-        return image;
-    
-    //   CGFloat size=40.f;// kb
-    CGFloat scale=size/(imageData.length/1024);
-    
-    scale = sqrt (scale);
-    
-    CGSize newsize=image.size;
-    newsize.height = newsize.height*scale;
-    newsize.width = newsize.width*scale;
-    
-    return [RAUtils scaleToSize:image size:newsize];
-    //    NSData *newData=UIImageJPEGRepresentation(image, scale);
-    
-    //    UIImage* ret= [[UIImage alloc] initWithData:newData];
-    //
-    //    return ret;
-}
-
-+(NSString*) FloatFormat:(float)value
-{
-    if (fmodf(value, 1)==0)
-    {
-        
-        return [NSString stringWithFormat:@"%.0f",value];
-        
-    } else if (fmodf(value*10, 1)==0)
-    {
-        
-        return [NSString stringWithFormat:@"%.1f",value];
-        
-    }
-    else if (fmodf(value*100, 1)==0)
-    {
-        
-        return [NSString stringWithFormat:@"%.2f",value];
-        
-    }
-    else if (fmodf(value*1000, 1)==0)
-    {
-        
-        return [NSString stringWithFormat:@"%.3f",value];
-        
-    }
-    else
-    {
-        
-        return [NSString stringWithFormat:@"%.4f",value];
-        
-        
-    }
-    return nil;
-}
-
-
-+(UIViewController*) getViewController:(UIView*) view
-{
-    for (UIView* next = [view superview]; next; next = next.superview) {
-        UIResponder* nextResponder = [next nextResponder];
-        if ([nextResponder isKindOfClass:[UIViewController class]]) {
-            return (UIViewController*)nextResponder;
-        }
-    }
-    return nil;
-}
-
-+ (float)fileSizeForDir:(NSString*)path//计算文件夹下文件的总大小
-{
-    NSFileManager *fileManager = [[NSFileManager alloc] init];
-    float size =0;
-    NSArray* array = [fileManager contentsOfDirectoryAtPath:path error:nil];
-    for(int i = 0; i<[array count]; i++)
-    {
-        NSString *fullPath = [path stringByAppendingPathComponent:[array objectAtIndex:i]];
-        BOOL isDir;
-        if ( !([fileManager fileExistsAtPath:fullPath isDirectory:&isDir] && isDir) )
-        {
-            NSDictionary *fileAttributeDic=[fileManager attributesOfItemAtPath:fullPath error:nil];
-            size+= fileAttributeDic.fileSize/ 1024.0/1024.0;
-        }
-        else
-        {
-            size+=[self fileSizeForDir:fullPath];
-        }
-    }
-    return size;
-}
-/*创建错误信息字典*/
-+(NSDictionary*) error_dict:(NSError*)error
-{
-    
-    if(error==nil)
-        return nil;
-    NSMutableDictionary* ret = [[NSMutableDictionary alloc] init];
-    [ret setValue:[NSString stringWithFormat:@"%ld",(long)error.code] forKey:@"error_code"];
-    [ret setValue:error.domain forKey:@"err_domain"];
-    [ret setValue:[error localizedDescription] forKey:@"err_message"];
-    // [ret setObject:error.userInfo forKey:@"user_info"];
-    return ret;
-}
-+(NSString*) current_date
-{
-    NSDate * date = [NSDate date];
-    NSTimeInterval sec = [date timeIntervalSinceNow];
-    NSDate * currentDate = [[NSDate alloc] initWithTimeIntervalSinceNow:sec];
-    
-    NSDateFormatter * df = [[NSDateFormatter alloc] init ];
-    [df setDateFormat:@"MM/dd/yyyy HH:mm:ss"];
-    NSString * na = [df stringFromDate:currentDate];
-    return na;
-}
-+(NSString*) current_date_forfile
-{
-    NSDate * date = [NSDate date];
-    NSTimeInterval sec = [date timeIntervalSinceNow];
-    NSDate * currentDate = [[NSDate alloc] initWithTimeIntervalSinceNow:sec];
-    
-    NSDateFormatter * df = [[NSDateFormatter alloc] init ];
-    [df setDateFormat:@"MM_dd_yyyy_HH_mm_ss"];
-    NSString * na = [df stringFromDate:currentDate];
-    return na;
-}
-//+(void) message_alert :(NSString*) msg title:(NSString*) title controller:(UIViewController*) vc
-//{
-//    if(title==nil)
-//        title = @"Message";
-//    if ([title isEqualToString:@"Add To Cart"]) {
-//        if ([msg hasPrefix:@"Out of Stock.\n"]) {
-//            title = @"Add To Cart: Out of Stock";
-//            msg = [msg substringFromIndex:[@"Out of Stock.\n" length]];
-//        }
-//    }
-//
-//
-//
-//    return [self alert_view:msg title:title];
-////
-////
-////    UIAlertController *alertControl = [UIAlertController alertControllerWithTitle:title message:nil preferredStyle:UIAlertControllerStyleAlert];
-////    //block代码块取代了delegate
-////
-////
-////    //        [alertControl addTextFieldWithConfigurationHandler:^(UITextField *textField) {
-////    //            textField.text = self.save_name;
-////    //
-////    //
-////    //        }];
-////
-////    //    UIAlertAction *actionOne = [UIAlertAction actionWithTitle:@"Yes" style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {
-////    //
-////    //        UIAlertController * waitalert = [RAUtils waiting_alert:self title:@"Delete Order"];
-////    //        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-////    //
-////    //            NSDictionary* return_json = [iSalesNetwork delete_Order:orderid];
-////    //
-////    //            dispatch_async(dispatch_get_main_queue(), ^{
-////    //                [waitalert dismissViewControllerAnimated:YES completion:nil];
-////    //
-////    //
-////    //                if([[return_json valueForKey:@"result"] intValue]==2)
-////    //                {
-////    //
-////    //                    [RAUtils error_alert:nil title:@"Order Delete"] ;
-////    //                }
-////    //                else
-////    //                {
-////    //                    [RAUtils error_alert:[return_json valueForKey:@"err_msg"] title:@"Delete Order Failed."] ;
-////    //                }
-////    //
-////    //
-////    //
-////    //
-////    //            });
-////    //        });
-////    //
-////    //
-////    //    }];
-////
-////    UIAlertAction *alertthree = [UIAlertAction actionWithTitle:@"Ok" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
-////        //DebugLog(@"Cancel");
-////    }];
-////    // [alertControl addAction:actionOne];
-////
-////    [alertControl addAction:alertthree];
-////
-////
-////    UIAlertAction *alertcancel = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
-////    }];
-////    [alertControl addAction:alertcancel];
-////    //UIAlertControllerStyle类型为UIAlertControllerStyleAlert可以添加addTextFieldWithConfigurationHandler:^(UITextField *textField)
-////
-////
-////
-////
-////    [vc presentViewController:alertControl animated:YES completion:nil];
-////
-////
-////
-////    return;
-////
-////
-//
-//
-//}
-
-
-//+(void) alert_view :(NSString*) msg title:(NSString*) title
-//{
-//    if(title==nil)
-//        title = NSLocalizedString(@"Message", @"Message");
-//    if(msg.length>0)
-//    {
-//        title=[NSString stringWithFormat:@"%@\n\n%@",title,msg];
-//    }
-//    UIAlertView * alert = [[UIAlertView alloc] initWithTitle: title message:nil delegate:nil cancelButtonTitle:NSLocalizedString(@"Ok", @"Ok") otherButtonTitles:nil, nil];
-//    [alert show];
-//}
-+ (long long) freeDiskSpaceInMegaBytes{
-    struct statfs buf;
-    long long freespace = -1;
-    if(statfs("/var", &buf) >= 0){
-        freespace = (long long)(buf.f_bsize * buf.f_bfree);
-    }
-    DebugLog(@"手机剩余存储空间为:%qi MB" ,freespace/1024/1024);
-    return freespace/1024/1024;
-}
-
-//+(UIAlertController*) waiting_alert:(UIViewController*)parent title:(NSString*) title
-//{
-//    UIAlertController *alertController = [UIAlertController alertControllerWithTitle:title message:@"Please wait..." preferredStyle:UIAlertControllerStyleAlert];
-//
-////    [parent presentModalViewController:alertController animated:YES];
-//    [parent presentViewController:alertController animated:YES completion:nil];
-//    return alertController;
-//
-//}
-+(UIAlertController*) waiting_alert:(UIViewController*)parent title:(NSString*) title completion:(void (^ __nullable)(void))completion
-{
-    
-    return [self waiting_alert:parent message:@"Please wait..." title:title completion:completion];
-//    UIAlertController *alertController = [UIAlertController alertControllerWithTitle:title message:@"Please wait..." preferredStyle:UIAlertControllerStyleAlert];
-//    
-//    [parent presentViewController:alertController animated:YES completion:completion];
-//    return alertController;
-
-}
-//+(UIAlertController*) waiting_alert:(UIViewController*)parent message:(NSString*)msg title:(NSString*) title
-//{
-//    UIAlertController *alertController = [UIAlertController alertControllerWithTitle:title message:msg preferredStyle:UIAlertControllerStyleAlert];
-//    [parent presentViewController:alertController animated:YES completion:nil];
-//    return alertController;
-//
-//}
-+(UIAlertController*) waiting_alert:(UIViewController*)parent message:(NSString*)msg title:(NSString*) title completion:(void (^ __nullable)(void))completion
-{
-    UIAlertController *alertController = [UIAlertController alertControllerWithTitle:title message:msg preferredStyle:UIAlertControllerStyleAlert];
-    [parent presentViewController:alertController animated:YES completion:completion];
-    return alertController;
-
-}
-
-+(UIAlertController*) message_alert :(NSString*) msg title:(NSString*) title controller:(UIViewController*) vc
-{
-    if(title==nil)
-        title = @"Message";
-    if ([title isEqualToString:@"Add To Cart"]) {
-        if ([msg hasPrefix:@"Out of Stock.\n"]) {
-            title = @"Add To Cart: Out of Stock";
-            msg = [msg substringFromIndex:[@"Out of Stock.\n" length]];
-        }
-    }
-    
-    UIAlertController *alertController = [UIAlertController alertControllerWithTitle:title message:msg preferredStyle:UIAlertControllerStyleAlert];
-    UIAlertAction *action_0 = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil];
-    [alertController addAction:action_0];
-    [vc presentViewController:alertController animated:YES completion:nil];
-    return alertController;
-
-}
-
-+(UIAlertController*) message_alert :(NSString*) msg title:(NSString*) title controller:(UIViewController*) vc action_handler:(void (^ __nullable)(UIAlertAction *action))action_handler completion:(void (^ __nullable)(void))completion
-{
-    if(title==nil)
-        title = @"Message";
-    if ([title isEqualToString:@"Add To Cart"]) {
-        if ([msg hasPrefix:@"Out of Stock.\n"]) {
-            title = @"Add To Cart: Out of Stock";
-            msg = [msg substringFromIndex:[@"Out of Stock.\n" length]];
-        }
-    }
-    
-    UIAlertController *alertController = [UIAlertController alertControllerWithTitle:title message:msg preferredStyle:UIAlertControllerStyleAlert];
-    UIAlertAction *action_0 = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:action_handler];
-    [alertController addAction:action_0];
-    [vc presentViewController:alertController animated:YES completion:completion];
-    return alertController;
-
-}
-//+(UIAlertView * ) waiting_alert :(NSString*) msg title:(NSString*) title
-//{
-//    if(title==nil)
-//        title = @"Please Wait";
-//    if(msg==nil)
-//        msg= @"Waiting...";
-//    NSAssert(msg!=nil, @"error message from json is nil");
-//    UIAlertView * alert = [[UIAlertView alloc] initWithTitle:title message:msg delegate:nil cancelButtonTitle:nil otherButtonTitles:nil, nil];
-//    [alert show];
-//    //
-//    //
-//    //    UIActivityIndicatorView *aiView = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(125.0, 80.0, 30.0, 30.0)];
-//    //    aiView.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge;
-//    // //   check if os version is 7 or above. ios7.0及以上UIAlertView弃用了addSubview方法
-//    ////    if ([[[UIDevice currentDevice] systemVersion] compare:@"7.0"] != NSOrderedAscending) {
-//    ////        [alert setValue:aiView forKey:@"accessoryView"];
-//    ////    }else{
-//    ////        [alert addSubview:aiView];
-//    ////    }
-//    //
-//    //    aiView.hidden = false;
-//    //    aiView.hidesWhenStopped = false;
-//    //    [aiView startAnimating];
-//    //
-//    //[alert addSubview:aiView];
-//
-//    return alert;
-//    //return nil;
-//    // return alert;
-//    //        UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Error!" message:@"User&Password can not be empty!" delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) , nil];
-//    //[alert show];
-//}
-+(NSDictionary*) device_info
-{
-    
-    
-    NSDictionary* infoDict =[[NSBundle mainBundle] infoDictionary];
-    NSString* build =[infoDict objectForKey:@"CFBundleVersion"];
-    NSString* version =[infoDict objectForKey:@"CFBundleShortVersionString"];
-    NSString* versionNum = [NSString stringWithFormat:@"Version: %@ Build %@",version,build];
-    
-    NSMutableDictionary * info = [[NSMutableDictionary alloc]init];
-    [info setValue:[[UIDevice currentDevice] name] forKey:@"name"];
-    [info setValue:[[UIDevice currentDevice] systemVersion] forKey:@"systemVersion"];
-    [info setValue:[[UIDevice currentDevice] model] forKey:@"model"];
-    [info setValue:versionNum forKey:@"ver"];
-    [info setValue:[[UIDevice currentDevice] localizedModel] forKey:@"localizedModel"];
-    
-    return info;
-    //    [info setValue:[[UIDevice currentDevice] name] forKey:@"name"];
-    //    [info setValue:[[UIDevice currentDevice] name] forKey:@"name"];
-    //    [info setValue:[[UIDevice currentDevice] name] forKey:@"name"];
-    
-}
-
-+ (NSString *)deviceID {
-    UIDevice * dev = [UIDevice currentDevice];
-    NSUUID* uuid =dev.identifierForVendor;
-    return uuid.UUIDString;
-}
-
-//+(NSArray*) string2arr:(NSString*) string separator:(NSString*)separator
-//{
-//    NSArray  *stringArray = [string componentsSeparatedByString:separator];
-//    
-//    return stringArray;
-//}
-
-+(NSDictionary*) string2dict:(NSString*) str
-{
-    
-    if(str==nil)
-        return nil;
-    NSError *error = nil;
-    NSDictionary *string2dic = [NSJSONSerialization JSONObjectWithData: [str dataUsingEncoding:NSUTF8StringEncoding]
-                                                               options: NSJSONReadingMutableContainers
-                                                                 error: &error];
-    DebugLog(@"%@",string2dic);
-    return string2dic;
-}
-+(UIColor*) strColor:(NSString*) color
-{
-    if([color.lowercaseString isEqualToString:@"red"])
-        return [UIColor redColor];
-    
-    return [UIColor blackColor];
-}
-
-+(NSString*) base64en:(NSString*) string
-{
-    
-    if(string == nil)
-        
-        return nil;
-    
-    NSData *data = [string dataUsingEncoding:NSUTF8StringEncoding];
-    NSString *stringBase64 = [data base64EncodedStringWithOptions:0]; // base64格式的字符串
-    
-    return stringBase64;
-}
-
-
-+(NSString*) base64de:(NSString*) stringBase64
-{
-    
-    if(stringBase64==nil)
-        return nil;
-    NSData *data = [[NSData alloc] initWithBase64EncodedString:stringBase64 options:NSDataBase64DecodingIgnoreUnknownCharacters];
-    NSString *string =[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
-    return string;
-}
-+(void) deletefiles :(NSString*) path
-{
-    
-    //    NSString *extension = @"m4r";
-    NSFileManager *fileManager = [NSFileManager defaultManager];
-    //    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
-    //    NSString *documentsDirectory = [paths objectAtIndex:0];
-    
-    NSArray *contents = [fileManager contentsOfDirectoryAtPath:path error:NULL];
-    NSEnumerator *e = [contents objectEnumerator];
-    NSString *filename;
-    while ((filename = [e nextObject])) {
-        
-        bool result=  [fileManager removeItemAtPath:[path stringByAppendingPathComponent:filename] error:NULL];
-        
-        if(!result)
-            DebugLog(@"delete file failed %@------%@",path,filename);
-    }
-}
-+(NSMutableArray*)dictionary2array:(NSDictionary*)json count_fields:(NSString*) count_fields item_mark:(NSString*) item_mark items_mark:(NSString* )items_mark
-{
-    if(json==nil)
-        return nil;
-    NSMutableArray* ret = [[NSMutableArray alloc] init];
-    
-    int count = [[json valueForKey:count_fields] intValue];
-    
-    NSDictionary* items = nil;
-    if(items_mark==nil)
-        items = json;
-    else
-        items = [json objectForKey:items_mark];
-    for(int i=0;i<count;i++)
-    {
-        NSDictionary* obj = [items objectForKey:[NSString stringWithFormat:@"%@%d",item_mark,i]];
-        [ret addObject:obj];
-    }
-    return ret;
-}
-+(NSDictionary*) error_json :(int)code err_msg:(NSString*)msg
-{
-    
-    NSMutableDictionary* ret = [[NSMutableDictionary alloc] init];
-    //#define RESULT_FALSE 0
-    //#define RESULT_TRUE		 2
-    //#define RESULT_NET_ERROR			 -3
-    //#define RESULT_NET_NOTAVAILABLE		  -4
-    //#define RESULT_ERROR				 -5
-    //#define RESULT_LOCALFILE_ERROR			 -7
-    //#define RESULT_USERAUTH_ERROR			 -9
-    //#define RESULT_UPDATE_USERAUTH_ERROR	 -11
-    //#define RESULT_SESSION_EXPIRED			  -13
-    //#define RESULT_VER_LOW
-    
-    if(msg.length<=0)
-    {
-        switch (code) {
-            case RESULT_NET_NOTAVAILABLE:
-                msg= MSG_NET_NOTAVAILABLE;
-                break;
-                
-            default:
-                // assert(@"UNDEFINE ERROR CODE!");
-                break;
-        }
-    }
-    //    if(code==RESULT_NET_NOTAVAILABLE)
-    //        [ret setValue:[NSString stringWithFormat:@"%d",RESULT_NET_ERROR] forKey:@"result"];
-    //    else
-    [ret setValue:[NSString stringWithFormat:@"%d",code] forKey:@"result"];
-    [ret setValue:msg forKey:@"err_msg"];
-    
-    //    NSData *jsonData = [NSJSONSerialization dataWithJSONObject:ret
-    //                                                       options:0
-    //                                                         error:nil];
-    
-    return ret;
-}
-+ (BOOL)isNumeric:(NSString*)string{
-    NSScanner* scan = [NSScanner scannerWithString:string];
-    int val;
-    return[scan scanInt:&val] && [scan isAtEnd];
-}
-+ (CGRect)relativeFrame:(CGRect) frame FromView:(UIView *)v toView:(UIView*)tv
-{
-    return [v convertRect: frame toView:tv];
-}
-+ (CGRect)relativeFrameForScreenWithView:(UIView *)v
-{
-    UIWindow * window=[[[UIApplication sharedApplication] delegate] window];
-    CGRect rect=[v convertRect: v.bounds toView:window];
-    return rect;
-    
-    
-    //    BOOL iOS7 = [[[UIDevice currentDevice] systemVersion] floatValue] >= 7;
-    //
-    //    CGFloat screenHeight = [UIScreen mainScreen].bounds.size.height;
-    //    if (!iOS7) {
-    //        screenHeight -= 20;
-    //    }
-    //    UIView *view = v;
-    //    CGFloat x = .0;
-    //    CGFloat y = .0;
-    //    while (view.frame.size.width != 320 || view.frame.size.height != screenHeight) {
-    //        x += view.frame.origin.x;
-    //        y += view.frame.origin.y;
-    //        view = view.superview;
-    //        if ([view isKindOfClass:[UIScrollView class]]) {
-    //            x -= ((UIScrollView *) view).contentOffset.x;
-    //            y -= ((UIScrollView *) view).contentOffset.y;
-    //        }
-    //    }
-    //    return CGRectMake(x, y, v.frame.size.width, v.frame.size.height);
-}
-
-+ (BOOL)saveData:(NSData *)data toPath:(NSString *)path {
-//    NSString *directory = [path stringByDeletingLastPathComponent];
-    NSFileManager *manager = [NSFileManager defaultManager];
-    NSString *dir = [path stringByDeletingLastPathComponent];
-    BOOL create = [manager createDirectoryAtPath:dir withIntermediateDirectories:YES attributes:nil error:nil];
-    if (create) {
-        BOOL save = [manager createFileAtPath:path contents:data attributes:nil];
-        if (save) {
-            return YES;
-        }
-        return NO;
-    }
-    return NO;
-    
-}
-
-+ (void)removeFileAtPath:(NSString *)path {
-    if (!path.length) {
-        return;
-    }
-    NSFileManager *manager = [NSFileManager defaultManager];
-    [manager removeItemAtPath:path error:nil];
-}
-
-+ (NSString *)appCacheDirectory {
-    return [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) lastObject];
-}
-
-+(NSString*)md5WithFile:(NSString*)path
-{
-    return (__bridge_transfer NSString *)FileMD5HashCreateWithPath((__bridge CFStringRef)path, FileHashDefaultChunkSizeForReadingData);
-}
-
-CFStringRef FileMD5HashCreateWithPath(CFStringRef filePath,size_t chunkSizeForReadingData) {
-    // Declare needed variables
-    CFStringRef result = NULL;
-    CFReadStreamRef readStream = NULL;
-    // Get the file URL
-    CFURLRef fileURL =
-    CFURLCreateWithFileSystemPath(kCFAllocatorDefault,
-                                  (CFStringRef)filePath,
-                                  kCFURLPOSIXPathStyle,
-                                  (Boolean)false);
-    if (!fileURL) goto done;
-    // Create and open the read stream
-    readStream = CFReadStreamCreateWithFile(kCFAllocatorDefault,
-                                            (CFURLRef)fileURL);
-    if (!readStream) goto done;
-    bool didSucceed = (bool)CFReadStreamOpen(readStream);
-    if (!didSucceed) goto done;
-    // Initialize the hash object
-    CC_MD5_CTX hashObject;
-    CC_MD5_Init(&hashObject);
-    // Make sure chunkSizeForReadingData is valid
-    if (!chunkSizeForReadingData) {
-        chunkSizeForReadingData = FileHashDefaultChunkSizeForReadingData;
-    }
-    // Feed the data to the hash object
-    bool hasMoreData = true;
-    while (hasMoreData) {
-        uint8_t buffer[chunkSizeForReadingData];
-        CFIndex readBytesCount = CFReadStreamRead(readStream,(UInt8 *)buffer,(CFIndex)sizeof(buffer));
-        if (readBytesCount == -1) break;
-        if (readBytesCount == 0) {
-            hasMoreData = false;
-            continue;
-        }
-        CC_MD5_Update(&hashObject,(const void *)buffer,(CC_LONG)readBytesCount);
-    }
-    // Check if the read operation succeeded
-    didSucceed = !hasMoreData;
-    // Compute the hash digest
-    unsigned char digest[CC_MD5_DIGEST_LENGTH];
-    CC_MD5_Final(digest, &hashObject);
-    // Abort if the read operation failed
-    if (!didSucceed) goto done;
-    // Compute the string result
-    char hash[2 * sizeof(digest) + 1];
-    for (size_t i = 0; i < sizeof(digest); ++i) {
-        snprintf(hash + (2 * i), 3, "%02x", (int)(digest[i]));
-    }
-    result = CFStringCreateWithCString(kCFAllocatorDefault,(const char *)hash,kCFStringEncodingUTF8);
-    
-done:
-    if (readStream) {
-        CFReadStreamClose(readStream);
-        CFRelease(readStream);
-    }
-    if (fileURL) {
-        CFRelease(fileURL);
-    }
-    return result;
-}
-
-+ (BOOL)fileExistsAtPath:(NSString *)path {
-    
-    NSFileManager *fm = [NSFileManager defaultManager];
-    
-    return [fm fileExistsAtPath:path];
-    
-    return NO;
-}
-+ (NSString *)htmlForVideo:(NSString*) iframeCode template:(NSString*) path
-{
-    
-    if(path==nil)
-        path=[[NSBundle mainBundle] pathForResource:@"photostack_video" ofType:@"html"];
-    NSString* tempate = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
-    
-    if(tempate==nil)
-        return @"";
-    
-//    NSData *imageData = UIImageJPEGRepresentation(image,1.0);
-//    NSString *imageSource = [NSString stringWithFormat:@"data:image/jpg;base64,%@",[imageData base64Encoding]];
-//    imageSource=[NSString stringWithFormat:@"<img src = \"%@\" />", imageSource];
-    
-    
-    tempate= [tempate stringByReplacingOccurrencesOfString:@"##replacement##" withString:iframeCode];
-    
-    return tempate;
-}
-
-+ (NSString *)htmlForImage:(UIImage *)image template:(NSString*) path
-{
-    
-    if(path==nil)
-        path=[[NSBundle mainBundle] pathForResource:@"photostack_image" ofType:@"html"];
-    NSString* tempate = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
-    
-    if(tempate==nil)
-        return @"";
-    
-    NSData *imageData = UIImageJPEGRepresentation(image,1.0);
-//    NSString *imageSource = [NSString stringWithFormat:@"data:image/jpg;base64,%@",[imageData base64Encoding]];
-    NSString *imageSource = [NSString stringWithFormat:@"data:image/jpg;base64,%@",[imageData base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithLineFeed]];
-    imageSource=[NSString stringWithFormat:@"<img src = \"%@\" />", imageSource];
-    
-    
-    tempate= [tempate stringByReplacingOccurrencesOfString:@"##replacement##" withString:imageSource];
-    
-    return tempate;
-}
-
-+ (nullable NSString *)md5:(nullable NSString *)str {
-    if (!str) return nil;
-    
-    const char *cStr = str.UTF8String;
-    unsigned char result[CC_MD5_DIGEST_LENGTH];
-    CC_MD5(cStr, (CC_LONG)strlen(cStr), result);
-    
-    NSMutableString *md5Str = [NSMutableString string];
-    for (int i = 0; i < CC_MD5_DIGEST_LENGTH; ++i) {
-        [md5Str appendFormat:@"%02x", result[i]];
-    }
-    return md5Str;
-}
-
-+ (void)ra_showAlertTitle:(NSString *)title message:(NSString *)msg withViewController:(UIViewController *)vc {
-    
-    if (vc) {
-        UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:title message:msg preferredStyle:UIAlertControllerStyleAlert];
-        UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
-            
-        }];
-        
-        [alertVC addAction:okAction];
-        
-        [vc presentViewController:alertVC animated:YES completion:nil];
-    }
-    
-}
-
-
-
-+ (CGSize)sizeWithFont:(NSString*)string font:(UIFont *)font constrainedToSize:(CGSize)maxsize lineBreakMode:(NSLineBreakMode)lineBreakMode
-{
-    
-    if(string.length==0)
-        return CGSizeZero;
-    // Let's make an NSAttributedString first
-    NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:string];
-    //Add LineBreakMode
-    NSMutableParagraphStyle *paragraphStyle = [NSMutableParagraphStyle new];
-    [paragraphStyle setLineBreakMode:lineBreakMode];
-    [attributedString setAttributes:@{NSParagraphStyleAttributeName:paragraphStyle} range:NSMakeRange(0, attributedString.length)];
-    // Add Font
-    [attributedString setAttributes:@{NSFontAttributeName:font} range:NSMakeRange(0, attributedString.length)];
-
-    //Now let's make the Bounding Rect
-    CGSize expectedSize = [attributedString boundingRectWithSize:maxsize options:NSStringDrawingUsesLineFragmentOrigin context:nil].size;
-    
-    return expectedSize;
-}
-
-@end
-
-
-
-

+ 1 - 1
RedAnt ERP Mobile/common/data_provider/RANetwork.h

@@ -226,7 +226,7 @@ extern NSString *const ScreenCodeOfflineSync;
 +(void)request_orderdetail:(NSMutableDictionary *) params completionHandler:(resultHandler)result;
 //+(void)request_commit_order:(NSString*) order_code completionHandler:(resultHandler)result;
 +(void)request_copy_order:(NSString*) order_code completionHandler:(resultHandler)result;
-+ (void)request_fastdownload:(NSMutableDictionary *)params url:(NSString *)url completionHandler:(resultHandler)result;
+//+ (void)request_fastdownload:(NSMutableDictionary *)params url:(NSString *)url completionHandler:(resultHandler)result;
 +(void) request_addto_portfolio:(NSString* ) item_id withScreen:(NSString *)screenName completionHandler:(resultHandler)result;
 
 +(void)request_addall_search:(long ) offset limit :(long)limit keywords :(NSString*) keywords matchfull:(bool)matchfull orderCode:(NSString*) orderCode  addTo:(NSString*) addTo completionHandler:(resultHandler)result;

+ 12 - 12
RedAnt ERP Mobile/common/data_provider/RANetwork.m

@@ -7872,18 +7872,18 @@ NSString *const ScreenCodeOfflineSync = @"Offline Sync Screen";
     //        return nil;
     
 }
-
-+ (void)request_fastdownload:(NSMutableDictionary *)params url:(NSString *)url completionHandler:(resultHandler)result
-{
-    
-    //#ifdef test_server
-    //    url=URL_REQUEST_RECORDS;
-    //    params[@"prefix"]=URL_REQUEST_RECORDS;
-    //#endif
-    
-    [self request_file_fast:url parameters:params completionHandler:result];
-    
-}
+//
+//+ (void)request_fastdownload:(NSMutableDictionary *)params url:(NSString *)url completionHandler:(resultHandler)result
+//{
+//    
+//    //#ifdef test_server
+//    //    url=URL_REQUEST_RECORDS;
+//    //    params[@"prefix"]=URL_REQUEST_RECORDS;
+//    //#endif
+//    
+//    [self request_file_fast:url parameters:params completionHandler:result];
+//    
+//}
 
 +(void) request_addto_portfolio:(NSString* ) item_id withScreen:(NSString *)screenName completionHandler:(resultHandler)result
 {

+ 7 - 5
RedAnt ERP Mobile/iSales-GATIT.xcodeproj/project.pbxproj

@@ -2006,7 +2006,7 @@
 		713F769E1929F4A7006A7305 /* Project object */ = {
 			isa = PBXProject;
 			attributes = {
-				LastUpgradeCheck = 1140;
+				LastUpgradeCheck = 1200;
 				ORGANIZATIONNAME = "United Software Applications, Inc";
 				TargetAttributes = {
 					713F76A51929F4A7006A7305 = {
@@ -2378,6 +2378,7 @@
 				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
 				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
 				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
 				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
 				CLANG_WARN_STRICT_PROTOTYPES = YES;
 				CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -2407,7 +2408,7 @@
 					"$(PROJECT_DIR)/common/qrcode",
 					"$(PROJECT_DIR)/common/CommonEditor",
 				);
-				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib";
 				ONLY_ACTIVE_ARCH = YES;
 				PRODUCT_NAME = "Titan Importer";
@@ -2439,6 +2440,7 @@
 				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
 				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
 				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
 				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
 				CLANG_WARN_STRICT_PROTOTYPES = YES;
 				CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -2461,7 +2463,7 @@
 					"$(PROJECT_DIR)/common/qrcode",
 					"$(PROJECT_DIR)/common/CommonEditor",
 				);
-				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib";
 				PRODUCT_NAME = "Titan Importer";
 				SDKROOT = iphoneos;
@@ -2487,7 +2489,7 @@
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
 				GCC_PREFIX_HEADER = "iSales-GATIT/iSales-GATIT-Prefix.pch";
 				INFOPLIST_FILE = "iSales-GATIT/iSales-GATIT-Info.plist";
-				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				LIBRARY_SEARCH_PATHS = (
 					"$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib",
 					"$(PROJECT_DIR)/GoogleAnalytics/GoogleAnalytics/Libraries",
@@ -2529,7 +2531,7 @@
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
 				GCC_PREFIX_HEADER = "iSales-GATIT/iSales-GATIT-Prefix.pch";
 				INFOPLIST_FILE = "iSales-GATIT/iSales-GATIT-Info.plist";
-				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				LIBRARY_SEARCH_PATHS = (
 					"$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib",
 					"$(PROJECT_DIR)/GoogleAnalytics/GoogleAnalytics/Libraries",

+ 7 - 5
RedAnt ERP Mobile/iSales-HOMER.xcodeproj/project.pbxproj

@@ -1982,7 +1982,7 @@
 		713F769E1929F4A7006A7305 /* Project object */ = {
 			isa = PBXProject;
 			attributes = {
-				LastUpgradeCheck = 1020;
+				LastUpgradeCheck = 1200;
 				ORGANIZATIONNAME = "United Software Applications, Inc";
 				TargetAttributes = {
 					713F76A51929F4A7006A7305 = {
@@ -2344,6 +2344,7 @@
 				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
 				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
 				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
 				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
 				CLANG_WARN_STRICT_PROTOTYPES = YES;
 				CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -2373,7 +2374,7 @@
 					"$(PROJECT_DIR)/common/qrcode",
 					"$(PROJECT_DIR)/common/CommonEditor",
 				);
-				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib";
 				ONLY_ACTIVE_ARCH = YES;
 				SDKROOT = iphoneos;
@@ -2404,6 +2405,7 @@
 				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
 				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
 				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
 				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
 				CLANG_WARN_STRICT_PROTOTYPES = YES;
 				CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -2426,7 +2428,7 @@
 					"$(PROJECT_DIR)/common/qrcode",
 					"$(PROJECT_DIR)/common/CommonEditor",
 				);
-				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib";
 				SDKROOT = iphoneos;
 				TARGETED_DEVICE_FAMILY = 2;
@@ -2451,7 +2453,7 @@
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
 				GCC_PREFIX_HEADER = "iSales-HOMER/iSales-HOMER-Prefix.pch";
 				INFOPLIST_FILE = "iSales-HOMER/iSales-HOMER-Info.plist";
-				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				LIBRARY_SEARCH_PATHS = (
 					"$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib",
 					"$(PROJECT_DIR)/GoogleAnalytics/GoogleAnalytics/Libraries",
@@ -2493,7 +2495,7 @@
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
 				GCC_PREFIX_HEADER = "iSales-HOMER/iSales-HOMER-Prefix.pch";
 				INFOPLIST_FILE = "iSales-HOMER/iSales-HOMER-Info.plist";
-				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				LIBRARY_SEARCH_PATHS = (
 					"$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib",
 					"$(PROJECT_DIR)/GoogleAnalytics/GoogleAnalytics/Libraries",

+ 7 - 5
RedAnt ERP Mobile/iSales-NPD.xcodeproj/project.pbxproj

@@ -2009,7 +2009,7 @@
 		713F769E1929F4A7006A7305 /* Project object */ = {
 			isa = PBXProject;
 			attributes = {
-				LastUpgradeCheck = 1020;
+				LastUpgradeCheck = 1200;
 				ORGANIZATIONNAME = "United Software Applications, Inc";
 				TargetAttributes = {
 					713F76A51929F4A7006A7305 = {
@@ -2382,6 +2382,7 @@
 				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
 				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
 				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
 				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
 				CLANG_WARN_STRICT_PROTOTYPES = YES;
 				CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -2411,7 +2412,7 @@
 					"$(PROJECT_DIR)/common/qrcode",
 					"$(PROJECT_DIR)/common/CommonEditor",
 				);
-				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib";
 				ONLY_ACTIVE_ARCH = YES;
 				SDKROOT = iphoneos;
@@ -2442,6 +2443,7 @@
 				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
 				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
 				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
 				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
 				CLANG_WARN_STRICT_PROTOTYPES = YES;
 				CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -2464,7 +2466,7 @@
 					"$(PROJECT_DIR)/common/qrcode",
 					"$(PROJECT_DIR)/common/CommonEditor",
 				);
-				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib";
 				SDKROOT = iphoneos;
 				TARGETED_DEVICE_FAMILY = 2;
@@ -2490,7 +2492,7 @@
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
 				GCC_PREFIX_HEADER = "iSales-NPD/iSales-NPD-Prefix.pch";
 				INFOPLIST_FILE = "$(SRCROOT)/iSales-NPD/iSales-NPD-Info.plist";
-				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				LIBRARY_SEARCH_PATHS = (
 					"$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib",
 					"$(PROJECT_DIR)/GoogleAnalytics/GoogleAnalytics/Libraries",
@@ -2534,7 +2536,7 @@
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
 				GCC_PREFIX_HEADER = "iSales-NPD/iSales-NPD-Prefix.pch";
 				INFOPLIST_FILE = "$(SRCROOT)/iSales-NPD/iSales-NPD-Info.plist";
-				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				LIBRARY_SEARCH_PATHS = (
 					"$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib",
 					"$(PROJECT_DIR)/GoogleAnalytics/GoogleAnalytics/Libraries",

+ 7 - 5
RedAnt ERP Mobile/iSales-TRADESHOW.xcodeproj/project.pbxproj

@@ -2007,7 +2007,7 @@
 		713F769E1929F4A7006A7305 /* Project object */ = {
 			isa = PBXProject;
 			attributes = {
-				LastUpgradeCheck = 1020;
+				LastUpgradeCheck = 1200;
 				ORGANIZATIONNAME = "United Software Applications, Inc";
 				TargetAttributes = {
 					713F76A51929F4A7006A7305 = {
@@ -2382,6 +2382,7 @@
 				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
 				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
 				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
 				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
 				CLANG_WARN_STRICT_PROTOTYPES = YES;
 				CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -2411,7 +2412,7 @@
 					"$(PROJECT_DIR)/common/qrcode",
 					"$(PROJECT_DIR)/common/CommonEditor",
 				);
-				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib";
 				ONLY_ACTIVE_ARCH = YES;
 				SDKROOT = iphoneos;
@@ -2442,6 +2443,7 @@
 				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
 				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
 				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
 				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
 				CLANG_WARN_STRICT_PROTOTYPES = YES;
 				CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -2464,7 +2466,7 @@
 					"$(PROJECT_DIR)/common/qrcode",
 					"$(PROJECT_DIR)/common/CommonEditor",
 				);
-				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib";
 				SDKROOT = iphoneos;
 				TARGETED_DEVICE_FAMILY = 2;
@@ -2490,7 +2492,7 @@
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
 				GCC_PREFIX_HEADER = "iSales-TRADESHOW/iSales-TRADESHOW-Prefix.pch";
 				INFOPLIST_FILE = "$(SRCROOT)/iSales-TRADESHOW/iSales-TRADESHOW-Info.plist";
-				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				LIBRARY_SEARCH_PATHS = (
 					"$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib",
 					"$(PROJECT_DIR)/GoogleAnalytics/GoogleAnalytics/Libraries",
@@ -2534,7 +2536,7 @@
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
 				GCC_PREFIX_HEADER = "iSales-TRADESHOW/iSales-TRADESHOW-Prefix.pch";
 				INFOPLIST_FILE = "$(SRCROOT)/iSales-TRADESHOW/iSales-TRADESHOW-Info.plist";
-				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				LIBRARY_SEARCH_PATHS = (
 					"$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib",
 					"$(PROJECT_DIR)/GoogleAnalytics/GoogleAnalytics/Libraries",

+ 7 - 5
RedAnt ERP Mobile/iSales-UNITED WAVER.xcodeproj/project.pbxproj

@@ -2012,7 +2012,7 @@
 		713F769E1929F4A7006A7305 /* Project object */ = {
 			isa = PBXProject;
 			attributes = {
-				LastUpgradeCheck = 1100;
+				LastUpgradeCheck = 1200;
 				ORGANIZATIONNAME = "United Software Applications, Inc";
 				TargetAttributes = {
 					713F76A51929F4A7006A7305 = {
@@ -2386,6 +2386,7 @@
 				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
 				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
 				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
 				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
 				CLANG_WARN_STRICT_PROTOTYPES = YES;
 				CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -2415,7 +2416,7 @@
 					"$(PROJECT_DIR)/common/qrcode",
 					"$(PROJECT_DIR)/common/CommonEditor",
 				);
-				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib";
 				ONLY_ACTIVE_ARCH = YES;
 				SDKROOT = iphoneos;
@@ -2446,6 +2447,7 @@
 				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
 				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
 				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
 				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
 				CLANG_WARN_STRICT_PROTOTYPES = YES;
 				CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -2468,7 +2470,7 @@
 					"$(PROJECT_DIR)/common/qrcode",
 					"$(PROJECT_DIR)/common/CommonEditor",
 				);
-				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib";
 				SDKROOT = iphoneos;
 				TARGETED_DEVICE_FAMILY = 2;
@@ -2496,7 +2498,7 @@
 				GCC_PREFIX_HEADER = "iSales-UWAVER/iSales-UWAVER-Prefix.pch";
 				GCC_WARN_INHIBIT_ALL_WARNINGS = NO;
 				INFOPLIST_FILE = "$(SRCROOT)/iSales-UWAVER/iSales-UWAVER-Info.plist";
-				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				LIBRARY_SEARCH_PATHS = (
 					"$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib",
 					"$(PROJECT_DIR)/GoogleAnalytics/GoogleAnalytics/Libraries",
@@ -2542,7 +2544,7 @@
 				GCC_PREFIX_HEADER = "iSales-UWAVER/iSales-UWAVER-Prefix.pch";
 				GCC_WARN_INHIBIT_ALL_WARNINGS = NO;
 				INFOPLIST_FILE = "$(SRCROOT)/iSales-UWAVER/iSales-UWAVER-Info.plist";
-				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				LIBRARY_SEARCH_PATHS = (
 					"$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib",
 					"$(PROJECT_DIR)/GoogleAnalytics/GoogleAnalytics/Libraries",

+ 7 - 5
RedAnt ERP Mobile/iSales-USAI.xcodeproj/project.pbxproj

@@ -2011,7 +2011,7 @@
 		713F769E1929F4A7006A7305 /* Project object */ = {
 			isa = PBXProject;
 			attributes = {
-				LastUpgradeCheck = 1020;
+				LastUpgradeCheck = 1200;
 				ORGANIZATIONNAME = "United Software Applications, Inc";
 				TargetAttributes = {
 					713F76A51929F4A7006A7305 = {
@@ -2384,6 +2384,7 @@
 				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
 				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
 				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
 				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
 				CLANG_WARN_STRICT_PROTOTYPES = YES;
 				CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -2413,7 +2414,7 @@
 					"$(PROJECT_DIR)/common/qrcode",
 					"$(PROJECT_DIR)/common/CommonEditor",
 				);
-				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib";
 				ONLY_ACTIVE_ARCH = YES;
 				SDKROOT = iphoneos;
@@ -2444,6 +2445,7 @@
 				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
 				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
 				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
 				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
 				CLANG_WARN_STRICT_PROTOTYPES = YES;
 				CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -2466,7 +2468,7 @@
 					"$(PROJECT_DIR)/common/qrcode",
 					"$(PROJECT_DIR)/common/CommonEditor",
 				);
-				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib";
 				SDKROOT = iphoneos;
 				TARGETED_DEVICE_FAMILY = 2;
@@ -2492,7 +2494,7 @@
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
 				GCC_PREFIX_HEADER = "iSales-USAI/iSales-USAI-Prefix.pch";
 				INFOPLIST_FILE = "$(SRCROOT)/iSales-USAI/iSales-USAI-Info.plist";
-				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				LIBRARY_SEARCH_PATHS = (
 					"$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib",
 					"$(PROJECT_DIR)/GoogleAnalytics/GoogleAnalytics/Libraries",
@@ -2535,7 +2537,7 @@
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
 				GCC_PREFIX_HEADER = "iSales-USAI/iSales-USAI-Prefix.pch";
 				INFOPLIST_FILE = "$(SRCROOT)/iSales-USAI/iSales-USAI-Info.plist";
-				IPHONEOS_DEPLOYMENT_TARGET = 11.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				LIBRARY_SEARCH_PATHS = (
 					"$(PROJECT_DIR)/ScanApiSDK-10.2.227-2/lib",
 					"$(PROJECT_DIR)/GoogleAnalytics/GoogleAnalytics/Libraries",

+ 37 - 192
RedAnt Mobile/RedAnt Mobile.xcodeproj/project.pbxproj

@@ -7,6 +7,10 @@
 	objects = {
 
 /* Begin PBXBuildFile section */
+		3C35977E255521420092D740 /* ytplayer.html in Resources */ = {isa = PBXBuildFile; fileRef = 3C35977B255521420092D740 /* ytplayer.html */; };
+		3C35977F255521420092D740 /* RAYTPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C35977D255521420092D740 /* RAYTPlayer.m */; };
+		3C359783255521760092D740 /* RAUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C359782255521760092D740 /* RAUtils.m */; };
+		3C359787255521C00092D740 /* UIImage+RedAnt.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C359785255521C00092D740 /* UIImage+RedAnt.m */; };
 		3C9BED1823740CAA0052241C /* RATakePhotoPreviewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C9BED1223740CAA0052241C /* RATakePhotoPreviewController.m */; };
 		3C9BED1923740CAA0052241C /* Camera.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3C9BED1323740CAA0052241C /* Camera.storyboard */; };
 		3C9BED1A23740CAA0052241C /* camera.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3C9BED1423740CAA0052241C /* camera.xcassets */; };
@@ -14,7 +18,6 @@
 		3C9BED2123740D500052241C /* RAQRCodeScannerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C9BED2023740D4F0052241C /* RAQRCodeScannerViewController.m */; };
 		3C9BED2423740DC00052241C /* RAPhotoPreviewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C9BED2223740DC00052241C /* RAPhotoPreviewController.m */; };
 		3C9BED2723740E2A0052241C /* RAPhotoPreviewModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C9BED2623740E2A0052241C /* RAPhotoPreviewModel.m */; };
-		3C9BED2A23740E540052241C /* PODModeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C9BED2923740E540052241C /* PODModeViewController.m */; };
 		4221EF931FA813030026E1EC /* RAModeCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4221EF921FA813030026E1EC /* RAModeCell.m */; };
 		4221EF9A1FA81D070026E1EC /* RAPredefQueryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4221EF991FA81D070026E1EC /* RAPredefQueryViewController.m */; };
 		4221EF9D1FA81D5B0026E1EC /* RAQueryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4221EF9C1FA81D5B0026E1EC /* RAQueryViewController.m */; };
@@ -39,19 +42,10 @@
 		42D64C931FD0FAA4003F49F9 /* CommonEditorBannerCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 42D64C8F1FD0FAA3003F49F9 /* CommonEditorBannerCell.m */; };
 		42D64C941FD0FAA4003F49F9 /* Phone_Banner_Cell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 42D64C901FD0FAA3003F49F9 /* Phone_Banner_Cell.xib */; };
 		42D64C951FD0FAA4003F49F9 /* Phone_Banner_Item_Cell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 42D64C911FD0FAA3003F49F9 /* Phone_Banner_Item_Cell.xib */; };
-		42D64C9D1FD0FAEF003F49F9 /* Assets.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 42D64C971FD0FAEE003F49F9 /* Assets.bundle */; };
-		42D64C9E1FD0FAEF003F49F9 /* YTPlayerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 42D64C9A1FD0FAEE003F49F9 /* YTPlayerView.m */; };
-		42D64C9F1FD0FAEF003F49F9 /* YTViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 42D64C9C1FD0FAEE003F49F9 /* YTViewController.m */; };
 		42D64CB61FD0FEB5003F49F9 /* ContentPreviewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 42D64CAE1FD0FEB4003F49F9 /* ContentPreviewController.m */; };
 		42D64CB71FD0FEB5003F49F9 /* PhotoList.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 42D64CB01FD0FEB4003F49F9 /* PhotoList.storyboard */; };
 		42D64CB81FD0FEB5003F49F9 /* PhotoPreviewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 42D64CB31FD0FEB4003F49F9 /* PhotoPreviewCell.m */; };
 		42D64CB91FD0FEB5003F49F9 /* VideoPreviewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 42D64CB51FD0FEB4003F49F9 /* VideoPreviewCell.m */; };
-		42D64CCE1FD12BCF003F49F9 /* NewPhotoPreviewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 42D64CC41FD12BCE003F49F9 /* NewPhotoPreviewController.m */; };
-		42D64CCF1FD12BCF003F49F9 /* PhotoPreviewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 42D64CC61FD12BCE003F49F9 /* PhotoPreviewController.m */; };
-		42D64CD01FD12BCF003F49F9 /* RAImagePhotoPreviewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 42D64CC71FD12BCE003F49F9 /* RAImagePhotoPreviewCell.m */; };
-		42D64CD11FD12BCF003F49F9 /* RAImage_PhotoList.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 42D64CC81FD12BCE003F49F9 /* RAImage_PhotoList.storyboard */; };
-		42D64CD21FD12BCF003F49F9 /* PhotoCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 42D64CCB1FD12BCE003F49F9 /* PhotoCell.m */; };
-		42D64CD31FD12BCF003F49F9 /* PhotoListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 42D64CCD1FD12BCF003F49F9 /* PhotoListViewController.m */; };
 		42D8CD5C1FC662E7005BEA15 /* CommonEditorTableContainerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 42D8CD5A1FC662E7005BEA15 /* CommonEditorTableContainerView.m */; };
 		42DBCB111FBEC0B7005574E0 /* CommonEditorWebCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 42DBCB101FBEC0B7005574E0 /* CommonEditorWebCell.m */; };
 		42DBCB131FBEC0E1005574E0 /* Phone_Web_Cell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 42DBCB121FBEC0E1005574E0 /* Phone_Web_Cell.xib */; };
@@ -66,19 +60,9 @@
 		42DFAE7B1F9B2CE6009AFCCC /* Phone_Switch_Cell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 42DFAE7A1F9B2CE6009AFCCC /* Phone_Switch_Cell.xib */; };
 		42DFAE7D1F9B2D02009AFCCC /* Phone_TextView_Cell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 42DFAE7C1F9B2D02009AFCCC /* Phone_TextView_Cell.xib */; };
 		7102C13B1FCC0FF70062A67A /* ImageUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 7102C1391FCC0FF60062A67A /* ImageUtils.m */; };
-		7102C13E1FCD46C10062A67A /* RootViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7102C13C1FCD46C00062A67A /* RootViewController.m */; };
-		7102C1411FCD46DE0062A67A /* RootModeCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 7102C1401FCD46DE0062A67A /* RootModeCell.m */; };
-		7102C1461FCD51FF0062A67A /* RAImage.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7102C1431FCD486F0062A67A /* RAImage.storyboard */; };
 		714590FE1FE36D99007FD0A4 /* CommonEditorAutoCompleteView.m in Sources */ = {isa = PBXBuildFile; fileRef = 714590FB1FE36D98007FD0A4 /* CommonEditorAutoCompleteView.m */; };
 		714590FF1FE36D99007FD0A4 /* CommonEditorAutoCompleteView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 714590FC1FE36D99007FD0A4 /* CommonEditorAutoCompleteView.xib */; };
 		714591081FEB8E68007FD0A4 /* MDHTMLLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 714591071FEB8E67007FD0A4 /* MDHTMLLabel.m */; };
-		7167802D1FCC087E00FE2784 /* BasicModeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7167802B1FCC087E00FE2784 /* BasicModeViewController.m */; };
-		7167802F1FCC095000FE2784 /* Mode.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7167802E1FCC095000FE2784 /* Mode.storyboard */; };
-		716780321FCC095D00FE2784 /* TakePhotoPreviewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 716780311FCC095D00FE2784 /* TakePhotoPreviewController.m */; };
-		716780351FCC096B00FE2784 /* PopModeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 716780331FCC096B00FE2784 /* PopModeViewController.m */; };
-		716780381FCC097B00FE2784 /* ModelModeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 716780371FCC097B00FE2784 /* ModelModeViewController.m */; };
-		7167803B1FCC098600FE2784 /* ManufacturerListController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7167803A1FCC098600FE2784 /* ManufacturerListController.m */; };
-		7167803E1FCC099200FE2784 /* ManufacturerCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 7167803D1FCC099200FE2784 /* ManufacturerCell.m */; };
 		716780411FCC0A2900FE2784 /* cam_scan.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 716780401FCC0A2900FE2784 /* cam_scan.storyboard */; };
 		7167804C1FCC0B0000FE2784 /* MenuViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 716780421FCC0AFF00FE2784 /* MenuViewController.m */; };
 		7167804D1FCC0B0000FE2784 /* RAMenu.m in Sources */ = {isa = PBXBuildFile; fileRef = 716780431FCC0AFF00FE2784 /* RAMenu.m */; };
@@ -123,7 +107,6 @@
 		71F3A9D01F5FA277001036C8 /* BasicViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71F3A9CF1F5FA277001036C8 /* BasicViewController.m */; };
 		71F3A9D91F5FA3B9001036C8 /* RANetwork.m in Sources */ = {isa = PBXBuildFile; fileRef = 71F3A9D81F5FA3B9001036C8 /* RANetwork.m */; };
 		71F3A9DC1F5FA458001036C8 /* RANetworkTaskDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 71F3A9DB1F5FA458001036C8 /* RANetworkTaskDelegate.m */; };
-		71F3A9E01F5FA484001036C8 /* RAUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 71F3A9DF1F5FA484001036C8 /* RAUtils.m */; };
 		71F3A9E31F5FA531001036C8 /* JLKeyboardListener.m in Sources */ = {isa = PBXBuildFile; fileRef = 71F3A9E21F5FA531001036C8 /* JLKeyboardListener.m */; };
 		71F3A9ED1F5FA557001036C8 /* ioapi.c in Sources */ = {isa = PBXBuildFile; fileRef = 71F3A9E61F5FA557001036C8 /* ioapi.c */; };
 		71F3A9EE1F5FA557001036C8 /* mztools.c in Sources */ = {isa = PBXBuildFile; fileRef = 71F3A9E81F5FA557001036C8 /* mztools.c */; };
@@ -187,6 +170,13 @@
 /* End PBXBuildFile section */
 
 /* Begin PBXFileReference section */
+		3C35977B255521420092D740 /* ytplayer.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; name = ytplayer.html; path = ../../../common/Youtube/ytplayer.html; sourceTree = "<group>"; };
+		3C35977C255521420092D740 /* RAYTPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RAYTPlayer.h; path = ../../../common/Youtube/RAYTPlayer.h; sourceTree = "<group>"; };
+		3C35977D255521420092D740 /* RAYTPlayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RAYTPlayer.m; path = ../../../common/Youtube/RAYTPlayer.m; sourceTree = "<group>"; };
+		3C359781255521760092D740 /* RAUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RAUtils.h; path = ../../common/RAUtils.h; sourceTree = "<group>"; };
+		3C359782255521760092D740 /* RAUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RAUtils.m; path = ../../common/RAUtils.m; sourceTree = "<group>"; };
+		3C359785255521C00092D740 /* UIImage+RedAnt.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIImage+RedAnt.m"; path = "../../common/UIImage/UIImage+RedAnt.m"; sourceTree = "<group>"; };
+		3C359786255521C00092D740 /* UIImage+RedAnt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIImage+RedAnt.h"; path = "../../common/UIImage/UIImage+RedAnt.h"; sourceTree = "<group>"; };
 		3C9BED1023740C1B0052241C /* RAPhotoDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RAPhotoDelegate.h; path = ../../common/InfinitePhoto/Delegate/RAPhotoDelegate.h; sourceTree = "<group>"; };
 		3C9BED1123740CAA0052241C /* RACamera.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RACamera.h; path = ../../common/Camera/RACamera.h; sourceTree = "<group>"; };
 		3C9BED1223740CAA0052241C /* RATakePhotoPreviewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RATakePhotoPreviewController.m; path = ../../common/Camera/RATakePhotoPreviewController.m; sourceTree = "<group>"; };
@@ -201,8 +191,6 @@
 		3C9BED2323740DC00052241C /* RAPhotoPreviewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RAPhotoPreviewController.h; path = ../../common/InfinitePhoto/Controller/RAPhotoPreviewController.h; sourceTree = "<group>"; };
 		3C9BED2523740E2A0052241C /* RAPhotoPreviewModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RAPhotoPreviewModel.h; path = "../../RA Image/RA Image/RAPhotoPreviewModel/RAPhotoPreviewModel.h"; sourceTree = "<group>"; };
 		3C9BED2623740E2A0052241C /* RAPhotoPreviewModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RAPhotoPreviewModel.m; path = "../../RA Image/RA Image/RAPhotoPreviewModel/RAPhotoPreviewModel.m"; sourceTree = "<group>"; };
-		3C9BED2823740E540052241C /* PODModeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PODModeViewController.h; path = "../../RA Image/RA Image/PODModeViewController.h"; sourceTree = "<group>"; };
-		3C9BED2923740E540052241C /* PODModeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PODModeViewController.m; path = "../../RA Image/RA Image/PODModeViewController.m"; sourceTree = "<group>"; };
 		4221EF911FA813030026E1EC /* RAModeCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RAModeCell.h; sourceTree = "<group>"; };
 		4221EF921FA813030026E1EC /* RAModeCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RAModeCell.m; sourceTree = "<group>"; };
 		4221EF981FA81D070026E1EC /* RAPredefQueryViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RAPredefQueryViewController.h; sourceTree = "<group>"; };
@@ -241,12 +229,6 @@
 		42D64C8F1FD0FAA3003F49F9 /* CommonEditorBannerCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CommonEditorBannerCell.m; path = "../../RedAnt ERP Mobile/common/CommonEditor/CommonEditorBannerCell.m"; sourceTree = "<group>"; };
 		42D64C901FD0FAA3003F49F9 /* Phone_Banner_Cell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = Phone_Banner_Cell.xib; path = "../../RedAnt ERP Mobile/common/CommonEditor/Phone_Banner_Cell.xib"; sourceTree = "<group>"; };
 		42D64C911FD0FAA3003F49F9 /* Phone_Banner_Item_Cell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = Phone_Banner_Item_Cell.xib; path = "../../RedAnt ERP Mobile/common/CommonEditor/Phone_Banner_Item_Cell.xib"; sourceTree = "<group>"; };
-		42D64C971FD0FAEE003F49F9 /* Assets.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = Assets.bundle; sourceTree = "<group>"; };
-		42D64C981FD0FAEE003F49F9 /* YouTubeiOSPlayerHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YouTubeiOSPlayerHelper.h; sourceTree = "<group>"; };
-		42D64C991FD0FAEE003F49F9 /* YTPlayerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YTPlayerView.h; sourceTree = "<group>"; };
-		42D64C9A1FD0FAEE003F49F9 /* YTPlayerView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = YTPlayerView.m; sourceTree = "<group>"; };
-		42D64C9B1FD0FAEE003F49F9 /* YTViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YTViewController.h; sourceTree = "<group>"; };
-		42D64C9C1FD0FAEE003F49F9 /* YTViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = YTViewController.m; sourceTree = "<group>"; };
 		42D64CAD1FD0FEB4003F49F9 /* ContentPreviewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContentPreviewController.h; sourceTree = "<group>"; };
 		42D64CAE1FD0FEB4003F49F9 /* ContentPreviewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ContentPreviewController.m; sourceTree = "<group>"; };
 		42D64CB01FD0FEB4003F49F9 /* PhotoList.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = PhotoList.storyboard; sourceTree = "<group>"; };
@@ -254,17 +236,6 @@
 		42D64CB31FD0FEB4003F49F9 /* PhotoPreviewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PhotoPreviewCell.m; sourceTree = "<group>"; };
 		42D64CB41FD0FEB4003F49F9 /* VideoPreviewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoPreviewCell.h; sourceTree = "<group>"; };
 		42D64CB51FD0FEB4003F49F9 /* VideoPreviewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VideoPreviewCell.m; sourceTree = "<group>"; };
-		42D64CC31FD12BCE003F49F9 /* PhotoPreviewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PhotoPreviewController.h; path = "../../RA Image/RA Image/PhotoPreviewController.h"; sourceTree = "<group>"; };
-		42D64CC41FD12BCE003F49F9 /* NewPhotoPreviewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NewPhotoPreviewController.m; path = "../../RA Image/RA Image/NewPhotoPreviewController.m"; sourceTree = "<group>"; };
-		42D64CC51FD12BCE003F49F9 /* PhotoListViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PhotoListViewController.h; path = "../../RA Image/RA Image/PhotoListViewController.h"; sourceTree = "<group>"; };
-		42D64CC61FD12BCE003F49F9 /* PhotoPreviewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PhotoPreviewController.m; path = "../../RA Image/RA Image/PhotoPreviewController.m"; sourceTree = "<group>"; };
-		42D64CC71FD12BCE003F49F9 /* RAImagePhotoPreviewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RAImagePhotoPreviewCell.m; path = "../../RA Image/RA Image/RAImagePhotoPreviewCell.m"; sourceTree = "<group>"; };
-		42D64CC81FD12BCE003F49F9 /* RAImage_PhotoList.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = RAImage_PhotoList.storyboard; path = "../../RA Image/RA Image/RAImage_PhotoList.storyboard"; sourceTree = "<group>"; };
-		42D64CC91FD12BCE003F49F9 /* NewPhotoPreviewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NewPhotoPreviewController.h; path = "../../RA Image/RA Image/NewPhotoPreviewController.h"; sourceTree = "<group>"; };
-		42D64CCA1FD12BCE003F49F9 /* RAImagePhotoPreviewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RAImagePhotoPreviewCell.h; path = "../../RA Image/RA Image/RAImagePhotoPreviewCell.h"; sourceTree = "<group>"; };
-		42D64CCB1FD12BCE003F49F9 /* PhotoCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PhotoCell.m; path = "../../RA Image/RA Image/PhotoCell.m"; sourceTree = "<group>"; };
-		42D64CCC1FD12BCF003F49F9 /* PhotoCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PhotoCell.h; path = "../../RA Image/RA Image/PhotoCell.h"; sourceTree = "<group>"; };
-		42D64CCD1FD12BCF003F49F9 /* PhotoListViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PhotoListViewController.m; path = "../../RA Image/RA Image/PhotoListViewController.m"; sourceTree = "<group>"; };
 		42D8CD5A1FC662E7005BEA15 /* CommonEditorTableContainerView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CommonEditorTableContainerView.m; path = "../../RedAnt ERP Mobile/common/CommonEditor/CommonEditorTableContainerView.m"; sourceTree = "<group>"; };
 		42D8CD5B1FC662E7005BEA15 /* CommonEditorTableContainerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommonEditorTableContainerView.h; path = "../../RedAnt ERP Mobile/common/CommonEditor/CommonEditorTableContainerView.h"; sourceTree = "<group>"; };
 		42DBCB0F1FBEC0B7005574E0 /* CommonEditorWebCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CommonEditorWebCell.h; path = "../../RedAnt ERP Mobile/common/CommonEditor/CommonEditorWebCell.h"; sourceTree = "<group>"; };
@@ -282,29 +253,11 @@
 		42DFAE7C1F9B2D02009AFCCC /* Phone_TextView_Cell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = Phone_TextView_Cell.xib; sourceTree = "<group>"; };
 		7102C1391FCC0FF60062A67A /* ImageUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ImageUtils.m; path = "../../RedAnt ERP Mobile/common/ImageUtils.m"; sourceTree = "<group>"; };
 		7102C13A1FCC0FF60062A67A /* ImageUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ImageUtils.h; path = "../../RedAnt ERP Mobile/common/ImageUtils.h"; sourceTree = "<group>"; };
-		7102C13C1FCD46C00062A67A /* RootViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RootViewController.m; path = "../../RA Image/RA Image/RootViewController.m"; sourceTree = "<group>"; };
-		7102C13D1FCD46C00062A67A /* RootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RootViewController.h; path = "../../RA Image/RA Image/RootViewController.h"; sourceTree = "<group>"; };
-		7102C13F1FCD46DE0062A67A /* RootModeCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RootModeCell.h; path = "../../RA Image/RA Image/RootModeCell.h"; sourceTree = "<group>"; };
-		7102C1401FCD46DE0062A67A /* RootModeCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RootModeCell.m; path = "../../RA Image/RA Image/RootModeCell.m"; sourceTree = "<group>"; };
-		7102C1441FCD486F0062A67A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = "../../RA Image/RA Image/Base.lproj/RAImage.storyboard"; sourceTree = "<group>"; };
 		714590FB1FE36D98007FD0A4 /* CommonEditorAutoCompleteView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CommonEditorAutoCompleteView.m; path = ../../common/customUI/commoneditor/CommonEditorAutoCompleteView.m; sourceTree = "<group>"; };
 		714590FC1FE36D99007FD0A4 /* CommonEditorAutoCompleteView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = CommonEditorAutoCompleteView.xib; path = ../../common/customUI/commoneditor/CommonEditorAutoCompleteView.xib; sourceTree = "<group>"; };
 		714590FD1FE36D99007FD0A4 /* CommonEditorAutoCompleteView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommonEditorAutoCompleteView.h; path = ../../common/customUI/commoneditor/CommonEditorAutoCompleteView.h; sourceTree = "<group>"; };
 		714591061FEB8E67007FD0A4 /* MDHTMLLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MDHTMLLabel.h; path = "../../RedAnt ERP Mobile/common/customUI/MDHTMLLabel.h"; sourceTree = "<group>"; };
 		714591071FEB8E67007FD0A4 /* MDHTMLLabel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MDHTMLLabel.m; path = "../../RedAnt ERP Mobile/common/customUI/MDHTMLLabel.m"; sourceTree = "<group>"; };
-		7167802B1FCC087E00FE2784 /* BasicModeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BasicModeViewController.m; path = "../../RA Image/RA Image/BasicModeViewController.m"; sourceTree = "<group>"; };
-		7167802C1FCC087E00FE2784 /* BasicModeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BasicModeViewController.h; path = "../../RA Image/RA Image/BasicModeViewController.h"; sourceTree = "<group>"; };
-		7167802E1FCC095000FE2784 /* Mode.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Mode.storyboard; path = "../../RA Image/RA Image/Mode.storyboard"; sourceTree = "<group>"; };
-		716780301FCC095D00FE2784 /* TakePhotoPreviewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TakePhotoPreviewController.h; path = "../../RA Image/RA Image/TakePhotoPreviewController.h"; sourceTree = "<group>"; };
-		716780311FCC095D00FE2784 /* TakePhotoPreviewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TakePhotoPreviewController.m; path = "../../RA Image/RA Image/TakePhotoPreviewController.m"; sourceTree = "<group>"; };
-		716780331FCC096B00FE2784 /* PopModeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PopModeViewController.m; path = "../../RA Image/RA Image/PopModeViewController.m"; sourceTree = "<group>"; };
-		716780341FCC096B00FE2784 /* PopModeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PopModeViewController.h; path = "../../RA Image/RA Image/PopModeViewController.h"; sourceTree = "<group>"; };
-		716780361FCC097B00FE2784 /* ModelModeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ModelModeViewController.h; path = "../../RA Image/RA Image/ModelModeViewController.h"; sourceTree = "<group>"; };
-		716780371FCC097B00FE2784 /* ModelModeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ModelModeViewController.m; path = "../../RA Image/RA Image/ModelModeViewController.m"; sourceTree = "<group>"; };
-		716780391FCC098600FE2784 /* ManufacturerListController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ManufacturerListController.h; path = "../../RA Image/RA Image/ManufacturerListController.h"; sourceTree = "<group>"; };
-		7167803A1FCC098600FE2784 /* ManufacturerListController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ManufacturerListController.m; path = "../../RA Image/RA Image/ManufacturerListController.m"; sourceTree = "<group>"; };
-		7167803C1FCC099200FE2784 /* ManufacturerCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ManufacturerCell.h; path = "../../RA Image/RA Image/ManufacturerCell.h"; sourceTree = "<group>"; };
-		7167803D1FCC099200FE2784 /* ManufacturerCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ManufacturerCell.m; path = "../../RA Image/RA Image/ManufacturerCell.m"; sourceTree = "<group>"; };
 		716780401FCC0A2900FE2784 /* cam_scan.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = cam_scan.storyboard; path = ../../common/cam_scan.storyboard; sourceTree = "<group>"; };
 		716780421FCC0AFF00FE2784 /* MenuViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MenuViewController.m; path = ../../common/MenuViewController.m; sourceTree = "<group>"; };
 		716780431FCC0AFF00FE2784 /* RAMenu.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RAMenu.m; path = ../../common/RAMenu.m; sourceTree = "<group>"; };
@@ -385,8 +338,6 @@
 		71F3A9D81F5FA3B9001036C8 /* RANetwork.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RANetwork.m; sourceTree = "<group>"; };
 		71F3A9DA1F5FA458001036C8 /* RANetworkTaskDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RANetworkTaskDelegate.h; path = ../../common/upload/RANetworkTaskDelegate.h; sourceTree = "<group>"; };
 		71F3A9DB1F5FA458001036C8 /* RANetworkTaskDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RANetworkTaskDelegate.m; path = ../../common/upload/RANetworkTaskDelegate.m; sourceTree = "<group>"; };
-		71F3A9DE1F5FA484001036C8 /* RAUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RAUtils.h; path = "../../RedAnt ERP Mobile/common/RAUtils.h"; sourceTree = "<group>"; };
-		71F3A9DF1F5FA484001036C8 /* RAUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RAUtils.m; path = "../../RedAnt ERP Mobile/common/RAUtils.m"; sourceTree = "<group>"; };
 		71F3A9E11F5FA531001036C8 /* JLKeyboardListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JLKeyboardListener.h; sourceTree = "<group>"; };
 		71F3A9E21F5FA531001036C8 /* JLKeyboardListener.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JLKeyboardListener.m; sourceTree = "<group>"; };
 		71F3A9E51F5FA557001036C8 /* crypt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = crypt.h; path = "../../RedAnt ERP Mobile/common/zip/minizip/crypt.h"; sourceTree = "<group>"; };
@@ -596,12 +547,9 @@
 		42D64C961FD0FAEE003F49F9 /* youtube */ = {
 			isa = PBXGroup;
 			children = (
-				42D64C971FD0FAEE003F49F9 /* Assets.bundle */,
-				42D64C981FD0FAEE003F49F9 /* YouTubeiOSPlayerHelper.h */,
-				42D64C991FD0FAEE003F49F9 /* YTPlayerView.h */,
-				42D64C9A1FD0FAEE003F49F9 /* YTPlayerView.m */,
-				42D64C9B1FD0FAEE003F49F9 /* YTViewController.h */,
-				42D64C9C1FD0FAEE003F49F9 /* YTViewController.m */,
+				3C35977C255521420092D740 /* RAYTPlayer.h */,
+				3C35977D255521420092D740 /* RAYTPlayer.m */,
+				3C35977B255521420092D740 /* ytplayer.html */,
 			);
 			name = youtube;
 			path = "../../RedAnt ERP Mobile/common/youtube";
@@ -646,78 +594,6 @@
 			path = View;
 			sourceTree = "<group>";
 		};
-		42D64CBA1FD125BB003F49F9 /* Root */ = {
-			isa = PBXGroup;
-			children = (
-				7102C13F1FCD46DE0062A67A /* RootModeCell.h */,
-				7102C1401FCD46DE0062A67A /* RootModeCell.m */,
-				7102C13D1FCD46C00062A67A /* RootViewController.h */,
-				7102C13C1FCD46C00062A67A /* RootViewController.m */,
-			);
-			name = Root;
-			sourceTree = "<group>";
-		};
-		42D64CBB1FD12620003F49F9 /* Modes */ = {
-			isa = PBXGroup;
-			children = (
-				716780301FCC095D00FE2784 /* TakePhotoPreviewController.h */,
-				716780311FCC095D00FE2784 /* TakePhotoPreviewController.m */,
-				7167802C1FCC087E00FE2784 /* BasicModeViewController.h */,
-				7167802B1FCC087E00FE2784 /* BasicModeViewController.m */,
-				42D64CBC1FD1262E003F49F9 /* POP */,
-				42D64CBD1FD12655003F49F9 /* Model */,
-			);
-			name = Modes;
-			sourceTree = "<group>";
-		};
-		42D64CBC1FD1262E003F49F9 /* POP */ = {
-			isa = PBXGroup;
-			children = (
-				716780341FCC096B00FE2784 /* PopModeViewController.h */,
-				716780331FCC096B00FE2784 /* PopModeViewController.m */,
-			);
-			name = POP;
-			sourceTree = "<group>";
-		};
-		42D64CBD1FD12655003F49F9 /* Model */ = {
-			isa = PBXGroup;
-			children = (
-				716780361FCC097B00FE2784 /* ModelModeViewController.h */,
-				716780371FCC097B00FE2784 /* ModelModeViewController.m */,
-				42D64CBE1FD1266B003F49F9 /* Manufacture */,
-			);
-			name = Model;
-			sourceTree = "<group>";
-		};
-		42D64CBE1FD1266B003F49F9 /* Manufacture */ = {
-			isa = PBXGroup;
-			children = (
-				716780391FCC098600FE2784 /* ManufacturerListController.h */,
-				7167803A1FCC098600FE2784 /* ManufacturerListController.m */,
-				7167803C1FCC099200FE2784 /* ManufacturerCell.h */,
-				7167803D1FCC099200FE2784 /* ManufacturerCell.m */,
-			);
-			name = Manufacture;
-			sourceTree = "<group>";
-		};
-		42D64CC21FD12B74003F49F9 /* PhotoList */ = {
-			isa = PBXGroup;
-			children = (
-				42D64CC81FD12BCE003F49F9 /* RAImage_PhotoList.storyboard */,
-				42D64CC51FD12BCE003F49F9 /* PhotoListViewController.h */,
-				42D64CCD1FD12BCF003F49F9 /* PhotoListViewController.m */,
-				42D64CCC1FD12BCF003F49F9 /* PhotoCell.h */,
-				42D64CCB1FD12BCE003F49F9 /* PhotoCell.m */,
-				42D64CC31FD12BCE003F49F9 /* PhotoPreviewController.h */,
-				42D64CC61FD12BCE003F49F9 /* PhotoPreviewController.m */,
-				42D64CC91FD12BCE003F49F9 /* NewPhotoPreviewController.h */,
-				42D64CC41FD12BCE003F49F9 /* NewPhotoPreviewController.m */,
-				42D64CCA1FD12BCE003F49F9 /* RAImagePhotoPreviewCell.h */,
-				42D64CC71FD12BCE003F49F9 /* RAImagePhotoPreviewCell.m */,
-			);
-			name = PhotoList;
-			sourceTree = "<group>";
-		};
 		42DBCB0E1FBEC055005574E0 /* WebCell */ = {
 			isa = PBXGroup;
 			children = (
@@ -901,18 +777,6 @@
 			path = detail;
 			sourceTree = "<group>";
 		};
-		71A2ACC71FCBEF2500F398DA /* RA IMAGE */ = {
-			isa = PBXGroup;
-			children = (
-				42D64CC21FD12B74003F49F9 /* PhotoList */,
-				42D64CBB1FD12620003F49F9 /* Modes */,
-				42D64CBA1FD125BB003F49F9 /* Root */,
-				7102C1431FCD486F0062A67A /* RAImage.storyboard */,
-				7167802E1FCC095000FE2784 /* Mode.storyboard */,
-			);
-			name = "RA IMAGE";
-			sourceTree = "<group>";
-		};
 		71CB70B21FA1CCBC009FDCB7 /* fake data */ = {
 			isa = PBXGroup;
 			children = (
@@ -925,6 +789,7 @@
 				7197D41B1FBD1CD60063EFBB /* kv.json */,
 				7197D4201FBEADCB0063EFBB /* orderdetail.json */,
 				71E925CA1FDA688E0037F017 /* query_setting.json */,
+				71CB70B01FA1BA5E009FDCB7 /* data.json */,
 			);
 			name = "fake data";
 			sourceTree = "<group>";
@@ -968,7 +833,6 @@
 				71F3A9E21F5FA531001036C8 /* JLKeyboardListener.m */,
 				4221EF971FA81CBB0026E1EC /* Mode */,
 				7167803F1FCC0A0C00FE2784 /* cam scan */,
-				71A2ACC71FCBEF2500F398DA /* RA IMAGE */,
 				42F2EB3A1FA80E3F00BC6468 /* ModeList */,
 				71F3A9BF1F5FA109001036C8 /* login */,
 				71CB70B21FA1CCBC009FDCB7 /* fake data */,
@@ -981,8 +845,6 @@
 				71F3A9A41F5F8E22001036C8 /* AppDelegate.m */,
 				3C9BED2323740DC00052241C /* RAPhotoPreviewController.h */,
 				3C9BED2223740DC00052241C /* RAPhotoPreviewController.m */,
-				3C9BED2823740E540052241C /* PODModeViewController.h */,
-				3C9BED2923740E540052241C /* PODModeViewController.m */,
 				3C9BED2523740E2A0052241C /* RAPhotoPreviewModel.h */,
 				3C9BED2623740E2A0052241C /* RAPhotoPreviewModel.m */,
 				3C9BED1F23740D4F0052241C /* RAQRCodeScannerViewController.h */,
@@ -1023,7 +885,6 @@
 				42A7EA7120609F70002EF939 /* ResultCell.xib */,
 				71F3A9B71F5F8E73001036C8 /* ResultViewController.h */,
 				71F3A9B81F5F8E73001036C8 /* ResultViewController.m */,
-				71CB70B01FA1BA5E009FDCB7 /* data.json */,
 				71F3A9BB1F5F8EAE001036C8 /* FullyShowViewController.h */,
 				71F3A9BC1F5F8EAE001036C8 /* FullyShowViewController.m */,
 				4221EFB71FA879470026E1EC /* Result.storyboard */,
@@ -1073,10 +934,12 @@
 		71F3A9DD1F5FA479001036C8 /* utils */ = {
 			isa = PBXGroup;
 			children = (
+				3C359786255521C00092D740 /* UIImage+RedAnt.h */,
+				3C359785255521C00092D740 /* UIImage+RedAnt.m */,
+				3C359781255521760092D740 /* RAUtils.h */,
+				3C359782255521760092D740 /* RAUtils.m */,
 				71F3A9FD1F5FDDF3001036C8 /* AES */,
 				71F3A9E41F5FA54A001036C8 /* zip */,
-				71F3A9DE1F5FA484001036C8 /* RAUtils.h */,
-				71F3A9DF1F5FA484001036C8 /* RAUtils.m */,
 				71F3AA661F624E19001036C8 /* JKTimerManager.h */,
 				71F3AA671F624E19001036C8 /* JKTimerManager.m */,
 				71F3AA841F626E14001036C8 /* RAConvertor.h */,
@@ -1269,7 +1132,7 @@
 		71F3A9951F5F8E22001036C8 /* Project object */ = {
 			isa = PBXProject;
 			attributes = {
-				LastUpgradeCheck = 0900;
+				LastUpgradeCheck = 1210;
 				ORGANIZATIONNAME = Ray;
 				TargetAttributes = {
 					71F3A99C1F5F8E22001036C8 = {
@@ -1281,10 +1144,9 @@
 			};
 			buildConfigurationList = 71F3A9981F5F8E22001036C8 /* Build configuration list for PBXProject "RedAnt Mobile" */;
 			compatibilityVersion = "Xcode 3.2";
-			developmentRegion = English;
+			developmentRegion = en;
 			hasScannedForEncodings = 0;
 			knownRegions = (
-				English,
 				en,
 				Base,
 			);
@@ -1303,9 +1165,8 @@
 			isa = PBXResourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				42D64C9D1FD0FAEF003F49F9 /* Assets.bundle in Resources */,
-				7102C1461FCD51FF0062A67A /* RAImage.storyboard in Resources */,
 				42A7EA7220609F70002EF939 /* Result.xib in Resources */,
+				3C35977E255521420092D740 /* ytplayer.html in Resources */,
 				42973AD81FBAB9C300A3C164 /* EnumSelectAndSort.storyboard in Resources */,
 				42A7EA7420609F70002EF939 /* ResultCell.xib in Resources */,
 				42DBCB131FBEC0E1005574E0 /* Phone_Web_Cell.xib in Resources */,
@@ -1320,7 +1181,6 @@
 				42DFAE6B1F9B2B73009AFCCC /* Phone_Action_Cell.xib in Resources */,
 				71CB70B41FA1CCDB009FDCB7 /* server.json in Resources */,
 				3C9BED1A23740CAA0052241C /* camera.xcassets in Resources */,
-				42D64CD11FD12BCF003F49F9 /* RAImage_PhotoList.storyboard in Resources */,
 				42DFAE791F9B2CBD009AFCCC /* Phone_Signature_Cell.xib in Resources */,
 				716780411FCC0A2900FE2784 /* cam_scan.storyboard in Resources */,
 				71F3A9B01F5F8E22001036C8 /* LaunchScreen.storyboard in Resources */,
@@ -1352,7 +1212,6 @@
 				7197D4211FBEADCB0063EFBB /* orderdetail.json in Resources */,
 				71F3AA361F612369001036C8 /* CommonEditor.storyboard in Resources */,
 				71FF602F1FA8449C00C5523A /* predef_query.json in Resources */,
-				7167802F1FCC095000FE2784 /* Mode.storyboard in Resources */,
 				71F3AA081F5FDDFE001036C8 /* LICENSE in Resources */,
 				4221EFB81FA879470026E1EC /* Result.storyboard in Resources */,
 			);
@@ -1366,15 +1225,14 @@
 			buildActionMask = 2147483647;
 			files = (
 				42A7EA6D20609DEE002EF939 /* RAResultViewController.m in Sources */,
-				7167803B1FCC098600FE2784 /* ManufacturerListController.m in Sources */,
 				4221EFB61FA859B80026E1EC /* JLRefreshFooter.m in Sources */,
 				4221EFB21FA8599A0026E1EC /* JLRefreshHeader.m in Sources */,
 				4221EFB31FA8599A0026E1EC /* JLRefreshBasis.m in Sources */,
 				4221EFB41FA8599A0026E1EC /* UIScrollView+JLRefresh.m in Sources */,
 				716780641FCC0D3700FE2784 /* UploadSettingController.m in Sources */,
 				4221EFB51FA8599A0026E1EC /* UIView+JLExtension.m in Sources */,
+				3C35977F255521420092D740 /* RAYTPlayer.m in Sources */,
 				71F3AA3E1F612369001036C8 /* CommonEditorCellSignature.m in Sources */,
-				7102C13E1FCD46C10062A67A /* RootViewController.m in Sources */,
 				71F3AA441F612369001036C8 /* EnumSelectViewController.m in Sources */,
 				7167805D1FCC0D0900FE2784 /* RAUploadOperation.m in Sources */,
 				71F3A9E31F5FA531001036C8 /* JLKeyboardListener.m in Sources */,
@@ -1383,19 +1241,13 @@
 				7197D40E1FBBE1260063EFBB /* KVViewController.m in Sources */,
 				71F3AA921F627700001036C8 /* DefaultTableHeaderView.m in Sources */,
 				71F3AA5F1F624AD4001036C8 /* StrikethroughLabel.m in Sources */,
-				716780321FCC095D00FE2784 /* TakePhotoPreviewController.m in Sources */,
 				42973AD71FBA8F4A00A3C164 /* CommonEditorRangeCell.m in Sources */,
 				7102C13B1FCC0FF70062A67A /* ImageUtils.m in Sources */,
 				71E925CE1FDA6C0D0037F017 /* SearchSettingViewController.m in Sources */,
-				7102C1411FCD46DE0062A67A /* RootModeCell.m in Sources */,
-				42D64CD21FD12BCF003F49F9 /* PhotoCell.m in Sources */,
 				71F3A9EE1F5FA557001036C8 /* mztools.c in Sources */,
-				716780381FCC097B00FE2784 /* ModelModeViewController.m in Sources */,
 				71F3AA861F626E14001036C8 /* RAConvertor.m in Sources */,
-				42D64CD31FD12BCF003F49F9 /* PhotoListViewController.m in Sources */,
 				71F3A9F01F5FA557001036C8 /* zip.c in Sources */,
 				71F3AA7D1F62617D001036C8 /* NetworkUtils+Contact.m in Sources */,
-				716780351FCC096B00FE2784 /* PopModeViewController.m in Sources */,
 				71F3AA3B1F612369001036C8 /* CommonEditorCellLabel.m in Sources */,
 				71F3AA891F62732A001036C8 /* FileCache.m in Sources */,
 				71F3AA651F624B2F001036C8 /* BundleModelViewController.m in Sources */,
@@ -1406,17 +1258,17 @@
 				71F3AA371F612369001036C8 /* CommonEditorCellAction.m in Sources */,
 				7197D4081FB57E270063EFBB /* SearchViewController.m in Sources */,
 				71F3AA381F612369001036C8 /* CommonEditorCellEdit.m in Sources */,
+				3C359783255521760092D740 /* RAUtils.m in Sources */,
 				71F3AA641F624B2F001036C8 /* BundleModelCell.m in Sources */,
 				71F3A9FC1F5FCC79001036C8 /* LoginSettingViewController.m in Sources */,
 				71F3AA4D1F6124A2001036C8 /* TouchImageView.m in Sources */,
 				3C9BED2723740E2A0052241C /* RAPhotoPreviewModel.m in Sources */,
 				71F3A9A51F5F8E22001036C8 /* AppDelegate.m in Sources */,
 				71FF60251FA7209F00C5523A /* EnumSelectAndSortViewController.m in Sources */,
+				3C359787255521C00092D740 /* UIImage+RedAnt.m in Sources */,
 				71F3AA0A1F5FDDFE001036C8 /* NSData+CommonCrypto.m in Sources */,
 				42D64CB91FD0FEB5003F49F9 /* VideoPreviewCell.m in Sources */,
-				3C9BED2A23740E540052241C /* PODModeViewController.m in Sources */,
 				71F3AA0B1F5FDDFE001036C8 /* NSString+Base64.m in Sources */,
-				42D64CCE1FD12BCF003F49F9 /* NewPhotoPreviewController.m in Sources */,
 				7167804E1FCC0B0000FE2784 /* SCShapeView.m in Sources */,
 				71F3AA111F611FC4001036C8 /* testViewController.m in Sources */,
 				71F3AA431F612369001036C8 /* EnumSelectorCell.m in Sources */,
@@ -1424,13 +1276,11 @@
 				4221EF931FA813030026E1EC /* RAModeCell.m in Sources */,
 				716780501FCC0B0000FE2784 /* ScannerViewController.m in Sources */,
 				3C9BED1823740CAA0052241C /* RATakePhotoPreviewController.m in Sources */,
-				71F3A9E01F5FA484001036C8 /* RAUtils.m in Sources */,
 				71F3AA401F612369001036C8 /* CommonEditorCellTextView.m in Sources */,
 				7167804D1FCC0B0000FE2784 /* RAMenu.m in Sources */,
 				71F3AA4A1F612415001036C8 /* RTLabel.m in Sources */,
 				71F3AA3C1F612369001036C8 /* CommonEditorCellMAction.m in Sources */,
 				71F3AA501F6124C4001036C8 /* ImageUploadViewController.m in Sources */,
-				7167803E1FCC099200FE2784 /* ManufacturerCell.m in Sources */,
 				71F3AA451F612369001036C8 /* MonthPickerViewController.m in Sources */,
 				71F3A9A21F5F8E22001036C8 /* main.m in Sources */,
 				71F3AA951F6277DE001036C8 /* DefaultAppearance.m in Sources */,
@@ -1439,11 +1289,9 @@
 				7167805C1FCC0D0900FE2784 /* RAUploadManager.m in Sources */,
 				714591081FEB8E68007FD0A4 /* MDHTMLLabel.m in Sources */,
 				71F3A9D01F5FA277001036C8 /* BasicViewController.m in Sources */,
-				7167802D1FCC087E00FE2784 /* BasicModeViewController.m in Sources */,
 				7197D4121FBBE1490063EFBB /* ModelDetailViewController.m in Sources */,
 				71F3AA531F6125ED001036C8 /* ImageViewController.m in Sources */,
 				71F3AA411F612369001036C8 /* CommonEditorViewController.m in Sources */,
-				42D64CCF1FD12BCF003F49F9 /* PhotoPreviewController.m in Sources */,
 				716780561FCC0C6D00FE2784 /* UIView+Toast.m in Sources */,
 				716780531FCC0C4F00FE2784 /* UIImage+fixOrientation.m in Sources */,
 				71F3A9ED1F5FA557001036C8 /* ioapi.c in Sources */,
@@ -1456,7 +1304,6 @@
 				7197D4181FBC10710063EFBB /* DetailKVCell.m in Sources */,
 				71F3AA831F6263B2001036C8 /* MainViewController.m in Sources */,
 				42D64CB81FD0FEB5003F49F9 /* PhotoPreviewCell.m in Sources */,
-				42D64C9E1FD0FAEF003F49F9 /* YTPlayerView.m in Sources */,
 				7197D41F1FBD2EA60063EFBB /* LineView.m in Sources */,
 				716780651FCC0D3700FE2784 /* UploadViewController.m in Sources */,
 				7197D4151FBBE1610063EFBB /* OrderDetailViewController.m in Sources */,
@@ -1471,8 +1318,6 @@
 				71F3AA461F612369001036C8 /* SRMonthPicker.m in Sources */,
 				71F3AA421F612369001036C8 /* DatePickerViewController.m in Sources */,
 				71F3A9D91F5FA3B9001036C8 /* RANetwork.m in Sources */,
-				42D64C9F1FD0FAEF003F49F9 /* YTViewController.m in Sources */,
-				42D64CD01FD12BCF003F49F9 /* RAImagePhotoPreviewCell.m in Sources */,
 				71F3AA091F5FDDFE001036C8 /* NSData+Base64.m in Sources */,
 				4221EF9D1FA81D5B0026E1EC /* RAQueryViewController.m in Sources */,
 				3C9BED2123740D500052241C /* RAQRCodeScannerViewController.m in Sources */,
@@ -1495,14 +1340,6 @@
 /* End PBXSourcesBuildPhase section */
 
 /* Begin PBXVariantGroup section */
-		7102C1431FCD486F0062A67A /* RAImage.storyboard */ = {
-			isa = PBXVariantGroup;
-			children = (
-				7102C1441FCD486F0062A67A /* Base */,
-			);
-			name = RAImage.storyboard;
-			sourceTree = "<group>";
-		};
 		71F3A9A91F5F8E22001036C8 /* Main.storyboard */ = {
 			isa = PBXVariantGroup;
 			children = (
@@ -1526,6 +1363,7 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				ALWAYS_SEARCH_USER_PATHS = NO;
+				CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
 				CLANG_ANALYZER_NONNULL = YES;
 				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
 				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
@@ -1536,6 +1374,7 @@
 				CLANG_WARN_BOOL_CONVERSION = YES;
 				CLANG_WARN_COMMA = YES;
 				CLANG_WARN_CONSTANT_CONVERSION = YES;
+				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
 				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
 				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
 				CLANG_WARN_EMPTY_BODY = YES;
@@ -1543,8 +1382,10 @@
 				CLANG_WARN_INFINITE_RECURSION = YES;
 				CLANG_WARN_INT_CONVERSION = YES;
 				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
 				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
 				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
 				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
 				CLANG_WARN_STRICT_PROTOTYPES = YES;
 				CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -1569,7 +1410,7 @@
 				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
 				GCC_WARN_UNUSED_FUNCTION = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
-				IPHONEOS_DEPLOYMENT_TARGET = 10.3;
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				MTL_ENABLE_DEBUG_INFO = YES;
 				ONLY_ACTIVE_ARCH = YES;
 				SDKROOT = iphoneos;
@@ -1580,6 +1421,7 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				ALWAYS_SEARCH_USER_PATHS = NO;
+				CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
 				CLANG_ANALYZER_NONNULL = YES;
 				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
 				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
@@ -1590,6 +1432,7 @@
 				CLANG_WARN_BOOL_CONVERSION = YES;
 				CLANG_WARN_COMMA = YES;
 				CLANG_WARN_CONSTANT_CONVERSION = YES;
+				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
 				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
 				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
 				CLANG_WARN_EMPTY_BODY = YES;
@@ -1597,8 +1440,10 @@
 				CLANG_WARN_INFINITE_RECURSION = YES;
 				CLANG_WARN_INT_CONVERSION = YES;
 				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
 				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
 				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
 				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
 				CLANG_WARN_STRICT_PROTOTYPES = YES;
 				CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -1617,7 +1462,7 @@
 				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
 				GCC_WARN_UNUSED_FUNCTION = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
-				IPHONEOS_DEPLOYMENT_TARGET = 10.3;
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				MTL_ENABLE_DEBUG_INFO = NO;
 				SDKROOT = iphoneos;
 				VALIDATE_PRODUCT = YES;
@@ -1630,7 +1475,7 @@
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				DEVELOPMENT_TEAM = HXWLAA5YN5;
 				INFOPLIST_FILE = "RedAnt Mobile/Info.plist";
-				IPHONEOS_DEPLOYMENT_TARGET = 10.3;
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
 				ONLY_ACTIVE_ARCH = YES;
 				PRODUCT_BUNDLE_IDENTIFIER = "usai.redant.RedAnt-Mobile";
@@ -1644,7 +1489,7 @@
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				DEVELOPMENT_TEAM = HXWLAA5YN5;
 				INFOPLIST_FILE = "RedAnt Mobile/Info.plist";
-				IPHONEOS_DEPLOYMENT_TARGET = 10.3;
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
 				ONLY_ACTIVE_ARCH = NO;
 				PRODUCT_BUNDLE_IDENTIFIER = "usai.redant.RedAnt-Mobile";

+ 142 - 66
RedAnt Mobile/RedAnt Mobile/LoginSettingViewController.m

@@ -68,78 +68,154 @@ if (password.length==0)
 //    [params setValue:[NSString stringWithFormat:@"%ld",ver]  forKey:@"auth_ver"];
     AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
     //    appDelegate.address = self.address;
+    
+    
     __weak typeof(self) weakself = self;
+    
     NSString* title=@"Request server information ";
-    UIAlertView *alert = [RAUtils waiting_alert:@"Please wait" title:title];
-    dispatch_async(dispatch_get_global_queue(0, 0), ^{
-
-        NSDictionary *result_json = [RANetwork require_server:params];
-        dispatch_async(dispatch_get_main_queue(), ^{
-            [alert dismissWithClickedButtonIndex:0 animated:YES];
-            int result = [[result_json objectForKey:@"result"] intValue];
-//            result=2;
-            switch (result) {
-                case RESULT_FALSE:
-                {
-                    //code not exist;
-                    
-                    [RAUtils message_alert:result_json[@"msg"] title:@"Warring" controller:weakself];
-                    //                            [weakself.view makeToast:weakself.verify_msg0 duration:3.0 position:CSToastPositionCenter];
-                    break;
-                }
-                case RESULT_TRUE:
-                {
+    
+    __block UIAlertController * waitalert = [RAUtils waiting_alert:self title:title completion:^{
+        [RANetwork require_server:params completionHandler:^(NSMutableDictionary *result) {
+            NSMutableDictionary* return_json = result;
+            
+            [waitalert dismissViewControllerAnimated:YES completion:^{
+                int resulti=[[return_json valueForKey:@"result"] intValue];
+                switch (resulti) {
+                    case RESULT_FALSE:
+                    {
+                        //code not exist;
+                        
+                        [RAUtils message_alert:return_json[@"msg"] title:@"Warring" controller:weakself];
+                        //                            [weakself.view makeToast:weakself.verify_msg0 duration:3.0 position:CSToastPositionCenter];
+                        break;
+                    }
+                    case RESULT_TRUE:
+                    {
 
-                    //            NSString *externalAddr = weakself.externalTextField.text;
-                    NSMutableDictionary *addressDic = [NSMutableDictionary dictionary];
-                    
-                    NSString* url = result_json[@"url"];
-                    if(url.length==0)
-                        url=@"";
-                    
-                    NSString* logo = result_json[@"logo"];
-                    if(logo.length==0)
-                        logo=@"";
-                    NSString* servername = result_json[@"server_name"];
-                    if(servername.length==0)
-                        servername=@"";
-                    appDelegate.server = url;
-                    [addressDic setObject:url forKey:@"serverAddress"];
-                    [addressDic setObject:servername forKey:@"serverName"];
-                    
-                    [addressDic setObject:logo forKey:@"CompanyLogo"];
-                    [addressDic setObject:password forKey:@"password"];
-                    //            if (externalAddr.length) {
-                    //                [addressDic setObject:externalAddr forKey:@"externalAddress"];
-                    //            }
-                    
-                        [addressDic setObject:company forKey:@"companyID"];
-                    
-                    
-                    [weakself setUserDefaultsValue:addressDic forKey:kScanAddress];
-                    if (self.returnValue) {
-                        self.returnValue(servername);
+                        //            NSString *externalAddr = weakself.externalTextField.text;
+                        NSMutableDictionary *addressDic = [NSMutableDictionary dictionary];
+                        
+                        NSString* url = return_json[@"url"];
+                        if(url.length==0)
+                            url=@"";
+                        
+                        NSString* logo = return_json[@"logo"];
+                        if(logo.length==0)
+                            logo=@"";
+                        NSString* servername = return_json[@"server_name"];
+                        if(servername.length==0)
+                            servername=@"";
+                        appDelegate.server = url;
+                        [addressDic setObject:url forKey:@"serverAddress"];
+                        [addressDic setObject:servername forKey:@"serverName"];
+                        
+                        [addressDic setObject:logo forKey:@"CompanyLogo"];
+                        [addressDic setObject:password forKey:@"password"];
+                        //            if (externalAddr.length) {
+                        //                [addressDic setObject:externalAddr forKey:@"externalAddress"];
+                        //            }
+                        
+                            [addressDic setObject:company forKey:@"companyID"];
+                        
+                        
+                        [weakself setUserDefaultsValue:addressDic forKey:kScanAddress];
+                        if (self.returnValue) {
+                            self.returnValue(servername);
+                        }
+    //                        [self dismissViewControllerAnimated:false completion:nil];
+                        [self.navigationController popViewControllerAnimated:false];
+                        break;
                     }
-//                        [self dismissViewControllerAnimated:false completion:nil];
-                    [self.navigationController popViewControllerAnimated:false];
-                    break;
-                }
-                case RESULT_NO_RESPONSE:
-                {
-                    [RAUtils message_alert:result_json[@"msg"] title:title controller:weakself];
-                }
-                case RESULT_NET_ERROR:
-                {
-                    [RAUtils message_alert:@"Can not connect to server" title:title controller:weakself];
+                    case RESULT_NO_RESPONSE:
+                    {
+                        [RAUtils message_alert:return_json[@"msg"] title:title controller:weakself];
+                    }
+                    case RESULT_NET_ERROR:
+                    {
+                        [RAUtils message_alert:@"Can not connect to server" title:title controller:weakself];
+                    }
+                    default:
+                        break;
                 }
-                default:
-                    break;
-            }
-            
-        });
+            }];
+        }];
         
-        //  }
-    });
+    }];
+    
+    
+//
+//    __weak typeof(self) weakself = self;
+//    NSString* title=@"Request server information ";
+//    UIAlertView *alert = [RAUtils waiting_alert:@"Please wait" title:title];
+//    dispatch_async(dispatch_get_global_queue(0, 0), ^{
+//
+//        NSDictionary *result_json = [RANetwork require_server:params];
+//        dispatch_async(dispatch_get_main_queue(), ^{
+//            [alert dismissWithClickedButtonIndex:0 animated:YES];
+//            int result = [[result_json objectForKey:@"result"] intValue];
+////            result=2;
+//            switch (result) {
+//                case RESULT_FALSE:
+//                {
+//                    //code not exist;
+//
+//                    [RAUtils message_alert:result_json[@"msg"] title:@"Warring" controller:weakself];
+//                    //                            [weakself.view makeToast:weakself.verify_msg0 duration:3.0 position:CSToastPositionCenter];
+//                    break;
+//                }
+//                case RESULT_TRUE:
+//                {
+//
+//                    //            NSString *externalAddr = weakself.externalTextField.text;
+//                    NSMutableDictionary *addressDic = [NSMutableDictionary dictionary];
+//
+//                    NSString* url = result_json[@"url"];
+//                    if(url.length==0)
+//                        url=@"";
+//
+//                    NSString* logo = result_json[@"logo"];
+//                    if(logo.length==0)
+//                        logo=@"";
+//                    NSString* servername = result_json[@"server_name"];
+//                    if(servername.length==0)
+//                        servername=@"";
+//                    appDelegate.server = url;
+//                    [addressDic setObject:url forKey:@"serverAddress"];
+//                    [addressDic setObject:servername forKey:@"serverName"];
+//
+//                    [addressDic setObject:logo forKey:@"CompanyLogo"];
+//                    [addressDic setObject:password forKey:@"password"];
+//                    //            if (externalAddr.length) {
+//                    //                [addressDic setObject:externalAddr forKey:@"externalAddress"];
+//                    //            }
+//
+//                        [addressDic setObject:company forKey:@"companyID"];
+//
+//
+//                    [weakself setUserDefaultsValue:addressDic forKey:kScanAddress];
+//                    if (self.returnValue) {
+//                        self.returnValue(servername);
+//                    }
+////                        [self dismissViewControllerAnimated:false completion:nil];
+//                    [self.navigationController popViewControllerAnimated:false];
+//                    break;
+//                }
+//                case RESULT_NO_RESPONSE:
+//                {
+//                    [RAUtils message_alert:result_json[@"msg"] title:title controller:weakself];
+//                }
+//                case RESULT_NET_ERROR:
+//                {
+//                    [RAUtils message_alert:@"Can not connect to server" title:title controller:weakself];
+//                }
+//                default:
+//                    break;
+//            }
+//
+//        });
+//
+//        //  }
+//    });
     
 }
 

+ 113 - 64
RedAnt Mobile/RedAnt Mobile/LoginViewController.m

@@ -219,84 +219,133 @@ static NSString *kLoginUserInfo = @"UserInfo";
     }
    AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
 //    appDelegate.address = self.address;
+    
     __weak typeof(self) weakself = self;
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    UIAlertView *alert = [RAUtils waiting_alert:@"Please wait" title:@"Login"];
-#pragma clang diagnostic pop
-    dispatch_async(dispatch_get_global_queue(0, 0), ^{
-        if (weakself) {
-            __strong typeof(weakself) strongself = weakself;
-            NSDictionary *loginDic = [RANetwork Login:strongself.user password:strongself.pwd];
-            dispatch_async(dispatch_get_main_queue(), ^{
-                [alert dismissWithClickedButtonIndex:0 animated:YES];
-                int result = [[loginDic objectForKey:@"result"] intValue];
-                BOOL rememberLogin = [[strongself userDefaultsValue:kRememberLogin] boolValue];
-                if (result == RESULT_TRUE) {
-                    NSArray *modeList = [loginDic objectForKey:@"mode_list"];
+    
+    __block UIAlertController * waitalert = [RAUtils waiting_alert:self title:@"Please wait" completion:^{
+        [RANetwork Login:weakself.user password:weakself.pwd completionHandler:^(NSMutableDictionary *result) {
+            NSMutableDictionary* return_json = result;
+            
+            [waitalert dismissViewControllerAnimated:YES completion:^{
+                int resulti=[[return_json valueForKey:@"result"] intValue];
+                BOOL rememberLogin = [[weakself userDefaultsValue:kRememberLogin] boolValue];
+                if(resulti==RESULT_TRUE)
+                {
+                    NSArray *modeList = [return_json objectForKey:@"mode_list"];
                     if (modeList != nil) {
                         
-                            RAModeListViewController *rootVC = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"RARootViewController"];
-                            rootVC.title = @"RedAnt Mobile";
+                        RAModeListViewController *rootVC = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"RARootViewController"];
+                        rootVC.title = @"RedAnt Mobile";
                         rootVC.isroot = true;
                         rootVC.modelist = modeList;
-//                        rootVC.onRBClick = ^(RAModeListViewController* bself){
-//                            
-//                            UIAlertView *alert = [RAUtils waiting_alert:@"Please wait..." title:@"Logout"];
-////                            __weak typeof(self) weakself = self;
-//                            dispatch_async(dispatch_get_main_queue(), ^{
-//                                
-//                                NSDictionary *logoutDic = [RANetwork logout];
-//                                int result = [[logoutDic objectForKey:@"result"] intValue];
-//                                dispatch_async(dispatch_get_main_queue(), ^{
-//                                    [alert dismissWithClickedButtonIndex:0 animated:YES];
-////                                    AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
-//                                    if (result == RESULT_TRUE) {
-//                                        
-//                                        [bself.navigationController popViewControllerAnimated:false];
-//                                        //                weakself.companyIcon = [UIImage imageNamed:@"AppIcon40x40"];
-//                                        //  [appDelegate logout];
-//                                    } else {
-//                                        __strong typeof(bself) strongself = bself;
-//                                        NSString *msg = [logoutDic objectForKey:@"err_msg"];
-//                                        [RAUtils message_alert:msg title:@"Warning" controller:strongself];
-//                                    }
-//                                });
-//                                
-//                                
-//                            });
-//                            ;
-//                        };
-//                        rootVC.onRBName = ^NSString *{
-//                            return @"Logout";
-//                        };
-//                            [rootVC setModeList:modeList];
+                        
                         [self.navigationController pushViewController:rootVC animated:false];
-//                        [appDelegate showNormalRootVCWithModeList:modeList];
+                        //                        [appDelegate showNormalRootVCWithModeList:modeList];
                     } else {
-                        [RAUtils message_alert:@"Something error" title:@"Warning" controller:strongself];
+                        [RAUtils message_alert:@"Something error" title:@"Warning" controller:weakself];
                     }
                     
                     if (!rememberLogin) {
                         [self setUserDefaultsValue:nil forKey:kLoginUserInfo];
-                    } else {
-                        [strongself setUserDefaultsValue:@{@"user" : strongself.user,@"pwd" : strongself.pwd} forKey:kLoginUserInfo];
+                    } else
+                    {
+                        [weakself setUserDefaultsValue:@{@"user" : weakself.user,@"pwd" : weakself.pwd} forKey:kLoginUserInfo];
                     }
-//                    appDelegate.bLogin = YES;
-                    appDelegate.user = strongself.user;
-                    appDelegate.password = strongself.pwd;
-//                    appDelegate.companyName = [loginDic objectForKey:@"company_name"];
-//                    [appDelegate loadCompanyIcon:[loginDic objectForKey:@"company_icon"]];
-//                    appDelegate.modeList = [loginDic objectForKey:@"modellist"];
-//                    [appDelegate showNormalRootVC];
-                } else {
-                    NSString *msg = [loginDic objectForKey:@"err_msg"];
-                    [RAUtils message_alert:msg title:@"Warning" controller:strongself];
+                    //                    appDelegate.bLogin = YES;
+                    appDelegate.user = weakself.user;
+                    appDelegate.password = weakself.pwd;
+
                 }
-            });
+                else
+                {
+                    NSString *msg = [return_json objectForKey:@"err_msg"];
+                    [RAUtils message_alert:msg title:@"Warning" controller:weakself];
+                }
+            }];
+        }];
+        
+    }];
+    
+    
+    
+//    __weak typeof(self) weakself = self;
+//#pragma clang diagnostic push
+//#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+//    UIAlertView *alert = [RAUtils waiting_alert:@"Please wait" title:@"Login"];
+//#pragma clang diagnostic pop
+//    dispatch_async(dispatch_get_global_queue(0, 0), ^{
+//        if (weakself) {
+//            __strong typeof(weakself) strongself = weakself;
+//            NSDictionary *loginDic = [RANetwork Login:strongself.user password:strongself.pwd];
+//            dispatch_async(dispatch_get_main_queue(), ^{
+//                [alert dismissWithClickedButtonIndex:0 animated:YES];
+//                int result = [[loginDic objectForKey:@"result"] intValue];
+//                BOOL rememberLogin = [[strongself userDefaultsValue:kRememberLogin] boolValue];
+//                if (result == RESULT_TRUE) {
+//                    NSArray *modeList = [loginDic objectForKey:@"mode_list"];
+//                    if (modeList != nil) {
+//
+//                            RAModeListViewController *rootVC = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"RARootViewController"];
+//                            rootVC.title = @"RedAnt Mobile";
+//                        rootVC.isroot = true;
+//                        rootVC.modelist = modeList;
+////                        rootVC.onRBClick = ^(RAModeListViewController* bself){
+////
+////                            UIAlertView *alert = [RAUtils waiting_alert:@"Please wait..." title:@"Logout"];
+//////                            __weak typeof(self) weakself = self;
+////                            dispatch_async(dispatch_get_main_queue(), ^{
+////
+////                                NSDictionary *logoutDic = [RANetwork logout];
+////                                int result = [[logoutDic objectForKey:@"result"] intValue];
+////                                dispatch_async(dispatch_get_main_queue(), ^{
+////                                    [alert dismissWithClickedButtonIndex:0 animated:YES];
+//////                                    AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
+////                                    if (result == RESULT_TRUE) {
+////
+////                                        [bself.navigationController popViewControllerAnimated:false];
+////                                        //                weakself.companyIcon = [UIImage imageNamed:@"AppIcon40x40"];
+////                                        //  [appDelegate logout];
+////                                    } else {
+////                                        __strong typeof(bself) strongself = bself;
+////                                        NSString *msg = [logoutDic objectForKey:@"err_msg"];
+////                                        [RAUtils message_alert:msg title:@"Warning" controller:strongself];
+////                                    }
+////                                });
+////
+////
+////                            });
+////                            ;
+////                        };
+////                        rootVC.onRBName = ^NSString *{
+////                            return @"Logout";
+////                        };
+////                            [rootVC setModeList:modeList];
+//                        [self.navigationController pushViewController:rootVC animated:false];
+////                        [appDelegate showNormalRootVCWithModeList:modeList];
+//                    } else {
+//                        [RAUtils message_alert:@"Something error" title:@"Warning" controller:strongself];
+//                    }
+//
+//                    if (!rememberLogin) {
+//                        [self setUserDefaultsValue:nil forKey:kLoginUserInfo];
+//                    } else {
+//                        [strongself setUserDefaultsValue:@{@"user" : strongself.user,@"pwd" : strongself.pwd} forKey:kLoginUserInfo];
+//                    }
+////                    appDelegate.bLogin = YES;
+//                    appDelegate.user = strongself.user;
+//                    appDelegate.password = strongself.pwd;
+////                    appDelegate.companyName = [loginDic objectForKey:@"company_name"];
+////                    [appDelegate loadCompanyIcon:[loginDic objectForKey:@"company_icon"]];
+////                    appDelegate.modeList = [loginDic objectForKey:@"modellist"];
+////                    [appDelegate showNormalRootVC];
+//                } else {
+//                    NSString *msg = [loginDic objectForKey:@"err_msg"];
+//                    [RAUtils message_alert:msg title:@"Warning" controller:strongself];
+//                }
+//            });
 
-        }
-    });
+//        }
+//    });
 }
 
 - (IBAction)settingBtnClick:(UIButton *)sender {

+ 97 - 72
RedAnt Mobile/RedAnt Mobile/RAModeListViewController.m

@@ -14,10 +14,10 @@
 #import "ResultViewController.h"
 #import "SearchViewController.h"
 #import "RANetwork.h"
-#import "BasicModeViewController.h"
-#import "ModelModeViewController.h"
-#import "PopModeViewController.h"
-#import "RootViewController.h"
+//#import "BasicModeViewController.h"
+//#import "ModelModeViewController.h"
+//#import "PopModeViewController.h"
+//#import "RootViewController.h"
 #import "SearchSettingViewController.h"
 #import "RAResultViewController.h"
 
@@ -66,29 +66,54 @@
 //    }
 //}
 - (void)logoutItemClick:(UIBarButtonItem *)sender {
-    UIAlertView *alert = [RAUtils waiting_alert:@"Please wait..." title:@"Logout"];
+    
     __weak typeof(self) weakself = self;
-    dispatch_async(dispatch_get_main_queue(), ^{
-        
-        NSDictionary *logoutDic = [RANetwork logout];
-        int result = [[logoutDic objectForKey:@"result"] intValue];
-        dispatch_async(dispatch_get_main_queue(), ^{
-            [alert dismissWithClickedButtonIndex:0 animated:YES];
-            AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
-            if (result == RESULT_TRUE) {
-                
-                [weakself.navigationController popViewControllerAnimated:false];
-//                weakself.companyIcon = [UIImage imageNamed:@"AppIcon40x40"];
-              //  [appDelegate logout];
-            } else {
-                __strong typeof(weakself) strongself = weakself;
-                NSString *msg = [logoutDic objectForKey:@"err_msg"];
-                [RAUtils message_alert:msg title:@"Warning" controller:strongself];
-            }
-        });
-        
+    
+    __block UIAlertController * waitalert = [RAUtils waiting_alert:self title:@"Logout" completion:^{
+        [RANetwork logout:^(NSMutableDictionary *result) {
+            NSMutableDictionary* logoutDic = result;
+            
+            [waitalert dismissViewControllerAnimated:YES completion:^{
+                int resulti=[[logoutDic valueForKey:@"result"] intValue];
+                if (resulti == RESULT_TRUE) {
+                    
+                    [weakself.navigationController popViewControllerAnimated:false];
+    //                weakself.companyIcon = [UIImage imageNamed:@"AppIcon40x40"];
+                  //  [appDelegate logout];
+                } else {
+                    __strong typeof(weakself) strongself = weakself;
+                    NSString *msg = [logoutDic objectForKey:@"err_msg"];
+                    [RAUtils message_alert:msg title:@"Warning" controller:strongself];
+                }
+            }];
+        }];
         
-    });
+    }];
+//
+//
+//    UIAlertView *alert = [RAUtils waiting_alert:@"Please wait..." title:@"Logout"];
+//    __weak typeof(self) weakself = self;
+//    dispatch_async(dispatch_get_main_queue(), ^{
+//
+//        NSDictionary *logoutDic = [RANetwork logout];
+//        int result = [[logoutDic objectForKey:@"result"] intValue];
+//        dispatch_async(dispatch_get_main_queue(), ^{
+//            [alert dismissWithClickedButtonIndex:0 animated:YES];
+//            AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
+//            if (result == RESULT_TRUE) {
+//
+//                [weakself.navigationController popViewControllerAnimated:false];
+////                weakself.companyIcon = [UIImage imageNamed:@"AppIcon40x40"];
+//              //  [appDelegate logout];
+//            } else {
+//                __strong typeof(weakself) strongself = weakself;
+//                NSString *msg = [logoutDic objectForKey:@"err_msg"];
+//                [RAUtils message_alert:msg title:@"Warning" controller:strongself];
+//            }
+//        });
+//
+//
+//    });
     
 }
 
@@ -184,6 +209,8 @@
 - (void) processQueryModel:(NSMutableDictionary *)modeinfo {
     
     
+    
+    
     SearchViewController *queryVC = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"SearchViewController"];
     
     queryVC.params = [NSMutableDictionary new];
@@ -207,59 +234,57 @@
 
 - (void) processLocalFunModel:(NSMutableDictionary *)modeinfo {
     
-    if ([modeinfo[@"module"] isEqualToString:@"tools_change_pwd"]) {
-        NSLog(@"change password");
-    }
-    else if ([modeinfo[@"module"] isEqualToString:@"raimage_mode"]) {
-        
-        
-       
-        AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
-        appDelegate.modeList = modeinfo[@"ext_data"];
-        RootViewController *ramodelist = [[UIStoryboard storyboardWithName:@"RAImage" bundle:nil] instantiateViewControllerWithIdentifier:@"RootViewController"];
-        [self.navigationController pushViewController:ramodelist animated:false];
-        
-    }
-//    else if ([modeinfo[@"module"] isEqualToString:@"raimage_pop"]) {
-////        NSLog(@"change password");
+    
+    [RAUtils message_alert:@"Local function" title:@"Message" controller:self];
+    return ;
 //
+//    if ([modeinfo[@"module"] isEqualToString:@"tools_change_pwd"]) {
+//        NSLog(@"change password");
+//    }
+//    else if ([modeinfo[@"module"] isEqualToString:@"raimage_mode"]) {
+//
+//
+//
+//        AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
+//        appDelegate.modeList = modeinfo[@"ext_data"];
+//        RootViewController *ramodelist = [[UIStoryboard storyboardWithName:@"RAImage" bundle:nil] instantiateViewControllerWithIdentifier:@"RootViewController"];
+//        [self.navigationController pushViewController:ramodelist animated:false];
 //
-//        BOOL enable = [modeinfo[@"enable"] boolValue];
-//        if (enable) {
-//            NSString *name = modeinfo[@"name"];
-//            AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
-////            appDelegate.shouldAutoShowModeVC = NO;
-//            [self setUserDefaultsValue:[NSString stringWithFormat:@"%@<&&>%@",appDelegate.user,name] forKey:@"lastChooseMode"];
-//            [self pushRAImageController:modeinfo];
-//        }
 //    }
+    
+    
+    
+    
 }
 - (void)pushRAImageController:(NSMutableDictionary *)modeinfo {
-    if (!modeinfo) {
-        return;
-    }
-//    NSIndexPath *indexPath = [self.modeTable indexPathForCell:cell];
-    NSDictionary *mode = modeinfo;//[self.modeList objectAtIndex:indexPath.row];
-    BasicModeViewController *modeVC = nil;
-    if ([mode[@"name"] isEqualToString:@"Model"]) {
-        ModelModeViewController *vc = (ModelModeViewController *)[self viewControllerInStoryboard:@"Mode" withId:@"ModelModeViewController"];
-        vc.manufacturerList = [mode objectForKey:@"manifacturer"];
-        modeVC = vc;
-    }else if ([mode[@"name"] isEqualToString:@"POP"]||[mode[@"name"] isEqualToString:@"Receiving"]||[mode[@"name"] isEqualToString:@"Returns"]) {
-        PopModeViewController *vc = [[UIStoryboard storyboardWithName:@"Mode" bundle:nil] instantiateViewControllerWithIdentifier:@"PopModeViewController"];
-        if (![mode[@"name"] isEqualToString:@"Receiving"]) {
-            vc.inputKeyboardType = UIKeyboardTypeNumberPad;
-        } else {
-            vc.inputKeyboardType = UIKeyboardTypeDefault;
-        }
-        modeVC = vc;
-    }
+    return;
     
-    if (modeVC) {
-        modeVC.barcodeTitle = mode[@"code_name"];
-        modeVC.name = mode[@"name"];
-        [self.navigationController pushViewController:modeVC animated:YES];
-    }
+//
+//    if (!modeinfo) {
+//        return;
+//    }
+////    NSIndexPath *indexPath = [self.modeTable indexPathForCell:cell];
+//    NSDictionary *mode = modeinfo;//[self.modeList objectAtIndex:indexPath.row];
+//    BasicModeViewController *modeVC = nil;
+//    if ([mode[@"name"] isEqualToString:@"Model"]) {
+//        ModelModeViewController *vc = (ModelModeViewController *)[self viewControllerInStoryboard:@"Mode" withId:@"ModelModeViewController"];
+//        vc.manufacturerList = [mode objectForKey:@"manifacturer"];
+//        modeVC = vc;
+//    }else if ([mode[@"name"] isEqualToString:@"POP"]||[mode[@"name"] isEqualToString:@"Receiving"]||[mode[@"name"] isEqualToString:@"Returns"]) {
+//        PopModeViewController *vc = [[UIStoryboard storyboardWithName:@"Mode" bundle:nil] instantiateViewControllerWithIdentifier:@"PopModeViewController"];
+//        if (![mode[@"name"] isEqualToString:@"Receiving"]) {
+//            vc.inputKeyboardType = UIKeyboardTypeNumberPad;
+//        } else {
+//            vc.inputKeyboardType = UIKeyboardTypeDefault;
+//        }
+//        modeVC = vc;
+//    }
+//
+//    if (modeVC) {
+//        modeVC.barcodeTitle = mode[@"code_name"];
+//        modeVC.name = mode[@"name"];
+//        [self.navigationController pushViewController:modeVC animated:YES];
+//    }
     
 }
 

+ 46 - 17
RedAnt Mobile/RedAnt Mobile/RANetwork.h

@@ -9,24 +9,53 @@
 #import "NetworkUtils.h"
 
 @interface RANetwork : NetworkUtils
-+(NSDictionary*)require_server : (NSMutableDictionary*) params;
-+(NSDictionary*)request_Editor:(NSString*) request_url params:(NSMutableDictionary*)params;
-+(NSDictionary*)commoneditor_partialrefresh: (NSMutableDictionary*)params url:(NSString*)url;
-+(NSDictionary*)Login : (NSString*) user password:(NSString*) password;
-+(NSDictionary*)logout;
-+(NSDictionary*)query : (NSMutableDictionary*) params;
-+(NSString*)download_query : (NSString*) url;
-+(NSString*)download_file : (NSMutableDictionary*) params url:(NSString*) url;
-+(NSDictionary*)require_query_ui:(NSString*) request_url params:(NSMutableDictionary*)params;
-+(NSDictionary*)kv_detail : (NSMutableDictionary*) params;
-+(NSDictionary*)require_orderdetail:(NSString*) request_url params:(NSMutableDictionary*)params;
-
-+(NSDictionary*)Verify : (NSMutableDictionary*) params;
-+ (NSDictionary *)getModelManufacture:(NSString *)model;
+//+(NSDictionary*)require_server : (NSMutableDictionary*) params;
+//+(NSDictionary*)request_Editor:(NSString*) request_url params:(NSMutableDictionary*)params;
+//+(NSDictionary*)commoneditor_partialrefresh: (NSMutableDictionary*)params url:(NSString*)url;
+//+(NSDictionary*)Login : (NSString*) user password:(NSString*) password;
+//+(NSDictionary*)logout;
+//+(NSDictionary*)query : (NSMutableDictionary*) params;
+//+(NSString*)download_query : (NSString*) url;
+//+(NSString*)download_file : (NSMutableDictionary*) params url:(NSString*) url;
+//+(NSDictionary*)require_query_ui:(NSString*) request_url params:(NSMutableDictionary*)params;
+//+(NSDictionary*)kv_detail : (NSMutableDictionary*) params;
+//+(NSDictionary*)require_orderdetail:(NSString*) request_url params:(NSMutableDictionary*)params;
+
+//+(NSDictionary*)Verify : (NSMutableDictionary*) params;
+//+ (NSDictionary *)getModelManufacture:(NSString *)model;
 
 +(NSString*) get_url:(NSString*) interface;
-+(NSDictionary*)query_setting:(NSString*) request_url params:(NSMutableDictionary*)params;
-+(NSDictionary*)save_querysetting : (NSMutableDictionary*) params;
+//+(NSDictionary*)query_setting:(NSString*) request_url params:(NSMutableDictionary*)params;
+//+(NSDictionary*)save_querysetting : (NSMutableDictionary*) params;
+
+//+(NSMutableDictionary*) queryAutoComplete:(NSMutableDictionary*)params;
+
+
+#pragma mark 2020 new interface
+typedef void(^resultHandler)(NSMutableDictionary *result);
+
++(void)require_server : (NSMutableDictionary*) params completionHandler:(resultHandler)result;
++(void)request_editor:(NSString*) request_url params:(NSMutableDictionary*)params completionHandler:(resultHandler)result;
++(void)request_commoneditor_partialrefresh: (NSMutableDictionary*)params url:(NSString*)url completionHandler:(resultHandler)result;
+
++(void)Login : (NSString*) user password:(NSString*) password completionHandler:(resultHandler)result;
++(void)logout:(resultHandler)result;
++(void)query : (NSMutableDictionary*) params completionHandler:(resultHandler)result;
++(void)download_query : (NSString*) url completionHandler:(resultHandler)result;
++(void)download_file : (NSMutableDictionary*) params url:(NSString*) url completionHandler:(resultHandler)result;
++(void)require_query_ui:(NSString*) request_url params:(NSMutableDictionary*)params completionHandler:(resultHandler)result;
++(void)kv_detail : (NSMutableDictionary*) params completionHandler:(resultHandler)result;
++(void)require_orderdetail:(NSString*) request_url params:(NSMutableDictionary*)params completionHandler:(resultHandler)result;
+
+//+(void)Verify : (NSMutableDictionary*) params completionHandler:(resultHandler)result;
+//+ (void )getModelManufacture:(NSString *)model completionHandler:(resultHandler)result;
+
+//+(void) get_url:(NSString*) interface completionHandler:(resultHandler)result;
++(void)query_setting:(NSString*) request_url params:(NSMutableDictionary*)params completionHandler:(resultHandler)result;
++(void)save_querysetting : (NSMutableDictionary*) params completionHandler:(resultHandler)result;
+
++(void) queryAutoComplete:(NSMutableDictionary*)params completionHandler:(resultHandler)result;
+
+
 
-+(NSMutableDictionary*) queryAutoComplete:(NSMutableDictionary*)params;
 @end

+ 672 - 0
RedAnt Mobile/RedAnt Mobile/RANetwork.m

@@ -599,4 +599,676 @@
     NSDictionary *resultDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
     return [resultDic mutableCopy];
 }
+
+
+#pragma mark 2020 new interface
+
+
++(void)require_server : (NSMutableDictionary*) params completionHandler:(resultHandler)result
+{
+#ifdef FAKE_DATA
+    
+    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+        
+        NSString *Path = [[NSBundle mainBundle] pathForResource:@"server.json" ofType:nil];
+        
+        NSData* data1 = [NSData dataWithContentsOfFile:Path];
+        
+        NSMutableDictionary* json = [[NSJSONSerialization JSONObjectWithData:data1 options:NSJSONReadingMutableContainers error:nil] mutableCopy];
+        dispatch_async(dispatch_get_main_queue(), ^{
+            result(json);
+        });
+    });
+    
+    return;
+    
+#endif
+    
+    
+    
+    params[@"_action"]=@"ant_mobile";
+    params[@"_operate"]=@"getUrl";
+
+    
+    // params[@"_operate"]=@"valid_upload";
+//    AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
+    
+//    NSData *data = [self get_json:URL_REQUIRE_SERVER parameters:params file:nil];
+//    NSDictionary *resultDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
+//    return resultDic;
+    
+    [self request_interface:URL_REQUIRE_SERVER parameters:params err_record_url:nil completionHandler:result retry:0];
+    
+}
++(void)request_editor:(NSString*) request_url params:(NSMutableDictionary*)params completionHandler:(resultHandler)result
+{
+    if([params[ @"_operate"] isEqualToString:@"search_setting"])
+    {
+        [self query_setting:request_url params:params completionHandler:result];
+    }
+    else if([params[ @"_operate"] isEqualToString:@"getCondition"])
+    {
+        [self require_query_ui:request_url params:params completionHandler:result];
+    }
+    else if([params[ @"_operate"] isEqualToString:@"order_detail"])
+    {
+        [self require_orderdetail:request_url params:params completionHandler:result];
+    }
+        
+}
++(void)REQUEST_EDITOR:(NSString*) request_url params:(NSMutableDictionary*)params completionHandler:(resultHandler)result
+{
+    
+    
+    
+    //    NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
+    AppDelegate *appDelegate = nil;
+    
+    appDelegate=(AppDelegate*)[[UIApplication sharedApplication] delegate];
+    if(appDelegate.user!=nil)
+        [params setValue:appDelegate.user forKey:@"user"];
+    
+    
+    //    if(![appDelegate.order_customer_id isEqualToString: appDelegate.contact_id]&& appDelegate.order_customer_id!=nil)
+    //        [params setValue:appDelegate.order_customer_id forKey:@"contactId"];
+    //    else
+    
+//    if(appDelegate.contact_id!=nil)
+//        [params setValue:appDelegate.contact_id forKey:@"contactId"];
+    if(appDelegate.password!=nil)
+        [params setValue:appDelegate.password forKey:@"password"];
+    
+//    if(appDelegate.order_code!=nil)
+//        [params setValue:appDelegate.order_code forKey:@"orderCode"];
+    
+//    bool can_create_backorder=appDelegate.can_create_backorder;
+    //    [params setValue:sourceid forKey:@"sourceid"];
+    //    [params setValue:editor forKey:@"editor"];
+    DebugLog(@"request editor url:%@",request_url);
+    
+    
+//    if([request_url isEqualToString:URL_NEW_CUSTOMER])
+//    {
+//        [params setObject:ScreenCodeNewCustomer forKey:kScreenName];
+//    }
+//    else if([request_url isEqualToString:URL_EDIT_CUSTOMER])
+//    {
+//        [params setObject:ScreenCodeEditCustomer forKey:kScreenName];
+//    }
+//    else if([request_url isEqualToString:URL_CUSTOMER_ADV_SEARCH])
+//    {
+//        [params setObject:ScreenCodeAdvanceSearch forKey:kScreenName];
+//    }
+//    else if([request_url isEqualToString:URL_CARTDELIVERY])
+//    {
+//        [params setObject:ScreenCodePlaceOrder forKey:kScreenName];
+//    }
+//    else if([request_url isEqualToString:URL_ADDRESS_EDOTOR])
+//    {
+//        [params setObject:ScreenCodeNewAddress forKey:kScreenName];
+//    }
+//    else if ([request_url isEqualToString:URL_DM_PARAMS]){
+//        [params setObject:ScreenCodeCreatePortfolio forKey:kScreenName];
+//    }
+    
+    
+    {
+        
+        
+//        if([request_url isEqualToString:URL_CARTDELIVERY])
+//        {
+//
+//
+//            NSString * uuid= [[NSUUID UUID] UUIDString];
+//            params[@"resultSerial"]=uuid;
+//            __block bool bbreak = false;
+//
+//            dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+//                for(int i=0;i<150;i++)
+//                {
+//                    //           NSMutableDictionary* result_params = [[NSMutableDictionary alloc]init];
+//                    //            result_params[@"resultSerial"]=uuid;
+//                    //json=[self get_json:request_url parameters:params];
+//                    if(bbreak)
+//                        break;
+//                    dispatch_async(dispatch_get_main_queue(), ^{
+//                        NSLog(@"request cart delivery %d",i);
+//                        [self request_interface:request_url parameters:params err_record_url:nil completionHandler:^(NSMutableDictionary *resulti) {
+//                            if(resulti!=nil)
+//                            {
+//
+//
+//                                if([resulti[@"result"] intValue]==2 || [resulti[@"result"] intValue] == 8)
+//                                {
+//
+//
+//                                    if(!bbreak) //此判断保证result只调用一次。
+//                                    {
+//                                        result(resulti);
+//                                        NSLog(@"result called at %d",i);
+//                                    }
+//                                    bbreak=true;
+//                                }
+//                            }
+//
+//                        } retry:3];
+//
+//                    });
+//
+//                    //                [self request_interface:request_url parameters:params err_record_url:nil completionHandler:result retry:0];
+//
+//                    sleep(2);
+//                }
+//            });
+//
+//        }
+//        else
+            [self request_interface:request_url parameters:params err_record_url:nil completionHandler:result retry:0];
+    }
+    //    if(json!=nil)
+    //    {
+    //        NSError *error=nil;
+    //        NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
+    //        return jsobj;
+    //    }
+    //    else
+    //        return nil;
+}
+
+
++(void)request_commoneditor_partialrefresh: (NSMutableDictionary*)params url:(NSString*)url completionHandler:(resultHandler)result
+{
+    //    NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
+    AppDelegate *appDelegate = nil;
+    
+    
+    appDelegate=(AppDelegate*)[[UIApplication sharedApplication] delegate];
+    
+    if(appDelegate.user!=nil)
+        [params setValue:appDelegate.user forKey:@"user"];
+//    if(appDelegate.contact_id!=nil)
+//        [params setValue:appDelegate.contact_id forKey:@"contactId"];
+    if(appDelegate.password!=nil)
+        [params setValue:appDelegate.password forKey:@"password"];
+    
+    //    if(appDelegate.order_code!=nil)
+    //        [params setValue:appDelegate.order_code forKey:@"orderCode"];
+    
+    //    NSDictionary* customerinfo= appDelegate.customerInfo;
+    //
+    //    NSArray* keys=[customerinfo allKeys];
+    //    for(int i=0;i<keys.count;i++)
+    //    {
+    //        [params setValue:[customerinfo valueForKey:(NSString*)keys[i]] forKey:keys[i] ];
+    //    }
+    //
+    //    [params setValue:sourceid forKey:@"sourceid"];
+    //    [params setValue:editor forKey:@"editor"];
+    
+//    [params setObject:ScreenCodeModelInfo forKey:kScreenName];
+    
+   
+    [self request_interface:url parameters:params err_record_url:nil completionHandler:result retry:0];
+    
+    
+    //
+    //    if(appDelegate.offline_mode)
+    //    {
+    //        params[@"offline_Command"]=url;
+    //        return [OLDataProvider offline_commoneditor_partialrefresh:params];
+    //    }
+    //
+    //    if(![self IsNetworkAvailable])
+    //        return [RAUtils error_json:RESULT_NET_NOTAVAILABLE err_msg:nil];
+    //
+    //    NSData* json=[self get_json:url parameters:params];
+    //    if(json!=nil)
+    //    {
+    //        NSError *error=nil;
+    //        NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
+    //        if([[jsobj valueForKey:@"result"]intValue]==2)
+    //            [appDelegate SetSo:nil];
+    //
+    //
+    //        return jsobj;
+    //    }
+    //    else
+    //        return nil;
+}
+
++(void)Login : (NSString*) user password:(NSString*) password completionHandler:(resultHandler)result
+{
+    
+#ifdef FAKE_DATA
+
+    
+    
+    
+    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+        
+        NSString *Path = [[NSBundle mainBundle] pathForResource:@"login.json" ofType:nil];
+        
+        NSData* data1 = [NSData dataWithContentsOfFile:Path];
+        
+        NSMutableDictionary* json = [[NSJSONSerialization JSONObjectWithData:data1 options:NSJSONReadingMutableContainers error:nil] mutableCopy];
+        dispatch_async(dispatch_get_main_queue(), ^{
+            result(json);
+        });
+    });
+    return;
+#endif
+    
+    
+    NSString* encryptu=[AESCrypt AES128Encrypt:user key:@"Usai2010"];
+    NSString* encryptp=[AESCrypt AES128Encrypt:password key:@"Usai2010"];
+    
+    
+    
+    NSMutableDictionary *params = @{@"user":encryptu,
+                                    @"pwd":encryptp,
+                                    @"_operate":@"login",
+                                    @"_action":@"ant_mobile"
+                                    }.mutableCopy;
+//    AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
+    
+    [self request_interface:URL_REQUIRE_SERVER parameters:params err_record_url:nil completionHandler:result retry:0];
+}
+
++(void)logout:(resultHandler)result
+{
+#ifdef FAKE_DATA
+
+    
+    
+    
+    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+        
+        
+        NSMutableDictionary* json = [@{@"result":@2} mutableCopy];
+        dispatch_async(dispatch_get_main_queue(), ^{
+            result(json);
+        });
+    });
+    return;
+#endif
+    
+    NSMutableDictionary * params =[NSMutableDictionary new];
+    
+    params[@"_action"]=@"ant_mobile";
+    params[@"_operate"]=@"getUrl";
+
+    
+    // params[@"_operate"]=@"valid_upload";
+//    AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
+    
+//    NSData *data = [self get_json:URL_REQUIRE_SERVER parameters:params file:nil];
+//    NSDictionary *resultDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
+//    return resultDic;
+    
+    [self request_interface:URL_LOGOUT parameters:params err_record_url:nil completionHandler:result retry:0];
+    
+    
+}
+
++(void)query : (NSMutableDictionary*) params completionHandler:(resultHandler)result
+{
+    
+#ifdef FAKE_DATA
+    
+    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+        
+        NSString *Path = [[NSBundle mainBundle] pathForResource:@"predef_query.json" ofType:nil];
+        
+        NSData* data1 = [NSData dataWithContentsOfFile:Path];
+        
+        NSMutableDictionary* json = [[NSJSONSerialization JSONObjectWithData:data1 options:NSJSONReadingMutableContainers error:nil] mutableCopy];
+        dispatch_async(dispatch_get_main_queue(), ^{
+            result(json);
+        });
+    });
+    return;
+    
+//    NSString *Path =nil;
+//    Path=[[NSBundle mainBundle] pathForResource:@"predef_query.json" ofType:nil];
+//
+//    NSData* data1 = [NSData dataWithContentsOfFile:Path];
+//    return [[NSJSONSerialization JSONObjectWithData:data1 options:NSJSONReadingMutableContainers error:nil] mutableCopy];
+#endif
+    
+    
+    params[ @"_action"]=@"ant_mobile";
+    params[ @"_operate"]=@"getResult";
+    
+   
+    // params[@"_operate"]=@"valid_upload";
+//    AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
+    [self request_interface:URL_LOGOUT parameters:params err_record_url:nil completionHandler:result retry:0];
+//    NSData *data = [self get_json:[self get_url:URL_QUERY] parameters:params file:nil];
+//    NSDictionary *resultDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
+//    return resultDic;
+}
+
++(void)download_query : (NSString*) url completionHandler:(resultHandler)result
+{
+    
+#ifdef FAKE_DATA
+    
+    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+        
+        NSString *Path = [[NSBundle mainBundle] pathForResource:@"download_query.xls" ofType:nil];
+        
+       
+        
+        NSMutableDictionary* json = [@{@"result":@2,@"path":Path} mutableCopy];
+        dispatch_async(dispatch_get_main_queue(), ^{
+            result(json);
+        });
+    });
+    return;
+//
+//    NSString *Path =nil;
+//    Path=[[NSBundle mainBundle] pathForResource:@"download_query.xls" ofType:nil];
+//
+//    return Path;
+#endif
+    
+    // params[@"_operate"]=@"valid_upload";
+//    AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
+    
+//    NSData *data=[NSData dataWithContentsOfURL:[NSURL URLWithString:url]];
+    
+    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+        
+       
+        NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:url]        cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:60*5];
+        
+        //设置请求方式为get
+        
+        [request setHTTPMethod:@"GET"];
+        
+        //添加用户会话id
+        
+        [request addValue:@"text/html" forHTTPHeaderField:@"Content-Type"];
+        
+        
+        NSHTTPURLResponse* urlResponse = nil;
+        
+        NSError *error = nil;
+        
+        NSData *data= [NSURLConnection sendSynchronousRequest:request returningResponse:&urlResponse error:&error];
+        
+        NSString* temp = NSTemporaryDirectory();
+        
+        NSString* file=[urlResponse suggestedFilename];
+        
+        NSString *tempfile = [temp stringByAppendingPathComponent:file];
+        
+        
+        [data writeToFile:tempfile atomically:false];
+        
+        NSMutableDictionary* json = [NSMutableDictionary new];
+        json[@"result"]=@2;
+        json[@"path"]=tempfile;
+        dispatch_async(dispatch_get_main_queue(), ^{
+            result(json);
+        });
+    });
+    
+  
+//    NSData *data = [self get_json:[self get_url:URL_QUERY] parameters:params file:nil];
+//    NSDictionary *resultDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
+//    return resultDic;
+}
++(void)download_file : (NSMutableDictionary*) params url:(NSString*) url completionHandler:(resultHandler)result
+{
+//    NSString *Path =nil;
+//    Path=[[NSBundle mainBundle] pathForResource:@"demo_row.pdf" ofType:nil];
+//    
+//    return Path;
+    
+    
+#ifdef FAKE_DATA
+    
+    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+        
+        NSString *Path = [[NSBundle mainBundle] pathForResource:@"demo_row.pdf" ofType:nil];
+        
+       
+        
+        NSMutableDictionary* json = [@{@"result":@2,@"path":Path} mutableCopy];
+        dispatch_async(dispatch_get_main_queue(), ^{
+            result(json);
+        });
+    });
+    return;
+//
+//    NSString *Path =nil;
+//    Path=[[NSBundle mainBundle] pathForResource:@"download_query.xls" ofType:nil];
+//
+//    return Path;
+#endif
+    
+    
+    [self request_file_fast:url parameters:params completionHandler:result];
+}
++(void)require_query_ui:(NSString*) request_url params:(NSMutableDictionary*)params completionHandler:(resultHandler)result
+{
+    
+    #ifdef FAKE_DATA
+    
+    
+    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+        
+        NSString *Path = [[NSBundle mainBundle] pathForResource:@"search_ui.json" ofType:nil];
+        
+        NSData* data1 = [NSData dataWithContentsOfFile:Path];
+        
+        NSMutableDictionary* json = [[NSJSONSerialization JSONObjectWithData:data1 options:NSJSONReadingMutableContainers error:nil] mutableCopy];
+        dispatch_async(dispatch_get_main_queue(), ^{
+            result(json);
+        });
+    });
+    return;
+
+    #endif
+        
+        
+        
+    
+    
+    params[ @"_action"]=@"ant_mobile";
+    params[ @"_operate"]=@"getCondition";
+        
+        
+        // params[@"_operate"]=@"valid_upload";
+    //    AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
+        
+    //    NSData *data = [self get_json:[self get_url:URL_QUERY_UI] parameters:params file:nil];
+    //    NSDictionary *resultDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
+    //    return resultDic;
+        
+    [self request_editor:request_url params:params completionHandler:result];
+    
+}
++(void)kv_detail : (NSMutableDictionary*) params completionHandler:(resultHandler)result
+{
+#ifdef FAKE_DATA
+    
+    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+        
+        NSString *Path = [[NSBundle mainBundle] pathForResource:@"kv.json" ofType:nil];
+        
+        NSData* data1 = [NSData dataWithContentsOfFile:Path];
+        
+        NSMutableDictionary* json = [[NSJSONSerialization JSONObjectWithData:data1 options:NSJSONReadingMutableContainers error:nil] mutableCopy];
+        dispatch_async(dispatch_get_main_queue(), ^{
+            result(json);
+        });
+    });
+    return;
+//    NSString *Path = [[NSBundle mainBundle] pathForResource:@"kv.json" ofType:nil];
+//
+//    NSData* data1 = [NSData dataWithContentsOfFile:Path];
+//    return [[NSJSONSerialization JSONObjectWithData:data1 options:NSJSONReadingMutableContainers error:nil] mutableCopy];
+#endif
+    
+    
+    params[ @"_action"]=@"ant_mobile";
+    params[ @"module"]=@"kv_detail";
+    params[ @"_operate"]=@"row_action";
+    
+    // params[@"_operate"]=@"valid_upload";
+//    AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
+    
+//    NSData *data = [self get_json:[self get_url:URL_KV_DETAIL] parameters:params file:nil];
+//    NSDictionary *resultDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
+//    return resultDic;
+    
+    [self request_interface:URL_KV_DETAIL parameters:params err_record_url:nil completionHandler:result retry:0];
+    
+//    [self request_editor:URL_KV_DETAIL params:params completionHandler:result];
+}
+
++(void)require_orderdetail:(NSString*) request_url params:(NSMutableDictionary*)params completionHandler:(resultHandler)result
+{
+#ifdef FAKE_DATA
+
+
+dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+    
+    NSString *Path = [[NSBundle mainBundle] pathForResource:@"orderdetail.json" ofType:nil];
+    
+    NSData* data1 = [NSData dataWithContentsOfFile:Path];
+    
+    NSMutableDictionary* json = [[NSJSONSerialization JSONObjectWithData:data1 options:NSJSONReadingMutableContainers error:nil] mutableCopy];
+    dispatch_async(dispatch_get_main_queue(), ^{
+        result(json);
+    });
+});
+return;
+
+#endif
+    
+    
+    
+
+
+//params[ @"_action"]=@"ant_mobile";
+//params[ @"_operate"]=@"getCondition";
+    
+    
+    // params[@"_operate"]=@"valid_upload";
+//    AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
+    
+//    NSData *data = [self get_json:[self get_url:URL_QUERY_UI] parameters:params file:nil];
+//    NSDictionary *resultDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
+//    return resultDic;
+    
+[self request_editor:request_url params:params completionHandler:result];
+    
+    
+//    NSString *Path = [[NSBundle mainBundle] pathForResource:@"orderdetail.json" ofType:nil];
+//    
+//    NSData* data1 = [NSData dataWithContentsOfFile:Path];
+//    return [[NSJSONSerialization JSONObjectWithData:data1 options:NSJSONReadingMutableContainers error:nil] mutableCopy];
+//    
+//    
+//    
+//    [self request_Editor:request_url params:params];
+}
+
+
++(void)query_setting:(NSString*) request_url params:(NSMutableDictionary*)params completionHandler:(resultHandler)result
+{
+#ifdef FAKE_DATA
+    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+        
+        NSString *Path = [[NSBundle mainBundle] pathForResource:@"query_setting.json" ofType:nil];
+        
+        NSData* data1 = [NSData dataWithContentsOfFile:Path];
+        
+        NSMutableDictionary* json = [[NSJSONSerialization JSONObjectWithData:data1 options:NSJSONReadingMutableContainers error:nil] mutableCopy];
+        dispatch_async(dispatch_get_main_queue(), ^{
+            result(json);
+        });
+    });
+    return;
+//    NSString *Path = [[NSBundle mainBundle] pathForResource:@"query_setting.json" ofType:nil];
+//
+//    NSData* data1 = [NSData dataWithContentsOfFile:Path];
+//    return [[NSJSONSerialization JSONObjectWithData:data1 options:NSJSONReadingMutableContainers error:nil] mutableCopy];
+#endif
+    
+    
+    
+    
+//    params[ @"_action"]=@"ant_mobile";
+//    params[ @"_operate"]=@"search_setting";
+    
+    
+    // params[@"_operate"]=@"valid_upload";
+    //    AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
+    
+    //    NSData *data = [self get_json:[self get_url:URL_QUERY_UI] parameters:params file:nil];
+    //    NSDictionary *resultDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
+    //    return resultDic;
+    
+    [self REQUEST_EDITOR:request_url params:params completionHandler:result];
+}
+
++(void)save_querysetting : (NSMutableDictionary*) params completionHandler:(resultHandler)result
+{
+    
+#ifdef FAKE_DATA
+    
+    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+        
+        NSString *Path = [[NSBundle mainBundle] pathForResource:@"predef_query.json" ofType:nil];
+        
+        NSData* data1 = [NSData dataWithContentsOfFile:Path];
+        
+        NSMutableDictionary* json = [[NSJSONSerialization JSONObjectWithData:data1 options:NSJSONReadingMutableContainers error:nil] mutableCopy];
+        dispatch_async(dispatch_get_main_queue(), ^{
+            result(json);
+        });
+    });
+    return;
+    
+//    NSString *Path =nil;
+//    Path=[[NSBundle mainBundle] pathForResource:@"predef_query.json" ofType:nil];
+//
+//    NSData* data1 = [NSData dataWithContentsOfFile:Path];
+//    return [[NSJSONSerialization JSONObjectWithData:data1 options:NSJSONReadingMutableContainers error:nil] mutableCopy];
+#endif
+    
+    
+    params[ @"_action"]=@"ant_mobile";
+    params[ @"_operate"]=@"save_searchsetting";
+    
+    
+    // params[@"_operate"]=@"valid_upload";
+//    AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
+//
+//    NSData *data = [self get_json:[self get_url:URL_SAVE_QUERY_SETTIING] parameters:params file:nil];
+//    NSDictionary *resultDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
+//    return resultDic;
+    
+    [self request_interface:URL_SAVE_QUERY_SETTIING parameters:params err_record_url:nil completionHandler:result retry:0];
+}
+
++(void) queryAutoComplete:(NSMutableDictionary*)params completionHandler:(resultHandler)result
+{
+    
+    params[ @"_action"]=@"ant_mobile";
+    params[ @"_operate"]=@"query_autocomplete";
+    
+    [self request_interface:URL_QUERY_AUTOCOMPLETE parameters:params err_record_url:nil completionHandler:result retry:0];
+    
+    // params[@"_operate"]=@"valid_upload";
+//    AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
+    
+//    NSData *data = [self get_json:[self get_url:URL_QUERY_AUTOCOMPLETE] parameters:params file:nil];
+//    NSDictionary *resultDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
+//    return [resultDic mutableCopy];
+}
 @end

+ 328 - 168
RedAnt Mobile/RedAnt Mobile/RAResultViewController.m

@@ -72,54 +72,96 @@
 //        dic[@"criteria"] = [NSArray arrayWithObjects:@"aaa",@"bbb", nil];
 
         __weak typeof(self) weakSelf = self;
-        dispatch_async(dispatch_get_global_queue(0, 0), ^{
-            NSDictionary *contentDic = [RANetwork query:dic];
-            NSInteger result = [[contentDic objectForKey:@"result"] integerValue];
-            dispatch_async(dispatch_get_main_queue(), ^{
-                if (weakSelf) {
-                    __strong typeof(weakSelf) strongSelf = weakSelf;
-                    
-                    [strongSelf.loadingIndicator stopAnimating];
-                    
-                    if (result == RESULT_TRUE) {
-                        strongSelf.content_layout = [contentDic objectForKey:@"layout"];
-                        strongSelf.content_action = [contentDic objectForKey:@"row_action"];
-                        strongSelf.content_menu = [[contentDic objectForKey:@"menu"] mutableCopy];
-                        [strongSelf setupNavigationBar];
+        
+        [RANetwork query:dic completionHandler:^(NSMutableDictionary *result) {
+            NSDictionary *contentDic = result;
+            int resulti = [[contentDic objectForKey:@"result"] intValue];
+            [weakSelf.loadingIndicator stopAnimating];
+            
+            if (resulti == RESULT_TRUE) {
+                weakSelf.content_layout = [contentDic objectForKey:@"layout"];
+                weakSelf.content_action = [contentDic objectForKey:@"row_action"];
+                weakSelf.content_menu = [[contentDic objectForKey:@"menu"] mutableCopy];
+                [weakSelf setupNavigationBar];
 
 //                            UILabel * headerview=(UILabel *)self.tableview.tableHeaderView;
 //                            headerview.text = contentDic[@"table_title"];
 //                            [self resize_tableHeader];
-                        
-                        NSString *title = contentDic[@"table_title"];
-                        self.titleLabel.text = title;
+                
+                NSString *title = contentDic[@"table_title"];
+                self.titleLabel.text = title;
 
-                        if(strongSelf.content_data==nil)
-                            strongSelf.content_data = [NSMutableDictionary new];
-                        NSMutableDictionary* newdata = [[contentDic objectForKey:@"data"] mutableCopy];
-                        for(int dc = 0;dc<[newdata[@"count"] intValue];dc++)
-                        {
-                            NSMutableDictionary * newdata_item = newdata[[NSString stringWithFormat:@"item_%d",dc]];
+                if(weakSelf.content_data==nil)
+                    weakSelf.content_data = [NSMutableDictionary new];
+                NSMutableDictionary* newdata = [[contentDic objectForKey:@"data"] mutableCopy];
+                for(int dc = 0;dc<[newdata[@"count"] intValue];dc++)
+                {
+                    NSMutableDictionary * newdata_item = newdata[[NSString stringWithFormat:@"item_%d",dc]];
 
-                            strongSelf.content_data[[NSString stringWithFormat:@"item_%d",[strongSelf.content_data[@"count"] intValue] ]] = newdata_item;
-                            strongSelf.content_data[@"count"] = @([strongSelf.content_data[@"count"] intValue]+1);
-                        }
+                    weakSelf.content_data[[NSString stringWithFormat:@"item_%d",[weakSelf.content_data[@"count"] intValue] ]] = newdata_item;
+                    weakSelf.content_data[@"count"] = @([weakSelf.content_data[@"count"] intValue]+1);
+                }
 
 //                        strongSelf.content_data = [contentDic objectForKey:@"data"];
-                        [strongSelf updateTableFrame];
-                        [strongSelf.tableview reloadData];
-                    } else {
-                        [RAUtils message_alert:[contentDic objectForKey:@"err_msg"] title:@"Warning" controller:strongSelf];
-                    }
-
-                    if (finish) {
-                        finish((int)result,(int)[self resultItemCount]);
-                    }
-
-                }
+                [weakSelf updateTableFrame];
+                [weakSelf.tableview reloadData];
+            } else {
+                [RAUtils message_alert:[contentDic objectForKey:@"err_msg"] title:@"Warning" controller:weakSelf];
+            }
 
-            });
-        });
+            if (finish) {
+                finish((int)result,(int)[self resultItemCount]);
+            }
+        }];
+        
+//        dispatch_async(dispatch_get_global_queue(0, 0), ^{
+//            NSDictionary *contentDic = [RANetwork query:dic];
+//            NSInteger result = [[contentDic objectForKey:@"result"] integerValue];
+//            dispatch_async(dispatch_get_main_queue(), ^{
+//                if (weakSelf) {
+//                    __strong typeof(weakSelf) strongSelf = weakSelf;
+//
+//                    [strongSelf.loadingIndicator stopAnimating];
+//
+//                    if (result == RESULT_TRUE) {
+//                        strongSelf.content_layout = [contentDic objectForKey:@"layout"];
+//                        strongSelf.content_action = [contentDic objectForKey:@"row_action"];
+//                        strongSelf.content_menu = [[contentDic objectForKey:@"menu"] mutableCopy];
+//                        [strongSelf setupNavigationBar];
+//
+////                            UILabel * headerview=(UILabel *)self.tableview.tableHeaderView;
+////                            headerview.text = contentDic[@"table_title"];
+////                            [self resize_tableHeader];
+//
+//                        NSString *title = contentDic[@"table_title"];
+//                        self.titleLabel.text = title;
+//
+//                        if(strongSelf.content_data==nil)
+//                            strongSelf.content_data = [NSMutableDictionary new];
+//                        NSMutableDictionary* newdata = [[contentDic objectForKey:@"data"] mutableCopy];
+//                        for(int dc = 0;dc<[newdata[@"count"] intValue];dc++)
+//                        {
+//                            NSMutableDictionary * newdata_item = newdata[[NSString stringWithFormat:@"item_%d",dc]];
+//
+//                            strongSelf.content_data[[NSString stringWithFormat:@"item_%d",[strongSelf.content_data[@"count"] intValue] ]] = newdata_item;
+//                            strongSelf.content_data[@"count"] = @([strongSelf.content_data[@"count"] intValue]+1);
+//                        }
+//
+////                        strongSelf.content_data = [contentDic objectForKey:@"data"];
+//                        [strongSelf updateTableFrame];
+//                        [strongSelf.tableview reloadData];
+//                    } else {
+//                        [RAUtils message_alert:[contentDic objectForKey:@"err_msg"] title:@"Warning" controller:strongSelf];
+//                    }
+//
+//                    if (finish) {
+//                        finish((int)result,(int)[self resultItemCount]);
+//                    }
+//
+//                }
+//
+//            });
+//        });
     }
 }
 
@@ -198,19 +240,42 @@
                 NSMutableDictionary *params = action[@"params"];
                 NSString* URL =action[@"url"];
                 __weak typeof(self) weakSelf = self;
-                dispatch_async(dispatch_get_global_queue(0, 0), ^{
-                    
-                    
-                    NSString *path = [RANetwork download_file:params url:URL];
-                    weakSelf.documentPath = path;
-                    
-                    if (path) {
-                        dispatch_async(dispatch_get_main_queue(), ^{
-                            [weakSelf.navigationController pushViewController:weakSelf.quickLook animated:NO];
-                        });
+                
+                [RANetwork download_file:params url:URL completionHandler:^(NSMutableDictionary *result) {
+                        int resulti=[result[@"result"] intValue];
+                    if(resulti==RESULT_TRUE)
+                    {
+                        NSString *path =result[@"path"];
+//                        weakSelf.download_query = path;
+                        weakSelf.documentPath = path;
+//                        [alertVC dismissViewControllerAnimated:YES completion:^{
+                            
+                            if (path) {
+                                [weakSelf.navigationController pushViewController:weakSelf.quickLook animated:NO];
+                            }
+                            
+//                        }];
                     }
-                    
-                });
+                    else
+                    {
+                        [RAUtils message_alert:@"Can not download file" title:@"Warring" controller:weakSelf];
+                    }
+                }];
+                
+                
+//                dispatch_async(dispatch_get_global_queue(0, 0), ^{
+//
+//
+//                    NSString *path = [RANetwork download_file:params url:URL];
+//                    weakSelf.documentPath = path;
+//
+//                    if (path) {
+//                        dispatch_async(dispatch_get_main_queue(), ^{
+//                            [weakSelf.navigationController pushViewController:weakSelf.quickLook animated:NO];
+//                        });
+//                    }
+//
+//                });
             }
             else if([module isEqualToString:@"kv_detail"])
             {
@@ -228,47 +293,69 @@
                 
                 params[@"criteria"]=[RAConvertor dict2string:criteria] ;
                 
-                
-                
-                UIAlertView * waitalert = [RAUtils waiting_alert:@"Loading..." title:@"Please wait"];
-                
-                
                 __weak typeof(self) weakself = self;
-                dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-                    
-                    
-                    
-                    NSDictionary* json =[RANetwork kv_detail:params];
-                    
-                    dispatch_async(dispatch_get_main_queue(), ^{
-                        [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
-                        
-                        
-                        if([[json valueForKey:@"result"] intValue]==2)
-                        {
-                            KVViewController *vc = [[UIStoryboard storyboardWithName:@"Detail" bundle:nil] instantiateViewControllerWithIdentifier:@"KVViewController"];
-                            vc.content = [json mutableCopy];
-                            [weakself.navigationController pushViewController:vc animated:NO];
-                            
-                            //                        weakself.content_data_download = [weakself CopyDirty:weakself.content_data_download to:[editor_json mutableCopy]];//[editor_json mutableCopy];
-                            //
-                            //                        weakself.content_data_control = [weakself translate_json:weakself.content_data_download changed: weakself.changed_data];
-                            //
-                            //
-                            //                        [weakself download_success];
-                            //                        [weakself.editorTable reloadData];
-                            
-                        }
-                        else
-                        {
-                            [RAUtils message_alert:json[@"msg"] title:nil controller:weakself] ;
-                        }
-                        
-                        
-                        
+                
+                __block UIAlertController * waitalert = [RAUtils waiting_alert:self title:@"Loading..." completion:^{
+                    [RANetwork kv_detail:params completionHandler:^(NSMutableDictionary *result) {
+                        NSMutableDictionary* return_json = result;
                         
-                    });
-                });
+                        [waitalert dismissViewControllerAnimated:YES completion:^{
+                            int resulti=[[return_json valueForKey:@"result"] intValue];
+                            if(resulti==2)
+                            {
+                                KVViewController *vc = [[UIStoryboard storyboardWithName:@"Detail" bundle:nil] instantiateViewControllerWithIdentifier:@"KVViewController"];
+                                vc.content = [return_json mutableCopy];
+                                [weakself.navigationController pushViewController:vc animated:NO];
+                            }
+                            else
+                            {
+                                [RAUtils message_alert:return_json[@"msg"] title:nil controller:weakself] ;
+                            }
+                        }];
+                    }];
+                    
+                }];
+                
+//
+//                UIAlertView * waitalert = [RAUtils waiting_alert:@"Loading..." title:@"Please wait"];
+//
+//
+//
+//                dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+//
+//
+//
+//                    NSDictionary* json =[RANetwork kv_detail:params];
+//
+//                    dispatch_async(dispatch_get_main_queue(), ^{
+//                        [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
+//
+//
+//                        if([[json valueForKey:@"result"] intValue]==2)
+//                        {
+//                            KVViewController *vc = [[UIStoryboard storyboardWithName:@"Detail" bundle:nil] instantiateViewControllerWithIdentifier:@"KVViewController"];
+//                            vc.content = [json mutableCopy];
+//                            [weakself.navigationController pushViewController:vc animated:NO];
+//
+//                            //                        weakself.content_data_download = [weakself CopyDirty:weakself.content_data_download to:[editor_json mutableCopy]];//[editor_json mutableCopy];
+//                            //
+//                            //                        weakself.content_data_control = [weakself translate_json:weakself.content_data_download changed: weakself.changed_data];
+//                            //
+//                            //
+//                            //                        [weakself download_success];
+//                            //                        [weakself.editorTable reloadData];
+//
+//                        }
+//                        else
+//                        {
+//                            [RAUtils message_alert:json[@"msg"] title:nil controller:weakself] ;
+//                        }
+//
+//
+//
+//
+//                    });
+//                });
             }
             else if([module isEqualToString:@"order_detail"])
             {
@@ -310,64 +397,112 @@
                         //            +(NSString*)download_file : (NSMutableDictionary*) params url:(NSString*) url
                         NSMutableDictionary *params = json[@"params"];
                         NSString* URL =json[@"url"];
-                        dispatch_async(dispatch_get_global_queue(0, 0), ^{
-                            
-                            
-                            NSString *path = [RANetwork download_file:params url:URL];
-                            weakSelf.documentPath = path;
-                            
-                            if (path) {
-                                dispatch_async(dispatch_get_main_queue(), ^{
-                                    [weakSelf.navigationController pushViewController:weakSelf.quickLook animated:NO];
-                                });
+                        
+                        [RANetwork download_file:params url:URL completionHandler:^(NSMutableDictionary *result) {
+                                int resulti=[result[@"result"] intValue];
+                            if(resulti==RESULT_TRUE)
+                            {
+                                NSString *path =result[@"path"];
+        //                        weakSelf.download_query = path;
+                                weakSelf.documentPath = path;
+        //                        [alertVC dismissViewControllerAnimated:YES completion:^{
+                                    
+                                    if (path) {
+                                        [weakSelf.navigationController pushViewController:weakSelf.quickLook animated:NO];
+                                    }
+                                    
+        //                        }];
                             }
-                            
-                        });
+                            else
+                            {
+                                [RAUtils message_alert:@"Can not download file" title:@"Warring" controller:weakSelf];
+                            }
+                        }];
+                        
+                        
+//                        dispatch_async(dispatch_get_global_queue(0, 0), ^{
+//                            
+//                            
+//                            NSString *path = [RANetwork download_file:params url:URL];
+//                            weakSelf.documentPath = path;
+//                            
+//                            if (path) {
+//                                dispatch_async(dispatch_get_main_queue(), ^{
+//                                    [weakSelf.navigationController pushViewController:weakSelf.quickLook animated:NO];
+//                                });
+//                            }
+//                            
+//                        });
                     }
                     else if([module isEqualToString:@"kv_detail"])
                     {
                         NSMutableDictionary *params = json[@"params"];
                         
-                        
-                        UIAlertView * waitalert = [RAUtils waiting_alert:@"Loading..." title:@"Please wait"];
-                        
-                        
                         __weak typeof(self) weakself = self;
-                        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-                            
-                            
-                            
-                            NSDictionary* json =[RANetwork kv_detail:params];
-                            
-                            dispatch_async(dispatch_get_main_queue(), ^{
-                                [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
-                                
-                                
-                                if([[json valueForKey:@"result"] intValue]==2)
-                                {
-                                    KVViewController *vc = [[UIStoryboard storyboardWithName:@"Detail" bundle:nil] instantiateViewControllerWithIdentifier:@"KVViewController"];
-                                    vc.content = [json mutableCopy];
-                                    [weakself.navigationController pushViewController:vc animated:NO];
-                                    
-                                    //                        weakself.content_data_download = [weakself CopyDirty:weakself.content_data_download to:[editor_json mutableCopy]];//[editor_json mutableCopy];
-                                    //
-                                    //                        weakself.content_data_control = [weakself translate_json:weakself.content_data_download changed: weakself.changed_data];
-                                    //
-                                    //
-                                    //                        [weakself download_success];
-                                    //                        [weakself.editorTable reloadData];
-                                    
-                                }
-                                else
-                                {
-                                    [RAUtils message_alert:json[@"msg"] title:nil controller:weakself] ;
-                                }
-                                
-                                
-                                
+                        
+                        __block UIAlertController * waitalert = [RAUtils waiting_alert:self title:@"Loading" completion:^{
+                            [RANetwork kv_detail:params completionHandler:^(NSMutableDictionary *result) {
+                                NSMutableDictionary* return_json = result;
                                 
-                            });
-                        });
+                                [waitalert dismissViewControllerAnimated:YES completion:^{
+                                    int resulti=[[return_json valueForKey:@"result"] intValue];
+                                    if(resulti==2)
+                                    {
+                                        KVViewController *vc = [[UIStoryboard storyboardWithName:@"Detail" bundle:nil] instantiateViewControllerWithIdentifier:@"KVViewController"];
+                                        vc.content = [json mutableCopy];
+                                        [weakself.navigationController pushViewController:vc animated:NO];
+
+                                        
+                                    }
+                                    else
+                                    {
+                                        [RAUtils message_alert:return_json[@"msg"] title:nil controller:weakself] ;
+                                    }
+                                }];
+                            }];
+                            
+                        }];
+                        
+//
+//                        UIAlertView * waitalert = [RAUtils waiting_alert:@"Loading..." title:@"Please wait"];
+//
+//
+//                        __weak typeof(self) weakself = self;
+//                        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+//
+//
+//
+//                            NSDictionary* json =[RANetwork kv_detail:params];
+//
+//                            dispatch_async(dispatch_get_main_queue(), ^{
+//                                [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
+//
+//
+//                                if([[json valueForKey:@"result"] intValue]==2)
+//                                {
+//                                    KVViewController *vc = [[UIStoryboard storyboardWithName:@"Detail" bundle:nil] instantiateViewControllerWithIdentifier:@"KVViewController"];
+//                                    vc.content = [json mutableCopy];
+//                                    [weakself.navigationController pushViewController:vc animated:NO];
+//
+//                                    //                        weakself.content_data_download = [weakself CopyDirty:weakself.content_data_download to:[editor_json mutableCopy]];//[editor_json mutableCopy];
+//                                    //
+//                                    //                        weakself.content_data_control = [weakself translate_json:weakself.content_data_download changed: weakself.changed_data];
+//                                    //
+//                                    //
+//                                    //                        [weakself download_success];
+//                                    //                        [weakself.editorTable reloadData];
+//
+//                                }
+//                                else
+//                                {
+//                                    [RAUtils message_alert:json[@"msg"] title:nil controller:weakself] ;
+//                                }
+//
+//
+//
+//
+//                            });
+//                        });
                     }
                     else if([module isEqualToString:@"order_detail"])
                     {
@@ -432,16 +567,14 @@
     UIAlertController *alertVC = [self showIndicatorAlert];
     
     __weak typeof(self) weakSelf = self;
-    dispatch_async(dispatch_get_global_queue(0, 0), ^{
-        
-        //        NSMutableDictionary *params = self.params.mutableCopy;
-        //        if(add_params!=nil)
-        //           [params addEntriesFromDictionary:add_params];
-        NSString *path = [RANetwork download_query:url];
-        weakSelf.download_query = path;
-        weakSelf.documentPath = path;
-        
-        dispatch_async(dispatch_get_main_queue(), ^{
+    
+    [RANetwork download_query:url completionHandler:^(NSMutableDictionary *result) {
+            int resulti=[result[@"result"] intValue];
+        if(resulti==RESULT_TRUE)
+        {
+            NSString *path =result[@"path"];
+            weakSelf.download_query = path;
+            weakSelf.documentPath = path;
             [alertVC dismissViewControllerAnimated:YES completion:^{
                 
                 if (path) {
@@ -449,9 +582,33 @@
                 }
                 
             }];
-        });
-        
-    });
+        }
+        else
+        {
+            [RAUtils message_alert:@"Can not download file" title:@"Warring" controller:weakSelf];
+        }
+    }];
+    
+//    dispatch_async(dispatch_get_global_queue(0, 0), ^{
+//
+//        //        NSMutableDictionary *params = self.params.mutableCopy;
+//        //        if(add_params!=nil)
+//        //           [params addEntriesFromDictionary:add_params];
+//        NSString *path = [RANetwork download_query:url];
+//        weakSelf.download_query = path;
+//        weakSelf.documentPath = path;
+//
+//        dispatch_async(dispatch_get_main_queue(), ^{
+//            [alertVC dismissViewControllerAnimated:YES completion:^{
+//
+//                if (path) {
+//                    [weakSelf.navigationController pushViewController:weakSelf.quickLook animated:NO];
+//                }
+//
+//            }];
+//        });
+//
+//    });
 }
 - (void)downloadItemClick:(UIBarButtonItem *)sender {
     
@@ -462,21 +619,24 @@
         return;
     }
     
-    __weak typeof(self) weakSelf = self;
-    dispatch_async(dispatch_get_global_queue(0, 0), ^{
-        
-        NSMutableDictionary *params = self.params.mutableCopy;
-        NSString *path = [RANetwork download_query:params];
-        weakSelf.download_query = path;
-        weakSelf.documentPath = path;
-        
-        if (path) {
-            dispatch_async(dispatch_get_main_queue(), ^{
-                [weakSelf.navigationController pushViewController:weakSelf.quickLook animated:NO];
-            });
-        }
-        
-    });
+    
+    NSAssert(true, @"downloadItemClick");
+//
+//    __weak typeof(self) weakSelf = self;
+//    dispatch_async(dispatch_get_global_queue(0, 0), ^{
+//
+//        NSMutableDictionary *params = self.params.mutableCopy;
+//        NSString *path = [RANetwork download_query:params];
+//        weakSelf.download_query = path;
+//        weakSelf.documentPath = path;
+//
+//        if (path) {
+//            dispatch_async(dispatch_get_main_queue(), ^{
+//                [weakSelf.navigationController pushViewController:weakSelf.quickLook animated:NO];
+//            });
+//        }
+//
+//    });
     
 }
 

+ 48 - 23
RedAnt Mobile/RedAnt Mobile/SearchSettingViewController.m

@@ -17,6 +17,10 @@
 
 - (void)viewDidLoad {
     [super viewDidLoad];
+    
+    self.params[ @"_action"]=@"ant_mobile";
+    self.params[ @"_operate"]=@"search_setting";
+    
     // Do any additional setup after loading the view.
     self.automaticallyAdjustsScrollViewInsets = NO;
     UIBarButtonItem *searchItem = [[UIBarButtonItem alloc] initWithTitle:@"Save" style:UIBarButtonItemStylePlain target:self action:@selector(RBItemClick:)];
@@ -42,22 +46,35 @@
         
             
             __weak typeof(self) weakSelf = self;
-            dispatch_async(dispatch_get_global_queue(0, 0), ^{
-                NSDictionary *contentDic = [RANetwork save_querysetting:upparams];
-                NSInteger result = [[contentDic objectForKey:@"result"] integerValue];
-                dispatch_async(dispatch_get_main_queue(), ^{
-                    if (weakSelf) {
-                        __strong typeof(weakSelf) strongSelf = weakSelf;
-                        if (result == RESULT_TRUE) {
-                            [self.navigationController popViewControllerAnimated:false];
-                        } else {
-                            [RAUtils message_alert:[contentDic objectForKey:@"err_msg"] title:@"Warning" controller:strongSelf];
-                        }
-                        
-                    }
-                    
-                });
-            });
+    
+    [RANetwork save_querysetting:upparams completionHandler:^(NSMutableDictionary *result) {
+        int resulti = [[result objectForKey:@"result"] intValue];
+        
+        if (resulti == RESULT_TRUE) {
+            [self.navigationController popViewControllerAnimated:false];
+        } else {
+            
+            [RAUtils message_alert:[result objectForKey:@"err_msg"] title:@"Warning" controller:weakSelf];
+        }
+    }];
+    
+    
+//            dispatch_async(dispatch_get_global_queue(0, 0), ^{
+//                NSDictionary *contentDic = [RANetwork save_querysetting:upparams];
+//                NSInteger result = [[contentDic objectForKey:@"result"] integerValue];
+//                dispatch_async(dispatch_get_main_queue(), ^{
+//                    if (weakSelf) {
+//                        __strong typeof(weakSelf) strongSelf = weakSelf;
+//                        if (result == RESULT_TRUE) {
+//                            [self.navigationController popViewControllerAnimated:false];
+//                        } else {
+//                            [RAUtils message_alert:[contentDic objectForKey:@"err_msg"] title:@"Warning" controller:strongSelf];
+//                        }
+//
+//                    }
+//
+//                });
+//            });
         
     
     
@@ -96,14 +113,22 @@
 #pragma mark Request Editor
 -(NSDictionary*)request_Editor:(NSString*) request_url params:(NSMutableDictionary*)params
 {
+    NSAssert(true, @"request_editor");
+    return nil;
 
-    NSDictionary* ret =[RANetwork query_setting:request_url params:params];
-    dispatch_async(dispatch_get_main_queue(), ^{
-        UILabel * headerview=(UILabel *)self.editorTable.tableHeaderView;
-        headerview.text = ret[@"table_title"];
-        [self resize_tableHeader];
-    });
-    return ret;
+//    [RANetwork query_setting:request_url params:params completionHandler:^(NSMutableDictionary *result) {
+//        UILabel * headerview=(UILabel *)self.editorTable.tableHeaderView;
+//        headerview.text = ret[@"table_title"];
+//        [self resize_tableHeader];;
+//    }];
+//
+//    NSDictionary* ret =[RANetwork query_setting:request_url params:params];
+//    dispatch_async(dispatch_get_main_queue(), ^{
+//        UILabel * headerview=(UILabel *)self.editorTable.tableHeaderView;
+//        headerview.text = ret[@"table_title"];
+//        [self resize_tableHeader];
+//    });
+//    return ret;
 }
 
 #pragma mark - customize editor

+ 34 - 27
RedAnt Mobile/RedAnt Mobile/SearchViewController.m

@@ -21,6 +21,9 @@
 - (void)viewDidLoad {
     [super viewDidLoad];
     // Do any additional setup after loading the view.
+    
+    self.params[ @"_action"]=@"ant_mobile";
+    self.params[ @"_operate"]=@"getCondition";
     self.automaticallyAdjustsScrollViewInsets = NO;
     [self setupNavigationBar];
 }
@@ -136,38 +139,42 @@
 #pragma mark Request Editor
 -(NSDictionary*)request_Editor:(NSString*) request_url params:(NSMutableDictionary*)params
 {
-    NSDictionary* ret =[RANetwork require_query_ui:request_url params:params];
-    dispatch_async(dispatch_get_main_queue(), ^{
-    UILabel * headerview=(UILabel *)self.editorTable.tableHeaderView;
-    headerview.text = ret[@"table_title"];
-        [self resize_tableHeader];
-    });
-    return ret;
+    NSAssert(true, @"request_editor");
+    return nil;
+//    NSDictionary* ret =[RANetwork require_query_ui:request_url params:params];
+//    dispatch_async(dispatch_get_main_queue(), ^{
+//    UILabel * headerview=(UILabel *)self.editorTable.tableHeaderView;
+//    headerview.text = ret[@"table_title"];
+//        [self resize_tableHeader];
+//    });
+//    return ret;
 }
 
 #pragma mark- autocomplete
 -( NSArray* )sync_loadCadidate:( NSString*)str //search_id:(NSString*) search_id
 {
-    NSIndexPath * indexPath = [self.editorTable indexPathForCell:self.editingcell];
-    NSDictionary* item_json =((NSMutableArray*)self.content_data_control[indexPath.section])[indexPath.row];
-
-    NSMutableDictionary* params = [NSMutableDictionary new];
-    params[@"query_id"]=self.params[@"query_id"];
-    params[@"name"]=item_json[@"name"];
-    params[@"keyword"]=str;
-//    params[@"request_id"]
-    NSMutableDictionary* json = [RANetwork queryAutoComplete:params];
+    NSAssert(true, @"sync_loadCadidate");
+    return nil;
+//    NSIndexPath * indexPath = [self.editorTable indexPathForCell:self.editingcell];
+//    NSDictionary* item_json =((NSMutableArray*)self.content_data_control[indexPath.section])[indexPath.row];
 //
-    NSMutableArray* ret= json[@"cadedate"];
-//    if(ret==nil)
-//        ret = [NSMutableArray new];
-//    //    NSMutableArray* ret = [NSMutableArray new];
-//    //    [ret addObject:@"autocomplete"];
-//    //    [ret addObject:@"datasource"];
-//    //    [ret addObject:@"loadCadidate"];
-//    //    [ret addObject:@"does"];
-//    //    [ret addObject:@"not"];
-//    //    [ret addObject:@"impl"];
-    return ret;
+//    NSMutableDictionary* params = [NSMutableDictionary new];
+//    params[@"query_id"]=self.params[@"query_id"];
+//    params[@"name"]=item_json[@"name"];
+//    params[@"keyword"]=str;
+////    params[@"request_id"]
+//    NSMutableDictionary* json = [RANetwork queryAutoComplete:params];
+////
+//    NSMutableArray* ret= json[@"cadedate"];
+////    if(ret==nil)
+////        ret = [NSMutableArray new];
+////    //    NSMutableArray* ret = [NSMutableArray new];
+////    //    [ret addObject:@"autocomplete"];
+////    //    [ret addObject:@"datasource"];
+////    //    [ret addObject:@"loadCadidate"];
+////    //    [ret addObject:@"does"];
+////    //    [ret addObject:@"not"];
+////    //    [ret addObject:@"impl"];
+//    return ret;
 }
 @end

+ 2 - 0
RedAnt Mobile/RedAnt Mobile/config.h

@@ -34,6 +34,7 @@
 #ifdef test_server
 #define URL_CUSTOMER_ADV_SEARCH @""
 #define URL_LOGIN @""
+#define URL_LOGOUT @""
 #define URL_QUERY @""
 #define URL_QUERY_UI @""
 #define URL_QUERY_SETTIING @""
@@ -54,6 +55,7 @@
 
 #else
 #define URL_LOGIN @""
+#define URL_LOGOUT @""
 #define  URL_CREDITCARD_EDOTOR @""
 #define URL_CUSTOMER_ADV_SEARCH @""
 #define  URL_ERR_LOG  @""

+ 7 - 4
RedAnt Mobile/RedAnt Mobile/detail/OrderDetailViewController.m

@@ -17,6 +17,9 @@
 
 - (void)viewDidLoad {
     [super viewDidLoad];
+    self.params[ @"_action"]=@"ant_mobile";
+    self.params[ @"_operate"]=@"order_detail";
+    self.params[ @"_order_type"]=@"sales_order";
     // Do any additional setup after loading the view.
 }
 
@@ -35,8 +38,8 @@
 }
 */
 #pragma mark Request Editor
--(NSDictionary*)request_Editor:(NSString*) request_url params:(NSMutableDictionary*)params
-{
-    return [RANetwork require_orderdetail:request_url params:params];
-}
+//-(NSDictionary*)request_Editor:(NSString*) request_url params:(NSMutableDictionary*)params
+//{
+//    return [RANetwork require_orderdetail:request_url params:params];
+//}
 @end

+ 2 - 2
RedAnt Mobile/RedAnt Mobile/predef_query.json

@@ -21,8 +21,8 @@
                    {
                    "title": "demo title",
                    "module0": "quick_look",
-                   "module": "kv_detail",
-                   "module1": "order_detail",
+                   "module1": "kv_detail",
+                   "module": "order_detail",
                    "url": "http://1.1.1.1",
                    "params": {
                    "order#": 0

+ 2 - 1
RedAnt Mobile/RedAnt Mobile/query_setting.json

@@ -1,8 +1,9 @@
 
 {
     "result": 2,
+    "title":"DEMO query_setting",
     "section_count": 1,
-    "section_1": {
+    "section_0": {
         "count": 2,
         "title": "Setting",
         "item_0": {

+ 1 - 1
RedAnt Mobile/RedAnt Mobile/search_ui.json

@@ -2,7 +2,7 @@
     "result": 2,
     "mode": "Regular Mode",
     "section_count": 3,
-    "title": "DEMO search",
+    "title": "DEMO search_ui",
     "section_0": {
         "count": 3,
         "title": "Analysis Condition",

+ 2 - 2
Redant Drivers/Apex And Drivers/AppDelegate.m

@@ -82,7 +82,7 @@
     
 
     [self.locationManager startUpdatingLocation];
-    self.locationManager.allowsBackgroundLocationUpdates=true;
+    self.locationManager.allowsBackgroundLocationUpdates=false;
 }
 
 - (void)stopBackgroundLocation {
@@ -508,7 +508,7 @@
 //        {
 //
 //        }
-        [manager allowDeferredLocationUpdatesUntilTraveled:distance timeout:time];
+//        [manager allowDeferredLocationUpdatesUntilTraveled:distance timeout:time];
     }
 }
 - (void)locationManager:(CLLocationManager *)manager

+ 0 - 1
Redant Drivers/Apex And Drivers/Info.plist

@@ -43,7 +43,6 @@
 	<string>Display location on map and navigation</string>
 	<key>UIBackgroundModes</key>
 	<array>
-		<string>location</string>
 		<string>remote-notification</string>
 	</array>
 	<key>UILaunchStoryboardName</key>

+ 5 - 5
common/NetworkUtils.m

@@ -10,8 +10,8 @@
 #import "RAUtils.h"
 #import "Reachability.h"
 #import "RANetworkTaskDelegate.h"
-
-
+#import "common_const.h"
+#import "config.h"
 #define BOUNDARY @"AaB03x"
 
 @implementation NetworkUtils
@@ -557,7 +557,7 @@ repeat:
 
 #pragma mark new interface
 
-+(NSMutableDictionary*) prepare_addtional_params:(NSMutableDictionary* ) params
++(NSMutableDictionary*) prepare_additional_params:(NSMutableDictionary* ) params
 {
 
 //
@@ -590,7 +590,7 @@ repeat:
             return ;
         }
 
-    params = [self prepare_addtional_params:params];
+    params = [self prepare_additional_params:params];
     
 
 //repeat:
@@ -988,7 +988,7 @@ repeat:
     //        return detailContent;
             return ;
         }
-    params = [self prepare_addtional_params:params];
+    params = [self prepare_additional_params:params];
 
     NSURLSession *urlSession = [self standSession];
     

+ 2 - 1
common/RAConvertor.h

@@ -16,7 +16,8 @@
 +(NSString*) arr2string:(NSArray *) arr separator:(NSString*)separator trim:(bool) btrim;
 +(NSString*) arr2string:(NSArray *) arr separator:(NSString*)separator trim:(bool) btrim brackets:(NSString*)brackets;
 +(NSArray*) string2arr:(NSString*) string separator:(NSString*)separator;
-
++(NSData*) arr2data:(NSArray*) arr;
++(NSArray*) data2arr:(NSData*) data;
 
 +(NSData*) dict2data:(NSDictionary*) dict;
 +(NSDictionary*) data2dict:(NSData*) data;

+ 17 - 0
common/RAConvertor.m

@@ -103,6 +103,23 @@ begin:
 }
 
 
++(NSData*) arr2data:(NSArray*) arr
+{
+    if(arr==nil)
+        return nil;
+    NSData *data = [NSKeyedArchiver archivedDataWithRootObject:arr];
+    return data;
+}
+
++(NSArray*) data2arr:(NSData*) data
+{
+    if(data == nil)
+        return nil;
+    
+    NSArray *array = [NSKeyedUnarchiver unarchiveObjectWithData:data];
+    return array;
+}
+
 +(NSData*) dict2data:(NSDictionary*) dict
 {
     if(dict==nil)

+ 25 - 1
common/RAUtils.h

@@ -17,6 +17,27 @@
 //    
 //}MyTestStruct;
 
+#define DEBUGLOG 1
+
+#ifdef DEBUGLOG
+#ifdef DEBUG
+//     #define DebugLog( s, ... ) fprintf(stderr,"%s\n",[[NSString stringWithFormat:s, ##__VA_ARGS__] UTF8String])//
+#define DebugLog( s, ... ) fprintf(stderr, "<%p %s:(%d)> %s \n", self, [[[NSString stringWithUTF8String:__FILE__] lastPathComponent]UTF8String], __LINE__, [[NSString stringWithFormat:(s), ##__VA_ARGS__]UTF8String] )
+
+#define blockDebugLog( s, ... ) fprintf(stderr, "<%p %s:(%d)> %s \n",weakself, [[[NSString stringWithUTF8String:__FILE__] lastPathComponent]UTF8String], __LINE__, [[NSString stringWithFormat:(s), ##__VA_ARGS__]UTF8String] )
+
+#else
+#define DebugLog( s, ... )
+
+#define blockDebugLog( s, ... )
+#endif
+#else
+#define DebugLog( s, ... )
+
+#define blockDebugLog( s, ... )
+#endif
+
+
 NS_ASSUME_NONNULL_BEGIN
 @interface RAUtils : NSObject
 
@@ -55,13 +76,16 @@ NS_ASSUME_NONNULL_BEGIN
 //+(NSArray*) expression_varable:(NSString*)content regex:(NSString*) pattern;
 //+(NSTextCheckingResult*) expression_findfistMatch:(NSString*)content regex:(NSString*) pattern;
 +(NSData*) getdbfile:(NSString*)dbname;
-+(NSString*) getdbzip:(NSString*)dbname;
+
+// 2020-1118  去掉zip 如果以后需要用到,单独加在其他包内
+//+(NSString*) getdbzip:(NSString*)dbname;
 + (UIImage *)scaleToSize:(UIImage *)img size:(CGSize)size;
 + (CGRect)scaleToSize:(CGRect )from to:(CGSize)to;
 + (CGRect)rectAlign:(CGRect )parent rect:(CGRect)rect hAlign:(NSString*)hAlign vAlign:(NSString*)vAlign;
 + (CGRect)rectVAlign:(CGRect )parent rect:(CGRect)rect vAlign:(NSString*)vAlign;
 +(UIImage*)img_compress:(UIImage*)image kbsize:(float) size;
 +(NSString* )current_date;
++(NSString*) current_date_time;
 +(NSString*) current_date_forfile;
 +(NSMutableArray*)dictionary2array:(NSDictionary*)json count_fields:(NSString*) count_fields item_mark:(NSString*) item_mark items_mark:(NSString* _Nullable )items_mark;
 +(int)getRandomNumber:(int)from to:(int)to;

+ 40 - 28
common/RAUtils.m

@@ -7,6 +7,7 @@
 //
 
 #import "RAUtils.h"
+#import "const.h"
 //#import "LoginViewController.h"
 //#import "MainViewController.h"
 #import <sys/param.h>
@@ -16,7 +17,7 @@
 //#import "Singleton.h"
 #include <CommonCrypto/CommonDigest.h>
 
-#import "ZipArchive.h"
+//#import "ZipArchive.h"
 
 #define FileHashDefaultChunkSizeForReadingData 1024*8
 
@@ -33,33 +34,33 @@
 //    int irandom = [self getRandomNumber:0 to:5];
 //    return irandom / 100.0;
 //}
-+(NSString*) getdbzip:(NSString*)dbname
-{
-    
-    
-    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
-    NSString *documents = /*[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];*/[paths objectAtIndex:0];
-    NSString *database_path = [documents stringByAppendingPathComponent:dbname];
-    
-    
-            NSString* temp = NSTemporaryDirectory();
-    
-    NSString* uuid=[[NSUUID UUID] UUIDString];
-    
-    NSString *tempfile = [temp stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.zip",uuid]];
-    
-    ZipArchive* zip = [[ZipArchive alloc] init];
-    
-    
-    BOOL result = [zip CreateZipFile2:tempfile Password:@"usai2010"];
-    
-
-        result = [zip addFileToZip:database_path newname:[database_path lastPathComponent]];
-    return tempfile;
-    
-    
-
-}
+//+(NSString*) getdbzip:(NSString*)dbname
+//{
+//
+//
+//    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
+//    NSString *documents = /*[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];*/[paths objectAtIndex:0];
+//    NSString *database_path = [documents stringByAppendingPathComponent:dbname];
+//
+//
+//            NSString* temp = NSTemporaryDirectory();
+//
+//    NSString* uuid=[[NSUUID UUID] UUIDString];
+//
+//    NSString *tempfile = [temp stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.zip",uuid]];
+//
+//    ZipArchive* zip = [[ZipArchive alloc] init];
+//
+//
+//    BOOL result = [zip CreateZipFile2:tempfile Password:@"usai2010"];
+//
+//
+//        result = [zip addFileToZip:database_path newname:[database_path lastPathComponent]];
+//    return tempfile;
+//
+//
+//
+//}
 +(NSData*) getdbfile:(NSString*)dbname
 {
     NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
@@ -442,6 +443,17 @@
     NSString * na = [df stringFromDate:currentDate];
     return na;
 }
++(NSString*) current_date_time
+{
+    NSDate * date = [NSDate date];
+    NSTimeInterval sec = [date timeIntervalSinceNow];
+    NSDate * currentDate = [[NSDate alloc] initWithTimeIntervalSinceNow:sec];
+    
+    NSDateFormatter * df = [[NSDateFormatter alloc] init ];
+    [df setDateFormat:@"MM/dd/yyyy HH:mm:ss"];
+    NSString * na = [df stringFromDate:currentDate];
+    return na;
+}
 +(NSString*) current_date_forfile
 {
     NSDate * date = [NSDate date];

+ 33 - 0
common/Tab Based Framework/RootViewController.h

@@ -0,0 +1,33 @@
+//
+//  RootViewController.h
+//  Apex Mobile
+//
+//  Created by Ray on 25/01/2018.
+//  Copyright © 2018 United Software Applications, Inc. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import "AppDelegate.h"
+#import "const.h"
+//#import "LoginViewController.h"
+//#import "ApexMobileSecondViewController.h"
+//#import "ToolsPanelViewController.h"
+//#import "HomeViewController.h"
+//#import "ToolslistViewController.h"
+//#import "SearchlistViewController.h"
+//#import "MylistViewController.h"
+//#import "OrderHistoryViewController.h"
+
+
+@interface RootViewController : UITabBarController
+
+// login tabbar & controllers
+@property (strong,nonatomic) NSArray* login_bar;
+//@property (strong,nonatomic) NSArray* login_controller;
+
+// logout tabbar & controllers
+@property (strong,nonatomic) NSArray* logout_bar;
+//@property (strong,nonatomic) NSArray* logout_controller;
+
+- (void)setup;
+@end

+ 99 - 0
common/Tab Based Framework/RootViewController.m

@@ -0,0 +1,99 @@
+//
+//  RootViewController.m
+//  Apex Mobile
+//
+//  Created by Ray on 25/01/2018.
+//  Copyright © 2018 United Software Applications, Inc. All rights reserved.
+//
+
+#import "RootViewController.h"
+
+@interface RootViewController ()
+
+@end
+
+@implementation RootViewController
+
+- (UITabBarItem *)itemWithSelectedImage:(NSString *)selectImage image:(NSString *)image title:(NSString *)title{
+    UIImage *im = [[UIImage imageNamed:image] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
+    UITabBarItem *item = [[UITabBarItem alloc] initWithTitle:title image:im selectedImage:im];
+    
+    return item;
+}
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    
+    [self registForNotification];
+    
+    
+    self.automaticallyAdjustsScrollViewInsets = NO;
+//    self.navigationItem.navi
+//     [self.navigationController setNavigationBarHidden:YES animated:YES];
+    
+//    [UIStoryboard storyboardWithName:@"EnumSelectAndSort" bundle:nil]
+    
+    UIBarButtonItem *backItem = [[UIBarButtonItem alloc] init];
+    backItem.title = @"Back";
+    self.navigationItem.backBarButtonItem = backItem;
+
+//    tabbar 选中色
+ 
+//    self.tabBar.tintColor = [UIColor blueColor];
+//    self.tabBar.barTintColor = [UIColor blackColor];
+    
+    
+    
+    [self setup];
+}
+-(void) setup
+{
+    NSAssert(true, @"setup does not implement");
+}
+- (void)didReceiveMemoryWarning {
+    [super didReceiveMemoryWarning];
+    // Dispose of any resources that can be recreated.
+}
+
+/*
+#pragma mark - Navigation
+
+// In a storyboard-based application, you will often want to do a little preparation before navigation
+- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
+    // Get the new view controller using [segue destinationViewController].
+    // Pass the selected object to the new view controller.
+}
+*/
+
+- (void)dealloc {
+    [[NSNotificationCenter defaultCenter] removeObserver:self];
+}
+
+- (void)registForNotification {
+    
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleNotification:) name:RA_NOTIFICATION_LOGOUT object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleNotification:) name:RA_NOTIFICATION_LOGIN object:nil];
+    
+}
+
+- (void)handleNotification:(NSNotification *)notification {
+    
+    
+    NSAssert(true, @"setup does not implement");
+    
+//    AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+//    if ([notification.name isEqualToString:RA_NOTIFICATION_LOGOUT]) {
+//        
+////        [appDelegate Logout];
+////        [(LoginViewController *)self.logoutbar.firstObject clear];
+////        self.viewControllers = self.logoutbar;
+////        self.selectedIndex = 0;
+////        
+//    }
+//    else if ([notification.name isEqualToString:RA_NOTIFICATION_LOGIN])
+//    {
+//        
+//    }
+}
+
+@end

+ 59 - 0
common/common_const.h

@@ -0,0 +1,59 @@
+//
+//  common_const.h
+//  RA TradeFiling
+//
+//  Created by Rui Zhang on 11/18/20.
+//
+
+#ifndef common_const_h
+#define common_const_h
+
+#define DEBUGLOG 1
+
+#ifdef DEBUGLOG
+#ifdef DEBUG
+//     #define DebugLog( s, ... ) fprintf(stderr,"%s\n",[[NSString stringWithFormat:s, ##__VA_ARGS__] UTF8String])//
+#define DebugLog( s, ... ) fprintf(stderr, "<%p %s:(%d)> %s \n", self, [[[NSString stringWithUTF8String:__FILE__] lastPathComponent]UTF8String], __LINE__, [[NSString stringWithFormat:(s), ##__VA_ARGS__]UTF8String] )
+
+#define blockDebugLog( s, ... ) fprintf(stderr, "<%p %s:(%d)> %s \n",weakself, [[[NSString stringWithUTF8String:__FILE__] lastPathComponent]UTF8String], __LINE__, [[NSString stringWithFormat:(s), ##__VA_ARGS__]UTF8String] )
+
+#else
+#define DebugLog( s, ... )
+
+#define blockDebugLog( s, ... )
+#endif
+#else
+#define DebugLog( s, ... )
+
+#define blockDebugLog( s, ... )
+#endif
+
+#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
+#define UIColorFromRGBAlpha(rgbValue,alp) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:(alp)]
+
+// 接口json 的result值
+#define RESULT_NO_RESPONSE -1024
+#define RESULT_NET_ERROR             -3
+#define RESULT_NET_NOTAVAILABLE          -4
+#define RESULT_ERROR                 -5
+#define RESULT_LOCALFILE_ERROR             -7
+#define RESULT_USERAUTH_ERROR             -9
+#define RESULT_VER_LOW                   -15
+#define RESULT_FALSE 0
+#define RESULT_TRUE         2
+#define RESULT_TIMEOUT                   99
+
+
+
+// 对应接口状态的部分message
+#define MSG_NET_NOTAVAILABLE @"No available network, please check your network setting."
+#define MSG_NET_ERROR @"Net Error. Cannot connect to server for now. Please retry later."
+#define MSG_USERAUTH_ERROR @"Username or password is incorrect.Please check."
+#define MSG_VER_LOW @"Current App version is out of date, please update to the latest version."
+#define MSG_ERROR @"Connection failed with Server, please email your IT Admin."//@"Some error occured on server."
+#define MSG_SUCCESS @"Success."
+#define MSG_LOGIN_DEVICE @"You are currently signed in on another device. Please check."
+#define MSG_TIMEOUT @"Request timeout."
+
+
+#endif /* common_const_h */