更新记录

1.0.1(2024-03-10)

重新优化内部逻辑实现。处理特殊数据传入逻辑。

1.0.0(2024-03-09)

版本初始化发布


平台兼容性

Vue2 Vue3
App 快应用 微信小程序 支付宝小程序 百度小程序 字节小程序 QQ小程序
HBuilderX 3.6.8,Android:4.4,iOS:不支持,HarmonyNext:不确定 × × × × × ×
钉钉小程序 快手小程序 飞书小程序 京东小程序
× × × ×
H5-Safari Android Browser 微信浏览器(Android) QQ浏览器(Android) Chrome IE Edge Firefox PC-Safari
× × × × × × × × ×

概述

XF-sunmiPrinterUTS封装商米打印模块,支持商米主推的智能商用硬件,设备应用于包括外卖接单,打印小票,扫描,收款,团购核销,点餐预约等一系列商业场景。

插件接口

startService

开启打印服务

uni-app项目中(nvue)调用示例:

import { startService } from "@/uni_modules/XF-sunmiPrinterUTS"

startService({
  complete: (res) => {
        console.log(res)
  }
});

uni-app x项目(uvue)中调用示例:

import { startService } from "@/uni_modules/XF-sunmiPrinterUTS";
import { StartServiceOptions } from "@/uni_modules/XF-sunmiPrinterUTS/utssdk/interface.uts";

let options = {
  complete: (res : any) => {
    console.log(res)
  }
} as StartServiceOptions;
startService(options);

可用性

Android系统

可提供的1.0.0及更高版本

stopService

停止打印服务

uni-app项目中(nvue)调用示例:

import { stopService } from "@/uni_modules/XF-sunmiPrinterUTS"

stopService({
  complete: (res) => {
        console.log(res)
  }
});

uni-app x项目(uvue)中调用示例:

import { stopService } from "@/uni_modules/XF-sunmiPrinterUTS";
import { PrintOptions } from "@/uni_modules/XF-sunmiPrinterUTS/utssdk/interface.uts";

let options = {
  complete: (res : any) => {
    console.log(res)
  }
} as PrintOptions;
stopService(options);

可用性

Android系统

可提供的1.0.0及更高版本

printerInit

初始化打印机,重置打印机的逻辑程序,但不清空缓存区数据,因此未完成的打印作业将在重置后继续

uni-app项目中(nvue)调用示例:

import { printerInit } from "@/uni_modules/XF-sunmiPrinterUTS"

printerInit({
  complete: (res) => {
        console.log(res)
  }
});

uni-app x项目(uvue)中调用示例:

import { printerInit } from "@/uni_modules/XF-sunmiPrinterUTS";
import { PrintOptions } from "@/uni_modules/XF-sunmiPrinterUTS/utssdk/interface.uts";

let options = {
  complete: (res : any) => {
    console.log(res)
  }
} as PrintOptions;
printerInit(options);

可用性

Android系统

可提供的1.0.0及更高版本

printerSelfChecking

打印机自检,打印机会打印自检

uni-app项目中(nvue)调用示例:

import { printerSelfChecking } from "@/uni_modules/XF-sunmiPrinterUTS"

printerSelfChecking({
  complete: (res) => {
        console.log(res)
  }
});

uni-app x项目(uvue)中调用示例:

import { printerSelfChecking } from "@/uni_modules/XF-sunmiPrinterUTS";
import { PrintOptions } from "@/uni_modules/XF-sunmiPrinterUTS/utssdk/interface.uts";

let options = {
  complete: (res : any) => {
    console.log(res)
  }
} as PrintOptions;
printerSelfChecking(options);

可用性

Android系统

可提供的1.0.0及更高版本

getPrinterSerialNoSync

获取打印机板序列列号

uni-app项目中(nvue)调用示例:

import { getPrinterSerialNoSync } from "@/uni_modules/XF-sunmiPrinterUTS"

getPrinterSerialNoSync();

uni-app x项目(uvue)中调用示例:

