Name Last Update
..
android Loading commit data...
README.md Loading commit data...
package.json Loading commit data...

README.md

native-fast-printer

传统 nativeplugins Android 原生插件版高速标签打印模块。

能力

  • 经典蓝牙连接 / 断开 / 状态
  • 接收系统模板 JSON
  • 原生生成 TSC 指令
  • 文本、价格、条码、二维码、横线、图片
  • 特殊字符文本和图片走原生位图补丁

前端调用

const printer = uni.requireNativePlugin('native-fast-printer')

方法

  • connect(params, callback)
  • disconnect(callback)
  • isConnected(callback)
  • printTemplate(params, callback)

源码位置

  • 当前目录是源码主目录
  • 美国版/Food Labeling Management App UniApp/nativeplugins/native-fast-printer/ 是同步后的 uni-app 打包镜像

目录结构

  • android-src/src/com/foodlabel/nativeprinter/
    • NativeFastPrinterModule.java:uni-app 原生模块入口
    • transport/:蓝牙连接与 SDK 传输层
    • template/:系统模板 JSON → TSC 指令
    • debug/:调试状态与统计信息
    • support/:结果对象、JSON 读取、异常展开
  • android/:编译产物 AAR
  • sync-to-uniapp.sh:同步到 uni-app 打包镜像

说明

  1. 修改源码后执行 android-src/build-aar.sh
  2. 再执行 sync-to-uniapp.sh
  3. 重新打包 uni-app 自定义基座