From 4a4b670c5c46f2a5c8352639b2ba18eb45a9d314 Mon Sep 17 00:00:00 2001 From: aihe <961836564@qq.com> Date: Wed, 24 Jul 2024 00:07:10 +0800 Subject: [PATCH] uu --- .../create-image-data-bycanvas.vue | 24 ++++++++--- .../tpx-bluetooth-print.vue | 13 +----- pages/print/courierNote.vue | 40 ------------------- 3 files changed, 20 insertions(+), 57 deletions(-) diff --git a/components/tpx-bluetooth-print/create-image-data-bycanvas.vue b/components/tpx-bluetooth-print/create-image-data-bycanvas.vue index 6f545cb..657c065 100644 --- a/components/tpx-bluetooth-print/create-image-data-bycanvas.vue +++ b/components/tpx-bluetooth-print/create-image-data-bycanvas.vue @@ -1,6 +1,6 @@ @@ -14,7 +14,20 @@ export default { }, computed: { - + canvSty(){ + let sty = `width:${this.canvasWidth}px;height:${this.canvasHeight}px;` + return sty + }, + convContSty(){ + // 缩放canvas的父级,绘图可以一屏宽度显示出来 + let bodyRpxWidth = 750 + var convRpxWidth = this.canvasWidth/(uni.upx2px(100)/100); + let convRpxHeight = this.canvasHeight/(uni.upx2px(100)/100) + let scale = bodyRpxWidth * 0.92 / convRpxWidth + let sty = `transform-origin: 0 0;transform: scale(${scale});height:${convRpxHeight * scale}rpx;` + sty += `margin-left:${bodyRpxWidth * 0.08 / 2}rpx;` + return sty + } }, data () { return { @@ -87,11 +100,10 @@ export default { \ No newline at end of file diff --git a/components/tpx-bluetooth-print/tpx-bluetooth-print.vue b/components/tpx-bluetooth-print/tpx-bluetooth-print.vue index 4b40bd8..f54b705 100644 --- a/components/tpx-bluetooth-print/tpx-bluetooth-print.vue +++ b/components/tpx-bluetooth-print/tpx-bluetooth-print.vue @@ -10,13 +10,8 @@