import { getPrinterSerialNoSync } from "@/uni_modules/XF-sunmiPrinterUTS";

getPrinterSerialNoSync();

可用性

Android系统

可提供的1.0.0及更高版本

getPrinterModalSync

获取打印机板序列列号

uni-app项目中(nvue)调用示例:

import { getPrinterModalSync } from "@/uni_modules/XF-sunmiPrinterUTS"

getPrinterModalSync();

uni-app x项目(uvue)中调用示例:

import { getPrinterModalSync } from "@/uni_modules/XF-sunmiPrinterUTS";

getPrinterModalSync();

可用性

Android系统

可提供的1.0.0及更高版本

getPrinterVersionSync

获取打印机固件版本号

uni-app项目中(nvue)调用示例:

import { getPrinterVersionSync } from "@/uni_modules/XF-sunmiPrinterUTS"

getPrinterVersionSync();

uni-app x项目(uvue)中调用示例:

import { getPrinterVersionSync } from "@/uni_modules/XF-sunmiPrinterUTS";

getPrinterVersionSync();

可用性

Android系统

可提供的1.0.0及更高版本

getUpdatePrinterStateSync

获取打印机的最新状态

uni-app项目中(nvue)调用示例:

import { getUpdatePrinterStateSync } from "@/uni_modules/XF-sunmiPrinterUTS"

getUpdatePrinterStateSync();

uni-app x项目(uvue)中调用示例:

import { getUpdatePrinterStateSync } from "@/uni_modules/XF-sunmiPrinterUTS";

getUpdatePrinterStateSync();

可用性

Android系统

可提供的1.0.0及更高版本

getServiceVersionSync

获取打印服务版本号

uni-app项目中(nvue)调用示例:

import { getServiceVersionSync } from "@/uni_modules/XF-sunmiPrinterUTS"

getServiceVersionSync();

uni-app x项目(uvue)中调用示例:

import { getServiceVersionSync } from "@/uni_modules/XF-sunmiPrinterUTS";

getServiceVersionSync();

可用性

Android系统

可提供的1.0.0及更高版本

getPrintedLength

获取打印头打印⻓长度

uni-app项目中(nvue)调用示例:

import { getPrintedLength } from "@/uni_modules/XF-sunmiPrinterUTS"

getPrintedLength({
  complete: (res) => {
        console.log(res)
  }
});

uni-app x项目(uvue)中调用示例:

import { getPrintedLength } from "@/uni_modules/XF-sunmiPrinterUTS";
import { PrintOptions } from "@/uni_modules/XF-sunmiPrinterUTS/utssdk/interface.uts";

let options = {
  complete: (res : any) => {
    console.log(res)
  }
} as PrintOptions;
getPrintedLength(options);

可用性

Android系统

可提供的1.0.0及更高版本

getPrinterPaperSync

获取打印机当前的纸张规格

uni-app项目中(nvue)调用示例:

import { getPrinterPaperSync } from "@/uni_modules/XF-sunmiPrinterUTS"

getPrinterPaperSync();

uni-app x项目(uvue)中调用示例:

import { getPrinterPaperSync } from "@/uni_modules/XF-sunmiPrinterUTS";

getPrinterPaperSync();

可用性

Android系统

可提供的1.0.0及更高版本

sendRAWData

打印ESC/POS格式指令

uni-app项目中(nvue)调用示例:

import { sendRAWData } from "@/uni_modules/XF-sunmiPrinterUTS"

sendRAWData({
  complete: (res) => {
        console.log(res)
  }
});

uni-app x项目(uvue)中调用示例:

import { sendRAWData } from "@/uni_modules/XF-sunmiPrinterUTS";
import { SendRAWDataOptions } from "@/uni_modules/XF-sunmiPrinterUTS/utssdk/interface.uts";

let options = {
  complete: (res : any) => {
    console.log(res)
  }
} as SendRAWDataOptions;
sendRAWData(options);

可用性

Android系统

可提供的1.0.0及更高版本

