Commit e1d93a92 authored by lujunye's avatar lujunye

接入热敏打印机。

parent 506b3e59
......@@ -40,13 +40,13 @@ import ESTabBarController_swift
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate,loginDelegate,UITabBarControllerDelegate, JPUSHRegisterDelegate{
var blueToothVC:BluetoothConnectViewController!
var blueToothVC:ConnectViewController!
var window:UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// 启动图,调整展示时间为3秒
Thread .sleep(forTimeInterval: 2.0)
blueToothVC = BluetoothConnectViewController()
blueToothVC = ConnectViewController()
let UserToken = UserDefaults.standard.value(forKey: "user_token")
if UserToken == nil {
......
......@@ -26,6 +26,10 @@
#import "JZLocationConverter.h"
#import "CBController.h"
#import "DeviceInfo.h"
#import "TscCommand.h"
#import "BLKWrite.h"
#import "EscCommand.h"
#import "ConnectViewController.h"
#endif /* Bridge_Header_h */
......@@ -80,6 +80,7 @@
<key>UIBackgroundModes</key>
<array>
<string>fetch</string>
<string>bluetooth-central</string>
<string>remote-notification</string>
</array>
<key>UILaunchImageFile</key>
......
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16097.2" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17703"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
......
......@@ -154,6 +154,18 @@ class NewCKVc: BaseViewController,UITableViewDelegate,UITableViewDataSource,CKNo
var goodsInfoArr:Array<Any> = []
@IBOutlet weak var gm_view: UIView!
@IBAction func ck_action(_ sender: UIButton) {
print("pw = ",BLKWrite.instance()?.printWidth())
let esc = EscCommand()
esc.hasResponse = true
esc.addInitializePrinter()
esc.addText("测试")
esc.addPrintMode(0x1B)
esc.addPrintAndFeedLines(8)
BLKWrite.instance()?.writeEscData(esc.getCommand(), withResponse: esc.hasResponse)
return
if isGm {
if typeSelect == nil {
HUD.flash(.label("请选择出库类型"),delay: 1.2)
......
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17703"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="BluetoothConnectViewController" customModule="TestClass" customModuleProvider="target">
<connections>
<outlet property="bottomView" destination="z6g-3U-Gjc" id="Kx7-8l-LwL"/>
<outlet property="tableView" destination="IoW-aR-gg0" id="Cxv-cQ-rjJ"/>
<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="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="IoW-aR-gg0">
<rect key="frame" x="0.0" y="44" width="414" height="768"/>
<color key="backgroundColor" name="app底色"/>
<connections>
<outlet property="dataSource" destination="-1" id="xfo-ZG-WzQ"/>
<outlet property="delegate" destination="-1" id="2c8-jb-9e5"/>
</connections>
</tableView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="z6g-3U-Gjc">
<rect key="frame" x="0.0" y="812" width="414" height="50"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="搜索" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bS9-xW-ajm">
<rect key="frame" x="207.5" y="15" width="35" height="20.5"/>
<constraints>
<constraint firstAttribute="width" constant="35" id="USO-np-8G1"/>
<constraint firstAttribute="height" constant="20.5" id="Xbv-19-TDF"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="guanbi" translatesAutoresizingMaskIntoConstraints="NO" id="zmP-e7-gur">
<rect key="frame" x="179" y="15" width="20" height="20"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="TmK-Oq-Sof"/>
<constraint firstAttribute="width" constant="20" id="Xi5-pM-tII"/>
</constraints>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Kxt-WC-XyY">
<rect key="frame" x="0.0" y="0.0" width="414" height="50"/>
<connections>
<action selector="searchAction:" destination="-1" eventType="touchUpInside" id="lDV-he-pEz"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="bS9-xW-ajm" firstAttribute="centerY" secondItem="z6g-3U-Gjc" secondAttribute="centerY" id="I5U-kM-DXb"/>
<constraint firstAttribute="height" constant="50" id="LW6-DI-gTT"/>
<constraint firstItem="Kxt-WC-XyY" firstAttribute="top" secondItem="z6g-3U-Gjc" secondAttribute="top" id="NJc-wO-cmv"/>
<constraint firstAttribute="bottom" secondItem="Kxt-WC-XyY" secondAttribute="bottom" id="Vtr-aJ-Rod"/>
<constraint firstItem="Kxt-WC-XyY" firstAttribute="leading" secondItem="z6g-3U-Gjc" secondAttribute="leading" id="WJR-bl-zKg"/>
<constraint firstItem="zmP-e7-gur" firstAttribute="centerX" secondItem="z6g-3U-Gjc" secondAttribute="centerX" constant="-18" id="iwy-LB-WMs"/>
<constraint firstItem="zmP-e7-gur" firstAttribute="centerY" secondItem="z6g-3U-Gjc" secondAttribute="centerY" id="j4R-HR-czB"/>
<constraint firstItem="bS9-xW-ajm" firstAttribute="centerX" secondItem="z6g-3U-Gjc" secondAttribute="centerX" constant="18" id="kn3-Ji-FaK"/>
<constraint firstAttribute="trailing" secondItem="Kxt-WC-XyY" secondAttribute="trailing" id="qu6-u0-3z0"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="EhN-in-WvW">
<rect key="frame" x="0.0" y="862" width="414" height="70"/>
<color key="backgroundColor" name="白色背景色"/>
<constraints>
<constraint firstAttribute="height" constant="70" id="5Bl-jC-R6q"/>
</constraints>
</view>
</subviews>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="IoW-aR-gg0" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="1BX-uM-9UQ"/>
<constraint firstItem="EhN-in-WvW" firstAttribute="top" secondItem="z6g-3U-Gjc" secondAttribute="bottom" id="6eJ-il-R2H"/>
<constraint firstAttribute="trailing" secondItem="EhN-in-WvW" secondAttribute="trailing" id="EOz-ma-JQs"/>
<constraint firstItem="IoW-aR-gg0" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="Rcf-fQ-pmW"/>
<constraint firstItem="z6g-3U-Gjc" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="SEI-Ob-cTQ"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="z6g-3U-Gjc" secondAttribute="bottom" id="VTm-D3-5xc"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="z6g-3U-Gjc" secondAttribute="trailing" id="Xak-0L-zec"/>
<constraint firstItem="z6g-3U-Gjc" firstAttribute="top" secondItem="IoW-aR-gg0" secondAttribute="bottom" id="aNn-3T-lTt"/>
<constraint firstItem="EhN-in-WvW" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="b7Q-gR-cJG"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="IoW-aR-gg0" secondAttribute="trailing" id="hos-nX-fj1"/>
</constraints>
<point key="canvasLocation" x="127.53623188405798" y="111.16071428571428"/>
</view>
</objects>
<resources>
<image name="guanbi" width="37" height="18"/>
<namedColor name="app底色">
<color red="0.94509803921568625" green="0.94509803921568625" blue="0.94509803921568625" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="标题字颜色">
<color red="0.18000000715255737" green="0.18000000715255737" blue="0.18000000715255737" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="白色背景色">
<color red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
//
// Bt_Cell.h
// GeliBusinessPlatform
//
// Created by junye lu on 2021/2/25.
// Copyright © 2021 junye lu. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface Bt_Cell : UITableViewCell
@property (weak, nonatomic) IBOutlet UIImageView *statusImg;
@property (weak, nonatomic) IBOutlet UILabel *title_lbl;
@end
NS_ASSUME_NONNULL_END
//
// Bt_Cell.m
// GeliBusinessPlatform
//
// Created by junye lu on 2021/2/25.
// Copyright © 2021 junye lu. All rights reserved.
//
#import "Bt_Cell.h"
@implementation Bt_Cell
- (void)awakeFromNib {
[super awakeFromNib];
self.selectionStyle = UITableViewCellSelectionStyleNone;
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17703"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="Bt_Cell">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="h8i-lL-wng">
<rect key="frame" x="15" y="0.0" width="270" height="44"/>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="13"/>
<color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="yuxuan" translatesAutoresizingMaskIntoConstraints="NO" id="Dt4-SC-5RJ">
<rect key="frame" x="285" y="12" width="20" height="20"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="g4G-0M-Rxg"/>
<constraint firstAttribute="width" constant="20" id="wrQ-9R-QS0"/>
</constraints>
</imageView>
</subviews>
<constraints>
<constraint firstItem="h8i-lL-wng" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="15" id="5aq-oo-tAy"/>
<constraint firstItem="Dt4-SC-5RJ" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="ERi-41-NCH"/>
<constraint firstAttribute="bottom" secondItem="h8i-lL-wng" secondAttribute="bottom" id="MFu-7I-Fhe"/>
<constraint firstAttribute="trailing" secondItem="Dt4-SC-5RJ" secondAttribute="trailing" constant="15" id="gU6-oH-pJf"/>
<constraint firstItem="h8i-lL-wng" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="uLg-IZ-WW5"/>
<constraint firstItem="Dt4-SC-5RJ" firstAttribute="leading" secondItem="h8i-lL-wng" secondAttribute="trailing" id="uin-js-ZxJ"/>
</constraints>
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
<connections>
<outlet property="statusImg" destination="Dt4-SC-5RJ" id="6N9-Rr-oJ6"/>
<outlet property="title_lbl" destination="h8i-lL-wng" id="fbs-kO-ZV2"/>
</connections>
<point key="canvasLocation" x="141" y="92"/>
</tableViewCell>
</objects>
<resources>
<image name="yuxuan" width="19" height="19"/>
<namedColor name="标题字颜色">
<color red="0.18000000715255737" green="0.18000000715255737" blue="0.18000000715255737" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
</resources>
</document>
//
// ConnectViewController.h
// BLETR
//
// Created by D500 user on 12/9/26.
// Copyright (c) 2012 ISSC Technologies Corporation. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "CBController.h"
#import "DeviceInfo.h"
@interface ConnectViewController : CBController<UITableViewDataSource, UITextViewDelegate, UITableViewDelegate>
{
IBOutlet UITableView *devicesTableView;
UIActivityIndicatorView *activityIndicatorView;
UILabel *statusLabel;
NSTimer *refreshDeviceListTimer;
int connectionStatus;
//Derek
DeviceInfo *deviceInfo;
MyPeripheral *controlPeripheral;
NSMutableArray *connectedDeviceInfo;//stored for DeviceInfo object
NSMutableArray *connectingList;//stored for MyPeripheral object
UIBarButtonItem *refreshButton;
UIBarButtonItem *scanButton;
UIBarButtonItem *cancelButton;
UIBarButtonItem *uuidSettingButton;
}
@property (nonatomic, retain) IBOutlet UIActivityIndicatorView *activityIndicatorView;
@property (nonatomic, retain) IBOutlet UILabel *statusLabel;
@property (assign) int connectionStatus;
@property (retain, nonatomic) IBOutlet UILabel *versionLabel;
- (IBAction)refreshDeviceList:(id)sender;
- (IBAction)actionButtonCancelScan:(id)sender;
- (IBAction)manualUUIDSetting:(id)sender;
- (IBAction)actionButtonDisconnect:(id)sender;
- (IBAction)actionButtonCancelConnect:(id)sender;
@end
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