更新记录
1.0.0.1(2025-08-23)
下载此版本
优化
1.0.0(2025-08-23)
下载此版本
初始化
平台兼容性
云端兼容性
uni-app(4.07)
Vue2 |
Vue3 |
Chrome |
Safari |
app-vue |
app-nvue |
Android |
iOS |
鸿蒙 |
- |
√ |
× |
× |
√ |
√ |
√ |
- |
- |
微信小程序 |
支付宝小程序 |
抖音小程序 |
百度小程序 |
快手小程序 |
京东小程序 |
鸿蒙元服务 |
QQ小程序 |
飞书小程序 |
快应用-华为 |
快应用-联盟 |
√ |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
iasei-esc-printer
组件介绍
本组件是BLE蓝牙 esc 58mm小票打印组件,支持打印文字、分割线、二维码、条形码,支持连接蓝牙、模块化布局和小票预览。如果需要打印其它宽度的的小票,可以查看iasei-esc-printer代码,根据需要修改。
iasei-esc-printer 暴露方法
iasei-esc-printer 插槽
属性名 |
属性值 |
用法 |
说明 |
#default |
默认插槽 |
|
自定义小票布局 |
布局组件
iasei-esc-text 文字组件
属性说明
名称 |
类型 |
默认值 |
描述 |
text |
String |
'' |
文字内容 |
size |
'1','2' |
'1' |
字体大小 |
bold |
Boolean |
false |
是否加粗 |
align |
"lt" , "rt" , "ct" |
'lt' |
文字位置 |
iasei-esc-line 分割线
属性说明
名称 |
类型 |
默认值 |
描述 |
separator |
String |
'-' |
分割线内容 |
text |
String |
'' |
文字内容 |
align |
"lt" , "rt" , "ct" |
'ct' |
文字位置 |
iasei-esc-between 两边文字
属性说明
名称 |
类型 |
默认值 |
描述 |
textL |
String |
'' |
左边文字内容 |
textR |
String |
'' |
右边文字内容 |
size |
'1','2' |
'1' |
字体大小 |
bold |
Boolean |
false |
是否加粗 |
align |
"lt" , "rt" , "ct" |
'lt' |
文字位置 |
iasei-esc-qrcode 二维码
属性说明
名称 |
类型 |
默认值 |
描述 |
text |
String |
'' |
二维码内容,不支持中文 |
iasei-esc-barcode 条形码
属性说明
名称 |
类型 |
默认值 |
描述 |
text |
String |
'' |
条形码内容,仅支持长度为12位的数字字符串 |
使用方式
<template>
<view class="content">
<image class="logo" src="/static/logo.png"></image>
<button @click="handlePrint">打印小票</button>
<iasei-esc-printer ref="printer">
<iasei-esc-text size="2" align="ct" :bold="true" text="标题"></iasei-esc-text>
<iasei-esc-line separator="*"></iasei-esc-line>
<iasei-esc-text :text="'文字文字文文字文文字文文字文文字文字文字文字' + item" v-for="item in 5" :key="item"></iasei-esc-text>
<iasei-esc-line separator="-" text="-"></iasei-esc-line>
<iasei-esc-line align="lt" separator="-" text="左左"></iasei-esc-line>
<iasei-esc-line align="rt" separator="-" text="右右"></iasei-esc-line>
<iasei-esc-line align="ct" separator="-" text="中中"></iasei-esc-line>
<iasei-esc-line separator="-" text=" "></iasei-esc-line>
<iasei-esc-between text-l="左左" text-r="右右"></iasei-esc-between>
<iasei-esc-between text-l="左左" text-r="右右"></iasei-esc-between>
<iasei-esc-between text-l="左左" text-r="右右"></iasei-esc-between>
<iasei-esc-line separator="-" text=""></iasei-esc-line>
<iasei-esc-qrcode text="https://www.baidu.com"></iasei-esc-qrcode>
<iasei-esc-line separator="-" text=""></iasei-esc-line>
<iasei-esc-barcode text="1234567"></iasei-esc-barcode>
<iasei-esc-line separator=" " text=""></iasei-esc-line>
<iasei-esc-line separator=" " text=""></iasei-esc-line>
<iasei-esc-line separator=" " text=""></iasei-esc-line>
</iasei-esc-printer>
</view>
</template>
<script>
export default {
components: {
},
data() {
return {
show: true,
title: "Hello",
};
},
onLoad() {
},
methods: {
handlePrint(){
this.$refs.printer.open();
}
},
};
</script>
<style lang="scss" scoped>
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.logo {
height: 200rpx;
width: 200rpx;
margin-top: 200rpx;
margin-left: auto;
margin-right: auto;
margin-bottom: 50rpx;
}
.text-area {
display: flex;
justify-content: center;
}
.title {
font-size: 36rpx;
color: #8f8f94;
}
</style>