Просмотр исходного кода

1.修改iOS Apex Drivers Edit Order增加日前选择。

Pen Li 7 лет назад
Родитель
Сommit
9b5122f8e4

+ 26 - 10
Redant Drivers/Apex And Drivers.xcodeproj/project.pbxproj

@@ -162,6 +162,9 @@
 		42D8B8DB20C279AA001C125F /* RAOrderDetailViewController+TableViewDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 42D8B8DA20C279AA001C125F /* RAOrderDetailViewController+TableViewDataSource.m */; };
 		42D8B8DE20C279BA001C125F /* RAOrderDetailViewController+TableViewDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 42D8B8DD20C279BA001C125F /* RAOrderDetailViewController+TableViewDelegate.m */; };
 		42D8B8E020C28755001C125F /* fake_order_detail.json in Resources */ = {isa = PBXBuildFile; fileRef = 42D8B8DF20C28755001C125F /* fake_order_detail.json */; };
+		42DCCC3B218155620027A5BB /* RAEditDateModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 42DCCC3A218155620027A5BB /* RAEditDateModel.m */; };
+		42DCCC44218166110027A5BB /* RAEditDateCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 42DCCC43218166110027A5BB /* RAEditDateCell.m */; };
+		42DCCC4A21818D2F0027A5BB /* date.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 42DCCC4921818D2F0027A5BB /* date.storyboard */; };
 		42DFE265213F80AF000213C2 /* RAEmptyDataView.m in Sources */ = {isa = PBXBuildFile; fileRef = 42DFE262213F80AF000213C2 /* RAEmptyDataView.m */; };
 		42DFE266213F80AF000213C2 /* UIScrollView+Empty.m in Sources */ = {isa = PBXBuildFile; fileRef = 42DFE264213F80AF000213C2 /* UIScrollView+Empty.m */; };
 		42DFE26A213F821E000213C2 /* RAEmptyView.m in Sources */ = {isa = PBXBuildFile; fileRef = 42DFE269213F821E000213C2 /* RAEmptyView.m */; };
@@ -488,6 +491,11 @@
 		42D8B8DC20C279BA001C125F /* RAOrderDetailViewController+TableViewDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "RAOrderDetailViewController+TableViewDelegate.h"; sourceTree = "<group>"; };
 		42D8B8DD20C279BA001C125F /* RAOrderDetailViewController+TableViewDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "RAOrderDetailViewController+TableViewDelegate.m"; sourceTree = "<group>"; };
 		42D8B8DF20C28755001C125F /* fake_order_detail.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = fake_order_detail.json; sourceTree = "<group>"; };
+		42DCCC39218155620027A5BB /* RAEditDateModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RAEditDateModel.h; sourceTree = "<group>"; };
+		42DCCC3A218155620027A5BB /* RAEditDateModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RAEditDateModel.m; sourceTree = "<group>"; };
+		42DCCC42218166110027A5BB /* RAEditDateCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RAEditDateCell.h; sourceTree = "<group>"; };
+		42DCCC43218166110027A5BB /* RAEditDateCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RAEditDateCell.m; sourceTree = "<group>"; };
+		42DCCC4921818D2F0027A5BB /* date.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = date.storyboard; sourceTree = "<group>"; };
 		42DFE261213F80AF000213C2 /* RAEmptyDataView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RAEmptyDataView.h; sourceTree = "<group>"; };
 		42DFE262213F80AF000213C2 /* RAEmptyDataView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RAEmptyDataView.m; sourceTree = "<group>"; };
 		42DFE263213F80AF000213C2 /* UIScrollView+Empty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIScrollView+Empty.h"; sourceTree = "<group>"; };
@@ -611,7 +619,6 @@
 		420D10FF2133DFFF00149B37 /* Filter */ = {
 			isa = PBXGroup;
 			children = (
-				42C1B2712134F23000637085 /* DatePicker */,
 				420D11062133EE1A00149B37 /* Cell */,
 				420D11052133EE1500149B37 /* Model */,
 				420D11002133E02800149B37 /* RAOrderFilterViewController.h */,
@@ -838,6 +845,8 @@
 				4255EC8C20C5232C00E5DA24 /* RAEditLabelCell.m */,
 				4235FAB1213E25AC000B6672 /* RAEditSignatureCell.h */,
 				4235FAB2213E25AC000B6672 /* RAEditSignatureCell.m */,
+				42DCCC42218166110027A5BB /* RAEditDateCell.h */,
+				42DCCC43218166110027A5BB /* RAEditDateCell.m */,
 			);
 			path = Cell;
 			sourceTree = "<group>";
@@ -859,6 +868,8 @@
 				4235FAAF213E258A000B6672 /* RAEditSignatureModel.m */,
 				4235FAB4213E30CC000B6672 /* RAEditImageBaseModel.h */,
 				4235FAB5213E30CC000B6672 /* RAEditImageBaseModel.m */,
+				42DCCC39218155620027A5BB /* RAEditDateModel.h */,
+				42DCCC3A218155620027A5BB /* RAEditDateModel.m */,
 			);
 			path = Model;
 			sourceTree = "<group>";
@@ -1009,15 +1020,6 @@
 			path = Offline;
 			sourceTree = "<group>";
 		};
