Przeglądaj źródła

1.修改iOS Apex Driver Detail没有位置信息图标显示。

Pen Li 7 lat temu
rodzic
commit
ba0e742e0b

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

@@ -0,0 +1,20 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

+ 13 - 2
Redant Drivers/Apex And Drivers/Detail/Cell/RADetailMapCell.m

@@ -61,9 +61,20 @@
 //
 //        // 将大头针数据模型添加到MKMapView上管理
 //        [self.mapView setRegion:region animated:YES];
-        self.navigationBtn.hidden = NO;
+        
+        if ([lonStr isEqualToString:@"-999"] && [latStr isEqualToString:@"-999"]) {
+            
+            self.navigationBtn.enabled = NO;
+            [self.navigationBtn setImage:[UIImage imageNamed:@"btn_map_no"] forState:UIControlStateNormal];
+        } else {
+            self.navigationBtn.enabled = YES;
+            [self.navigationBtn setImage:[UIImage imageNamed:@"btn_map"] forState:UIControlStateNormal];
+        }
+        
     } else {
-        self.navigationBtn.hidden = YES;
+        
+        self.navigationBtn.enabled = NO;
+        [self.navigationBtn setImage:[UIImage imageNamed:@"btn_map_no"] forState:UIControlStateNormal];
     }
 }
 

+ 6 - 5
Redant Drivers/Apex And Drivers/Update/RAOrderEditViewController.m

@@ -308,7 +308,12 @@
     }
     if (RASingleton.sharedInstance.requiredLocation) {
         CLLocation *location = RASingleton.sharedInstance.currentLocation;
-        NSString *latLon = [NSString stringWithFormat:@"%f,%f",location.coordinate.latitude,location.coordinate.longitude];
+        NSString *latLon = nil;
+        if (location) {
+            latLon = [NSString stringWithFormat:@"%f,%f",location.coordinate.latitude,location.coordinate.longitude];
+        } else {
+            latLon = @"-999,-999";
+        }
         [params setObject:latLon forKey:@"location"];
     }
     NSMutableArray *emptyArr = [NSMutableArray array];
@@ -589,10 +594,6 @@
     [params setObject:encryptp forKey:@"password"];
     [params setObject:@"iOS" forKey:@"platform"];
     
-    if ([RASingleton sharedInstance].currentLocation) {
-        [params setObject:[NSString stringWithFormat:@"%f,%f",[RASingleton sharedInstance].currentLocation.coordinate.latitude,[RASingleton sharedInstance].currentLocation.coordinate.longitude] forKey:@"location"];
-    }
-    
     for (RAEditSectionModel *section in self.sectionArray) {
         for (int i = 0; i < [section itemCount]; i++) {
             RAEditBaseModel *model = [section itemModelForIndex:i];