mirror of
https://github.com/yummy4friends/y4f.git
synced 2024-12-27 22:48:19 +01:00
Add kunden login index
This commit is contained in:
parent
7b8db08d99
commit
a9418aea33
@ -1,23 +1,58 @@
|
||||
@page "/"
|
||||
@layout Startseite
|
||||
@page "/"
|
||||
@layout Startseite
|
||||
|
||||
@inject HttpClient Http
|
||||
@inject Blazored.LocalStorage.ISyncLocalStorageService localStorage
|
||||
|
||||
<PageTitle>Yummy4Friends</PageTitle>
|
||||
|
||||
|
||||
<body style='--blazor-load-percentage: 100%; --blazor-load-percentage-text: "100%"; background-color:#C7FFD5;'>
|
||||
|
||||
<div class="container col-lg-6 col-md-9 col-sm-12 d-flex flex-column " id="content" style=" padding-left:10%; padding-right:10%;">
|
||||
<center><h1>Herzlich Willkommen!</h1></center>
|
||||
<div class="container col-lg-6 col-md-9 col-sm-12 d-flex flex-column " id="content" style=" padding-left:10%; padding-right:10%;">
|
||||
<center><h1>Herzlich Willkommen!</h1></center>
|
||||
|
||||
<img src="assets/Logo_new.png" class="img" title="logo image">
|
||||
<img src="assets/Logo_new.png" class="img" title="logo image">
|
||||
|
||||
<button type="submit" id="button1" class="btn">QR-Code einscannen</button>
|
||||
<button type="submit" id="button1" class="btn">QR-Code einscannen</button>
|
||||
|
||||
<input type="text" class="form-control" id="qrcode" placeholder="Zugangscode eintragen" name="qrcode">
|
||||
|
||||
<button type="submit" id="button1" class="btn">Bestätigen</button>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="qrcode" placeholder="Zugangscode eintragen" name="qrcode" @bind-value="@qrcodeValue">
|
||||
|
||||
<button type="submit" id="button1" class="btn" @onclick="@(() => CheckCode())">Bestätigen</button>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
|
||||
|
||||
@code {
|
||||
private string qrcodeValue;
|
||||
private List<Kunde> kunden = new List<Kunde>();
|
||||
|
||||
public void CheckCode()
|
||||
{
|
||||
foreach (var kunde in kunden)
|
||||
{
|
||||
if (kunde.Code == qrcodeValue)
|
||||
{
|
||||
localStorage.SetItem("kunde", kunde);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
kunden = await Http.GetFromJsonAsync<List<Kunde>>("https://localhost:7076/api/kunden");
|
||||
}
|
||||
|
||||
|
||||
|
||||
public class Kunde
|
||||
{
|
||||
public int Idkunde { get; set; }
|
||||
public string Code { get; set; }
|
||||
public int Treuepunkte { get; set; }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user