Преглед изворни кода

170106
GE eSign release version 1.0.170105

Ray Zhang пре 9 година
родитељ
комит
f63f5bead1

+ 0 - 19
Ants Contract/AntsContract/AntsContract/CheckSelectorViewController.h

@@ -1,19 +0,0 @@
-//
-//  CheckSelectorViewController.h
-//  AntsContract
-//
-//  Created by Ray on 12/22/16.
-//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-
-@interface CheckSelectorViewController : UIViewController
-@property (strong, nonatomic) IBOutlet UITableView *tableView;
-
-@property (strong, nonatomic) NSArray* rowData;
-@property (strong, nonatomic) NSMutableArray* checkedData;
-@property bool single_select;
-
-@property (nonatomic , copy) void (^blk_OK)(NSArray* checkedData);
-@end

+ 0 - 155
Ants Contract/AntsContract/AntsContract/CheckSelectorViewController.m

@@ -1,155 +0,0 @@
-//
-//  CheckSelectorViewController.m
-//  AntsContract
-//
-//  Created by Ray on 12/22/16.
-//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
-//
-
-#import "CheckSelectorViewController.h"
-
-@interface CheckSelectorViewController ()
-
-@end
-
-@implementation CheckSelectorViewController
-
-- (void)viewDidLoad {
-    [super viewDidLoad];
-    // Do any additional setup after loading the view.
-}
-
-- (void)didReceiveMemoryWarning {
-    [super didReceiveMemoryWarning];
-    // Dispose of any resources that can be recreated.
-}
-- (IBAction)OnOKClick:(id)sender {
-    [self dismissViewControllerAnimated:false completion:^{
-        if(self.blk_OK)
-            self.blk_OK(self.checkedData);
-    }];
-}
-- (IBAction)OnCancelClick:(id)sender {
-    
-    [self dismissViewControllerAnimated:false completion:nil];
-}
-
-/*
-#pragma mark - Navigation
-
-// In a storyboard-based application, you will often want to do a little preparation before navigation
-- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
-    // Get the new view controller using [segue destinationViewController].
-    // Pass the selected object to the new view controller.
-}
-*/
-
-#pragma mark - Table view data source
-- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath;
-{
-
-    return 44;
-    
-    
-}
-
-
-
-- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
-    
-    return @"";//[NSString stringWithFormat:@"Signature%ld",(long)section];
-    
-}
-- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
-{
-    return 1;
-}
-
-- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
-{
-    
-    return self.rowData.count;
-    
-}
-
-- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
-{
-    
-    
-
-    NSString *CellIdentifier = @"CheckItemCell";
-    UITableViewCell * cell= [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
-    
-    NSArray *item_arr = self.rowData[indexPath.row];
-    
-    cell.textLabel.text = item_arr[0];
-
-    return cell;
-}
-- (UITableViewCellAccessoryType)tableView:(UITableView*)tableView accessoryTypeForRowWithIndexPath:(NSIndexPath*)indexPath
-{
-    if([self.checkedData containsObject:[NSNumber numberWithLong:indexPath.row]])
-    {
-        return UITableViewCellAccessoryCheckmark;
-    }
-    else
-    {
-        return UITableViewCellAccessoryNone;
-    }
-}
-#pragma mark tableview delegate
-- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
-{
-        UITableViewCell* cell = [tableView cellForRowAtIndexPath:indexPath];
-    if(self.single_select)
-    {
-        [self.checkedData removeAllObjects];
-        if(cell.accessoryType==UITableViewCellAccessoryNone)
-            [self.checkedData addObject:[NSNumber numberWithLong:indexPath.row] ];
-        
-    }
-    else
-    {
-        if([self.checkedData containsObject:[NSNumber numberWithLong:indexPath.row]])
-        {
-            [self.checkedData removeObject:[NSNumber numberWithLong:indexPath.row]];
-            
-        }
-        else
-        {
-            [self.checkedData addObject:[NSNumber numberWithLong:indexPath.row] ];
-        }
-        
-    }
-    
-
-   // cell.accessoryType=UITableViewCellAccessoryCheckmark;
-    
-    [tableView reloadData];
-    
-    
-
-//    if(self.blk_Select)
-//    {
-//        
-//        //        SignatureTableViewCell * cell= [tableView cellForRowAtIndexPath:indexPath];
-//        
-//        NSDictionary * item_json = self.signatureData[[NSString stringWithFormat:@"item_%ld",(long)indexPath.section]];
-//        
-//        //        UIImage* img = [UIImage imageWithContentsOfFile:item_json[@"file"]];
-//        
-//        
-//        self.blk_Select(item_json[@"file"]);
-//        
-//    }
-//    
-//    [self dismissViewControllerAnimated:false completion:nil];
-    
- 
-    
-    
-}
-
-
-
-@end

+ 0 - 22
Ants Contract/AntsContract/AntsContract/DocumentPageViewController.h

@@ -1,22 +0,0 @@
-//
-//  DocumentPageViewController.h
-//  AntsContract
-//
-//  Created by Ray on 12/16/16.
-//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-
-@interface DocumentPageViewController : UIViewController <UIPageViewControllerDelegate , UIPageViewControllerDataSource>
-
-@property (strong, nonatomic) UIPageViewController *pageViewController;
-@property (strong, nonatomic) NSMutableDictionary * controlTemplate;
-@property size_t total_page;
-@property CGPDFDocumentRef document;
-@property (strong, nonatomic) NSMutableDictionary* signatureData;
-
-
-@property (strong, nonatomic) NSString* pdfName;
-@property (strong, nonatomic) NSString* templateName;
-@end

+ 0 - 316
Ants Contract/AntsContract/AntsContract/DocumentPageViewController.m

@@ -1,316 +0,0 @@
-//
-//  DocumentPageViewController.m
-//  AntsContract
-//
-//  Created by Ray on 12/16/16.
-//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
-//
-
-#import "DocumentPageViewController.h"
-#import "PageViewController.h"
-#import "SignatureListViewController.h"
-#import "SignatureViewController.h"
-#import "PDFUtils.h"
-
-@interface DocumentPageViewController ()
-
-@end
-
-@implementation DocumentPageViewController
-
-- (void)viewDidLoad {
-    [super viewDidLoad];
-    
-    
-    //    self.delegate = self;
-    //    self.dataSource = self;
-    
-    
-    self.signatureData= [[NSMutableDictionary alloc] init];
-    
-    
-    self.document = [PDFUtils OpenPDF:self.pdfName];
-    self.total_page = CGPDFDocumentGetNumberOfPages (self.document);
-    self.controlTemplate = [PDFUtils loadControl:self.templateName];
-    
-    
-    PageViewController* startingViewController=[self viewControllerAtIndex:0];
-    
-    // NSArray* viewControllers =[NSArray arrayWithObjects:page_0,nil];
-    
-    self.pageViewController = [[UIPageViewController alloc] initWithTransitionStyle:UIPageViewControllerTransitionStyleScroll navigationOrientation:UIPageViewControllerNavigationOrientationHorizontal options:nil];
-    self.pageViewController.delegate = self;
-    
-    //    PageViewController *startingViewController = [self viewControllerAtIndex:0 storyboard:self.storyboard];
-    NSArray *viewControllers = @[startingViewController];
-    [self.pageViewController setViewControllers:viewControllers direction:UIPageViewControllerNavigationDirectionForward animated:NO completion:nil];
-    
-    self.pageViewController.dataSource = self;
-    
-    [self addChildViewController:self.pageViewController];
-    [self.view addSubview:self.pageViewController.view];
-    
-    // Set the page view controller's bounds using an inset rect so that self's view is visible around the edges of the pages.
-    CGRect pageViewRect = self.view.bounds;
-    if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
-        pageViewRect = pageViewRect;//CGRectInset(pageViewRect, 40.0, 40.0);
-    }
-    self.pageViewController.view.frame = pageViewRect;
-    
-    [self.pageViewController didMoveToParentViewController:self];
-    
-    // Do any additional setup after loading the view.
-}
-
-- (void)didReceiveMemoryWarning {
-    [super didReceiveMemoryWarning];
-    // Dispose of any resources that can be recreated.
-}
-- (IBAction)onSignatureClicked:(id)sender {
-    
-    //    CGRect cellrect_screen = [RAUtils relativeFrameForScreenWithView:trigger];
-    //
-    //
-    //    CGRect rect1=[self.view convertRect:cellrect_screen fromView:[[[UIApplication sharedApplication] delegate] window]];
-    //
-    //    DebugLog(@"convert1 %@",NSStringFromCGRect(rect1));
-    SignatureListViewController *signatureVC = [ [UIStoryboard storyboardWithName:@"signature" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"SignatureListViewController"];
-    signatureVC.title=@"Signatures";
-    signatureVC.signatureData = self.signatureData;
-    
-    
-    signatureVC.blk_Add = ^()
-    {
-        
-        __block UIImage* signimg=nil;
-        SignatureViewController * vc =[ [UIStoryboard storyboardWithName:@"signature" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"SignatureViewController"];
-        
-        vc.onReturnImg = ^(UIImage* img)
-        {
-            
-            
-            signimg = img;
-            
-            if(signimg!=nil)
-                [PDFUtils addSignature:signimg to:self.signatureData];
-                //[self addSignature:signimg];
-                
-            
-            
-        };
-        //    orderinfoVC.url_type = URL_REMOTE;
-        //    orderinfoVC.request_url=URL_CARTDELIVERY;
-        //
-        //    orderinfoVC.params = params;
-        //
-        //    orderinfoVC.delegate=self;
-        //
-        //    if(checked.count==count)
-        //    {
-        //    orderinfoVC.have_tail = true
-        //    }
-        
-        [self.navigationController pushViewController:vc animated:true];
-        
-        
-        
-    };
-    
-    UINavigationController * navi = [[UINavigationController alloc] initWithRootViewController:signatureVC];
-    navi.modalPresentationStyle=UIModalPresentationPopover;
-    
-    UIPopoverPresentationController* popPc = navi.popoverPresentationController;
-    popPc.permittedArrowDirections = UIPopoverArrowDirectionUp;
-    popPc.barButtonItem = sender;
-    popPc.delegate = nil;
-    
-    
-    
-    [self presentViewController:navi animated:true completion:nil];
-    
-    ////    menu.selector = self.selector;
-    ////
-    ////    menu.selectordelegate = self;
-    //
-    //    // 1.创建一个UIPopover
-    //    UIPopoverController *popover = [[UIPopoverController alloc] initWithContentViewController:[[UINavigationController alloc] initWithRootViewController:menu]];
-    //
-    //
-    //
-    //    UIPopoverPresentationController
-    //    // 2.设置尺寸
-    //    //    popover.popoverContentSize = CGSizeMake(320, 44 * 5);
-    //
-    //    // 3.从哪里显示出来 --> 指向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];
-    
-}
-- (IBAction)onSaveClicked:(id)sender {
-    [PDFUtils SavePDF:self.controlTemplate source:self.document window_rect:CGRectMake(0, 0, 768, 960)];
-  //  [PDFUtils savep
-}
-
--(void) addSignature :(UIImage*) img to:(NSMutableDictionary*)signatureData
-{
-    
-    
-    if(true)
-    {
-        NSString* newfile=[self saveTempSignature:UIImagePNGRepresentation(img)];
-        
-        int newidx = [self.signatureData[@"count"] intValue];
-        
-       // [@"file"]= newfile;
-        
-        NSMutableDictionary* item = [[NSMutableDictionary alloc] init];
-        item[@"file"]=newfile;
-        signatureData[[NSString stringWithFormat:@"item_%d",newidx]] = item;
-        signatureData[@"count"]=[NSNumber numberWithInt:newidx+1];
-        
-        
-    
-    }
-    
-    
-    
-}
--(NSString *) saveTempSignature:(NSData *) image
-{
-    NSString* tempDir = NSTemporaryDirectory();
-    
-    NSString *saveFileName=[NSString stringWithFormat:@"%@.png",[[NSUUID UUID ] UUIDString] ] ;
-    
-    NSString *newFilePath=[tempDir stringByAppendingPathComponent:saveFileName];
-    
-    
-       bool bsuccess=[image writeToFile:newFilePath atomically:YES];
-    if(bsuccess)
-    {
-
-        return newFilePath;
-    }
-    else
-    {
-        return nil;
-    }
-
-}
-/*
- #pragma mark - Navigation
- 
- // In a storyboard-based application, you will often want to do a little preparation before navigation
- - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
- // Get the new view controller using [segue destinationViewController].
- // Pass the selected object to the new view controller.
- }
- */
-
-
-- (PageViewController *)viewControllerAtIndex:(NSUInteger)index
-{
-    //Return the PDFViewController for the given index.
-    if ((self.total_page == 0 )|| (index > self.total_page) ) {
-        return nil;
-    }
-    
-    //Create a new view controller and pass suitable data.
-    PageViewController *PageViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"PageViewController"];
-    
-    PageViewController.pageRef =  CGPDFDocumentGetPage (self.document , index+1);
-    PageViewController.pageIndex = index;
-    
-    ;
-    PageViewController.controlTemplate = self.controlTemplate[[NSString stringWithFormat:@"page_%lu",(unsigned long)index]];
-    
-    PageViewController.signatureData = self.signatureData;
-    //PageViewController.pdfview = [self.pagePDF objectAtIndex:index];
-    
-    /*
-     PageViewController.pdfview = [[PDFView alloc]initWithFrame:self.view.frame atPage:index];
-     [PageViewController.view addSubview:PageViewController.pdfview];
-     NSLog(@"index = %d",index);
-     
-     
-     */
-    return PageViewController;
-}
-
-- (NSUInteger) indexOfViewController:(PageViewController *)viewController
-{
-    return viewController.pageIndex;//[self.pagePDF indexOfObject:viewController.pdfview];
-}
-
-
-#pragma mark - Page View Controller Data Source
-
-
-- (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerBeforeViewController:(UIViewController *)viewController
-{
-    NSUInteger index = [self indexOfViewController:(PageViewController *)viewController];
-    if ((index == 0 ) || (index == NSNotFound)){
-        return nil;
-    }
-    
-    index--;
-    return  [self viewControllerAtIndex:index];
-}
-
-- (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerAfterViewController:(UIViewController *)viewController
-{
-    NSUInteger index = [self indexOfViewController:(PageViewController *)viewController];
-    if (index == NSNotFound)
-    {
-        return nil;
-    }
-    
-    index++;
-    
-    if (index == self.total_page){
-        return  nil;
-    }
-    
-    return [self viewControllerAtIndex:index];
-}
-
-
-#pragma mark - UIPageViewController delegate methods
-- (UIPageViewControllerSpineLocation)pageViewController:(UIPageViewController *)pageViewController spineLocationForInterfaceOrientation:(UIInterfaceOrientation)orientation {
-    if (true||UIInterfaceOrientationIsPortrait(orientation) || ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)) {
-        // In portrait orientation or on iPhone: Set the spine position to "min" and the page view controller's view controllers array to contain just one view controller. Setting the spine position to 'UIPageViewControllerSpineLocationMid' in landscape orientation sets the doubleSided property to YES, so set it to NO here.
-        
-        UIViewController *currentViewController = self.pageViewController.viewControllers[0];
-        NSArray *viewControllers = @[currentViewController];
-        [self.pageViewController setViewControllers:viewControllers direction:UIPageViewControllerNavigationDirectionForward animated:YES completion:nil];
-        
-        self.pageViewController.doubleSided = NO;
-        return UIPageViewControllerSpineLocationMin;
-    }
-    
-//    // In landscape orientation: Set set the spine location to "mid" and the page view controller's view controllers array to contain two view controllers. If the current page is even, set it to contain the current and next view controllers; if it is odd, set the array to contain the previous and current view controllers.
-//    PageViewController *currentViewController = self.pageViewController.viewControllers[0];
-//    NSArray *viewControllers = nil;
-//    
-//    NSUInteger indexOfCurrentViewController = [self indexOfViewController:currentViewController];
-//    if (indexOfCurrentViewController == 0 || indexOfCurrentViewController % 2 == 0) {
-//        UIViewController *nextViewController = [self pageViewController:self.pageViewController viewControllerAfterViewController:currentViewController];
-//        viewControllers = @[currentViewController, nextViewController];
-//    } else {
-//        UIViewController *previousViewController = [self pageViewController:self.pageViewController viewControllerBeforeViewController:currentViewController];
-//        viewControllers = @[previousViewController, currentViewController];
-//    }
-//    [self.pageViewController setViewControllers:viewControllers direction:UIPageViewControllerNavigationDirectionForward animated:YES completion:nil];
-//    
-//    
-//    return UIPageViewControllerSpineLocationMid;
-}
-
-
-
-@end

+ 0 - 13
Ants Contract/AntsContract/AntsContract/EditControlView.h

@@ -1,13 +0,0 @@
-//
-//  EditControlView.h
-//  AntsContract
-//
-//  Created by Ray on 12/19/16.
-//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-
-@interface EditControlView : UIView
-
-@end

+ 0 - 21
Ants Contract/AntsContract/AntsContract/EditControlView.m

@@ -1,21 +0,0 @@
-//
-//  EditControlView.m
-//  AntsContract
-//
-//  Created by Ray on 12/19/16.
-//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
-//
-
-#import "EditControlView.h"
-
-@implementation EditControlView
-
-/*
-// Only override drawRect: if you perform custom drawing.
-// An empty implementation adversely affects performance during animation.
-- (void)drawRect:(CGRect)rect {
-    // Drawing code
-}
-*/
-
-@end

+ 0 - 14
Ants Contract/AntsContract/AntsContract/PDFPageView.h

@@ -1,14 +0,0 @@
-//
-//  PDFPageView.h
-//  AntsContract
-//
-//  Created by Ray on 12/16/16.
-//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-
-@interface PDFPageView : UIView
-@property size_t pageIndex;
-@property CGPDFPageRef pageRef;
-@end

+ 0 - 120
Ants Contract/AntsContract/AntsContract/PDFPageView.m

@@ -1,120 +0,0 @@
-//
-//  PDFPageView.m
-//  AntsContract
-//
-//  Created by Ray on 12/16/16.
-//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
-//
-
-#import "PDFPageView.h"
-
-@implementation PDFPageView
-
-
-// Only override drawRect: if you perform custom drawing.
-// An empty implementation adversely affects performance during animation.
-- (void)drawRect:(CGRect)rect {
-    // Drawing code
-    
-            //CGPDFDocumentRef document = [self OpenPDF:@"GEIC - Home Improvement Contract 2016.pdf"];
-    
-    
-    
-
-
-    
-        CGContextRef context = UIGraphicsGetCurrentContext();
-    
-    [self MyDisplayPDFPage:context index:self.pageIndex file:@"GEIC - Home Improvement Contract 2016.pdf"];
-}
-
-
-
--(void) MyDisplayPDFPage:(CGContextRef) myContext index:(size_t)pageNumber file:(NSString*) filename//(,  , const char *filename)
-{
-    
-    
-    {
-    CGPDFPageRef page = self.pageRef;
-
-    CGContextSaveGState (myContext);
-    
-                CGRect mediabox= CGPDFPageGetBoxRect(page, kCGPDFMediaBox);
-        
-//                CGContextTranslateCTM(myContext, 0, mediabox.size.height);
-//                CGContextScaleCTM(myContext, 1, -1);
-
-        CGAffineTransform pdfTransform = CGPDFPageGetDrawingTransform(page, kCGPDFMediaBox, self.frame, 0, true);
-        CGContextConcatCTM(myContext, pdfTransform);
-        
-        CGContextScaleCTM(myContext, 1, -1);
-        CGContextTranslateCTM(myContext, 0, -self.frame.size.height/pdfTransform.a);
-        
-
-    CGContextDrawPDFPage (myContext, page);
-    CGContextRestoreGState (myContext);
-    }
-    
-    
-    
-    
-    
-//    CGPDFPageRef page = self.pageRef;
-//
-//    CGContextSaveGState (myContext);
-//    
-//    CGRect mediabox= CGPDFPageGetBoxRect(page, kCGPDFMediaBox);
-//    
-//    CGContextTranslateCTM(myContext, 0, mediabox.size.height);
-//    // Reverse the Y axis to grow from bottom to top.
-//    CGContextScaleCTM(myContext, 1, -1);
-//    
-//    CGContextDrawPDFPage (myContext, page);
-//    CGContextRestoreGState (myContext);
-//    return ;
-    
-//    {
-//        
-//        // CGPDFDocumentRef document;
-//        CGPDFPageRef page = self.pageRef;
-//
-//        CGContextSaveGState (myContext);
-//        
-//        
-//        CGRect mediabox= CGPDFPageGetBoxRect(page, kCGPDFMediaBox);
-//        
-//        CGContextTranslateCTM(myContext, 0, mediabox.size.height);
-//        CGContextScaleCTM(myContext, 1, -1);
-//        
-//        CGContextDrawPDFPage (myContext, page);
-//        CGContextRestoreGState (myContext);
-//    }
-    
-    
-    
-    
-    
- /*
-   // CGPDFDocumentRef document;
-    CGPDFPageRef page = self.pageRef;
- //   document = [self OpenPDF:filename];                                   // 1 创建PDFDocument对象
-  //  page = CGPDFDocumentGetPage (document, pageNumber);           // 2 获取指定页的PDF文档
-    
-    
-//    CGAffineTransform m;
-//    m = CGPDFPageGetDrawingTransform (page, kCGPDFMediaBox, self.bounds, -180, true);
-    CGContextSaveGState (myContext);
-    
-    CGContextTranslateCTM(myContext, 80, self.frame.size.height);
-    CGContextScaleCTM(myContext, 1, -1);
-    
- //   CGContextConcatCTM (myContext, m);
-  //  CGContextClipToRect (myContext,CGPDFPageGetBoxRect (page, kCGPDFCropBox));
-    CGContextDrawPDFPage (myContext, page);
-    CGContextRestoreGState (myContext);
-    */
-    
-  //  CGContextDrawPDFPage (myContext, page);                                       // 3 将PDF绘制到图形上下文中
-//    CGPDFDocumentRelease (document);
-}
-@end

+ 0 - 13
Ants Contract/AntsContract/AntsContract/PDFScrollView.h

@@ -1,13 +0,0 @@
-//
-//  PDFScrollView.h
-//  AntsContract
-//
-//  Created by Ray on 12/19/16.
-//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-
-@interface PDFScrollView : UIScrollView
-
-@end

+ 0 - 21
Ants Contract/AntsContract/AntsContract/PDFScrollView.m

@@ -1,21 +0,0 @@
-//
-//  PDFScrollView.m
-//  AntsContract
-//
-//  Created by Ray on 12/19/16.
-//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
-//
-
-#import "PDFScrollView.h"
-
-@implementation PDFScrollView
-
-/*
-// Only override drawRect: if you perform custom drawing.
-// An empty implementation adversely affects performance during animation.
-- (void)drawRect:(CGRect)rect {
-    // Drawing code
-}
-*/
-
-@end

+ 0 - 28
Ants Contract/AntsContract/AntsContract/PageViewController.h

@@ -1,28 +0,0 @@
-//
-//  DocumentViewController.h
-//  AntsContract
-//
-//  Created by Ray on 12/16/16.
-//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-#import "PDFPageView.h"
-#import "PDFScrollView.h"
-#import "EditControlView.h"
-#import "TouchImageView.h"
-
-@interface PageViewController : UIViewController<UITextViewDelegate,TouchImageViewDelegate>
-
-@property (strong, nonatomic) IBOutlet PDFPageView *pdfPageView;
-@property (strong, nonatomic) IBOutlet EditControlView *editControlView;
-@property size_t pageIndex;
-@property CGPDFPageRef pageRef;
-@property (strong, nonatomic) IBOutlet PDFScrollView *pdfScrollView;
-
-
-
-@property (strong, nonatomic) NSMutableDictionary * controlTemplate;
-
-@property (strong, nonatomic) NSMutableDictionary * signatureData;
-@end

+ 0 - 499
Ants Contract/AntsContract/AntsContract/PageViewController.m

@@ -1,499 +0,0 @@
-//
-//  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 "CheckSelectorViewController.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)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;i<count;i++)
-    {
-        NSMutableDictionary * control =self.controlTemplate [[NSString stringWithFormat:@"control_%d",i] ];
-        if([control[@"type"] isEqualToString:@"TextView"])
-        {
-            [self addTextView:control destView:self.editControlView index:i];
-        }
-        else if([control[@"type"] isEqualToString:@"Button"])
-        {
-            [self addButton:control destView:self.editControlView index:i];
-            
-        }
-        else if([control[@"type"] isEqualToString:@"Check"])
-        {
-            [self addCheck:control destView:self.editControlView index:i];
-            
-        }
-        else if([control[@"type"] isEqualToString:@"Signature"])
-        {
-            [self addSignatureButton:control destView:self.editControlView index:i];
-            
-        }
-    }
-    
-}
-#pragma mark add controls
--(void) addTextView:(NSMutableDictionary*) template destView:(UIView*)destView index:(int) index
-{
-    UITextView* tv = [[UITextView alloc] initWithFrame:CGRectMake([template[@"pos_x"] floatValue], [template[@"pos_y"] floatValue], [template[@"width"] floatValue], [template[@"height"] floatValue])];
-    float fontsize = [template[@"size"] floatValue];
-    if(fontsize==0)
-        fontsize=10;
-    [tv setFont:[UIFont systemFontOfSize:fontsize]];
-    
-    tv.text =template[@"value"];
-    
-    tv.tag = index+ CONTROL_BASE;
-    
-    
-    //    tv.place
-    //    [btn setTitle:template[@"title"] forState:UIControlStateNormal];
-    //    ref addTarget:self action:@selector(manually_refresh) forControlEvents:UIControlEventValueChanged
-    
-    
-    tv.delegate = self;
-    //    [btn addTarget:self action:@selector(ControlButtonClicked:) forControlEvents:UIControlEventTouchUpInside];
-    if(DEBUG_PDFSIG)
-    {
-        tv.backgroundColor = [UIColor lightGrayColor];
-        
-        // [btn setBackgroundImage:[UIColor grayColor] forState:UIControlStateNormal];
-    }
-    [destView addSubview:tv];
-}
--(void) addButton:(NSMutableDictionary*) template destView:(UIView*)destView index:(int) index
-{
-    UIButton* btn = [[UIButton alloc] initWithFrame:CGRectMake([template[@"pos_x"] floatValue], [template[@"pos_y"] floatValue], [template[@"width"] floatValue], [template[@"height"] floatValue])];
-    [btn setTitle:template[@"title"] forState:UIControlStateNormal];
-    
-        btn.tag = index+ CONTROL_BASE;
-    //    ref addTarget:self action:@selector(manually_refresh) forControlEvents:UIControlEventValueChanged
-    
-    [btn addTarget:self action:@selector(ControlButtonClicked:) forControlEvents:UIControlEventTouchUpInside];
-    if(DEBUG_PDFSIG)
-    {
-        btn.backgroundColor = [UIColor lightGrayColor];
-        
-        // [btn setBackgroundImage:[UIColor grayColor] forState:UIControlStateNormal];
-    }
-    [destView addSubview:btn];
-}
--(UIView*) createMarker:(int)size x:(int)x y:(int)y
-{
-    UIView* v=[[UIView alloc] initWithFrame:CGRectMake(x, y, size, size)];
-    return v;
-    
-}
--(void) addCheck:(NSMutableDictionary*) template destView:(UIView*)destView index:(int) index
-{
-    UIButton* btn = [[UIButton alloc] initWithFrame:CGRectMake([template[@"pos_x"] floatValue], [template[@"pos_y"] floatValue], [template[@"width"] floatValue], [template[@"height"] floatValue])];
-    
-    //    ref addTarget:self action:@selector(manually_refresh) forControlEvents:UIControlEventValueChanged
-        btn.tag = index+ CONTROL_BASE;
-    [btn addTarget:self action:@selector(CheckButtonClicked:) forControlEvents:UIControlEventTouchUpInside];
-    UIColor* marker_bg=[UIColor clearColor];
-    if(DEBUG_PDFSIG)
-    {
-       // btn.backgroundColor = [UIColor lightGrayColor];
-
-        [btn setTitle:template[@"title"] forState:UIControlStateNormal];
-        marker_bg = [UIColor redColor];
-        
-        // [btn setBackgroundImage:[UIColor grayColor] forState:UIControlStateNormal];
-    }
-    [destView addSubview:btn];
-    NSArray* cadedate = template[@"cadedate"];
-    
-    NSArray* checkedData = self.controlTemplate [[NSString stringWithFormat:@"control_%d",index] ][@"value"];
-
-
-    
-    
-    for(int i=0;i<cadedate.count;i++)
-    {
-        NSArray* item = cadedate[i];
-        
-        UIView* marker=[self createMarker:[template[@"marker_size"] intValue] x:[item[1][0] intValue] y:[item[1][1] intValue]];
-        
-        marker.backgroundColor = marker_bg;
-        marker.tag = CHECK_BASE+index*1000+i;
-        
-        
-        if([checkedData containsObject:[NSNumber numberWithLong:i]])
-        {
-            
-            marker.backgroundColor= [UIColor blackColor];
-            
-        }
-        else
-        {
-            marker.backgroundColor= marker_bg;
-        }
-        
-        [destView addSubview:marker];
-        
-    }
-    
-}
--(void) addSignatureButton:(NSMutableDictionary*) template destView:(UIView*)destView index:(int) index
-{
-    TouchImageView* btn = [[TouchImageView alloc] initWithFrame:CGRectMake([template[@"pos_x"] floatValue], [template[@"pos_y"] floatValue], [template[@"width"] floatValue], [template[@"height"] floatValue])];
-    
-    btn.contentMode = UIViewContentModeScaleAspectFit;
-    btn.delegate = self;
-    btn.layer.borderColor = [UIColor clearColor].CGColor;
-    btn.layer.borderWidth = 0;
-        btn.tag = index+ CONTROL_BASE;
-    
-    NSString* file =template[@"value"];
-    
-    NSData* img_data=[ImageUtils load_img:file];
-    
-    if(img_data!=nil)
-    {
-        
-        UIImage* image=[UIImage imageWithData:img_data];
-        btn.image = image;
-        
-    }
-    
-
-
-
-    if(DEBUG_PDFSIG)
-    {
-        btn.backgroundColor = [UIColor lightGrayColor];
-        
-        // [btn setBackgroundImage:[UIColor grayColor] forState:UIControlStateNormal];
-    }
-    [destView addSubview:btn];
-}
-
-#pragma mark UIScrollView delegate
-
-- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView {
-    
-    
-    UIView *subView = [scrollView viewWithTag:1024];
-    return subView;
-    
-}
-//- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(float)scale {
-//
-//
-//
-//}
-#pragma mark Button Click
-- (void)ControlButtonClicked:(UIButton *)sender {
-    //    DebugLog(@"cart sort button clicked");
-    
-    NSLog(@"button clicked;");
-    //    [self.view addSubview:self.sortItemController.view];
-}
-- (void)CheckButtonClicked:(UIButton *)sender {
-    //    DebugLog(@"cart sort button clicked");
-    
-    NSLog(@"check clicked;");
-    
-    long index = sender.tag - CONTROL_BASE;
-    
-
-    bool single_select = [self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"single_select"] boolValue];
-    
-    NSArray* rowData = self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"cadedate"];
-    NSArray* checkedData = self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"value"];
-    CheckSelectorViewController *checkVC = [ [UIStoryboard storyboardWithName:@"signature" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"CheckSelectorViewController"];
-    
-    checkVC.blk_OK = ^(NSArray* checkedData){
-        for(int i=0;i<rowData.count;i++)
-        {
-            long tag=CHECK_BASE+index*1000+i;
-           // UIView* v= sender;
-            if([checkedData containsObject:[NSNumber numberWithLong:i]])
-            {
-               // [checkedData removeObject:[NSNumber numberWithLong:indexPath.row]];
-                
-                [sender.superview viewWithTag:tag].backgroundColor= [UIColor blackColor];
-                
-            }
-            else
-            {
-               // [self.checkedData addObject:[NSNumber numberWithLong:indexPath.row] ];
-                [sender.superview viewWithTag:tag].backgroundColor= [UIColor clearColor];
-            }
-            self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"value"]=checkedData;
-            
-        }
-    };
-    checkVC.rowData = rowData;
-    checkVC.checkedData = [checkedData mutableCopy];
-    checkVC.single_select = single_select;
-    
-    checkVC.title=@"abcdefg";
-    checkVC.modalPresentationStyle = UIModalTransitionStyleCrossDissolve;
-    [self presentViewController:checkVC animated:YES completion:nil];
-    
-}
-
-#pragma mark TextViewDelegate
-- (void)textViewDidEndEditing:(UITextView *)textView
-{
-    
-    long index = textView.tag - CONTROL_BASE;
-    
-    NSString* text =textView.text;
-    if(text==nil)
-        text=@"";
-    self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"value"] = text;
-    
-//    int count = [self.controlTemplate[@"count"] intValue];
-//    for(int i=0;i<count;i++)
-//    {
-//        NSMutableDictionary * control =;
-    //[self update_newprice];
-}
-/*
- #pragma mark - Navigation
- 
- // In a storyboard-based application, you will often want to do a little preparation before navigation
- - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
- // Get the new view controller using [segue destinationViewController].
- // Pass the selected object to the new view controller.
- }
- */
-#pragma mark signature clicked 
-//touchimageview Delegate
-- (void)TouchImageViewOnTouche:(TouchImageView *)touchImageView
-{
-    
-    NSLog(@"signature button clicked;");
-    
-    
-    {
-        
-        //    CGRect cellrect_screen = [RAUtils relativeFrameForScreenWithView:trigger];
-        //
-        //
-        //    CGRect rect1=[self.view convertRect:cellrect_screen fromView:[[[UIApplication sharedApplication] delegate] window]];
-        //
-        //    DebugLog(@"convert1 %@",NSStringFromCGRect(rect1));
-        SignatureListViewController *signatureVC = [ [UIStoryboard storyboardWithName:@"signature" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"SignatureListViewController"];
-        signatureVC.title=@"Signatures";
-        signatureVC.signatureData = self.signatureData;
-        
-//        signatureVC.imageView = touchImageView;
-        
-        signatureVC.blk_Select =^(NSString* file)
-        {
-            
-            
-            
-//            NSString* file_name=[file lastPathComponent];
-            
-            NSData* img_data=[ImageUtils load_img:file];
-            
-            if(img_data!=nil)
-            {
-                
-                UIImage* image=[UIImage imageWithData:img_data];
-                touchImageView.image = image;
-                
-                long index = touchImageView.tag - CONTROL_BASE;
-                self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"value"] = file;
-                
-            }
-
-        };
-        signatureVC.blk_Add = ^()
-        {
-            
-            __block UIImage* signimg=nil;
-            SignatureViewController * vc =[ [UIStoryboard storyboardWithName:@"signature" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"SignatureViewController"];
-            
-            vc.onReturnImg = ^(UIImage* img)
-            {
-                
-                
-                signimg = img;
-                
-                if(signimg!=nil)
-                {
-                    NSString* file=[PDFUtils addSignature:signimg to:self.signatureData];
-                        long index = touchImageView.tag - CONTROL_BASE;
-                        self.controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ][@"value"] = file;
-                    touchImageView.image = signimg;
-                }
-                
-                
-            };
-            //    orderinfoVC.url_type = URL_REMOTE;
-            //    orderinfoVC.request_url=URL_CARTDELIVERY;
-            //
-            //    orderinfoVC.params = params;
-            //
-            //    orderinfoVC.delegate=self;
-            //
-            //    if(checked.count==count)
-            //    {
-            //    orderinfoVC.have_tail = true
-            //    }
-            
-            [self.navigationController pushViewController:vc animated:true];
-            
-            
-            
-        };
-        
-        UINavigationController * navi = [[UINavigationController alloc] initWithRootViewController:signatureVC];
-        navi.modalPresentationStyle=UIModalPresentationPopover;
-        
-        UIPopoverPresentationController* popPc = navi.popoverPresentationController;
-        popPc.permittedArrowDirections = UIPopoverArrowDirectionAny;
-        popPc.sourceView = touchImageView;
-        popPc.delegate = nil;
-        
-        
-        
-        [self presentViewController:navi animated:true completion:nil];
-        
-        ////    menu.selector = self.selector;
-        ////
-        ////    menu.selectordelegate = self;
-        //
-        //    // 1.创建一个UIPopover
-        //    UIPopoverController *popover = [[UIPopoverController alloc] initWithContentViewController:[[UINavigationController alloc] initWithRootViewController:menu]];
-        //
-        //
-        //
-        //    UIPopoverPresentationController
-        //    // 2.设置尺寸
-        //    //    popover.popoverContentSize = CGSizeMake(320, 44 * 5);
-        //
-        //    // 3.从哪里显示出来 --> 指向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

+ 0 - 20
Ants Contract/AntsContract/AntsContract/SignatureListViewController.h

@@ -1,20 +0,0 @@
-//
-//  SignatureListViewController.h
-//  AntsContract
-//
-//  Created by Ray on 12/19/16.
-//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-
-@interface SignatureListViewController : UIViewController
-
-@property (strong, nonatomic) IBOutlet UITableView *tableView;
-
-@property (strong, nonatomic) NSMutableDictionary* signatureData;
-
-//@property (strong, nonatomic)  UIImageView *imageView;
-@property (nonatomic , copy) void (^blk_Add)();
-@property (nonatomic , copy) void (^blk_Select)(NSString* file);
-@end

+ 0 - 397
Ants Contract/AntsContract/AntsContract/SignatureListViewController.m

@@ -1,397 +0,0 @@
-//
-//  SignatureListViewController.m
-//  AntsContract
-//
-//  Created by Ray on 12/19/16.
-//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
-//
-
-#import "SignatureListViewController.h"
-#import "SignatureTableViewCell.h"
-
-@interface SignatureListViewController ()
-
-@end
-
-@implementation SignatureListViewController
-
-- (void)viewDidLoad {
-    [super viewDidLoad];
-    // Do any additional setup after loading the view.
-}
-
-- (void)didReceiveMemoryWarning {
-    [super didReceiveMemoryWarning];
-    // Dispose of any resources that can be recreated.
-}
-- (IBAction)onAddClick:(id)sender {
-    
-    
-    [self dismissViewControllerAnimated:false completion:^{
-        
-        
-        if(self.blk_Add)
-            self.blk_Add();
-        
-     }];
-    
-
-    
-}
-
-/*
-#pragma mark - Navigation
-
-// In a storyboard-based application, you will often want to do a little preparation before navigation
-- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
-    // Get the new view controller using [segue destinationViewController].
-    // Pass the selected object to the new view controller.
-}
-*/
-
-
-#pragma mark - Table view data source
-- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath;
-{
-    //     NSDictionary * item_json = [self.content_data objectForKey:[NSString stringWithFormat:@"item_%ld",(long)indexPath.row]];
-    //    if([item_json objectForKey:@"combine"] == nil)
-    //    {
-    //        return 120;
-    //    }
-    //    else
-    //        return 150;
-    
-    
-    return 128;
-
-    
-}
-
-//- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
-//{
-//    return 0;
-//}
-//- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
-//{
-//    return 0;
-//}
-//- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
-//{
-//        UIView* myView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 0.0001)];
-//    return myView;
-//
-//}
-
-//- (UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
-//{
-//    UIView* myView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 0.0001)];
-////    myView.backgroundColor = [UIColor colorWithRed:0.10 green:0.68 blue:0.94 alpha:0.7];
-////    UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 0, 90, 22)];
-////    titleLabel.textColor=[UIColor whiteColor];
-////    titleLabel.backgroundColor = [UIColor clearColor];
-////    if(section==0)
-////        titleLabel.text=NSLocalizedString(@"display_items", nil);
-////    else
-////        titleLabel.text=NSLocalizedString(@"hide_items", nil);
-////    [titleLabel sizeToFit];
-////    [myView addSubview:titleLabel];
-////
-//    return myView;
-//}
-//
-
-//- (UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
-//{
-//    
-//    
-//    NSString* value =[DefaultAppearance get_noneappearance_value:@"DefaultTableHeaderView" valuename:@"title_text_color"];
-//    
-//    if(value==nil)
-//        value=@"";
-//    unsigned long color = strtoul([value UTF8String],0,16);
-//    
-//    
-//    DefaultTableHeaderView* myView = [[DefaultTableHeaderView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 0.0001)];
-//    //  myView.backgroundColor = UIColorFromRGB(0x996633);;
-//    
-//    
-//    myView.layer.shadowPath =[UIBezierPath bezierPathWithRect:myView.bounds].CGPath;
-//    //    myView.layer.masksToBounds = false;
-//    //添加四个边阴影
-//    
-//    myView.layer.shadowColor = [UIColor blackColor].CGColor;
-//    myView.layer.shadowOffset = CGSizeMake(0, 0);
-//    myView.layer.shadowOpacity = 0.5;
-//    myView.layer.shadowRadius = 2.0;
-//    
-//    
-//    NSString*labeltitle = nil;
-//    switch (section) {
-//        case 0:
-//            labeltitle= @"Order Info";
-//            break;
-//        case 1:
-//        {
-//            labeltitle= @"More Info";
-//            
-//            NSString* btntitle=nil ;
-//            if(self.showMore)
-//            {
-//                btntitle=@"Hide";
-//                //        [section setValue:@"false" forKey:@"hide"];
-//                //        [sender setTitle:@"Show" forState:UIControlStateNormal];
-//            }
-//            else{
-//                btntitle=@"Show";
-//            }
-//            
-//            
-//            UIButton * btn =[[UIButton alloc] initWithFrame:CGRectMake(tableView.bounds.size.width-50-15, 0, 50, 33)];
-//            btn.tag=section;
-//            [btn addTarget:self action:@selector(HideSction:) forControlEvents:UIControlEventTouchUpInside];
-//            [btn setTitle:btntitle forState:UIControlStateNormal];
-//            [myView addSubview:btn];
-//            
-//        }
-//            break;
-//        case 2:{
-//            labeltitle= @"Models";
-//            
-//            NSString* btntitle=nil ;
-//            if(self.showModels)
-//            {
-//                btntitle=@"Hide";
-//            }
-//            else{
-//                btntitle=@"Show";
-//            }
-//            
-//            
-//            UIButton * btn =[[UIButton alloc] initWithFrame:CGRectMake(tableView.bounds.size.width-50-15, 0, 50, 33)];
-//            btn.tag=section;
-//            
-//            [btn addTarget:self action:@selector(HideSction:) forControlEvents:UIControlEventTouchUpInside];
-//            
-//            [btn setTitle:btntitle forState:UIControlStateNormal];
-//            [myView addSubview:btn];
-//            
-//        }
-//            break;
-//        case 3:
-//            labeltitle= @"Price Info";
-//        default:
-//            break;
-//    }
-//    
-//    
-//    
-//    UILabel *titlelabel = [[UILabel alloc] initWithFrame:CGRectMake(15, 5.5, 200, 20)];
-//    titlelabel.textColor=UIColorFromRGB(color);;
-//    titlelabel.backgroundColor = [UIColor clearColor];
-//    titlelabel.text=NSLocalizedString(labeltitle, nil);
-//    [titlelabel sizeToFit];
-//    [myView addSubview:titlelabel];
-//    
-//    //
-//    return myView;
-//}
-
-- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
-    
-    return [NSString stringWithFormat:@"Signature%ld",(long)section];
-    
-}
-- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
-{
-    return [self.signatureData[@"count"] intValue];
-}
-//- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
-//{
-//    return 33;
-//}
-- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
-{
-    
-    return 1;
-    
-}
-
-- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
-{
-    
-    
-    NSString *CellIdentifier = @"SignatureTableViewCell";
-    SignatureTableViewCell * cell= [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
-    NSDictionary * item_json = self.signatureData[[NSString stringWithFormat:@"item_%ld",(long)indexPath.section]];
-    
-    UIImage* img = [UIImage imageWithContentsOfFile:item_json[@"file"]];
-    
-    cell.signatureImageView.image = img;
-//    
-//    
-//    cell.webview.tag = indexPath.section;
-//    
-//    cell.webview.delegate = self;
-//    //        cell.webView.scrollView.contentSize.height = 0;
-//    cell.webview.scrollView.bounces=NO;
-//    cell.webview.scrollView.directionalLockEnabled = true;
-//    CGSize size= cell.webview.scrollView.contentSize;
-//    size.height=10;
-//    cell.webview.scrollView.contentSize=size;
-//    
-//    [cell.webview loadHTMLString:[self.content_data valueForKey:@"order_info"] baseURL:nil];
-//    
-//    cell.backgroundColor = [UIColor whiteColor];
-    return cell;
-
-
-    //    if(tableView==self.itemListTable)
-    //    {
-    //    NSString *CellIdentifier = @"CartItemCell";
-    //    ModelItemCell * cell= [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
-    //    NSDictionary * item_json = [self.content_data objectForKey:[NSString stringWithFormat:@"item_%ld",(long)indexPath.row]];
-    //    NSDictionary * combine_json =[item_json objectForKey:@"combine"];
-    //
-    //    cell.bundle_item=combine_json;
-    //    NSString* img_url = [item_json valueForKey:@"img_url"];
-    //    NSString* description = [item_json valueForKey:@"description"];
-    //    //    NSString* identifier = [item_json valueForKey:@"identifier"];
-    //    //    NSString* attribute = [item_json valueForKey:@"attribute"];
-    //    NSString* currency = [item_json valueForKey:@"currency"];
-    //    int count =[[item_json valueForKey:@"count"] intValue];
-    //
-    //    int stockUom =[[item_json valueForKey:@"stockUom"] intValue];
-    //
-    //    double totalprice =[[item_json valueForKey:@"subtotal_price"] doubleValue];
-    //
-    //    double unitprice=[[item_json valueForKey:@"unit_price"] doubleValue];
-    //    cell.unit_price = unitprice;
-    //    //    cell.labelAttribute.text = attribute;
-    //    //    cell.labelCurrency.text = currency;
-    //    cell.labelDescription.text = description;
-    //    //   cell.labelIdentifier.text = identifier;
-    //    cell.labelPrice.text = [NSString stringWithFormat:@"%.2f",totalprice];
-    //
-    //    cell.labelUnitPrice.text = [NSString stringWithFormat:@"%.2f",unitprice];
-    //
-    //
-    //
-    //    NSString* cart_item_id= [item_json valueForKey:@"cart_item_id"];
-    //    cell.cart_id = cart_item_id;
-    //    [cell init_Stepper:stockUom max:9999 min:stockUom value:count];
-    //
-    //
-    //
-    //    [cell set_Count:count];
-    //
-    //    NSString* file_name=[img_url lastPathComponent];
-    //    NSData* img_data=[iSalesDB load_cached_img:file_name loadFrom:img_url];
-    //    if(img_data!=nil)
-    //    {
-    //
-    //        UIImage * img =[UIImage imageWithData:img_data];
-    //        [cell.btnImage setBackgroundImage:img forState:UIControlStateNormal];
-    //    }
-    //    else
-    //    {
-    //
-    //        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-    //
-    //            NSData*  downloadimg_data = [NSData dataWithContentsOfURL:[NSURL URLWithString:img_url]];
-    //
-    //            dispatch_async(dispatch_get_main_queue(), ^{
-    //
-    //
-    //
-    //                if(downloadimg_data!=nil)
-    //                {
-    //                    [iSalesDB cache_img:downloadimg_data :file_name ];
-    //
-    //                    UIImage * img =[UIImage imageWithData:downloadimg_data];
-    //                    [cell.btnImage setBackgroundImage:img forState:UIControlStateNormal];
-    //                }
-    //
-    //            });
-    //        });
-    //
-    //
-    //    }
-    //    return cell;
-    //    }
-    //    else
-    //    {
-    //        NSString *CellIdentifier = @"OrderInfoListItem";
-    //        UITableViewCell * cell= [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
-    //        return cell;
-    //    }
-}
-#pragma mark tableview delegate
-- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
-{
-    if(self.blk_Select)
-    {
-        
-//        SignatureTableViewCell * cell= [tableView cellForRowAtIndexPath:indexPath];
-        
-        NSDictionary * item_json = self.signatureData[[NSString stringWithFormat:@"item_%ld",(long)indexPath.section]];
-        
-//        UIImage* img = [UIImage imageWithContentsOfFile:item_json[@"file"]];
-        
-        
-        self.blk_Select(item_json[@"file"]);
-
-    }
-    
-    [self dismissViewControllerAnimated:false completion:nil];
-    
-//    if (tableView.isEditing) { // 编辑模式下不响应
-//        return;
-//    }
-//    //
-//    if(indexPath.row==self.content_data.count)
-//        return;
-//    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
-//    
-//    if(appDelegate.user_type==USER_ROLE_CUSTOMER) { // Customer
-//        if ([Singleton sharedInstance].global_lock) { // Order list 被锁
-//            [RAUtils message_alert:@"App is locked,You can't view the order Detail" title:@"Warning" controller:self];
-//            return;
-//        }
-//    }
-//    
-//    NSString* orderid= [self.content_data[indexPath.row] valueForKey:@"order_id"];
-//    OrderDetailViewController* dvc = [self.storyboard instantiateViewControllerWithIdentifier:@"OrderDetailViewController" ];
-//    
-//    //    int i =[[self.content_data[indexPath.row] valueForKey:@"order_code"];
-//    dvc.selectOrder=^(NSMutableDictionary* order_detail){
-//        
-//        [self.navigationController popViewControllerAnimated:false];
-//        if(self.selectOrder)
-//            self.selectOrder(order_detail);
-//        
-//        
-//        
-//    };
-//    NSString* order_code =[self.content_data[indexPath.row] valueForKey:@"order_code"];
-//    
-//    dvc.is_shoporder=(self.orderType == 0);
-//    dvc.order_code = order_code;
-//    dvc.order_status =[[self.content_data[indexPath.row] valueForKey:@"orderStatus"] intValue];
-//    //    bool temp_order = false ;
-//    //    NSString* order_status=[self.content_data[indexPath.row] valueForKey:@"order_status"];
-//    //    if([order_status isEqualToString:@"Saved"]||[order_status isEqualToString:@"Quoted"])
-//    //        temp_order=true;
-//    //
-//    //    dvc.isTempOrder = temp_order;
-//    
-//    //            dvc
-//    
-//    dvc.orderid=orderid;
-//    //    dvc.category_id=nil;
-//    //    dvc.ispush=true;
-//    //    [dvc reload];
-//    [self.navigationController pushViewController:dvc animated:true];
-    
-    
-}
-@end