更新记录

1.0.6(2025-09-24) 下载此版本

修复连接打印机之后,打印机中途重启丢失连接的问题。

1.0.5(2025-09-13) 下载此版本

增加对 qrcode 的支持

1.0.4(2025-09-12) 下载此版本

更新文档

查看更多

平台兼容性

uni-app(4.07)

Vue2 Vue3 Chrome Safari app-vue app-nvue Android iOS 鸿蒙
- - - - - - - -
微信小程序 支付宝小程序 抖音小程序 百度小程序 快手小程序 京东小程序 鸿蒙元服务 QQ小程序 飞书小程序 快应用-华为 快应用-联盟
- - - - - - - - - -

uni-app x(4.07)

Chrome Safari Android iOS 鸿蒙 微信小程序
- - - - - -

创印蓝牙打印插件

使用方法

Demo

CPCL 打印指令

import PrintCPCL from '@/uni_modules/chuangyin-bluetooth/utils/print_cpcl.js'
const cpcl = new PrintCPCL()

cpcl.text_bold('hello, world!')
cpcl.text('欢迎使用创印智能打印机!')
cpcl.qrcode_right('二维码内容')
cpcl.lineX()  // 打印横线
const data = cpcl.render()

POS/ESC 打印指令

import PrintPOS from '@/uni_modules/chuangyin-bluetooth/utils/print_pos.js'
const pos = new PrintPOS()

pos.text_bold('hello, world!')
pos.text('欢迎使用创印智能打印机!')
pos.qrcode('二维码内容')
const data = pos.render()

蓝牙打印机

import BluetoothPrinter from '@/uni_modules/chuangyin-bluetooth/utils/bluetooth_printer.js'
const printer = new BluetoothPrinter(uni)
printer.registeredDevices = ['GP-M421-87F6']  // 此处为打印机的蓝牙设备名称
// getState 会基于上面注册的蓝牙打印机名称自动连接打印机并调用打印
printer.getState({  
  success: (res) => {
    printer.writeBuffer(data)
  }  
})

隐私、权限声明

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

<uses-permission android:name=\"android.permission.BLUETOOTH\"/>

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

插件不采集任何数据

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

许可协议

MIT协议