setPrinterStyle

设置打印机的样式

uni-app项目中(nvue)调用示例:

import { setPrinterStyle } from "@/uni_modules/XF-sunmiPrinterUTS"

setPrinterStyle({
  complete: (res) => {
        console.log(res)
  }
});

uni-app x项目(uvue)中调用示例:

import { setPrinterStyle } from "@/uni_modules/XF-sunmiPrinterUTS";
import { SetPrinterStyleOptions } from "@/uni_modules/XF-sunmiPrinterUTS/utssdk/interface.uts";

let options = {
  complete: (res : any) => {
    console.log(res)
  }
} as SetPrinterStyleOptions;
setPrinterStyle(options);

可用性

Android系统

可提供的1.0.0及更高版本

getPrinterModeSync

获取打印机模式

uni-app项目中(nvue)调用示例:

import { getPrinterModeSync } from "@/uni_modules/XF-sunmiPrinterUTS"

getPrinterModeSync();

uni-app x项目(uvue)中调用示例:

import { getPrinterModeSync } from "@/uni_modules/XF-sunmiPrinterUTS";

getPrinterModeSync();

可用性

Android系统

可提供的1.0.0及更高版本

getPrinterBBMDistanceSync

获取黑标模式打印机自动走纸距离

uni-app项目中(nvue)调用示例:

import { getPrinterBBMDistanceSync } from "@/uni_modules/XF-sunmiPrinterUTS"

getPrinterBBMDistanceSync();

uni-app x项目(uvue)中调用示例:

import { getPrinterBBMDistanceSync } from "@/uni_modules/XF-sunmiPrinterUTS";

getPrinterBBMDistanceSync();

可用性

Android系统

可提供的1.0.0及更高版本

setAlignment

设置对⻬模式

uni-app项目中(nvue)调用示例:

import { setAlignment } from "@/uni_modules/XF-sunmiPrinterUTS"

setAlignment({
  complete: (res) => {
        console.log(res)
  }
});

uni-app x项目(uvue)中调用示例:

import { setAlignment } from "@/uni_modules/XF-sunmiPrinterUTS";
import { SetAlignmentOptions } from "@/uni_modules/XF-sunmiPrinterUTS/utssdk/interface.uts";

let options = {
  complete: (res : any) => {
    console.log(res)
  }
} as SetAlignmentOptions;
setAlignment(options);

可用性

Android系统

可提供的1.0.0及更高版本

setFontName

设置打印字体

uni-app项目中(nvue)调用示例:

import { setFontName } from "@/uni_modules/XF-sunmiPrinterUTS"

setFontName({
  complete: (res) => {
        console.log(res)
  }
});

uni-app x项目(uvue)中调用示例:

import { setFontName } from "@/uni_modules/XF-sunmiPrinterUTS";
import { SetFontNameOptions } from "@/uni_modules/XF-sunmiPrinterUTS/utssdk/interface.uts";

let options = {
  complete: (res : any) => {
    console.log(res)
  }
} as SetFontNameOptions;
setFontName(options);

可用性

Android系统

可提供的1.0.0及更高版本

setFontSize

设置字体大小

uni-app项目中(nvue)调用示例:

import { setFontSize } from "@/uni_modules/XF-sunmiPrinterUTS"

setFontSize({
  complete: (res) => {
        console.log(res)
  }
});

uni-app x项目(uvue)中调用示例:

import { setFontSize } from "@/uni_modules/XF-sunmiPrinterUTS";
import { SetFontSizeOptions } from "@/uni_modules/XF-sunmiPrinterUTS/utssdk/interface.uts";

let options = {
  complete: (res : any) => {
    console.log(res)
  }
} as SetFontSizeOptions;
setFontSize(options);

可用性

Android系统

可提供的1.0.0及更高版本

printText

打印文字

uni-app项目中(nvue)调用示例:

import { printText } from "@/uni_modules/XF-sunmiPrinterUTS"

printText({
  complete: (res) => {
        console.log(res)
  }
});

