Przeglądaj źródła

1.修复程序第一次登录自动显示上一次选取的模式。
2.完成上传进度用户界面。

Pen Li 9 lat temu
rodzic
commit
605cdc5f79

+ 43 - 3
RA Image/RA Image.xcodeproj/project.pbxproj

@@ -16,6 +16,9 @@
 		42A829C01EBC027100898B8A /* RootNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 42A829BF1EBC027100898B8A /* RootNavigationController.m */; };
 		42A829C31EBC0F8300898B8A /* ManufacturerListController.m in Sources */ = {isa = PBXBuildFile; fileRef = 42A829C21EBC0F8300898B8A /* ManufacturerListController.m */; };
 		42A829C71EBC0FAC00898B8A /* ManufacturerCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 42A829C61EBC0FAC00898B8A /* ManufacturerCell.m */; };
+		42A829CC1EBC6CA200898B8A /* UploadViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 42A829CB1EBC6CA200898B8A /* UploadViewController.m */; };
+		42A829CE1EBC6CA900898B8A /* Upload.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 42A829CD1EBC6CA900898B8A /* Upload.storyboard */; };
+		42A829D21EBC6D3300898B8A /* UploadCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 42A829D11EBC6D3300898B8A /* UploadCell.m */; };
 		42BC2CFF1EBAC4050016B30D /* PhotoListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 42BC2CFE1EBAC4050016B30D /* PhotoListViewController.m */; };
 		42BC2D011EBAC4310016B30D /* PhotoList.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 42BC2D001EBAC4310016B30D /* PhotoList.storyboard */; };
 		42BC2D051EBAC4C00016B30D /* PhotoCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 42BC2D041EBAC4C00016B30D /* PhotoCell.m */; };
@@ -75,6 +78,11 @@
 		42A829C21EBC0F8300898B8A /* ManufacturerListController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ManufacturerListController.m; sourceTree = "<group>"; };
 		42A829C51EBC0FAC00898B8A /* ManufacturerCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ManufacturerCell.h; sourceTree = "<group>"; };
 		42A829C61EBC0FAC00898B8A /* ManufacturerCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ManufacturerCell.m; sourceTree = "<group>"; };
+		42A829CA1EBC6CA200898B8A /* UploadViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UploadViewController.h; sourceTree = "<group>"; };
+		42A829CB1EBC6CA200898B8A /* UploadViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UploadViewController.m; sourceTree = "<group>"; };
+		42A829CD1EBC6CA900898B8A /* Upload.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Upload.storyboard; sourceTree = "<group>"; };
+		42A829D01EBC6D3300898B8A /* UploadCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UploadCell.h; sourceTree = "<group>"; };
+		42A829D11EBC6D3300898B8A /* UploadCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UploadCell.m; sourceTree = "<group>"; };
 		42BC2CFD1EBAC4050016B30D /* PhotoListViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PhotoListViewController.h; sourceTree = "<group>"; };
 		42BC2CFE1EBAC4050016B30D /* PhotoListViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PhotoListViewController.m; sourceTree = "<group>"; };
 		42BC2D001EBAC4310016B30D /* PhotoList.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = PhotoList.storyboard; sourceTree = "<group>"; };
@@ -194,9 +202,7 @@
 			children = (
 				426E6B251EB85C4200942BE1 /* ModelModeViewController.h */,
 				426E6B261EB85C4200942BE1 /* ModelModeViewController.m */,
-				42A829C11EBC0F8300898B8A /* ManufacturerListController.h */,
-				42A829C21EBC0F8300898B8A /* ManufacturerListController.m */,
-				42A829C41EBC0F8D00898B8A /* view */,
+				42A829C81EBC2BA600898B8A /* manufacturer */,
 			);
 			name = ModelMode;
 			sourceTree = "<group>";
@@ -210,6 +216,36 @@
 			name = view;
 			sourceTree = "<group>";
 		};
