diff --git a/shopxo/app/plugins/vr_ticket/view/goods/ticket_card.html b/shopxo/app/plugins/vr_ticket/view/goods/ticket_card.html index e972a28..86a23ec 100644 --- a/shopxo/app/plugins/vr_ticket/view/goods/ticket_card.html +++ b/shopxo/app/plugins/vr_ticket/view/goods/ticket_card.html @@ -436,7 +436,7 @@ var VrTicketWallet = (function() { '
' + '
核销码
' + '
' + escapeHtml(ticket.short_code) + '
' + - '' + + '' + '
' + '
' + '
状态
' + @@ -487,7 +487,7 @@ var VrTicketWallet = (function() { '
' + '
核销码
' + '
' + escapeHtml(ticket.short_code) + '
' + - '' + + '' + '
' + verifiedBadge + '
' + @@ -605,7 +605,9 @@ var VrTicketWallet = (function() { function renderBarcode(shortCode) { try { var canvas = document.getElementById('vrBarcodeCanvas'); - if (!canvas || !shortCode) return; + if (!canvas) { console.warn('[Barcode] canvas not found'); return; } + if (!shortCode) { console.warn('[Barcode] shortCode empty'); return; } + if (typeof JsBarcode === 'undefined') { console.warn('[Barcode] JsBarcode not loaded'); return; } JsBarcode(canvas, shortCode, { format: 'CODE128', width: 2, @@ -615,7 +617,7 @@ var VrTicketWallet = (function() { margin: 5 }); } catch (e) { - console.warn('Barcode render failed:', e); + console.error('[Barcode] render error:', e.message, '| shortCode:', shortCode); } } diff --git a/shopxo/public/plugins/vr_ticket/static/js/ticket_card.js b/shopxo/public/plugins/vr_ticket/static/js/ticket_card.js index d58b479..0b1e28d 100644 --- a/shopxo/public/plugins/vr_ticket/static/js/ticket_card.js +++ b/shopxo/public/plugins/vr_ticket/static/js/ticket_card.js @@ -172,7 +172,7 @@ var VrTicketWallet = (function() { '
' + '
核销码
' + '
' + escapeHtml(ticket.short_code) + '
' + - '' + + '' + '
' + '
' + '
状态
' + @@ -223,7 +223,7 @@ var VrTicketWallet = (function() { '
' + '
核销码
' + '
' + escapeHtml(ticket.short_code) + '
' + - '' + + '' + '
' + verifiedBadge + '
' + @@ -334,7 +334,9 @@ var VrTicketWallet = (function() { function renderBarcode(shortCode) { try { var canvas = document.getElementById('vrBarcodeCanvas'); - if (!canvas || !shortCode) return; + if (!canvas) { console.warn('[Barcode] canvas not found'); return; } + if (!shortCode) { console.warn('[Barcode] shortCode empty'); return; } + if (typeof JsBarcode === 'undefined') { console.warn('[Barcode] JsBarcode not loaded'); return; } JsBarcode(canvas, shortCode, { format: 'CODE128', width: 2, @@ -344,7 +346,7 @@ var VrTicketWallet = (function() { margin: 5 }); } catch (e) { - console.warn('Barcode render failed:', e); + console.error('[Barcode] render error:', e.message, '| shortCode:', shortCode); } }