Commit 643e52cf authored by 勾芒's avatar 勾芒

caoyunxiao

parent 1113c993
......@@ -21,6 +21,13 @@
- (void)setModel:(ShopcarModel *)model
{
_model = model;
[self.goodsImageview sd_setImageWithURL:[NSURL URLWithString:_model.goods.pictures] placeholderImage:REPLACEIMAGE];
self.goodsName.text = _model.goods.name;
self.goodsCraneQuotation.text = [_model.goods.tagPrice stringValue];
self.goodsSpecifications.text = _model.goods.spec;
self.goodsNumber.text = _model.goods.number;
self.goodsPrice.text = [_model.goods.costPrice stringValue];
}
......
......@@ -69,6 +69,8 @@
// Do any additional setup after loading the view.
[self uiConfigAction];
[self getShoppingCardata];
[self getGuideAllcustomerOrder];
}
......@@ -78,6 +80,7 @@
self.ClientdetailsTableview.delegate = self;
self.ClientdetailsTableview.dataSource = self;
self.ClientdetailsTableview.tableFooterView = [UIView new];
//圆角
self.shoppingAndRecordBackview.layer.masksToBounds = YES;
......@@ -109,13 +112,14 @@
ClientDetailsTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ClientDetails" forIndexPath:indexPath];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.model = [self.orderRecordArray objectAtIndex_opple:indexPath.row];
cell.model = [self.shopResponseArray objectAtIndex_opple:indexPath.row];
return cell;
}else if (self.orderRecordButton.selected)
{
OrderTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ordercell" forIndexPath:indexPath];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.model = [self.orderRecordArray objectAtIndex_opple:indexPath.row];
return cell;
}
return nil;
......@@ -153,9 +157,17 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"StoryboardwithCYX" bundle:nil];
OrderdetailsViewController *orderdetails = [storyboard instantiateViewControllerWithIdentifier:@"orderdetails"];
[self.navigationController pushViewController:orderdetails animated:YES];
if (self.shoppingBagButton.selected) {
return;
}else if (self.orderRecordButton.selected)
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"StoryboardwithCYX" bundle:nil];
OrderdetailsViewController *orderdetails = [storyboard instantiateViewControllerWithIdentifier:@"orderdetails"];
orderdetails.orderCode = [[[self.orderRecordArray objectAtIndex_opple:indexPath.row] order] orderNumber];
[self.navigationController pushViewController:orderdetails animated:YES];
}
}
......@@ -163,9 +175,8 @@
#pragma mark -获取购物车商品
- (void)getShoppingCardata
{
ShopCartFilter *shopcarNumber = [[ShopCartFilter alloc]init];
shopcarNumber.consumerId = [Customermanager manager].customerID;
shopcarNumber.consumerId = _model.fid;
DataPage *Newpage = [[DataPage alloc]init];
Newpage.page = 0;
shopcarNumber.dp = Newpage;
......@@ -194,7 +205,6 @@
[self.shopResponseArray addObject:model];
}
[self.ClientdetailsTableview reloadData];
}else
......@@ -212,6 +222,47 @@
#pragma mark -获取客户订单数据
- (void)getGuideAllcustomerOrder
{
OrderBill *allOrder = [[OrderBill alloc]init];
//分页
DataPage *page = [[DataPage alloc]init];
page.page = 0;
page.rows = 10;
//订单
TOOrderEntity *Neworder = [[TOOrderEntity alloc]init];
Neworder.guideId = [Shoppersmanager manager].Shoppers.employee.fid;
allOrder.datapage = page;
allOrder.order = Neworder;
[self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/order/query"] WithRequestType:0 WithParameter:allOrder WithReturnValueBlock:^(id returnValue) {
[self RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
OrderResponse *Allorder = [[OrderResponse alloc]initWithDictionary:returnValue[@"data"] error:nil];
for (OrderBill *model in Allorder.orderBillList) {
[self.orderRecordArray addObject:model];
}
[self.ClientdetailsTableview reloadData];
}else
{
[self ErrorMBProgressView:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
} WithFailureBlock:^(id error) {
[self RemoveMBProgressHUDLoding];
}];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
......
......@@ -8,6 +8,26 @@
#import <UIKit/UIKit.h>
/**
* 撤销订单
*/
@protocol undoOrderDelegate <NSObject>
@optional
/**
* 撤销订单
*
* @param cellindex cell下标
*/
- (void)undoOrderButtonClick:(NSInteger)cellindex;
@end
@interface CustomerOrderTableViewCell : UITableViewCell
......@@ -82,7 +102,7 @@
/**
* 客户地址
* 收货地址
*/
@property (weak, nonatomic) IBOutlet UILabel *consigneeAddress;
......@@ -97,10 +117,40 @@
@property (weak, nonatomic) IBOutlet UIView *cellBackView;
/**
* 订单详情model
*/
@property (nonatomic,strong) OrderBill *model;
/**
* 撤销订单
*/
@property (weak, nonatomic) IBOutlet UIButton *delecteOrder;
/**
* 收货人电话title
*/
@property (weak, nonatomic) IBOutlet UILabel *consigneeNumber;
/**
* 订单总计title
*/
@property (weak, nonatomic) IBOutlet UILabel *orderAll;
/**
* 撤销订单代理
*/
@property (nonatomic,assign) id<undoOrderDelegate>delegate;
/**
* 传入cell下标
*/
@property (nonatomic,assign) NSInteger cellIndex;
@end
......@@ -13,8 +13,74 @@
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
[self uiConfigAction];
}
#pragma mark -UI
- (void)uiConfigAction
{
self.delecteOrder.layer.masksToBounds = YES;
self.delecteOrder.layer.cornerRadius = kCornerRadius;
self.cellBackView.layer.masksToBounds = YES;
self.cellBackView.layer.cornerRadius = kCornerRadius;
[self.consigneeNumber mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.orderAll.mas_left).offset(13);
make.top.equalTo(self.orderAll.mas_bottom).offset(10);
}];
}
#pragma mark -赋值
- (void)setModel:(OrderBill *)model
{
_model = model;
self.orderDate.text = [self dateAsString:_model.order.orderTime];
self.orderSerialNumber.text = _model.order.orderNumber;
self.shoppersName.text = _model.employee.userName;
self.customerName.text = _model.consumer.name;
[self.customerHeader sd_setImageWithURL:[NSURL URLWithString:_model.consumer.picture] placeholderImage:ReplaceImage];
self.orderStatus.text = _model.order.orderState;
self.styleNumber.text = _model.order.goodsNum;
self.consigneeName.text = _model.order.receiverName;
self.consigneePhoneNumber.text = _model.order.receiverMobile;
self.phoneNumber.text = _model.consumer.mobile;
self.consigneeAddress.text = _model.order.receiverAddress;
NSInteger goodsAllprice = 0;
for (TOOrderdetailEntity *goodslist in _model.orderdetailList) {
goodsAllprice += [goodslist.goodsTotalPrice integerValue];
}
self.orderTotalPrice.text = [NSString stringWithFormat:@"%ld",goodsAllprice];
}
#pragma mark -时间转换NSDate转NSString
- (NSString*)dateAsString:(NSDate*)date {
NSDateFormatter *formatter=[[NSDateFormatter alloc] init];
[formatter setDateFormat:@"yyyy-MM-dd"];
NSString * timeString = [formatter stringFromDate:date];
return timeString;
}
#pragma mark -撤销订单
- (IBAction)delecteOrderButtonClick:(UIButton *)sender {
if ([self.delegate respondsToSelector:@selector(undoOrderButtonClick:)]) {
[self.delegate undoOrderButtonClick:_cellIndex];
}
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
......
......@@ -113,6 +113,7 @@
[self.drawerController setCloseDrawerGestureModeMask:MMCloseDrawerGestureModeAll];
SHARED_APPDELEGATE.mmdrawer = self.drawerController;
SHARED_APPDELEGATE.window.rootViewController = self.drawerController;
SHARED_APPDELEGATE.Mytabbar = self.customtabbar;
}
......
......@@ -10,4 +10,78 @@
@interface OrderTableViewCell : UITableViewCell
/**
* 下单时间
*/
@property (weak, nonatomic) IBOutlet UILabel *orderTime;
/**
* 订单状态
*/
@property (weak, nonatomic) IBOutlet UILabel *orderState;
/**
* 客户名称
*/
@property (weak, nonatomic) IBOutlet UILabel *customerName;
/**
* 购买数量
*/
@property (weak, nonatomic) IBOutlet UILabel *goodsNumber;
/**
* 收货人名字
*/
@property (weak, nonatomic) IBOutlet UILabel *consigneeName;
/**
* 收货人电话
*/
@property (weak, nonatomic) IBOutlet UILabel *consigneePhoneNumber;
/**
* 订单编号
*/
@property (weak, nonatomic) IBOutlet UILabel *orderSerialNumber;
/**
* 服务导购
*/
@property (weak, nonatomic) IBOutlet UILabel *shopperName;
/**
* 联系电话
*/
@property (weak, nonatomic) IBOutlet UILabel *phoneNumber;
/**
* 订单总计
*/
@property (weak, nonatomic) IBOutlet UILabel *orderAllprice;
/**
* 客户地址
*/
@property (weak, nonatomic) IBOutlet UILabel *customerAddress;
/**
* 客户订单记录数据源
*/
@property (nonatomic,strong) OrderBill *model;
@end
......@@ -15,6 +15,59 @@
// Initialization code
}
#pragma mark -UI
- (void)setModel:(OrderBill *)model
{
_model = model;
self.orderTime.text = [self dateAsString:_model.order.orderTime];
self.orderState.text = _model.order.orderState;
self.customerName.text = _model.consumer.name;
//总数量
NSInteger Number = 0;
for (TOOrderdetailEntity *objc in _model.orderdetailList) {
Number += [objc.goodsNum integerValue];
}
self.goodsNumber.text = [NSString stringWithFormat:@"%ld",Number];
self.consigneeName.text = _model.order.receiverName;
self.consigneePhoneNumber.text = _model.order.receiverMobile;
self.orderSerialNumber.text = _model.order.orderNumber;
self.shopperName.text = _model.employee.userName;
self.phoneNumber.text = _model.consumer.mobile;
//价格
NSInteger allprice = 0;
for (TOOrderdetailEntity *objc in _model.orderdetailList) {
allprice += [objc.goodsPrice integerValue];
}
self.orderAllprice.text = [NSString stringWithFormat:@"%ld",allprice];
self.customerAddress.text = _model.consumer.address;
}
#pragma mark -时间转换NSDate转NSString
- (NSString*)dateAsString:(NSDate*)date {
NSDateFormatter *formatter=[[NSDateFormatter alloc] init];
[formatter setDateFormat:@"yyyy-MM-dd"];
NSString * timeString = [formatter stringFromDate:date];
return timeString;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
......
......@@ -364,7 +364,7 @@
{
[self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:@"%@%@%@",ServerAddress,@"/order/UrlOfprintPDF/",@"A0716051715560001"] 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"]];
self.PDFpath = url;
......@@ -394,6 +394,7 @@
PDFViewController *pdfVc = [[PDFViewController alloc]init];
pdfVc.pdfURLString = self.PDFpath;
[self presentViewController:pdfVc animated:YES completion:nil];
}];
}
......
......@@ -105,10 +105,11 @@
if (response.goodsEntity.count == 0) {
[self ErrorMBProgressView:@"暂无数据"];
return ;
}else
{
weakSelf.datasArray = response;
[weakSelf.productCollectionView reloadData];
}
weakSelf.datasArray = response;
[weakSelf.productCollectionView reloadData];
}];
}
......@@ -130,10 +131,12 @@
if (response.goodsEntity.count == 0) {
[self ErrorMBProgressView:@"暂无数据"];
return ;
}else
{
weakSelf.datasArray = response;
[weakSelf.productCollectionView reloadData];
}
weakSelf.datasArray = response;
[weakSelf.productCollectionView reloadData];
}];
}
......@@ -183,7 +186,7 @@
}
else
{
[self ErrorMBProgressView:returnValue[@"message"]];
[self ErrorMBProgressView:@"暂无数据"];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
......@@ -219,7 +222,8 @@
#pragma mark -返回根视图
- (void)popTorootviewController:(NSNotification *)not
{
[self.navigationController popToViewController:[self.navigationController.viewControllers objectAtIndex_opple:1] animated:NO];
[self.navigationController popToViewController:[self.navigationController.viewControllers firstObject] animated:NO];
}
......@@ -521,11 +525,11 @@
}
#pragma mark -释放
- (void)dealloc
{
[[NSNotificationCenter defaultCenter]removeObserver:self];
}
//#pragma mark -释放
//- (void)dealloc
//{
// [[NSNotificationCenter defaultCenter]removeObserver:self];
//}
......
//
// 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;
@end
@implementation ScannerViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
[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 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="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" 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="101" 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>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<point key="canvasLocation" x="363" y="-85"/>
</view>
</objects>
<resources>
<image name="ScannerViewController" width="430" height="430"/>
</resources>
</document>
......@@ -42,6 +42,10 @@
self.invoiceType.layer.cornerRadius = kCornerRadius;
self.invoiceBackView.layer.masksToBounds = YES;
self.invoiceBackView.layer.cornerRadius = kCornerRadius;
self.cancelButton.layer.masksToBounds = YES;
self.cancelButton.layer.cornerRadius = kCornerRadius;
self.sureButton.layer.masksToBounds = YES;
self.sureButton.layer.cornerRadius = kCornerRadius;
}
......@@ -93,6 +97,33 @@
[self ShowPopoverViewController:CGSizeMake(100, 200) Withdatas:arr ShowButton:sender SelectedIndex:0 GetTitle:YES];
}
#pragma mark -微信支付
- (IBAction)WechatButtonClick:(UIButton *)sender {
sender.selected = !sender.selected;
if (sender.selected) {
self.payTreasureButton.selected = NO;
[self.payTypeButton setTitle:@"现金、支票、转账" forState:UIControlStateNormal];
}
}
#pragma mark -支付宝支付
- (IBAction)ZhifubaoPayButtonClick:(UIButton *)sender {
sender.selected = !sender.selected;
if (sender.selected) {
self.WeixiPayButton.selected = NO;
[self.payTypeButton setTitle:@"现金、支票、转账" forState:UIControlStateNormal];
}
}
#pragma mark -是否开票
- (IBAction)isinvoiceButtonClick:(UIButton *)sender {
......@@ -164,9 +195,6 @@
#pragma mark -确认支付请求
- (void)SurePayRequest
{
......
......@@ -39,7 +39,7 @@
<rect key="frame" x="83" y="59" width="160" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" textAlignment="natural" minimumFontSize="17" id="kfb-PC-RSU">
<textField opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" textAlignment="natural" minimumFontSize="17" id="kfb-PC-RSU">
<rect key="frame" x="10" y="1" width="150" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
......@@ -74,7 +74,7 @@
<rect key="frame" x="83" y="98" width="160" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" textAlignment="natural" minimumFontSize="17" id="Wku-Nz-Jvr">
<textField opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" textAlignment="natural" minimumFontSize="17" id="Wku-Nz-Jvr">
<rect key="frame" x="10" y="0.0" width="150" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
......@@ -91,23 +91,29 @@
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="pfa-IW-8J9">
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="pfa-IW-8J9">
<rect key="frame" x="83" y="180" width="160" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.93333333330000001" green="0.93333333330000001" blue="0.93333333330000001" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<state key="normal" title="微信支付">
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<state key="normal" backgroundImage="wechat1">
<color key="titleColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="selected" backgroundImage="圆角矩形-2-副本-2"/>
<connections>
<action selector="WechatButtonClick:" destination="-1" eventType="touchUpInside" id="woS-KH-v7d"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="u1Q-iA-oUv">
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="u1Q-iA-oUv">
<rect key="frame" x="83" y="219" width="160" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.93333333330000001" green="0.93333333330000001" blue="0.93333333330000001" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<state key="normal" title="支付宝支付">
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<state key="normal" backgroundImage="图层-1">
<color key="titleColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
</state>
<state key="selected" backgroundImage="图层-3"/>
<connections>
<action selector="ZhifubaoPayButtonClick:" destination="-1" eventType="touchUpInside" id="KqV-tt-tEq"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="发票抬头:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="58b-Vg-zBQ">
<rect key="frame" x="25" y="376" width="58" height="21"/>
......@@ -223,5 +229,9 @@
<resources>
<image name="05产品库-详情_03" width="500" height="375"/>
<image name="down_arr" width="22" height="12"/>
<image name="wechat1" width="175" height="30"/>
<image name="图层-1" width="175" height="30"/>
<image name="图层-3" width="175" height="30"/>
<image name="圆角矩形-2-副本-2" width="175" height="30"/>
</resources>
</document>
......@@ -365,6 +365,7 @@
order.order = orderReceiver;
orderReceiver.guideId = [[Shoppersmanager manager] Shoppers].employee.fid;
orderReceiver.consumerId = [[Customermanager manager] customerID];
orderReceiver.orderState = @"001";
//商品ID
NSArray *goodArray = [self.datasArray lastObject];
NSMutableArray *goodidArr = [NSMutableArray array];
......@@ -380,6 +381,7 @@
orderGoods.goodsNum = model.goods.number;
orderGoods.goodsPrice = model.goods.costPrice;
orderGoods.remark = @" ";
//总价
NSInteger allprice = [model.goods.number integerValue]*[model.goods.costPrice integerValue];
orderGoods.goodsTotalPrice = [NSNumber numberWithInteger:allprice];
......
......@@ -10,4 +10,11 @@
@interface CustomTabbarController : UITabBarController
@end
......@@ -20,7 +20,7 @@
#import "UserViewController.h"
#import "ChangePasswordViewController.h"
#import "SearchViewController.h"
#import "ScannerViewController.h"
@interface CustomTabbarController ()<TabbarButtonClickdelegate,ChangpasswordDelegate,CancelButtondelegate,UITextFieldDelegate>
......@@ -71,7 +71,7 @@
toolview.delegate = self;
toolview.inputField.delegate = self;
[self.tabBar addSubview:toolview];
SHARED_APPDELEGATE.tabbar = self.tabBar;
// SHARED_APPDELEGATE.Mytabbar = self.tabBar;
}
......@@ -214,21 +214,27 @@
- (void)QrcodeButtonClick
{
NSLog(@"二维码扫描");
ScannerViewController *scannerVC = [[ScannerViewController alloc]init];
[scannerVC setReturnScannerResponse:^(id value) {
[self dismissViewControllerAnimated:YES completion:nil];
//调用商品控制器
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"StoryboardwithCYX" bundle:nil];
ProductLibraryViewController *productVC = [storyboard instantiateViewControllerWithIdentifier:@"productlibrary"];
productVC.selectedCode = value;
[self.navigationController pushViewController:productVC animated:YES];
}];
[self presentViewController:scannerVC animated:YES completion:nil];
}
#pragma mark -搜索框代理方法
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField
{
if (textField.text.length != 0) {
//返回根视图
[[NSNotificationCenter defaultCenter] postNotificationName:POPROOTCONTROLLER object:nil];
}else
{
self.selectedIndex = 9;
}
[[NSNotificationCenter defaultCenter] postNotificationName:POPROOTCONTROLLER object:nil];
self.selectedIndex = 9;
return YES;
}
......@@ -239,11 +245,9 @@
{
//搜索
if (textField.text != nil) {
if (textField.text.length != 0) {
[textField resignFirstResponder];
// self.selectedIndex = 4;
//搜索
[[NSNotificationCenter defaultCenter] postNotificationName:SEARCHSTRING object:textField.text];
}
......
......@@ -95,6 +95,8 @@
29BFBD981CE46FDA00C238FB /* MyclientEntityModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 29BFBD971CE46FDA00C238FB /* MyclientEntityModel.m */; };
29C584E91CDA249300C6F677 /* ProductCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29C584E81CDA249200C6F677 /* ProductCollectionViewCell.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 */; };
29E28CE81CE0B91B00812A55 /* HENLENSONG.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E28CE71CE0B91B00812A55 /* HENLENSONG.m */; };
29E384BE1CE9933300888199 /* AdditionalTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E384BC1CE9933300888199 /* AdditionalTableViewCell.m */; };
29E384BF1CE9933300888199 /* AdditionalTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 29E384BD1CE9933300888199 /* AdditionalTableViewCell.xib */; };
......@@ -280,6 +282,9 @@
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>"; };
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>"; };
29E28CE61CE0B91B00812A55 /* HENLENSONG.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HENLENSONG.h; sourceTree = "<group>"; };
29E28CE71CE0B91B00812A55 /* HENLENSONG.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HENLENSONG.m; sourceTree = "<group>"; };
29E384BB1CE9933300888199 /* AdditionalTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AdditionalTableViewCell.h; sourceTree = "<group>"; };
......@@ -476,6 +481,7 @@
2928F7DD1CD085430036D761 /* Class */ = {
isa = PBXGroup;
children = (
29CF6B791CEC433900D4A778 /* ScannerVC */,
29E384C01CE9A68F00888199 /* SearchController */,
29834EC11CDF768C001A484F /* XXuserController */,
2962D06E1CD1A56B0058829D /* RIghtVC */,
......@@ -985,6 +991,16 @@
name = view;
sourceTree = "<group>";
};
29CF6B791CEC433900D4A778 /* ScannerVC */ = {
isa = PBXGroup;
children = (
29CB70EE1CEC4607003508BF /* ScannerViewController.h */,
29CB70EF1CEC4607003508BF /* ScannerViewController.m */,
29CB70F01CEC4607003508BF /* ScannerViewController.xib */,
);
name = ScannerVC;
sourceTree = "<group>";
};
29E28CE51CE0B90600812A55 /* Regularexpressions */ = {
isa = PBXGroup;
children = (
......@@ -1215,6 +1231,7 @@
29A938271CDAE31B00F21E54 /* ProductDetailsHeaderView.xib in Resources */,
2908870C1CE5A308000B7097 /* DateSelectedViewController.xib in Resources */,
2942F8A81CDD80CE005B377E /* authenticateView.xib in Resources */,
29CB70F21CEC4607003508BF /* ScannerViewController.xib in Resources */,
29E384BF1CE9933300888199 /* AdditionalTableViewCell.xib in Resources */,
29807C651CD20F0F00F111B8 /* StoryboardwithCYX.storyboard in Resources */,
29EAAE901CDC3E9700C4DBA2 /* BillingInfoView.xib in Resources */,
......@@ -1368,6 +1385,7 @@
29A9DCAE1CEB643C00A7567A /* PDFViewController.m in Sources */,
29EAAE8E1CDC3E8E00C4DBA2 /* BillingInfoView.m in Sources */,
0470D6141CE2938000647F0F /* ProductLibraryView.m in Sources */,
29CB70F11CEC4607003508BF /* ScannerViewController.m in Sources */,
290887061CE58BC2000B7097 /* screeningButton.m in Sources */,
044708611CD7C1E800555827 /* MainSetViewController.m in Sources */,
29E28CE81CE0B91B00812A55 /* HENLENSONG.m in Sources */,
......@@ -1498,7 +1516,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "Brand Assets";
CLANG_ENABLE_OBJC_WEAK = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_IDENTITY = "iPhone Developer: 云霄 曹 (WM8ZU7YY98)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: 云霄 曹 (WM8ZU7YY98)";
COMPRESS_PNG_FILES = NO;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
......@@ -1537,7 +1555,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.gomore.opple;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "e9bd3600-5e9c-4cd0-a0d5-b7d8b0882ca8";
PROVISIONING_PROFILE = "f89bebf5-81e2-4c61-9052-8c7bb0f9ddd6";
STRIP_PNG_TEXT = NO;
USER_HEADER_SEARCH_PATHS = "$(PODS_ROOT)/**";
};
......@@ -1550,8 +1568,8 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "Brand Assets";
CLANG_ENABLE_OBJC_WEAK = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: 云霄 曹 (WM8ZU7YY98)";
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
COMPRESS_PNG_FILES = NO;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "$(SRCROOT)/Tools/PrefixHeader.pch";
......@@ -1589,7 +1607,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.gomore.opple;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "e9bd3600-5e9c-4cd0-a0d5-b7d8b0882ca8";
PROVISIONING_PROFILE = "f89bebf5-81e2-4c61-9052-8c7bb0f9ddd6";
STRIP_PNG_TEXT = NO;
USER_HEADER_SEARCH_PATHS = "$(PODS_ROOT)/**";
};
......
......@@ -34,7 +34,7 @@
/**
* tabbar控制器
*/
@property (nonatomic,strong) UITabBar *tabbar;
@property (nonatomic,strong) UITabBarController *Mytabbar;
- (void)saveContext;
- (NSURL *)applicationDocumentsDirectory;
......
{
"images" : [
{
"idiom" : "universal",
"filename" : "ScannerViewController.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ScannerViewController@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "wechat1.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "wechat1@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "图层-1.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "图层-1@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "图层-3.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "图层-3@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "圆角矩形-2-副本-2.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "圆角矩形-2-副本-2@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "圆角矩形-5.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "圆角矩形-5@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
......@@ -8,7 +8,7 @@
#import "PDFViewController.h"
@interface PDFViewController ()
@interface PDFViewController ()<UIWebViewDelegate>
@property (nonatomic,strong) UIWebView *webView;
......@@ -23,14 +23,38 @@
[self uiConfigAction];
}
#pragma mark -UI
- (void)uiConfigAction
{
self.webView = [[UIWebView alloc] initWithFrame:self.view.bounds];
[self.view addSubview:self.webView];
self.webView.delegate = self;
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:_pdfURLString]];
[self.webView loadRequest:request];
[self.webView 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];
}
@end
......@@ -26,6 +26,7 @@
#import "Shoppersmanager.h"
#import "UIImageView+WebCache.h"
#import "Customermanager.h"
#import "AppDelegate.h"
// Include any system framework and library headers here that should be included in all compilation units.
// You will also need to set the Prefix Header build setting of one or more of your targets to reference this file.
......
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