emis-app/pages/print/bluetoothPrinter.vue
2024-08-09 01:05:36 +08:00

52 lines
801 B
Vue

<template>
<tpx-page>
<tpx-bluetooth-print ref="curPrint"></tpx-bluetooth-print>
</tpx-page>
</template>
<script>
export default {
computed: {
},
data () {
return {
pageLoading: true,
queryOption: {
imageUrl: '',
}
}
},
mounted () {
// 保证ref节点加载
this.initData();
},
unmounted() {
},
onLoad(option) {
this.queryOption = option
},
methods: {
initData(){
let urls = this.queryOption?.imageUrl?.split(",")
let prtCmdData = decodeURIComponent(this.queryOption?.prtCmdData || '')
this.pageLoading = false
if(urls?.length > 0) {
this.$refs.curPrint.startPrint({
imageUrl: urls,
prtCmdData
}, false)
} else {
this.showToast('缺少打印内容')
}
},
}
}
</script>
<style scoped lang="scss">
</style>