Преглед на файлове

1.修改iOS Apex Drivers Order Detail,增加Map、Photo以及Signature。
2.修改iOS Apex Drivers Order Edit,增加Signature。

Pen Li преди 7 години
родител
ревизия
188e8ee813
променени са 38 файла, в които са добавени 920 реда и са изтрити 36 реда
  1. 13 0
      Redant Drivers/Apex And Drivers/Detail/Cell/RADetailMapCell.h
  2. 33 0
      Redant Drivers/Apex And Drivers/Detail/Cell/RADetailMapCell.m
  3. 16 0
      Redant Drivers/Apex And Drivers/Detail/Cell/RADetailPhotoCell.h
  4. 53 0
      Redant Drivers/Apex And Drivers/Detail/Cell/RADetailPhotoCell.m
  5. 16 0
      Redant Drivers/Apex And Drivers/Detail/Cell/RADetailSignatureCell.h
  6. 56 0
      Redant Drivers/Apex And Drivers/Detail/Cell/RADetailSignatureCell.m
  7. 120 0
      Redant Drivers/Apex And Drivers/Detail/Detail.storyboard
  8. 6 1
      Redant Drivers/Apex And Drivers/Detail/Model/RADetailBaseModel.h
  9. 13 0
      Redant Drivers/Apex And Drivers/Detail/Model/RADetailMapModel.h
  10. 17 0
      Redant Drivers/Apex And Drivers/Detail/Model/RADetailMapModel.m
  11. 25 0
      Redant Drivers/Apex And Drivers/Detail/Model/RADetailPhotoModel.h
  12. 56 0
      Redant Drivers/Apex And Drivers/Detail/Model/RADetailPhotoModel.m
  13. 27 0
      Redant Drivers/Apex And Drivers/Detail/Model/RADetailSignatureModel.h
  14. 48 0
      Redant Drivers/Apex And Drivers/Detail/Model/RADetailSignatureModel.m
  15. 1 0
      Redant Drivers/Apex And Drivers/Detail/RAOrderDetailViewController+TableViewDataSource.h
  16. 27 1
      Redant Drivers/Apex And Drivers/Detail/RAOrderDetailViewController+TableViewDataSource.m
  17. 24 0
      Redant Drivers/Apex And Drivers/Detail/RAOrderDetailViewController.m
  18. 6 0
      Redant Drivers/Apex And Drivers/FakeData/fake_order_edit.json
  19. 3 0
      Redant Drivers/Apex And Drivers/Home/More/RAHomeMoreViewController+TableDelegate.m
  20. 10 0
      Redant Drivers/Apex And Drivers/Home/RAHomeOrderModel.m
  21. 3 0
      Redant Drivers/Apex And Drivers/Home/RAHomeViewController+HomeTableDelegate.m
  22. 1 1
      Redant Drivers/Apex And Drivers/RADataProvider.m
  23. 2 0
      Redant Drivers/Apex And Drivers/Update/Cell/RAEditMultInputCell.m
  24. 2 0
      Redant Drivers/Apex And Drivers/Update/Cell/RAEditPhotoCell.m
  25. 3 0
      Redant Drivers/Apex And Drivers/Update/Cell/RAEditScanInputCell.m
  26. 25 0
      Redant Drivers/Apex And Drivers/Update/Cell/RAEditSignatureCell.h
  27. 68 0
      Redant Drivers/Apex And Drivers/Update/Cell/RAEditSignatureCell.m
  28. 78 10
      Redant Drivers/Apex And Drivers/Update/Edit.storyboard
  29. 3 1
      Redant Drivers/Apex And Drivers/Update/Model/RAEditBaseModel.h
  30. 17 0
      Redant Drivers/Apex And Drivers/Update/Model/RAEditImageBaseModel.h
  31. 21 0
      Redant Drivers/Apex And Drivers/Update/Model/RAEditImageBaseModel.m
  32. 2 2
      Redant Drivers/Apex And Drivers/Update/Model/RAEditPhotoModel.h
  33. 8 0
      Redant Drivers/Apex And Drivers/Update/Model/RAEditPhotoModel.m
  34. 16 0
      Redant Drivers/Apex And Drivers/Update/Model/RAEditSignatureModel.h
  35. 37 0
      Redant Drivers/Apex And Drivers/Update/Model/RAEditSignatureModel.m
  36. 2 1
      Redant Drivers/Apex And Drivers/Update/RAOrderEditViewController+TableDataSource.h
  37. 34 0
      Redant Drivers/Apex And Drivers/Update/RAOrderEditViewController+TableDataSource.m
  38. 28 19
      Redant Drivers/Apex And Drivers/Update/RAOrderEditViewController.m

+ 13 - 0
Redant Drivers/Apex And Drivers/Detail/Cell/RADetailMapCell.h

@@ -0,0 +1,13 @@
+//
+//  RADetailMapCell.h
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/9/4.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface RADetailMapCell : UITableViewCell
+
+@end

+ 33 - 0
Redant Drivers/Apex And Drivers/Detail/Cell/RADetailMapCell.m

@@ -0,0 +1,33 @@
+//
+//  RADetailMapCell.m
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/9/4.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RADetailMapCell.h"
+#import <MapKit/MapKit.h>
+
+@interface RADetailMapCell ()
+
+@property (strong, nonatomic) IBOutlet UILabel *titleLabel;
+@property (strong, nonatomic) IBOutlet MKMapView *mapView;
+@property (strong, nonatomic) IBOutlet UILabel *valueLabel;
+
+@end
+
+@implementation RADetailMapCell
+
+- (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
+}
+
+@end

+ 16 - 0
Redant Drivers/Apex And Drivers/Detail/Cell/RADetailPhotoCell.h

@@ -0,0 +1,16 @@
+//
+//  RADetailPhotoCell.h
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/9/4.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@class RADetailPhotoModel;
+@interface RADetailPhotoCell : UITableViewCell
+
+@property (nonatomic,strong) RADetailPhotoModel *model;
+
+@end

+ 53 - 0
Redant Drivers/Apex And Drivers/Detail/Cell/RADetailPhotoCell.m

@@ -0,0 +1,53 @@
+//
+//  RADetailPhotoCell.m
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/9/4.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RADetailPhotoCell.h"
+#import "RADetailPhotoModel.h"
+
+@interface RADetailPhotoCell () <RADetailPhotoModelDelegate>
+
+@property (strong, nonatomic) IBOutlet UILabel *titleLabel;
+@property (strong, nonatomic) IBOutlet UIImageView *photoView;
+
+@end
+
+@implementation RADetailPhotoCell
+
+- (void)awakeFromNib {
+    [super awakeFromNib];
+    // Initialization code
+    
+    self.photoView.layer.borderWidth = 0.5f;
+    self.photoView.layer.borderColor = [UIColor lightGrayColor].CGColor;
+}
+
+- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
+    [super setSelected:selected animated:animated];
+
+    // Configure the view for the selected state
+}
+
+- (void)setModel:(RADetailPhotoModel *)model {
+    if (_model) {
+        _model.delegate = nil;
+    }
+    _model = model;
+    if (_model) {
+        _model.delegate = self;
+    }
+    
+    [self refreshUI];
+}
+
+- (void)refreshUI {
+    
+    self.titleLabel.text = _model.title;
+    self.photoView.image = _model.photo;
+}
+
+@end

+ 16 - 0
Redant Drivers/Apex And Drivers/Detail/Cell/RADetailSignatureCell.h

@@ -0,0 +1,16 @@
+//
+//  RADetailSignatureCell.h
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/9/4.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@class RADetailSignatureModel;
+@interface RADetailSignatureCell : UITableViewCell
+
+@property (nonatomic,strong) RADetailSignatureModel *model;
+
+@end