-		42C1B2712134F23000637085 /* DatePicker */ = {
-			isa = PBXGroup;
-			children = (
-				42C1B2722134F24C00637085 /* RADatePickerViewController.h */,
-				42C1B2732134F24C00637085 /* RADatePickerViewController.m */,
-			);
-			path = DatePicker;
-			sourceTree = "<group>";
-		};
 		42C6074921536E59003E5379 /* ExceptionHandler */ = {
 			isa = PBXGroup;
 			children = (
@@ -1187,6 +1189,16 @@
 			path = Collection;
 			sourceTree = "<group>";
 		};
+		42DCCC4821818CF90027A5BB /* DatePicker */ = {
+			isa = PBXGroup;
+			children = (
+				42C1B2722134F24C00637085 /* RADatePickerViewController.h */,
+				42C1B2732134F24C00637085 /* RADatePickerViewController.m */,
+				42DCCC4921818D2F0027A5BB /* date.storyboard */,
+			);
+			path = DatePicker;
+			sourceTree = "<group>";
+		};
 		42DFE260213F80AF000213C2 /* UIScrollVIew+Empty */ = {
 			isa = PBXGroup;
 			children = (
@@ -1253,6 +1265,7 @@
 		71EAA33020B9571B002F003C /* Apex And Drivers */ = {
 			isa = PBXGroup;
 			children = (
+				42DCCC4821818CF90027A5BB /* DatePicker */,
 				42C6074921536E59003E5379 /* ExceptionHandler */,
 				42DFE267213F81F8000213C2 /* EmptyView */,
 				42DFE260213F80AF000213C2 /* UIScrollVIew+Empty */,
@@ -1387,6 +1400,7 @@
 				4205FD4420C0F2C000DB42B4 /* Login.storyboard in Resources */,
 				42595995214905E400F7DD41 /* setting.json in Resources */,
 				4235FAB8213E581E000B6672 /* Signature.xcassets in Resources */,
+				42DCCC4A21818D2F0027A5BB /* date.storyboard in Resources */,
 				71EAA33920B9571B002F003C /* Main.storyboard in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
@@ -1498,6 +1512,7 @@
 				421C43ED217EEF0600D80B82 /* RAReachability.m in Sources */,
 				42C6074C21536E5A003E5379 /* RAExceptionHandler.m in Sources */,
 				42810FEE20E4C93400315156 /* RAHomeMoreViewController+TableDataSource.m in Sources */,
+				42DCCC44218166110027A5BB /* RAEditDateCell.m in Sources */,
 				4205FD6C20C13E0700DB42B4 /* RAHomeViewController+HomeTableDelegate.m in Sources */,
 				4235FA9A213E0CE9000B6672 /* RADetailMapCell.m in Sources */,
 				4255EC9F20C5287D00E5DA24 /* RAEditPhotoModel.m in Sources */,
@@ -1534,6 +1549,7 @@
 				42D187802140BACC00C822C0 /* RAEditRequiredAlert.m in Sources */,
 				425959862148F85100F7DD41 /* RASettingSwitchCell.m in Sources */,
 				4205FD6F20C13E2700DB42B4 /* RAHomeViewController+HomeTableDataSource.m in Sources */,
+				42DCCC3B218155620027A5BB /* RAEditDateModel.m in Sources */,
 				425959892148F85F00F7DD41 /* RASettingActionCell.m in Sources */,
 				42D8B8C520C24AB4001C125F /* RADetailLocationModel.m in Sources */,
 				4281100220E4D47000315156 /* JLRefreshHeader.m in Sources */,

+ 2 - 0
Redant Drivers/Apex And Drivers/Filter/DatePicker/RADatePickerViewController.h → Redant Drivers/Apex And Drivers/DatePicker/RADatePickerViewController.h

@@ -12,4 +12,6 @@
 
 + (void)presentDatePicker:(UIViewController *)viewController title:(NSString *)title withSetBlk:(void(^)(NSDate *date))blk;
 
++ (void)presentDatePicker:(UIViewController *)viewController title:(NSString *)title dateMode:(UIDatePickerMode)mode withSetBlk:(void(^)(NSDate *date))blk;
+
 @end

+ 14 - 3
Redant Drivers/Apex And Drivers/Filter/DatePicker/RADatePickerViewController.m → Redant Drivers/Apex And Drivers/DatePicker/RADatePickerViewController.m

@@ -10,23 +10,25 @@
 #import "RAPresentationController.h"
 
 @interface RADatePickerViewController () <UIViewControllerTransitioningDelegate>
+
 @property (strong, nonatomic) IBOutlet UILabel *titleLabel;
 @property (strong, nonatomic) IBOutlet UIDatePicker *datePicker;
 
 @property (nonatomic,copy) void(^blk)(NSDate *);
+@property (nonatomic,assign) UIDatePickerMode datePickerMode;
 
 @end
 
 @implementation RADatePickerViewController
 
 + (instancetype)viewControllerFromStoryboard {
-    RADatePickerViewController *datePickerVC = [[UIStoryboard storyboardWithName:@"orderFilter" bundle:nil] instantiateViewControllerWithIdentifier:[self storyboardID]];
+    RADatePickerViewController *datePickerVC = [[UIStoryboard storyboardWithName:@"date" bundle:nil] instantiateViewControllerWithIdentifier:[self storyboardID]];
     
     
     return datePickerVC;
 }
 
-+ (void)presentDatePicker:(UIViewController *)viewController title:(NSString *)title withSetBlk:(void(^)(NSDate *date))blk {
++ (void)presentDatePicker:(UIViewController *)viewController title:(NSString *)title dateMode:(UIDatePickerMode)mode withSetBlk:(void(^)(NSDate *date))blk {
     
     if (!viewController) {
         return;
@@ -36,14 +38,22 @@
     
     datePickerVC.title = title;
     datePickerVC.blk = blk;
+    datePickerVC.datePickerMode = mode;
     
     datePickerVC.transitioningDelegate = datePickerVC;
     datePickerVC.modalPresentationStyle = UIModalPresentationCustom;
-    datePickerVC.preferredContentSize = CGSizeMake(300, 315);
+    
+    CGFloat width = [UIScreen mainScreen].bounds.size.width - 40;
+    datePickerVC.preferredContentSize = CGSizeMake(width, 325);
     
     [viewController presentViewController:datePickerVC animated:YES completion:nil];
 }
 
++ (void)presentDatePicker:(UIViewController *)viewController title:(NSString *)title withSetBlk:(void(^)(NSDate *date))blk {
+    
+    [self presentDatePicker:viewController title:title dateMode:UIDatePickerModeDate withSetBlk:blk];
+}
+
 - (void)viewDidLoad {
     [super viewDidLoad];
     // Do any additional setup after loading the view.
@@ -51,6 +61,7 @@
     self.view.layer.cornerRadius = 5.0f;
     self.view.layer.masksToBounds = YES;
     
+    self.datePicker.datePickerMode = self.datePickerMode;
     self.titleLabel.text = self.title;
 }
 

+ 124 - 0
Redant Drivers/Apex And Drivers/DatePicker/date.storyboard

@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14313.18" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+    <device id="retina4_7" orientation="portrait">
+        <adaptation id="fullscreen"/>
+    </device>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14283.14"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <scenes>
+        <!--Date Picker View Controller-->
+        <scene sceneID="Zyp-gu-v0h">
+            <objects>
+                <viewController storyboardIdentifier="RADatePickerViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="UZ8-Ru-lSY" customClass="RADatePickerViewController" sceneMemberID="viewController">
+                    <view key="view" contentMode="scaleToFill" id="3G4-y1-fay">
+                        <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <subviews>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Title" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Fbi-R0-4N2">
+                                <rect key="frame" x="5" y="25" width="365" height="40"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="40" id="Ly9-61-pLF"/>
+                                </constraints>
+                                <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                <nil key="textColor"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="O9N-iu-Ek5">
+                                <rect key="frame" x="0.0" y="64" width="375" height="0.5"/>
+                                <color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="0.5" id="0H3-fw-1wB"/>
+                                </constraints>
+                            </view>
+                            <datePicker contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" datePickerMode="date" minuteInterval="1" translatesAutoresizingMaskIntoConstraints="NO" id="p97-x3-1d5">
+                                <rect key="frame" x="0.0" y="65" width="375" height="238"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="238" id="r3b-tc-qku"/>
+                                </constraints>
+                                <date key="date" timeIntervalSinceReferenceDate="557120579.94449699">
+                                    <!--2018-08-28 03:42:59 +0000-->
+                                </date>
+                            </datePicker>
+                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="cBT-vV-Li8">
+                                <rect key="frame" x="0.0" y="303" width="375" height="41"/>
+                                <subviews>
+                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="LjX-WA-ZSH">
+                                        <rect key="frame" x="188" y="1" width="187" height="40"/>
+                                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="40" id="Tli-gy-iyX"/>
+                                        </constraints>
+                                        <state key="normal" title="Set">
+                                            <color key="titleColor" red="1" green="0.1047433005" blue="0.075207091899999995" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                        </state>
+                                        <connections>
+                                            <action selector="setBtnClick:" destination="UZ8-Ru-lSY" eventType="touchUpInside" id="U7T-k0-wnb"/>
+                                        </connections>
+                                    </button>
+                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="7Bd-bE-hfF">
+                                        <rect key="frame" x="0.0" y="1" width="187" height="40"/>
+                                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                        <constraints>
+                                            <constraint firstAttribute="height" constant="40" id="Ug3-7k-Rpy"/>
+                                        </constraints>
+                                        <state key="normal" title="Cancel"/>
+                                        <connections>
+                                            <action selector="cancelBtnClick:" destination="UZ8-Ru-lSY" eventType="touchUpInside" id="yh6-LK-cR2"/>
+                                        </connections>
+                                    </button>
+                                </subviews>
+                                <color key="backgroundColor" red="0.9322579339" green="0.9322579339" blue="0.9322579339" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="41" id="0ED-vX-XfU"/>
+                                    <constraint firstItem="LjX-WA-ZSH" firstAttribute="leading" secondItem="7Bd-bE-hfF" secondAttribute="trailing" constant="1" id="39B-8l-8He"/>
+                                    <constraint firstItem="LjX-WA-ZSH" firstAttribute="top" secondItem="cBT-vV-Li8" secondAttribute="top" constant="1" id="CUE-qo-Ed6"/>
+                                    <constraint firstItem="LjX-WA-ZSH" firstAttribute="width" secondItem="7Bd-bE-hfF" secondAttribute="width" id="d7B-qa-xgc"/>
+                                    <constraint firstAttribute="trailing" secondItem="LjX-WA-ZSH" secondAttribute="trailing" id="dTk-fs-BGS"/>
+                                    <constraint firstItem="7Bd-bE-hfF" firstAttribute="top" secondItem="cBT-vV-Li8" secondAttribute="top" constant="1" id="ifC-kU-vkx"/>
+                                    <constraint firstItem="7Bd-bE-hfF" firstAttribute="leading" secondItem="cBT-vV-Li8" secondAttribute="leading" id="uHP-vF-oUL"/>
+                                </constraints>
+                            </view>
+                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Ei2-z6-v8t">
+                                <rect key="frame" x="0.0" y="303" width="375" height="0.5"/>
+                                <color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="0.5" id="ShW-cR-veE"/>
+                                </constraints>
+                            </view>
+                        </subviews>
+                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                        <gestureRecognizers/>
+                        <constraints>
+                            <constraint firstItem="p97-x3-1d5" firstAttribute="top" secondItem="Fbi-R0-4N2" secondAttribute="bottom" id="2XR-9y-ej4"/>
+                            <constraint firstItem="O9N-iu-Ek5" firstAttribute="leading" secondItem="xiG-YA-3Yu" secondAttribute="leading" id="2lx-uQ-mdE"/>
+                            <constraint firstItem="xiG-YA-3Yu" firstAttribute="trailing" secondItem="cBT-vV-Li8" secondAttribute="trailing" id="6E2-Nw-A2p"/>
+                            <constraint firstItem="cBT-vV-Li8" firstAttribute="leading" secondItem="xiG-YA-3Yu" secondAttribute="leading" id="6J3-31-uJT"/>
+                            <constraint firstItem="Fbi-R0-4N2" firstAttribute="top" secondItem="xiG-YA-3Yu" secondAttribute="top" constant="5" id="Nkn-02-9dp"/>
+                            <constraint firstItem="xiG-YA-3Yu" firstAttribute="trailing" secondItem="Fbi-R0-4N2" secondAttribute="trailing" constant="5" id="Xk4-1K-DGL"/>
+                            <constraint firstItem="xiG-YA-3Yu" firstAttribute="trailing" secondItem="O9N-iu-Ek5" secondAttribute="trailing" id="Z5t-sR-OiV"/>
+                            <constraint firstItem="O9N-iu-Ek5" firstAttribute="top" secondItem="Fbi-R0-4N2" secondAttribute="bottom" constant="-1" id="dKu-nW-qid"/>
+                            <constraint firstItem="p97-x3-1d5" firstAttribute="trailing" secondItem="xiG-YA-3Yu" secondAttribute="trailing" id="il2-tV-eIZ"/>
+                            <constraint firstItem="cBT-vV-Li8" firstAttribute="top" secondItem="p97-x3-1d5" secondAttribute="bottom" id="pLe-ib-Aey"/>
+                            <constraint firstItem="Ei2-z6-v8t" firstAttribute="leading" secondItem="xiG-YA-3Yu" secondAttribute="leading" id="pqS-vs-71I"/>
+                            <constraint firstItem="Fbi-R0-4N2" firstAttribute="leading" secondItem="xiG-YA-3Yu" secondAttribute="leading" constant="5" id="prt-yY-H7F"/>
+                            <constraint firstItem="xiG-YA-3Yu" firstAttribute="trailing" secondItem="Ei2-z6-v8t" secondAttribute="trailing" id="qNA-vg-KJz"/>
+                            <constraint firstItem="Ei2-z6-v8t" firstAttribute="top" secondItem="cBT-vV-Li8" secondAttribute="top" id="sY1-6d-EqB"/>
+                            <constraint firstItem="p97-x3-1d5" firstAttribute="leading" secondItem="xiG-YA-3Yu" secondAttribute="leading" id="tbN-9P-LLx"/>
+                        </constraints>
+                        <viewLayoutGuide key="safeArea" id="xiG-YA-3Yu"/>
+                    </view>
+                    <connections>
+                        <outlet property="datePicker" destination="p97-x3-1d5" id="Ca6-aZ-Jl3"/>
+                        <outlet property="titleLabel" destination="Fbi-R0-4N2" id="qvH-GX-0Kx"/>
+                    </connections>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="ggs-ni-j3T" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="549.60000000000002" y="45.42728635682159"/>
+        </scene>
+    </scenes>
+</document>

+ 9 - 96
Redant Drivers/Apex And Drivers/Filter/orderFilter.storyboard

@@ -19,10 +19,10 @@
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
                             <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="a7i-EN-gze">
-                                <rect key="frame" x="0.0" y="20" width="600" height="580"/>
+                                <rect key="frame" x="0.0" y="20" width="375" height="647"/>
                                 <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                 <view key="tableFooterView" contentMode="scaleToFill" id="goQ-QF-OSZ">
-                                    <rect key="frame" x="0.0" y="178" width="600" height="44"/>
+                                    <rect key="frame" x="0.0" y="178" width="375" height="44"/>
                                     <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                     <subviews>
                                         <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="7Rj-Wx-DTQ">
@@ -55,10 +55,10 @@
                                 </view>
                                 <prototypes>
                                     <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="RAOrderFilterStatusCell" rowHeight="50" id="hjv-Nk-Dm5" customClass="RAOrderFilterStatusCell">
-                                        <rect key="frame" x="0.0" y="28" width="600" height="50"/>
+                                        <rect key="frame" x="0.0" y="28" width="375" height="50"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="hjv-Nk-Dm5" id="FFw-dW-CKf">
-                                            <rect key="frame" x="0.0" y="0.0" width="600" height="49.5"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="375" height="49.5"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Y6T-Kp-z23">
@@ -89,10 +89,10 @@
                                         </connections>
                                     </tableViewCell>
                                     <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="RAOrderFilterDateCell" rowHeight="50" id="CrM-Nd-7k0" customClass="RAOrderFilterDateCell">
-                                        <rect key="frame" x="0.0" y="78" width="600" height="50"/>
+                                        <rect key="frame" x="0.0" y="78" width="375" height="50"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="CrM-Nd-7k0" id="ZC9-gt-wnt">
-                                            <rect key="frame" x="0.0" y="0.0" width="600" height="49.5"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="375" height="49.5"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Qyi-QK-7XW">
@@ -129,14 +129,14 @@
                                         </connections>
                                     </tableViewCell>
                                     <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="RAOrderFilterInputCell" rowHeight="50" id="7T8-AK-bBK" customClass="RAOrderFilterInputCell">
-                                        <rect key="frame" x="0.0" y="128" width="600" height="50"/>
+                                        <rect key="frame" x="0.0" y="128" width="375" height="50"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="7T8-AK-bBK" id="mag-H5-gTb">
-                                            <rect key="frame" x="0.0" y="0.0" width="600" height="49.5"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="375" height="49.5"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" clearButtonMode="whileEditing" translatesAutoresizingMaskIntoConstraints="NO" id="Z7R-ah-wFK">
-                                                    <rect key="frame" x="5" y="10" width="365" height="30"/>
+                                                    <rect key="frame" x="5" y="10" width="590" height="30"/>
                                                     <nil key="textColor"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="14"/>
                                                     <textInputTraits key="textInputTraits"/>
@@ -191,93 +191,6 @@
             </objects>
             <point key="canvasLocation" x="-172" y="46.326836581709152"/>
         </scene>
-        <!--Date Picker View Controller-->
-        <scene sceneID="e5E-Qz-Lpl">
-            <objects>
-                <viewController storyboardIdentifier="RADatePickerViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="ve0-TL-ioM" customClass="RADatePickerViewController" sceneMemberID="viewController">
-                    <view key="view" contentMode="scaleToFill" id="w0j-gm-hR4">
-                        <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
-                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                        <subviews>
-                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Title" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2g4-Gg-0Ru">
-                                <rect key="frame" x="5" y="25" width="590" height="21"/>
-                                <fontDescription key="fontDescription" type="boldSystem" pointSize="18"/>
-                                <nil key="textColor"/>
-                                <nil key="highlightedColor"/>
-                            </label>
-                            <datePicker contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" datePickerMode="date" minuteInterval="1" translatesAutoresizingMaskIntoConstraints="NO" id="6hd-0G-aqr">
-                                <rect key="frame" x="0.0" y="56" width="600" height="238"/>
-                                <constraints>
-                                    <constraint firstAttribute="height" constant="238" id="Qtz-qV-kzO"/>
-                                </constraints>
-                                <date key="date" timeIntervalSinceReferenceDate="557120579.94449699">
-                                    <!--2018-08-28 03:42:59 +0000-->
-                                </date>
-                            </datePicker>
-                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="6Ff-xa-iJY">
-                                <rect key="frame" x="0.0" y="294" width="600" height="41"/>
-                                <subviews>
-                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="88Y-5e-Ze7">
-                                        <rect key="frame" x="300.5" y="1" width="299.5" height="40"/>
-                                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
-                                        <constraints>
-                                            <constraint firstAttribute="height" constant="40" id="iuk-rP-hZ4"/>
-                                        </constraints>
-                                        <state key="normal" title="Set">
-                                            <color key="titleColor" red="1" green="0.1047433005" blue="0.075207091899999995" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-                                        </state>
-                                        <connections>
-                                            <action selector="setBtnClick:" destination="ve0-TL-ioM" eventType="touchUpInside" id="162-qt-INl"/>
-                                        </connections>
-                                    </button>
-                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="7Vh-DW-0uh">
-                                        <rect key="frame" x="0.0" y="1" width="299.5" height="40"/>
-                                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
-                                        <constraints>
-                                            <constraint firstAttribute="height" constant="40" id="qeM-pM-TfW"/>
-                                        </constraints>
-                                        <state key="normal" title="Cancel"/>
-                                        <connections>
-                                            <action selector="cancelBtnClick:" destination="ve0-TL-ioM" eventType="touchUpInside" id="EWW-t2-k52"/>
-                                        </connections>
-                                    </button>
-                                </subviews>
-                                <color key="backgroundColor" red="0.93225793393782386" green="0.93225793393782386" blue="0.93225793393782386" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-                                <constraints>
-                                    <constraint firstItem="88Y-5e-Ze7" firstAttribute="top" secondItem="6Ff-xa-iJY" secondAttribute="top" constant="1" id="1lS-uX-Gas"/>
-                                    <constraint firstItem="7Vh-DW-0uh" firstAttribute="top" secondItem="6Ff-xa-iJY" secondAttribute="top" constant="1" id="4Pw-Te-Etl"/>
-                                    <constraint firstItem="88Y-5e-Ze7" firstAttribute="leading" secondItem="7Vh-DW-0uh" secondAttribute="trailing" constant="1" id="8Cj-Yh-C3F"/>
-                                    <constraint firstAttribute="trailing" secondItem="88Y-5e-Ze7" secondAttribute="trailing" id="PLN-ZD-4i0"/>
-                                    <constraint firstItem="88Y-5e-Ze7" firstAttribute="width" secondItem="7Vh-DW-0uh" secondAttribute="width" id="gQg-3B-Gt7"/>
-                                    <constraint firstItem="7Vh-DW-0uh" firstAttribute="leading" secondItem="6Ff-xa-iJY" secondAttribute="leading" id="hkJ-P2-js8"/>
-                                    <constraint firstAttribute="height" constant="41" id="w59-g8-CXO"/>
-                                </constraints>
-                            </view>
-                        </subviews>
-                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
-                        <gestureRecognizers/>
-                        <constraints>
-                            <constraint firstItem="jlX-fr-QNH" firstAttribute="trailing" secondItem="6Ff-xa-iJY" secondAttribute="trailing" id="QnX-a1-Otu"/>
-                            <constraint firstItem="6Ff-xa-iJY" firstAttribute="top" secondItem="6hd-0G-aqr" secondAttribute="bottom" id="Vu0-22-LJS"/>
-                            <constraint firstItem="6Ff-xa-iJY" firstAttribute="leading" secondItem="jlX-fr-QNH" secondAttribute="leading" id="XyY-gg-Zf4"/>
-                            <constraint firstItem="2g4-Gg-0Ru" firstAttribute="leading" secondItem="jlX-fr-QNH" secondAttribute="leading" constant="5" id="ZK9-zP-cW8"/>
-                            <constraint firstItem="2g4-Gg-0Ru" firstAttribute="top" secondItem="jlX-fr-QNH" secondAttribute="top" constant="5" id="e1c-8X-6L3"/>
-                            <constraint firstItem="jlX-fr-QNH" firstAttribute="trailing" secondItem="2g4-Gg-0Ru" secondAttribute="trailing" constant="5" id="hUC-3i-Prq"/>
-                            <constraint firstItem="6hd-0G-aqr" firstAttribute="trailing" secondItem="jlX-fr-QNH" secondAttribute="trailing" id="mP2-Ml-cLT"/>
-                            <constraint firstItem="6hd-0G-aqr" firstAttribute="leading" secondItem="jlX-fr-QNH" secondAttribute="leading" id="pp6-lH-Zi2"/>
-                            <constraint firstItem="6hd-0G-aqr" firstAttribute="top" secondItem="2g4-Gg-0Ru" secondAttribute="bottom" constant="10" id="qme-zl-aRs"/>
-                        </constraints>
-                        <viewLayoutGuide key="safeArea" id="jlX-fr-QNH"/>
-                    </view>
-                    <connections>
-                        <outlet property="datePicker" destination="6hd-0G-aqr" id="Zl0-6V-sbi"/>
-                        <outlet property="titleLabel" destination="2g4-Gg-0Ru" id="cg8-4j-w7r"/>
-                    </connections>
-                </viewController>
-                <placeholder placeholderIdentifier="IBFirstResponder" id="0Ay-7l-b8r" userLabel="First Responder" sceneMemberID="firstResponder"/>
-            </objects>
-            <point key="canvasLocation" x="549.60000000000002" y="45.42728635682159"/>
-        </scene>
     </scenes>
     <resources>
         <image name="check_mark" width="20" height="20"/>

+ 28 - 0
Redant Drivers/Apex And Drivers/Update/Cell/RAEditDateCell.h

@@ -0,0 +1,28 @@
+//
+//  RAEditDateCell.h
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/10/25.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@class RAEditDateModel,RAEditDateCell;
+
+@protocol RAEditDateCellDelegate <NSObject>
+
+- (void)dateCell:(RAEditDateCell *)cell didClickForModel:(RAEditDateModel *)model;
+
+@end
+
+@interface RAEditDateCell : UITableViewCell
+
+@property (nonatomic,weak) RAEditDateModel *model;
+@property (nonatomic,weak) id<RAEditDateCellDelegate> delegate;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 78 - 0
Redant Drivers/Apex And Drivers/Update/Cell/RAEditDateCell.m

@@ -0,0 +1,78 @@
+//
+//  RAEditDateCell.m
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/10/25.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RAEditDateCell.h"
+#import "RAEditDateModel.h"
+
+@interface RAEditDateCell ()<RAEditModelDelegate>
+
+@property (nonatomic,strong) IBOutlet UILabel *titleLabel;
+@property (nonatomic,strong) IBOutlet UILabel *dateLabel;
+@property (nonatomic,strong) IBOutlet UILabel *startLabel;
+@property (nonatomic,strong) IBOutlet UIButton *datePickerBtn;
+
+@end
+
+@implementation RAEditDateCell
+
+- (void)awakeFromNib {
+    [super awakeFromNib];
+    // Initialization code
+    
+    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapClick:)];
+    [self.contentView addGestureRecognizer:tap];
+    
+    self.model = nil;
+}
+
+- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
+    [super setSelected:selected animated:animated];
+
+    // Configure the view for the selected state
+}
+
+- (void)prepareForReuse {
+    [super prepareForReuse];
+    
+    self.model = nil;
+    self.delegate = nil;
+}
+
+- (void)setModel:(RAEditDateModel *)model {
+    if (_model.delegate) {
+        _model.delegate = nil;
+    }
+    _model = model;
+    if (_model) {
+        _model.delegate = self;
+    }
+    
+    [self refresh];
+}
+
+- (void)refresh {
+    self.titleLabel.text = self.model.title;
+    self.startLabel.hidden = !self.model.required;
+    self.dateLabel.text = self.model.value;
+}
+
+#pragma mark - Action
+
+- (void)tapClick:(UITapGestureRecognizer *)tap {
+    if (self.delegate && [self.delegate respondsToSelector:@selector(dateCell:didClickForModel:)]) {
+        [self.delegate dateCell:self didClickForModel:self.model];
+    }
+}
+
+- (IBAction)datePickerBtnClick:(UIButton *)sender {
+    if (self.delegate && [self.delegate respondsToSelector:@selector(dateCell:didClickForModel:)]) {
+        [self.delegate dateCell:self didClickForModel:self.model];
+    }
+}
+
+@end

+ 69 - 5
Redant Drivers/Apex And Drivers/Update/Edit.storyboard

@@ -1,12 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14313.18" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
     <device id="retina4_7" orientation="portrait">
         <adaptation id="fullscreen"/>
     </device>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
-        <capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14283.14"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -78,7 +77,7 @@
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Qmw-jO-NVe">
-                                                    <rect key="frame" x="5" y="-0.5" width="42" height="100"/>
+                                                    <rect key="frame" x="5" y="0.0" width="42" height="99.5"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                                     <nil key="textColor"/>
                                                     <nil key="highlightedColor"/>
@@ -91,7 +90,7 @@
                                                     </constraints>
                                                 </imageView>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="*" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tbt-gp-C5J">
-                                                    <rect key="frame" x="52" y="36" width="8" height="21"/>
+                                                    <rect key="frame" x="52" y="36.5" width="8" height="21"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                                     <color key="textColor" red="1" green="0.1047433005" blue="0.075207091899999995" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                                     <nil key="highlightedColor"/>
@@ -245,6 +244,68 @@
                                             <outlet property="titleLabel" destination="3pu-Ya-6af" id="vPH-wV-7Ey"/>
                                         </connections>
                                     </tableViewCell>
+                                    <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="RAEditDateCell" rowHeight="55" id="b5o-NB-xXS" customClass="RAEditDateCell">
+                                        <rect key="frame" x="0.0" y="523" width="375" height="55"/>
+                                        <autoresizingMask key="autoresizingMask"/>
+                                        <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="b5o-NB-xXS" id="Rxx-xH-4mP">
+                                            <rect key="frame" x="0.0" y="0.0" width="375" height="54.5"/>
+                                            <autoresizingMask key="autoresizingMask"/>
+                                            <subviews>
+                                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="877-kV-pfE">
+                                                    <rect key="frame" x="5" y="5" width="42" height="21"/>
+                                                    <constraints>
+                                                        <constraint firstAttribute="height" constant="21" id="Boo-cS-pY0"/>
+                                                    </constraints>
+                                                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                                    <nil key="textColor"/>
+                                                    <nil key="highlightedColor"/>
+                                                </label>
+                                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Urz-aO-cuz">
+                                                    <rect key="frame" x="5" y="31" width="330" height="18"/>
+                                                    <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                                                    <nil key="textColor"/>
+                                                    <nil key="highlightedColor"/>
+                                                </label>
+                                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="*" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="OjZ-5U-5uD">
+                                                    <rect key="frame" x="52" y="2" width="8" height="21"/>
+                                                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                                    <color key="textColor" red="1" green="0.1047433005" blue="0.075207091899999995" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                                    <nil key="highlightedColor"/>
+                                                </label>
+                                                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="i0H-tc-GBN">
+                                                    <rect key="frame" x="340" y="12.5" width="30" height="30"/>
+                                                    <constraints>
+                                                        <constraint firstAttribute="height" constant="30" id="A8j-lk-laU"/>
+                                                        <constraint firstAttribute="width" constant="30" id="Tra-px-j9M"/>
+                                                    </constraints>
+                                                    <state key="normal" image="btn_scanner"/>
+                                                    <connections>
+                                                        <action selector="datePickerBtnClick:" destination="b5o-NB-xXS" eventType="touchUpInside" id="KSB-Lh-3WQ"/>
+                                                    </connections>
+                                                </button>
+                                            </subviews>
+                                            <constraints>
+                                                <constraint firstItem="OjZ-5U-5uD" firstAttribute="leading" secondItem="877-kV-pfE" secondAttribute="trailing" constant="5" id="E4t-7L-L3f"/>
+                                                <constraint firstItem="i0H-tc-GBN" firstAttribute="leading" secondItem="Urz-aO-cuz" secondAttribute="trailing" constant="5" id="IKl-ZA-y7m"/>
+                                                <constraint firstItem="877-kV-pfE" firstAttribute="top" secondItem="Rxx-xH-4mP" secondAttribute="top" constant="5" id="NCc-dx-C6M"/>
+                                                <constraint firstAttribute="bottom" secondItem="Urz-aO-cuz" secondAttribute="bottom" constant="5.5" id="Nki-e0-D91"/>
+                                                <constraint firstItem="Urz-aO-cuz" firstAttribute="top" secondItem="877-kV-pfE" secondAttribute="bottom" constant="5" id="OzZ-QE-uvp"/>
+                                                <constraint firstItem="i0H-tc-GBN" firstAttribute="centerY" secondItem="Rxx-xH-4mP" secondAttribute="centerY" id="RIk-Rw-eDH"/>
+                                                <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="OjZ-5U-5uD" secondAttribute="trailing" constant="5" id="dgM-YQ-7eq"/>
+                                                <constraint firstAttribute="trailing" secondItem="i0H-tc-GBN" secondAttribute="trailing" constant="5" id="eSh-WN-DOb"/>
+                                                <constraint firstItem="OjZ-5U-5uD" firstAttribute="top" secondItem="Rxx-xH-4mP" secondAttribute="top" constant="2" id="ij3-sW-kEX"/>
+                                                <constraint firstItem="i0H-tc-GBN" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="OjZ-5U-5uD" secondAttribute="trailing" constant="5" id="lVp-Si-4A5"/>
+                                                <constraint firstItem="Urz-aO-cuz" firstAttribute="leading" secondItem="877-kV-pfE" secondAttribute="leading" id="qMt-p5-gtZ"/>
+                                                <constraint firstItem="877-kV-pfE" firstAttribute="leading" secondItem="Rxx-xH-4mP" secondAttribute="leading" constant="5" id="wx7-lV-Dks"/>
+                                            </constraints>
+                                        </tableViewCellContentView>
+                                        <connections>
+                                            <outlet property="dateLabel" destination="Urz-aO-cuz" id="Ea0-Di-iMC"/>
+                                            <outlet property="datePickerBtn" destination="i0H-tc-GBN" id="5go-h7-xT6"/>
+                                            <outlet property="startLabel" destination="OjZ-5U-5uD" id="iaP-2L-Boj"/>
+                                            <outlet property="titleLabel" destination="877-kV-pfE" id="MuA-bl-qzb"/>
+                                        </connections>
+                                    </tableViewCell>
                                 </prototypes>
                                 <connections>
                                     <outlet property="dataSource" destination="IN3-1q-AsB" id="j4i-ZN-kfv"/>
@@ -349,4 +410,7 @@
             <point key="canvasLocation" x="790.39999999999998" y="170.91454272863569"/>
         </scene>
     </scenes>
+    <resources>
+        <image name="btn_scanner" width="30" height="30"/>
+    </resources>
 </document>

+ 7 - 1
Redant Drivers/Apex And Drivers/Update/Model/RAEditBaseModel.h

@@ -14,7 +14,8 @@ typedef enum {
     RAEditTypeInput = 1,
     RAEditTypeMultInput = 2,
     RAEditTypePhoto = 3,
-    RAEditTypeSignature = 4
+    RAEditTypeSignature = 4,
+    RAEditTypeDate = 5
     
 } RAEditType;
 
@@ -34,4 +35,9 @@ typedef enum {
 
 @property (nonatomic,weak) id<RAEditModelDelegate> delegate;
 
+@property (nonatomic,strong) id expand;
+@property (nonatomic,assign) BOOL autofill;
+
+- (void)updateDefaultValue;
+
 @end

+ 12 - 0
Redant Drivers/Apex And Drivers/Update/Model/RAEditBaseModel.m

@@ -14,6 +14,14 @@
     
 }
 
+- (void)setValuesForKeysWithDictionary:(NSDictionary<NSString *,id> *)keyedValues {
+    [super setValuesForKeysWithDictionary:keyedValues];
+    
+    if (self.autofill) {
+        [self updateDefaultValue];
+    }
+}
+
 - (void)setTitle:(NSString *)title {
     _title = title;
     
@@ -22,4 +30,8 @@
     }
 }
 
+- (void)updateDefaultValue {
+
+}
+
 @end

+ 26 - 0
Redant Drivers/Apex And Drivers/Update/Model/RAEditDateModel.h

@@ -0,0 +1,26 @@
+//
+//  RAEditDateModel.h
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/10/25.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RAEditBaseModel.h"
+
+typedef enum {
+    
+    RAEditTypeModeTime = 0,
+    RAEditTypeModeDate = 1,
+    RAEditTypeModeDateAndTime = 2
+    
+} RAEditTypeMode;
+
+@interface RAEditDateModel : RAEditBaseModel
+
+@property (nonatomic,copy) NSString *format;
+@property (nonatomic,copy) NSString *value;
+@property (nonatomic,assign) RAEditTypeMode mode;
+
+@end
+

+ 34 - 0
Redant Drivers/Apex And Drivers/Update/Model/RAEditDateModel.m

@@ -0,0 +1,34 @@
+//
+//  RAEditDateModel.m
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/10/25.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RAEditDateModel.h"
+
+@implementation RAEditDateModel
+
+- (CGFloat)height {
+    return 55.0f;
+}
+
+- (void)updateDefaultValue {
+    
+    NSDate *date = [NSDate date];
+    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
+    formatter.dateFormat = self.format;
+    
+    self.value = [formatter stringFromDate:date];
+}
+
+- (void)setValue:(NSString *)value {
+    _value = value;
+    
+    if (self.delegate && [self.delegate respondsToSelector:@selector(refresh)]) {
+        [self.delegate refresh];
+    }
+}
+
+@end

+ 2 - 1
Redant Drivers/Apex And Drivers/Update/RAOrderEditViewController+TableDataSource.h

@@ -11,7 +11,8 @@
 #import "RAEditMultInputCell.h"
 #import "RAEditPhotoCell.h"
 #import "RAEditSignatureCell.h"
+#import "RAEditDateCell.h"
 
-@interface RAOrderEditViewController (TableDataSource) <UITableViewDataSource,RAEditInputDelegate,RAEditMultInputDelegate,RAEditPhotoCellDelegate,RAEditSignatureCellDelegate>
+@interface RAOrderEditViewController (TableDataSource) <UITableViewDataSource,RAEditInputDelegate,RAEditMultInputDelegate,RAEditPhotoCellDelegate,RAEditSignatureCellDelegate,RAEditDateCellDelegate>
 
 @end

+ 62 - 1
Redant Drivers/Apex And Drivers/Update/RAOrderEditViewController+TableDataSource.m

@@ -10,12 +10,12 @@
 
 #import "RAEditLabelCell.h"
 
-
 #import "RAEditInputModel.h"
 #import "RAEditMultInputModel.h"
 #import "RAEditLabelModel.h"
 #import "RAEditPhotoModel.h"
 #import "RAEditSignatureModel.h"
+#import "RAEditDateModel.h"
 
 #import "RAQRCodeScannerViewController.h"
 #import "RACameraViewController.h"
@@ -23,6 +23,8 @@
 #import "SignatureViewController.h"
 #import "UIImage+RedAnt.h"
 
+#import "RADatePickerViewController.h"
+
 
 @implementation RAOrderEditViewController (TableDataSource)
 
@@ -79,6 +81,14 @@
             return cell;
         }
             break;
+        case RAEditTypeDate: {
+            RAEditDateModel *dateModel = (RAEditDateModel *)model;
+            RAEditDateCell *cell = [tableView dequeueReusableCellWithIdentifier:@"RAEditDateCell" forIndexPath:indexPath];
+            cell.model = dateModel;
+            cell.delegate = self;
+            return cell;
+        }
+            break;
             
         default:
             break;
@@ -166,6 +176,21 @@
         {
             if(img!=nil) {
                 model.signature = img;
+                if (model.expand) {
+                    
+                    if ([model.expand isKindOfClass:[NSDictionary class]]) {
+                        
+                        NSIndexPath *indexPath = [self.tableView indexPathForCell:cell];
+                        [self expandIndexPath:indexPath withJsonItem:model.expand];
+                        
+                    } else if ([model.expand isKindOfClass:[RAEditBaseModel class]]) {
+                        
+                        if (((RAEditBaseModel *)model.expand).autofill) {
+                            [((RAEditBaseModel *)model.expand) updateDefaultValue];
+                        }
+                    }
+                    
+                }
             }
         };
         [self.navigationController pushViewController:vc animated:NO];
@@ -173,4 +198,40 @@
     }
 }
 
