更新记录
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 | 鸿蒙 | 微信小程序 |
|---|---|---|---|---|---|
| - | - | - | - | - | - |
创印蓝牙打印插件
使用方法
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)
}
})

收藏人数:
下载插件并导入HBuilderX
下载插件ZIP
赞赏(0)
下载 16
赞赏 0
下载 10633949
赞赏 1792
赞赏
京公网安备:11010802035340号