Commit c2da9865 authored by lujunye's avatar lujunye

1231232323

parent b1c7310b
...@@ -26,10 +26,15 @@ ...@@ -26,10 +26,15 @@
#import "JZLocationConverter.h" #import "JZLocationConverter.h"
#import "HLBLEManager.h"
#import "SVProgressHUD.h" #import "SVProgressHUD.h"
#import "BtViewController.h" #import "BtViewController.h"
#import "HLPrinter.h"
#import "WKWebView+UIImage.h" #import "WKWebView+UIImage.h"
#import "BLEConnecter.h"
#import "EthernetConnecter.h"
#import "Connecter.h"
#import "ConnecterManager.h"
#import "TscCommand.h"
#endif /* Bridge_Header_h */ #endif /* Bridge_Header_h */
...@@ -27,10 +27,10 @@ let systemVersion = (UIDevice.current.systemVersion as String) ...@@ -27,10 +27,10 @@ let systemVersion = (UIDevice.current.systemVersion as String)
//接口地址 //接口地址
//test //test
let SERVERCE_ImageHost = "https://z.gelifood.com/" //let SERVERCE_ImageHost = "https://z.gelifood.com/"
let SERVERCE_HOST = "https://z.gelifood.com/admin/" //let SERVERCE_HOST = "https://z.gelifood.com/admin/"
//let SERVERCE_ImageHost = "https://zx.gelifood.com/" let SERVERCE_ImageHost = "https://zx.gelifood.com/"
//let SERVERCE_HOST = "https://zx.gelifood.com/admin/" let SERVERCE_HOST = "https://zx.gelifood.com/admin/"
//online //online
//视图常量 //视图常量
......
...@@ -81,6 +81,7 @@ ...@@ -81,6 +81,7 @@
<true/> <true/>
<key>UIBackgroundModes</key> <key>UIBackgroundModes</key>
<array> <array>
<string>bluetooth-central</string>
<string>fetch</string> <string>fetch</string>
<string>remote-notification</string> <string>remote-notification</string>
</array> </array>
......
...@@ -346,6 +346,7 @@ class addPinPinOrder_model: Mappable { ...@@ -346,6 +346,7 @@ class addPinPinOrder_model: Mappable {
class addPinPinOrderData_model: Mappable { class addPinPinOrderData_model: Mappable {
var id:String? var id:String?
var wb_no : String? var wb_no : String?
var lwb_no :String?
required init?( map: Map) { required init?( map: Map) {
...@@ -353,6 +354,7 @@ class addPinPinOrderData_model: Mappable { ...@@ -353,6 +354,7 @@ class addPinPinOrderData_model: Mappable {
func mapping(map: Map) { func mapping(map: Map) {
id <- map["id"] id <- map["id"]
wb_no <- map["wb_no"] wb_no <- map["wb_no"]
lwb_no <- map["lwb_no"]
} }
} }
//MARK: - 拼拼货计算价格 //MARK: - 拼拼货计算价格
......
//
// ConnecterManager.h
// GSDK
//
// Created by 猿史森林 on 2018/6/21.
// Copyright © 2018年 Smarnet. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "BLEConnecter.h"
#import "EthernetConnecter.h"
#import "Connecter.h"
/**
* @enum ConnectMethod
* @discussion 连接方式
* @constant BLUETOOTH 蓝牙连接
* @constant ETHERNET 网口连接(wifi连接)
*/
typedef enum : NSUInteger{
BLUETOOTH,
ETHERNET
}ConnectMethod;
#define Manager [ConnecterManager sharedInstance]
@interface ConnecterManager : NSObject
@property(nonatomic,strong)BLEConnecter *bleConnecter;
@property(nonatomic,strong)EthernetConnecter *ethernetConnecter;
@property(nonatomic,strong)Connecter *connecter;
+(instancetype)sharedInstance;
/**
* 方法说明:连接指定ip和端口号的网络设备
* @param ip 设备的ip地址
* @param port 设备端口号
* @param connectState 连接状态
* @param callback 读取数据接口
*/
-(void)connectIP:(NSString *)ip port:(int)port connectState:(void (^)(ConnectState state))connectState callback:(void (^)(NSData *))callback;
-(void)closePeripheral:(CBPeripheral *)peripheral;
/**
* 方法说明:关闭连接
*/
-(void)close;
/**
* 方法说明: 向输出流中写入数据(只适用于蓝牙)
* @param data 需要写入的数据
* @param progress 写入数据进度
* @param callBack 读取输入流中的数据
*/
-(void)write:(NSData *_Nullable)data progress:(void(^_Nullable)(NSUInteger total,NSUInteger progress))progress receCallBack:(void (^_Nullable)(NSData *_Nullable))callBack;
/**
* 方法说明:向输出流中写入数据
* @param callBack 读取数据接口
*/
-(void)write:(NSData *)data receCallBack:(void (^)(NSData *))callBack;
/**
* 方法说明:向输出流中写入数据
* @param data 需要写入的数据
*/
-(void)write:(NSData *)data;
/**
* 方法说明:停止扫描
*/
-(void)stopScan;
/**
* 方法说明:更新蓝牙状态
* @param state 蓝牙状态
*/
-(void)didUpdateState:(void(^)(NSInteger state))state;
/**
* 方法说明:连接外设
* @param peripheral 需连接的外设
* @param options 其它可选操作
* @param timeout 连接时间
* @param connectState 连接状态
*/
-(void)connectPeripheral:(CBPeripheral *)peripheral options:(nullable NSDictionary<NSString *,id> *)options timeout:(NSUInteger)timeout connectBlack:(void(^_Nullable)(ConnectState state)) connectState;
/**
* 方法说明:连接外设
* @param peripheral 需连接的外设
* @param options 其它可选操作
*/
-(void)connectPeripheral:(CBPeripheral * _Nullable)peripheral options:(nullable NSDictionary<NSString *,id> *)options;
/**
* 方法说明:扫描外设
* @param serviceUUIDs 需要发现外设的UUID,设置为nil则发现周围所有外设
* @param options 其它可选操作
* @param discover 发现的设备
*/
-(void)scanForPeripheralsWithServices:(nullable NSArray<CBUUID *> *)serviceUUIDs options:(nullable NSDictionary<NSString *, id> *)options discover:(void(^_Nullable)(CBPeripheral *_Nullable peripheral,NSDictionary<NSString *, id> *_Nullable advertisementData,NSNumber *_Nullable RSSI))discover;
@end
//
// ConnecterManager.m
// GSDK
//
// Created by 猿史森林 on 2018/6/21.
// Copyright © 2018年 Smarnet. All rights reserved.
//
#import "ConnecterManager.h"
@interface ConnecterManager(){
ConnectMethod currentConnMethod;
}
@end
@implementation ConnecterManager
static ConnecterManager *manager;
static dispatch_once_t once;
+(instancetype)sharedInstance {
dispatch_once(&once, ^{
manager = [[ConnecterManager alloc]init];
});
return manager;
}
/**
* 方法说明:连接指定ip和端口号的网络设备
* @param ip 设备的ip地址
* @param port 设备端口号
* @param connectState 连接状态
* @param callback 读取数据接口
*/
-(void)connectIP:(NSString *)ip port:(int)port connectState:(void (^)(ConnectState state))connectState callback:(void (^)(NSData *))callback {
dispatch_async(dispatch_get_global_queue(0, 0), ^{
if (_ethernetConnecter == nil) {
currentConnMethod = ETHERNET;
[self initConnecter:currentConnMethod];
}
[_ethernetConnecter connectIP:ip port:port connectState:connectState callback:callback];
});
}
/**
* 方法说明:扫描外设
* @param serviceUUIDs 需要发现外设的UUID,设置为nil则发现周围所有外设
* @param options 其它可选操作
* @param discover 发现的设备
*/
-(void)scanForPeripheralsWithServices:(nullable NSArray<CBUUID *> *)serviceUUIDs options:(nullable NSDictionary<NSString *, id> *)options discover:(void(^_Nullable)(CBPeripheral *_Nullable peripheral,NSDictionary<NSString *, id> *_Nullable advertisementData,NSNumber *_Nullable RSSI))discover{
[_bleConnecter scanForPeripheralsWithServices:serviceUUIDs options:options discover:discover];
}
/**
* 方法说明:更新蓝牙状态
* @param state 蓝牙状态
*/
-(void)didUpdateState:(void(^)(NSInteger state))state {
if (_bleConnecter == nil) {
currentConnMethod = BLUETOOTH;
[self initConnecter:currentConnMethod];
}
[_bleConnecter didUpdateState:state];
}
-(void)initConnecter:(ConnectMethod)connectMethod {
switch (connectMethod) {
case BLUETOOTH:
_bleConnecter = [BLEConnecter new];
_connecter = _bleConnecter;
break;
case ETHERNET:
_ethernetConnecter = [EthernetConnecter new];
_connecter = _ethernetConnecter;
break;
default:
break;
}
}
/**
* 方法说明:停止扫描
*/
-(void)stopScan {
[_bleConnecter stopScan];
}
/**
* 连接
*/
-(void)connectPeripheral:(CBPeripheral *)peripheral options:(nullable NSDictionary<NSString *,id> *)options timeout:(NSUInteger)timeout connectBlack:(void(^_Nullable)(ConnectState state)) connectState{
[_bleConnecter connectPeripheral:peripheral options:options timeout:timeout connectBlack:connectState];
}
-(void)closePeripheral:(CBPeripheral *)peripheral{
[_bleConnecter closePeripheral:peripheral];
}
-(void)connectPeripheral:(CBPeripheral * _Nullable)peripheral options:(nullable NSDictionary<NSString *,id> *)options {
[_bleConnecter connectPeripheral:peripheral options:options];
}
-(void)write:(NSData *_Nullable)data progress:(void(^_Nullable)(NSUInteger total,NSUInteger progress))progress receCallBack:(void (^_Nullable)(NSData *_Nullable))callBack {
[_bleConnecter write:data progress:progress receCallBack:callBack];
}
-(void)write:(NSData *)data receCallBack:(void (^)(NSData *))callBack {
#ifdef DEBUG
NSLog(@"[ConnecterManager] write:receCallBack:");
#endif
_bleConnecter.writeProgress = nil;
[_connecter write:data receCallBack:callBack];
}
-(void)write:(NSData *)data {
#ifdef DEBUG
NSLog(@"[ConnecterManager] write:");
#endif
_bleConnecter.writeProgress = nil;
[_connecter write:data];
}
-(void)close {
if (_connecter) {
[_connecter close];
}
switch (currentConnMethod) {
case BLUETOOTH:
_bleConnecter = nil;
break;
case ETHERNET:
_ethernetConnecter = nil;
break;
}
}
@end
//
// Connecter.h
// GSDK
//
// Created by 猿史森林 on 2018/6/15.
// Copyright © 2018年 Smarnet. All rights reserved.
//
#import "Connecter.h"
#import <CoreBluetooth/CoreBluetooth.h>
@interface BLEConnecter :Connecter
@property(nonatomic,strong)CBCharacteristic *airPatchChar;
@property(nonatomic,strong)CBCharacteristic *transparentDataWriteChar;
@property(nonatomic,strong)CBCharacteristic *transparentDataReadOrNotifyChar;
@property(nonatomic,strong)CBCharacteristic *connectionParameterChar;
@property(nonatomic,strong)CBUUID *transServiceUUID;
@property(nonatomic,strong)CBUUID *transTxUUID;
@property(nonatomic,strong)CBUUID *transRxUUID;
@property(nonatomic,strong)CBUUID *disUUID1;
@property(nonatomic,strong)CBUUID *disUUID2;
@property(nonatomic,strong)NSArray *serviceUUID;
@property(nonatomic,copy)DiscoverDevice discover;
@property(nonatomic,copy)UpdateState updateState;
@property(nonatomic,copy)WriteProgress writeProgress;
/**数据包大小,默认130个字节*/
@property(nonatomic,assign)NSUInteger datagramSize;
@property(nonatomic,strong)CBPeripheral *connPeripheral;
//+(instancetype)sharedInstance;
/**
* 方法说明:设置特定的Service UUID,以及Service对应的具有读、写特征值
* @param serviceUUID 蓝牙模块的service uuid
* @param txUUID 具有写入权限特征值
* @param rxUUID 具有读取权限特征值
*/
- (void)configureTransparentServiceUUID: (NSString *)serviceUUID txUUID:(NSString *)txUUID rxUUID:(NSString *)rxUUID;
/**
* 方法说明:扫描外设
* @param serviceUUIDs 需要连接的外设UUID
* @param options 其它可选操作
* @param discover 发现设备
* peripheral 发现的外设
* advertisementData
* RSSI 外设信号强度
*/
-(void)scanForPeripheralsWithServices:(nullable NSArray<CBUUID *> *)serviceUUIDs options:(nullable NSDictionary<NSString *, id> *)options discover:(void(^_Nullable)(CBPeripheral *_Nullable peripheral,NSDictionary<NSString *, id> *_Nullable advertisementData,NSNumber *_Nullable RSSI))discover;
/**
* 方法说明:停止扫描蓝牙外设
*/
-(void)stopScan;
/**
* 方法说明:更新蓝牙状态
* @param state 更新蓝牙状态
*/
-(void)didUpdateState:(void(^_Nullable)(NSInteger state))state;
/**
* 方法说明:连接外设
* @param peripheral 需要连接的外设
* @param options 其它可选操作
* @param timeout 连接超时
* @param connectState 连接状态
*/
-(void)connectPeripheral:(CBPeripheral *_Nullable)peripheral options:(nullable NSDictionary<NSString *,id> *)options timeout:(NSUInteger)timeout connectBlack:(void(^_Nullable)(ConnectState state)) connectState;
/**
* 方法说明:连接外设
* @param peripheral 需要连接的外设
* @param options 其它可选操作
*/
-(void)connectPeripheral:(CBPeripheral * _Nullable)peripheral options:(nullable NSDictionary<NSString *,id> *)options;
/**
* 方法说明:断开连接
* @param peripheral 需要断开连接的外设
*/
-(void)closePeripheral:(nonnull CBPeripheral *)peripheral;
/**
* 方法说明: 往蓝牙模块中写入数据
* @param data 往蓝牙模块中写入的数据
* @param progress 写入数据的进度
* @param callBack 读取蓝牙模块返回数据
*/
-(void)write:(NSData *_Nullable)data progress:(void(^_Nullable)(NSUInteger total,NSUInteger progress))progress receCallBack:(void (^_Nullable)(NSData *_Nullable))callBack;
/**
* 方法说明: 往蓝牙模块中写入数据
* @param characteristic 特征值
* @param data 往蓝牙模块中写入的数据
* @param type 写入方式<b>CBCharacteristicWriteWithResponse</b>写入方式是带流控写入方式。<b>CBCharacteristicWriteWithoutResponse</b>不带流控写入方式 <p><b>@see CBCharacteristicWriteType</b></p>
*/
-(void)writeValue:(NSData *)data forCharacteristic:(nonnull CBCharacteristic *)characteristic type:(CBCharacteristicWriteType)type;
@end
//
// Connecter.h
// GSDK
//
// Created by 猿史森林 on 2018/6/16.
// Copyright © 2018年 Smarnet. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "ConnecterBlock.h"
@interface Connecter:NSObject
//读取数据
@property(nonatomic,copy)ReadData readData;
//连接状态
@property(nonatomic,copy)ConnectDeviceState state;
/**
* 方法说明: 连接
*/
-(void)connect;
/**
* 方法说明: 连接到指定设备
* @param connectState 连接状态
*/
-(void)connect:(void(^)(ConnectState state))connectState;
/**
* 方法说明: 关闭连接
*/
-(void)close;
/**
* 发送数据
* 向输出流中写入数据
*/
-(void)write:(NSData *)data receCallBack:(void(^)(NSData *data))callBack;
-(void)write:(NSData *)data;
/**
* 读取数据
* @parma data 读取到的数据
*/
-(void)read:(void(^)(NSData *data))data;
@end
//
// ConnecterBlock.h
// GSDK
//
// Created by 猿史森林 on 2018/6/16.
// Copyright © 2018年 Smarnet. All rights reserved.
//
#ifndef ConnecterBlock_h
#define ConnecterBlock_h
#import <CoreBluetooth/CBPeripheral.h>
/**
* @enum ConnectState
* @discussion 连接状态
* @constant CONNECT_STATE_DISCONNECT ConnectDeviceState返回state为该状态是表示已断开连接
* @constant CONNECT_STATE_CONNECTING ConnectDeviceState返回state为该状态是表示正在连接中
* @constant CONNECT_STATE_CONNECTED ConnectDeviceState返回state为该状态是表示连接成功
* @constant CONNECT_STATE_TIMEOUT ConnectDeviceState返回state为该状态是表示连接超时
* @constant CONNECT_STATE_FAILT ConnectDeviceState返回state为该状态是表示连接失败
*/
typedef enum : NSUInteger {
NOT_FOUND_DEVICE,//未找到设备
CONNECT_STATE_DISCONNECT,//断开连接
CONNECT_STATE_CONNECTING,//连接中
CONNECT_STATE_CONNECTED,//连接上
CONNECT_STATE_TIMEOUT,//连接超时
CONNECT_STATE_FAILT//连接失败
}ConnectState;
/**发现设备*/
typedef void(^DiscoverDevice)(CBPeripheral *_Nullable peripheral,NSDictionary<NSString *, id> * _Nullable advertisementData,NSNumber * _Nullable RSSI);
/**蓝牙状态更新*/
typedef void(^UpdateState)(NSInteger state);
/**连接状态*/
typedef void(^ConnectDeviceState)(ConnectState state);
/**读取数据*/
typedef void(^ReadData)(NSData * _Nullable data);
/**发送数据进度 只适用于蓝牙发送数据*/
typedef void(^WriteProgress)(NSUInteger total,NSUInteger progress);
//typedef void (^Error)(id error);
#endif /* ConnecterBlock_h */
//
// EthernetConnecter.h
// GSDK
//
// Created by 猿史森林 on 2018/6/16.
// Copyright © 2018年 猿史森林. All rights reserved.
//
#import "Connecter.h"
@interface EthernetConnecter :Connecter
/**连接设备的ip地址*/
@property(nonatomic,strong)NSString *ip;
/**连接设备的端口号*/
@property(nonatomic,assign)int port;
//+(instancetype)sharedInstance;
/**
* 方法说明: 连接设备
* @param ip 连接设备的ip地址
* @param port 连接设备的端口号
* @param connectState 连接状态 @see ConnectState
* @param callback 输入流数据回调
*/
-(void)connectIP:(NSString *)ip port:(int)port connectState:(void (^)(ConnectState state))connectState callback:(void(^)(NSData *data))callback;
-(void)connectIP:(NSString *)ip port:(int)port connectState:(void (^)(ConnectState))connectState;
@end
//
// TscCommand.h
// Gprinter
//
// Created by Wind on 2018/6/15.
// Copyright (c) 2018年 Smarnet. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
typedef NS_ENUM (NSUInteger,Response){
OFF = 0,//关闭自动返回状态功能
ON = 1,//打开自动返回状态功能,每打印完一张返回一次
BATCH = 2,//打开自动返回状态功能,打印完毕后返回一次
};
@interface TscCommand : NSObject
/**
* 方法说明:设置标签尺寸的宽和高
* @param width 标签宽度
* @param height 标签高度
*/
-(void) addSize:(int) width :(int) height;
/**
* 方法说明:设置标签间隙尺寸 单位mm
* @param m 间隙长度
* @param n 间隙偏移
*/
-(void) addGapWithM:(int) m withN:(int) n;
/**
* 方法说明:设置标签原点坐标
* @param x 横坐标
* @param y 纵坐标
*/
-(void) addReference:(int) x :(int)y;
/**
* 方法说明:设置打印速度
* @param speed 打印速度
*/
-(void) addSpeed:(int) speed;
/**
* 方法说明:设置打印浓度
* @param density 浓度
*/
-(void) addDensity:(int) density;
/**
* 方法说明:设置打印方向
* @param direction 方向
*/
-(void) addDirection:(int) direction;
/**
* 方法说明:清除打印缓冲区
*/
-(void) addCls;
/**
* 方法说明:在标签上绘制文字
* @param x 横坐标
* @param y 纵坐标
* @param font 字体类型
* @param rotation 旋转角度
* @param xScal 横向放大
* @param yScal 纵向放大
* @param text 文字字符串
*/
-(void) addTextwithX:(int)x withY:(int)y withFont:(NSString*)font withRotation:(int)rotation withXscal:(int)xScal withYscal:(int)yScal withText:(NSString*)text;
/*
BITMAP X, Y, width, height, mode, bitmap data
参 数 说 明
x 点阵影像的水平启始位置
y 点阵影像的垂直启始位置
width 影像的宽度,以 byte 表示
height 影像的高度,以点(dot)表示
mode 影像绘制模式
0 OVERWRITE
1 OR
2 XOR
bitmap data 影像数据
*/
-(void) addBitmapwithX:(int)x withY:(int) y withWidth:(int) width withHeight:(int) height withMode:(int) mode withData:(NSData*) data;
-(void)addBitmapwithX:(int)x withY:(int)y withMode:(int)mode withWidth:(int)width withImage:(UIImage *)image;
-(void)addBitmapwithX:(int)x withY:(int)y withMode:(int)mode withImage:(UIImage *)image;
/**
* 方法说明:在标签上绘制一维条码
* @param x 横坐标
* @param y 纵坐标
* @param barcodeType 条码类型
* @param height 条码高度,默认为40
* @param readable 是否可识别,0: 人眼不可识,1: 人眼可识
* @param rotation 旋转角度,条形码旋转角度,顺时钟方向,0不旋转,90顺时钟方向旋转90度,180顺时钟方向旋转180度,270顺时钟方向旋转270度
* @param narrow 默认值2,窄 bar 宽度,以点(dot)表示
* @param wide 默认值4,宽 bar 宽度,以点(dot)表示
* @param content 条码内容
BARCODE X,Y,"code type",height,human readable,rotation,narrow,wide,"code"
BARCODE 100,100,"39",40,1,0,2,4,"1000"
BARCODE 10,10,"128",40,1,0,2,2,"124096ABCDEFZ$%+-./*"
"code type":
EAN13("EAN13"),
EAN8("EAN8"),
UPCA("UPCA"),
ITF14("ITF14"),
CODE39("39"),
CODE128("128"),
*/
-(void) add1DBarcode:(int)x :(int)y :(NSString*)barcodeType :(int)height :(int)readable :(int)rotation :(int)narrow :(int)wide :(NSString*)content;
/**
* 方法说明:在标签上绘制QRCode二维码
* @param x 横坐标
* @param y 纵坐标
* @param ecclever 选择QRCODE纠错等级,L为7%,M为15%,Q为25%,H为30%
* @param cellwidth 二维码宽度1~10,默认为4
* @param mode 默认为A,A为Auto,M为Manual
* @param rotation 旋转角度,QRCode二维旋转角度,顺时钟方向,0不旋转,90顺时钟方向旋转90度,180顺时钟方向旋转180度,270顺时钟方向旋转270度
* @param content 条码内容
* QRCODE X,Y ,ECC LEVER ,cell width,mode,rotation, "data string"
* QRCODE 20,24,L,4,A,0,"佳博集团网站www.Gprinter.com.cn"
*/
-(void) addQRCode:(int)x :(int)y :(NSString*)ecclever :(int)cellwidth :(NSString*)mode :(int)rotation :(NSString*)content;
/**
* 方法说明:执行打印
* @param m
* @param n
*/
-(void) addPrint:(int) m :(int) n;
/**
* 方法说明:获得打印命令
*/
-(NSData*) getCommand;
/**
* 方法说明:将字符串转成十六进制码
* @param str 命令字符串
*/
-(void) addStrToCommand:(NSString *) str;
-(void) addNSDataToCommand:(NSData*) data;
/**
* 方法说明:发送一些TSC的固定命令,在cls命令之前发送
*/
-(void) addComonCommand;
/**
* 方法说明:打印自检页,打印测试页
*/
-(void) addSelfTest;
/**
* 方法说明 :查询打印机型号
*/
-(void) queryPrinterType;
/**
* 方法说明:设置打印机剥离模式
* @param peel ON/OFF 是否开启
*/
-(void) addPeel:(NSString *) peel;
/**
* 方法说明:设置打印机撕离模式
* @param tear ON/OFF 是否开启
*/
-(void) addTear:(NSString *) tear;
/**
* 方法说明:设置切刀是否有效
* @param cutter 是否开启 OFF/pieces (0<=pieces<=127)设定几张标签切一次
*/
-(void) addCutter:(NSString *) cutter;
/**
* 方法说明:设置切刀半切是否有效
* @param cutter 是否开启
*/
-(void) addPartialCutter:(NSString *) cutter;
/**
* 方法说明:设置蜂鸣器
* @param level 频率
* @param interval 时间ms
*/
-(void) addSound:(int) level :(int) interval;
/**
* 方法说明:打开钱箱命令,CASHDRAWER m,t1,t2
* @param m 钱箱号 m 0,48 钱箱插座的引脚2 1,49 钱箱插座的引脚5
* @param t1 高电平时间0 ≤ t1 ≤ 255输出由t1和t2设定的钱箱开启脉冲到由m指定的引脚
* @param t2 低电平时间0 ≤ t2 ≤ 255输出由t1和t2设定的钱箱开启脉冲到由m指定的引脚
*/
-(void) addCashdrawer:(int) m :(int) t1 :(int) t2;
/**
* 方法说明:在标签上绘制黑块,画线
* @param x 起始横坐标
* @param y 起始纵坐标
* @param width 线宽,以点(dot)表示
* @param height 线高,以点(dot)表示
*/
-(void) addBar:(int) x :(int) y :(int) width :(int) height;
/**
* 方法说明:在标签上绘制矩形
* @param xStart 起始横坐标
* @param yStart 起始纵坐标
* @param xEnd 终点横坐标
* @param yEnd 终点纵坐标
* @param lineThickness 矩形框线厚度或宽度,以点(dot)表示
*/
-(void) addBox:(int) xStart :(int) yStart :(int) xEnd :(int) yEnd :(int) lineThickness;
/**
* 方法说明:查询打印机状态<ESC>!?
*询问打印机状态指令为立即响应型指令,该指令控制字符是以<ESC> (ASCII 27=0x1B, escape字符)为控制字符.!(ASCII 33=0x21),?(ASCII 63=0x3F)
*即使打印机在错误状态中仍能透过 RS-232 回传一个 byte 资料来表示打印机状态,若回传值为 0 则表示打印
*机处于正常的状态
*/
-(void) queryPrinterStatus;
/**
* 方法说明:将指定的区域反向打印(黑色变成白色,白色变成黑色)
* @param xStart 起始横坐标
* @param yStart 起始横坐标
* @param xWidth X坐标方向宽度,dot为单位
* @param yHeight Y坐标方向高度,dot为单位
*/
-(void) addReverse:(int) xStart :(int) yStart :(int) xWidth :(int) yHeight;
/**
* 方法说明: 打印机打印完成时,自动返回状态。可用于实现连续打印功能
* @param response 自动返回状态 <a>@see Response</a>
* OFF 关闭自动返回状态功能
* ON 开启自动返回状态功能
* BATCH 全部打印完成后返回状态
*/
-(void)addQueryPrinterStatus:(Response)response;
/**
* 方法说明: 查询打印机电量。
* <p>返回值: 31(低电量);32 (中电量);33 (高电量);35 (正在充电)</p>
*
*/
-(void)queryElectricity;
@end
...@@ -198,7 +198,21 @@ class NewCKVc: BaseViewController,UITableViewDelegate,UITableViewDataSource,CKNo ...@@ -198,7 +198,21 @@ class NewCKVc: BaseViewController,UITableViewDelegate,UITableViewDataSource,CKNo
} }
var goodsInfoArr:Array<Any> = [] var goodsInfoArr:Array<Any> = []
@IBOutlet weak var gm_view: UIView! @IBOutlet weak var gm_view: UIView!
@IBAction func ck_action(_ sender: UIButton) { @IBAction func ck_action(_ sender: UIButton) {
let command = TscCommand()
command.addSize(40, 30)
command.addGap(withM: 2, withN: 0)
command.addReference(0, 0)
command.addTear("ON")
command.addQueryPrinterStatus(Response(rawValue: 1)!)
command.addCls()
let image = UIImage(named: "3.png")
command.addBitmapwithX(0, withY: 0, withMode: 0, withWidth: 400, with: image)
command.addPrint(1, 1)
ConnecterManager.sharedInstance()?.write(command.getCommand())
return
if isGm { if isGm {
if typeSelect == nil { if typeSelect == nil {
......
...@@ -32,6 +32,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -32,6 +32,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
vc.receiveArr = pph_receive_arr vc.receiveArr = pph_receive_arr
vc.add_order_time = (model.data?.create_time)! vc.add_order_time = (model.data?.create_time)!
vc.wb_no = pph_wb_no vc.wb_no = pph_wb_no
vc.lwb_no = pph_lwb_no
vc.car_type = pphCarTypesArr[pph_selectCarType].name! vc.car_type = pphCarTypesArr[pph_selectCarType].name!
vc.price = totalPrice vc.price = totalPrice
vc.pay_time = (model.data?.pay_time)! vc.pay_time = (model.data?.pay_time)!
...@@ -47,6 +48,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -47,6 +48,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
var paymentView:PaymentView? var paymentView:PaymentView?
var res = -1 var res = -1
var pph_wb_no = "" var pph_wb_no = ""
var pph_lwb_no = ""
@IBAction func PPH_PayAction(_ sender: Any) { @IBAction func PPH_PayAction(_ sender: Any) {
if apply_btn.isSelected == false { if apply_btn.isSelected == false {
HUD.flash(.label("您好,请同意《电子运单契约条款》,方可下单。谢谢"), delay: 1.2) HUD.flash(.label("您好,请同意《电子运单契约条款》,方可下单。谢谢"), delay: 1.2)
...@@ -114,6 +116,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -114,6 +116,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
addPinPinOrder(dict) {[self] (data) in addPinPinOrder(dict) {[self] (data) in
let model = data as! addPinPinOrder_model let model = data as! addPinPinOrder_model
self.pph_wb_no = (model.data?.wb_no)! self.pph_wb_no = (model.data?.wb_no)!
self.pph_lwb_no = (model.data?.lwb_no)!
if paymentView == nil{ if paymentView == nil{
paymentView = PaymentView(frame: view.bounds) paymentView = PaymentView(frame: view.bounds)
paymentView?.delegate = self paymentView?.delegate = self
......
...@@ -127,7 +127,7 @@ class PPH_YDXQ_VC: BaseViewController,UITableViewDelegate,UITableViewDataSource, ...@@ -127,7 +127,7 @@ class PPH_YDXQ_VC: BaseViewController,UITableViewDelegate,UITableViewDataSource,
let l = (modelData?.pph_info!.driverMobile)!.suffix(3) let l = (modelData?.pph_info!.driverMobile)!.suffix(3)
mobile = (modelData?.pph_info!.driverMobile)! mobile = (modelData?.pph_info!.driverMobile)!
if (modelData?.pph_info?.driverName!.count)! > 0 { if (modelData?.pph_info?.driverName!.count)! > 0 {
driver = (modelData?.pph_info!.driverName)! + "(\(f)*****\(l)" driver = (modelData?.pph_info!.driverName)! + "(\(f)*****\(l))"
} }
if (modelData?.sale_plat!.count)! > 0 { if (modelData?.sale_plat!.count)! > 0 {
plan = (modelData?.sale_plat)! plan = (modelData?.sale_plat)!
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
import UIKit import UIKit
class PPH_SUC_VC: BaseViewController,UITableViewDelegate,UITableViewDataSource { class PPH_SUC_VC: BaseViewController,UITableViewDelegate,UITableViewDataSource {
var lwb_no = ""
var sendArr:Array<addPinPinOrder_adrInfo>? var sendArr:Array<addPinPinOrder_adrInfo>?
var receiveArr:Array<addPinPinOrder_adrInfo>? var receiveArr:Array<addPinPinOrder_adrInfo>?
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
...@@ -27,7 +27,7 @@ class PPH_SUC_VC: BaseViewController,UITableViewDelegate,UITableViewDataSource { ...@@ -27,7 +27,7 @@ class PPH_SUC_VC: BaseViewController,UITableViewDelegate,UITableViewDataSource {
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.section == 0 { if indexPath.section == 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: "Suc_Top_Cell") as! Suc_Top_Cell let cell = tableView.dequeueReusableCell(withIdentifier: "Suc_Top_Cell") as! Suc_Top_Cell
cell.wb_no_lbl.text = wb_no cell.wb_no_lbl.text = lwb_no
cell.order_time_lbl.text = add_order_time cell.order_time_lbl.text = add_order_time
return cell return cell
} }
......
...@@ -7,11 +7,12 @@ ...@@ -7,11 +7,12 @@
// //
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "ConnecterManager.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface BtViewController : UIViewController @interface BtViewController : UIViewController
@property(nonatomic,copy)ConnectDeviceState state;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
...@@ -821,7 +821,7 @@ class YDLBVc: BaseViewController,UITableViewDelegate,UITableViewDataSource,UISea ...@@ -821,7 +821,7 @@ class YDLBVc: BaseViewController,UITableViewDelegate,UITableViewDataSource,UISea
cell.acButton.setTitle("支付运费", for: .normal) cell.acButton.setTitle("支付运费", for: .normal)
} }
}else{ }else{
if rowModel.delivery_status == 1 { if rowModel.delivery_status == 1 && rowModel.lc_name != "拼拼货"{
cell.acButton.isHidden = false cell.acButton.isHidden = false
cell.acButton.setTitle("取消运单", for: .normal) cell.acButton.setTitle("取消运单", for: .normal)
} }
......
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