+#pragma mark - DateCellDelegate
+
+- (void)dateCell:(RAEditDateCell *)cell didClickForModel:(RAEditDateModel *)model {
+    if (model) {
+        
+        UIDatePickerMode mode = UIDatePickerModeDate;
+        switch (model.mode) {
+            case RAEditTypeModeTime: {
+                mode = UIDatePickerModeTime;
+            }
+                break;
+            case RAEditTypeModeDate: {
+                mode = UIDatePickerModeDate;
+            }
+                break;
+            case RAEditTypeModeDateAndTime: {
+                mode = UIDatePickerModeDateAndTime;
+            }
+                break;
+                
+            default:
+                break;
+        }
+        
+        [RADatePickerViewController presentDatePicker:self title:model.title dateMode:mode withSetBlk:^(NSDate *date) {
+            
+            NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
+            formatter.timeZone = [NSTimeZone localTimeZone];
+            formatter.dateFormat = model.format;
+            NSString *dateStr = [formatter stringFromDate:date];
+            
+            model.value = dateStr;
+        }];
+    }
+}
+
 @end

+ 5 - 0
Redant Drivers/Apex And Drivers/Update/RAOrderEditViewController.h

@@ -9,6 +9,7 @@
 #import "RABaseViewController.h"
 
 @class RAEditBaseModel;
