1 Star 0 Fork 3

BossDing-2020 / BTPrinter

forked from 山野羡民 / BTPrinter 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

JS调用原生方法

显示消息短提示:

Bluetooth.showToast('提示语');

显示消息对话框:

Bluetooth.showAlert('提示语');

显示/关闭等待对话框:

Bluetooth.showProgress('提示语');
Bluetooth.closeProgress();

检查蓝牙是否开启:

if (Bluetooth.isBluetoothEnabled()) {
    Bluetooth.showToast('蓝牙已打开');
} else {
    Bluetooth.showToast('蓝牙未打开');
}

开启蓝牙:

Bluetooth.enableBluetooth();

关闭蓝牙:

Bluetooth.disableBluetooth();

打开蓝牙设置(配对):

Bluetooth.openBluetoothSettings();

获取已配对蓝牙设备:

var json = Bluetooth.getPairedDevice();
Bluetooth.showAlert(json);
[{"address":"DC:0D:30:60:A1:F3","name":"Printer001"},{"address":"54:DC:1D:57:7D:57","name":"cool1 dual"},{"address":"E4:F8:9C:66:5A:B6","name":"LIYUJIANG"}]

连接蓝牙打印机:

Bluetooth.connectPrinter('DC:0D:30:60:A1:F3');

打印测试:

var json = '{}';
Bluetooth.printPaper(json);

空文件

简介

蓝牙打印机,热敏纸打印机,小票打印机,蓝牙热敏纸小票打印机。封装原生方法映射到JS给H5调用(JsBridge) 展开 收起
Android
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Android
1
https://gitee.com/BossDing/BTPrinter.git
git@gitee.com:BossDing/BTPrinter.git
BossDing
BTPrinter
BTPrinter
master

搜索帮助

14c37bed 8189591 565d56ea 8189591