uni-app x项目(uvue)中调用示例:

import { printText } from "@/uni_modules/XF-sunmiPrinterUTS";
import { PrintTextOptions } from "@/uni_modules/XF-sunmiPrinterUTS/utssdk/interface.uts";

let options = {
  complete: (res : any) => {
    console.log(res)
  }
} as PrintTextOptions;
printText(options);

可用性

Android系统

可提供的1.0.0及更高版本

printTextWithFont

打印指定字体,大小的文本

uni-app项目中(nvue)调用示例:

import { printTextWithFont } from "@/uni_modules/XF-sunmiPrinterUTS"

printTextWithFont({
  complete: (res) => {
        console.log(res)
  }
});

uni-app x项目(uvue)中调用示例:

import { printTextWithFont } from "@/uni_modules/XF-sunmiPrinterUTS";
import { PrintTextWithFontOptions } from "@/uni_modules/XF-sunmiPrinterUTS/utssdk/interface.uts";

let options = {
  complete: (res : any) => {
    console.log(res)
  }
} as PrintTextWithFontOptions;
printTextWithFont(options);

可用性

Android系统

可提供的1.0.0及更高版本

printOriginalText

打印矢量文字

uni-app项目中(nvue)调用示例:

import { printOriginalText } from "@/uni_modules/XF-sunmiPrinterUTS"

printOriginalText({
  complete: (res) => {
        console.log(res)
  }
});

uni-app x项目(uvue)中调用示例:

import { printOriginalText } from "@/uni_modules/XF-sunmiPrinterUTS";
import { PrintTextOptions } from "@/uni_modules/XF-sunmiPrinterUTS/utssdk/interface.uts";

let options = {
  complete: (res : any) => {
    console.log(res)
  }
} as PrintTextOptions;
printOriginalText(options);

可用性

Android系统

可提供的1.0.0及更高版本

PrintColumnsText

打印表格的一行(不支持阿拉伯字符)

uni-app项目中(nvue)调用示例:

import { printColumnsText } from "@/uni_modules/XF-sunmiPrinterUTS"

printColumnsText({
  complete: (res) => {
        console.log(res)
  }
});

uni-app x项目(uvue)中调用示例:

import { printColumnsText } from "@/uni_modules/XF-sunmiPrinterUTS";
import { PrintColumnsOptions } from "@/uni_modules/XF-sunmiPrinterUTS/utssdk/interface.uts";

let options = {
  complete: (res : any) => {
    console.log(res)
  }
} as PrintColumnsOptions;
printColumnsText(options);

可用性

Android系统

可提供的1.0.0及更高版本

printColumnsString

打印表格的一行,可以指定列宽、对齐方式

uni-app项目中(nvue)调用示例:

import { printColumnsString } from "@/uni_modules/XF-sunmiPrinterUTS"

printColumnsString({
  complete: (res) => {
        console.log(res)
  }
});

uni-app x项目(uvue)中调用示例:

import { printColumnsString } from "@/uni_modules/XF-sunmiPrinterUTS";
import { PrintColumnsOptions } from "@/uni_modules/XF-sunmiPrinterUTS/utssdk/interface.uts";

let options = {
  complete: (res : any) => {
    console.log(res)
  }
} as PrintColumnsOptions;
printColumnsString(options);

可用性

Android系统

可提供的1.0.0及更高版本

printBitmap

打印图片

uni-app项目中(nvue)调用示例:

import { printBitmap } from "@/uni_modules/XF-sunmiPrinterUTS"

printBitmap({
  complete: (res) => {
        console.log(res)
  }
});

uni-app x项目(uvue)中调用示例:

import { printBitmap } from "@/uni_modules/XF-sunmiPrinterUTS";
import { PrintBitmapOptions } from "@/uni_modules/XF-sunmiPrinterUTS/utssdk/interface.uts";

let options = {
  complete: (res : any) => {
    console.log(res)
  }
} as PrintBitmapOptions;
printBitmap(options);