+
 @interface RAOrderEditViewController : RABaseViewController
 
 @property (nonatomic,copy) NSString *orderID;
@@ -17,6 +18,8 @@
 @property (nonatomic,copy) NSString *actionTitle;
 @property (nonatomic,copy) NSString *orderType2;
 
+@property (nonatomic,strong,readonly) UITableView *tableView;
+
 
 @property (nonatomic,strong) NSIndexPath *editingIndexPath;
 
@@ -26,4 +29,6 @@
 - (RAEditBaseModel *)modelForIndexPath:(NSIndexPath *)indexPath;
 - (NSIndexPath *)indexPathForCell:(UITableViewCell *)cell;
 
+- (void)expandIndexPath:(NSIndexPath *)indexPath withJsonItem:(NSDictionary *)item;
+
 @end

+ 82 - 45
Redant Drivers/Apex And Drivers/Update/RAOrderEditViewController.m

@@ -14,6 +14,7 @@
 #import "RAEditImageBaseModel.h"
 #import "RAEditPhotoModel.h"
 #import "RAEditSignatureModel.h"
+#import "RAEditDateModel.h"
 
 #import "RAProgressHUD.h"
 #import "ZipArchive.h"
@@ -42,51 +43,9 @@
     NSMutableArray *itemArr = [NSMutableArray arrayWithCapacity:items.count];
     for (int i = 0; i < tmpItems.count; i++) {
         NSDictionary *item = [tmpItems objectAtIndex:i];
-        RAEditType type = [[item objectForKey:@"type"] intValue];
-        switch (type) {
-            case RAEditTypeLabel: {
-                
-                RAEditLabelModel *model = [RAEditLabelModel new];
-//                model.required = YES;
-                [model setValuesForKeysWithDictionary:item];
-                [itemArr addObject:model];
-            }
-                break;
-            case RAEditTypeInput: {
-                
-                RAEditInputModel *model = [RAEditInputModel new];
-//                model.required = YES;
-                [model setValuesForKeysWithDictionary:item];
-                [itemArr addObject:model];
-            }
-                break;
-            case RAEditTypeMultInput: {
-                
-                RAEditMultInputModel *model = [RAEditMultInputModel new];
-//                model.required = YES;
-                [model setValuesForKeysWithDictionary:item];
-                [itemArr addObject:model];
-            }
-                break;
-            case RAEditTypePhoto: {
-                
-                RAEditPhotoModel *model = [RAEditPhotoModel new];
-//                model.required = YES;
-                [model setValuesForKeysWithDictionary:item];
-                [itemArr addObject:model];
-            }
-                break;
-            case RAEditTypeSignature: {
-                
-                RAEditSignatureModel *model = [RAEditSignatureModel new];
-//                model.required = YES;
-                [model setValuesForKeysWithDictionary:item];
-                [itemArr addObject:model];
-            }
-                break;
-                
-            default:
-                break;
+        RAEditBaseModel *model = [self createModelWithJsonItem:item];
+        if (model) {
+            [itemArr addObject:model];
         }
     }
     _items = itemArr;
@@ -100,6 +59,63 @@
     return [self.items objectAtIndex:index];
 }
 
