插件说明
调用联迪MifareOne卡及打印 - DCloud 插件市场
/**
* 调用刷卡
*/
const card = uni.requireNativePlugin("Asa-liandi_Mifare")
card.getMifareOne((res) => {console.log(res)}) //开始刷卡
card.getDataUid(res => {console.log(res)}) //关闭服务
/**
* 调用打印机
*/
[调用联迪MifareOne卡及打印 - DCloud 插件市场](https://ext.dcloud.net.cn/plugin?id=10353)
const getPrint = uni.requireNativePlugin("Asa-liandi_Print")
let data = {json:[
{content: "title", //标题 固定值
font:"Pos机收款"
},
{content: "content", //内容打印 固定值
font:"时间:2020-11-11", //内容
size: "1", //大小 1小 2适中 3特大
alignment:"1" // 位置 1 左 2 中 3右
},
{content: "content",
font:"卡号:33333333333333333",
size: "2", //大小 1小 2适中 3特大
alignment:"1" // 位置 1 左 2 中 3右
},
{content: "content",
font:"开票类型:消费时开票",
size: "3", //大小 1小 2适中 3特大
alignment:"1" // 位置 1 左 2 中 3右
},
{
content: "code",//一维码 固定值
font:"123454567", //一维码内容
alignment:"2" // 位置 1左 2中 3右
},
{
content: "QrCode", //二维码
font:"123454567",
alignment:"2" // 位置 1左 2中 3右
},
{ //图片
content: "img", // 图片必须是相册中的图片,可以在相册中新建文件夹,必须位于相册文件夹下 相册文件夹名 DCIM
font:"2.jpg", //新建文件夹 示例 img/2.jpg img:文件夹名称
alignment:"1" // 位置 1左 2中 3右
}
]
}
getPrint.printer({content: data}, res => {console.log(res)}) //开始打印 刷卡参数参考data
[调用联迪MifareOne卡及打印 - DCloud 插件市场](https://ext.dcloud.net.cn/plugin?id=10353)