可用性

Android系统

可提供的1.0.0及更高版本

printBitmapCustom

打印图片

uni-app项目中(nvue)调用示例:

import { printBitmapCustom } from "@/uni_modules/XF-sunmiPrinterUTS"

printBitmapCustom({
  complete: (res) => {
        console.log(res)
  }
});

uni-app x项目(uvue)中调用示例:

import { printBitmapCustom } from "@/uni_modules/XF-sunmiPrinterUTS";
import { PrintBitmapCustomOptions } from "@/uni_modules/XF-sunmiPrinterUTS/utssdk/interface.uts";

let options = {
  complete: (res : any) => {
    console.log(res)
  }
} as PrintBitmapCustomOptions;
printBitmapCustom(options);

可用性

Android系统

可提供的1.0.0及更高版本

printBarCode

打印⼀维条码

uni-app项目中(nvue)调用示例:

import { printBarCode } from "@/uni_modules/XF-sunmiPrinterUTS"

printBarCode({
  complete: (res) => {
        console.log(res)
  }
});

uni-app x项目(uvue)中调用示例:

import { printBarCode } from "@/uni_modules/XF-sunmiPrinterUTS";
import { PrintBarCodeOptions } from "@/uni_modules/XF-sunmiPrinterUTS/utssdk/interface.uts";

let options = {
  complete: (res : any) => {
    console.log(res)
  }
} as PrintBarCodeOptions;
printBarCode(options);

可用性

Android系统

可提供的1.0.0及更高版本

printQRCode

打印QR条码

uni-app项目中(nvue)调用示例:

import { printQRCode } from "@/uni_modules/XF-sunmiPrinterUTS"

printQRCode({
  complete: (res) => {
        console.log(res)
  }
});

uni-app x项目(uvue)中调用示例:

import { printQRCode } from "@/uni_modules/XF-sunmiPrinterUTS";
import { PrintQRCodeOptions } from "@/uni_modules/XF-sunmiPrinterUTS/utssdk/interface.uts";

let options = {
  complete: (res : any) => {
    console.log(res)
  }
} as PrintQRCodeOptions;
printQRCode(options);

可用性

Android系统

可提供的1.0.0及更高版本

print2DCode

打印⼆维条码

uni-app项目中(nvue)调用示例:

import { print2DCode } from "@/uni_modules/XF-sunmiPrinterUTS"

print2DCode({
  complete: (res) => {
        console.log(res)
  }
});

uni-app x项目(uvue)中调用示例:

import { print2DCode } from "@/uni_modules/XF-sunmiPrinterUTS";
import { Print2DCodeOptions } from "@/uni_modules/XF-sunmiPrinterUTS/utssdk/interface.uts";

let options = {
  complete: (res : any) => {
    console.log(res)
  }
} as Print2DCodeOptions;
print2DCode(options);

可用性

Android系统

可提供的1.0.0及更高版本

lineWrap

打印机⾛纸n⾏

uni-app项目中(nvue)调用示例:

import { lineWrap } from "@/uni_modules/XF-sunmiPrinterUTS"

lineWrap({
  complete: (res) => {
        console.log(res)
  }
});

uni-app x项目(uvue)中调用示例:

import { lineWrap } from "@/uni_modules/XF-sunmiPrinterUTS";
import { LineWrapOptions } from "@/uni_modules/XF-sunmiPrinterUTS/utssdk/interface.uts";

let options = {
  complete: (res : any) => {
    console.log(res)
  }
} as LineWrapOptions;
lineWrap(options);

可用性

Android系统

可提供的1.0.0及更高版本

cutPaper

切刀

uni-app项目中(nvue)调用示例:

import { cutPaper } from "@/uni_modules/XF-sunmiPrinterUTS"

cutPaper({
  complete: (res) => {
        console.log(res)
  }
});

uni-app x项目(uvue)中调用示例:

import { cutPaper } from "@/uni_modules/XF-sunmiPrinterUTS";
import { PrintOptions } from "@/uni_modules/XF-sunmiPrinterUTS/utssdk/interface.uts";

