adjust signature qr

pull/349/head
Pete Matsyburka 1 year ago
parent 93d2b76eae
commit 9e4ec11e33

@ -156,7 +156,7 @@
class="top-0 bottom-0 right-0 left-0 absolute bg-white rounded-2xl m-0.5" class="top-0 bottom-0 right-0 left-0 absolute bg-white rounded-2xl m-0.5"
/> />
<div <div
v-show="isShowQr" v-if="isShowQr"
class="top-0 bottom-0 right-0 left-0 absolute bg-base-content/10 rounded-2xl" class="top-0 bottom-0 right-0 left-0 absolute bg-base-content/10 rounded-2xl"
> >
<div <div
@ -172,13 +172,13 @@
</div> </div>
<div class="flex items-center justify-center w-full h-full p-4"> <div class="flex items-center justify-center w-full h-full p-4">
<div <div
v-if="withQrButton"
ref="qr"
class="bg-white p-4 rounded-xl h-full" class="bg-white p-4 rounded-xl h-full"
> >
<canvas <canvas
ref="qrCanvas" ref="qrCanvas"
class="h-full" class="h-full"
width="132"
height="132"
/> />
</div> </div>
</div> </div>
@ -340,18 +340,6 @@ export default {
this.$refs.canvas.getContext('2d').scale(scale, scale) this.$refs.canvas.getContext('2d').scale(scale, scale)
} }
if (this.withQrButton) {
import('qr-creator').then(({ default: Qr }) => {
Qr.render({
text: `${document.location.origin}/p/${this.submitterSlug}?f=${this.field.uuid.split('-')[0]}`,
radius: 0.0,
ecLevel: 'H',
background: null,
size: 132
}, this.$refs.qrCanvas)
})
}
}) })
if (this.$refs.canvas) { if (this.$refs.canvas) {
@ -406,6 +394,20 @@ export default {
showQr () { showQr () {
this.isShowQr = true this.isShowQr = true
this.$nextTick(() => {
import('qr-creator').then(({ default: Qr }) => {
if (this.$refs.qrCanvas) {
Qr.render({
text: `${document.location.origin}/p/${this.submitterSlug}?f=${this.field.uuid.split('-')[0]}`,
radius: 0.0,
ecLevel: 'H',
background: null,
size: 132
}, this.$refs.qrCanvas)
}
})
})
this.startCheckSignature() this.startCheckSignature()
}, },
hideQr () { hideQr () {

Loading…
Cancel
Save