| | |
| | | qrCodes: VisitorCodeDisplayTicket[] |
| | | } |
| | | |
| | | function wait(ms: number) { |
| | | return new Promise(resolve => setTimeout(resolve, ms)) |
| | | } |
| | | |
| | | const systemInfo = uni.getSystemInfoSync() |
| | | const { safeAreaInsets } = systemInfo |
| | | const parkFlowBottomPx = Math.max(24, Math.round(systemInfo.windowHeight / 8)) |
| | |
| | | ) |
| | | const visitorCodeCardMinHeightClass = computed(() => { |
| | | if (hasLongAccessAreaText.value) { |
| | | return currentOrderHasMultipleTickets.value ? 'min-h-[900rpx]' : 'min-h-[860rpx]' |
| | | return currentOrderHasMultipleTickets.value ? 'min-h-[940rpx]' : 'min-h-[900rpx]' |
| | | } |
| | | return currentOrderHasMultipleTickets.value ? 'min-h-[804rpx]' : 'min-h-[760rpx]' |
| | | return currentOrderHasMultipleTickets.value ? 'min-h-[844rpx]' : 'min-h-[800rpx]' |
| | | }) |
| | | const currentTicket = computed(() => { |
| | | if (!currentOrder.value) { |
| | |
| | | errorCorrectionLevel: 'M', |
| | | margin: 1, |
| | | }) |
| | | const size = 300 |
| | | const size = 400 |
| | | const moduleCount = qr.modules.size |
| | | const tileSize = size / moduleCount |
| | | const canvasId = 'visitorQrCanvas' |
| | |
| | | } |
| | | |
| | | context.draw(false, () => { |
| | | uni.canvasToTempFilePath({ |
| | | canvasId, |
| | | width: size, |
| | | height: size, |
| | | destWidth: size * 2, |
| | | destHeight: size * 2, |
| | | success: res => resolve(res.tempFilePath), |
| | | fail: reject, |
| | | void wait(500).then(() => { |
| | | uni.canvasToTempFilePath({ |
| | | canvasId, |
| | | width: size, |
| | | height: size, |
| | | destWidth: size * 2, |
| | | destHeight: size * 2, |
| | | success: res => resolve(res.tempFilePath), |
| | | fail: reject, |
| | | }) |
| | | }) |
| | | }) |
| | | }) |
| | |
| | | /> |
| | | <image |
| | | :src="currentOrder?.orderId === order.orderId ? currentTicket?.qrCode : order.qrCodes[0]?.qrCode" |
| | | class="h-[360rpx] w-[360rpx]" |
| | | class="h-[400rpx] w-[400rpx]" |
| | | mode="aspectFit" |
| | | /> |
| | | <image |
| | |
| | | position: fixed; |
| | | left: -9999px; |
| | | top: -9999px; |
| | | width: 300px; |
| | | height: 300px; |
| | | width: 400px; |
| | | height: 400px; |
| | | pointer-events: none; |
| | | } |
| | | </style> |