feat(events): guest checkout with email delivery, Stripe return flow, public ticket page #144
1 changed files with 2 additions and 7 deletions
feat(events): use the shared logo QR renderer in My Tickets
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EYwoAkZZmXMMmaBp4WGUBo
commit
89a1fcb030
|
|
@ -1,5 +1,6 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, onMounted, ref, watch } from 'vue'
|
import { computed, onMounted, ref, watch } from 'vue'
|
||||||
|
import { renderTicketQr } from '../lib/ticketQr'
|
||||||
import { RouterLink, onBeforeRouteLeave } from 'vue-router'
|
import { RouterLink, onBeforeRouteLeave } from 'vue-router'
|
||||||
import { useUserTickets } from '../composables/useUserTickets'
|
import { useUserTickets } from '../composables/useUserTickets'
|
||||||
import { useEvents } from '../composables/useEvents'
|
import { useEvents } from '../composables/useEvents'
|
||||||
|
|
@ -134,13 +135,7 @@ async function generateQRCode(ticketId: string) {
|
||||||
if (qrCodes.value[ticketId]) return qrCodes.value[ticketId]
|
if (qrCodes.value[ticketId]) return qrCodes.value[ticketId]
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const qrcode = await import('qrcode')
|
const dataUrl = await renderTicketQr(ticketId, { width: 200 })
|
||||||
const ticketUrl = `ticket://${ticketId}`
|
|
||||||
const dataUrl = await qrcode.toDataURL(ticketUrl, {
|
|
||||||
width: 200,
|
|
||||||
margin: 2,
|
|
||||||
color: { dark: '#000000', light: '#FFFFFF' }
|
|
||||||
})
|
|
||||||
qrCodes.value[ticketId] = dataUrl
|
qrCodes.value[ticketId] = dataUrl
|
||||||
return dataUrl
|
return dataUrl
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue