|
|
@@ -35,6 +35,15 @@
|
|
|
// Dispose of any resources that can be recreated.
|
|
|
}
|
|
|
|
|
|
+#pragma mark - Private
|
|
|
+
|
|
|
+- (void)clear {
|
|
|
+ self.barcode = nil;
|
|
|
+ [self.imgBtn setBackgroundImage:nil forState:UIControlStateNormal];
|
|
|
+ self.photos = nil;
|
|
|
+ self.photoCount = 0;
|
|
|
+}
|
|
|
+
|
|
|
#pragma mark - Button Action
|
|
|
|
|
|
- (IBAction)imgBtnClick:(UIButton *)sender {
|
|
|
@@ -71,21 +80,23 @@
|
|
|
|
|
|
for(NSMutableDictionary* photo in self.photos)
|
|
|
{
|
|
|
- NSMutableDictionary* task=[[NSMutableDictionary alloc]init];
|
|
|
|
|
|
+ NSMutableDictionary* task=[[NSMutableDictionary alloc]init];
|
|
|
|
|
|
- task[@"file_path"]=photo[@"path"];
|
|
|
- task[@"url"]=Appdelegate.address;
|
|
|
+
|
|
|
+ task[@"file_path"]=photo[@"path"];
|
|
|
+ task[@"url"]=Appdelegate.address;
|
|
|
+ NSString *md5 = [photo objectForKey:@"md5"];
|
|
|
|
|
|
- NSDictionary* params = @{
|
|
|
- @"user" : Appdelegate.user,
|
|
|
- @"password" : Appdelegate.password,
|
|
|
- @"mode":self.name,
|
|
|
- @"barcode":self.barcode,
|
|
|
- @"_operate":@"upload",
|
|
|
- @"md5":@""
|
|
|
- };
|
|
|
- task[@"params"]=params;
|
|
|
+ NSDictionary* params = @{
|
|
|
+ @"user" : Appdelegate.user,
|
|
|
+ @"password" : Appdelegate.password,
|
|
|
+ @"mode":self.name,
|
|
|
+ @"barcode":self.barcode,
|
|
|
+ @"_operate":@"upload",
|
|
|
+ @"md5":md5
|
|
|
+ };
|
|
|
+ task[@"params"]=params;
|
|
|
[tasks addObject:task];
|
|
|
|
|
|
}
|
|
|
@@ -95,7 +106,7 @@
|
|
|
[Appdelegate.uploadManager addTasks:tasks];
|
|
|
|
|
|
|
|
|
-
|
|
|
+ [self clear];
|
|
|
|
|
|
UploadViewController *upVC = (UploadViewController *)[self viewControllerInStoryboard:@"Upload" withId:@"UploadViewController"];
|
|
|
[self.navigationController pushViewController:upVC animated:YES];
|
|
|
@@ -115,6 +126,9 @@
|
|
|
|
|
|
- (void)setBarcode:(NSString *)barcode {
|
|
|
[super setBarcode:barcode];
|
|
|
+ if (!barcode) {
|
|
|
+ barcode = @"";
|
|
|
+ }
|
|
|
self.barcodeLabel.text = [NSString stringWithFormat:@"%@:%@",self.barcodeTitle,barcode];
|
|
|
}
|
|
|
|