+ 56 - 0
Redant Drivers/Apex And Drivers/Detail/Cell/RADetailSignatureCell.m

@@ -0,0 +1,56 @@
+//
+//  RADetailSignatureCell.m
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/9/4.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RADetailSignatureCell.h"
+#import "RADetailSignatureModel.h"
+
+@interface RADetailSignatureCell () <RADetailSignatureModelDelegate>
+
+@property (nonatomic,strong) IBOutlet UILabel *titleLabel;
+@property (nonatomic,strong) IBOutlet UIImageView *signatureView;
+
+@end
+
+@implementation RADetailSignatureCell
+
+- (void)awakeFromNib {
+    [super awakeFromNib];
+    // Initialization code
+}
+
+- (void)prepareForReuse {
+    [super prepareForReuse];
+    
+    self.model = nil;
+}
+
+- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
+    [super setSelected:selected animated:animated];
+
+    // Configure the view for the selected state
+}
+
+- (void)setModel:(RADetailSignatureModel *)model {
+    if (_model) {
+        _model.delegate = nil;
+    }
+    _model = model;
+    if (_model) {
+        _model.delegate = self;
+    }
+    
+    [self refreshUI];
+}
+
+- (void)refreshUI {
+    
+    self.titleLabel.text = _model.title;
+    self.signatureView.image = _model.signature;
+}
+
+@end

+ 120 - 0
Redant Drivers/Apex And Drivers/Detail/Detail.storyboard

@@ -6,6 +6,7 @@
     <dependencies>
         <deployment identifier="iOS"/>
         <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
+        <capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -213,6 +214,125 @@ OAKLAND,CA</string>
                                             <outlet property="actionCollectionView" destination="iKo-LB-QEE" id="XWC-qN-Lrx"/>
                                         </connections>
                                     </tableViewCell>
+                                    <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="RADetailMapCell" rowHeight="100" id="sLQ-ry-Yxv" customClass="RADetailMapCell">
+                                        <rect key="frame" x="0.0" y="388" width="375" height="100"/>
+                                        <autoresizingMask key="autoresizingMask"/>
+                                        <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="sLQ-ry-Yxv" id="3xH-7S-3HD">
+                                            <rect key="frame" x="0.0" y="0.0" width="375" height="99.5"/>
+                                            <autoresizingMask key="autoresizingMask"/>
+                                            <subviews>
+                                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="PFm-sQ-c4b">
+                                                    <rect key="frame" x="5" y="31" width="260" height="63.5"/>
+                                                    <string key="text">TRANS PACIFIC CONTAINER SERVICE
+BERTH 30 2800 7TH ST
+OAKLAND,CA</string>
+                                                    <fontDescription key="fontDescription" type="system" pointSize="15"/>
+                                                    <nil key="textColor"/>
+                                                    <nil key="highlightedColor"/>
+                                                </label>
+                                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Pick Up" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="xB6-BK-ueh">
+                                                    <rect key="frame" x="5" y="5" width="365" height="21"/>
+                                                    <constraints>
+                                                        <constraint firstAttribute="height" constant="21" id="fu8-8j-kB0"/>
+                                                    </constraints>
+                                                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                                    <nil key="textColor"/>
+                                                    <nil key="highlightedColor"/>
+                                                </label>
+                                                <mapView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" mapType="standard" translatesAutoresizingMaskIntoConstraints="NO" id="HTh-Id-rGS">
+                                                    <rect key="frame" x="310" y="33" width="60" height="60"/>
+                                                    <constraints>
+                                                        <constraint firstAttribute="height" constant="60" id="Ife-Uc-FoA"/>
+                                                        <constraint firstAttribute="width" constant="60" id="hte-fM-6X0"/>
+                                                    </constraints>
+                                                </mapView>
+                                            </subviews>
+                                            <constraints>
+                                                <constraint firstItem="HTh-Id-rGS" firstAttribute="centerY" secondItem="PFm-sQ-c4b" secondAttribute="centerY" id="HWn-WY-xhN"/>
+                                                <constraint firstItem="xB6-BK-ueh" firstAttribute="top" secondItem="3xH-7S-3HD" secondAttribute="top" constant="5" id="KSy-vK-d3g"/>
+                                                <constraint firstItem="PFm-sQ-c4b" firstAttribute="top" secondItem="xB6-BK-ueh" secondAttribute="bottom" constant="5" id="RvK-I5-aUn"/>
+                                                <constraint firstAttribute="trailing" secondItem="HTh-Id-rGS" secondAttribute="trailing" constant="5" id="bSW-oA-jc8"/>
+                                                <constraint firstItem="xB6-BK-ueh" firstAttribute="leading" secondItem="3xH-7S-3HD" secondAttribute="leading" constant="5" id="eGw-aX-50a"/>
+                                                <constraint firstItem="PFm-sQ-c4b" firstAttribute="leading" secondItem="3xH-7S-3HD" secondAttribute="leading" constant="5" id="eSs-EX-al6"/>
+                                                <constraint firstAttribute="bottom" secondItem="PFm-sQ-c4b" secondAttribute="bottom" constant="5" id="fmQ-Bh-2j8"/>
+                                                <constraint firstItem="HTh-Id-rGS" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="PFm-sQ-c4b" secondAttribute="trailing" constant="5" id="he7-zp-sOU"/>
+                                                <constraint firstAttribute="trailing" secondItem="xB6-BK-ueh" secondAttribute="trailing" constant="5" id="uYg-df-E7T"/>
+                                            </constraints>
+                                        </tableViewCellContentView>
+                                        <connections>
+                                            <outlet property="mapView" destination="HTh-Id-rGS" id="tqR-iW-DG4"/>
+                                            <outlet property="titleLabel" destination="xB6-BK-ueh" id="qka-5z-4Nn"/>
+                                            <outlet property="valueLabel" destination="PFm-sQ-c4b" id="oNG-uG-bHW"/>
+                                        </connections>
+                                    </tableViewCell>
+                                    <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="RADetailPhotoCell" rowHeight="100" id="44Q-BL-fjP" customClass="RADetailPhotoCell">
+                                        <rect key="frame" x="0.0" y="488" width="375" height="100"/>
+                                        <autoresizingMask key="autoresizingMask"/>
+                                        <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="44Q-BL-fjP" id="k4f-vX-hlb">
+                                            <rect key="frame" x="0.0" y="0.0" width="375" height="99.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="M6V-ez-t4d">
+                                                    <rect key="frame" x="5" y="-0.5" width="42" height="100"/>
+                                                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                                    <nil key="textColor"/>
+                                                    <nil key="highlightedColor"/>
+                                                </label>
+                                                <imageView contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="x23-Ma-VwQ">
+                                                    <rect key="frame" x="280.5" y="5" width="89.5" height="89.5"/>
+                                                    <gestureRecognizers/>
+                                                    <constraints>
+                                                        <constraint firstAttribute="width" secondItem="x23-Ma-VwQ" secondAttribute="height" multiplier="89:89" id="Gi9-rt-ewa"/>
+                                                    </constraints>
+                                                </imageView>
+                                            </subviews>
+                                            <constraints>
+                                                <constraint firstAttribute="trailing" secondItem="x23-Ma-VwQ" secondAttribute="trailing" constant="5" id="2XQ-JJ-1cI"/>
+                                                <constraint firstAttribute="bottom" secondItem="x23-Ma-VwQ" secondAttribute="bottom" constant="5" id="Dmd-a9-WuR"/>
+                                                <constraint firstItem="M6V-ez-t4d" firstAttribute="centerY" secondItem="k4f-vX-hlb" secondAttribute="centerY" id="LOQ-E1-Std"/>
+                                                <constraint firstItem="M6V-ez-t4d" firstAttribute="height" secondItem="k4f-vX-hlb" secondAttribute="height" id="XKq-Xo-cjc"/>
+                                                <constraint firstItem="M6V-ez-t4d" firstAttribute="leading" secondItem="k4f-vX-hlb" secondAttribute="leading" constant="5" id="Y8M-sa-2fC"/>
+                                                <constraint firstItem="x23-Ma-VwQ" firstAttribute="top" secondItem="k4f-vX-hlb" secondAttribute="top" constant="5" id="o0h-IC-2Ok"/>
+                                                <constraint firstItem="x23-Ma-VwQ" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="M6V-ez-t4d" secondAttribute="trailing" constant="10" id="pc5-75-bka"/>
+                                            </constraints>
+                                        </tableViewCellContentView>
+                                        <connections>
+                                            <outlet property="photoView" destination="x23-Ma-VwQ" id="9DZ-DP-10C"/>
+                                            <outlet property="titleLabel" destination="M6V-ez-t4d" id="5az-3z-y9q"/>
+                                        </connections>
+                                    </tableViewCell>
+                                    <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="RADetailSignatureCell" rowHeight="150" id="KBG-tu-iKo" customClass="RADetailSignatureCell">
+                                        <rect key="frame" x="0.0" y="588" width="375" height="150"/>
+                                        <autoresizingMask key="autoresizingMask"/>
+                                        <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="KBG-tu-iKo" id="EcS-EV-o0B">
+                                            <rect key="frame" x="0.0" y="0.0" width="375" height="149.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="ErT-qT-9u6">
+                                                    <rect key="frame" x="5" y="5" width="365" height="21"/>
+                                                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                                    <nil key="textColor"/>
+                                                    <nil key="highlightedColor"/>
+                                                </label>
+                                                <imageView contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="na6-0y-zBR">
+                                                    <rect key="frame" x="5" y="31" width="365" height="113.5"/>
+                                                </imageView>
+                                            </subviews>
+                                            <constraints>
+                                                <constraint firstAttribute="trailing" secondItem="na6-0y-zBR" secondAttribute="trailing" constant="5" id="3CV-pY-zBa"/>
+                                                <constraint firstAttribute="trailing" secondItem="ErT-qT-9u6" secondAttribute="trailing" constant="5" id="7LJ-RW-QJj"/>
+                                                <constraint firstAttribute="bottom" secondItem="na6-0y-zBR" secondAttribute="bottom" constant="5" id="9IY-QN-41w"/>
+                                                <constraint firstItem="ErT-qT-9u6" firstAttribute="top" secondItem="EcS-EV-o0B" secondAttribute="top" constant="5" id="ICR-NK-MX4"/>
+                                                <constraint firstItem="ErT-qT-9u6" firstAttribute="leading" secondItem="EcS-EV-o0B" secondAttribute="leading" constant="5" id="Jhd-HB-yo7"/>
+                                                <constraint firstItem="na6-0y-zBR" firstAttribute="leading" secondItem="EcS-EV-o0B" secondAttribute="leading" constant="5" id="d8G-L4-4Gx"/>
+                                                <constraint firstItem="na6-0y-zBR" firstAttribute="top" secondItem="ErT-qT-9u6" secondAttribute="bottom" constant="5" id="i1z-eQ-TaE"/>
+                                            </constraints>
+                                        </tableViewCellContentView>
+                                        <connections>
+                                            <outlet property="signatureView" destination="na6-0y-zBR" id="pVr-yi-poc"/>
+                                            <outlet property="titleLabel" destination="ErT-qT-9u6" id="c67-Sd-fgi"/>
+                                        </connections>
+                                    </tableViewCell>
                                 </prototypes>
                                 <connections>
                                     <outlet property="dataSource" destination="wYu-98-b8c" id="ddq-cb-RtK"/>

+ 6 - 1
Redant Drivers/Apex And Drivers/Detail/Model/RADetailBaseModel.h

@@ -9,10 +9,15 @@
 #import <UIKit/UIKit.h>
 
 typedef enum {
+    
     RAOrderDetailValueTypeSingleLine = 0,
     RAOrderDetailValueTypeMultipleLine = 1,
     RAOrderDetailValueTypeAction = 2,
-    RAOrderDetailValueTypeLocation = 3
+    RAOrderDetailValueTypeLocation = 3,
+    RAOrderDetailValueTypeMap = 4,
+    RAOrderDetailValueTypePhoto = 5,
+    RAOrderDetailValueTypeSignature = 6
+    
 } RAOrderDetailValueType;
 
 @interface RADetailBaseModel : NSObject

+ 13 - 0
Redant Drivers/Apex And Drivers/Detail/Model/RADetailMapModel.h

@@ -0,0 +1,13 @@
+//
+//  RADetailMapModel.h
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/9/4.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RADetailBaseModel.h"
+
+@interface RADetailMapModel : RADetailBaseModel
+
+@end

+ 17 - 0
Redant Drivers/Apex And Drivers/Detail/Model/RADetailMapModel.m

@@ -0,0 +1,17 @@
+//
+//  RADetailMapModel.m
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/9/4.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RADetailMapModel.h"
+
+@implementation RADetailMapModel
+
+- (CGFloat)height {
+    return 100.0f;
+}
+
+@end

+ 25 - 0
Redant Drivers/Apex And Drivers/Detail/Model/RADetailPhotoModel.h

@@ -0,0 +1,25 @@
+//
+//  RADetailPhotoModel.h
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/9/4.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RADetailBaseModel.h"
+
+@protocol RADetailPhotoModelDelegate <NSObject>
+
+- (void)refreshUI;
+
+@end
+
+@interface RADetailPhotoModel : RADetailBaseModel
+
+@property (nonatomic,copy) NSString *title;
+@property (nonatomic,copy) NSString *photoURL;
+@property (nonatomic,strong,readonly) UIImage *photo;
+
+@property (nonatomic,weak) id<RADetailPhotoModelDelegate> delegate;
+
+@end

+ 56 - 0
Redant Drivers/Apex And Drivers/Detail/Model/RADetailPhotoModel.m

@@ -0,0 +1,56 @@
+//
+//  RADetailPhotoModel.m
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/9/4.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RADetailPhotoModel.h"
+#import "UIImage+RedAnt.h"
+
+@interface RADetailPhotoModel ()
+
+
+
+@end
+
+@implementation RADetailPhotoModel
+
+- (void)setPhotoURL:(NSString *)photoURL {
+    _photoURL = photoURL;
+    
+    if (_photoURL.length > 0) {
+        
+        __weak typeof(self) weakSelf = self;
+        [RASingleton.sharedInstance.networkQueue addOperationWithBlock:^{
+            
+            UIImage *photo = [UIImage ra_imageWithURL:[NSURL URLWithString:photoURL]];
+            if (weakSelf) {
+                __strong typeof(weakSelf) strongSelf = weakSelf;
+                [strongSelf setPhoto:photo];
+            }
+            
+        }];
+        
+    } else {
+        [self setPhoto:nil];
+    }
+}
+
+- (void)setPhoto:(UIImage *)photo {
+    _photo = photo;
+    
+    if (self.delegate && [self.delegate respondsToSelector:@selector(refreshUI)]) {
+        dispatch_async(dispatch_get_main_queue(), ^{
+            [self.delegate refreshUI];
+        });
+    }
+}
+
+- (CGFloat)height {
+    return 100.0f;
+}
+
+
+@end

