更新记录

0.0.1(2024-08-10) 下载此版本

新增打印机打印队列


平台兼容性

Vue2 Vue3
App 快应用 微信小程序 支付宝小程序 百度小程序 字节小程序 QQ小程序
HBuilderX 3.7.6 app-vue app-nvue × × × × × ×
钉钉小程序 快手小程序 飞书小程序 京东小程序
× × × ×
H5-Safari Android Browser 微信浏览器(Android) QQ浏览器(Android) Chrome IE Edge Firefox PC-Safari
× × × × × × × × ×

开发环境

  • manifest.json 需要将SQLLite(数据库)开启
  • 使用打印SDK https://ext.dcloud.net.cn/plugin?id=462

导入插件

import printerServiceV2 from '@/util/printerService/printerServiceV2';

打印队列运行

printerServiceV2.openPrinterDb(function(){
    console.log('开始运行打印任务。。。')
    printerServiceV2.deletePrinterTastAll()
    printerServiceV2.runPrinter()
})

打印内容实例

let data = {"mer_id":65,"uid":["cashier6"],"msg_type":"printer","data":{"merid":65,"time":,"device":"f1fb3a2379e525e22e9ba61f164e7343","printer_location":"192.168.0.202","data":{"printer_type":0,"printer_location":"192.168.0.202","content":[{"text":"测试门店","center":"center","font":"normal","zoom":1,"rotatin":0},{"text":"店内(点菜单)","center":"center","font":"normal","bottom":"2","reversemode":0,"rightspacing":10,"zoom":2,"rotatin":0},{"text":"桌号:B001","center":"center","font":"normal","bottom":"2","reversemode":0,"rightspacing":10,"zoom":2,"rotatin":0},{"text":"--------------------------------","center":"left","font":"normal","bottom":"1"},{"text":"人数:1","center":"left","font":"normal","bottom":"1"},{"text":"订单编号:","center":"left","font":"normal","bottom":"1"},{"text":"下单时间:2024-07-31 19:02:03","center":"left","font":"normal","bottom":"1"},{"text":"--------------------------------","center":"left","font":"normal","bottom":"1"},{"title":["商品名称","单价","数量","小计"],"left":[0,43,62,77],"center":"left","font":"normal","bottom":"1"},{"text":"--------------------------------","center":"left","font":"normal","bottom":"1"},{"title":["金针菇牛肉卷1","25.00","2份","50.00"],"left":[0,43,62,77],"center":"left","font":"normal","bottom":"1"},{"text":"备注:冷上热待","center":"left","font":"normal","bottom":"1"},{"title":["金针菇牛肉卷1","25.00","2份","50.00"],"left":[0,43,62,77],"center":"left","font":"normal","bottom":"1"},{"title":["毛豆鸡丁(中)","10.00","1份","10.00"],"left":[0,43,62,77],"center":"left","font":"normal","bottom":"1"},{"title":["拍黄瓜-复制1","3.00","1份","3.00"],"left":[0,43,62,77],"center":"left","font":"normal","bottom":"1"},{"title":["(退)(必)不","4.00","2份","8.00"],"left":[0,43,62,77],"center":"left","font":"normal","bottom":"1"},{"text":"参与优惠商品","center":"left","font":"normal","bottom":"1"},{"title":["(退)(必)山","40.00","1份","40.00"],"left":[0,43,62,77],"center":"left","font":"normal","bottom":"1"},{"text":"楂排骨","center":"left","font":"normal","bottom":"1"},{"title":["(退)(必)爆","35.55","1份","35.55"],"left":[0,43,62,77],"center":"left","font":"normal","bottom":"1"},{"text":"炒猪肝","center":"left","font":"normal","bottom":"1"},{"text":"--------------------------------","center":"left","font":"normal","bottom":"1"},{"text":"打印时间:2024-08-10 15:39:46","center":"center","font":"normal","bottom":"1"},{"text":"----#1完----","center":"center","font":"normal","bottom":"4"}]},"sn":"printer","order_id":2904}}

添加打印任务

printerServiceV2.addPrinter(data)

隐私、权限声明

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

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

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

许可协议

MIT协议

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