Commit 6f6e8b62 authored by 勾芒's avatar 勾芒

debug

parent 0ec4d741
......@@ -24,7 +24,7 @@
self.isInvoiceLabe.text = _model.isBill;
self.invoiceHeader.text = _model.billTitle;
self.invoiceType.text = _model.billType;
self.invoiceType.text = _model.payType;
self.payType.text = _model.payType;
}
......
......@@ -414,7 +414,7 @@
[Customermanager manager].companyName = nil;
[Customermanager manager].cutomerAddress = nil;
[Customermanager manager].header = nil;
self.customerHeader.image = nil;
self.customerHeader.image = TCImage(@"now");
[self.changePersonInformationButton setTitle:@"更改客户信息" forState:UIControlStateNormal];
[self ChangeCustomerName];
[self QueryShoppingCarNumber];
......
......@@ -21,4 +21,13 @@
* 身份ID/判断是场景库调用还是产品库调用
*/
@property (nonatomic,assign) BOOL isProductLibrary;
/**
* 应该现在的下标
*/
@property (nonatomic,assign) NSInteger currentindex;
@end
......@@ -81,7 +81,7 @@ static NSString * const reuseIdentifier = @"Cell";
}else//场景列表调用
{
self.backView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, 64)];
self.backView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.5];
self.backView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.4];
[self.view addSubview:self.backView];
//返回按钮
UIButton *backButton = [UIButton buttonWithType:UIButtonTypeCustom];
......@@ -101,6 +101,7 @@ static NSString * const reuseIdentifier = @"Cell";
[tiYanCenterButton addTarget:self action:@selector(GotoTiYanCenterButtonClick) forControlEvents:UIControlEventTouchUpInside];
[self.backView addSubview:tiYanCenterButton];
}
[self.collectionView setContentOffset:CGPointMake(ScreenWidth*self.currentindex, 0)];
}
#pragma mark -返回
......@@ -134,7 +135,12 @@ static NSString * const reuseIdentifier = @"Cell";
FullScreenViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:reuseIdentifier forIndexPath:indexPath];
cell.backgroundColor = kTCColor(251, 248, 241);
[cell.imageView sd_setImageWithURL:[NSURL URLWithString:[self.datasArray objectAtIndex_opple:indexPath.item]] placeholderImage:REPLACEIMAGE];
if (self.isProductLibrary) {
[cell.imageView sd_setImageWithURL:[NSURL URLWithString:[self.datasArray objectAtIndex_opple:indexPath.item]] placeholderImage:REPLACEIMAGE];
return cell;
}
TOSceneEntity *model = [self.datasArray objectAtIndex_opple:indexPath.item];
[cell.imageView sd_setImageWithURL:[NSURL URLWithString:model.pricure] placeholderImage:REPLACEIMAGE];
return cell;
}
......
......@@ -184,7 +184,7 @@
} WithErrorCodeBlock:^(id errorCodeValue) {
NSLog(@"%@",errorCodeValue);
[self ErrorMBProgressView:@"网络中的"];
} WithFailureBlock:^(id error) {
......@@ -255,7 +255,6 @@
return;
}
self.identityView.layer.masksToBounds = YES;
self.identityView.layer.cornerRadius = 10;
[self.identityView.backLoginButton addTarget:self action:@selector(BackloginButtonClick) forControlEvents:UIControlEventTouchUpInside];
......
......@@ -111,7 +111,6 @@
} WithErrorCodeBlock:^(id errorCodeValue) {
} WithFailureBlock:^(id error) {
[self RemoveMBProgressHUDLoding];
......@@ -159,7 +158,6 @@
UIView *lineView = [[UIView alloc]initWithFrame:CGRectMake(0, 59, ScreenWidth, 1)];
lineView.backgroundColor = kTCColor(193, 193, 193);
[headerView addSubview:lineView];
self.orderDetailsTableview.tableHeaderView = headerView;
}
......@@ -361,7 +359,6 @@
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
UIView *view = [[UIView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, 60)];
//区头文字
......@@ -394,8 +391,8 @@
{
[self DownloadPDF:^(id returnValue) {
[self callAirprintWithdata:returnValue SuccessBlock:^{
[self SuccessMBProgressView:@"打印成功"];
[self callAirprintWithURL:[NSURL URLWithString:@"http://139.196.195.30:8090/opple-web/export/pdf/A0516052616540001.pdf"] SuccessBlock:^{
[self SuccessMBProgressView:@"打印完成"];
} ErrorBlock:^{
[self ErrorMBProgressView:@"打印失败"];
}];
......@@ -406,23 +403,26 @@
#pragma mark -下载PDF
- (void)DownloadPDF:(void(^)(id returnValue))success
{
[self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@%@",ServerAddress,@"/order/UrlOfprintPDF/",_orderCode] WithRequestType:1 WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[self RemoveMBProgressHUDLoding];
NSString *url = [NSString stringWithFormat:@"%@%@",PDFSERADDRESS,returnValue[@"data"]];
[[NetworkRequestClassManager Manager] DownloadPDFdatasWithURL:url WithReturnValueBlock:^(id returnValue) {
[self RemoveMBProgressHUDLoding];
success(returnValue);
} WithErrorCodeBlock:^(id errorCodeValue) {
} WithFailureBlock:^(id error) {
[self RemoveMBProgressHUDLoding];
}];
} WithErrorCodeBlock:^(id errorCodeValue) {
success(url);
// [[NetworkRequestClassManager Manager] DownloadPDFdatasWithURL:url WithReturnValueBlock:^(id returnValue) {
//
// [self RemoveMBProgressHUDLoding];
// success(returnValue);
//
// } WithErrorCodeBlock:^(id errorCodeValue) {
//
// } WithFailureBlock:^(id error) {
// [self RemoveMBProgressHUDLoding];
// }];
} WithErrorCodeBlock:^(id errorCodeValue) {
[self RemoveMBProgressHUDLoding];
[self ErrorMBProgressView:@"网络中断"];
} WithFailureBlock:^(id error) {
[self RemoveMBProgressHUDLoding];
}];
......@@ -437,12 +437,15 @@
__weak typeof(self) weakSelf = self;
[self DownloadPDF:^(id returnValue) {
self.PDFpath = returnValue;
QLPreviewController *previewController = [[QLPreviewController alloc] init];
previewController.dataSource = weakSelf;
// PDFViewController *viewvc = [[PDFViewController alloc]init];
// [viewvc.view addSubview:previewController.view];
[weakSelf presentViewController:previewController animated:YES completion:nil];
// self.PDFpath = returnValue;
// QLPreviewController *previewController = [[QLPreviewController alloc] init];
// previewController.dataSource = weakSelf;
// previewController.navigationController.navigationBarHidden = YES;
// [weakSelf presentViewController:previewController animated:YES completion:nil];
PDFViewController *pdfvc = [[PDFViewController alloc]init];
pdfvc.pdfURLString = returnValue;
[weakSelf presentViewController:pdfvc animated:YES completion:nil];
}];
}else if ([button.currentTitle isEqualToString:@"撤销订单"])
......@@ -452,7 +455,6 @@
[alertVC addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
[weakSelf dismissViewControllerAnimated:YES completion:nil];
}]];
[alertVC addAction:[UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDestructive handler:^(UIAlertAction * _Nonnull action)
{
[self CreateMBProgressHUDLoding];
......
......@@ -32,6 +32,11 @@
*/
@property (nonatomic,strong) NSMutableArray *imagesArray;
/**
* 点击小图的下标 默认0
*/
@property (nonatomic,assign) NSInteger imageIndex;
@end
@implementation ProductDetailsViewController
......@@ -71,6 +76,7 @@
#pragma mark -UI
- (void)uiConfigAction
{
self.imageIndex = 0;
self.productDetilsTableview.dataSource = self;
self.productDetilsTableview.delegate = self;
[self.productDetilsTableview registerNib:[UINib nibWithNibName:@"goodsDetailsTableViewCell" bundle:nil] forCellReuseIdentifier:@"goodsdetailscell"];
......@@ -151,12 +157,12 @@
//图文大图
self.goodsDetailsArray = [NSMutableArray arrayWithArray:[self.entity.detailedIntro componentsSeparatedByString:@","]];
[self.productDetilsTableview reloadData];
}
#pragma mark -小图点击手势、切换图片显示
- (void)SubimageViewClickAction:(UITapGestureRecognizer *)tap
{
self.imageIndex = tap.view.tag-100;
[self.headerView.goodsImageview sd_setImageWithURL:[self.imagesArray objectAtIndex_opple:tap.view.tag-100] placeholderImage:REPLACEIMAGE];
}
......@@ -168,11 +174,8 @@
FullScreenViewController *fullScreenVC = [[FullScreenViewController alloc]init];
fullScreenVC.datasArray = self.imagesArray;
fullScreenVC.isProductLibrary = YES;
dispatch_async(dispatch_get_main_queue(), ^{
[self presentViewController:fullScreenVC animated:YES completion:nil];
});
fullScreenVC.currentindex = self.imageIndex;
[self presentViewController:fullScreenVC animated:YES completion:nil];
}
......
......@@ -102,8 +102,6 @@
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
......
......@@ -222,7 +222,9 @@
{
FullScreenViewController *fullScreenVC = [[FullScreenViewController alloc]init];
[self presentViewController:fullScreenVC animated:NO completion:nil];
fullScreenVC.datasArray = self.responseArray;
fullScreenVC.currentindex = indexPath.row;
[self presentViewController:fullScreenVC animated:YES completion:nil];
}
......
......@@ -256,7 +256,6 @@
order.orderNumber = _orderCode;
order.fnewstate = @"002";
order.oldstate = @"001";
order.billTitle = self.invoiceHeader.text;
//支付类型
if (self.payTreasureButton.selected) {
......@@ -280,11 +279,17 @@
if ([self.invoiceType.currentTitle isEqualToString:@"公司发票"]) {
order.billType = @"001";
if (self.invoiceHeader.text.length == 0 || !self.invoiceHeader.text) {
[self ErrorMBProgressView:@"发票抬头不能为空"];
return;
}
}else if ([self.invoiceType.currentTitle isEqualToString:@"个人发票"])
{
order.billType = @"002";
}
[self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/order/payOrder"] WithRequestType:0 WithParameter:order WithReturnValueBlock:^(id returnValue) {
......
......@@ -8,7 +8,7 @@
#import "BaseViewController.h"
@interface BaseViewController ()<UIPrintInteractionControllerDelegate>
@interface BaseViewController ()<UIPrintInteractionControllerDelegate,UIWebViewDelegate>
@property (nonatomic,strong) MBProgressHUD*TCHud;
@property (nonatomic,strong) UIWebView *webView;
......@@ -242,11 +242,11 @@
// NSData *mypdfdata = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"The Swift Programming Language 中文版 - v1.2" ofType:@"pdf"]];
UIPrintInteractionController *pic = [UIPrintInteractionController sharedPrintController];
pic.delegate = self;
[self.webView loadRequest:[NSURLRequest requestWithURL:datasurl]];//网页
self.webView.delegate = self;
pic.printFormatter = [self.webView viewPrintFormatter];//布局打印视图绘制的内容。
UIPrintInfo *printInfo = [UIPrintInfo printInfo];
printInfo.outputType = UIPrintInfoOutputGeneral;
printInfo.jobName = @"订单明细";
......@@ -273,6 +273,19 @@
}
}
- (void)webViewDidStartLoad:(UIWebView *)webView
{
[self CreateMBProgressHUDLoding];
}
- (void)webViewDidFinishLoad:(UIWebView *)webView
{
[self RemoveMBProgressHUDLoding];
}
- (void)webView:(UIWebView *)webView didFailLoadWithError:(nullable NSError *)error
{
[self ErrorMBProgressView:@"打印失败"];
}
#pragma mark -提示文本,图片
- (void)PromptinformationViewWithimage:(UIImage *)image withTitle:(NSString *)title withpoint:(CGPoint)point
......
......@@ -92,7 +92,7 @@ static NetworkRequestClassManager *manager = nil;
successBlock(responseObject);
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
failureBlock(error);
}];
......
......@@ -24,124 +24,42 @@
}
- (BOOL)prefersStatusBarHidden
{
return YES;
}
//
//#pragma mark -UI
#pragma mark -UI
- (void)uiConfigAction
{
// 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.webView = [[UIWebView alloc] initWithFrame:self.view.bounds];
[self.view addSubview:self.webView];
self.webView.scalesPageToFit = YES;
self.webView.delegate = self;
// NSString *path = [[NSBundle mainBundle] pathForResource:@"A0516052613060001" ofType:@"pdf"];
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:_pdfURLString]];
[self.webView loadRequest:request];
[self.view addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(PDFClickAction)]];
}
#pragma mark -dismiss
- (void)PDFClickAction
{
[self dismissViewControllerAnimated:YES completion:nil];
}
//
//
//#pragma mark -加载错误
//- (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 (contentStr)
//
// {
//
// [contentStr writeToURL:tmpFileUrl atomically:YES encoding:NSUTF16StringEncoding error:NULL];
//
//
//
// return tmpFileUrl;
//
// }
//
// else
//
// {
//
// 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;
//
// }
//
// }
//
//}
#pragma mark -加载错误
- (void)webView:(UIWebView *)webView didFailLoadWithError:(nullable NSError *)error
{
[self ErrorMBProgressView:@"加载错误"];
[self dismissViewControllerAnimated:YES completion:nil];
}
- (void)webViewDidStartLoad:(UIWebView *)webView
{
[self CreateMBProgressHUDLoding];
}
- (void)webViewDidFinishLoad:(UIWebView *)webView
{
[self RemoveMBProgressHUDLoding];
}
......
......@@ -285,7 +285,7 @@
- (void)LineAnimation {
if (_up == YES) {
CGFloat y = self.instructionsLine.frame.origin.y;
y += 3;
y += 4;
CGRect frame = self.instructionsLine.frame;
frame.origin.y = y;
self.instructionsLine.frame = frame;
......@@ -294,7 +294,7 @@
}
}else{
CGFloat y = self.instructionsLine.frame.origin.y;
y -= 3;
y -= 4;
CGRect frame = self.instructionsLine.frame;
frame.origin.y = y;
self.instructionsLine.frame = frame;;
......
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