+ 27 - 0
Redant Drivers/Apex And Drivers/Detail/Model/RADetailSignatureModel.h

@@ -0,0 +1,27 @@
+//
+//  RADetailSignatureModel.h
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/9/4.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RADetailBaseModel.h"
+
+@protocol RADetailSignatureModelDelegate <NSObject>
+
+- (void)refreshUI;
+
+@end
+
+@interface RADetailSignatureModel : RADetailBaseModel
+
+@property (nonatomic,copy) NSString *title;
+
+@property (nonatomic,copy) NSString *signatureURL;
+
+@property (nonatomic,strong,readonly) UIImage *signature;
+
+@property (nonatomic,weak) id<RADetailSignatureModelDelegate> delegate;
+
+@end

+ 48 - 0
Redant Drivers/Apex And Drivers/Detail/Model/RADetailSignatureModel.m

@@ -0,0 +1,48 @@
+//
+//  RADetailSignatureModel.m
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/9/4.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RADetailSignatureModel.h"
+#import "UIImage+RedAnt.h"
+
+@implementation RADetailSignatureModel
+
+- (void)setSignatureURL:(NSString *)signatureURL {
+    _signatureURL = signatureURL;
+    
+    if (_signatureURL.length > 0) {
+        
+        __weak typeof(self) weakSelf = self;
+        [RASingleton.sharedInstance.networkQueue addOperationWithBlock:^{
+            
+            UIImage *signature = [UIImage ra_imageWithURL:[NSURL URLWithString:signatureURL]];
+            if (weakSelf) {
+                __strong typeof(weakSelf) strongSelf = weakSelf;
+                [strongSelf setSignature:signature];
+            }
+        }];
+        
+    } else {
+        self.signature = nil;
+    }
+}
+
+- (void)setSignature:(UIImage *)signature {
+    _signature = signature;
+    
+    if (self.delegate && [self.delegate respondsToSelector:@selector(refreshUI)]) {
+        dispatch_async(dispatch_get_main_queue(), ^{
+            [self.delegate refreshUI];
+        });
+    }
+}
+
+- (CGFloat)height {
+    return 150.0f;
+}
+
+@end

+ 1 - 0
Redant Drivers/Apex And Drivers/Detail/RAOrderDetailViewController+TableViewDataSource.h

@@ -11,6 +11,7 @@
 #import "RADetailActionsCell.h"
 #import "RADetailActionSelectionViewController.h"
 
+
 @interface RAOrderDetailViewController (TableViewDataSource) <UITableViewDataSource,RADetailLocationCellDelegate,RAdetailActionsCellDelegate,UIPopoverPresentationControllerDelegate,RADetailActionSelectionDelegate>
 
 @end

+ 27 - 1
Redant Drivers/Apex And Drivers/Detail/RAOrderDetailViewController+TableViewDataSource.m

@@ -14,10 +14,12 @@
 #import "RADetailLocationModel.h"
 #import "RADetailActionCollectionModel.h"
 #import "RADetailActionModel.h"
+#import "RADetailSignatureModel.h"
 
 #import "RADetailSingleLineCell.h"
 #import "RADetailMultLineCell.h"
 #import "RADetailActionSubCell.h"
+#import "RADetailSignatureCell.h"
 
 #import <MapKit/MapKit.h>
 
@@ -28,7 +30,10 @@
 
 #import <AddressBook/AddressBook.h>
 //#import <Contacts/Contacts.h>
-
+#import "RADetailMapCell.h"
+#import "RADetailPhotoCell.h"
+#import "RADetailPhotoModel.h"
+#import "RADetailMapModel.h"
 
 
 @implementation RAOrderDetailViewController (TableViewDataSource)
@@ -68,6 +73,27 @@
             return cell;
         }
             break;
+        case RAOrderDetailValueTypeMap: {
+            
+            RADetailMapCell *cell = [tableView dequeueReusableCellWithIdentifier:@"RADetailMapCell" forIndexPath:indexPath];
+            
+            return cell;
+        }
+            break;
+        case RAOrderDetailValueTypePhoto: {
+            RADetailPhotoModel *photoModel = (RADetailPhotoModel *)model;
+            RADetailPhotoCell *cell = [tableView dequeueReusableCellWithIdentifier:@"RADetailPhotoCell" forIndexPath:indexPath];
+            [cell setModel:photoModel];
+            return cell;
+        }
+            break;
+        case RAOrderDetailValueTypeSignature: {
+            RADetailSignatureModel *signatureModel = (RADetailSignatureModel *)model;
+            RADetailSignatureCell *cell = [tableView dequeueReusableCellWithIdentifier:@"RADetailSignatureCell" forIndexPath:indexPath];
+            [cell setModel:signatureModel];
+            return cell;
+        }
+            break;
             
         default:
             break;

+ 24 - 0
Redant Drivers/Apex And Drivers/Detail/RAOrderDetailViewController.m

@@ -12,6 +12,9 @@
 #import "RADetailMultLineModel.h"
 #import "RADetailLocationModel.h"
 #import "RADetailActionCollectionModel.h"
+#import "RADetailMapModel.h"
+#import "RADetailPhotoModel.h"
+#import "RADetailSignatureModel.h"
 
 #import "RAProgressHUD.h"
 
@@ -69,6 +72,27 @@
                 [modelArr addObject:model];
             }
                 break;
+            case RAOrderDetailValueTypeMap: {
+                RADetailMapModel *model = [[RADetailMapModel alloc] init];
+                model.width = self.tableWidth;
+                [model setValuesForKeysWithDictionary:value];
+                [modelArr addObject:model];
+            }
+                break;
+            case RAOrderDetailValueTypePhoto: {
+                RADetailPhotoModel *model = [[RADetailPhotoModel alloc] init];
+                model.width = self.tableWidth;
+                [model setValuesForKeysWithDictionary:value];
+                [modelArr addObject:model];
+            }
+                break;
+            case RAOrderDetailValueTypeSignature: {
+                RADetailSignatureModel *model = [[RADetailSignatureModel alloc] init];
+                model.width = self.tableWidth;
+                [model setValuesForKeysWithDictionary:value];
+                [modelArr addObject:model];
+            }
+                break;
                 
             default:
                 break;

+ 6 - 0
Redant Drivers/Apex And Drivers/FakeData/fake_order_edit.json

@@ -85,6 +85,12 @@
                            "key": "container_photo_1",
                            "title": "Container Photo 1",
                            "path": "photoPath"
+                           },
+                           {
+                           "type": 4,
+                           "key": "signature",
+                           "title": "Signature",
+                           "path": "photoPath"
                            }
                            ]
                  }

+ 3 - 0
Redant Drivers/Apex And Drivers/Home/More/RAHomeMoreViewController+TableDelegate.m

@@ -19,6 +19,9 @@
 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
     
     RAHomeOrderModel *order = [self orderModelForIndexPath:indexPath];
+    if (order.backendFlag) {
+        order.backendFlag = !order.backendFlag;
+    }
     [self pushDetailViewControllerForModel:order];
 }
 

+ 10 - 0
Redant Drivers/Apex And Drivers/Home/RAHomeOrderModel.m

@@ -21,6 +21,16 @@
     return _icon;
 }
 
