更新记录
1.0.1(2024-08-29)
下载此版本
适配各类打印机机型 如有问题请留言 wifi打印 蓝牙打印 适配斑马等一系列打印 指令采用的是ZPL
平台兼容性
App |
快应用 |
微信小程序 |
支付宝小程序 |
百度小程序 |
字节小程序 |
QQ小程序 |
HBuilderX 3.7.8 app-vue |
× |
× |
× |
× |
× |
× |
钉钉小程序 |
快手小程序 |
飞书小程序 |
京东小程序 |
× |
× |
× |
× |
H5-Safari |
Android Browser |
微信浏览器(Android) |
QQ浏览器(Android) |
Chrome |
IE |
Edge |
Firefox |
PC-Safari |
× |
× |
× |
× |
× |
× |
× |
× |
× |
插件使用说明如下 下载我的插件ZIP 解压后是一个print.js文件 引入方式如下,自己引入哦
<template>
<view>
<view style="
text-align: center;
padding: 10rpx 0;
border: 1rpx solid #ccc;
border-radius: 15rpx;
" class="uni-flex uni-row">
<view class="flex-item">
<button type="primary" plain size="mini" @click="print('192.168.3.254', 6101)">
打印测试wifi
</button>
<button type="primary" plain size="mini" @click="print()">打印测试蓝牙</button>
</view>
</view>
</view>
</template>
<script>
import Print from '@/common/print.js';
export default {
data() {
return {
jsons: `^XA
^CW1,E:SIMHEI.FNT
^FO10,10^GB760,1180,3^FS
^FX Third section with bar code.
^BY5,3,140
^FO100,40^BC^FD12345678^FS
^FX Second section with recipient address and permit information.
^CFE,31
^FO50,240^FDChannel Code:^FS
^FO50,370^FDPCS:^FS
^FO50,420^FDBag No:^FS
^FO50,470^FDWeight:^FS
^FO50,520^FDProduct:^FS
^FO50,570^FDProt:^FS
^FO50,670^FDPrint:^FS
^FO50,870^FDprompt:^FS
^CFE,31
^FO320,240^FB400,3,0,L^FDccc^FS
^FO320,370^FB400,1,0,L^FD3^FS
^FO320,420^FB400,1,0,L^FD003^FS
^FO320,470^FB400,1,0,L^FD1.016^FS
^FO320,520^FB400,1,0,L^FDDK;FE;CX^FS
^FO320,570^FB400,3,0,L^FDPROT^FS
^FO320,670^FB400,1,0,L^FD2024-08-29 16:39:38^FS
^FO320,870^FB400,1,0,L^FDPROMPT^FS
^CFE,40
^FO220,740^FB400,3,0,L^FDMade In China^FS
^XZ`
};
},
methods: {
print(ip, port) {
// { //wifi打印
let print = new Print(this.jsons);
print.printIp(ip, port);
// }
// { 蓝牙打印
// let print = new Print(this.jsons);
// print.initPrinterList();
// print.printBluetoothAdapter();
// }
}
}
};
</script>
<style scoped>
page {
padding: 0;
margin: 0;
}
.picked {
background-color: lavender;
}
</style>