+- (RAEditBaseModel *)createModelWithJsonItem:(NSDictionary *)item {
+    
+    RAEditType type = [[item objectForKey:@"type"] intValue];
+    
+    RAEditBaseModel *model;
+    switch (type) {
+        case RAEditTypeLabel: {
+            
+             model = [RAEditLabelModel new];
+        }
+            break;
+        case RAEditTypeInput: {
+            
+            model = [RAEditInputModel new];
+        }
+            break;
+        case RAEditTypeMultInput: {
+            
+            model = [RAEditMultInputModel new];
+        }
+            break;
+        case RAEditTypePhoto: {
+            
+             model = [RAEditPhotoModel new];
+        }
+            break;
+        case RAEditTypeSignature: {
+            
+            model = [RAEditSignatureModel new];
+        }
+            break;
+        case RAEditTypeDate: {
+            model = [RAEditDateModel new];
+        }
+            break;
+            
+        default: {
+            model = nil;
+        }
+            break;
+    }
+    [model setValuesForKeysWithDictionary:item];
+    
+    return model;
+}
+
+- (RAEditBaseModel *)addModelAtIndex:(NSUInteger)idx withJsonItem:(NSDictionary *)item {
+    
+    RAEditBaseModel *model = [self createModelWithJsonItem:item];
+    if (model) {
+        NSMutableArray *arr = [self.items mutableCopy];
+        [arr insertObject:model atIndex:idx];
+        _items = arr;
+    }
+    return model;
+}
+
 @end
 
 