+- (void)setBackendFlag:(BOOL)backendFlag {
+    _backendFlag = backendFlag;
+    
+    if (self.delegate && [self.delegate respondsToSelector:@selector(refreshUI)]) {
+        dispatch_async(dispatch_get_main_queue(), ^{
+            [self.delegate refreshUI];
+        });
+    }
+}
+
 - (void)setIcon:(UIImage *)icon {
     _icon = icon;
     

+ 3 - 0
Redant Drivers/Apex And Drivers/Home/RAHomeViewController+HomeTableDelegate.m

@@ -65,6 +65,9 @@
 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
     
     RAHomeOrderModel *order = [self orderModelForIndexPath:indexPath];
+    if (order.backendFlag) {
+        order.backendFlag = !order.backendFlag;
+    }
     self.currentOrderID = order.orderID;
     [self pushDetailViewControllerForModel:order];
 }

+ 1 - 1
Redant Drivers/Apex And Drivers/RADataProvider.m

@@ -214,7 +214,7 @@
 }
 
 + (NSDictionary *)requestUpdateOrder:(NSString *)orderID driverAction:(NSInteger)action {
-    
+    return [self loadFakeData:@"fake_order_edit.json"];
     NSMutableDictionary *params = [NSMutableDictionary dictionary];
     if (orderID) {
         [params setObject:orderID forKey:@"orderID"];

+ 2 - 0
Redant Drivers/Apex And Drivers/Update/Cell/RAEditMultInputCell.m

@@ -12,6 +12,7 @@
 @interface RAEditMultInputCell () <UITextViewDelegate,RAEditModelDelegate>
 
 @property (strong, nonatomic) IBOutlet UILabel *titleLabel;
+@property (nonatomic,strong) IBOutlet UILabel *startLabel;
 @property (strong, nonatomic) IBOutlet UITextView *inputView;
 
 
@@ -58,6 +59,7 @@
 - (void)refresh {
     self.titleLabel.text = _model.title;
     self.inputView.text = _model.value;
+    self.startLabel.hidden = !_model.required;
 }
 
 #pragma mark - TextView Delegate

+ 2 - 0
Redant Drivers/Apex And Drivers/Update/Cell/RAEditPhotoCell.m

@@ -12,6 +12,7 @@
 @interface RAEditPhotoCell () <RAEditModelDelegate>
 
 @property (strong, nonatomic) IBOutlet UILabel *titleLabel;
+@property (nonatomic,strong) IBOutlet UILabel *startLabel;
 @property (strong, nonatomic) IBOutlet UIImageView *photoView;
 
 
@@ -70,6 +71,7 @@
 - (void)refresh {
     self.titleLabel.text = _model.title;
     self.photoView.image = _model.photo;
+    self.startLabel.hidden = !_model.required;
 }
 
 @end

+ 3 - 0
Redant Drivers/Apex And Drivers/Update/Cell/RAEditScanInputCell.m

@@ -12,6 +12,7 @@
 @interface RAEditScanInputCell () <UITextFieldDelegate,RAEditModelDelegate>
 
 @property (strong, nonatomic) IBOutlet UILabel *titlelabel;
+@property (nonatomic,strong) IBOutlet UILabel *startLabel;
 @property (strong, nonatomic) IBOutlet UITextField *inputTextField;
 
 
@@ -76,6 +77,8 @@
         self.inputTextField.rightViewMode = UITextFieldViewModeNever;
         self.inputTextField.rightView = nil;
     }
+    
+    self.startLabel.hidden = !_model.required;
 }
 
 #pragma mark - TextField Delegate

+ 25 - 0
Redant Drivers/Apex And Drivers/Update/Cell/RAEditSignatureCell.h

@@ -0,0 +1,25 @@
+//
+//  RAEditSignatureCell.h
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/9/4.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@class RAEditSignatureModel,RAEditSignatureCell;
+
+@protocol RAEditSignatureCellDelegate <NSObject>
+
+- (void)signatureCell:(RAEditSignatureCell *)cell tapSignature:(RAEditSignatureModel *)model;
+
+@end
+
+@interface RAEditSignatureCell : UITableViewCell
+
+@property (nonatomic,strong) RAEditSignatureModel *model;
+
+@property (nonatomic,weak) id<RAEditSignatureCellDelegate> delegate;
+
+@end

+ 68 - 0
Redant Drivers/Apex And Drivers/Update/Cell/RAEditSignatureCell.m

@@ -0,0 +1,68 @@
+//
+//  RAEditSignatureCell.m
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/9/4.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RAEditSignatureCell.h"
+#import "RAEditSignatureModel.h"
+
+@interface RAEditSignatureCell () <RAEditModelDelegate>
+
+@property (nonatomic,strong) IBOutlet UILabel *titleLabel;
+@property (nonatomic,strong) IBOutlet UILabel *startLabel;
+@property (nonatomic,strong) IBOutlet UIImageView *signatureView;
+
+@end
+
+@implementation RAEditSignatureCell
+
+- (void)awakeFromNib {
+    [super awakeFromNib];
+    // Initialization code
+    
+    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapSignature:)];
+    [self.signatureView addGestureRecognizer:tap];
+}
+
+- (void)prepareForReuse {
+    [super prepareForReuse];
+    
+    self.model = nil;
+}
+
+- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
+    [super setSelected:selected animated:animated];
+
+    // Configure the view for the selected state
+}
+
+- (void)setModel:(RAEditSignatureModel *)model {
+    if (_model) {
+        _model.delegate = nil;
+    }
+    _model = model;
+    if (_model) {
+        _model.delegate = self;
+    }
+    
+    [self refresh];
+}
+
+- (void)tapSignature:(UITapGestureRecognizer *)tap {
+    
+    if (self.delegate && [self.delegate respondsToSelector:@selector(signatureCell:tapSignature:)]) {
+        [self.delegate signatureCell:self tapSignature:_model];
+    }
+}
+
+- (void)refresh {
+    
+    self.titleLabel.text = _model.title;
+    self.signatureView.image = _model.signature;
+    self.startLabel.hidden = !_model.required;
+}
+
+@end

+ 78 - 10
Redant Drivers/Apex And Drivers/Update/Edit.storyboard

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14109" 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="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
     <device id="retina4_7" orientation="portrait">
         <adaptation id="fullscreen"/>
     </device>
@@ -31,7 +31,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="7mL-uV-Ec4">
-                                                    <rect key="frame" x="5" y="5" width="365" height="21"/>
+                                                    <rect key="frame" x="5" y="5" width="42" height="21"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                                     <nil key="textColor"/>
                                                     <nil key="highlightedColor"/>
@@ -45,19 +45,28 @@
                                                         <outlet property="delegate" destination="LAb-ek-OMl" id="HhP-qc-Ler"/>
                                                     </connections>
                                                 </textField>
+                                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="*" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="oNJ-t7-BbU">
+                                                    <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>
                                             </subviews>
                                             <constraints>
                                                 <constraint firstItem="7mL-uV-Ec4" firstAttribute="leading" secondItem="OdP-kT-OdJ" secondAttribute="leading" constant="5" id="0H6-kh-H5g"/>
                                                 <constraint firstAttribute="bottom" secondItem="xpV-6I-fj3" secondAttribute="bottom" constant="5" id="4uL-YG-IfT"/>
-                                                <constraint firstItem="xpV-6I-fj3" firstAttribute="trailing" secondItem="7mL-uV-Ec4" secondAttribute="trailing" id="5v6-aj-FeD"/>
                                                 <constraint firstItem="7mL-uV-Ec4" firstAttribute="top" secondItem="OdP-kT-OdJ" secondAttribute="top" constant="5" id="8Dw-A1-VX7"/>
