|
|
@@ -4638,6 +4638,60 @@
|
|
|
signimg = img;
|
|
|
|
|
|
if(signimg!=nil)
|
|
|
+ {
|
|
|
+ if(appDelegate.offline_mode)
|
|
|
+ {
|
|
|
+
|
|
|
+ NSData *data = UIImagePNGRepresentation(img);
|
|
|
+
|
|
|
+ // 再将NSData转为字符串
|
|
|
+ NSString *jsonStr = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
|
|
|
+
|
|
|
+ // NSMutableString *str = [[NSMutableString alloc] initWithData:responseObject encoding:NSUTF8StringEncoding];
|
|
|
+
|
|
|
+ NSLog(@"data string: %@",jsonStr);
|
|
|
+ NSError *error=nil;
|
|
|
+ NSDictionary *json = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:&error];
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //NSMutableArray* arr_ret = [[NSMutableArray alloc] init];
|
|
|
+ if([[json valueForKey:@"result"] intValue]==2)
|
|
|
+ {
|
|
|
+ NSString* img_url_down = json[@"img_url_aname"];
|
|
|
+ // if(img_url_down.length==0)
|
|
|
+ // img_url_down=@"";
|
|
|
+ NSString* img_url_up = json[@"img_url"];
|
|
|
+ // if(img_url_up.length==0)
|
|
|
+ // img_url_up=@"";
|
|
|
+
|
|
|
+ NSMutableDictionary* item_json =((NSMutableArray*)self.content_data_control[indexPath.section])[indexPath.row];
|
|
|
+
|
|
|
+ [item_json setValue:img_url_down forKey:@"avalue"];
|
|
|
+ [item_json setValue:img_url_up forKey:@"value"];
|
|
|
+ [item_json setValue:@"true" forKey:@"dirty"];
|
|
|
+ NSMutableDictionary* section_json = [[self.content_data_download objectForKey:[NSString stringWithFormat:@"section_%ld",(long)indexPath.section ]] mutableCopy];
|
|
|
+ [section_json setObject:item_json forKey:[NSString stringWithFormat:@"item_%d",indexPath.row]];
|
|
|
+
|
|
|
+ [self.content_data_download setObject:section_json forKey:[NSString stringWithFormat:@"section_%ld",(long)indexPath.section ]];
|
|
|
+ self.content_data_control = [self translate_json:self.content_data_download changed:self.changed_data];
|
|
|
+
|
|
|
+
|
|
|
+ CommonEditorCellSignature* cell = (CommonEditorCellSignature*) [self.editorTable cellForRowAtIndexPath:indexPath];
|
|
|
+
|
|
|
+ cell.imageviewSignature.image = signimg;
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ [RAUtils message_alert:[json valueForKey:@"err_msg"] title:@"Upload Image" controller:self] ;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
{
|
|
|
NSData *imageData = UIImagePNGRepresentation(img);
|
|
|
|
|
|
@@ -4748,8 +4802,8 @@
|
|
|
|
|
|
[uploadTask resume];
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
};
|
|
|
|