Prechádzať zdrojové kódy

1.完成iOS Apex Drivers Order Filter。

Pen Li 7 rokov pred
rodič
commit
5f69f68d18
45 zmenil súbory, kde vykonal 1587 pridanie a 23 odobranie
  1. 4 4
      Redant Drivers/Apex And Drivers/AppDelegate.m
  2. BIN
      Redant Drivers/Apex And Drivers/Assets.xcassets/AppIcon.appiconset/Apex & Drivers Logo.png
  3. BIN
      Redant Drivers/Apex And Drivers/Assets.xcassets/AppIcon.appiconset/Apex & Drivers Logo@2x-1.png
  4. BIN
      Redant Drivers/Apex And Drivers/Assets.xcassets/AppIcon.appiconset/Apex & Drivers Logo@2x-2.png
  5. BIN
      Redant Drivers/Apex And Drivers/Assets.xcassets/AppIcon.appiconset/Apex & Drivers Logo@2x-3.png
  6. BIN
      Redant Drivers/Apex And Drivers/Assets.xcassets/AppIcon.appiconset/Apex & Drivers Logo@2x.png
  7. BIN
      Redant Drivers/Apex And Drivers/Assets.xcassets/AppIcon.appiconset/Apex & Drivers Logo@3x-1.png
  8. BIN
      Redant Drivers/Apex And Drivers/Assets.xcassets/AppIcon.appiconset/Apex & Drivers Logo@3x-2.png
  9. BIN
      Redant Drivers/Apex And Drivers/Assets.xcassets/AppIcon.appiconset/Apex & Drivers Logo@3x-3.png
  10. BIN
      Redant Drivers/Apex And Drivers/Assets.xcassets/AppIcon.appiconset/Apex & Drivers Logo@3x.png
  11. 18 9
      Redant Drivers/Apex And Drivers/Assets.xcassets/AppIcon.appiconset/Contents.json
  12. 61 0
      Redant Drivers/Apex And Drivers/FakeData/fake_order_filter.json
  13. 16 0
      Redant Drivers/Apex And Drivers/Filter/Cell/RAOrderFilterBaseCell.h
  14. 42 0
      Redant Drivers/Apex And Drivers/Filter/Cell/RAOrderFilterBaseCell.m
  15. 25 0
      Redant Drivers/Apex And Drivers/Filter/Cell/RAOrderFilterDateCell.h
  16. 71 0
      Redant Drivers/Apex And Drivers/Filter/Cell/RAOrderFilterDateCell.m
  17. 13 0
      Redant Drivers/Apex And Drivers/Filter/Cell/RAOrderFilterInputCell.h
  18. 49 0
      Redant Drivers/Apex And Drivers/Filter/Cell/RAOrderFilterInputCell.m
  19. 13 0
      Redant Drivers/Apex And Drivers/Filter/Cell/RAOrderFilterStatusCell.h
  20. 39 0
      Redant Drivers/Apex And Drivers/Filter/Cell/RAOrderFilterStatusCell.m
  21. 15 0
      Redant Drivers/Apex And Drivers/Filter/DatePicker/RADatePickerViewController.h
  22. 97 0
      Redant Drivers/Apex And Drivers/Filter/DatePicker/RADatePickerViewController.m
  23. 31 0
      Redant Drivers/Apex And Drivers/Filter/Model/RAOrderFilterBaseModel.h
  24. 17 0
      Redant Drivers/Apex And Drivers/Filter/Model/RAOrderFilterBaseModel.m
  25. 16 0
      Redant Drivers/Apex And Drivers/Filter/Model/RAOrderFilterDateModel.h
  26. 29 0
      Redant Drivers/Apex And Drivers/Filter/Model/RAOrderFilterDateModel.m
  27. 17 0
      Redant Drivers/Apex And Drivers/Filter/Model/RAOrderFilterInputModel.h
  28. 25 0
      Redant Drivers/Apex And Drivers/Filter/Model/RAOrderFilterInputModel.m
  29. 20 0
      Redant Drivers/Apex And Drivers/Filter/Model/RAOrderFilterSectionModel.h
  30. 62 0
      Redant Drivers/Apex And Drivers/Filter/Model/RAOrderFilterSectionModel.m
  31. 16 0
      Redant Drivers/Apex And Drivers/Filter/Model/RAOrderFilterStatusModel.h
  32. 29 0
      Redant Drivers/Apex And Drivers/Filter/Model/RAOrderFilterStatusModel.m
  33. 14 0
      Redant Drivers/Apex And Drivers/Filter/RAOrderFilterViewController+DataSource.h
  34. 88 0
      Redant Drivers/Apex And Drivers/Filter/RAOrderFilterViewController+DataSource.m
  35. 13 0
      Redant Drivers/Apex And Drivers/Filter/RAOrderFilterViewController+TableDelegate.h
  36. 44 0
      Redant Drivers/Apex And Drivers/Filter/RAOrderFilterViewController+TableDelegate.m
  37. 28 0
      Redant Drivers/Apex And Drivers/Filter/RAOrderFilterViewController.h
  38. 245 0
      Redant Drivers/Apex And Drivers/Filter/RAOrderFilterViewController.m
  39. 269 0
      Redant Drivers/Apex And Drivers/Filter/orderFilter.storyboard
  40. 30 5
      Redant Drivers/Apex And Drivers/Home/More/RAHomeMoreViewController.m
  41. 1 1
      Redant Drivers/Apex And Drivers/Home/RAHomeViewController+HomeTableDelegate.m
  42. 93 0
      Redant Drivers/Apex And Drivers/PresentationController/RAPresentationController.m
  43. 13 0
      Redant Drivers/Apex And Drivers/PresentationController/RApresentationController.h
  44. 4 2
      Redant Drivers/Apex And Drivers/RADataProvider.h
  45. 20 2
      Redant Drivers/Apex And Drivers/RADataProvider.m

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

@@ -82,12 +82,12 @@ static const NSInteger OrderTypeNew = 2;
     self.locationManager = nil;
 }
 