+		42A829C81EBC2BA600898B8A /* manufacturer */ = {
+			isa = PBXGroup;
+			children = (
+				42A829C11EBC0F8300898B8A /* ManufacturerListController.h */,
+				42A829C21EBC0F8300898B8A /* ManufacturerListController.m */,
+				42A829C41EBC0F8D00898B8A /* view */,
+			);
+			name = manufacturer;
+			sourceTree = "<group>";
+		};
+		42A829C91EBC6BF500898B8A /* Upload */ = {
+			isa = PBXGroup;
+			children = (
+				42A829CA1EBC6CA200898B8A /* UploadViewController.h */,
+				42A829CB1EBC6CA200898B8A /* UploadViewController.m */,
+				42A829CD1EBC6CA900898B8A /* Upload.storyboard */,
+				42A829CF1EBC6D0F00898B8A /* view */,
+			);
+			name = Upload;
+			sourceTree = "<group>";
+		};
+		42A829CF1EBC6D0F00898B8A /* view */ = {
+			isa = PBXGroup;
+			children = (
+				42A829D01EBC6D3300898B8A /* UploadCell.h */,
+				42A829D11EBC6D3300898B8A /* UploadCell.m */,
+			);
+			name = view;
+			sourceTree = "<group>";
+		};
 		42BC2CFC1EBAC3D40016B30D /* PhotoList */ = {
 			isa = PBXGroup;
 			children = (
@@ -403,6 +439,7 @@
 				42BC2D061EBAC74A0016B30D /* Common */,
 				71114AA71EB1C51200D2200C /* util */,
 				42E1B10D1EB1E91D00EEF27C /* Network */,
+				42A829C91EBC6BF500898B8A /* Upload */,
 				42BC2CFC1EBAC3D40016B30D /* PhotoList */,
 				71DCDC4E1EAF34F800BA045A /* modes */,
 				71114AE21EB2DEE800D2200C /* cam scan */,
@@ -510,6 +547,7 @@
 				71114AB31EB1C5C800D2200C /* LICENSE in Resources */,
 				42BC2D011EBAC4310016B30D /* PhotoList.storyboard in Resources */,
 				42E1B1041EB1CCB200EEF27C /* login.json in Resources */,
+				42A829CE1EBC6CA900898B8A /* Upload.storyboard in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -520,6 +558,7 @@
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
+				42A829CC1EBC6CA200898B8A /* UploadViewController.m in Sources */,
 				42BC2D051EBAC4C00016B30D /* PhotoCell.m in Sources */,
 				71114AB21EB1C5C800D2200C /* AESCrypt.m in Sources */,
 				42BC2D0C1EBB00FD0016B30D /* PhotoPreviewController.m in Sources */,
@@ -555,6 +594,7 @@
 				71114ABC1EB1C73400D2200C /* ZipArchive.mm in Sources */,
 				42056E871EB9CF5D0010597A /* BasicModeViewController.m in Sources */,
 				42E1B0FE1EB1C8EE00EEF27C /* LoginTextFiledCell.m in Sources */,
+				42A829D21EBC6D3300898B8A /* UploadCell.m in Sources */,
 				71114AB41EB1C5C800D2200C /* NSData+Base64.m in Sources */,
 				71114ACF1EB1C79300D2200C /* Reachability.m in Sources */,
 				42E1B0FD1EB1C8EE00EEF27C /* LoginSwitchCell.m in Sources */,

BIN
RA Image/RA Image.xcodeproj/project.xcworkspace/xcuserdata/macmini1.xcuserdatad/UserInterfaceState.xcuserstate


+ 4 - 7
RA Image/RA Image/BasicModeViewController.m

@@ -89,23 +89,20 @@
 }
 
 - (void)showBarcodeInput {
+    [self tapResignFirstResponder:nil];
     __weak typeof(self) weakself = self;
-    UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Please enter Barcode" message:nil preferredStyle:UIAlertControllerStyleAlert];
+    UIAlertController *alert = [UIAlertController alertControllerWithTitle:[NSString stringWithFormat:@"Please enter %@ Code",self.barcodeTitle] message:nil preferredStyle:UIAlertControllerStyleAlert];
     [alert addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {
        
         textField.delegate = weakself;
+        textField.clearButtonMode = UITextFieldViewModeWhileEditing;
         
     }];
     
     UIAlertAction *OK = [UIAlertAction actionWithTitle:@"Ok" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
-
-    }];
-    
-    UIAlertAction *cancel = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action) {
         
     }];
