Explorar el Código

1.修改iOS Apex Drivers Update Order多图上传图片不正确。

Pen Li hace 7 años
padre
commit
455900025d

+ 1 - 1
Redant Drivers/Apex And Drivers/Base.lproj/Localizable.strings

@@ -56,7 +56,7 @@
 "Background" = "Background";
 "Retry" = "Retry";
 "update_success" = "update success";
-"update_photo_success" = "update success,the photos and signatures will upload background,you can find them on upload list.";
+"update_photo_success" = "update success,the photos and signatures will upload in background,you can find them on upload list.";
 
 /**
  Detail

+ 0 - 8
Redant Drivers/Apex And Drivers/Detail/Model/RADetailMultPhotoModel.m

@@ -60,12 +60,4 @@
     return self.mapModle;
 }
 
-- (NSUInteger)photoCount {
-    return self.mapModle.photoCount;
-}
-
-- (UIImage *)photoForIndex:(NSUInteger)index {
-    return [self.mapModle photoAtIndex:index];
-}
-
 @end

+ 3 - 1
Redant Drivers/Apex And Drivers/Login/LoginViewController.m

@@ -203,8 +203,10 @@
             if (ret==RESULT_TRUE)
             {
                 NSString *firstName = [loginInfo objectForKey:@"firstName"];
+                NSString *driver = [loginInfo objectForKey:@"driver"];
+                
                 if(self.loginSuccessful)
-                    self.loginSuccessful(self.editUser.text.lowercaseString,self.editPassword.text, firstName);
+                    self.loginSuccessful(driver,request_password, firstName);
             }
             else
             {

+ 2 - 0
Redant Drivers/Apex And Drivers/PhotoCell/Model/RAPhotoModel.h

@@ -30,4 +30,6 @@
 
 - (NSUInteger)photoCount;
 
+- (NSArray<UIImage *> *)photoArray;
+
 @end

+ 12 - 0
Redant Drivers/Apex And Drivers/PhotoCell/Model/RAPhotoModel.m

@@ -90,6 +90,18 @@
     return count;
 }
 
+- (NSArray<UIImage *> *)photoArray {
+    
+    NSMutableArray *tmpArr = [NSMutableArray array];
+    [self.photos enumerateObjectsUsingBlock:^(RAPhotoItemModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
+        
+        if (!obj.isEmpty) {
+            [tmpArr addObject:obj.photo];
+        }
+    }];
+    return [tmpArr copy];
+}
+
 #pragma mark - Layout Delegate
 
 - (NSArray *)prepareLayout {

+ 5 - 1
Redant Drivers/Apex And Drivers/Update/Model/RAEditMultPhotoModel.m

@@ -65,7 +65,11 @@
 }
 
 - (UIImage *)photoForIndex:(NSUInteger)index {
-    return [self.mapModle photoAtIndex:index];
+    NSArray<UIImage *> *tmpArr = [self.mapModle photoArray];
+    if (index < 0 || index >= tmpArr.count) {
+        return nil;
+    }
+    return tmpArr[index];
 }
 
 @end

+ 8 - 7
Redant Drivers/Apex And Drivers/Update/RAOrderEditViewController.m

@@ -42,13 +42,13 @@
 - (void)setItems:(NSArray<RAEditBaseModel *> *)items {
     
     NSMutableArray *tmpItems = [items mutableCopy];
-//    [tmpItems addObject:@{
-//                          @"type" : @6,
-//                          @"title" : @"Container Photo",
-//                          @"required" : @(YES),
-//                          @"photos" : @[@{@"placeHolder":@"btn_add_photo"},@{@"placeHolder":@"btn_add_photo"},@{@"placeHolder":@"btn_add_photo"},@{@"placeHolder":@"btn_add_photo"},@{@"placeHolder":@"btn_add_photo"},@{@"placeHolder":@"btn_add_photo"}],
-//                          @"key" : @"test_photo"
-//                          }];
+    [tmpItems addObject:@{
+                          @"type" : @6,
+                          @"title" : @"Container Photo",
+                          @"required" : @(YES),
+                          @"photos" : @[@{@"placeHolder":@"btn_add_photo"},@{@"placeHolder":@"btn_add_photo"},@{@"placeHolder":@"btn_add_photo"},@{@"placeHolder":@"btn_add_photo"},@{@"placeHolder":@"btn_add_photo"},@{@"placeHolder":@"btn_add_photo"}],
+                          @"key" : @"test_photo"
+                          }];
     
     NSMutableArray *itemArr = [NSMutableArray arrayWithCapacity:items.count];
     for (int i = 0; i < tmpItems.count; i++) {
@@ -800,6 +800,7 @@
                                 // 临时创建PhotoModel,用于上传
                                 RAEditPhotoModel *tmpPhotoModel = [RAEditPhotoModel new];
                                 tmpPhotoModel.type = RAEditTypePhoto;
+                                tmpPhotoModel.title = [NSString stringWithFormat:@"%@_%d",photoModel.title,i];
                                 tmpPhotoModel.key = [NSString stringWithFormat:@"%@_%d",photoModel.key,i];
                                 tmpPhotoModel.photo = img;
                                 

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

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

+ 1 - 1
Redant Drivers/Apex And Drivers/en.lproj/Localizable.strings

@@ -57,7 +57,7 @@
 "Background" = "Background";
 "Retry" = "Retry";
 "update_success" = "update success";
-"update_photo_success" = "update success,the photos and signatures will upload background,you can find them on upload list.";
+"update_photo_success" = "update success,the photos and signatures will upload in background,you can find them on upload list.";
 
 /**
  Detail

+ 1 - 1
Redant Drivers/Apex And Drivers/zh-Hans.lproj/Localizable.strings

@@ -57,7 +57,7 @@
 "Background" = "后台上传";
 "Retry" = "重试";
 "update_success" = "提交成功";
-"update_photo_success" = "提交成功,照片和签名将上传后台,你可以在上传列表中找到它们。";
+"update_photo_success" = "提交成功,照片和签名将在后台上传,你可以在上传列表中找到它们。";
 
 /**
  Detail