let options = {
  complete: (res : any) => {
    console.log(res)
  }
} as PrintOptions;
cutPaper(options);

可用性

Android系统

可提供的1.0.0及更高版本

getCutPaperTimesSync

获取切⼑次数

uni-app项目中(nvue)调用示例:

import { getCutPaperTimesSync } from "@/uni_modules/XF-sunmiPrinterUTS"

getCutPaperTimesSync();

uni-app x项目(uvue)中调用示例:

import { getCutPaperTimesSync } from "@/uni_modules/XF-sunmiPrinterUTS";

getCutPaperTimesSync();

可用性

Android系统

可提供的1.0.0及更高版本

openDrawer

打开钱箱

uni-app项目中(nvue)调用示例:

import { openDrawer } from "@/uni_modules/XF-sunmiPrinterUTS"

openDrawer({
  complete: (res) => {
        console.log(res)
  }
});

uni-app x项目(uvue)中调用示例:

import { openDrawer } from "@/uni_modules/XF-sunmiPrinterUTS";
import { PrintOptions } from "@/uni_modules/XF-sunmiPrinterUTS/utssdk/interface.uts";

let options = {
  complete: (res : any) => {
    console.log(res)
  }
} as PrintOptions;
openDrawer(options);

可用性

Android系统

可提供的1.0.0及更高版本

getOpenDrawerTimesSync

获取钱箱累计打开次数

uni-app项目中(nvue)调用示例:

import { getOpenDrawerTimesSync } from "@/uni_modules/XF-sunmiPrinterUTS"

getOpenDrawerTimesSync();

uni-app x项目(uvue)中调用示例:

import { getOpenDrawerTimesSync } from "@/uni_modules/XF-sunmiPrinterUTS";

getOpenDrawerTimesSync();

可用性

Android系统

可提供的1.0.0及更高版本

getDrawerStatusSync

获取当前的钱箱状态

uni-app项目中(nvue)调用示例:

import { getDrawerStatusSync } from "@/uni_modules/XF-sunmiPrinterUTS"

getDrawerStatusSync();

uni-app x项目(uvue)中调用示例:

import { getDrawerStatusSync } from "@/uni_modules/XF-sunmiPrinterUTS";

getDrawerStatusSync();

可用性

Android系统

可提供的1.0.0及更高版本

getForcedDoubleSync

获取全局字体倍⾼倍宽状态

uni-app项目中(nvue)调用示例:

import { getForcedDoubleSync } from "@/uni_modules/XF-sunmiPrinterUTS"

getForcedDoubleSync();

uni-app x项目(uvue)中调用示例:

import { getForcedDoubleSync } from "@/uni_modules/XF-sunmiPrinterUTS";

getForcedDoubleSync();

可用性

Android系统

可提供的1.0.0及更高版本

isForcedAntiWhiteSync

获取全局字体反⽩样式使能

uni-app项目中(nvue)调用示例:

import { isForcedAntiWhiteSync } from "@/uni_modules/XF-sunmiPrinterUTS"

isForcedAntiWhiteSync();

uni-app x项目(uvue)中调用示例:

import { isForcedAntiWhiteSync } from "@/uni_modules/XF-sunmiPrinterUTS";

isForcedAntiWhiteSync();

可用性

Android系统

可提供的1.0.0及更高版本

isForcedBoldSync

获取全局字体加粗样式使能

uni-app项目中(nvue)调用示例:

import { isForcedBoldSync } from "@/uni_modules/XF-sunmiPrinterUTS"

isForcedBoldSync();

uni-app x项目(uvue)中调用示例:

import { isForcedBoldSync } from "@/uni_modules/XF-sunmiPrinterUTS";

isForcedBoldSync();

可用性

Android系统

可提供的1.0.0及更高版本

isForcedUnderlineSync

获取全局字体下划线样式使能

uni-app项目中(nvue)调用示例:

