Преглед изворни кода

ra image 1.16 添加 receiving-palletid

Ray Zhang пре 5 година
родитељ
комит
36148b9453

+ 29 - 11
RA Image/RA Image.xcodeproj/project.pbxproj

@@ -8,6 +8,8 @@
 
 /* Begin PBXBuildFile section */
 		3C9CCF4A247E4B07006A49A5 /* UIImage+RedAnt.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C9CCF48247E4B07006A49A5 /* UIImage+RedAnt.m */; };
+		3CBE7AE425469D9E000D520B /* ReceivingPalletIDViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CBE7AE325469D9E000D520B /* ReceivingPalletIDViewController.m */; };
+		3CD0EDFE2541BB5C00BDA788 /* RAUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CD0EDFD2541BB5C00BDA788 /* RAUtils.m */; };
 		4203E5FD21BA5E88003E90BD /* QRCode.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4203E5F321BA5E88003E90BD /* QRCode.storyboard */; };
 		4203E5FE21BA5E88003E90BD /* RAQRCodeScannerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4203E5F521BA5E88003E90BD /* RAQRCodeScannerViewController.m */; };
 		4203E5FF21BA5E88003E90BD /* Camera.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4203E5F721BA5E88003E90BD /* Camera.storyboard */; };
@@ -56,7 +58,6 @@
 		42E1B1081EB1D9B100EEF27C /* LoginSettingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 42E1B1071EB1D9B100EEF27C /* LoginSettingViewController.m */; };
 		71114A9D1EB1BCB400D2200C /* LoginViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71114A9C1EB1BCB400D2200C /* LoginViewController.m */; };
 		71114AA31EB1C40900D2200C /* RANetwork.m in Sources */ = {isa = PBXBuildFile; fileRef = 71114AA21EB1C40900D2200C /* RANetwork.m */; };
-		71114AA61EB1C50D00D2200C /* RAUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 71114AA51EB1C50D00D2200C /* RAUtils.m */; };
 		71114AB21EB1C5C800D2200C /* AESCrypt.m in Sources */ = {isa = PBXBuildFile; fileRef = 71114AAA1EB1C5C800D2200C /* AESCrypt.m */; };
 		71114AB31EB1C5C800D2200C /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = 71114AAB1EB1C5C800D2200C /* LICENSE */; };
 		71114AB41EB1C5C800D2200C /* NSData+Base64.m in Sources */ = {isa = PBXBuildFile; fileRef = 71114AAD1EB1C5C800D2200C /* NSData+Base64.m */; };
@@ -94,6 +95,10 @@
 /* Begin PBXFileReference section */
 		3C9CCF48247E4B07006A49A5 /* UIImage+RedAnt.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIImage+RedAnt.m"; path = "../../common/UIImage/UIImage+RedAnt.m"; sourceTree = "<group>"; };
 		3C9CCF49247E4B07006A49A5 /* UIImage+RedAnt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIImage+RedAnt.h"; path = "../../common/UIImage/UIImage+RedAnt.h"; sourceTree = "<group>"; };
+		3CBE7AE225469D9E000D520B /* ReceivingPalletIDViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ReceivingPalletIDViewController.h; sourceTree = "<group>"; };
+		3CBE7AE325469D9E000D520B /* ReceivingPalletIDViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ReceivingPalletIDViewController.m; sourceTree = "<group>"; };
+		3CD0EDFC2541BB5C00BDA788 /* RAUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RAUtils.h; path = ../../common/RAUtils.h; sourceTree = "<group>"; };
+		3CD0EDFD2541BB5C00BDA788 /* RAUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RAUtils.m; path = ../../common/RAUtils.m; sourceTree = "<group>"; };
 		4203E5F321BA5E88003E90BD /* QRCode.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = QRCode.storyboard; sourceTree = "<group>"; };
 		4203E5F421BA5E88003E90BD /* RAQRCodeScannerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RAQRCodeScannerViewController.h; sourceTree = "<group>"; };
 		4203E5F521BA5E88003E90BD /* RAQRCodeScannerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RAQRCodeScannerViewController.m; sourceTree = "<group>"; };
@@ -179,8 +184,6 @@
 		71114A9C1EB1BCB400D2200C /* LoginViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LoginViewController.m; sourceTree = "<group>"; };
 		71114AA11EB1C40900D2200C /* RANetwork.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RANetwork.h; sourceTree = "<group>"; };
 		71114AA21EB1C40900D2200C /* RANetwork.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RANetwork.m; sourceTree = "<group>"; };
-		71114AA41EB1C50D00D2200C /* RAUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RAUtils.h; path = "../../RedAnt ERP Mobile/common/RAUtils.h"; sourceTree = "<group>"; };
-		71114AA51EB1C50D00D2200C /* RAUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RAUtils.m; path = "../../RedAnt ERP Mobile/common/RAUtils.m"; sourceTree = "<group>"; };
 		71114AA91EB1C5C800D2200C /* AESCrypt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AESCrypt.h; path = "../../RedAnt ERP Mobile/common/AES/AESCrypt.h"; sourceTree = "<group>"; };
 		71114AAA1EB1C5C800D2200C /* AESCrypt.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AESCrypt.m; path = "../../RedAnt ERP Mobile/common/AES/AESCrypt.m"; sourceTree = "<group>"; };
 		71114AAB1EB1C5C800D2200C /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = LICENSE; path = "../../RedAnt ERP Mobile/common/AES/LICENSE"; sourceTree = "<group>"; };
@@ -257,6 +260,15 @@
 /* End PBXFrameworksBuildPhase section */
 
 /* Begin PBXGroup section */