-                                                <constraint firstItem="xpV-6I-fj3" firstAttribute="leading" secondItem="7mL-uV-Ec4" secondAttribute="leading" id="Ekc-Ff-6Bk"/>
+                                                <constraint firstItem="oNJ-t7-BbU" firstAttribute="top" secondItem="OdP-kT-OdJ" secondAttribute="top" constant="2" id="BOc-zX-3e0"/>
+                                                <constraint firstItem="oNJ-t7-BbU" firstAttribute="leading" secondItem="7mL-uV-Ec4" secondAttribute="trailing" constant="5" id="F2a-M3-Zuo"/>
+                                                <constraint firstAttribute="trailing" secondItem="xpV-6I-fj3" secondAttribute="trailing" constant="5" id="Jih-Bf-StV"/>
+                                                <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="oNJ-t7-BbU" secondAttribute="trailing" constant="5" id="NRw-kp-GOp"/>
                                                 <constraint firstItem="xpV-6I-fj3" firstAttribute="top" secondItem="7mL-uV-Ec4" secondAttribute="bottom" constant="5" id="Zay-mH-x7B"/>
-                                                <constraint firstAttribute="trailing" secondItem="7mL-uV-Ec4" secondAttribute="trailing" constant="5" id="b09-TU-lQW"/>
+                                                <constraint firstItem="xpV-6I-fj3" firstAttribute="leading" secondItem="OdP-kT-OdJ" secondAttribute="leading" constant="5" id="iX6-A4-7PJ"/>
                                             </constraints>
                                         </tableViewCellContentView>
                                         <connections>
                                             <outlet property="inputTextField" destination="xpV-6I-fj3" id="zlO-oi-ql2"/>
+                                            <outlet property="startLabel" destination="oNJ-t7-BbU" id="WNx-9W-SSe"/>
                                             <outlet property="titlelabel" destination="7mL-uV-Ec4" id="M6i-GR-xhU"/>
                                         </connections>
                                     </tableViewCell>
@@ -81,19 +90,28 @@
                                                         <constraint firstAttribute="width" secondItem="MBQ-1e-9Rf" secondAttribute="height" multiplier="89:89" id="wf3-jd-K2C"/>
                                                     </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"/>
+                                                    <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>
                                             </subviews>
                                             <constraints>
                                                 <constraint firstItem="MBQ-1e-9Rf" firstAttribute="top" secondItem="1NM-GJ-ZhA" secondAttribute="top" constant="5" id="3sZ-Ux-FGz"/>
+                                                <constraint firstItem="MBQ-1e-9Rf" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="tbt-gp-C5J" secondAttribute="trailing" constant="5" id="9Xf-uA-RaH"/>
                                                 <constraint firstItem="Qmw-jO-NVe" firstAttribute="centerY" secondItem="1NM-GJ-ZhA" secondAttribute="centerY" id="9ge-KJ-iRy"/>
                                                 <constraint firstAttribute="bottom" secondItem="MBQ-1e-9Rf" secondAttribute="bottom" constant="5" id="HgN-3y-uPQ"/>
                                                 <constraint firstAttribute="trailing" secondItem="MBQ-1e-9Rf" secondAttribute="trailing" constant="5" id="MZv-jg-YDL"/>
                                                 <constraint firstItem="Qmw-jO-NVe" firstAttribute="height" secondItem="1NM-GJ-ZhA" secondAttribute="height" id="YOC-Jh-83d"/>
-                                                <constraint firstItem="MBQ-1e-9Rf" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Qmw-jO-NVe" secondAttribute="trailing" constant="10" id="eEK-Vc-XMC"/>
+                                                <constraint firstItem="tbt-gp-C5J" firstAttribute="centerY" secondItem="Qmw-jO-NVe" secondAttribute="centerY" constant="-3" id="mMb-Zk-fge"/>
                                                 <constraint firstItem="Qmw-jO-NVe" firstAttribute="leading" secondItem="1NM-GJ-ZhA" secondAttribute="leading" constant="5" id="wg3-mz-Lx8"/>
+                                                <constraint firstItem="tbt-gp-C5J" firstAttribute="leading" secondItem="Qmw-jO-NVe" secondAttribute="trailing" constant="5" id="zgd-44-oss"/>
                                             </constraints>
                                         </tableViewCellContentView>
                                         <connections>
                                             <outlet property="photoView" destination="MBQ-1e-9Rf" id="y5c-aA-4aD"/>
+                                            <outlet property="startLabel" destination="tbt-gp-C5J" id="9kQ-Ag-fNW"/>
                                             <outlet property="titleLabel" destination="Qmw-jO-NVe" id="dV3-vz-92d"/>
                                         </connections>
                                     </tableViewCell>
@@ -105,7 +123,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="kSq-7N-B38">
-                                                    <rect key="frame" x="5" y="5" width="365" height="21"/>
+                                                    <rect key="frame" x="5" y="5" width="42" height="21"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="17"/>
                                                     <nil key="textColor"/>
                                                     <nil key="highlightedColor"/>
@@ -120,19 +138,28 @@
                                                         <outlet property="delegate" destination="N8K-99-Zru" id="mqY-ul-1AU"/>
                                                     </connections>
                                                 </textView>
+                                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="*" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="PXh-An-liI">
+                                                    <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>
                                             </subviews>
                                             <constraints>
                                                 <constraint firstItem="IOP-ZT-bPg" firstAttribute="top" secondItem="kSq-7N-B38" secondAttribute="bottom" constant="5" id="ALn-a5-hd8"/>
-                                                <constraint firstItem="IOP-ZT-bPg" firstAttribute="trailing" secondItem="kSq-7N-B38" secondAttribute="trailing" id="IWB-Wc-5C5"/>
+                                                <constraint firstAttribute="trailing" secondItem="IOP-ZT-bPg" secondAttribute="trailing" constant="5" id="CFF-qv-TKh"/>
                                                 <constraint firstItem="kSq-7N-B38" firstAttribute="top" secondItem="hEy-c0-9Kf" secondAttribute="top" constant="5" id="Nay-fR-SMJ"/>
-                                                <constraint firstItem="IOP-ZT-bPg" firstAttribute="leading" secondItem="kSq-7N-B38" secondAttribute="leading" id="OhJ-tA-WvU"/>
-                                                <constraint firstAttribute="trailing" secondItem="kSq-7N-B38" secondAttribute="trailing" constant="5" id="ZrD-vg-hUA"/>
+                                                <constraint firstItem="PXh-An-liI" firstAttribute="leading" secondItem="kSq-7N-B38" secondAttribute="trailing" constant="5" id="U99-yd-DPU"/>
                                                 <constraint firstItem="kSq-7N-B38" firstAttribute="leading" secondItem="hEy-c0-9Kf" secondAttribute="leading" constant="5" id="bNJ-Or-Wab"/>
+                                                <constraint firstItem="PXh-An-liI" firstAttribute="top" secondItem="hEy-c0-9Kf" secondAttribute="top" constant="2" id="ncC-UJ-j3n"/>
                                                 <constraint firstAttribute="bottom" secondItem="IOP-ZT-bPg" secondAttribute="bottom" constant="5" id="qGB-Zw-orV"/>
+                                                <constraint firstItem="IOP-ZT-bPg" firstAttribute="leading" secondItem="hEy-c0-9Kf" secondAttribute="leading" constant="5" id="qLq-zu-DPZ"/>
+                                                <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="PXh-An-liI" secondAttribute="trailing" constant="5" id="yZR-9G-MTy"/>
                                             </constraints>
                                         </tableViewCellContentView>
                                         <connections>
                                             <outlet property="inputView" destination="IOP-ZT-bPg" id="HHf-TM-AeD"/>
+                                            <outlet property="startLabel" destination="PXh-An-liI" id="08G-No-gXN"/>
                                             <outlet property="titleLabel" destination="kSq-7N-B38" id="Nqr-vh-BVJ"/>
                                         </connections>
                                     </tableViewCell>