import { isForcedUnderlineSync } from "@/uni_modules/XF-sunmiPrinterUTS"

isForcedUnderlineSync();

uni-app x项目(uvue)中调用示例:

import { isForcedUnderlineSync } from "@/uni_modules/XF-sunmiPrinterUTS";

isForcedUnderlineSync();

可用性

Android系统

可提供的1.0.0及更高版本

getForcedRowHeightSync

获取全局⾏⾼设定值

uni-app项目中(nvue)调用示例:

import { getForcedRowHeightSync } from "@/uni_modules/XF-sunmiPrinterUTS"

getForcedRowHeightSync();

uni-app x项目(uvue)中调用示例:

import { getForcedRowHeightSync } from "@/uni_modules/XF-sunmiPrinterUTS";

getForcedRowHeightSync();

可用性

Android系统

可提供的1.0.0及更高版本

getFontNameSync

获取当前的使⽤字体

uni-app项目中(nvue)调用示例:

import { getFontNameSync } from "@/uni_modules/XF-sunmiPrinterUTS"

getFontNameSync();

uni-app x项目(uvue)中调用示例:

import { getFontNameSync } from "@/uni_modules/XF-sunmiPrinterUTS";

getFontNameSync();

可用性

Android系统

可提供的1.0.0及更高版本

getPrinterDensitySync

获取打印机浓

uni-app项目中(nvue)调用示例:

import { getPrinterDensitySync } from "@/uni_modules/XF-sunmiPrinterUTS"

getPrinterDensitySync();

uni-app x项目(uvue)中调用示例:

import { getPrinterDensitySync } from "@/uni_modules/XF-sunmiPrinterUTS";

getPrinterDensitySync();

可用性

Android系统

可提供的1.0.0及更高版本

sendLCDCommand

发送顾显控制命令

uni-app项目中(nvue)调用示例:

import { sendLCDCommand } from "@/uni_modules/XF-sunmiPrinterUTS"

sendLCDCommand({
  complete: (res) => {
        console.log(res)
  }
});

uni-app x项目(uvue)中调用示例:

import { sendLCDCommand } from "@/uni_modules/XF-sunmiPrinterUTS";
import { SendLCDCommandOptions } from "@/uni_modules/XF-sunmiPrinterUTS/utssdk/interface.uts";

let options = {
  complete: (res : any) => {
    console.log(res)
  }
} as SendLCDCommandOptions;
sendLCDCommand(options);

可用性

Android系统

可提供的1.0.0及更高版本

sendLCDString

发送单⾏⽂本内容

uni-app项目中(nvue)调用示例:

import { sendLCDString } from "@/uni_modules/XF-sunmiPrinterUTS"

sendLCDString({
  complete: (res) => {
        console.log(res)
  }
});

uni-app x项目(uvue)中调用示例:

import { sendLCDString } from "@/uni_modules/XF-sunmiPrinterUTS";
import { SendLCDStringOptions } from "@/uni_modules/XF-sunmiPrinterUTS/utssdk/interface.uts";

let options = {
  complete: (res : any) => {
    console.log(res)
  }
} as SendLCDStringOptions;
sendLCDString(options);

可用性

Android系统

可提供的1.0.0及更高版本

sendLCDDoubleString

发送双⾏⽂本内容

uni-app项目中(nvue)调用示例:

import { sendLCDDoubleString } from "@/uni_modules/XF-sunmiPrinterUTS"

sendLCDDoubleString({
  complete: (res) => {
        console.log(res)
  }
});

uni-app x项目(uvue)中调用示例:

import { sendLCDDoubleString } from "@/uni_modules/XF-sunmiPrinterUTS";
import { SendLCDDoubleStringOptions } from "@/uni_modules/XF-sunmiPrinterUTS/utssdk/interface.uts";

let options = {
  complete: (res : any) => {
    console.log(res)
  }
} as SendLCDDoubleStringOptions;
sendLCDDoubleString(options);

可用性

Android系统

可提供的1.0.0及更高版本

