- Inizio pagina ScanNew
This commit is contained in:
@ -38,7 +38,7 @@
|
|||||||
private bool showCodiceCliente { get; set; } = false;
|
private bool showCodiceCliente { get; set; } = false;
|
||||||
private bool showForm { get; set; } = false;
|
private bool showForm { get; set; } = false;
|
||||||
private InvitoEventoViewModel invito { get; set; } = new InvitoEventoViewModel();
|
private InvitoEventoViewModel invito { get; set; } = new InvitoEventoViewModel();
|
||||||
private Component_Registrazione registrazione { get; set; }
|
private Component_Registrazione registrazione { get; set; } = new();
|
||||||
|
|
||||||
private string codiceFornito { get; set; }
|
private string codiceFornito { get; set; }
|
||||||
|
|
||||||
|
|||||||
@ -1,9 +1,13 @@
|
|||||||
@page "/activate-qr-scan"
|
@page "/activate-qr-scan"
|
||||||
@using StandManager.Components.Layout
|
@using StandManager.Components.Layout
|
||||||
@inject NavigationManager Nav
|
@inject NavigationManager Nav
|
||||||
|
|
||||||
@layout PublicLayout
|
@layout PublicLayout
|
||||||
|
|
||||||
|
@inject IJSRuntime JS
|
||||||
|
@inject BodyClassService BodyClass
|
||||||
|
@rendermode InteractiveServer
|
||||||
|
|
||||||
|
<PageTitle>Scan Code</PageTitle>
|
||||||
<div class="page" style="min-height: 100dvh;">
|
<div class="page" style="min-height: 100dvh;">
|
||||||
<div class="page-wrapper" style="min-height: 100dvh;">
|
<div class="page-wrapper" style="min-height: 100dvh;">
|
||||||
<div class="container container-tight py-4 d-flex flex-column" style="min-height: 100dvh;">
|
<div class="container container-tight py-4 d-flex flex-column" style="min-height: 100dvh;">
|
||||||
@ -14,7 +18,7 @@
|
|||||||
class="btn btn-icon btn-ghost-secondary rounded-circle"
|
class="btn btn-icon btn-ghost-secondary rounded-circle"
|
||||||
aria-label="Chiudi"
|
aria-label="Chiudi"
|
||||||
@onclick="OnClose">
|
@onclick="OnClose">
|
||||||
<span class="ti ti-x fs-2"></span>
|
<i class="fa fa-x footer-icon"></i>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<div class="flex-fill"></div>
|
<div class="flex-fill"></div>
|
||||||
@ -23,51 +27,79 @@
|
|||||||
class="btn btn-icon btn-ghost-secondary rounded-circle"
|
class="btn btn-icon btn-ghost-secondary rounded-circle"
|
||||||
aria-label="Aiuto"
|
aria-label="Aiuto"
|
||||||
@onclick="OnHelp">
|
@onclick="OnHelp">
|
||||||
<span class="ti ti-help fs-2"></span>
|
<i class="fa fa-question footer-icon"></i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Center content -->
|
@if (openManual)
|
||||||
<div class="d-flex flex-column align-items-center justify-content-center text-center flex-fill px-3">
|
{
|
||||||
<div class="mb-5">
|
<div class="d-flex flex-column align-items-center justify-content-center text-center flex-fill px-3">
|
||||||
<div class="qr-shell">
|
<div class="row">
|
||||||
<span class="ti ti-qrcode qr-icon"></span>
|
<div class="col-12 mb-3">
|
||||||
|
<RadzenTextBox @bind-Value="@registrationCode" Placeholder="Inserirci il codice" Style="width: 100%;" />
|
||||||
|
@if (!string.IsNullOrEmpty(invalidCode))
|
||||||
|
{
|
||||||
|
<div class="text-danger mt-1">@invalidCode</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
<div class="col-6 mb-3">
|
||||||
|
<button type="button" class="btn btn-primary w-100" @onclick="GoTo">
|
||||||
|
Invia
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="col-6 mb-3">
|
||||||
|
<button type="button" class="btn btn-default w-100" @onclick="UndoChoice">
|
||||||
|
Annulla
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
<!-- corner accents -->
|
<!-- Bottom actions -->
|
||||||
<span class="qr-corner tl"></span>
|
@if (!openManual && !openScan)
|
||||||
<span class="qr-corner tr"></span>
|
{
|
||||||
<span class="qr-corner bl"></span>
|
<!-- Center content -->
|
||||||
<span class="qr-corner br"></span>
|
<div class="d-flex flex-column align-items-center justify-content-center text-center flex-fill px-3">
|
||||||
|
<div class="mb-5">
|
||||||
|
<div class="qr-shell">
|
||||||
|
<span class="ti ti-qrcode qr-icon"></span>
|
||||||
|
|
||||||
|
<!-- corner accents -->
|
||||||
|
<span class="qr-corner tl"></span>
|
||||||
|
<span class="qr-corner tr"></span>
|
||||||
|
<span class="qr-corner bl"></span>
|
||||||
|
<span class="qr-corner br"></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="max-width: 320px;">
|
||||||
|
<h1 class="h2 mb-2 fw-bold">Scan QR Code</h1>
|
||||||
|
<p class="text-secondary mb-0">
|
||||||
|
Align the QR code within the frame to automatically detect and identify the client.
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="max-width: 320px;">
|
<div class="pb-4">
|
||||||
<h1 class="h2 mb-2 fw-bold">Scan QR Code</h1>
|
<div class="d-grid gap-3">
|
||||||
<p class="text-secondary mb-0">
|
<button type="button"
|
||||||
Align the QR code within the frame to automatically detect and identify the client.
|
class="btn btn-lg btn-primary d-inline-flex align-items-center justify-content-center gap-2"
|
||||||
</p>
|
@onclick="OnScan">
|
||||||
|
<span class="ti ti-scan fs-3"></span>
|
||||||
|
<span>Scan Code</span>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<button type="button"
|
||||||
|
class="btn btn-link text-secondary fw-bold"
|
||||||
|
@onclick="OnManual">
|
||||||
|
Enter code manually
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="height: .5rem;"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
}
|
||||||
|
|
||||||
<!-- Bottom actions -->
|
|
||||||
<div class="pb-4">
|
|
||||||
<div class="d-grid gap-3">
|
|
||||||
<button type="button"
|
|
||||||
class="btn btn-lg btn-primary d-inline-flex align-items-center justify-content-center gap-2"
|
|
||||||
@onclick="OnScan">
|
|
||||||
<span class="ti ti-scan fs-3"></span>
|
|
||||||
<span>Scan Code</span>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<button type="button"
|
|
||||||
class="btn btn-link text-secondary fw-bold"
|
|
||||||
@onclick="OnManual">
|
|
||||||
Enter code manually
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div style="height: .5rem;"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -79,26 +111,46 @@
|
|||||||
[Parameter] public EventCallback Scan { get; set; }
|
[Parameter] public EventCallback Scan { get; set; }
|
||||||
[Parameter] public EventCallback Manual { get; set; }
|
[Parameter] public EventCallback Manual { get; set; }
|
||||||
|
|
||||||
|
private bool openManual { get; set; } = false;
|
||||||
|
private bool openScan { get; set; } = false;
|
||||||
|
private string registrationCode { get; set; }
|
||||||
|
private string invalidCode = string.Empty;
|
||||||
|
|
||||||
private async Task OnClose()
|
private async Task OnClose()
|
||||||
{
|
{
|
||||||
if (Close.HasDelegate) await Close.InvokeAsync();
|
Nav.NavigateTo("/");
|
||||||
else Nav.NavigateTo("/");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task OnHelp()
|
private async Task OnHelp()
|
||||||
{
|
{
|
||||||
if (Help.HasDelegate) await Help.InvokeAsync();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task OnScan()
|
private async Task OnScan()
|
||||||
{
|
{
|
||||||
if (Scan.HasDelegate) await Scan.InvokeAsync();
|
|
||||||
// qui poi ci attacchi la logica di attivazione camera/scan
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task OnManual()
|
private async Task OnManual()
|
||||||
{
|
{
|
||||||
if (Manual.HasDelegate) await Manual.InvokeAsync();
|
openManual = true;
|
||||||
// es: Nav.NavigateTo("/enter-code");
|
}
|
||||||
|
|
||||||
|
private async Task GoTo()
|
||||||
|
{
|
||||||
|
var code = Guid.Empty;
|
||||||
|
|
||||||
|
if (Guid.TryParse(registrationCode, out code))
|
||||||
|
{
|
||||||
|
var iscrizione = await _managerService.IscrizioneEventoService.RicercaPer(filtro: x => x.Id == code);
|
||||||
|
|
||||||
|
var ok = await _dialogService.Confirm($"Il numero di persone indicate per questo evento è {iscrizione.Partecipanti}", $"Benvenuto {iscrizione.RagioneSociale}", new ConfirmOptions { OkButtonText = "Sì", CancelButtonText = "No", Width = "400px" });
|
||||||
|
}
|
||||||
|
else invalidCode = "Il codice inserito non risulta corretto!";
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task UndoChoice()
|
||||||
|
{
|
||||||
|
openManual = false;
|
||||||
|
openScan = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user