+		3CBE7AE125469D36000D520B /* Receiving */ = {
+			isa = PBXGroup;
+			children = (
+				3CBE7AE225469D9E000D520B /* ReceivingPalletIDViewController.h */,
+				3CBE7AE325469D9E000D520B /* ReceivingPalletIDViewController.m */,
+			);
+			name = Receiving;
+			sourceTree = "<group>";
+		};
 		4203E5F221BA5E88003E90BD /* QRCode */ = {
 			isa = PBXGroup;
 			children = (
@@ -566,8 +578,6 @@
 				42056E7B1EB989AB0010597A /* KeyboardListener */,
 				71114AB91EB1C71E00D2200C /* zip */,
 				71114AA81EB1C5C000D2200C /* aes */,
-				71114AA41EB1C50D00D2200C /* RAUtils.h */,
-				71114AA51EB1C50D00D2200C /* RAUtils.m */,
 				71114ACD1EB1C79300D2200C /* Reachability.h */,
 				71114ACE1EB1C79300D2200C /* Reachability.m */,
 				42D64CBF1FD12B20003F49F9 /* RAConvertor.h */,
@@ -581,6 +591,8 @@
 		71114AA81EB1C5C000D2200C /* aes */ = {
 			isa = PBXGroup;
 			children = (
+				3CD0EDFC2541BB5C00BDA788 /* RAUtils.h */,
+				3CD0EDFD2541BB5C00BDA788 /* RAUtils.m */,
 				71114AA91EB1C5C800D2200C /* AESCrypt.h */,
 				71114AAA1EB1C5C800D2200C /* AESCrypt.m */,
 				71114AAB1EB1C5C800D2200C /* LICENSE */,
@@ -700,6 +712,7 @@
 		71DCDC4E1EAF34F800BA045A /* modes */ = {
 			isa = PBXGroup;
 			children = (
+				3CBE7AE125469D36000D520B /* Receiving */,
 				71DCDC4F1EAF353000BA045A /* modelist.json */,
 				426E6B281EB8720400942BE1 /* Mode.storyboard */,
 				429F25201EC9AA4200C22ABB /* TakePhotoPreviewController.h */,
@@ -739,7 +752,7 @@
 		71DCDC2C1EAF234E00BA045A /* Project object */ = {
 			isa = PBXProject;
 			attributes = {
-				LastUpgradeCheck = 1150;
+				LastUpgradeCheck = 1210;
 				ORGANIZATIONNAME = USAI;
 				TargetAttributes = {
 					71DCDC331EAF234E00BA045A = {
@@ -832,15 +845,16 @@
 				71114AA31EB1C40900D2200C /* RANetwork.m in Sources */,
 				71114AC91EB1C73B00D2200C /* zip.c in Sources */,
 				428566D81EF122360041208A /* RAImagePhotoPreviewCell.m in Sources */,
+				3CD0EDFE2541BB5C00BDA788 /* RAUtils.m in Sources */,
 				71114AF31EB2DEF900D2200C /* SCShapeView.m in Sources */,
 				71961CB11EC00DDD002C4096 /* RAUploadManager.m in Sources */,
+				3CBE7AE425469D9E000D520B /* ReceivingPalletIDViewController.m in Sources */,
 				71114AF21EB2DEF900D2200C /* ScannerViewController.m in Sources */,
 				717A37AE1ED6BF0700E09FB6 /* ImageUtils.m in Sources */,
 				42BC2D091EBAC75F0016B30D /* TouchImageView.m in Sources */,
 				42A829C31EBC0F8300898B8A /* ManufacturerListController.m in Sources */,
 				4203E5FE21BA5E88003E90BD /* RAQRCodeScannerViewController.m in Sources */,
 				71114AB61EB1C5C800D2200C /* NSString+Base64.m in Sources */,
-				71114AA61EB1C50D00D2200C /* RAUtils.m in Sources */,
 				71749AFD1ECC199300018EEC /* UIImage+fixOrientation.m in Sources */,
 				4203E60221BA5E88003E90BD /* RATakePhotoPreviewController.m in Sources */,
 				71DCDC3C1EAF234E00BA045A /* AppDelegate.m in Sources */,
@@ -913,6 +927,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;
@@ -937,7 +952,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;
@@ -970,6 +985,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;
@@ -988,7 +1004,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;
@@ -1002,8 +1018,9 @@
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				DEVELOPMENT_TEAM = HXWLAA5YN5;
 				INFOPLIST_FILE = "RA Image/Info.plist";
-				IPHONEOS_DEPLOYMENT_TARGET = 9.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+				MARKETING_VERSION = 1.16;
 				PRODUCT_BUNDLE_IDENTIFIER = "usai.redant.RA-Image";
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE_SPECIFIER = "";
@@ -1017,8 +1034,9 @@
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				DEVELOPMENT_TEAM = HXWLAA5YN5;
 				INFOPLIST_FILE = "RA Image/Info.plist";
-				IPHONEOS_DEPLOYMENT_TARGET = 9.0;
+				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+				MARKETING_VERSION = 1.16;
 				PRODUCT_BUNDLE_IDENTIFIER = "usai.redant.RA-Image";
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PROVISIONING_PROFILE_SPECIFIER = "";

+ 110 - 57
RA Image/RA Image/BasicModeViewController.m

@@ -690,65 +690,118 @@
     NSString* title=[@"Verify " stringByAppendingString:self.barcodeTitle];
     
     __block UIAlertController* alertc = [RAUtils waiting_alert:self title:title completion:^{
-        dispatch_async(dispatch_get_global_queue(0, 0), ^{
-            //    if (weakself) {
-        //            __strong typeof(weakself) strongself = weakself;
-                    NSDictionary *result_json = [RANetwork Verify:params];
-                    dispatch_async(dispatch_get_main_queue(), ^{
-//                        [alert dismissWithClickedButtonIndex:0 animated:YES];
-                        [alertc dismissViewControllerAnimated:YES completion:^{
-                            int result = [[result_json objectForKey:@"result"] intValue];
-                            //                BOOL rememberLogin = [[strongself userDefaultsValue:kRememberLogin] boolValue];
-                            //                [self addTasks];
-                            //                return;
-                                            switch (result) {
-                                                case 0:
-                                                {
-                                                    //code not exist;
-                                                    
-                                                    [RAUtils message_alert:weakself.verify_msg0 title:@"Warring" controller:weakself];
-                            //                            [weakself.view makeToast:weakself.verify_msg0 duration:3.0 position:CSToastPositionCenter];
-                                                    break;
-                                                }
-                                                case 1:
-                                                {
-                                                    
-                                                    [RAUtils message_alert:@"Model/Manufacturer does not match" title:@"Warring" controller:weakself];
-                            //                                                    [weakself.view makeToast:@"Model/Manufacturer does not match" duration:3.0 position:CSToastPositionCenter];
-                                                    break;
-                                                }
-                                                case 2:
-                                                {
-                                                    //upload;
-                                                    [self addTasks];
-                                                    break;
-                                                }
-                                                case RESULT_NET_ERROR:
-                                                {
-                                                    __weak typeof(self) weakSelf = self;
-                                                    UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"Warning" message:@"Can not connect to server,still upload?" preferredStyle:UIAlertControllerStyleAlert];
-                                                    UIAlertAction *yesAction = [UIAlertAction actionWithTitle:@"Yes" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
-                                                        [weakSelf addTasks];
-                                                    }];
-                                                    
-                                                    UIAlertAction *noAction = [UIAlertAction actionWithTitle:@"No" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
-                                                        
-                                                    }];
-                                                    [alertVC addAction:yesAction];
-                                                    [alertVC addAction:noAction];
-                                                    [self presentViewController:alertVC animated:yesAction completion:nil];
-                                                    
-                                                }
-                                                default:
-                                                    break;
-                                            }
+        [RANetwork request_verify:params completionHandler:^(NSMutableDictionary *result_json) {
+            //                        [alert dismissWithClickedButtonIndex:0 animated:YES];
+            [alertc dismissViewControllerAnimated:YES completion:^{
+                int result = [[result_json objectForKey:@"result"] intValue];
+                //                BOOL rememberLogin = [[strongself userDefaultsValue:kRememberLogin] boolValue];
+                //                [self addTasks];
+                //                return;
+                switch (result) {
+                    case 0:
+                    {
+                        //code not exist;
+                        
+                        [RAUtils message_alert:weakself.verify_msg0 title:@"Warring" controller:weakself];
+                        //                            [weakself.view makeToast:weakself.verify_msg0 duration:3.0 position:CSToastPositionCenter];
+                        break;
+                    }
+                    case 1:
+                    {
+                        
+                        [RAUtils message_alert:@"Model/Manufacturer does not match" title:@"Warring" controller:weakself];
+                        //                                                    [weakself.view makeToast:@"Model/Manufacturer does not match" duration:3.0 position:CSToastPositionCenter];
+                        break;
+                    }
+                    case 2:
+                    {
+                        //upload;
+                        [self addTasks];
+                        break;
+                    }
+                    case RESULT_NET_ERROR:
+                    {
+                        __weak typeof(self) weakSelf = self;
+                        UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"Warning" message:@"Can not connect to server,still upload?" preferredStyle:UIAlertControllerStyleAlert];
+                        UIAlertAction *yesAction = [UIAlertAction actionWithTitle:@"Yes" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+                            [weakSelf addTasks];
                         }];
                         
-                       
-                    });
-                    
-              //  }
-            });
+                        UIAlertAction *noAction = [UIAlertAction actionWithTitle:@"No" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
+                            
+                        }];
+                        [alertVC addAction:yesAction];
+                        [alertVC addAction:noAction];
+                        [self presentViewController:alertVC animated:yesAction completion:nil];
+                        
+                    }
+                    default:
+                        break;
+                }
+            }];
+            
+            
+        }];
+        
+//        dispatch_async(dispatch_get_global_queue(0, 0), ^{
+//            //    if (weakself) {
+//        //            __strong typeof(weakself) strongself = weakself;
+//                    NSDictionary *result_json = [RANetwork Verify:params];
+//                    dispatch_async(dispatch_get_main_queue(), ^{
+////                        [alert dismissWithClickedButtonIndex:0 animated:YES];
+//                        [alertc dismissViewControllerAnimated:YES completion:^{
+//                            int result = [[result_json objectForKey:@"result"] intValue];
+//                            //                BOOL rememberLogin = [[strongself userDefaultsValue:kRememberLogin] boolValue];
+//                            //                [self addTasks];
+//                            //                return;
+//                                            switch (result) {
+//                                                case 0:
+//                                                {
+//                                                    //code not exist;
+//
+//                                                    [RAUtils message_alert:weakself.verify_msg0 title:@"Warring" controller:weakself];
+//                            //                            [weakself.view makeToast:weakself.verify_msg0 duration:3.0 position:CSToastPositionCenter];
+//                                                    break;
+//                                                }
+//                                                case 1:
+//                                                {
+//
+//                                                    [RAUtils message_alert:@"Model/Manufacturer does not match" title:@"Warring" controller:weakself];
+//                            //                                                    [weakself.view makeToast:@"Model/Manufacturer does not match" duration:3.0 position:CSToastPositionCenter];
+//                                                    break;
+//                                                }
+//                                                case 2:
+//                                                {
+//                                                    //upload;
+//                                                    [self addTasks];
+//                                                    break;
+//                                                }
+//                                                case RESULT_NET_ERROR:
+//                                                {
+//                                                    __weak typeof(self) weakSelf = self;
+//                                                    UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"Warning" message:@"Can not connect to server,still upload?" preferredStyle:UIAlertControllerStyleAlert];
+//                                                    UIAlertAction *yesAction = [UIAlertAction actionWithTitle:@"Yes" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+//                                                        [weakSelf addTasks];
+//                                                    }];
+//
+//                                                    UIAlertAction *noAction = [UIAlertAction actionWithTitle:@"No" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
+//
+//                                                    }];
+//                                                    [alertVC addAction:yesAction];
+//                                                    [alertVC addAction:noAction];
+//                                                    [self presentViewController:alertVC animated:yesAction completion:nil];
+//
+//                                                }
+//                                                default:
+//                                                    break;
+//                                            }
+//                        }];
+//
+//
+//                    });
+//
+//              //  }
+//            });
     }];
 //    UIAlertView *alert = [RAUtils waiting_alert:@"Please wait" title:title];
     

+ 1 - 1
RA Image/RA Image/Info.plist

@@ -15,7 +15,7 @@
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
-	<string>1.11</string>
+	<string>$(MARKETING_VERSION)</string>
 	<key>CFBundleVersion</key>
 	<string>39906</string>
 	<key>LSRequiresIPhoneOS</key>

+ 65 - 35
RA Image/RA Image/LoginViewController.m

@@ -211,44 +211,74 @@ static NSString *kLoginUserInfo = @"UserInfo";
     }
     AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
     appDelegate.address = self.address;
-    __weak typeof(self) weakself = self;
+//    __weak typeof(self) weakself = self;
     
 //    UIAlertView *alert = [RAUtils waiting_alert:@"Please wait" title:@"Login"];
    __block UIAlertController* alert = [RAUtils waiting_alert:self title:@"Login" completion:^{
-        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];
-                    
-                    [alert dismissViewControllerAnimated:YES completion:^{
-                        int result = [[loginDic objectForKey:@"result"] intValue];
-                        BOOL rememberLogin = [[strongself userDefaultsValue:kRememberLogin] boolValue];
-                        if (result == RESULT_TRUE) {
-                            if (!rememberLogin) {
-                                [self setUserDefaultsValue:nil forKey:kLoginUserInfo];
-                            } else {
-                                [strongself setUserDefaultsValue:@{@"address" : strongself.address,@"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];
-                        }
-                    }];
-                    
-                    
-                });
-
-            }
-        });
+       
+       [RANetwork request_login:self.user password:self.pwd completionHandler:^(NSMutableDictionary *result) {
+       //                    [alert dismissWithClickedButtonIndex:0 animated:YES];
+                           
+                           [alert dismissViewControllerAnimated:YES completion:^{
+                               int result_code = [[result objectForKey:@"result"] intValue];
+                               BOOL rememberLogin = [[self userDefaultsValue:kRememberLogin] boolValue];
+                               if (result_code == RESULT_TRUE) {
+                                   if (!rememberLogin) {
+                                       [self setUserDefaultsValue:nil forKey:kLoginUserInfo];
+                                   } else {
+                                       [self setUserDefaultsValue:@{@"address" : self.address,@"user" : self.user,@"pwd" : self.pwd} forKey:kLoginUserInfo];
+                                   }
+                                   appDelegate.bLogin = YES;
+                                   appDelegate.user = self.user;
+                                   appDelegate.password = self.pwd;
+                                   appDelegate.companyName = [result objectForKey:@"company_name"];
+                                   [appDelegate loadCompanyIcon:[result objectForKey:@"company_icon"]];
+                                   appDelegate.modeList = [result objectForKey:@"modellist"];
+                                   [appDelegate showNormalRootVC];
+                               } else {
+                                   NSString *msg = [result objectForKey:@"err_msg"];
+                                   [RAUtils message_alert:msg title:@"Warning" controller:self];
+                               }
+                           }];
+                           
+                           
+                       }];
+       
+       
+//        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];
+//
+//                    [alert dismissViewControllerAnimated:YES completion:^{
+//                        int result = [[loginDic objectForKey:@"result"] intValue];
+//                        BOOL rememberLogin = [[strongself userDefaultsValue:kRememberLogin] boolValue];
+//                        if (result == RESULT_TRUE) {
+//                            if (!rememberLogin) {
+//                                [self setUserDefaultsValue:nil forKey:kLoginUserInfo];
+//                            } else {
+//                                [strongself setUserDefaultsValue:@{@"address" : strongself.address,@"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];
+//                        }
+//                    }];
+//
+//
+//                });
+//
+//            }
+//        });
     }];
     
 }

+ 346 - 27
RA Image/RA Image/Mode.storyboard

@@ -1,14 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12120" systemVersion="16A323" 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.Storyboard.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="12088"/>
-        <capability name="Alignment constraints to the first baseline" minToolsVersion="6.0"/>
-        <capability name="Alignment constraints with different attributes" minToolsVersion="5.1"/>
-        <capability name="Constraints to layout margins" minToolsVersion="6.0"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17126"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <scenes>
@@ -24,8 +19,8 @@
                         <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
-                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="tx6-Jq-V78">
-                                <rect key="frame" x="47.5" y="50" width="280" height="280"/>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="tx6-Jq-V78">
+                                <rect key="frame" x="47.5" y="30" width="280" height="280"/>
                                 <constraints>
                                     <constraint firstAttribute="height" constant="280" id="0HU-zi-itA"/>
                                     <constraint firstAttribute="width" constant="200" id="CRQ-nA-AMT"/>
@@ -68,7 +63,7 @@
                                     <action selector="imgBtnClick:" destination="K9i-vs-efO" eventType="touchUpInside" id="0xC-AA-qah"/>
                                 </connections>
                             </button>
-                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="6jr-Xw-2tL">
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="6jr-Xw-2tL">
                                 <rect key="frame" x="47.5" y="560" width="60" height="60"/>
                                 <constraints>
                                     <constraint firstAttribute="width" constant="60" id="K6W-Tz-wcn"/>
@@ -93,7 +88,7 @@
                                     <action selector="scanBtnClick:" destination="K9i-vs-efO" eventType="touchUpInside" id="1iv-fR-oCn"/>
                                 </connections>
                             </button>
-                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="NAz-nK-Hgz">
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="NAz-nK-Hgz">
                                 <rect key="frame" x="157.5" y="560" width="60" height="60"/>
                                 <constraints>
                                     <constraint firstAttribute="height" constant="60" id="o6H-g4-n4a"/>
@@ -104,13 +99,13 @@
                                 </connections>
                             </button>
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="PIID:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7rM-i2-eHr">
-                                <rect key="frame" x="47.5" y="353" width="280" height="27"/>
+                                <rect key="frame" x="47.5" y="333" width="280" height="27"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                 <nil key="textColor"/>
                                 <nil key="highlightedColor"/>
                             </label>
                             <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Rvg-OG-bQ0">
-                                <rect key="frame" x="297.5" y="353" width="30" height="27"/>
+                                <rect key="frame" x="297.5" y="333" width="30" height="27"/>
                                 <constraints>
                                     <constraint firstAttribute="width" constant="30" id="ART-XN-Nuf"/>
                                 </constraints>
@@ -122,7 +117,7 @@
                                     <action selector="typeBtnClick:" destination="K9i-vs-efO" eventType="touchUpInside" id="NoL-VF-6k9"/>
                                 </connections>
                             </button>
-                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="jte-R6-noU">
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="jte-R6-noU">
                                 <rect key="frame" x="267.5" y="560" width="60" height="60"/>
                                 <state key="normal" backgroundImage="upload"/>
                                 <connections>
@@ -130,7 +125,7 @@
                                 </connections>
                             </button>
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="No Photos" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="m3e-vD-xep">
-                                <rect key="frame" x="47.5" y="310" width="280" height="20"/>
+                                <rect key="frame" x="47.5" y="290" width="280" height="20"/>
                                 <constraints>
                                     <constraint firstAttribute="height" constant="20" id="mgg-Dx-4kA"/>
                                 </constraints>
@@ -336,8 +331,8 @@
                         <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
-                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="i3W-S0-nip">
-                                <rect key="frame" x="47.5" y="70" width="280" height="280"/>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="i3W-S0-nip">
+                                <rect key="frame" x="47.5" y="50" width="280" height="280"/>
                                 <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
                                 <constraints>
                                     <constraint firstAttribute="height" constant="200" id="P4F-3c-O90"/>
@@ -424,8 +419,8 @@
                                     <action selector="uploadBtnClick:" destination="7Iz-ry-1hB" eventType="touchUpInside" id="Iqc-0G-ztp"/>
                                 </connections>
                             </button>
-                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="tailTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="gY5-Tk-ev9">
-                                <rect key="frame" x="47" y="32" width="280" height="30"/>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="tailTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="gY5-Tk-ev9">
+                                <rect key="frame" x="47.5" y="12" width="280" height="30"/>
                                 <constraints>
                                     <constraint firstAttribute="height" constant="30" id="swK-1l-5tG"/>
                                 </constraints>
@@ -435,7 +430,7 @@
                                 </connections>
                             </button>
                             <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" keyboardDismissMode="interactive" text="Note:" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="ZS1-pc-kXu">
-                                <rect key="frame" x="47.5" y="396" width="280" height="181"/>
+                                <rect key="frame" x="47.5" y="376" width="280" height="201"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="14"/>
                                 <textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
                                 <connections>
@@ -443,13 +438,13 @@
                                 </connections>
                             </textView>
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Model:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="RZK-hh-toU">
-                                <rect key="frame" x="47.5" y="360" width="280" height="27"/>
+                                <rect key="frame" x="47.5" y="340" width="280" height="27"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                 <nil key="textColor"/>
                                 <nil key="highlightedColor"/>
                             </label>
                             <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="A3O-9b-0D7">
-                                <rect key="frame" x="297.5" y="360" width="30" height="27"/>
+                                <rect key="frame" x="297.5" y="340" width="30" height="27"/>
                                 <constraints>
                                     <constraint firstAttribute="width" constant="30" id="gjf-JE-DIU"/>
                                 </constraints>
@@ -462,7 +457,7 @@
                                 </connections>
                             </button>
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="No Photos" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="JAw-ik-fYD">
-                                <rect key="frame" x="47.5" y="330" width="280" height="20"/>
+                                <rect key="frame" x="47.5" y="310" width="280" height="20"/>
                                 <constraints>
                                     <constraint firstAttribute="height" constant="20" id="gr4-N2-NFP"/>
                                 </constraints>
@@ -734,7 +729,7 @@
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
                             <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="l46-Cv-WLh">
-                                <rect key="frame" x="0.0" y="20" width="375" height="647"/>
+                                <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
                                 <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                                 <prototypes>
                                     <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="ManufacturerCell" id="Scm-6H-13W" customClass="ManufacturerCell">
@@ -745,8 +740,7 @@
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="Manufacturer" borderStyle="roundedRect" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="NYL-AQ-1Xx">
-                                                    <rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
-                                                    <nil key="textColor"/>
+                                                    <rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="15"/>
                                                     <textInputTraits key="textInputTraits"/>
                                                 </textField>
@@ -866,6 +860,331 @@
             </objects>
             <point key="canvasLocation" x="2557.5999999999999" y="243.32833583208398"/>
         </scene>
+        <!--Receiving PalletID View Controller-->
+        <scene sceneID="5mW-OL-MSN">
+            <objects>
+                <viewController storyboardIdentifier="ReceivingPalletIDViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="WLx-Jq-mzn" customClass="ReceivingPalletIDViewController" sceneMemberID="viewController">
+                    <layoutGuides>
+                        <viewControllerLayoutGuide type="top" id="DsB-BP-B4H"/>
+                        <viewControllerLayoutGuide type="bottom" id="hHA-gX-oZi"/>
+                    </layoutGuides>
+                    <view key="view" contentMode="scaleToFill" id="bCQ-uW-IAl">
+                        <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <subviews>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="dRN-mO-3vM">
+                                <rect key="frame" x="47.5" y="30" width="280" height="280"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="280" id="Aju-N4-4mk"/>
+                                    <constraint firstAttribute="width" constant="200" id="Hnq-XD-Vua"/>
+                                    <constraint firstAttribute="width" constant="300" id="Pe2-Tg-s5c"/>
+                                    <constraint firstAttribute="height" constant="300" id="RX7-9a-OZn"/>
+                                    <constraint firstAttribute="height" constant="280" id="qDC-lB-D6y"/>
+                                    <constraint firstAttribute="height" constant="200" id="urA-kU-EvO"/>
+                                </constraints>
+                                <variation key="default">
+                                    <mask key="constraints">
+                                        <exclude reference="Aju-N4-4mk"/>
+                                        <exclude reference="Hnq-XD-Vua"/>
+                                        <exclude reference="Pe2-Tg-s5c"/>
+                                        <exclude reference="RX7-9a-OZn"/>
+                                        <exclude reference="qDC-lB-D6y"/>
+                                        <exclude reference="urA-kU-EvO"/>
+                                    </mask>
+                                </variation>
+                                <variation key="heightClass=compact-widthClass=compact">
+                                    <mask key="constraints">
+                                        <include reference="Hnq-XD-Vua"/>
+                                        <include reference="urA-kU-EvO"/>
+                                    </mask>
+                                </variation>
+                                <variation key="heightClass=compact-widthClass=regular">
+                                    <mask key="constraints">
+                                        <include reference="Pe2-Tg-s5c"/>
+                                        <include reference="RX7-9a-OZn"/>
+                                    </mask>
+                                </variation>
+                                <variation key="heightClass=regular-widthClass=compact">
+                                    <mask key="constraints">
+                                        <include reference="Aju-N4-4mk"/>
+                                        <exclude reference="Hnq-XD-Vua"/>
+                                        <include reference="qDC-lB-D6y"/>
+                                        <exclude reference="urA-kU-EvO"/>
+                                    </mask>
+                                </variation>
+                                <connections>
+                                    <action selector="imgBtnClick:" destination="WLx-Jq-mzn" eventType="touchUpInside" id="xhA-bO-egh"/>
+                                </connections>
+                            </button>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="3cA-CO-ZLQ">
+                                <rect key="frame" x="47.5" y="560" width="60" height="60"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="60" id="MwV-bj-Hxs"/>
+                                </constraints>
+                                <state key="normal" backgroundImage="scan"/>
+                                <variation key="default">
+                                    <mask key="constraints">
+                                        <exclude reference="MwV-bj-Hxs"/>
+                                    </mask>
+                                </variation>
+                                <variation key="heightClass=compact-widthClass=compact">
+                                    <mask key="constraints">
+                                        <include reference="MwV-bj-Hxs"/>
+                                    </mask>
+                                </variation>
+                                <variation key="heightClass=regular-widthClass=compact">
+                                    <mask key="constraints">
+                                        <include reference="MwV-bj-Hxs"/>
+                                    </mask>
+                                </variation>
+                                <connections>
+                                    <action selector="scanBtnClick:" destination="WLx-Jq-mzn" eventType="touchUpInside" id="PxN-Au-XsU"/>
+                                </connections>
+                            </button>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="MNR-Fn-jzo">
+                                <rect key="frame" x="157.5" y="560" width="60" height="60"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="60" id="3dX-J3-8Fj"/>
+                                </constraints>
+                                <state key="normal" backgroundImage="camera"/>
+                                <connections>
+                                    <action selector="cameraBtnClick:" destination="WLx-Jq-mzn" eventType="touchUpInside" id="QQm-0T-Ken"/>
+                                </connections>
+                            </button>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="PalletID:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="f0j-Hn-HoR">
+                                <rect key="frame" x="47.5" y="333" width="280" height="27"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                <nil key="textColor"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="6v2-xf-Mlq">
+                                <rect key="frame" x="297.5" y="333" width="30" height="27"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="30" id="EsY-VJ-dlt"/>
+                                </constraints>
+                                <fontDescription key="fontDescription" type="system" pointSize="12"/>
+                                <state key="normal" title="Type">
+                                    <color key="titleColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                </state>
+                                <connections>
+                                    <action selector="typeBtnClick:" destination="WLx-Jq-mzn" eventType="touchUpInside" id="1ug-18-yKA"/>
+                                </connections>
+                            </button>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="VrG-fi-tpQ">
+                                <rect key="frame" x="267.5" y="560" width="60" height="60"/>
+                                <state key="normal" backgroundImage="upload"/>
+                                <connections>
+                                    <action selector="uploadBtnClick:" destination="WLx-Jq-mzn" eventType="touchUpInside" id="cbu-Si-UNE"/>
+                                </connections>
+                            </button>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="No Photos" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5E0-My-HAt">
+                                <rect key="frame" x="47.5" y="290" width="280" height="20"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="20" id="jKl-ec-MOH"/>
+                                </constraints>
+                                <fontDescription key="fontDescription" type="system" pointSize="16"/>
+                                <color key="textColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="calibratedRGB"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                            <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" keyboardDismissMode="interactive" text="Reference:" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="Oc8-aY-oLa">
+                                <rect key="frame" x="47.5" y="369" width="280" height="181"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                                <textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
+                                <connections>
+                                    <outlet property="delegate" destination="WLx-Jq-mzn" id="FiI-8O-had"/>
+                                </connections>
+                            </textView>
+                        </subviews>
+                        <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                        <constraints>
+                            <constraint firstItem="MNR-Fn-jzo" firstAttribute="bottom" secondItem="3cA-CO-ZLQ" secondAttribute="bottom" id="0Ip-DY-emB"/>
+                            <constraint firstItem="VrG-fi-tpQ" firstAttribute="height" secondItem="MNR-Fn-jzo" secondAttribute="height" id="1h2-ad-imy"/>
+                            <constraint firstItem="MNR-Fn-jzo" firstAttribute="width" secondItem="3cA-CO-ZLQ" secondAttribute="width" id="2ob-Vw-oAF"/>
+                            <constraint firstItem="dRN-mO-3vM" firstAttribute="centerY" secondItem="bCQ-uW-IAl" secondAttribute="centerY" id="38e-bn-FiW"/>
+                            <constraint firstItem="VrG-fi-tpQ" firstAttribute="trailing" secondItem="dRN-mO-3vM" secondAttribute="trailing" id="3De-mR-QbH"/>
+                            <constraint firstItem="VrG-fi-tpQ" firstAttribute="bottom" secondItem="MNR-Fn-jzo" secondAttribute="bottom" id="3Om-qn-3RT"/>
+                            <constraint firstItem="6v2-xf-Mlq" firstAttribute="centerY" secondItem="f0j-Hn-HoR" secondAttribute="centerY" id="3wM-B7-KMm"/>
+                            <constraint firstItem="VrG-fi-tpQ" firstAttribute="trailing" secondItem="f0j-Hn-HoR" secondAttribute="trailing" id="4f8-bi-dlI"/>
+                            <constraint firstItem="MNR-Fn-jzo" firstAttribute="baseline" secondItem="3cA-CO-ZLQ" secondAttribute="firstBaseline" id="56r-Ym-9VE"/>
+                            <constraint firstAttribute="trailingMargin" secondItem="f0j-Hn-HoR" secondAttribute="trailing" id="5rE-9d-Qhm"/>
+                            <constraint firstItem="dRN-mO-3vM" firstAttribute="leading" secondItem="bCQ-uW-IAl" secondAttribute="leadingMargin" constant="30" id="7qw-Ev-g8Q"/>
+                            <constraint firstItem="dRN-mO-3vM" firstAttribute="top" secondItem="DsB-BP-B4H" secondAttribute="bottom" constant="30" id="8ud-hp-Z5j"/>
+                            <constraint firstItem="VrG-fi-tpQ" firstAttribute="centerY" secondItem="MNR-Fn-jzo" secondAttribute="centerY" id="ADI-kh-16l"/>
+                            <constraint firstItem="f0j-Hn-HoR" firstAttribute="top" secondItem="dRN-mO-3vM" secondAttribute="top" id="BQN-db-jK2"/>
+                            <constraint firstItem="5E0-My-HAt" firstAttribute="width" secondItem="dRN-mO-3vM" secondAttribute="width" id="EHr-Cl-wRC"/>
+                            <constraint firstItem="MNR-Fn-jzo" firstAttribute="height" secondItem="3cA-CO-ZLQ" secondAttribute="height" id="EiV-Ot-fHW"/>
+                            <constraint firstItem="MNR-Fn-jzo" firstAttribute="top" secondItem="Oc8-aY-oLa" secondAttribute="bottom" constant="10" id="Hwn-Mr-4S6"/>
+                            <constraint firstItem="VrG-fi-tpQ" firstAttribute="height" secondItem="MNR-Fn-jzo" secondAttribute="height" id="J5p-IY-Ssa"/>
+                            <constraint firstItem="dRN-mO-3vM" firstAttribute="leading" secondItem="bCQ-uW-IAl" secondAttribute="leadingMargin" constant="30" id="JCA-dF-NaV"/>
+                            <constraint firstItem="VrG-fi-tpQ" firstAttribute="bottom" secondItem="MNR-Fn-jzo" secondAttribute="bottom" id="JDV-Cf-BSc"/>
+                            <constraint firstItem="3cA-CO-ZLQ" firstAttribute="leading" secondItem="f0j-Hn-HoR" secondAttribute="leading" id="JJG-l3-Dg5"/>
+                            <constraint firstItem="f0j-Hn-HoR" firstAttribute="top" secondItem="dRN-mO-3vM" secondAttribute="top" id="JqB-aF-Yax"/>
+                            <constraint firstItem="hHA-gX-oZi" firstAttribute="top" secondItem="MNR-Fn-jzo" secondAttribute="bottom" constant="47" id="M7U-wK-jxK"/>
+                            <constraint firstItem="5E0-My-HAt" firstAttribute="top" secondItem="dRN-mO-3vM" secondAttribute="bottom" constant="-20" id="Oyp-s3-pgr"/>
+                            <constraint firstItem="f0j-Hn-HoR" firstAttribute="leading" secondItem="dRN-mO-3vM" secondAttribute="leading" id="Q3V-j9-eUh"/>
+                            <constraint firstItem="MNR-Fn-jzo" firstAttribute="bottom" secondItem="3cA-CO-ZLQ" secondAttribute="bottom" id="Q5p-pU-upt"/>
+                            <constraint firstItem="5E0-My-HAt" firstAttribute="leading" secondItem="dRN-mO-3vM" secondAttribute="leading" id="R74-5D-0oi"/>
+                            <constraint firstItem="3cA-CO-ZLQ" firstAttribute="leading" secondItem="dRN-mO-3vM" secondAttribute="trailing" constant="30" id="SCd-EB-4QU"/>
+                            <constraint firstItem="MNR-Fn-jzo" firstAttribute="width" secondItem="3cA-CO-ZLQ" secondAttribute="width" id="Ur0-PV-IbG"/>
+                            <constraint firstItem="6v2-xf-Mlq" firstAttribute="leading" secondItem="f0j-Hn-HoR" secondAttribute="trailing" constant="-30" id="Vu8-TZ-LnL"/>
+                            <constraint firstItem="3cA-CO-ZLQ" firstAttribute="leading" secondItem="f0j-Hn-HoR" secondAttribute="leading" id="WOg-ld-yaQ"/>
+                            <constraint firstItem="f0j-Hn-HoR" firstAttribute="width" secondItem="dRN-mO-3vM" secondAttribute="width" id="WsA-GJ-TbM"/>
+                            <constraint firstItem="3cA-CO-ZLQ" firstAttribute="bottom" secondItem="dRN-mO-3vM" secondAttribute="bottom" id="XuN-3h-12C"/>
+                            <constraint firstItem="MNR-Fn-jzo" firstAttribute="centerX" secondItem="f0j-Hn-HoR" secondAttribute="centerX" id="Y4p-nu-cxz"/>
+                            <constraint firstItem="MNR-Fn-jzo" firstAttribute="centerX" secondItem="bCQ-uW-IAl" secondAttribute="centerX" id="ZQo-Ua-pdS"/>
+                            <constraint firstItem="3cA-CO-ZLQ" firstAttribute="width" secondItem="MNR-Fn-jzo" secondAttribute="width" id="ZSD-n7-afU"/>
+                            <constraint firstItem="Oc8-aY-oLa" firstAttribute="top" secondItem="f0j-Hn-HoR" secondAttribute="bottom" constant="9" id="Zaz-OT-sqR"/>
+                            <constraint firstItem="3cA-CO-ZLQ" firstAttribute="bottom" secondItem="dRN-mO-3vM" secondAttribute="bottom" id="aw7-gl-58W"/>
+                            <constraint firstItem="6v2-xf-Mlq" firstAttribute="top" secondItem="f0j-Hn-HoR" secondAttribute="top" id="dE4-I6-2GJ"/>
+                            <constraint firstItem="MNR-Fn-jzo" firstAttribute="centerX" secondItem="f0j-Hn-HoR" secondAttribute="centerX" id="dsH-qH-Nkb"/>
+                            <constraint firstItem="f0j-Hn-HoR" firstAttribute="bottom" secondItem="dRN-mO-3vM" secondAttribute="bottom" constant="50" id="fQu-uc-oBs"/>
+                            <constraint firstItem="3cA-CO-ZLQ" firstAttribute="height" secondItem="MNR-Fn-jzo" secondAttribute="height" id="gMB-fa-1E3"/>
+                            <constraint firstItem="f0j-Hn-HoR" firstAttribute="leading" secondItem="dRN-mO-3vM" secondAttribute="trailing" constant="30" id="iH7-Ke-wfl"/>
+                            <constraint firstItem="VrG-fi-tpQ" firstAttribute="width" secondItem="MNR-Fn-jzo" secondAttribute="width" id="iYO-WV-zRP"/>
+                            <constraint firstItem="dRN-mO-3vM" firstAttribute="centerY" secondItem="bCQ-uW-IAl" secondAttribute="centerY" id="jb3-FT-uFm"/>
+                            <constraint firstItem="VrG-fi-tpQ" firstAttribute="width" secondItem="MNR-Fn-jzo" secondAttribute="width" id="nNU-13-GWC"/>
+                            <constraint firstItem="Oc8-aY-oLa" firstAttribute="leading" secondItem="f0j-Hn-HoR" secondAttribute="leading" id="oWU-Nz-aAN"/>
+                            <constraint firstItem="MNR-Fn-jzo" firstAttribute="firstBaseline" secondItem="3cA-CO-ZLQ" secondAttribute="baseline" id="pF7-7n-2Qg"/>
+                            <constraint firstItem="VrG-fi-tpQ" firstAttribute="width" secondItem="MNR-Fn-jzo" secondAttribute="width" id="q07-JZ-E2X"/>
+                            <constraint firstItem="dRN-mO-3vM" firstAttribute="top" secondItem="DsB-BP-B4H" secondAttribute="bottom" constant="30" id="qvr-kg-jUB"/>
+                            <constraint firstItem="6v2-xf-Mlq" firstAttribute="height" secondItem="f0j-Hn-HoR" secondAttribute="height" id="r8Z-4a-1QG"/>
+                            <constraint firstItem="f0j-Hn-HoR" firstAttribute="leading" secondItem="3cA-CO-ZLQ" secondAttribute="leading" id="sAE-GZ-bCF"/>
+                            <constraint firstItem="VrG-fi-tpQ" firstAttribute="height" secondItem="MNR-Fn-jzo" secondAttribute="height" id="sxm-DE-2oJ"/>
+                            <constraint firstItem="dRN-mO-3vM" firstAttribute="centerX" secondItem="bCQ-uW-IAl" secondAttribute="centerX" id="u5v-j8-pau"/>
+                            <constraint firstAttribute="trailingMargin" secondItem="f0j-Hn-HoR" secondAttribute="trailing" id="vlU-J5-puv"/>
+                            <constraint firstItem="MNR-Fn-jzo" firstAttribute="baseline" secondItem="VrG-fi-tpQ" secondAttribute="baseline" id="xel-iV-WEG"/>
+                            <constraint firstItem="MNR-Fn-jzo" firstAttribute="top" secondItem="3cA-CO-ZLQ" secondAttribute="top" id="yQc-7V-l0P"/>
+                            <constraint firstItem="VrG-fi-tpQ" firstAttribute="trailing" secondItem="f0j-Hn-HoR" secondAttribute="trailing" id="yfg-Ez-gR1"/>
+                            <constraint firstItem="Oc8-aY-oLa" firstAttribute="centerX" secondItem="bCQ-uW-IAl" secondAttribute="centerX" id="zi8-Pc-h4C"/>
+                        </constraints>
+                        <variation key="default">
+                            <mask key="constraints">
+                                <exclude reference="38e-bn-FiW"/>
+                                <exclude reference="7qw-Ev-g8Q"/>
+                                <exclude reference="8ud-hp-Z5j"/>
+                                <exclude reference="JCA-dF-NaV"/>
+                                <exclude reference="jb3-FT-uFm"/>
+                                <exclude reference="qvr-kg-jUB"/>
+                                <exclude reference="u5v-j8-pau"/>
+                                <exclude reference="5rE-9d-Qhm"/>
+                                <exclude reference="BQN-db-jK2"/>
+                                <exclude reference="JqB-aF-Yax"/>
+                                <exclude reference="Q3V-j9-eUh"/>
+                                <exclude reference="WsA-GJ-TbM"/>
+                                <exclude reference="fQu-uc-oBs"/>
+                                <exclude reference="iH7-Ke-wfl"/>
+                                <exclude reference="sAE-GZ-bCF"/>
+                                <exclude reference="vlU-J5-puv"/>
+                                <exclude reference="JJG-l3-Dg5"/>
+                                <exclude reference="SCd-EB-4QU"/>
+                                <exclude reference="WOg-ld-yaQ"/>
+                                <exclude reference="XuN-3h-12C"/>
+                                <exclude reference="ZSD-n7-afU"/>
+                                <exclude reference="aw7-gl-58W"/>
+                                <exclude reference="gMB-fa-1E3"/>
+                                <exclude reference="0Ip-DY-emB"/>
+                                <exclude reference="2ob-Vw-oAF"/>
+                                <exclude reference="56r-Ym-9VE"/>
+                                <exclude reference="EiV-Ot-fHW"/>
+                                <exclude reference="Q5p-pU-upt"/>
+                                <exclude reference="Ur0-PV-IbG"/>
+                                <exclude reference="Y4p-nu-cxz"/>
+                                <exclude reference="ZQo-Ua-pdS"/>
+                                <exclude reference="dsH-qH-Nkb"/>
+                                <exclude reference="pF7-7n-2Qg"/>
+                                <exclude reference="xel-iV-WEG"/>
+                                <exclude reference="yQc-7V-l0P"/>
+                                <exclude reference="1h2-ad-imy"/>
+                                <exclude reference="3De-mR-QbH"/>
+                                <exclude reference="3Om-qn-3RT"/>
+                                <exclude reference="4f8-bi-dlI"/>
+                                <exclude reference="ADI-kh-16l"/>
+                                <exclude reference="J5p-IY-Ssa"/>
+                                <exclude reference="JDV-Cf-BSc"/>
+                                <exclude reference="iYO-WV-zRP"/>
+                                <exclude reference="nNU-13-GWC"/>
+                                <exclude reference="q07-JZ-E2X"/>
+                                <exclude reference="sxm-DE-2oJ"/>
+                                <exclude reference="yfg-Ez-gR1"/>
+                                <exclude reference="M7U-wK-jxK"/>
+                            </mask>
+                        </variation>
+                        <variation key="heightClass=compact-widthClass=compact">
+                            <mask key="constraints">
+                                <include reference="38e-bn-FiW"/>
+                                <include reference="JCA-dF-NaV"/>
+                                <include reference="BQN-db-jK2"/>
+                                <include reference="sAE-GZ-bCF"/>
+                                <include reference="vlU-J5-puv"/>
+                                <include reference="SCd-EB-4QU"/>
+                                <include reference="XuN-3h-12C"/>
+                                <include reference="0Ip-DY-emB"/>
+                                <include reference="2ob-Vw-oAF"/>
+                                <include reference="EiV-Ot-fHW"/>
+                                <include reference="Y4p-nu-cxz"/>
+                                <include reference="J5p-IY-Ssa"/>
+                                <include reference="JDV-Cf-BSc"/>
+                                <include reference="nNU-13-GWC"/>
+                                <include reference="yfg-Ez-gR1"/>
+                            </mask>
+                        </variation>
+                        <variation key="heightClass=compact-widthClass=regular">
+                            <mask key="constraints">
+                                <include reference="7qw-Ev-g8Q"/>
+                                <include reference="jb3-FT-uFm"/>
+                                <include reference="5rE-9d-Qhm"/>
+                                <include reference="JqB-aF-Yax"/>
+                                <include reference="iH7-Ke-wfl"/>
+                                <include reference="JJG-l3-Dg5"/>
+                                <include reference="ZSD-n7-afU"/>
+                                <include reference="aw7-gl-58W"/>
+                                <include reference="gMB-fa-1E3"/>
+                                <include reference="Q5p-pU-upt"/>
+                                <include reference="dsH-qH-Nkb"/>
+                                <include reference="3Om-qn-3RT"/>
+                                <include reference="4f8-bi-dlI"/>
+                                <include reference="iYO-WV-zRP"/>
+                                <include reference="sxm-DE-2oJ"/>
+                            </mask>
+                        </variation>
+                        <variation key="heightClass=regular-widthClass=compact">
+                            <mask key="constraints">
+                                <include reference="8ud-hp-Z5j"/>
+                                <include reference="qvr-kg-jUB"/>
+                                <include reference="u5v-j8-pau"/>
+                                <include reference="Q3V-j9-eUh"/>
+                                <include reference="WsA-GJ-TbM"/>
+                                <include reference="fQu-uc-oBs"/>
+                                <include reference="WOg-ld-yaQ"/>
+                                <include reference="56r-Ym-9VE"/>
+                                <include reference="Ur0-PV-IbG"/>
+                                <include reference="ZQo-Ua-pdS"/>
+                                <include reference="pF7-7n-2Qg"/>
+                                <include reference="xel-iV-WEG"/>
+                                <include reference="yQc-7V-l0P"/>
+                                <include reference="1h2-ad-imy"/>
+                                <include reference="3De-mR-QbH"/>
+                                <include reference="ADI-kh-16l"/>
+                                <include reference="q07-JZ-E2X"/>
+                                <include reference="M7U-wK-jxK"/>
+                            </mask>
+                        </variation>
+                    </view>
+                    <connections>
+                        <outlet property="barcodeLabel" destination="f0j-Hn-HoR" id="SSC-Yb-Vah"/>
+                        <outlet property="camerBtn" destination="MNR-Fn-jzo" id="acC-r3-qbY"/>
+                        <outlet property="imgBtn" destination="dRN-mO-3vM" id="J0B-Mb-5mN"/>
+                        <outlet property="noteTextView" destination="Oc8-aY-oLa" id="UDt-Bc-6c9"/>
+                        <outlet property="photoCountLabel" destination="5E0-My-HAt" id="qOZ-Or-mlA"/>
+                        <outlet property="scanBtn" destination="3cA-CO-ZLQ" id="vdK-Na-jnk"/>
+                        <outlet property="typeBtn" destination="6v2-xf-Mlq" id="00b-Ui-OtN"/>
+                        <outlet property="uploadBtn" destination="VrG-fi-tpQ" id="5lA-Is-8kD"/>
+                    </connections>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="q1E-27-iLT" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="-251.08695652173915" y="104.34782608695653"/>
+        </scene>
     </scenes>
     <resources>
         <image name="camera" width="60" height="60"/>

+ 60 - 30
RA Image/RA Image/ModelModeViewController.m

@@ -124,6 +124,7 @@
                                      @"password" : encryptp,
                                      @"mode":self.name,
                                      @"barcode":self.barcode,
+                                     @"code_name":self.barcodeTitle,
                                      @"_operate":@"valid_upload",
                                      @"_action":@"handset_new",
                                      @"platform":@"ios"
@@ -180,6 +181,7 @@
                                          @"password" : encryptp,
                                          @"mode":self.name,
                                          @"barcode":self.barcode,
+                                         @"code_name":self.barcodeTitle,
                                          @"_operate":@"upload",
                                          @"_action":@"handset_new",
                                          @"platform":@"ios",
@@ -241,37 +243,65 @@
     if (barcode.length > 0) {
         
         __block UIAlertController* alertc=[RAUtils waiting_alert:self title:@"Loading model's manufactures" completion:^{
-            dispatch_async(dispatch_get_global_queue(0, 0), ^{
-                NSDictionary *modelManufacturs = [RANetwork getModelManufacture:barcode];
-                dispatch_async(dispatch_get_main_queue(), ^{
-//                    [alert dismissWithClickedButtonIndex:0 animated:YES];
-                    [alertc dismissViewControllerAnimated:YES completion:^{
-                        int result = [[modelManufacturs objectForKey:@"result"] intValue];
-                                           if (result == 2) {
-                                               NSArray *manufacturs = [modelManufacturs objectForKey:@"manufacturer"];
-                                               if (manufacturs.count > 0) {
-                                                   self.manufacturerList = manufacturs;
-                                                   NSString *manufacter = nil;
-                                                   if (manufacturs.count == 1) {
-                                                       manufacter = [manufacturs objectAtIndex:0];
-                                                   } else {
-                                                       manufacter = nil;
-                                                   }
-                                                   self.manufacturer = manufacter;
-                                               } else {
-                                                   self.manufacturerList = manufacturs;
-                                                   self.manufacturer = nil;
-                                               }
-                                           } else {
-                                               self.manufacturerList = self.oldManufacturerList;
-                                               self.manufacturer = nil;
-                                           }
-                    }];
-                   
-                });
-
+            
+            [RANetwork request_modelmanufacture:barcode completionHandler:^(NSMutableDictionary *modelManufacturs) {
+                //                    [alert dismissWithClickedButtonIndex:0 animated:YES];
+                [alertc dismissViewControllerAnimated:YES completion:^{
+                    int result = [[modelManufacturs objectForKey:@"result"] intValue];
+                    if (result == 2) {
+                        NSArray *manufacturs = [modelManufacturs objectForKey:@"manufacturer"];
+                        if (manufacturs.count > 0) {
+                            self.manufacturerList = manufacturs;
+                            NSString *manufacter = nil;
+                            if (manufacturs.count == 1) {
+                                manufacter = [manufacturs objectAtIndex:0];
+                            } else {
+                                manufacter = nil;
+                            }
+                            self.manufacturer = manufacter;
+                        } else {
+                            self.manufacturerList = manufacturs;
+                            self.manufacturer = nil;
+                        }
+                    } else {
+                        self.manufacturerList = self.oldManufacturerList;
+                        self.manufacturer = nil;
+                    }
+                }];
                 
-            });
+            }];
+            
+//            dispatch_async(dispatch_get_global_queue(0, 0), ^{
+//                NSDictionary *modelManufacturs = [RANetwork getModelManufacture:barcode];
+//                dispatch_async(dispatch_get_main_queue(), ^{
+////                    [alert dismissWithClickedButtonIndex:0 animated:YES];
+//                    [alertc dismissViewControllerAnimated:YES completion:^{
+//                        int result = [[modelManufacturs objectForKey:@"result"] intValue];
+//                                           if (result == 2) {
+//                                               NSArray *manufacturs = [modelManufacturs objectForKey:@"manufacturer"];
+//                                               if (manufacturs.count > 0) {
+//                                                   self.manufacturerList = manufacturs;
+//                                                   NSString *manufacter = nil;
+//                                                   if (manufacturs.count == 1) {
+//                                                       manufacter = [manufacturs objectAtIndex:0];
+//                                                   } else {
+//                                                       manufacter = nil;
+//                                                   }
+//                                                   self.manufacturer = manufacter;
+//                                               } else {
+//                                                   self.manufacturerList = manufacturs;
+//                                                   self.manufacturer = nil;
+//                                               }
+//                                           } else {
+//                                               self.manufacturerList = self.oldManufacturerList;
+//                                               self.manufacturer = nil;
+//                                           }
+//                    }];
+//
+//                });
+//
+//
+//            });
         }];
         
       

+ 3 - 0
RA Image/RA Image/PODModeViewController.m

@@ -92,6 +92,7 @@
                                  @"user" : encryptu,
                                  @"password" : encryptp,
                                  @"mode":self.name,
+                                 @"code_name":self.barcodeTitle,
                                  @"barcode":self.barcode,
                                  @"_operate":@"upload",
                                  @"_action":@"handset_new",
@@ -153,6 +154,7 @@
                                      @"user" : encryptu,
                                      @"password" : encryptp,
                                      @"mode":self.name,
+                                     @"code_name":self.barcodeTitle,
                                      @"barcode":self.barcode,
                                      @"_operate":@"valid_upload",
                                      @"_action":@"handset_new",
@@ -197,6 +199,7 @@
                                  @"password" : encryptp,
                                  @"mode":self.name,
                                  @"barcode":self.barcode,
+                                 @"code_name":self.barcodeTitle,
                                  @"_operate":@"upload",
                                  @"_action":@"handset_new",
                                  @"platform":@"ios",

+ 2 - 0
RA Image/RA Image/PopModeViewController.m

@@ -93,6 +93,7 @@
                              @"user" : encryptu,
                              @"password" : encryptp,
                              @"mode":self.name,
+                             @"code_name":self.barcodeTitle,
                              @"barcode":self.barcode,
                              @"_operate":@"valid_upload",
                              @"_action":@"handset_new",
@@ -137,6 +138,7 @@
                                  @"password" : encryptp,
                                  @"mode":self.name,
                                  @"barcode":self.barcode,
+                                 @"code_name":self.barcodeTitle,
                                  @"_operate":@"upload",
                                  @"_action":@"handset_new",
                                  @"platform":@"ios",

+ 9 - 4
RA Image/RA Image/RANetwork.h

@@ -10,8 +10,13 @@
 #import "NetworkUtils.h"
 
 @interface RANetwork : NetworkUtils
-+(NSDictionary*)Login : (NSString*) user password:(NSString*) password;
-+(NSDictionary*)logout;
-+(NSDictionary*)Verify : (NSMutableDictionary*) params;
-+ (NSDictionary *)getModelManufacture:(NSString *)model;
+//+(NSDictionary*)Login : (NSString*) user password:(NSString*) password;
+//+(NSDictionary*)logout;
+//+(NSDictionary*)Verify : (NSMutableDictionary*) params;
+//+ (NSDictionary *)getModelManufacture:(NSString *)model;
+
++(void)request_login : (NSString*) user password:(NSString*) password completionHandler:(resultHandler)result;
++(void)request_logout:(resultHandler)result;
++(void)request_verify : (NSMutableDictionary*) params completionHandler:(resultHandler)result;
++ (void)request_modelmanufacture:(NSString *)model completionHandler:(resultHandler)result;
 @end

+ 91 - 25
RA Image/RA Image/RANetwork.m

@@ -105,8 +105,76 @@
      */
     return nil;
 }
+//
+//+ (NSDictionary *)Login:(NSString *)user password:(NSString *)password {
+//
+//
+//    NSString* encryptu=[AESCrypt AES128Encrypt:user key:@"usai"];
+//    NSString* encryptp=[AESCrypt AES128Encrypt:password key:@"usai"];
+//
+//    NSMutableDictionary *params = @{@"user":encryptu,
+//                                    @"password":encryptp,
+//                                    @"_action":@"handset_new",
+//                                    @"_operate":@"handset_login"
+//                                    }.mutableCopy;
+//    AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
+//
+//    NSData *data = [self get_json:appDelegate.address parameters:params file:nil];
+//    NSDictionary *resultDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
+//    return resultDic;
+//}
+
+//+(NSDictionary*)Verify : (NSMutableDictionary*) params
+//{
+//
+//
+//
+//   // params[@"_operate"]=@"valid_upload";
+//    AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
+//
+//    NSData *data = [self get_json:appDelegate.address parameters:params file:nil];
+//    NSDictionary *resultDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
+//    return resultDic;
+//}
 
-+ (NSDictionary *)Login:(NSString *)user password:(NSString *)password {
+//+ (NSDictionary *)logout {
+////    NSMutableDictionary *params = @{@"_operate":@"handset_logout"
+////                                    }.mutableCopy;
+////    AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
+////    NSString *urlStr = appDelegate.address;
+////
+////    NSData *data = [self get_json:urlStr parameters:params file:nil];
+////    NSDictionary *resultDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
+////    return resultDic;
+//
+//    return @{@"result" : @"2"};
+//}
+
+//+ (NSDictionary *)getModelManufacture:(NSString *)model {
+//
+//    AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
+//
+//    NSString* encryptu=[AESCrypt AES128Encrypt:appDelegate.user key:@"usai"];
+//    NSString* encryptp=[AESCrypt AES128Encrypt:appDelegate.password key:@"usai"];
+//    NSMutableDictionary *params = @{
+//                                    @"user":encryptu,
+//                                    @"password":encryptp,
+//                                    @"_operate":@"handset_get_manufacturer",
+//                                    @"_action":@"handset_new",
+//                                    @"barcode":model
+//                                    }.mutableCopy;
+//
+//    NSData *data = [self get_json:appDelegate.address parameters:params file:nil];
+//    NSDictionary *resultDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
+//    return resultDic;
+//
+//}
+
+
+#pragma mark 2020
+
++ (void)request_login:(NSString *)user password:(NSString *)password completionHandler:(resultHandler)result
+{
 
 
     NSString* encryptu=[AESCrypt AES128Encrypt:user key:@"usai"];
@@ -119,12 +187,20 @@
                                     }.mutableCopy;
     AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
     
-    NSData *data = [self get_json:appDelegate.address parameters:params file:nil];
-    NSDictionary *resultDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
-    return resultDic;
+    [self request_interface:appDelegate.address parameters:params err_record_url:nil completionHandler:result retry:0];
+//    
+//    NSData *data = [self get_json:appDelegate.address parameters:params file:nil];
+//    NSDictionary *resultDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
+//    return resultDic;
+}
++(void)request_logout:(resultHandler)result
+{
+    
+    result( [@{@"result" : @"2"} mutableCopy]);
 }
 
-+(NSDictionary*)Verify : (NSMutableDictionary*) params
+
++(void)request_verify : (NSMutableDictionary*) params completionHandler:(resultHandler)result
 {
 
     
@@ -132,25 +208,14 @@
    // params[@"_operate"]=@"valid_upload";
     AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
     
-    NSData *data = [self get_json:appDelegate.address parameters:params file:nil];
-    NSDictionary *resultDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
-    return resultDic;
-}
-
-+ (NSDictionary *)logout {
-//    NSMutableDictionary *params = @{@"_operate":@"handset_logout"
-//                                    }.mutableCopy;
-//    AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
-//    NSString *urlStr = appDelegate.address;
-//    
-//    NSData *data = [self get_json:urlStr parameters:params file:nil];
+    [self request_interface:appDelegate.address parameters:params err_record_url:nil completionHandler:result retry:0];
+    
+//    NSData *data = [self get_json:appDelegate.address parameters:params file:nil];
 //    NSDictionary *resultDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
 //    return resultDic;
-    
-    return @{@"result" : @"2"};
 }
-
-+ (NSDictionary *)getModelManufacture:(NSString *)model {
++ (void)request_modelmanufacture:(NSString *)model completionHandler:(resultHandler)result
+{
     
     AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
 
@@ -164,10 +229,11 @@
                                     @"barcode":model
                                     }.mutableCopy;
     
-    NSData *data = [self get_json:appDelegate.address parameters:params file:nil];
-    NSDictionary *resultDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
-    return resultDic;
+    [self request_interface:appDelegate.address parameters:params err_record_url:nil completionHandler:result retry:0];
+    
+//    NSData *data = [self get_json:appDelegate.address parameters:params file:nil];
+//    NSDictionary *resultDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
+//    return resultDic;
 
 }
-
 @end

+ 17 - 0
RA Image/RA Image/ReceivingPalletIDViewController.h

@@ -0,0 +1,17 @@
+//
+//  ReceivingPalletIDViewController.h
+//  RA Image
+//
+//  Created by Rui Zhang on 10/26/20.
+//  Copyright © 2020 USAI. All rights reserved.
+//
+
+#import "BasicModeViewController.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface ReceivingPalletIDViewController : BasicModeViewController
+@property (nonatomic,assign) UIKeyboardType inputKeyboardType;
+@end
+
+NS_ASSUME_NONNULL_END

+ 239 - 0
RA Image/RA Image/ReceivingPalletIDViewController.m

@@ -0,0 +1,239 @@
+//
+//  ReceivingPalletIDViewController.m
+//  RA Image
+//
+//  Created by Rui Zhang on 10/26/20.
+//  Copyright © 2020 USAI. All rights reserved.
+//
+
+#import "ReceivingPalletIDViewController.h"
+#import "UploadViewController.h"
+#import "AESCrypt.h"
+#import "JLKeyboardListener.h"
+
+@interface ReceivingPalletIDViewController ()<UITextViewDelegate>
+@property (strong, nonatomic) IBOutlet UITextView *noteTextView;
+@property (strong, nonatomic) IBOutlet UIButton *scanBtn;
+@property (strong, nonatomic) IBOutlet UIButton *camerBtn;
+@property (strong, nonatomic) IBOutlet UIButton *uploadBtn;
+@property (strong, nonatomic) IBOutlet UIButton *imgBtn;
+@property (strong, nonatomic) IBOutlet UILabel *barcodeLabel;
+@property (strong, nonatomic) IBOutlet UIButton *typeBtn;
+@property (strong, nonatomic) IBOutlet UILabel *photoCountLabel;
+@end
+
+@implementation ReceivingPalletIDViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    self.verify_msg0=[NSString stringWithFormat:@"%@ does not exist",self.barcodeTitle];
+    self.noteTextView.layer.borderColor = [UIColor blackColor].CGColor;
+    self.noteTextView.layer.borderWidth = 1.0f;
+    [self registListenKeyboard];
+    self.imgBtn.layer.borderColor = [UIColor blackColor].CGColor;
+    self.imgBtn.layer.borderWidth = 1.0f;
+    // Do any additional setup after loading the view.
+}
+
+/*
+#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.
+}
+*/
+
+#pragma mark - Private
+
+- (void)clear {
+    self.barcode = nil;
+    self.noteTextView.text = @"Reference:";
+    [self.imgBtn setBackgroundImage:nil forState:UIControlStateNormal];
+    [self clearPhotos];
+}
+
+#pragma mark - Button Action
+
+- (IBAction)imgBtnClick:(UIButton *)sender {
+    [self showPhotoList];
+}
+
+- (IBAction)scanBtnClick:(UIButton *)sender {
+    [self showScanner];
+}
+
+- (IBAction)cameraBtnClick:(UIButton *)sender {
+    [self clickCameraButton];
+}
+
+- (IBAction)uploadBtnClick:(UIButton *)sender {
+    
+
+    
+    // check piid, photo...
+    if(self.barcode.length ==0)
+    {
+    [RAUtils message_alert:[NSString stringWithFormat:@"%@ cannot be blank",self.barcodeTitle] title:@"Warning" controller:self];
+    return;
+    }
+    if(self.photos.count ==0)
+    {
+        [RAUtils message_alert:@"You must take at least one photo." title:@"Warning" controller:self];
+        return;
+    }
+    
+
+    
+    
+        AppDelegate* Appdelegate=(AppDelegate*)[UIApplication sharedApplication].delegate;
+    NSString* encryptu=[AESCrypt AES128Encrypt:Appdelegate.user key:@"usai"];
+    NSString* encryptp=[AESCrypt AES128Encrypt:Appdelegate.password key:@"usai"];
+    NSMutableDictionary* params = [@{
+                             @"user" : encryptu,
+                             @"password" : encryptp,
+                             @"mode":self.name,
+                             @"code_name":self.barcodeTitle,
+                             @"barcode":self.barcode,
+                             @"_operate":@"valid_upload",
+                             @"_action":@"handset_new",
+                             @"platform":@"ios"
+                             } mutableCopy];
+    
+    NSString *note = self.noteTextView.text;
+
+    if (note) {
+        [params setObject:note forKey:@"note"];
+    }
+    [self verify:params];
+    
+//    UploadViewController *upVC = (UploadViewController *)[self viewControllerInStoryboard:@"Upload" withId:@"UploadViewController"];
+//    [self.navigationController pushViewController:upVC animated:YES];
+}
+
+-(void)addTasks
+{
+    
+    AppDelegate* Appdelegate=(AppDelegate*)[UIApplication sharedApplication].delegate;
+    
+    if (![self shouldUploadWithCurrentNerworkStatus]) {
+        [self.view makeToast:@"Current network is not WiFi,you can upload it manually when wifi connected." duration:3.0 position:CSToastPositionCenter];
+    }
+    NSString *note = self.noteTextView.text;
+    //prepare upload
+    NSMutableArray* tasks = [NSMutableArray new];
+    
+    for(NSMutableDictionary* photo in self.photos)
+    {
+        
+        NSMutableDictionary* task=[[NSMutableDictionary alloc]init];
+        
+        
+        task[@"path"]=self.name;
+        task[@"file"]=photo[@"file"];
+        
+        task[@"url"]=Appdelegate.address;
+        NSString *md5 = [photo objectForKey:@"md5"];
+        
+        
+        
+        NSString* encryptu=[AESCrypt AES128Encrypt:Appdelegate.user key:@"usai"];
+        NSString* encryptp=[AESCrypt AES128Encrypt:Appdelegate.password key:@"usai"];
+        NSMutableDictionary* params = [@{
+                                 @"user" : encryptu,
+                                 @"password" : encryptp,
+                                 @"mode":self.name,
+                                 @"code_name":self.barcodeTitle,
+                                 @"barcode":self.barcode,
+                                 @"_operate":@"upload",
+                                 @"_action":@"handset_new",
+                                 @"platform":@"ios",
+                                 @"md5":md5
+        }mutableCopy];
+        
+        
+
+        if (note) {
+            [params setObject:note forKey:@"note"];
+        }
+        
+        task[@"params"]=params;
+        
+        NSString *file = photo[@"file"];
+        [self moveTmpImageToCache:file];
+        
+        [tasks addObject:task];
+        
+    }
+    
+    
+    //    // add upload tasks;
+    [Appdelegate.uploadManager addTasks:tasks];
+    
+    [self clear];
+}
+
+- (IBAction)typeBtnClick:(UIButton *)sender {
+    [self showBarcodeInput:self.inputKeyboardType];//UIKeyboardTypeNumberPad
+}
+
+#pragma mark - Super Method
+
+- (void)receiveImage:(UIImage *)img {
+    
+    [self.imgBtn setBackgroundImage:img forState:UIControlStateNormal];
+    
+}
+
+- (void)setBarcode:(NSString *)barcode {
+    [super setBarcode:barcode];
+
+        
+ 
+    if (!barcode) {
+        barcode = @"";
+    }
+    else
+    {
+        if(![RAUtils isNumeric:barcode]&&![self.name isEqualToString:@"Receiving"])
+        {
+            
+            NSString* msg = [NSString stringWithFormat:@"%@ must be a number",self.barcodeTitle];
+            
+                                        [self.view makeToast:msg duration:3.0 position:CSToastPositionCenter];
+            
+            barcode = @"";
+        }
+    }
+    self.barcodeLabel.text = [NSString stringWithFormat:@"%@:%@",self.barcodeTitle,barcode];
+}
+
+- (void)setPhotoCount:(NSUInteger)photoCount {
+    [super setPhotoCount:photoCount];
+    NSString *str = nil;
+    if (photoCount > 0) {
+        str = [NSString stringWithFormat:@"%lu Photos",photoCount];
+    } else {
+        str = @"No Photos";
+    }
+    self.photoCountLabel.text = str;
+}
+#pragma mark - TextView Delegate
+
+- (BOOL)textViewShouldBeginEditing:(UITextView *)textView {
+    self.currentFirstResponder = textView;
+    if ([textView.text isEqualToString:@"Reference:"]) {
+        textView.text = nil;
+    }
+    return YES;
+}
+
+- (BOOL)textViewShouldEndEditing:(UITextView *)textView {
+    self.currentFirstResponder = nil;
+    if (!textView.text.length) {
+        textView.text = @"Reference:";
+    }
+    return YES;
+}
+@end