@@ -194,6 +210,10 @@
 
 #pragma mark - Getter
 
+- (UITableView *)tableView {
+    return self.orderEditTableView;
+}
+
 - (NSMutableArray *)sectionArray {
     if (!_sectionArray) {
         _sectionArray = [NSMutableArray array];
@@ -222,6 +242,23 @@
     return [self.orderEditTableView indexPathForCell:cell];
 }
 
+#pragma mark - Setter
+
+- (void)addModelAtIndex:(NSIndexPath *)indexPath withJsonItem:(NSDictionary *)item {
+    RAEditSectionModel *section = [self.sectionArray objectAtIndex:indexPath.section];
+    [section addModelAtIndex:indexPath.row withJsonItem:item];
+    [self.orderEditTableView reloadData];
+}
+
+- (void)expandIndexPath:(NSIndexPath *)indexPath withJsonItem:(NSDictionary *)item {
+    
+    RAEditSectionModel *section = [self.sectionArray objectAtIndex:indexPath.section];
+    RAEditBaseModel *curM = [self modelForIndexPath:indexPath];
+    RAEditBaseModel *expand = [section addModelAtIndex:(indexPath.row + 1) withJsonItem:item];
+    curM.expand = expand;
+    [self.orderEditTableView reloadData];
+}
+
 #pragma mark - Data
 
 - (void)loadData {

+ 2 - 2
Redant Drivers/Apex And Drivers/config.h

@@ -17,8 +17,8 @@
 #define ApexDriverWhiteColor UIColorFromRGB(0xffffff)
 #define ApexDriverRedColor UIColorFromRGB(0xAE2838)
 
-//#define URL_HOST                @"http://192.168.0.124:8080/t"
-#define URL_HOST                @"https://ra.apexshipping.com/t"
+#define URL_HOST                @"http://192.168.0.124:8080/t"
+//#define URL_HOST                @"https://ra.apexshipping.com/t"
 
 
 #define APPENDING_STR(var)      [URL_HOST stringByAppendingString:var]