-- (void)reportLocation:(CLLocation *)location {
+- (void)reportLocation:(CLLocation *)location forOrder:(NSString *)orderID {
     
     if (location) {
         NSString *latLon = [NSString stringWithFormat:@"%f,%f",location.coordinate.latitude,location.coordinate.longitude];
         dispatch_async(dispatch_get_global_queue(0, 0), ^{
-           [RADataProvider reportCurrentLocation:latLon];
+           [RADataProvider reportCurrentLocation:latLon forOrderID:orderID];
         });
     } else {
         
@@ -252,8 +252,8 @@ static const NSInteger OrderTypeNew = 2;
         NSDictionary *aps = [userInfo objectForKey:@"aps"];
         NSInteger report_location = [[aps objectForKey:@"report-location"] integerValue];
         if (report_location == 1) {
-            
-            [self reportLocation:[RASingleton sharedInstance].currentLocation];
+            NSString *orderID = [aps objectForKey:@"order-id"];
+            [self reportLocation:[RASingleton sharedInstance].currentLocation forOrder:orderID];
             completionHandler(UIBackgroundFetchResultNewData);
         } else {
             /**

BIN
Redant Drivers/Apex And Drivers/Assets.xcassets/AppIcon.appiconset/Apex & Drivers Logo.png


BIN
Redant Drivers/Apex And Drivers/Assets.xcassets/AppIcon.appiconset/Apex & Drivers Logo@2x-1.png


BIN
Redant Drivers/Apex And Drivers/Assets.xcassets/AppIcon.appiconset/Apex & Drivers Logo@2x-2.png


BIN
Redant Drivers/Apex And Drivers/Assets.xcassets/AppIcon.appiconset/Apex & Drivers Logo@2x-3.png


BIN
Redant Drivers/Apex And Drivers/Assets.xcassets/AppIcon.appiconset/Apex & Drivers Logo@2x.png


BIN
Redant Drivers/Apex And Drivers/Assets.xcassets/AppIcon.appiconset/Apex & Drivers Logo@3x-1.png


BIN
Redant Drivers/Apex And Drivers/Assets.xcassets/AppIcon.appiconset/Apex & Drivers Logo@3x-2.png


BIN
Redant Drivers/Apex And Drivers/Assets.xcassets/AppIcon.appiconset/Apex & Drivers Logo@3x-3.png


BIN
Redant Drivers/Apex And Drivers/Assets.xcassets/AppIcon.appiconset/Apex & Drivers Logo@3x.png


+ 18 - 9
Redant Drivers/Apex And Drivers/Assets.xcassets/AppIcon.appiconset/Contents.json

@@ -1,43 +1,51 @@
 {
   "images" : [
     {
-      "idiom" : "iphone",
       "size" : "20x20",
+      "idiom" : "iphone",
+      "filename" : "Apex & Drivers Logo@2x-3.png",
       "scale" : "2x"
     },
     {
-      "idiom" : "iphone",
       "size" : "20x20",
+      "idiom" : "iphone",
+      "filename" : "Apex & Drivers Logo@3x-3.png",
       "scale" : "3x"
     },
     {
-      "idiom" : "iphone",
       "size" : "29x29",
+      "idiom" : "iphone",
+      "filename" : "Apex & Drivers Logo@2x-2.png",
       "scale" : "2x"
     },
     {
-      "idiom" : "iphone",
       "size" : "29x29",
+      "idiom" : "iphone",
+      "filename" : "Apex & Drivers Logo@3x-2.png",
       "scale" : "3x"
     },
     {
-      "idiom" : "iphone",
       "size" : "40x40",
+      "idiom" : "iphone",
+      "filename" : "Apex & Drivers Logo@2x-1.png",
       "scale" : "2x"
     },
     {
-      "idiom" : "iphone",
       "size" : "40x40",
+      "idiom" : "iphone",
+      "filename" : "Apex & Drivers Logo@3x-1.png",
       "scale" : "3x"
     },
     {
-      "idiom" : "iphone",
       "size" : "60x60",
+      "idiom" : "iphone",
+      "filename" : "Apex & Drivers Logo@2x.png",
       "scale" : "2x"
     },
     {
-      "idiom" : "iphone",
       "size" : "60x60",
+      "idiom" : "iphone",
+      "filename" : "Apex & Drivers Logo@3x.png",
       "scale" : "3x"
     },
     {
@@ -86,8 +94,9 @@
       "scale" : "2x"
     },
     {
-      "idiom" : "ios-marketing",
       "size" : "1024x1024",
+      "idiom" : "ios-marketing",
+      "filename" : "Apex & Drivers Logo.png",
       "scale" : "1x"
     }
   ],

+ 61 - 0
Redant Drivers/Apex And Drivers/FakeData/fake_order_filter.json

@@ -0,0 +1,61 @@
+{
+    "sections": [
+                 {
+                 "title": "Order Status",
+                 "values": [
+                            {
+                            "type": 0,
+                            "value": "New Order"
+                            },
+                            {
+                            "type": 0,
+                            "value": "PickUp Order"
+                            },
+                            {
+                            "type": 0,
+                            "value": "Delivered"
+                            },
+                            {
+                            "type": 0,
+                            "value": "Cancel"
+                            },
+                            {
+                            "type": 0,
+                            "value": "Return"
+                            }
+                            ],
+                 "key": "status"
+                 },
+                 {
+                 "title": "Order ID",
+                 "values": [
+                            {
+                            "type": 1,
+                            "value": ""
+                            }
+                            ],
+                 "key": "order_id"
+                 },
+                 {
+                 "title": "Container No.",
+                 "values": [
+                            {
+                            "type": 1,
+                            "value": ""
+                            }
+                            ],
+                 "key": "container_no"
+                 },
+                 {
+                 "title": "Date",
+                 "values": [
+                            {
+                            "type": 2,
+                            "from": "",
+                            "to": ""
+                            }
+                            ],
+                 "key": "date"
+                 }
+                 ]
+}

+ 16 - 0
Redant Drivers/Apex And Drivers/Filter/Cell/RAOrderFilterBaseCell.h

@@ -0,0 +1,16 @@
+//
+//  RAOrderFilterBaseCell.h
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/8/27.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import "RAOrderFilterBaseModel.h"
+
+@interface RAOrderFilterBaseCell : UITableViewCell <RAOrderFilterDelegate>
+
+@property (nonatomic,weak) RAOrderFilterBaseModel *model;
+
+@end

+ 42 - 0
Redant Drivers/Apex And Drivers/Filter/Cell/RAOrderFilterBaseCell.m

@@ -0,0 +1,42 @@
+//
+//  RAOrderFilterBaseCell.m
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/8/27.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RAOrderFilterBaseCell.h"
+
+@implementation RAOrderFilterBaseCell
+
+- (void)awakeFromNib {
+    [super awakeFromNib];
+    // Initialization code
+}
+
+- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
+    [super setSelected:selected animated:animated];
+
+    // Configure the view for the selected state
+}
+
+- (void)setModel:(RAOrderFilterBaseModel *)model {
+    _model.delegate = nil;
+    _model = model;
+    _model.delegate = self;
+    
+    [self refreshUI];
+}
+
+- (void)prepareForReuse {
+    [super prepareForReuse];
+    
+    self.model = nil;
+}
+
+- (void)refreshUI {
+    
+}
+
+@end

+ 25 - 0
Redant Drivers/Apex And Drivers/Filter/Cell/RAOrderFilterDateCell.h

@@ -0,0 +1,25 @@
+//
+//  RAOrderFilterDateCell.h
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/8/27.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RAOrderFilterBaseCell.h"
+
+@class RAOrderFilterDateCell;
+@protocol RAOrderFilterDateCellDelegate <NSObject>
+
+@required
+
+- (void)orderFilterDateCell:(RAOrderFilterDateCell *)cell didClickFromButton:(UIButton *)sender;
+- (void)orderFilterDateCell:(RAOrderFilterDateCell *)cell didClickToButton:(UIButton *)sender;
+
+@end
+
+@interface RAOrderFilterDateCell : RAOrderFilterBaseCell
+
+@property (nonatomic,weak) id<RAOrderFilterDateCellDelegate> delegate;
+
+@end

+ 71 - 0
Redant Drivers/Apex And Drivers/Filter/Cell/RAOrderFilterDateCell.m

@@ -0,0 +1,71 @@
+//
+//  RAOrderFilterDateCell.m
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/8/27.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RAOrderFilterDateCell.h"
+#import "RAOrderFilterDateModel.h"
+
+
+@interface RAOrderFilterDateCell ()
+
+@property (nonatomic,strong) IBOutlet UIButton *fromBtn;
+@property (nonatomic,strong) IBOutlet UIButton *toBtn;
+
+
+@end
+
+@implementation RAOrderFilterDateCell
+
+- (void)awakeFromNib {
+    [super awakeFromNib];
+    // Initialization code
+    
+    self.selectionStyle = UITableViewCellSelectionStyleNone;
+}
+
+- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
+    [super setSelected:selected animated:animated];
+
+    // Configure the view for the selected state
+}
+
+- (void)prepareForReuse {
+    [super prepareForReuse];
+    
+    self.delegate = nil;
+}
+
+- (IBAction)fromBtnClick:(id)sender {
+
+    if (self.delegate) {
+        [self.delegate orderFilterDateCell:self didClickFromButton:sender];
+    }
+}
+
+- (IBAction)toBtnClick:(id)sender {
+    if (self.delegate) {
+        [self.delegate orderFilterDateCell:self didClickToButton:sender];
+    }
+}
+
+- (void)refreshUI {
+    
+    RAOrderFilterDateModel *model = (RAOrderFilterDateModel *)self.model;
+    NSString *from = model.from;
+    if (from.length == 0) {
+        from = @"From";
+    }
+    [self.fromBtn setTitle:from forState:UIControlStateNormal];
+    
+    NSString *to = model.to;
+    if (to.length == 0) {
+        to = @"To";
+    }
+    [self.toBtn setTitle:to forState:UIControlStateNormal];
+}
+
+@end

+ 13 - 0
Redant Drivers/Apex And Drivers/Filter/Cell/RAOrderFilterInputCell.h

@@ -0,0 +1,13 @@
+//
+//  RAOrderFilterInputCell.h
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/8/27.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RAOrderFilterBaseCell.h"
+
+@interface RAOrderFilterInputCell : RAOrderFilterBaseCell
+
+@end

+ 49 - 0
Redant Drivers/Apex And Drivers/Filter/Cell/RAOrderFilterInputCell.m

@@ -0,0 +1,49 @@
+//
+//  RAOrderFilterInputCell.m
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/8/27.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RAOrderFilterInputCell.h"
+#import "RAOrderFilterInputModel.h"
+
+@interface RAOrderFilterInputCell () <UITextFieldDelegate>
+
+@property (nonatomic,strong) IBOutlet UITextField *inputTextField;
+
+@end
+
+
+@implementation RAOrderFilterInputCell
+
+- (void)awakeFromNib {
+    [super awakeFromNib];
+    // Initialization code
+    
+    self.selectionStyle = UITableViewCellSelectionStyleNone;
+}
+
+- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
+    [super setSelected:selected animated:animated];
+
+    // Configure the view for the selected state
+}
+
+- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
+    
+    NSString *newStr = [textField.text stringByReplacingCharactersInRange:range withString:string];
+    RAOrderFilterInputModel *model = (RAOrderFilterInputModel *)self.model;
+    [model updateValue:newStr];
+    
+    return YES;
+}
+
+- (void)refreshUI {
+    RAOrderFilterInputModel *model = (RAOrderFilterInputModel *)self.model;
+    
+    self.inputTextField.text = model.value;
+}
+
+@end

+ 13 - 0
Redant Drivers/Apex And Drivers/Filter/Cell/RAOrderFilterStatusCell.h

@@ -0,0 +1,13 @@
+//
+//  RAOrderFilterStatusCell.h
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/8/27.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RAOrderFilterBaseCell.h"
+
+@interface RAOrderFilterStatusCell : RAOrderFilterBaseCell
+
+@end

+ 39 - 0
Redant Drivers/Apex And Drivers/Filter/Cell/RAOrderFilterStatusCell.m

@@ -0,0 +1,39 @@
+//
+//  RAOrderFilterStatusCell.m
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/8/27.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RAOrderFilterStatusCell.h"
+#import "RAOrderFilterStatusModel.h"
+
+@interface RAOrderFilterStatusCell ()
+
+@property (nonatomic,strong) IBOutlet UILabel *valueLabel;
+@property (nonatomic,strong) IBOutlet UIImageView *selectionView;
+
+@end
+
+@implementation RAOrderFilterStatusCell
+
+- (void)awakeFromNib {
+    [super awakeFromNib];
+    // Initialization code
+}
+
+- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
+    [super setSelected:selected animated:animated];
+
+    // Configure the view for the selected state
+}
+
+- (void)refreshUI {
+    RAOrderFilterStatusModel *model = (RAOrderFilterStatusModel *)self.model;
+    
+    self.valueLabel.text = model.value;
+    self.selectionView.hidden = !model.selected;
+}
+
+@end

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

@@ -0,0 +1,15 @@
+//
+//  RADatePickerViewController.h
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/8/28.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RABaseViewController.h"
+
+@interface RADatePickerViewController : RABaseViewController
+
++ (void)presentDatePicker:(UIViewController *)viewController title:(NSString *)title withSetBlk:(void(^)(NSDate *date))blk;
+
+@end

+ 97 - 0
Redant Drivers/Apex And Drivers/Filter/DatePicker/RADatePickerViewController.m

@@ -0,0 +1,97 @@
+//
+//  RADatePickerViewController.m
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/8/28.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RADatePickerViewController.h"
+#import "RAPresentationController.h"
+
+@interface RADatePickerViewController () <UIViewControllerTransitioningDelegate>
+@property (strong, nonatomic) IBOutlet UILabel *titleLabel;
+@property (strong, nonatomic) IBOutlet UIDatePicker *datePicker;
+
+@property (nonatomic,copy) void(^blk)(NSDate *);
+
+@end
+
+@implementation RADatePickerViewController
+
++ (instancetype)viewControllerFromStoryboard {
+    RADatePickerViewController *datePickerVC = [[UIStoryboard storyboardWithName:@"orderFilter" bundle:nil] instantiateViewControllerWithIdentifier:[self storyboardID]];
+    
+    
+    return datePickerVC;
+}
+
++ (void)presentDatePicker:(UIViewController *)viewController title:(NSString *)title withSetBlk:(void(^)(NSDate *date))blk {
+    
+    if (!viewController) {
+        return;
+    }
+    
+    RADatePickerViewController *datePickerVC = [self viewControllerFromStoryboard];
+    
+    datePickerVC.title = title;
+    datePickerVC.blk = blk;
+    
+    datePickerVC.transitioningDelegate = datePickerVC;
+    datePickerVC.modalPresentationStyle = UIModalPresentationCustom;
+    datePickerVC.preferredContentSize = CGSizeMake(300, 315);
+    
+    [viewController presentViewController:datePickerVC animated:YES completion:nil];
+}
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view.
+    
+    self.view.layer.cornerRadius = 5.0f;
+    self.view.layer.masksToBounds = YES;
+    
+    self.titleLabel.text = self.title;
+}
+
+- (void)didReceiveMemoryWarning {
+    [super didReceiveMemoryWarning];
+    // Dispose of any resources that can be recreated.
+}
+
+#pragma mark - UIViewControllerTransitioningDelegate
+
+- (UIPresentationController *)presentationControllerForPresentedViewController:(UIViewController *)presented
+                                                      presentingViewController:(UIViewController *)presenting
+                                                          sourceViewController:(UIViewController *)source {
+    
+    return [[RAPresentationController alloc] initWithPresentedViewController:presented presentingViewController:presenting];
+    
+}
+
+#pragma mark - Action
+
+- (IBAction)cancelBtnClick:(id)sender {
+    
+    [self dismissViewControllerAnimated:YES completion:nil];
+    
+}
+
+- (IBAction)setBtnClick:(id)sender {
+    
+    __weak typeof(self) weakSelf = self;
+    NSDate *date = self.datePicker.date;
+    [self dismissViewControllerAnimated:YES completion:^{
+       
+        if (weakSelf) {
+            __strong typeof(weakSelf) strongSelf = weakSelf;
+            if (strongSelf.blk) {
+                strongSelf.blk(date);
+            }
+        }
+        
+    }];
+}
+
+
+@end

+ 31 - 0
Redant Drivers/Apex And Drivers/Filter/Model/RAOrderFilterBaseModel.h

@@ -0,0 +1,31 @@
+//
+//  RAOrderFilterBaseModel.h
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/8/27.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+typedef enum {
+    
+    RAOrderFilterModelTypeStatus = 0,
+    RAOrderFilterModelTypeInput = 1,
+    RAOrderFilterModelTypeDate = 2
+    
+} RAOrderFilterModelType;
+
+
+@protocol RAOrderFilterDelegate <NSObject>
+
+- (void)refreshUI;
+
+@end
+
+@interface RAOrderFilterBaseModel : NSObject
+
+@property (nonatomic,assign) RAOrderFilterModelType type;
+@property (nonatomic,weak) id<RAOrderFilterDelegate> delegate;
+
+@end

+ 17 - 0
Redant Drivers/Apex And Drivers/Filter/Model/RAOrderFilterBaseModel.m

@@ -0,0 +1,17 @@
+//
+//  RAOrderFilterBaseModel.m
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/8/27.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RAOrderFilterBaseModel.h"
+
+@implementation RAOrderFilterBaseModel
+
+- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
+    
+}
+
+@end

+ 16 - 0
Redant Drivers/Apex And Drivers/Filter/Model/RAOrderFilterDateModel.h

@@ -0,0 +1,16 @@
+//
+//  RAOrderFilterDateModel.h
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/8/27.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RAOrderFilterBaseModel.h"
+
+@interface RAOrderFilterDateModel : RAOrderFilterBaseModel
+
+@property (nonatomic,copy) NSString *from;
+@property (nonatomic,copy) NSString *to;
+
+@end

+ 29 - 0
Redant Drivers/Apex And Drivers/Filter/Model/RAOrderFilterDateModel.m

@@ -0,0 +1,29 @@
+//
+//  RAOrderFilterDateModel.m
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/8/27.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RAOrderFilterDateModel.h"
+
+@implementation RAOrderFilterDateModel
+
+- (void)setFrom:(NSString *)from {
+    _from = from;
+    
+    if (self.delegate) {
+        [self.delegate refreshUI];
+    }
+}
+
+- (void)setTo:(NSString *)to {
+    _to = to;
+    
+    if (self.delegate) {
+        [self.delegate refreshUI];
+    }
+}
+
+@end

+ 17 - 0
Redant Drivers/Apex And Drivers/Filter/Model/RAOrderFilterInputModel.h

@@ -0,0 +1,17 @@
+//
+//  RAOrderFilterInputModel.h
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/8/27.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RAOrderFilterBaseModel.h"
+
+@interface RAOrderFilterInputModel : RAOrderFilterBaseModel
+
+@property (nonatomic,copy) NSString *value;
+
+- (void)updateValue:(NSString *)value;
+
+@end

+ 25 - 0
Redant Drivers/Apex And Drivers/Filter/Model/RAOrderFilterInputModel.m

@@ -0,0 +1,25 @@
+//
+//  RAOrderFilterInputModel.m
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/8/27.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RAOrderFilterInputModel.h"
+
+@implementation RAOrderFilterInputModel
+
+- (void)setValue:(NSString *)value {
+    _value = value;
+    
+    if (self.delegate) {
+        [self.delegate refreshUI];
+    }
+}
+
+- (void)updateValue:(NSString *)value {
+    _value = value;    
+}
+
+@end

+ 20 - 0
Redant Drivers/Apex And Drivers/Filter/Model/RAOrderFilterSectionModel.h

@@ -0,0 +1,20 @@
+//
+//  RAOrderFilterSectionModel.h
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/8/27.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "RAOrderFilterBaseModel.h"
+
+@interface RAOrderFilterSectionModel : NSObject
+
+@property (nonatomic,copy) NSString *title;
+@property (nonatomic,copy) NSString *key;
+@property (nonatomic,strong) NSArray<RAOrderFilterBaseModel *> *values;
+
+- (RAOrderFilterBaseModel *)modelForRow:(NSInteger)row;
+
+@end

+ 62 - 0
Redant Drivers/Apex And Drivers/Filter/Model/RAOrderFilterSectionModel.m

@@ -0,0 +1,62 @@
+//
+//  RAOrderFilterSectionModel.m
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/8/27.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RAOrderFilterSectionModel.h"
+#import "RAOrderFilterStatusModel.h"
+#import "RAOrderFilterDateModel.h"
+#import "RAOrderFilterInputModel.h"
+
+@implementation RAOrderFilterSectionModel
+
+- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
+    
+}
+
+- (void)setValues:(NSArray *)values {
+    
+    NSMutableArray *valuesArr = [NSMutableArray array];
+    for (int i = 0; i < values.count; i++) {
+        NSDictionary *value = [values objectAtIndex:i];
+        
+        RAOrderFilterModelType type = [[value objectForKey:@"type"] intValue];
+        switch (type) {
+            case RAOrderFilterModelTypeStatus:{
+                RAOrderFilterStatusModel *model = [[RAOrderFilterStatusModel alloc] init];
+                [model setValuesForKeysWithDictionary:value];
+                
+                [valuesArr addObject:model];
+            }
+                break;
+            case RAOrderFilterModelTypeDate: {
+                RAOrderFilterDateModel *model = [[RAOrderFilterDateModel alloc] init];
+                [model setValuesForKeysWithDictionary:value];
+                
+                [valuesArr addObject:model];
+            }
+                break;
+            case RAOrderFilterModelTypeInput: {
+                RAOrderFilterInputModel *model = [[RAOrderFilterInputModel alloc] init];
+                [model setValuesForKeysWithDictionary:value];
+                
+                [valuesArr addObject:model];
+            }
+                break;
+                
+            default:
+                break;
+        }
+    }
+    
+    _values = valuesArr;
+}
+
+- (RAOrderFilterBaseModel *)modelForRow:(NSInteger)row {
+    return [self.values objectAtIndex:row];
+}
+
+@end

+ 16 - 0
Redant Drivers/Apex And Drivers/Filter/Model/RAOrderFilterStatusModel.h

@@ -0,0 +1,16 @@
+//
+//  RAOrderFilterStatusModel.h
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/8/27.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RAOrderFilterBaseModel.h"
+
+@interface RAOrderFilterStatusModel : RAOrderFilterBaseModel
+
+@property (nonatomic,copy) NSString *value;
+@property (nonatomic,assign) BOOL selected;
+
+@end

+ 29 - 0
Redant Drivers/Apex And Drivers/Filter/Model/RAOrderFilterStatusModel.m

@@ -0,0 +1,29 @@
+//
+//  RAOrderFilterStatusModel.m
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/8/27.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RAOrderFilterStatusModel.h"
+
+@implementation RAOrderFilterStatusModel
+
+- (void)setValue:(NSString *)value {
+    _value = value;
+    
+    if (self.delegate) {
+        [self.delegate refreshUI];
+    }
+}
+
+- (void)setSelected:(BOOL)selected {
+    _selected = selected;
+    
+    if (self.delegate) {
+        [self.delegate refreshUI];
+    }
+}
+
+@end

+ 14 - 0
Redant Drivers/Apex And Drivers/Filter/RAOrderFilterViewController+DataSource.h

@@ -0,0 +1,14 @@
+//
+//  RAOrderFilterViewController+DataSource.h
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/8/27.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RAOrderFilterViewController.h"
+#import "RAOrderFilterDateCell.h"
+
+@interface RAOrderFilterViewController (DataSource) <UITableViewDataSource,RAOrderFilterDateCellDelegate>
+
+@end

+ 88 - 0
Redant Drivers/Apex And Drivers/Filter/RAOrderFilterViewController+DataSource.m

@@ -0,0 +1,88 @@
+//
+//  RAOrderFilterViewController+DataSource.m
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/8/27.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RAOrderFilterViewController+DataSource.h"
+#import "RAOrderFilterInputCell.h"
+#import "RAOrderFilterStatusCell.h"
+#import "RADatePickerViewController.h"
+#import "RAOrderFilterDateModel.h"
+
+@implementation RAOrderFilterViewController (DataSource) 
+
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
+    return [self sectionCount];
+}
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
+    return [self rowCountForSection:section];
+}
+
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
+    
+    RAOrderFilterBaseModel *model = [self modelForIndexPath:indexPath];
+    switch (model.type) {
+        case RAOrderFilterModelTypeDate: {
+            RAOrderFilterDateCell *cell = [tableView dequeueReusableCellWithIdentifier:@"RAOrderFilterDateCell" forIndexPath:indexPath];
+            cell.model = model;
+            cell.delegate = self;
+            return cell;
+        }
+        break;
+        case RAOrderFilterModelTypeInput: {
+            RAOrderFilterInputCell *cell = [tableView dequeueReusableCellWithIdentifier:@"RAOrderFilterInputCell" forIndexPath:indexPath];
+            cell.model = model;
+            return cell;
+        }
+        break;
+        case RAOrderFilterModelTypeStatus: {
+            RAOrderFilterStatusCell *cell = [tableView dequeueReusableCellWithIdentifier:@"RAOrderFilterStatusCell" forIndexPath:indexPath];
+            cell.model = model;
+            return cell;
+        }
+        break;
+        
+        default:
+        break;
+    }
+    
+    return [[UITableViewCell alloc] init];
+}
+
+#pragma mark - DateCell Delegate
+
+- (void)orderFilterDateCell:(RAOrderFilterDateCell *)cell didClickFromButton:(UIButton *)sender {
+    
+    NSIndexPath *indexPath = [self.tableView indexPathForCell:cell];
+    RAOrderFilterDateModel *model = (RAOrderFilterDateModel *)[self modelForIndexPath:indexPath];
+    
+    [RADatePickerViewController presentDatePicker:self title:@"From Date" withSetBlk:^(NSDate *date) {
+        
+        NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
+        formatter.dateFormat = @"YYYY-MM-dd";
+        NSString *dateStr = [formatter stringFromDate:date];
+    
+        model.from = dateStr;
+    }];
+}
+
+- (void)orderFilterDateCell:(RAOrderFilterDateCell *)cell didClickToButton:(UIButton *)sender {
+    
+    NSIndexPath *indexPath = [self.tableView indexPathForCell:cell];
+    RAOrderFilterDateModel *model = (RAOrderFilterDateModel *)[self modelForIndexPath:indexPath];
+    
+    [RADatePickerViewController presentDatePicker:self title:@"To Date" withSetBlk:^(NSDate *date) {
+        
+        NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
+        formatter.dateFormat = @"YYYY-MM-dd";
+        NSString *dateStr = [formatter stringFromDate:date];
+        
+        model.to = dateStr;
+    }];
+}
+
+@end

+ 13 - 0
Redant Drivers/Apex And Drivers/Filter/RAOrderFilterViewController+TableDelegate.h

@@ -0,0 +1,13 @@
+//
+//  RAOrderFilterViewController+TableDelegate.h
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/8/27.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RAOrderFilterViewController.h"
+
+@interface RAOrderFilterViewController (TableDelegate) <UITableViewDelegate>
+
+@end

+ 44 - 0
Redant Drivers/Apex And Drivers/Filter/RAOrderFilterViewController+TableDelegate.m

@@ -0,0 +1,44 @@
+//
+//  RAOrderFilterViewController+TableDelegate.m
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/8/27.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RAOrderFilterViewController+TableDelegate.h"
+#import "RAOrderFilterSectionModel.h"
+#import "RAOrderFilterStatusModel.h"
+
+@implementation RAOrderFilterViewController (TableDelegate)
+
+- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
+    return 50.0f;
+}
+
+- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
+    
+    UIView *header = [[UIView alloc] init];
+    header.backgroundColor = [UIColor colorWithRed:0.8 green:0.8 blue:0.8 alpha:0.8];
+    
+    UILabel *titleLB = [[UILabel alloc] initWithFrame:CGRectMake(5, 5, CGRectGetWidth(tableView.bounds) - 11, 30)];
+    titleLB.text = [self sectionModelForSection:section].title;
+    
+    [header addSubview:titleLB];
+    
+    return header;
+}
+
+- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
+    return 40.0f;
+}
+
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
+    RAOrderFilterBaseModel *model = [self modelForIndexPath:indexPath];
+    if (model.type == RAOrderFilterModelTypeStatus) {
+        RAOrderFilterStatusModel *statusModel = (RAOrderFilterStatusModel *)model;
+        statusModel.selected = !statusModel.selected;
+    }
+}
+
+@end

+ 28 - 0
Redant Drivers/Apex And Drivers/Filter/RAOrderFilterViewController.h

@@ -0,0 +1,28 @@
+//
+//  RAOrderFilterViewController.h
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/8/27.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RABaseViewController.h"
+
+@class RAOrderFilterBaseModel,RAOrderFilterSectionModel;
+@interface RAOrderFilterViewController : RABaseViewController 
+
+@property (nonatomic,copy) void(^searchBlk) (NSDictionary *params);
+
+@property (nonatomic,weak,readonly) UITableView *tableView;
+
+- (void)setFilter:(NSDictionary *)filter;
+
+- (NSInteger)sectionCount;
+
+- (RAOrderFilterSectionModel *)sectionModelForSection:(NSInteger)section;
+
+- (NSInteger)rowCountForSection:(NSInteger)section;
+
+- (RAOrderFilterBaseModel *)modelForIndexPath:(NSIndexPath *)indexPath;
+
+@end

+ 245 - 0
Redant Drivers/Apex And Drivers/Filter/RAOrderFilterViewController.m

@@ -0,0 +1,245 @@
+//
+//  RAOrderFilterViewController.m
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/8/27.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RAOrderFilterViewController.h"
+#import "RAOrderFilterSectionModel.h"
+#import "RAOrderFilterStatusModel.h"
+#import "RAOrderFilterDateModel.h"
+#import "RAOrderFilterInputModel.h"
+
+@interface RAOrderFilterViewController () <UIGestureRecognizerDelegate>
+
+@property (nonatomic,strong) IBOutlet UITableView *filterTable;
+@property (nonatomic,assign) NSInteger orderStatus;///< New Order、Processing Order、Finish Order
+@property (nonatomic,strong) NSMutableArray<RAOrderFilterSectionModel *> *sectionArray;
+
+@property (nonatomic,strong) IBOutlet UITapGestureRecognizer *resignTap;
+@property (nonatomic,assign) BOOL showKeyboard;
+
+@end
+
+@implementation RAOrderFilterViewController
+
++ (instancetype)viewControllerFromStoryboard {
+    RAOrderFilterViewController *vc = [[UIStoryboard storyboardWithName:@"orderFilter" bundle:nil] instantiateViewControllerWithIdentifier:[self storyboardID]];
+    return vc;
+}
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view.
+    
+    self.title = @"Order Filter";
+    
+    [self configureTableView];
+}
+
+
+- (void)viewWillAppear:(BOOL)animated {
+    [super viewWillAppear:animated];
+    
+    [self registKeyboardListener];
+}
+
+- (void)viewWillDisappear:(BOOL)animated {
+    [super viewWillDisappear:animated];
+    
+    [self unregistKeyboardListener];
+}
+
+- (void)viewDidAppear:(BOOL)animated {
+    [super viewDidAppear:animated];
+    
+    if (self.sectionArray.count == 0) {
+        
+        UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:@"Warning" message:@"There is no filter data" preferredStyle:UIAlertControllerStyleAlert];
+        __weak typeof(self) weakSelf = self;
+        UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"Ok" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+            
+            [weakSelf.navigationController popViewControllerAnimated:YES];
+            
+        }];
+        
+        [alertVC addAction:okAction];
+        
+        [self presentViewController:alertVC animated:YES completion:nil];
+        
+    }
+}
+
+- (void)didReceiveMemoryWarning {
+    [super didReceiveMemoryWarning];
+    // Dispose of any resources that can be recreated.
+}
+
+- (void)configureTableView {
+    
+    if (@available(iOS 11,*)) {
+        self.filterTable.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
+    } else {
+        self.automaticallyAdjustsScrollViewInsets = NO;
+    }
+    
+}
+
+- (UITableView *)tableView {
+    return self.filterTable;
+}
+
+
+- (void)registKeyboardListener {
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillChangeFrame:) name:UIKeyboardWillChangeFrameNotification object:nil];
+}
+
+- (void)unregistKeyboardListener {
+    [[NSNotificationCenter defaultCenter] removeObserver:self];
+}
+
+#pragma mark - Keyboard Listener
+
+- (void)keyboardWillChangeFrame:(NSNotification *)notification {
+    
+    CGRect end = [[[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue];
+    CGFloat screenHeight = CGRectGetHeight([UIScreen mainScreen].bounds);
+    CGFloat keyboardHeight = screenHeight - CGRectGetMinY(end);
+    
+    UIEdgeInsets insets = UIEdgeInsetsMake(0, 0, keyboardHeight, 0);
+    self.tableView.contentInset = insets;
+    
+    self.showKeyboard = keyboardHeight > 0;
+}
+
+#pragma mark - Data
+
+- (NSMutableArray *)sectionArray {
+    if (!_sectionArray) {
+        _sectionArray = [NSMutableArray array];
+    }
+    return _sectionArray;
+}
+
+- (void)setFilter:(NSDictionary *)filter {
+    
+    self.orderStatus = [[filter objectForKey:@"orderStatus"] integerValue];
+
+    NSArray *sections = [filter objectForKey:@"sections"];
+    for (int i = 0; i < sections.count; i++) {
+        NSDictionary *section = [sections objectAtIndex:i];
+
+        RAOrderFilterSectionModel *model = [[RAOrderFilterSectionModel alloc] init];
+        [model setValuesForKeysWithDictionary:section];
+
+        [self.sectionArray addObject:model];
+    }
+    
+}
+
+- (NSInteger)sectionCount {
+    return self.sectionArray.count;
+}
+
+- (RAOrderFilterSectionModel *)sectionModelForSection:(NSInteger)section {
+    return [self.sectionArray objectAtIndex:section];
+}
+
+- (NSInteger)rowCountForSection:(NSInteger)section {
+    return [self.sectionArray objectAtIndex:section].values.count;
+}
+
+- (RAOrderFilterBaseModel *)modelForIndexPath:(NSIndexPath *)indexPath {
+    return [[self.sectionArray objectAtIndex:indexPath.section] modelForRow:indexPath.row];
+}
+
+- (NSDictionary *)prepareSearchParameters {
+    
+    NSMutableDictionary *params = [NSMutableDictionary dictionary];
+    
+    for (RAOrderFilterSectionModel *section in self.sectionArray) {
+        NSString *key = section.key;
+        if (key.length > 0) {
+            NSMutableArray *values = [NSMutableArray array];
+            for (RAOrderFilterBaseModel *model in section.values) {
+                switch (model.type) {
+                    case RAOrderFilterModelTypeStatus: {
+                        RAOrderFilterStatusModel *statusModel = (RAOrderFilterStatusModel *)model;
+                        if (statusModel.selected && statusModel.value > 0) {
+                            [values addObject:statusModel.value];
+                        }
+                    }
+                    break;
+                    case RAOrderFilterModelTypeDate: {
+                        RAOrderFilterDateModel *dateModel = (RAOrderFilterDateModel *)model;
+                        if (dateModel.from.length > 0 || dateModel.to.length > 0) {
+                            if (dateModel.from.length == 0) {
+                                dateModel.from = @"";
+                            }
+                            if (dateModel.to.length == 0) {
+                                dateModel.to = @"";
+                            }
+                            NSString *date = [NSString stringWithFormat:@"%@~%@",dateModel.from,dateModel.to];
+                            [values addObject:date];
+                        }
+                    }
+                    break;
+                    case RAOrderFilterModelTypeInput: {
+                        RAOrderFilterInputModel *inputModel = (RAOrderFilterInputModel *)model;
+                        if (inputModel.value.length > 0) {
+                            [values addObject:inputModel.value];
+                        }
+                    }
+                    break;
+                    default:
+                    break;
+                }
+            }
+            NSString *value = [values componentsJoinedByString:@"<RASEPERATOR>"];
+            if (value.length > 0) {
+                [params setObject:value forKey:key];
+            }
+        }
+    }
+    
+    if (params.allValues.count == 0) {
+        params = nil;
+    }
+    
+    return params;
+}
+
+#pragma mark - Action
+
+- (IBAction)searchButtonClick:(id)sender {
+    
+    if (self.searchBlk) {
+        self.searchBlk([self prepareSearchParameters]);
+    }
+    [self.navigationController popViewControllerAnimated:YES];
+}
+
+- (IBAction)tapToResignFirstResponder:(UITapGestureRecognizer *)tap {
+    [self.view endEditing:YES];
+}
+
+#pragma mark - Gesture Recognizer Delegate
+
+- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer {
+    if (!self.showKeyboard && gestureRecognizer == self.resignTap) {
+        return NO;
+    }
+    return YES;
+}
+
+#pragma mark - Override
+
+- (void)presentViewController:(UIViewController *)viewControllerToPresent animated:(BOOL)flag completion:(void (^)(void))completion {
+    [self.view endEditing:YES];
+    
+    [super presentViewController:viewControllerToPresent animated:flag completion:completion];
+}
+
+@end

+ 269 - 0
Redant Drivers/Apex And Drivers/Filter/orderFilter.storyboard

@@ -0,0 +1,269 @@
+<?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">
+    <device id="retina4_7" orientation="portrait">
+        <adaptation id="fullscreen"/>
+    </device>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <scenes>
+        <!--Order Filter View Controller-->
+        <scene sceneID="WdM-Vh-QdR">
+            <objects>
+                <viewController storyboardIdentifier="RAOrderFilterViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="b7h-oK-i0d" customClass="RAOrderFilterViewController" sceneMemberID="viewController">
+                    <view key="view" contentMode="scaleToFill" id="asq-jc-W9V">
+                        <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
+                        <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="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="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">
+                                            <rect key="frame" x="0.0" y="1" width="375" height="43"/>
+                                            <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                            <state key="normal" title="Search"/>
+                                            <connections>
+                                                <action selector="searchButtonClick:" destination="b7h-oK-i0d" eventType="touchUpInside" id="Njo-v6-j2g"/>
+                                            </connections>
+                                        </button>
+                                    </subviews>
+                                    <color key="backgroundColor" red="0.94288374352331605" green="0.94288374352331605" blue="0.94288374352331605" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                    <constraints>
+                                        <constraint firstAttribute="bottom" secondItem="7Rj-Wx-DTQ" secondAttribute="bottom" id="HZb-9D-AsL"/>
+                                        <constraint firstAttribute="trailing" secondItem="7Rj-Wx-DTQ" secondAttribute="trailing" id="Ro7-4r-RPE"/>
+                                        <constraint firstItem="7Rj-Wx-DTQ" firstAttribute="top" secondItem="goQ-QF-OSZ" secondAttribute="top" constant="1" id="dHa-sj-0rb"/>
+                                        <constraint firstItem="7Rj-Wx-DTQ" firstAttribute="leading" secondItem="goQ-QF-OSZ" secondAttribute="leading" id="yPE-iV-Dai"/>
+                                    </constraints>
+                                </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="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="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">
+                                                    <rect key="frame" x="5" y="14.5" width="320" height="21"/>
+                                                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                                    <nil key="textColor"/>
+                                                    <nil key="highlightedColor"/>
+                                                </label>
+                                                <imageView contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Checkmark.png" translatesAutoresizingMaskIntoConstraints="NO" id="Ojw-Rz-bEx">
+                                                    <rect key="frame" x="330" y="4" width="40" height="40"/>
+                                                    <constraints>
+                                                        <constraint firstAttribute="width" constant="40" id="qmh-Es-QCm"/>
+                                                        <constraint firstAttribute="height" constant="40" id="yKk-ej-gvI"/>
+                                                    </constraints>
+                                                </imageView>
+                                            </subviews>
+                                            <constraints>
+                                                <constraint firstItem="Ojw-Rz-bEx" firstAttribute="centerY" secondItem="FFw-dW-CKf" secondAttribute="centerY" id="JRJ-Lv-DhZ"/>
+                                                <constraint firstItem="Y6T-Kp-z23" firstAttribute="centerY" secondItem="FFw-dW-CKf" secondAttribute="centerY" id="bds-ba-KQP"/>
+                                                <constraint firstItem="Y6T-Kp-z23" firstAttribute="leading" secondItem="FFw-dW-CKf" secondAttribute="leading" constant="5" id="k3n-rV-Th1"/>
+                                                <constraint firstItem="Ojw-Rz-bEx" firstAttribute="leading" secondItem="Y6T-Kp-z23" secondAttribute="trailing" constant="5" id="obN-iA-2mT"/>
+                                                <constraint firstAttribute="trailing" secondItem="Ojw-Rz-bEx" secondAttribute="trailing" constant="5" id="pKr-P3-5ap"/>
+                                            </constraints>
+                                        </tableViewCellContentView>
+                                        <connections>
+                                            <outlet property="selectionView" destination="Ojw-Rz-bEx" id="8NE-Rz-UFm"/>
+                                            <outlet property="valueLabel" destination="Y6T-Kp-z23" id="dY7-ep-Mx0"/>
+                                        </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="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="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">
+                                                    <rect key="frame" x="5" y="10" width="180" height="30"/>
+                                                    <state key="normal" title="From"/>
+                                                    <connections>
+                                                        <action selector="fromBtnClick:" destination="CrM-Nd-7k0" eventType="touchUpInside" id="p54-dJ-yOF"/>
+                                                    </connections>
+                                                </button>
+                                                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="89y-vM-rg0">
+                                                    <rect key="frame" x="190" y="10" width="180" height="30"/>
+                                                    <state key="normal" title="To"/>
+                                                    <connections>
+                                                        <action selector="toBtnClick:" destination="CrM-Nd-7k0" eventType="touchUpInside" id="Acv-Zk-Mxl"/>
+                                                    </connections>
+                                                </button>
+                                            </subviews>
+                                            <constraints>
+                                                <constraint firstItem="Qyi-QK-7XW" firstAttribute="centerY" secondItem="ZC9-gt-wnt" secondAttribute="centerY" id="1e4-Ad-MVb"/>
+                                                <constraint firstAttribute="trailing" secondItem="89y-vM-rg0" secondAttribute="trailing" constant="5" id="Oa8-gx-nJQ"/>
+                                                <constraint firstItem="Qyi-QK-7XW" firstAttribute="leading" secondItem="ZC9-gt-wnt" secondAttribute="leading" constant="5" id="WIh-67-K01"/>
+                                                <constraint firstItem="89y-vM-rg0" firstAttribute="leading" secondItem="Qyi-QK-7XW" secondAttribute="trailing" constant="5" id="dKV-uu-PwL"/>
+                                                <constraint firstItem="89y-vM-rg0" firstAttribute="centerY" secondItem="ZC9-gt-wnt" secondAttribute="centerY" id="frD-am-hKe"/>
+                                                <constraint firstItem="89y-vM-rg0" firstAttribute="width" secondItem="Qyi-QK-7XW" secondAttribute="width" id="huw-lx-WrV"/>
+                                            </constraints>
+                                        </tableViewCellContentView>
+                                        <connections>
+                                            <outlet property="fromBtn" destination="Qyi-QK-7XW" id="QoH-Nq-mSB"/>
+                                            <outlet property="toBtn" destination="89y-vM-rg0" id="Y2R-8E-6oh"/>
+                                        </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="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="375" height="49.5"/>
+                                            <autoresizingMask key="autoresizingMask"/>
+                                            <subviews>
+                                                <textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="Z7R-ah-wFK">
+                                                    <rect key="frame" x="5" y="10" width="365" height="30"/>
+                                                    <nil key="textColor"/>
+                                                    <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                                                    <textInputTraits key="textInputTraits"/>
+                                                    <connections>
+                                                        <outlet property="delegate" destination="7T8-AK-bBK" id="ccJ-lE-LcC"/>
+                                                    </connections>
+                                                </textField>
+                                            </subviews>
+                                            <constraints>
+                                                <constraint firstAttribute="trailing" secondItem="Z7R-ah-wFK" secondAttribute="trailing" constant="5" id="QnF-AL-mKY"/>
+                                                <constraint firstItem="Z7R-ah-wFK" firstAttribute="centerY" secondItem="mag-H5-gTb" secondAttribute="centerY" id="XLn-UL-eNK"/>
+                                                <constraint firstItem="Z7R-ah-wFK" firstAttribute="leading" secondItem="mag-H5-gTb" secondAttribute="leading" constant="5" id="giK-G3-yNR"/>
+                                            </constraints>
+                                        </tableViewCellContentView>
+                                        <connections>
+                                            <outlet property="inputTextField" destination="Z7R-ah-wFK" id="c2b-vF-tgH"/>
+                                        </connections>
+                                    </tableViewCell>
+                                </prototypes>
+                                <connections>
+                                    <outlet property="dataSource" destination="b7h-oK-i0d" id="FBq-iH-Awx"/>
+                                    <outlet property="delegate" destination="b7h-oK-i0d" id="w1d-ac-ojT"/>
+                                </connections>
+                            </tableView>
+                        </subviews>
+                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                        <gestureRecognizers/>
+                        <constraints>
+                            <constraint firstItem="a7i-EN-gze" firstAttribute="leading" secondItem="Zmz-gT-Ohz" secondAttribute="leading" id="4Bo-br-Ic9"/>
+                            <constraint firstItem="Zmz-gT-Ohz" firstAttribute="trailing" secondItem="a7i-EN-gze" secondAttribute="trailing" id="Ut5-1n-8Ei"/>
+                            <constraint firstItem="a7i-EN-gze" firstAttribute="top" secondItem="Zmz-gT-Ohz" secondAttribute="top" id="olD-pG-x8i"/>
+                            <constraint firstItem="Zmz-gT-Ohz" firstAttribute="bottom" secondItem="a7i-EN-gze" secondAttribute="bottom" id="vby-N2-RQg"/>
+                        </constraints>
+                        <viewLayoutGuide key="safeArea" id="Zmz-gT-Ohz"/>
+                        <connections>
+                            <outletCollection property="gestureRecognizers" destination="zyk-y8-SKg" appends="YES" id="gIE-mU-Bu4"/>
+                        </connections>
+                    </view>
+                    <connections>
+                        <outlet property="filterTable" destination="a7i-EN-gze" id="DV2-UD-uIh"/>
+                        <outlet property="resignTap" destination="zyk-y8-SKg" id="4H4-UG-R3w"/>
+                    </connections>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="NS3-fN-yIS" userLabel="First Responder" sceneMemberID="firstResponder"/>
+                <tapGestureRecognizer id="zyk-y8-SKg">
+                    <connections>
+                        <action selector="tapToResignFirstResponder:" destination="b7h-oK-i0d" id="bpq-Gu-jBs"/>
+                        <outlet property="delegate" destination="b7h-oK-i0d" id="eHw-1z-TLg"/>
+                    </connections>
+                </tapGestureRecognizer>
+            </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="365" 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="375" 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="375" 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="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="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="187" 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="Checkmark.png" width="50" height="50"/>
+    </resources>
+</document>

+ 30 - 5
Redant Drivers/Apex And Drivers/Home/More/RAHomeMoreViewController.m

@@ -10,6 +10,7 @@
 #import "RAProgressHUD.h"
 #import "RAOrderDetailViewController.h"
 #import "JLRefreshFooter.h"
+#import "RAOrderFilterViewController.h"
 
 static const NSInteger limit = 20;
 
@@ -29,6 +30,8 @@ typedef enum {
 @property (nonatomic,strong) NSMutableArray<RAHomeOrderModel *> *orderArray;
 @property (nonatomic,strong) JLRefreshFooter *refreshFooter;
 
+@property (nonatomic,strong) NSDictionary *filter;
+
 @end
 
 @implementation RAHomeMoreViewController
@@ -42,6 +45,7 @@ typedef enum {
     [super viewDidLoad];
     // Do any additional setup after loading the view.
     
+    [self configureNavigationBar];
     [self configureTableView];
     [self registNotification];
     [self loadData];
@@ -58,6 +62,15 @@ typedef enum {
 
 #pragma mark - Configure
 
+- (void)configureNavigationBar {
+    
+    UIBarButtonItem *filterItem = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"Filter"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]
+                                                                   style:UIBarButtonItemStylePlain
+                                                                  target:self
+                                                                  action:@selector(filterItemClick:)];
+    self.navigationItem.rightBarButtonItem = filterItem;
+}
+
 - (void)configureTableView {
     
     if (@available(iOS 11.0, *)) {
@@ -109,6 +122,18 @@ typedef enum {
     [self reloadData];
 }
 
+- (void)filterItemClick:(id)sender {
+    RAOrderFilterViewController *filterVC = [RAOrderFilterViewController viewControllerFromStoryboard];
+    [filterVC setFilter:[RADataProvider loadFakeData:@"fake_order_filter.json"]];
+    __weak typeof(self) weakSelf = self;
+    filterVC.searchBlk = ^(NSDictionary *params) {
+        weakSelf.filter = params;
+        [weakSelf loadData:LoadDataActionTypeReLoad];
+    };
+    
+    [self.navigationController pushViewController:filterVC animated:YES];
+}
+
 #pragma mark - Controller Action
 
 - (void)pushDetailViewControllerForModel:(RAHomeOrderModel *)model {
@@ -143,7 +168,7 @@ typedef enum {
     __weak typeof(self) weakSelf = self;
     dispatch_async(dispatch_get_global_queue(0, 0), ^{
         
-        NSDictionary *json = [RADataProvider requestMoreOrder:self.type offset:offset limit:limit];
+        NSDictionary *json = [RADataProvider requestMoreOrder:weakSelf.type offset:offset limit:limit filter:weakSelf.filter];
         
         dispatch_async(dispatch_get_main_queue(), ^{
             
@@ -157,7 +182,7 @@ typedef enum {
                 __strong typeof(weakSelf) strongSelf = weakSelf;
                 
                 if (actionType == LoadDataActionTypeLoadMore) {
-                    [weakSelf.refreshFooter performSelector:@selector(endRefresh)];
+                    [strongSelf.refreshFooter performSelector:@selector(endRefresh)];
                 }
                 
                 int result = [[json objectForKey:@"result"] intValue];
@@ -166,10 +191,10 @@ typedef enum {
                     NSArray *orders = [json objectForKey:@"orders"];
                     
                     if (actionType != LoadDataActionTypeLoadMore) {
-                        [self.orderArray removeAllObjects];
+                        [strongSelf.orderArray removeAllObjects];
                     } else {
                         if (orders.count < limit) {
-                            [weakSelf.refreshFooter performSelector:@selector(noMoreData)];
+                            [strongSelf.refreshFooter performSelector:@selector(noMoreData)];
                         }
                     }
                     
@@ -177,7 +202,7 @@ typedef enum {
                         NSDictionary *order = [orders objectAtIndex:i];
                         RAHomeOrderModel *orderModel = [RAHomeOrderModel new];
                         [orderModel setValuesForKeysWithDictionary:order];
-                        [self.orderArray addObject:orderModel];
+                        [strongSelf.orderArray addObject:orderModel];
                     }
                     
                     if (orders.count > 0) {

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

@@ -21,7 +21,7 @@
 - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
     
     UIView *header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(tableView.bounds), 44.0f)];
-    header.backgroundColor = [UIColor lightGrayColor];
+    header.backgroundColor = [UIColor colorWithRed:0.8 green:0.8 blue:0.8 alpha:0.8];
     UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(10, 11, CGRectGetWidth(tableView.bounds) - 100, 22)];
     [header addSubview:label];
     

+ 93 - 0
Redant Drivers/Apex And Drivers/PresentationController/RAPresentationController.m

@@ -0,0 +1,93 @@
+//
+//  RApresentationController.m
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/8/28.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import "RAPresentationController.h"
+
+@interface RAPresentationController ()
+
+@property (nonatomic,strong) UIView *dimmingView;
+
+@end
+
+@implementation RAPresentationController
+
+- (UIView *)dimmingView {
+    if (!_dimmingView) {
+        _dimmingView = [UIView new];
+        _dimmingView.backgroundColor = [UIColor grayColor];
+    }
+    return _dimmingView;
+}
+
+- (void)presentationTransitionWillBegin {
+    self.dimmingView.frame = self.containerView.bounds;
+    self.dimmingView.alpha = 0.f;
+    
+    [self.containerView addSubview:self.dimmingView];
+    [self.containerView addSubview:self.presentedView];
+    
+    // 确保我们的动画与其他动画一道儿播放。
+    id<UIViewControllerTransitionCoordinator> transitionCoordiantor = self.presentedViewController.transitionCoordinator;
+    [transitionCoordiantor animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext>  _Nonnull context) {
+        self.dimmingView.alpha = .4f;
+    } completion:^(id<UIViewControllerTransitionCoordinatorContext>  _Nonnull context) {
+        
+    }];
+}
+
+- (void)presentationTransitionDidEnd:(BOOL)completed {
+    if (completed) {
+        //        [self.dimmingView removeFromSuperview];
+    }
+}
+
+- (CGRect)frameOfPresentedViewInContainerView {
+    CGSize size = self.containerView.bounds.size;
+    
+    UIViewController *presentedVC = self.presentedViewController;
+    size = presentedVC.preferredContentSize;
+    if (size.width <= 0 || size.height <= 0) {
+        size = self.containerView.bounds.size;
+    }
+    
+    CGFloat w = CGRectGetWidth(self.containerView.bounds);
+    CGFloat h = CGRectGetHeight(self.containerView.bounds);
+    
+    return CGRectMake((w - size.width) * 0.5, (h - size.height) * 0.5, size.width, size.height);
+}
+
+- (void)dismissalTransitionWillBegin {
+    // 确保我们的动画与其他动画一道儿播放。
+    id<UIViewControllerTransitionCoordinator> transitionCoordiantor = self.presentedViewController.transitionCoordinator;
+    [transitionCoordiantor animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext>  _Nonnull context) {
+        self.dimmingView.alpha = 0.f;
+    } completion:^(id<UIViewControllerTransitionCoordinatorContext>  _Nonnull context) {
+        
+    }];
+}
+
+- (void)dismissalTransitionDidEnd:(BOOL)completed {
+    if (completed) {
+        //        [self.dimmingView removeFromSuperview];
+    }
+}
+
+// 屏幕旋转调用此方法
+- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
+    [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
+    
+    [coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext>  _Nonnull context) {
+        self.dimmingView.frame = self.containerView.bounds;
+        self.presentedView.frame = [self frameOfPresentedViewInContainerView];
+    } completion:^(id<UIViewControllerTransitionCoordinatorContext>  _Nonnull context) {
+        
+    }];
+}
+
+
+@end

+ 13 - 0
Redant Drivers/Apex And Drivers/PresentationController/RApresentationController.h

@@ -0,0 +1,13 @@
+//
+//  RApresentationController.h
+//  Apex And Drivers
+//
+//  Created by Jack on 2018/8/28.
+//  Copyright © 2018年 USAI. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface RAPresentationController : UIPresentationController
+
+@end

+ 4 - 2
Redant Drivers/Apex And Drivers/RADataProvider.h

@@ -16,7 +16,7 @@
 
 + (NSDictionary *)requestOrderList;
 
-+ (NSDictionary *)requestMoreOrder:(NSInteger)orderType offset:(NSInteger)offset limit:(NSInteger)limit;
++ (NSDictionary *)requestMoreOrder:(NSInteger)orderType offset:(NSInteger)offset limit:(NSInteger)limit filter:(NSDictionary *)filter;
 
 + (NSDictionary *)requestOrderDetail:(NSString *)orderID type:(NSInteger)type type2:(NSString *)type2;
 
@@ -28,10 +28,12 @@
 
 + (NSDictionary *)uploadFile:(NSString *)filePath parameters:(NSMutableDictionary *)params;///<同步上传文件
 
-+ (NSDictionary *)reportCurrentLocation:(NSString *)location;
++ (NSDictionary *)reportCurrentLocation:(NSString *)location forOrderID:(NSString *)orderID;
 
 + (NSDictionary *)bindNitificationToken:(NSString *)token;
 
 + (NSDictionary *)logout;
 
++ (NSDictionary *)loadFakeData:(NSString *)fileName;
+
 @end

+ 20 - 2
Redant Drivers/Apex And Drivers/RADataProvider.m

@@ -182,12 +182,15 @@
     return [self handleJsonData:json];
 }
 
-+ (NSDictionary *)requestMoreOrder:(NSInteger)orderType offset:(NSInteger)offset limit:(NSInteger)limit {
++ (NSDictionary *)requestMoreOrder:(NSInteger)orderType offset:(NSInteger)offset limit:(NSInteger)limit filter:(NSDictionary *)filter {
     
     NSMutableDictionary *params = [NSMutableDictionary dictionary];
     [params setObject:@(orderType) forKey:@"type"];
     [params setObject:@(offset) forKey:@"offset"];
     [params setObject:@(limit) forKey:@"limit"];
+    if (filter) {
+        [params setObject:[self dic2String:filter] forKey:@"filter"];
+    }
     
     NSData* json=[self get_json:URL_MORE_ORDER parameters:params  file:nil];
     
@@ -257,12 +260,15 @@
     return [self upload:URL_UPLOAD parameters:params file:filePath];
 }
 
-+ (NSDictionary *)reportCurrentLocation:(NSString *)location {
++ (NSDictionary *)reportCurrentLocation:(NSString *)location forOrderID:(NSString *)orderID {
     
     NSMutableDictionary *params = [NSMutableDictionary dictionary];
     if (location) {
         [params setObject:location forKey:@"location"];
     }
+    if (orderID) {
+        [params setObject:orderID forKey:@"orderID"];
+    }
     
     NSData* json=[self get_json:URL_REPORT_LOCATION parameters:params  file:nil];
     
@@ -309,4 +315,16 @@
 //             };
 //}
 
+#pragma mark - Utils
+
++ (NSString *)dic2String:(NSDictionary *)dic {
+    if (!dic) {
+        return nil;
+    }
+    
+    NSData *data = [NSJSONSerialization dataWithJSONObject:dic options:NSJSONWritingPrettyPrinted error:nil];
+    NSString *str = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
+    return str;
+}
+
 @end