@@ -177,6 +204,47 @@
                                             <outlet property="valueLabel" destination="Rwu-ro-0dr" id="irJ-pb-krL"/>
                                         </connections>
                                     </tableViewCell>
+                                    <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="RAEditSignatureCell" rowHeight="150" id="33D-yI-fjG" customClass="RAEditSignatureCell">
+                                        <rect key="frame" x="0.0" y="373" width="375" height="150"/>
+                                        <autoresizingMask key="autoresizingMask"/>
+                                        <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="33D-yI-fjG" id="4qt-JW-wbB">
+                                            <rect key="frame" x="0.0" y="0.0" width="375" height="149.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="3pu-Ya-6af">
+                                                    <rect key="frame" x="5" y="5" width="42" height="21"/>
+                                                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                                    <nil key="textColor"/>
+                                                    <nil key="highlightedColor"/>
+                                                </label>
+                                                <imageView contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="gSS-iw-R4g">
+                                                    <rect key="frame" x="5" y="31" width="365" height="113.5"/>
+                                                </imageView>
+                                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="*" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Top-J1-yJf">
+                                                    <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>
+                                            </subviews>
+                                            <constraints>
+                                                <constraint firstItem="Top-J1-yJf" firstAttribute="top" secondItem="4qt-JW-wbB" secondAttribute="top" constant="2" id="0aE-yF-bEn"/>
+                                                <constraint firstAttribute="bottom" secondItem="gSS-iw-R4g" secondAttribute="bottom" constant="5" id="C6D-v4-PVe"/>
+                                                <constraint firstItem="gSS-iw-R4g" firstAttribute="leading" secondItem="4qt-JW-wbB" secondAttribute="leading" constant="5" id="FCA-rd-46e"/>
+                                                <constraint firstItem="3pu-Ya-6af" firstAttribute="top" secondItem="4qt-JW-wbB" secondAttribute="top" constant="5" id="QIP-ek-4FG"/>
+                                                <constraint firstItem="Top-J1-yJf" firstAttribute="leading" secondItem="3pu-Ya-6af" secondAttribute="trailing" constant="5" id="akC-tG-vpm"/>
+                                                <constraint firstAttribute="trailing" secondItem="gSS-iw-R4g" secondAttribute="trailing" constant="5" id="cuh-4E-jD8"/>
+                                                <constraint firstItem="gSS-iw-R4g" firstAttribute="top" secondItem="3pu-Ya-6af" secondAttribute="bottom" constant="5" id="mhf-Ss-IeP"/>
+                                                <constraint firstItem="3pu-Ya-6af" firstAttribute="leading" secondItem="4qt-JW-wbB" secondAttribute="leading" constant="5" id="oyJ-EV-pml"/>
+                                                <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="Top-J1-yJf" secondAttribute="trailing" constant="5" id="p7d-zU-F7K"/>
+                                            </constraints>
+                                        </tableViewCellContentView>
+                                        <connections>
+                                            <outlet property="signatureView" destination="gSS-iw-R4g" id="Rpx-U1-ZYy"/>
+                                            <outlet property="startLabel" destination="Top-J1-yJf" id="c05-Nt-GXN"/>
+                                            <outlet property="titleLabel" destination="3pu-Ya-6af" id="vPH-wV-7Ey"/>
+                                        </connections>
+                                    </tableViewCell>
                                 </prototypes>
                                 <connections>
                                     <outlet property="dataSource" destination="IN3-1q-AsB" id="j4i-ZN-kfv"/>

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

@@ -13,7 +13,8 @@ typedef enum {
     RAEditTypeLabel = 0,
     RAEditTypeInput = 1,
     RAEditTypeMultInput = 2,
-    RAEditTypePhoto = 3
+    RAEditTypePhoto = 3,
+    RAEditTypeSignature = 4
     
 } RAEditType;
 
@@ -29,6 +30,7 @@ typedef enum {
 @property (nonatomic,copy) NSString *key;
 @property (nonatomic,copy) NSString *title;
 @property (nonatomic,assign) CGFloat height;
+@property (nonatomic,assign) BOOL required;
 
 @property (nonatomic,weak) id<RAEditModelDelegate> delegate;
 

+ 17 - 0
Redant Drivers/Apex And Drivers/Update/Model/RAEditImageBaseModel.h

@@ -0,0 +1,17 @@
+//
+//  RAEditImageBaseModel.h
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/9/4.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RAEditBaseModel.h"
+
+@interface RAEditImageBaseModel : RAEditBaseModel
+
+- (UIImage *)image;
+
+- (NSString *)imageName;
+
+@end

+ 21 - 0
Redant Drivers/Apex And Drivers/Update/Model/RAEditImageBaseModel.m

@@ -0,0 +1,21 @@
+//
+//  RAEditImageBaseModel.m
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/9/4.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RAEditImageBaseModel.h"
+
+@implementation RAEditImageBaseModel
+
+- (UIImage *)image {
+    return nil;
+}
+
+- (NSString *)imageName {
+    return nil;
+}
+
+@end

+ 2 - 2
Redant Drivers/Apex And Drivers/Update/Model/RAEditPhotoModel.h

@@ -6,9 +6,9 @@
 //  Copyright © 2018年 USAI. All rights reserved.
 //
 
-#import "RAEditBaseModel.h"
+#import "RAEditImageBaseModel.h"
 
-@interface RAEditPhotoModel : RAEditBaseModel
+@interface RAEditPhotoModel : RAEditImageBaseModel
 
 @property (nonatomic,strong) UIImage *photo;
 @property (nonatomic,copy,readonly) NSString *photoName;

+ 8 - 0
Redant Drivers/Apex And Drivers/Update/Model/RAEditPhotoModel.m

@@ -25,4 +25,12 @@
     }
 }
 
+- (NSString *)imageName {
+    return self.photoName;
+}
+
+- (UIImage *)image {
+    return self.photo;
+}
+
 @end

+ 16 - 0
Redant Drivers/Apex And Drivers/Update/Model/RAEditSignatureModel.h

@@ -0,0 +1,16 @@
+//
+//  RAEditSignatureModel.h
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/9/4.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RAEditImageBaseModel.h"
+
+@interface RAEditSignatureModel : RAEditImageBaseModel
+
+@property (nonatomic,strong) UIImage *signature;
+@property (nonatomic,copy,readonly) NSString *signatureName;
+
+@end

+ 37 - 0
Redant Drivers/Apex And Drivers/Update/Model/RAEditSignatureModel.m

@@ -0,0 +1,37 @@
+//
+//  RAEditSignatureModel.m
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/9/4.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RAEditSignatureModel.h"
+
+@implementation RAEditSignatureModel
+
+- (NSString *)signatureName {
+    return [NSString stringWithFormat:@"%@.jpg",self.key];
+}
+
+- (void)setSignature:(UIImage *)signature {
+    _signature = signature;
+    
+    if (self.delegate && [self.delegate respondsToSelector:@selector(refresh)]) {
+        [self.delegate refresh];
+    }
+}
+
+- (CGFloat)height {
+    return 150.0f;
+}
+
+- (NSString *)imageName {
+    return [self signatureName];
+}
+
+- (UIImage *)image {
+    return self.signature;
+}
+
+@end

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

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

+ 34 - 0
Redant Drivers/Apex And Drivers/Update/RAOrderEditViewController+TableDataSource.m

@@ -15,10 +15,13 @@
 #import "RAEditMultInputModel.h"
 #import "RAEditLabelModel.h"
 #import "RAEditPhotoModel.h"
+#import "RAEditSignatureModel.h"
 
 #import "RAQRCodeScannerViewController.h"
 #import "RACameraViewController.h"
 #import "RAPhotoPreviewController.h"
