Commit 0ec4d741 authored by 勾芒's avatar 勾芒

debug

parent b8d74198
...@@ -288,6 +288,7 @@ ...@@ -288,6 +288,7 @@
[Customermanager manager].customerPhoneNumber = model.mobile; [Customermanager manager].customerPhoneNumber = model.mobile;
[Customermanager manager].companyName = model.address; [Customermanager manager].companyName = model.address;
[Customermanager manager].cutomerAddress = model.address; [Customermanager manager].cutomerAddress = model.address;
[Customermanager manager].header = model.picture;
[self.addpersonInformationButton setTitle:@"退出当前客户" forState:UIControlStateNormal]; [self.addpersonInformationButton setTitle:@"退出当前客户" forState:UIControlStateNormal];
self.changePersonInformationButton.hidden = NO; self.changePersonInformationButton.hidden = NO;
[self SetupUserShoppingCarNumberRequest]; [self SetupUserShoppingCarNumberRequest];
...@@ -330,6 +331,7 @@ ...@@ -330,6 +331,7 @@
[Customermanager manager].customerPhoneNumber = model.mobile; [Customermanager manager].customerPhoneNumber = model.mobile;
[Customermanager manager].companyName = model.address; [Customermanager manager].companyName = model.address;
[Customermanager manager].cutomerAddress = model.address; [Customermanager manager].cutomerAddress = model.address;
[Customermanager manager].header = model.picture;
[self.addpersonInformationButton setTitle:@"退出当前客户" forState:UIControlStateNormal]; [self.addpersonInformationButton setTitle:@"退出当前客户" forState:UIControlStateNormal];
self.changePersonInformationButton.hidden = NO; self.changePersonInformationButton.hidden = NO;
[self SetupUserShoppingCarNumberRequest]; [self SetupUserShoppingCarNumberRequest];
...@@ -411,6 +413,7 @@ ...@@ -411,6 +413,7 @@
[Customermanager manager].customerPhoneNumber = nil; [Customermanager manager].customerPhoneNumber = nil;
[Customermanager manager].companyName = nil; [Customermanager manager].companyName = nil;
[Customermanager manager].cutomerAddress = nil; [Customermanager manager].cutomerAddress = nil;
[Customermanager manager].header = nil;
self.customerHeader.image = nil; self.customerHeader.image = nil;
[self.changePersonInformationButton setTitle:@"更改客户信息" forState:UIControlStateNormal]; [self.changePersonInformationButton setTitle:@"更改客户信息" forState:UIControlStateNormal];
[self ChangeCustomerName]; [self ChangeCustomerName];
......
...@@ -100,8 +100,7 @@ ...@@ -100,8 +100,7 @@
#pragma mark -登陆 #pragma mark -登陆
- (IBAction)LoginButtonClick:(UIButton *)sender { - (IBAction)LoginButtonClick:(UIButton *)sender {
[self SetTheRootViewController];
return;
if (self.userName.text.length == 0) { if (self.userName.text.length == 0) {
[self ErrorMBProgressView:@"用户名不能为空"]; [self ErrorMBProgressView:@"用户名不能为空"];
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#import <QuickLook/QuickLook.h> #import <QuickLook/QuickLook.h>
#import "PDFViewController.h" #import "PDFViewController.h"
@interface OrderdetailsViewController ()<UITableViewDelegate,UITableViewDataSource> @interface OrderdetailsViewController ()<UITableViewDelegate,UITableViewDataSource,QLPreviewControllerDataSource>
/** /**
...@@ -411,7 +411,6 @@ ...@@ -411,7 +411,6 @@
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@%@",ServerAddress,@"/order/UrlOfprintPDF/",_orderCode] WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@%@",ServerAddress,@"/order/UrlOfprintPDF/",_orderCode] WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) {
NSString *url = [NSString stringWithFormat:@"%@%@",PDFSERADDRESS,returnValue[@"data"]]; NSString *url = [NSString stringWithFormat:@"%@%@",PDFSERADDRESS,returnValue[@"data"]];
self.PDFpath = url;
[[NetworkRequestClassManager Manager] DownloadPDFdatasWithURL:url WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] DownloadPDFdatasWithURL:url WithReturnValueBlock:^(id returnValue) {
[self RemoveMBProgressHUDLoding]; [self RemoveMBProgressHUDLoding];
...@@ -434,11 +433,16 @@ ...@@ -434,11 +433,16 @@
- (void)PreviewButtonClick:(UIButton *)button - (void)PreviewButtonClick:(UIButton *)button
{ {
if ([button.currentTitle isEqualToString:@"预览"]) { if ([button.currentTitle isEqualToString:@"预览"]) {
__weak typeof(self) weakSelf = self;
[self DownloadPDF:^(id returnValue) { [self DownloadPDF:^(id returnValue) {
PDFViewController *pdfVc = [[PDFViewController alloc]init]; self.PDFpath = returnValue;
pdfVc.pdfURLString = self.PDFpath; QLPreviewController *previewController = [[QLPreviewController alloc] init];
[self presentViewController:pdfVc animated:YES completion:nil]; previewController.dataSource = weakSelf;
// PDFViewController *viewvc = [[PDFViewController alloc]init];
// [viewvc.view addSubview:previewController.view];
[weakSelf presentViewController:previewController animated:YES completion:nil];
}]; }];
}else if ([button.currentTitle isEqualToString:@"撤销订单"]) }else if ([button.currentTitle isEqualToString:@"撤销订单"])
...@@ -481,17 +485,18 @@ ...@@ -481,17 +485,18 @@
}]; }];
}]]; }]];
[self presentViewController:alertVC animated:YES completion:nil]; [self presentViewController:alertVC animated:YES completion:nil];
} }
} }
- (NSInteger)numberOfPreviewItemsInPreviewController:(QLPreviewController *)controller
{
return 1;
}
- (id)previewController:(QLPreviewController *)controller previewItemAtIndex:(NSInteger)index
{
return self.PDFpath;
}
#pragma mark - Navigation #pragma mark - Navigation
...@@ -499,9 +504,12 @@ ...@@ -499,9 +504,12 @@
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController]. // Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller. // Pass the selected object to the new view controller.
} }
- (BOOL)prefersStatusBarHidden
{
return YES;
}
- (void)didReceiveMemoryWarning { - (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning]; [super didReceiveMemoryWarning];
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
[super awakeFromNib]; [super awakeFromNib];
// Initialization code // Initialization code
[self.customerHeader sd_setImageWithURL:[NSURL URLWithString:[[Customermanager manager] customerID]] placeholderImage:REPLACEIMAGE]; [self.customerHeader sd_setImageWithURL:[NSURL URLWithString:[[Customermanager manager] header]] placeholderImage:REPLACEIMAGE];
self.customerName.text = [[Customermanager manager] customerName]; self.customerName.text = [[Customermanager manager] customerName];
self.companyName.text = [[Customermanager manager] customerName]; self.companyName.text = [[Customermanager manager] customerName];
self.companyLocation.text = [[Customermanager manager] cutomerAddress]; self.companyLocation.text = [[Customermanager manager] cutomerAddress];
...@@ -26,7 +26,8 @@ ...@@ -26,7 +26,8 @@
- (void)setModel:(TOConsumerEntity *)model - (void)setModel:(TOConsumerEntity *)model
{ {
_model = model; _model = model;
[self.customerHeader sd_setImageWithURL:[NSURL URLWithString:_model.picture] placeholderImage:REPLACEIMAGE]; NSArray *images = [_model.picture componentsSeparatedByString:@","];
[self.customerHeader sd_setImageWithURL:[NSURL URLWithString:[images firstObject]] placeholderImage:REPLACEIMAGE];
self.customerName.text = _model.name; self.customerName.text = _model.name;
self.companyName.text = _model.name; self.companyName.text = _model.name;
self.customerAddress.text = _model.address; self.customerAddress.text = _model.address;
......
//
// ScannerViewController.h
// Lighting
//
// Created by 曹云霄 on 16/5/18.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "BaseViewController.h"
@interface ScannerViewController : BaseViewController
/**
* 回传扫描后的结果
*/
@property (nonatomic,copy) void(^ReturnScannerResponse)(id response);
@end
//
// ScannerViewController.m
// Lighting
//
// Created by 曹云霄 on 16/5/18.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "ScannerViewController.h"
#import <AVFoundation/AVFoundation.h>
@interface ScannerViewController ()<AVCaptureMetadataOutputObjectsDelegate>
/**
* 捕捉会话
*/
@property(strong,nonatomic) AVCaptureSession *session;
/**
* 展示layer
*/
@property(strong,nonatomic) AVCaptureVideoPreviewLayer *previewLayer;
/**
* 展示View
*/
@property (weak, nonatomic) IBOutlet UIImageView *scanRectView;
/**
*用于记录scrollLine的上下循环状态
*/
@property (assign, nonatomic) BOOL up;
/**
*计时器
*/
@property (strong, nonatomic) CADisplayLink *link;
/**
* 指示线
*/
@property (weak, nonatomic) IBOutlet UIImageView *instructionsLine;
@end
@implementation ScannerViewController
- (CADisplayLink *)link {
if (!_link) {
_link = [CADisplayLink displayLinkWithTarget:self selector:@selector(LineAnimation)];
}
return _link;
}
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
//计时器添加到循环中去
_up = YES;
[self.link addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
[self uiConfigAction];
}
#pragma mark -UI
- (void)uiConfigAction
{
// 1. 摄像头设备
AVCaptureDevice *device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
// 2. 设置输入
NSError *error = nil;
AVCaptureDeviceInput *input = [AVCaptureDeviceInput deviceInputWithDevice:device error:&error];
if (error) {
NSLog(@"没有摄像头-%@", error.localizedDescription);
[self ErrorMBProgressView:@"开启摄像头失败"];
return;
}
// 3. 设置输出(Metadata元数据)
AVCaptureMetadataOutput *output = [[AVCaptureMetadataOutput alloc] init];
// 3.1 设置输出的代理
// 说明:使用主线程队列,相应比较同步,使用其他队列,相应不同步,容易让用户产生不好的体验
[output setMetadataObjectsDelegate:self queue:dispatch_get_main_queue()];
// [output setMetadataObjectsDelegate:self queue:dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)];
// 4. 拍摄会话
AVCaptureSession *session = [[AVCaptureSession alloc] init];
// 添加session的输入和输出
[session addInput:input];
[session addOutput:output];
//使用1080p的图像输出
session.sessionPreset = AVCaptureSessionPreset1920x1080;
// 4.1 设置输出的格式
// 提示:一定要先设置会话的输出为output之后,再指定输出的元数据类型!
[output setMetadataObjectTypes:[output availableMetadataObjectTypes]];
// 5. 设置预览图层(用来让用户能够看到扫描情况)
AVCaptureVideoPreviewLayer *preview = [AVCaptureVideoPreviewLayer layerWithSession:session];
// 5.1 设置preview图层的属性
preview.videoGravity = AVLayerVideoGravityResizeAspectFill;
// 5.2 设置preview图层的大小
preview.frame = [UIScreen mainScreen].bounds;
self.previewLayer = preview;
//
// UIView *view = [[UIView alloc]initWithFrame:CGRectMake(0, 0, ScreenHeight, ScreenWidth)];
// view.transform = CGAffineTransformMakeRotation(M_PI/2);
// [view.layer insertSublayer:self.previewLayer above:0];
[self.view.layer insertSublayer:self.previewLayer atIndex:0];
//
// CGSize size = [UIScreen mainScreen].bounds.size;
// CGRect cropRect = self.scanRectView.frame;
// CGFloat p1 = size.height/size.width;
// CGFloat p2 = 1920./1080.; //使用1080p的图像输出
output.rectOfInterest = CGRectMake(self.scanRectView.frame.origin.y/ScreenHeight,((ScreenWidth-self.scanRectView.frame.size.width)/2)/ScreenWidth, self.scanRectView.frame.size.height/ScreenHeight, self.scanRectView.frame.size.width/ScreenWidth);
//
// CGFloat fixHeight = [UIScreen mainScreen].bounds.size.width * 1920. / 1080.;
// CGFloat fixPadding = (fixHeight - size.height)/2;
// output.rectOfInterest = CGRectMake((cropRect.origin.y + fixPadding)/fixHeight,
// cropRect.origin.x/size.width,
// cropRect.size.height/fixHeight,
// cropRect.size.width/size.width);
NSLog(@"%@",NSStringFromCGRect(output.rectOfInterest));
// if (p1 < p2) {
// CGFloat fixHeight = [UIScreen mainScreen].bounds.size.width * 1920. / 1080.;
// CGFloat fixPadding = (fixHeight - size.height)/2;
// output.rectOfInterest = CGRectMake((cropRect.origin.y + fixPadding)/fixHeight,
// cropRect.origin.x/size.width,
// cropRect.size.height/fixHeight,
// cropRect.size.width/size.width);
// } else {
// CGFloat fixWidth = [UIScreen mainScreen].bounds.size.height * 1080. / 1920.;
// CGFloat fixPadding = (fixWidth - size.width)/2;
// output.rectOfInterest = CGRectMake(cropRect.origin.y/size.height,
// (cropRect.origin.x + fixPadding)/fixWidth,
// cropRect.size.height/size.height,
// cropRect.size.width/fixWidth);
// }
self.session = session;
[self.session startRunning];
}
#pragma mark - delegate
- (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputMetadataObjects:(NSArray *)metadataObjects fromConnection:(AVCaptureConnection *)connection
{
if (metadataObjects.count > 0) {
AVMetadataMachineReadableCodeObject *obj = metadataObjects[0];
[self.session stopRunning];
//扫描结果
if (self.ReturnScannerResponse) {
self.ReturnScannerResponse(obj.stringValue);
}
}
}
#pragma mark - 线条运动的动画
- (void)LineAnimation {
if (_up == YES) {
CGFloat y = self.instructionsLine.frame.origin.y;
y += 2;
CGRect frame = self.instructionsLine.frame;
frame.origin.y = y;
self.instructionsLine.frame = frame;
if (y >= self.scanRectView.frame.origin.y + self.scanRectView.frame.size.height-20) {
_up = NO;
}
}else{
CGFloat y = self.instructionsLine.frame.origin.y;
y -= 2;
CGRect frame = self.instructionsLine.frame;
frame.origin.y = y;
self.instructionsLine.frame = frame;;
if (y <= self.scanRectView.frame.origin.y+20) {
_up = YES;
}
}
}
#pragma amrk -取消扫描
- (IBAction)cancelButtonClick:(UIButton *)sender {
[self.session stopRunning];
[self dismissViewControllerAnimated:YES completion:nil];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#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.
}
*/
@end
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ScannerViewController">
<connections>
<outlet property="instructionsLine" destination="Qlb-aW-bDM" id="1jD-uu-254"/>
<outlet property="scanRectView" destination="nwi-18-pl1" id="YRc-6i-tRV"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" alpha="0.5" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="700" height="528"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="将二维码、条形码放入框中即可自动扫描" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="3VO-ZE-ryq">
<rect key="frame" x="139" y="54" width="423" height="24"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ScannerViewController" id="nwi-18-pl1">
<rect key="frame" x="150" y="107" width="400" height="400"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="Max-ka-Yvf">
<rect key="frame" x="33" y="476" width="85" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<state key="normal" title="取消扫描">
<color key="titleColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="cancelButtonClick:" destination="-1" eventType="touchUpInside" id="8qh-ki-1tT"/>
</connections>
</button>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="圆角矩形-5" id="Qlb-aW-bDM">
<rect key="frame" x="175" y="130" width="350" height="10"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView>
</subviews>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<point key="canvasLocation" x="363" y="-85"/>
</view>
</objects>
<resources>
<image name="ScannerViewController" width="430" height="430"/>
<image name="圆角矩形-5" width="383" height="19"/>
</resources>
</document>
...@@ -271,10 +271,10 @@ ...@@ -271,10 +271,10 @@
} }
//是否开票 //是否开票
if ([self.ISinvoiceButton.currentTitle isEqualToString:@"是"]) { if ([self.ISinvoiceButton.currentTitle isEqualToString:@"是"]) {
order.isbill = @"001"; order.isbill = @"Y";
} }
else if ([self.ISinvoiceButton.currentTitle isEqualToString:@"否"]){ else if ([self.ISinvoiceButton.currentTitle isEqualToString:@"否"]){
order.isbill = @"002"; order.isbill = @"N";
} }
//发票类型 //发票类型
if ([self.invoiceType.currentTitle isEqualToString:@"公司发票"]) { if ([self.invoiceType.currentTitle isEqualToString:@"公司发票"]) {
......
...@@ -13,8 +13,9 @@ ...@@ -13,8 +13,9 @@
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="1qT-Vq-AnQ"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="1qT-Vq-AnQ">
<rect key="frame" x="8" y="7" width="54" height="30"/> <rect key="frame" x="8" y="7" width="54" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="1" green="0.70412693910000002" blue="0.69044467629999995" alpha="1" colorSpace="calibratedRGB"/> <state key="normal" title="完成">
<state key="normal" title="完成"/> <color key="titleColor" red="0.34901960784313724" green="0.67450980392156867" blue="0.86274509803921573" alpha="1" colorSpace="calibratedRGB"/>
</state>
</button> </button>
<pickerView contentMode="scaleToFill" id="X1a-mQ-VBj"> <pickerView contentMode="scaleToFill" id="X1a-mQ-VBj">
<rect key="frame" x="0.0" y="40" width="320" height="120"/> <rect key="frame" x="0.0" y="40" width="320" height="120"/>
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#import "UserViewController.h" #import "UserViewController.h"
#import "ChangePasswordViewController.h" #import "ChangePasswordViewController.h"
#import "SearchViewController.h" #import "SearchViewController.h"
#import "ScannerViewController.h"
#import "BaseViewController.h" #import "BaseViewController.h"
#import "QRViewController.h" #import "QRViewController.h"
......
...@@ -81,6 +81,13 @@ ...@@ -81,6 +81,13 @@
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
[Shoppersmanager manager].currentCustomer = NO;
[Customermanager manager].customerID = nil;
[Customermanager manager].customerName = nil;
[Customermanager manager].customerPhoneNumber = nil;
[Customermanager manager].companyName = nil;
[Customermanager manager].cutomerAddress = nil;
[Customermanager manager].header = nil;
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
LoginViewController *loginVC = [storyboard instantiateViewControllerWithIdentifier:@"Login"]; LoginViewController *loginVC = [storyboard instantiateViewControllerWithIdentifier:@"Login"];
[[NSUserDefaults standardUserDefaults] removeObjectForKey:USERNAME]; [[NSUserDefaults standardUserDefaults] removeObjectForKey:USERNAME];
......
...@@ -104,8 +104,6 @@ ...@@ -104,8 +104,6 @@
29BFBD981CE46FDA00C238FB /* MyclientEntityModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 29BFBD971CE46FDA00C238FB /* MyclientEntityModel.m */; }; 29BFBD981CE46FDA00C238FB /* MyclientEntityModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 29BFBD971CE46FDA00C238FB /* MyclientEntityModel.m */; };
29C584E91CDA249300C6F677 /* ProductCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29C584E81CDA249200C6F677 /* ProductCollectionViewCell.m */; }; 29C584E91CDA249300C6F677 /* ProductCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29C584E81CDA249200C6F677 /* ProductCollectionViewCell.m */; };
29C584ED1CDA429500C6F677 /* ProductDetailsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 29C584EC1CDA429500C6F677 /* ProductDetailsViewController.m */; }; 29C584ED1CDA429500C6F677 /* ProductDetailsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 29C584EC1CDA429500C6F677 /* ProductDetailsViewController.m */; };
29CB70F11CEC4607003508BF /* ScannerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 29CB70EF1CEC4607003508BF /* ScannerViewController.m */; };
29CB70F21CEC4607003508BF /* ScannerViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 29CB70F01CEC4607003508BF /* ScannerViewController.xib */; };
29D260F51CEEAE2800A9787D /* FullScreenViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 29D260F41CEEAE2800A9787D /* FullScreenViewController.m */; }; 29D260F51CEEAE2800A9787D /* FullScreenViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 29D260F41CEEAE2800A9787D /* FullScreenViewController.m */; };
29D260F81CEEAF2D00A9787D /* FullScreenViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29D260F71CEEAF2D00A9787D /* FullScreenViewCell.m */; }; 29D260F81CEEAF2D00A9787D /* FullScreenViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29D260F71CEEAF2D00A9787D /* FullScreenViewCell.m */; };
29D260FB1CEECDFF00A9787D /* goodsDetailsTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29D260FA1CEECDFF00A9787D /* goodsDetailsTableViewCell.m */; }; 29D260FB1CEECDFF00A9787D /* goodsDetailsTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29D260FA1CEECDFF00A9787D /* goodsDetailsTableViewCell.m */; };
...@@ -316,9 +314,6 @@ ...@@ -316,9 +314,6 @@
29C584E81CDA249200C6F677 /* ProductCollectionViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ProductCollectionViewCell.m; sourceTree = "<group>"; }; 29C584E81CDA249200C6F677 /* ProductCollectionViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ProductCollectionViewCell.m; sourceTree = "<group>"; };
29C584EB1CDA429500C6F677 /* ProductDetailsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProductDetailsViewController.h; sourceTree = "<group>"; }; 29C584EB1CDA429500C6F677 /* ProductDetailsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProductDetailsViewController.h; sourceTree = "<group>"; };
29C584EC1CDA429500C6F677 /* ProductDetailsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ProductDetailsViewController.m; sourceTree = "<group>"; }; 29C584EC1CDA429500C6F677 /* ProductDetailsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ProductDetailsViewController.m; sourceTree = "<group>"; };
29CB70EE1CEC4607003508BF /* ScannerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScannerViewController.h; sourceTree = "<group>"; };
29CB70EF1CEC4607003508BF /* ScannerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ScannerViewController.m; sourceTree = "<group>"; };
29CB70F01CEC4607003508BF /* ScannerViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ScannerViewController.xib; sourceTree = "<group>"; };
29D260F31CEEAE2800A9787D /* FullScreenViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FullScreenViewController.h; sourceTree = "<group>"; }; 29D260F31CEEAE2800A9787D /* FullScreenViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FullScreenViewController.h; sourceTree = "<group>"; };
29D260F41CEEAE2800A9787D /* FullScreenViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FullScreenViewController.m; sourceTree = "<group>"; }; 29D260F41CEEAE2800A9787D /* FullScreenViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FullScreenViewController.m; sourceTree = "<group>"; };
29D260F61CEEAF2D00A9787D /* FullScreenViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FullScreenViewCell.h; sourceTree = "<group>"; }; 29D260F61CEEAF2D00A9787D /* FullScreenViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FullScreenViewCell.h; sourceTree = "<group>"; };
...@@ -561,7 +556,6 @@ ...@@ -561,7 +556,6 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
29D260EF1CEEAA5000A9787D /* FullScreen */, 29D260EF1CEEAA5000A9787D /* FullScreen */,
29CF6B791CEC433900D4A778 /* ScannerVC */,
29E384C01CE9A68F00888199 /* SearchController */, 29E384C01CE9A68F00888199 /* SearchController */,
29834EC11CDF768C001A484F /* XXuserController */, 29834EC11CDF768C001A484F /* XXuserController */,
2962D06E1CD1A56B0058829D /* RIghtVC */, 2962D06E1CD1A56B0058829D /* RIghtVC */,
...@@ -1086,16 +1080,6 @@ ...@@ -1086,16 +1080,6 @@
name = view; name = view;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
29CF6B791CEC433900D4A778 /* ScannerVC */ = {
isa = PBXGroup;
children = (
29CB70EE1CEC4607003508BF /* ScannerViewController.h */,
29CB70EF1CEC4607003508BF /* ScannerViewController.m */,
29CB70F01CEC4607003508BF /* ScannerViewController.xib */,
);
name = ScannerVC;
sourceTree = "<group>";
};
29D260EF1CEEAA5000A9787D /* FullScreen */ = { 29D260EF1CEEAA5000A9787D /* FullScreen */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -1353,7 +1337,6 @@ ...@@ -1353,7 +1337,6 @@
29A938271CDAE31B00F21E54 /* ProductDetailsHeaderView.xib in Resources */, 29A938271CDAE31B00F21E54 /* ProductDetailsHeaderView.xib in Resources */,
2908870C1CE5A308000B7097 /* DateSelectedViewController.xib in Resources */, 2908870C1CE5A308000B7097 /* DateSelectedViewController.xib in Resources */,
2942F8A81CDD80CE005B377E /* authenticateView.xib in Resources */, 2942F8A81CDD80CE005B377E /* authenticateView.xib in Resources */,
29CB70F21CEC4607003508BF /* ScannerViewController.xib in Resources */,
29E384BF1CE9933300888199 /* AdditionalTableViewCell.xib in Resources */, 29E384BF1CE9933300888199 /* AdditionalTableViewCell.xib in Resources */,
29807C651CD20F0F00F111B8 /* StoryboardwithCYX.storyboard in Resources */, 29807C651CD20F0F00F111B8 /* StoryboardwithCYX.storyboard in Resources */,
29EAAE901CDC3E9700C4DBA2 /* BillingInfoView.xib in Resources */, 29EAAE901CDC3E9700C4DBA2 /* BillingInfoView.xib in Resources */,
...@@ -1521,7 +1504,6 @@ ...@@ -1521,7 +1504,6 @@
0470D6141CE2938000647F0F /* ProductLibraryView.m in Sources */, 0470D6141CE2938000647F0F /* ProductLibraryView.m in Sources */,
29F14BAB1CF6B60D0005D3E5 /* QRViewController.m in Sources */, 29F14BAB1CF6B60D0005D3E5 /* QRViewController.m in Sources */,
29D260F81CEEAF2D00A9787D /* FullScreenViewCell.m in Sources */, 29D260F81CEEAF2D00A9787D /* FullScreenViewCell.m in Sources */,
29CB70F11CEC4607003508BF /* ScannerViewController.m in Sources */,
290887061CE58BC2000B7097 /* screeningButton.m in Sources */, 290887061CE58BC2000B7097 /* screeningButton.m in Sources */,
044708611CD7C1E800555827 /* MainSetViewController.m in Sources */, 044708611CD7C1E800555827 /* MainSetViewController.m in Sources */,
29E28CE81CE0B91B00812A55 /* HENLENSONG.m in Sources */, 29E28CE81CE0B91B00812A55 /* HENLENSONG.m in Sources */,
......
...@@ -44,5 +44,9 @@ ...@@ -44,5 +44,9 @@
*/ */
@property (nonatomic,copy) NSString *cutomerAddress; @property (nonatomic,copy) NSString *cutomerAddress;
/**
* header
*/
@property (nonatomic,copy) NSString *header;
@end @end
...@@ -25,115 +25,123 @@ ...@@ -25,115 +25,123 @@
#pragma mark -UI - (BOOL)prefersStatusBarHidden
- (void)uiConfigAction
{ {
self.webView = [[UIWebView alloc] initWithFrame:self.view.bounds]; return YES;
[self.view addSubview:self.webView];
self.webView.delegate = self;
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:_pdfURLString]];
NSURL *url = [NSURL URLWithString:_pdfURLString];
if ([url pathExtension] && ([[[url pathExtension] lowercaseString] isEqualToString:@"txt"] || [[[url pathExtension] lowercaseString] isEqualToString:@"text"]))
{
// return [self convertTxtEncoding:url];
NSURLRequest *request = [NSURLRequest requestWithURL:[self convertTxtEncoding:url]];
[self.webView loadRequest:request];
}
else
{
// return url;
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:_pdfURLString]];
[self.webView loadRequest:request];
}
[self.webView loadRequest:request];
[self.webView addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(PDFClickAction)]];
} }
#pragma mark -dismiss
- (void)PDFClickAction //
//#pragma mark -UI
- (void)uiConfigAction
{ {
[self dismissViewControllerAnimated:YES completion:nil]; // self.webView = [[UIWebView alloc] initWithFrame:self.view.bounds];
// [self.view addSubview:self.webView];
// self.webView.delegate = self;
//// NSString * strUrl = [[NSString alloc]initWithContentsOfURL:[NSURL URLWithString:_pdfURLString] encoding:NSUTF8StringEncoding error:nil];
//
// NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:_pdfURLString]];
//// NSURL *url = [NSURL URLWithString:_pdfURLString];
//// if ([url pathExtension] && ([[[url pathExtension] lowercaseString] isEqualToString:@"txt"] || [[[url pathExtension] lowercaseString] isEqualToString:@"text"]))
//// {
////// return [self convertTxtEncoding:url];
//// NSURLRequest *request = [NSURLRequest requestWithURL:[self convertTxtEncoding:url]];
//// [self.webView loadRequest:request];
//// }
//// else
//// {
////// return url;
//// NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:_pdfURLString]];
//// [self.webView loadRequest:request];
//// }
// [self.webView loadRequest:request];
[self.view addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(PDFClickAction)]];
} }
#pragma mark -dismiss
- (void)PDFClickAction
#pragma mark -加载错误
- (void)webView:(UIWebView *)webView didFailLoadWithError:(nullable NSError *)error
{ {
[self ErrorMBProgressView:@"加载错误"];
[self dismissViewControllerAnimated:YES completion:nil]; [self dismissViewControllerAnimated:YES completion:nil];
} }
//
//
//#pragma mark -加载错误
- (NSURL *)convertTxtEncoding:(NSURL *)fileUrl //- (void)webView:(UIWebView *)webView didFailLoadWithError:(nullable NSError *)error
//{
{ // [self ErrorMBProgressView:@"加载错误"];
// [self dismissViewControllerAnimated:YES completion:nil];
//}
//
//
//
//- (NSURL *)convertTxtEncoding:(NSURL *)fileUrl
//
//{
////
//// if ([FileManagementAPI getFileSize:[fileUrl path]] > 1024*1024.0f)
////
//// {
////
//// return fileUrl;
////
//// }
//
// NSString *tmpFilePath = [NSString stringWithFormat:@"%@/tmp/%@", NSHomeDirectory(), [fileUrl lastPathComponent]];
//
// NSLog(@"tmpFilePath=%@", tmpFilePath);
//
// NSURL *tmpFileUrl = [NSURL fileURLWithPath:tmpFilePath];
//
// NSStringEncoding encode;
//
// NSString *contentStr = [NSString stringWithContentsOfURL:fileUrl usedEncoding:&encode error:NULL];
// //
// if ([FileManagementAPI getFileSize:[fileUrl path]] > 1024*1024.0f) //
//
// if (contentStr)
// //
// { // {
// //
// return fileUrl; // [contentStr writeToURL:tmpFileUrl atomically:YES encoding:NSUTF16StringEncoding error:NULL];
//
//
//
// return tmpFileUrl;
// //
// } // }
//
NSString *tmpFilePath = [NSString stringWithFormat:@"%@/tmp/%@", NSHomeDirectory(), [fileUrl lastPathComponent]]; // else
//
NSLog(@"tmpFilePath=%@", tmpFilePath); // {
//
NSURL *tmpFileUrl = [NSURL fileURLWithPath:tmpFilePath]; // NSStringEncoding convertEncoding = CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingGB_18030_2000);
//
NSStringEncoding encode; // contentStr = [NSString stringWithContentsOfURL:fileUrl encoding:convertEncoding error:NULL];
//
NSString *contentStr = [NSString stringWithContentsOfURL:fileUrl usedEncoding:&encode error:NULL]; //
//
// if (contentStr)
//
if (contentStr) // {
//
{ // [contentStr writeToURL:tmpFileUrl atomically:YES encoding:NSUTF16StringEncoding error:NULL];
//
[contentStr writeToURL:tmpFileUrl atomically:YES encoding:NSUTF16StringEncoding error:NULL]; //
//
// return tmpFileUrl;
//
return tmpFileUrl; // }
//
} // else
//
else // {
//
{ // return fileUrl;
//
NSStringEncoding convertEncoding = CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingGB_18030_2000); // }
//
contentStr = [NSString stringWithContentsOfURL:fileUrl encoding:convertEncoding error:NULL]; // }
//
//}
if (contentStr)
{
[contentStr writeToURL:tmpFileUrl atomically:YES encoding:NSUTF16StringEncoding error:NULL];
return tmpFileUrl;
}
else
{
return fileUrl;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment