Bläddra i källkod

1.修改iOS Apex Driver Detail Value高亮显示以及Confirm刷新。

Pen Li 7 år sedan
förälder
incheckning
b1e3db6b40

+ 3 - 0
Redant Drivers/Apex And Drivers/Assets.xcassets/btn_map_no.imageset/Contents.json

@@ -2,14 +2,17 @@
   "images" : [
     {
       "idiom" : "universal",
+      "filename" : "btn_map_no.png",
       "scale" : "1x"
     },
     {
       "idiom" : "universal",
+      "filename" : "btn_map_no@2x.png",
       "scale" : "2x"
     },
     {
       "idiom" : "universal",
+      "filename" : "btn_map_no@3x.png",
       "scale" : "3x"
     }
   ],

BIN
Redant Drivers/Apex And Drivers/Assets.xcassets/btn_map_no.imageset/btn_map_no.png


BIN
Redant Drivers/Apex And Drivers/Assets.xcassets/btn_map_no.imageset/btn_map_no@2x.png


BIN
Redant Drivers/Apex And Drivers/Assets.xcassets/btn_map_no.imageset/btn_map_no@3x.png


+ 6 - 0
Redant Drivers/Apex And Drivers/Detail/Cell/RADetailLocationCell.m

@@ -45,6 +45,12 @@
     
     self.titleLabel.text = _model.title;
     self.valueLabel.text = _model.location;
+    
+    if (_model.highlight) {
+        self.valueLabel.textColor = [UIColor redColor];
+    } else{
+        self.valueLabel.textColor = [UIColor blackColor];
+    }
 }
 
 #pragma mark - User Action

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

@@ -45,6 +45,11 @@
     self.titleLabel.text = _model.title;
     self.valueLabel.text = _model.location;
     
+    if (_model.highlight) {
+        self.valueLabel.textColor = [UIColor redColor];
+    } else{
+        self.valueLabel.textColor = [UIColor blackColor];
+    }
     
     NSString *lonStr = _model.lon;
     NSString *latStr = _model.lat;

+ 5 - 0
Redant Drivers/Apex And Drivers/Detail/Cell/RADetailMultLineCell.m

@@ -39,6 +39,11 @@
     _model = model;
     
     self.valueLabel.text = _model.value;
+    if (_model.highlight) {
+        self.valueLabel.textColor = [UIColor redColor];
+    } else{
+        self.valueLabel.textColor = [UIColor blackColor];
+    }
 }
 
 @end

+ 5 - 0
Redant Drivers/Apex And Drivers/Detail/Cell/RADetailSingleLineCell.m

@@ -41,6 +41,11 @@
     
     self.titleLable.text = _model.title;
     self.valueLabel.text = _model.value;
+    if (_model.highlight) {
+        self.valueLabel.textColor = [UIColor redColor];
+    } else{
+        self.valueLabel.textColor = [UIColor blackColor];
+    }
 }
 
 @end

+ 8 - 0
Redant Drivers/Apex And Drivers/Detail/Model/Collection/RADetailActionModel.h

@@ -21,6 +21,13 @@ typedef enum {
     RADetailActionSubTypeOther = 4
 } RADetailActionSubType;
 
+typedef enum {
+    
+    RADetailRemoteActionTypeGoHome = 0,
+    RADetailRemoteActionTypeReload = 1
+    
+} RADetailRemoteActionType;
+
 @class RADetailActionSelectionModel;
 @interface RADetailActionModel : NSObject
 
@@ -31,6 +38,7 @@ typedef enum {
 #pragma mark - actionType == RADetailActionTypeRemote
 
 @property (nonatomic,copy) NSString *url;///<
+@property (nonatomic,assign) RADetailRemoteActionType remoteActionType;
 @property (nonatomic,strong) NSMutableDictionary *params;///<
 
 #pragma mark - actionType == RADetailActionTypeLocal && actionSubType == RADetailActionSubTypeEnum

+ 2 - 0
Redant Drivers/Apex And Drivers/Detail/Model/RADetailBaseModel.h

@@ -25,5 +25,7 @@ typedef enum {
 @property (nonatomic,assign) RAOrderDetailValueType type;
 @property (nonatomic,assign) CGFloat width; ///< tableView Width, if smaller than 0 then use screen width
 @property (nonatomic,readonly,assign) CGFloat height;
+@property (nonatomic,assign) BOOL highlight;
+
 
 @end

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

@@ -284,7 +284,20 @@
                     }
                     
                     [[NSNotificationCenter defaultCenter] postNotificationName:RANotificationReloadHome object:nil];
-                    [strongSelf.navigationController popToRootViewControllerAnimated:YES];
+                    
+                    switch (model.remoteActionType) {
+                        case RADetailRemoteActionTypeGoHome:{
+                            [strongSelf.navigationController popToRootViewControllerAnimated:YES];
+                        }
+                            break;
+                        case RADetailRemoteActionTypeReload: {
+                            [strongSelf reloadData];
+                        }
+                            break;
+                            
+                        default:
+                            break;
+                    }
                     
                 } else {
                     // process error

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

@@ -21,4 +21,6 @@
 - (NSInteger)numberOfItemForSection:(NSInteger)section;
 - (RADetailBaseModel *)modelForIndexPath:(NSIndexPath *)indexPath;
 
+- (void)reloadData;
+
 @end

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

@@ -178,6 +178,10 @@
 
 #pragma mark - Data
 
+- (void)reloadData {
+    [self loadData];
+}
+
 - (void)loadData {
     
     if (self.loading) {

+ 6 - 3
Redant Drivers/Apex And Drivers/RANavigationController.m

@@ -116,7 +116,8 @@
     if (!orderType2) {
         orderType2 = @"";
     }
-
+    
+    BOOL required = [[aps objectForKey:@"required"] boolValue];
     BOOL go2Detail = [[userInfo objectForKey:@"go2Detail"] boolValue];
     
 //    [RASingleton.sharedInstance writeLog:[NSString stringWithFormat:@"%s",__func__]];
@@ -138,11 +139,13 @@
             }];
             
             __weak typeof(self) weakSelf = self;
-            UIAlertAction *detailAction = [UIAlertAction actionWithTitle:@"Yes" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+            UIAlertAction *detailAction = [UIAlertAction actionWithTitle:@"Ok" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
                 [weakSelf pushDetailViewControllerForOrderID:orderID type:orderType type2:orderType2 statusNo:statusNo];
             }];
             
-            [alertVC addAction:cancelAction];
+            if (!required) {
+                [alertVC addAction:cancelAction];
+            }
             [alertVC addAction:detailAction];
             
             [self presentViewController:alertVC animated:YES completion:nil];