+ 77 - 29
RA Image/RA Image/RootViewController.m

@@ -13,6 +13,7 @@
 #import "ModelModeViewController.h"
 #import "UploadSettingController.h"
 #import "PODModeViewController.h"
+#import "ReceivingPalletIDViewController.h"
 
 static NSString *kLastMode = @"lastChooseMode";
 
@@ -35,7 +36,7 @@ static NSString *kLastMode = @"lastChooseMode";
     UIView *v = [UIView new];
     [self.view insertSubview:v atIndex:0];
     self.lastChoosedIndex = -1;
-
+    
     
 #ifndef PROJ_RAMOBILE
     //如果是Redant Mobile 集成的,就没有logout
@@ -109,7 +110,7 @@ static NSString *kLastMode = @"lastChooseMode";
     NSDictionary *mode = [self.modeList objectAtIndex:indexPath.row];
     NSString *name = [mode objectForKey:@"name"];
     NSString *desc = [mode objectForKey:@"description"];
-//    cell.mode = name;
+    //    cell.mode = name;
     [cell setMode:name desc:desc];
     NSString *codeName = [mode objectForKey:@"code_name"];
     cell.code_name = codeName;
@@ -163,7 +164,7 @@ static NSString *kLastMode = @"lastChooseMode";
         ModelModeViewController *vc = (ModelModeViewController *)[self viewControllerInStoryboard:@"Mode" withId:@"ModelModeViewController"];
         vc.manufacturerList = [mode objectForKey:@"manifacturer"];
         modeVC = vc;
