// // DocumentViewController.m // AntsContract // // Created by Ray on 12/16/16. // Copyright © 2016 United Software Applications, Inc. All rights reserved. // #import "PageViewController.h" #import "config.h" #import "const.h" #import "SignatureListViewController.h" #import "SignatureViewController.h" #import "PDFUtils.h" #import "ImageUtils.h" #import "TextUtils.h" #import "CheckSelectorViewController.h" #import "DatePickerViewController.h" //#import "TouchImageView.h" @interface PageViewController () @end @implementation PageViewController - (void)viewDidLoad { [super viewDidLoad]; // self.pageIndex=1; // self.pdfPageView.pageIndex=self.pageIndex; self.pdfPageView.pageRef= self.pageRef; [self initControl]; // UIPinchGestureRecognizer *pinchGestureRecognizer = [[UIPinchGestureRecognizer alloc] // initWithTarget:self // action:@selector(handlePinch:)]; // // [self.view addGestureRecognizer:pinchGestureRecognizer]; // Do any additional setup after loading the view. } -(void) dealloc { // CFBridgingRelease(self.pageRef); } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } //- (void) handlePinch:(UIPinchGestureRecognizer*) recognizer //{ //// recognizer.view.transform = CGAffineTransformScale(recognizer.view.transform, recognizer.scale, recognizer.scale); //// recognizer.scale = 1; // // CGSize contentsize =self.pdfScrollView.contentSize; // // self.pdfScrollView.contentSize = CGSizeMake(contentsize.width*recognizer.scale, contentsize.height*recognizer.scale); //} -(void) initControl { int count = [self.controlTemplate[@"count"] intValue]; for(int i=0;i0) // marker_bg = [UIColor clearColor]; // else marker_bg=UIColorFromRGB(CK_BG); for(int i=0;i=3) { NSMutableDictionary* action = item[2]; NSArray* disable_arr = action[@"disable"] ; for(int d = 0 ; dtextView.text.length ||[text isEqualToString:@""]); } } - (void)textViewDidEndEditing:(UITextView *)textView { long index = textView.tag - CONTROL_BASE; //处理 prefix 和 浮点格式化 NSString* prefix_str= self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"prefix_str"]; if(prefix_str.length==0) prefix_str = @""; NSString* text = [textView.text stringByReplacingOccurrencesOfString:prefix_str withString:@""]; NSString* value_type= self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"value_type"]; if([value_type isEqualToString:@"float"]) text=[NSString stringWithFormat:@"%.2f",[text floatValue] ]; text =[NSString stringWithFormat:@"%@%@",prefix_str,text] ; textView.text = text; if(text==nil) text=@""; self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"value"] = text; NSDictionary* action = self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"action"]; NSArray* keys=[action allKeys]; for(int k=0;k 指向item // // [popover presentPopoverFromRect:self.view.frame inView:self.view permittedArrowDirections:0 animated:YES]; // // [popover presentPopoverFromBarButtonItem:item permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; // //// self.popover = popover; // popover pop // // [self performSegueWithIdentifier:@"selector_popover" sender:self]; } // __block int tag = touchImageView.tag; // UIViewController* vc=[RAUtils getViewController :touchImageView]; // // if(self.editable==true) // { // // // ImageUploadViewController * uploadvc =[ vc.storyboard instantiateViewControllerWithIdentifier:@"ImageUploadViewController"]; // // // UIImage* img =[self.buttonImg backgroundImageForState:UIControlStateNormal];; // // if(self.img_validate) // uploadvc.img= touchImageView.image; // // uploadvc.returnValue = ^(NSString* url_down,NSString* url_up,UIImage* img) // { // // self.imgs[tag] = url_up; // // NSString* newurl=[RAUtils arr2string:self.imgs separator:@"," trim:false]; // // touchImageView.image=img; // // if(self.imgChanged) // self.imgChanged(url_down,newurl,tag,url_up); // // }; // // [vc.navigationController pushViewController:uploadvc animated:false]; // } // else // { // if(touchImageView.image==nil) // return ; // ImageViewController * imagevc =[ vc.storyboard instantiateViewControllerWithIdentifier:@"ImageViewController"]; // // // UIImage* img=touchImageView.image; // // if(self.img_validate) // imagevc.image = img;//.imageView.image = [self.buttonImg backgroundImageForState:UIControlStateNormal]; // // // uploadvc.returnValue = ^(NSString* url_down,NSString* url_up,UIImage* img) // // { // // // // [self.buttonImg setBackgroundImage:img forState:UIControlStateNormal]; // // // // if(self.imgChanged) // // self.imgChanged(url_down,url_up); // // // // }; // // [vc.navigationController pushViewController:imagevc animated:false]; // } // // bundleVC.content_data = self.bundle_item; // } @end