+#import "SignatureViewController.h"
+
 
 @implementation RAOrderEditViewController (TableDataSource)
 
@@ -66,6 +69,15 @@
             return cell;
         }
             break;
+        case RAEditTypeSignature: {
+            
+            RAEditSignatureModel *signatureModel = (RAEditSignatureModel *)model;
+            RAEditSignatureCell *cell = [tableView dequeueReusableCellWithIdentifier:@"RAEditSignatureCell" forIndexPath:indexPath];
+            cell.model = signatureModel;
+            cell.delegate = self;
+            return cell;
+        }
+            break;
             
         default:
             break;
@@ -138,4 +150,26 @@
     self.editingIndexPath = nil;
 }
 
+#pragma mark - Signature Delegate
+
+- (void)signatureCell:(RAEditSignatureCell *)cell tapSignature:(RAEditSignatureModel *)model {
+    
+    if (model) {
+        
+        SignatureViewController * vc =[ [UIStoryboard storyboardWithName:@"signature"
+                                                                  bundle:[NSBundle mainBundle]]
+                                       instantiateViewControllerWithIdentifier:@"SignatureViewController"];
+        
+        
+        vc.onReturnImg = ^(UIImage* img)
+        {
+            if(img!=nil) {
+                model.signature = img;
+            }
+        };
+        [self.navigationController pushViewController:vc animated:true];
+        
+    }
+}
+
 @end

+ 28 - 19
Redant Drivers/Apex And Drivers/Update/RAOrderEditViewController.m

@@ -11,12 +11,15 @@
 #import "RAEditInputModel.h"
 #import "RAEditMultInputModel.h"
 #import "RAEditLabelModel.h"
+#import "RAEditImageBaseModel.h"
 #import "RAEditPhotoModel.h"
+#import "RAEditSignatureModel.h"
 
 #import "RAProgressHUD.h"
 #import "ZipArchive.h"
 #import "AppDelegate.h"
 
+
 #import <CoreLocation/CoreLocation.h>
 
 @interface RAEditSectionModel : NSObject
@@ -68,6 +71,13 @@
                 [itemArr addObject:model];
             }
                 break;
+            case RAEditTypeSignature: {
+                
+                RAEditSignatureModel *model = [RAEditSignatureModel new];
+                [model setValuesForKeysWithDictionary:item];
+                [itemArr addObject:model];
+            }
+                break;
                 
             default:
                 break;
@@ -283,7 +293,7 @@
         NSString *latLon = [NSString stringWithFormat:@"%f,%f",location.coordinate.latitude,location.coordinate.longitude];
         [params setObject:latLon forKey:@"location"];
     }
-    NSMutableArray <RAEditPhotoModel *> *photoArr = [self prepareParams:params];
+    NSMutableArray <RAEditImageBaseModel *> *photoArr = [self prepareParams:params];
     
     __weak typeof(self) weakSelf = self;
     dispatch_async(dispatch_get_global_queue(0, 0), ^{
@@ -328,7 +338,7 @@
     });
 }
 
-- (void)backgroundUploadPhoto:(NSArray *)photos Json:(NSDictionary *)json {
+- (void)backgroundUploadPhoto:(NSArray<RAEditImageBaseModel *> *)photos Json:(NSDictionary *)json {
     
     AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
     
@@ -337,7 +347,7 @@
     formatter.dateFormat = @"MM/dd/YYYY HH:mm";
     NSString *time = [formatter stringFromDate:date];
     
-    for (RAEditPhotoModel *model in photos) {
+    for (RAEditImageBaseModel *model in photos) {
         
         NSString *serial = [json objectForKey:model.key];
         if (serial.length) {
@@ -350,7 +360,7 @@
             [params setObject:[RASingleton.sharedInstance encryptUser] forKey:@"name"];
             [params setObject:[RASingleton.sharedInstance encryptPassword] forKey:@"password"];
             [params setObject:@"iOS" forKey:@"platform"];
-            NSString *photoPath = [self.photoDir.lastPathComponent stringByAppendingPathComponent:model.photoName];
+            NSString *photoPath = [self.photoDir.lastPathComponent stringByAppendingPathComponent:model.imageName];
             
             NSMutableDictionary *task = [@{
                                            @"order" : self.orderID,
@@ -366,7 +376,7 @@
     }
 }
 
-- (void)syncUploadPhotos:(NSMutableArray *)photoArr Json:(NSDictionary *)json HUD:(RAProgressHUD *)hud {
+- (void)syncUploadPhotos:(NSMutableArray<RAEditImageBaseModel *> *)photoArr Json:(NSDictionary *)json HUD:(RAProgressHUD *)hud {
     
     dispatch_async(dispatch_get_main_queue(), ^{
         
@@ -382,7 +392,7 @@
             NSMutableArray *completArr = [NSMutableArray array];
             // 同步上传照片
             for (int i = 0; i < photoArr.count; i++) {
-                RAEditPhotoModel *model = [photoArr objectAtIndex:i];
+                RAEditImageBaseModel *model = [photoArr objectAtIndex:i];
                 NSString *serial = [json objectForKey:model.key];
                 if (serial.length) {
                     
@@ -392,7 +402,7 @@
                         [fileParams setObject:self.orderType2 forKey:@"orderType2"];
                     }
                     
-                    NSString *photoPath = [self.photoDir stringByAppendingPathComponent:model.photoName];
+                    NSString *photoPath = [self.photoDir stringByAppendingPathComponent:model.imageName];
                     NSDictionary *uploadJson = [RADataProvider uploadFile:photoPath parameters:fileParams];
                     int uploadResult = [[uploadJson objectForKey:@"result"] intValue];
                     
@@ -516,13 +526,13 @@
     return _photoDir;
 }
 
-- (NSMutableArray <RAEditPhotoModel *> *)prepareParams:(NSMutableDictionary *)params {
+- (NSMutableArray <RAEditImageBaseModel *> *)prepareParams:(NSMutableDictionary *)params {
     
     if (params == nil) {
         return nil;
     }
     
-    NSMutableArray <RAEditPhotoModel *> *photoArr = [NSMutableArray array];
+    NSMutableArray <RAEditImageBaseModel *> *photoArr = [NSMutableArray array];
     
     NSString *photoDir = [self photoDir];
     
@@ -563,27 +573,26 @@
                     }
                 }
                     break;
-                case RAEditTypePhoto: {
+                case RAEditTypePhoto:
+                case RAEditTypeSignature: {
                     
                     if (photoDir) {
-                    
-                        RAEditPhotoModel *photoModel = (RAEditPhotoModel *)model;
-                        if (photoModel.photo) {
+                        
+                        RAEditImageBaseModel *imageModel = (RAEditImageBaseModel *)model;
+                        if (imageModel.image) {
                             
-                            NSString *photoPath = [photoDir stringByAppendingPathComponent:photoModel.photoName];
-                            NSData *imgData = UIImageJPEGRepresentation(photoModel.photo, 1.0f);
+                            NSString *photoPath = [photoDir stringByAppendingPathComponent:imageModel.imageName];
+                            NSData *imgData = UIImageJPEGRepresentation(imageModel.image, 1.0f);
                             if (imgData) {
                                 
                                 [imgData writeToFile:photoPath atomically:NO];
-                                [params setObject:photoModel.photoName forKey:photoModel.key];
+                                [params setObject:imageModel.imageName forKey:imageModel.key];
                                 
-                                [photoArr addObject:photoModel];
+                                [photoArr addObject:imageModel];
                             }
                         }
                         
                     }
-                    
-                    
                 }
                     break;