-    }else if ([cell.mode isEqualToString:@"POP"]||[cell.mode isEqualToString:@"Receiving"]||[cell.mode isEqualToString:@"Returns"]) {
+    }else if ([cell.mode isEqualToString:@"POP"]||[cell.mode isEqualToString:@"Returns"]) {
         PopModeViewController *vc = [[UIStoryboard storyboardWithName:@"Mode" bundle:nil] instantiateViewControllerWithIdentifier:@"PopModeViewController"];
         if (![cell.mode isEqualToString:@"Receiving"]) {
             vc.inputKeyboardType = UIKeyboardTypeNumberPad;
@@ -171,7 +172,23 @@ static NSString *kLastMode = @"lastChooseMode";
             vc.inputKeyboardType = UIKeyboardTypeDefault;
         }
         modeVC = vc;
-    } else if ([cell.mode isEqualToString:@"POD"]) {
+    }
+    else if([cell.mode isEqualToString:@"Receiving"])
+    {
+        if([cell.code_name isEqualToString:@"PO#"])
+        {
+            PopModeViewController *vc = [[UIStoryboard storyboardWithName:@"Mode" bundle:nil] instantiateViewControllerWithIdentifier:@"PopModeViewController"];
+            vc.inputKeyboardType = UIKeyboardTypeNumberPad;
+            modeVC = vc;
+        }
+        else
+        {
+            ReceivingPalletIDViewController *vc = [[UIStoryboard storyboardWithName:@"Mode" bundle:nil] instantiateViewControllerWithIdentifier:@"ReceivingPalletIDViewController"];
+            vc.inputKeyboardType = UIKeyboardTypeDefault;
+            modeVC = vc;
+        }
+    }
+    else if ([cell.mode isEqualToString:@"POD"]) {
         
         PODModeViewController *vc = [PODModeViewController viewControllerFromStoryboard];
         vc.inputKeyboardType = UIKeyboardTypeDefault;
@@ -199,34 +216,65 @@ static NSString *kLastMode = @"lastChooseMode";
 #ifndef PROJ_RAMOBILE
     //如果是Redant Mobile 集成的,就没有logout
     
-
+    
     __block UIAlertController* alertcontroller= [RAUtils waiting_alert:self title:@"Logout" completion:^{
         __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];
-                   [alertcontroller dismissViewControllerAnimated:true completion:^{
-                       AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
-                       if (result == RESULT_TRUE) {
-                           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];
-                       }
-                   }];
-
-               });
-               
-               
-           });
+        [RANetwork request_logout:^(NSMutableDictionary *resulti) {
+            
+            NSDictionary *logoutDic = resulti;
+            int result = [[logoutDic objectForKey:@"result"] intValue];
+            dispatch_async(dispatch_get_main_queue(), ^{
+                //                   [alert dismissWithClickedButtonIndex:0 animated:YES];
+                [alertcontroller dismissViewControllerAnimated:true completion:^{
+                    AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
+                    if (result == RESULT_TRUE) {
+                        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];
+                    }
+                }];
+                
+            });
+            
+            
+        }];
+        
+        
+        
+        
+        
+        
+        
+        
+        
+        //           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];
+        //                   [alertcontroller dismissViewControllerAnimated:true completion:^{
+        //                       AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
+        //                       if (result == RESULT_TRUE) {
+        //                           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"];
-   
+    //   UIAlertView *alert = [RAUtils waiting_alert:@"Please wait..." title:@"Logout"];
+    
     
 #endif
     

+ 10 - 10
RA Image/RA Image/config.h

@@ -16,16 +16,16 @@
 
 
 //#define ENCRYPT_OFF
-# ifdef DEBUG
-#define NO_SAVE_VERIFY true
-    #define test_server
-# else
-#define NO_SAVE_VERIFY false
-# endif
-
-#define DEBUG_PDFSIG false
-
-#define PDF_DEBUG false
+//# ifdef DEBUG
+//#define NO_SAVE_VERIFY true
+//    #define test_server
+//# else
+//#define NO_SAVE_VERIFY false
+//# endif
+//
+//#define DEBUG_PDFSIG false
+//
+//#define PDF_DEBUG false