SendLCDMultiString

发送多⾏⽂本内容

uni-app项目中(nvue)调用示例:

import { SendLCDMultiString } from "@/uni_modules/XF-sunmiPrinterUTS"

SendLCDMultiString({
  complete: (res) => {
        console.log(res)
  }
});

uni-app x项目(uvue)中调用示例:

import { SendLCDMultiString } from "@/uni_modules/XF-sunmiPrinterUTS";
import { SendLCDMultiStringOptions } from "@/uni_modules/XF-sunmiPrinterUTS/utssdk/interface.uts";

let options = {
  complete: (res : any) => {
    console.log(res)
  }
} as SendLCDMultiStringOptions;
SendLCDMultiString(options);

可用性

Android系统

可提供的1.0.0及更高版本

sendLCDFillString

发送⾃定义⼤⼩单⾏⽂本内容

uni-app项目中(nvue)调用示例:

import { sendLCDFillString } from "@/uni_modules/XF-sunmiPrinterUTS"

sendLCDFillString({
  complete: (res) => {
        console.log(res)
  }
});

uni-app x项目(uvue)中调用示例:

import { sendLCDFillString } from "@/uni_modules/XF-sunmiPrinterUTS";
import { SendLCDFillStringOptions } from "@/uni_modules/XF-sunmiPrinterUTS/utssdk/interface.uts";

let options = {
  complete: (res : any) => {
    console.log(res)
  }
} as SendLCDFillStringOptions;
sendLCDFillString(options);

可用性

Android系统

可提供的1.0.0及更高版本

sendLCDBitmap

发送图⽚显示内容

uni-app项目中(nvue)调用示例:

import { sendLCDBitmap } from "@/uni_modules/XF-sunmiPrinterUTS"

sendLCDBitmap({
  complete: (res) => {
        console.log(res)
  }
});

uni-app x项目(uvue)中调用示例:

import { sendLCDBitmap } from "@/uni_modules/XF-sunmiPrinterUTS";
import { SendLCDBitmapOptions } from "@/uni_modules/XF-sunmiPrinterUTS/utssdk/interface.uts";

let options = {
  complete: (res : any) => {
    console.log(res)
  }
} as SendLCDBitmapOptions;
sendLCDBitmap(options);

可用性

Android系统

可提供的1.0.0及更高版本

labelLocate

定位下⼀张标签

uni-app项目中(nvue)调用示例:

import { labelLocate } from "@/uni_modules/XF-sunmiPrinterUTS"

labelLocate({
  complete: (res) => {
        console.log(res)
  }
});

uni-app x项目(uvue)中调用示例:

import { labelLocate } from "@/uni_modules/XF-sunmiPrinterUTS";
import { PrintOptions } from "@/uni_modules/XF-sunmiPrinterUTS/utssdk/interface.uts";

let options = {
  complete: (res : any) => {
    console.log(res)
  }
} as PrintOptions;
labelLocate(options);

可用性

Android系统

可提供的1.0.0及更高版本

labelOutput

输出标签

uni-app项目中(nvue)调用示例:

import { labelOutput } from "@/uni_modules/XF-sunmiPrinterUTS"

labelOutput({
  complete: (res) => {
        console.log(res)
  }
});

uni-app x项目(uvue)中调用示例:

import { labelOutput } from "@/uni_modules/XF-sunmiPrinterUTS";
import { PrintOptions } from "@/uni_modules/XF-sunmiPrinterUTS/utssdk/interface.uts";

let options = {
  complete: (res : any) => {
    console.log(res)
  }
} as PrintOptions;
labelOutput(options);

可用性

Android系统

可提供的1.0.0及更高版本

隐私、权限声明

1. 本插件需要申请的系统权限列表:

2. 本插件采集的数据、发送的服务器地址、以及数据用途说明:

3. 本插件是否包含广告,如包含需详细说明广告表达方式、展示频率:

暂无用户评论。

使用中有什么不明白的地方,就向插件作者提问吧~ 我要提问