-    
-    [alert addAction:cancel];
+
     [alert addAction:OK];
    
     [self presentViewController:alert animated:YES completion:nil];

+ 20 - 8
RA Image/RA Image/LoginSettingViewController.m

@@ -48,6 +48,7 @@ static NSString *kScanAddress = @"ScanAddress";
     if (addressDic) {
         self.internalTextField.text = [addressDic objectForKey:@"internalAddress"];
         self.externalTextField.text = [addressDic objectForKey:@"externalAddress"];
+        self.nameTextField.text = [addressDic objectForKey:@"name"];
     }
 }
 
@@ -61,7 +62,24 @@ static NSString *kScanAddress = @"ScanAddress";
     if (self.checkedAddress && self.returnValue) {
         self.returnValue(self.checkedAddress);
     }
-    [self.navigationController dismissViewControllerAnimated:YES completion:nil];
+    __weak typeof(self) weakself = self;
+    [self.navigationController dismissViewControllerAnimated:YES completion:^{
+        // 保存信息
+        NSString *name = weakself.nameTextField.text;
+        NSString *internalAddr = weakself.internalTextField.text;
+        NSString *externalAddr = weakself.externalTextField.text;
+        NSMutableDictionary *addressDic = [NSMutableDictionary dictionary];
+        if (internalAddr.length) {
+             [addressDic setObject:internalAddr forKey:@"internalAddress"];
+        }
+        if (externalAddr.length) {
+            [addressDic setObject:externalAddr forKey:@"externalAddress"];
+        }
+        if (name.length) {
+            [addressDic setObject:name forKey:@"name"];
+        }
+        [weakself setUserDefaultsValue:addressDic forKey:kScanAddress];
+    }];
 }
 
 - (void)scanItemClick:(UIBarButtonItem *)sender {
@@ -74,22 +92,16 @@ static NSString *kScanAddress = @"ScanAddress";
 
             if (weakself) {
                 __strong typeof(weakself) strongself = weakself;
-//                NSString *internalAddr = @"http://192.168.0.155/wm_postgresql/handset_login.php";
-//                NSString *externalAddr = @"http://127.0.0.1";
                 
                 NSArray *dataArr = [code componentsSeparatedByString:@";"];
                 NSString *name = [dataArr objectAtIndex:0];
                 NSString *internalAddr = [dataArr objectAtIndex:1];
                 NSString *externalAddr = [dataArr objectAtIndex:2];
                 
-                
-                NSMutableDictionary *addressDic = [NSMutableDictionary dictionary];
-                [addressDic setObject:internalAddr forKey:@"internalAddress"];
-                [addressDic setObject:externalAddr forKey:@"externalAddress"];
                 strongself.nameTextField.text = name;
                 strongself.internalTextField.text = internalAddr;
                 strongself.externalTextField.text = externalAddr;
-                [strongself setUserDefaultsValue:addressDic forKey:kScanAddress];
+                
             }
             
         }

+ 7 - 10
RA Image/RA Image/LoginViewController.m

@@ -55,18 +55,15 @@ static NSString *kLoginUserInfo = @"UserInfo";
 }
 
 - (void)initUserData {
-    NSString *userData = [self userDefaultsValue:kLoginUserInfo];
+    NSDictionary *userData = [self userDefaultsValue:kLoginUserInfo];
     if (userData) {
-        NSArray *arr = [userData componentsSeparatedByString:@"&"];
-        [arr enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
-            if (idx == 0) self.address = obj;
-            if (idx == 1) self.user = obj;
-            if (idx == 2) self.pwd = obj;
-        }];
+        self.address = [userData objectForKey:@"address"];
+        self.user = [userData objectForKey:@"user"];
+        self.pwd = [userData objectForKey:@"pwd"];
     }
 }
 
-- (void)prepareUserData {
+- (void)prepareUserData { // 登录取数据
     
     int count = [[self.dataDic objectForKey:@"count"] intValue];
     for (int i = 0; i < count; i++) {
@@ -178,11 +175,11 @@ static NSString *kLoginUserInfo = @"UserInfo";
                 [alert dismissWithClickedButtonIndex:0 animated:YES];
                 int result = [[loginDic objectForKey:@"result"] intValue];
                 BOOL rememberLogin = [[strongself userDefaultsValue:kRememberLogin] boolValue];
-                if (result == 1) {
+                if (result == RESULT_TRUE) {
                     if (!rememberLogin) {
                         [self setUserDefaultsValue:nil forKey:kLoginUserInfo];
                     } else {
-                         [strongself setUserDefaultsValue:[NSString stringWithFormat:@"%@&%@&%@",strongself.address,strongself.user,strongself.pwd] forKey:kLoginUserInfo];
+                        [strongself setUserDefaultsValue:@{@"address" : strongself.address,@"user" : strongself.user,@"pwd" : strongself.pwd} forKey:kLoginUserInfo];
                     }
                     appDelegate.bLogin = YES;
                     appDelegate.user = strongself.user;

+ 1 - 1
RA Image/RA Image/Mode.storyboard

@@ -427,7 +427,7 @@
                                     <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="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="gY5-Tk-ev9">
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="tailTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="gY5-Tk-ev9">
                                 <rect key="frame" x="66.666666666666686" y="32" width="280" height="30"/>
                                 <color key="backgroundColor" red="0.63798287620000005" green="0.61995456810000005" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 <constraints>

+ 5 - 1
RA Image/RA Image/ModelModeViewController.m

@@ -85,7 +85,11 @@
 
 - (void)setManufacturer:(NSString *)manufacturer {
     _manufacturer = manufacturer;
-    [self.manufactureBtn setTitle:[NSString stringWithFormat:@"Manufacturer:%@",manufacturer] forState:UIControlStateNormal];
+    NSString *title = @"Manufacturer";
+    if (manufacturer.length) {
+        title = manufacturer;
+    }
+    [self.manufactureBtn setTitle:title forState:UIControlStateNormal];
 }
 
 #pragma mark - Super Method

+ 3 - 1
RA Image/RA Image/PopModeViewController.m

@@ -7,6 +7,7 @@
 //
 
 #import "PopModeViewController.h"
+#import "UploadViewController.h"
 
 @interface PopModeViewController ()
 @property (strong, nonatomic) IBOutlet UIButton *scanBtn;
@@ -47,7 +48,8 @@
 }
 
 - (IBAction)uploadBtnClick:(UIButton *)sender {
-    self.barcodeLabel.text = @"upload";
+    UploadViewController *upVC = (UploadViewController *)[self viewControllerInStoryboard:@"Upload" withId:@"UploadViewController"];
+    [self.navigationController pushViewController:upVC animated:YES];
 }
 
 - (IBAction)typeBtnClick:(UIButton *)sender {

+ 12 - 9
RA Image/RA Image/RAINetwork.m

@@ -107,7 +107,8 @@
 
 + (NSDictionary *)Login:(NSString *)user password:(NSString *)password {
     NSMutableDictionary *params = @{@"user":user,
-                                    @"password":password
+                                    @"password":password,
+                                    @"_operate":@"handset_login"
                                     }.mutableCopy;
     AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
     
@@ -117,14 +118,16 @@
 }
 
 + (NSDictionary *)logout {
-    NSMutableDictionary *params = @{
-                                    }.mutableCopy;
-    AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
-    NSString *urlStr = [appDelegate.address stringByAppendingString:@"/index.php?_operate=logout"];
-    
-    NSData *data = [self get_json:urlStr parameters:params file:nil];
-    NSDictionary *resultDic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
-    return resultDic;
+//    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"};
 }
 
 @end

+ 28 - 15
RA Image/RA Image/RootViewController.m

@@ -48,6 +48,26 @@ static NSString *kLastMode = @"lastChooseMode";
     [self.modeTable reloadData];
 }
 
+- (void)viewDidAppear:(BOOL)animated {
+    [super viewDidAppear:animated];
+    AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
+    NSString *lastChoosedMode = [self userDefaultsValue:kLastMode];
+    NSArray *savedArr = [lastChoosedMode componentsSeparatedByString:@"<&&>"];
+    NSString *lastLoginName = [savedArr firstObject];
+    if (![lastLoginName isEqualToString:appDelegate.user]) { // 登录用户与上一次使用过模式的用户相同才进入上一次模式。
+        appDelegate.shouldAutoShowModeVC = NO;
+        return;
+    }
+    if (appDelegate.shouldAutoShowModeVC) {
+        appDelegate.shouldAutoShowModeVC = NO;
+        if (self.lastChoosedIndex > -1) {
+            //            RootModeCell *cell = [self.modeTable cellForRowAtIndexPath:[NSIndexPath indexPathForRow:self.lastChoosedIndex inSection:0]];
+            //            [self pushCurrentModeController:cell];
+            [self tableView:self.modeTable didSelectRowAtIndexPath:[NSIndexPath indexPathForRow:self.lastChoosedIndex inSection:0]];
+        }
+    }
+}
+
 
 - (void)didReceiveMemoryWarning {
     [super didReceiveMemoryWarning];
@@ -78,20 +98,6 @@ static NSString *kLastMode = @"lastChooseMode";
 
 }
 
-- (void)viewDidAppear:(BOOL)animated {
-    [super viewDidAppear:animated];
-    AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
-    if (appDelegate.shouldAutoShowModeVC) {
-        if (self.lastChoosedIndex > -1) {
-//            RootModeCell *cell = [self.modeTable cellForRowAtIndexPath:[NSIndexPath indexPathForRow:self.lastChoosedIndex inSection:0]];
-//            [self pushCurrentModeController:cell];
-            [self tableView:self.modeTable didSelectRowAtIndexPath:[NSIndexPath indexPathForRow:self.lastChoosedIndex inSection:0]];
-        }
-        
-        appDelegate.shouldAutoShowModeVC = NO;
-    }
-}
-
 #pragma mark - DataSource
 
 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
@@ -106,7 +112,11 @@ static NSString *kLastMode = @"lastChooseMode";
     cell.mode = name;
     NSString *codeName = [mode objectForKey:@"code_name"];
     cell.code_name = codeName;
+    
     NSString *lastChoosedMode = [self userDefaultsValue:kLastMode];
+    NSArray *savedArr = [lastChoosedMode componentsSeparatedByString:@"<&&>"];
+    lastChoosedMode = [savedArr lastObject];
+    
     if (lastChoosedMode.length) {
         if ([lastChoosedMode isEqualToString:name]) {
             self.lastChoosedIndex = indexPath.row;
@@ -121,12 +131,15 @@ static NSString *kLastMode = @"lastChooseMode";
 #pragma mark - Delegate
 
 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
+    
     RootModeCell *cell = [tableView cellForRowAtIndexPath:indexPath];
     NSDictionary *mode = [self.modeList objectAtIndex:indexPath.row];
     BOOL enable = [[mode objectForKey:@"enable"] boolValue];
     if (enable) {
         NSString *name = cell.mode;
-        [self setUserDefaultsValue:name forKey:kLastMode];
+        AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
+        appDelegate.shouldAutoShowModeVC = NO;
+        [self setUserDefaultsValue:[NSString stringWithFormat:@"%@<&&>%@",appDelegate.user,name] forKey:kLastMode];
         [self pushCurrentModeController:cell];
     }
 }

+ 126 - 0
RA Image/RA Image/Upload.storyboard

@@ -0,0 +1,126 @@
+<?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="retina5_5" orientation="landscape">
+        <adaptation id="fullscreen"/>
+    </device>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12088"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <scenes>
+        <!--Upload View Controller-->
+        <scene sceneID="fdB-I2-mlc">
+            <objects>
+                <viewController storyboardIdentifier="UploadViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="Vs6-tY-sxv" customClass="UploadViewController" sceneMemberID="viewController">
+                    <layoutGuides>
+                        <viewControllerLayoutGuide type="top" id="j2x-TC-dGc"/>
+                        <viewControllerLayoutGuide type="bottom" id="Lf0-ZV-MXy"/>
+                    </layoutGuides>
+                    <view key="view" contentMode="scaleToFill" id="aIg-QL-Ze6">
+                        <rect key="frame" x="0.0" y="0.0" width="736" height="414"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <subviews>
+                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="g67-RH-bZN">
+                                <rect key="frame" x="0.0" y="20" width="736" height="394"/>
+                                <subviews>
+                                    <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="80" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="u4f-TD-M09">
+                                        <rect key="frame" x="0.0" y="0.0" width="736" height="394"/>
+                                        <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                        <inset key="separatorInset" minX="10" minY="0.0" maxX="0.0" maxY="0.0"/>
+                                        <prototypes>
+                                            <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="UploadCell" rowHeight="80" id="p1C-Cy-yXq" customClass="UploadCell">
+                                                <rect key="frame" x="0.0" y="28" width="736" height="80"/>
+                                                <autoresizingMask key="autoresizingMask"/>
+                                                <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="p1C-Cy-yXq" id="tdd-mO-6vJ">
+                                                    <rect key="frame" x="0.0" y="0.0" width="736" height="80"/>
+                                                    <autoresizingMask key="autoresizingMask"/>
+                                                    <subviews>
+                                                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="QS8884456999666666" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0VW-ZZ-YcB">
+                                                            <rect key="frame" x="10" y="5" width="716" height="20"/>
+                                                            <constraints>
+                                                                <constraint firstAttribute="height" constant="20" id="bKP-Fo-NMF"/>
+                                                            </constraints>
+                                                            <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                                            <nil key="textColor"/>
+                                                            <nil key="highlightedColor"/>
+                                                        </label>
+                                                        <progressView opaque="NO" contentMode="scaleToFill" verticalHuggingPriority="750" progress="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="NYs-S2-H37">
+                                                            <rect key="frame" x="10" y="37.333333333333336" width="716" height="5"/>
+                                                            <constraints>
+                                                                <constraint firstAttribute="height" constant="5" id="QYr-rE-zSp"/>
+                                                            </constraints>
+                                                        </progressView>
+                                                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="99.9%" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="8Qr-iv-UsW">
+                                                            <rect key="frame" x="684" y="52.333333333333329" width="42" height="20.999999999999986"/>
+                                                            <constraints>
+                                                                <constraint firstAttribute="height" constant="21" id="8Tc-O3-69h"/>
+                                                                <constraint firstAttribute="width" constant="42" id="ljZ-ci-ehG"/>
+                                                            </constraints>
+                                                            <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                                                            <color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
+                                                            <nil key="highlightedColor"/>
+                                                        </label>
+                                                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Waiting" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="DED-nv-Rm5">
+                                                            <rect key="frame" x="10" y="52.333333333333329" width="664" height="20.999999999999986"/>
+                                                            <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                                                            <nil key="textColor"/>
+                                                            <nil key="highlightedColor"/>
+                                                        </label>
+                                                    </subviews>
+                                                    <constraints>
+                                                        <constraint firstItem="0VW-ZZ-YcB" firstAttribute="leading" secondItem="tdd-mO-6vJ" secondAttribute="leading" constant="10" id="FCo-NT-BOv"/>
+                                                        <constraint firstItem="8Qr-iv-UsW" firstAttribute="trailing" secondItem="NYs-S2-H37" secondAttribute="trailing" id="JGj-5b-hiQ"/>
+                                                        <constraint firstItem="DED-nv-Rm5" firstAttribute="height" secondItem="8Qr-iv-UsW" secondAttribute="height" id="JlG-aW-F59"/>
+                                                        <constraint firstAttribute="trailing" secondItem="0VW-ZZ-YcB" secondAttribute="trailing" constant="10" id="LM3-AQ-rZq"/>
+                                                        <constraint firstItem="DED-nv-Rm5" firstAttribute="trailing" secondItem="8Qr-iv-UsW" secondAttribute="leading" constant="-10" id="TIA-Cn-ROG"/>
+                                                        <constraint firstItem="NYs-S2-H37" firstAttribute="leading" secondItem="tdd-mO-6vJ" secondAttribute="leading" constant="10" id="YA4-TF-Sg3"/>
+                                                        <constraint firstAttribute="trailing" secondItem="NYs-S2-H37" secondAttribute="trailing" constant="10" id="bCR-Ap-65f"/>
+                                                        <constraint firstItem="0VW-ZZ-YcB" firstAttribute="top" secondItem="tdd-mO-6vJ" secondAttribute="top" constant="5" id="blc-vu-cfg"/>
+                                                        <constraint firstItem="DED-nv-Rm5" firstAttribute="leading" secondItem="NYs-S2-H37" secondAttribute="leading" id="fPh-dc-l8i"/>
+                                                        <constraint firstItem="NYs-S2-H37" firstAttribute="centerY" secondItem="tdd-mO-6vJ" secondAttribute="centerY" id="itJ-sP-86i"/>
+                                                        <constraint firstItem="8Qr-iv-UsW" firstAttribute="top" secondItem="NYs-S2-H37" secondAttribute="bottom" constant="10" id="k7O-MS-POX"/>
+                                                        <constraint firstItem="DED-nv-Rm5" firstAttribute="centerY" secondItem="8Qr-iv-UsW" secondAttribute="centerY" id="uPm-aG-F8H"/>
+                                                    </constraints>
+                                                </tableViewCellContentView>
+                                                <connections>
+                                                    <outlet property="nameLabel" destination="0VW-ZZ-YcB" id="Ta1-1H-jUh"/>
+                                                    <outlet property="progressIndicator" destination="8Qr-iv-UsW" id="jDN-NR-tA7"/>
+                                                    <outlet property="progressView" destination="NYs-S2-H37" id="HWA-Wj-UYx"/>
+                                                    <outlet property="stateLabel" destination="DED-nv-Rm5" id="NZE-TT-CzN"/>
+                                                </connections>
+                                            </tableViewCell>
+                                        </prototypes>
+                                        <connections>
+                                            <outlet property="dataSource" destination="Vs6-tY-sxv" id="xLY-s9-2X5"/>
+                                            <outlet property="delegate" destination="Vs6-tY-sxv" id="cEk-H5-xU4"/>
+                                        </connections>
+                                    </tableView>
+                                </subviews>
+                                <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                                <constraints>
+                                    <constraint firstItem="u4f-TD-M09" firstAttribute="top" secondItem="g67-RH-bZN" secondAttribute="top" id="2fC-Fh-6wV"/>
+                                    <constraint firstItem="u4f-TD-M09" firstAttribute="leading" secondItem="g67-RH-bZN" secondAttribute="leading" id="Ch0-jy-eXz"/>
+                                    <constraint firstAttribute="trailing" secondItem="u4f-TD-M09" secondAttribute="trailing" id="mnG-Od-jfb"/>
+                                    <constraint firstAttribute="bottom" secondItem="u4f-TD-M09" secondAttribute="bottom" id="ww5-O1-TmJ"/>
+                                </constraints>
+                            </view>
+                        </subviews>
+                        <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                        <constraints>
+                            <constraint firstItem="g67-RH-bZN" firstAttribute="leading" secondItem="aIg-QL-Ze6" secondAttribute="leading" id="44L-0R-Fbl"/>
+                            <constraint firstItem="g67-RH-bZN" firstAttribute="top" secondItem="j2x-TC-dGc" secondAttribute="bottom" id="6n2-Bq-Er8"/>
+                            <constraint firstAttribute="trailing" secondItem="g67-RH-bZN" secondAttribute="trailing" id="RPR-11-7rQ"/>
+                            <constraint firstItem="Lf0-ZV-MXy" firstAttribute="top" secondItem="g67-RH-bZN" secondAttribute="bottom" id="d0l-ZN-f7u"/>
+                        </constraints>
+                    </view>
+                    <connections>
+                        <outlet property="uploadTable" destination="u4f-TD-M09" id="nnG-Am-DZu"/>
+                    </connections>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="akp-uQ-YhO" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="-585" y="-38"/>
+        </scene>
+    </scenes>
+</document>

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

@@ -0,0 +1,17 @@
+//
+//  UploadCell.h
+//  RA Image
+//
+//  Created by Jack on 2017/5/5.
+//  Copyright © 2017年 USAI. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface UploadCell : UITableViewCell
+
+@property (nonatomic,copy) NSString *name;
+@property (nonatomic,assign) float progress;
+@property (nonatomic,copy) NSString *state;
+
+@end

+ 57 - 0
RA Image/RA Image/UploadCell.m

@@ -0,0 +1,57 @@
+//
+//  UploadCell.m
+//  RA Image
+//
+//  Created by Jack on 2017/5/5.
+//  Copyright © 2017年 USAI. All rights reserved.
+//
+
+#import "UploadCell.h"
+
+@interface UploadCell ()
+
+@property (strong, nonatomic) IBOutlet UILabel *nameLabel;
+@property (strong, nonatomic) IBOutlet UIProgressView *progressView;
+@property (strong, nonatomic) IBOutlet UILabel *progressIndicator;
+
+@property (strong, nonatomic) IBOutlet UILabel *stateLabel;
+
+@end
+
+@implementation UploadCell
+
+- (void)awakeFromNib {
+    [super awakeFromNib];
+    // Initialization code
+}
+
+- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
+    [super setSelected:selected animated:animated];
+
+    // Configure the view for the selected state
+}
+
+- (void)setName:(NSString *)name {
+    _name = name;
+    self.nameLabel.text = name;
+}
+
+- (void)setProgress:(float)progress {
+    if (progress < 0) {
+        progress = 0.0f;
+    }
+    if (progress > 1) {
+        progress = 1.0f;
+    }
+    _progress = progress;
+    self.progressView.progress = progress;
+    progress = progress * 100;
+    self.progressIndicator.text = [NSString stringWithFormat:@"%.1f%%",progress];
+}
+
+- (void)setState:(NSString *)state {
+    _state = state;
+    self.stateLabel.text = state;
+}
+
+@end

+ 13 - 0
RA Image/RA Image/UploadViewController.h

@@ -0,0 +1,13 @@
+//
+//  UploadViewController.h
+//  RA Image
+//
+//  Created by Jack on 2017/5/5.
+//  Copyright © 2017年 USAI. All rights reserved.
+//
+
+#import "BasicViewController.h"
+
+@interface UploadViewController : BasicViewController
+
+@end

+ 63 - 0
RA Image/RA Image/UploadViewController.m

@@ -0,0 +1,63 @@
+//
+//  UploadViewController.m
+//  RA Image
+//
+//  Created by Jack on 2017/5/5.
+//  Copyright © 2017年 USAI. All rights reserved.
+//
+
+#import "UploadViewController.h"
+#import "UploadCell.h"
+
+@interface UploadViewController ()<UITableViewDelegate,UITableViewDataSource>
+
+@property (strong, nonatomic) IBOutlet UITableView *uploadTable;
+
+@end
+
+@implementation UploadViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view.
+    [self.view insertSubview:[UIView new] atIndex:0];
+}
+
+- (void)didReceiveMemoryWarning {
+    [super didReceiveMemoryWarning];
+    // Dispose of any resources that can be recreated.
+}
+
+#pragma mark - TableView DataSource
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
+    return 10;
+}
+
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
+    UploadCell *cell = [tableView dequeueReusableCellWithIdentifier:@"UploadCell"];
+    
+    return cell;
+}
+
+#pragma mark - TableView Delegate
+
+- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
+    UploadCell *upCell = (UploadCell *)cell;
+    upCell.name = @"QS-WPS00889-OPQ-WQER";
+    upCell.progress = indexPath.row / 10.0;
+    upCell.state = @"Uploading...";
+    if (indexPath.row > 5) {
+        upCell.state = @"Waiting...";
+    }
+}
+
+- (void)tableView:(UITableView *)tableView didEndDisplayingCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
+    UploadCell *upCell = (UploadCell *)cell;
+    upCell.name = nil;
+    upCell.progress = 0;
+    upCell.state = nil;
+}
+
+
+@end