...
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
@using HushianWebApp.Service
|
||||
@inject AuthService AuthService
|
||||
<div class="text-end mb-3">
|
||||
<span class="badge bg-info p-2">نیاز برای ارتباط با کارشناسان وارد شود</span>
|
||||
</div>
|
||||
<div class=" group w-full">
|
||||
<Spinner Class="me-3" Type="SpinnerType.Dots" Color="SpinnerColor.Primary" Visible="@visible" />
|
||||
|
||||
@if (ID==0)
|
||||
{
|
||||
<label for="user-name" class="block mb-2 text-slate-600 font-bold">
|
||||
شماره همراه / نام کاربری
|
||||
</label>
|
||||
<div class="d-flex">
|
||||
|
||||
<div class="container-input" style="width:150px;margin-left:5px">
|
||||
<input disabled="@visible" style="text-align:center;height:30px" type="number" id="user-name" maxlength="64"
|
||||
@bind-value=Username title="نام کاربری را وارد کنید." class="input-form input_vk_1" required="" data-val="true" data-val-required="شماره همراه / نام کاربری را وارد کنید." name="Username">
|
||||
|
||||
</div>
|
||||
<Button disabled="visible" Color="ButtonColor.Primary" Type="ButtonType.Submit" @onclick="Login" class="btn-primary"
|
||||
style="text-align:center;height:30px">
|
||||
ورود
|
||||
</Button>
|
||||
</div>
|
||||
}
|
||||
else{
|
||||
<label for="user-name" class="block mb-2 text-slate-600 font-bold">
|
||||
جهت احراز کد ارسال شده را وارد کنید
|
||||
</label>
|
||||
|
||||
<div class="d-flex">
|
||||
|
||||
<div class="container-input" style="width:150px;margin-left:5px">
|
||||
<input style="text-align:center;height:30px" type="number" id="Code" maxlength="64"
|
||||
@bind-value=Code title="کد احراز" class="input-form input_vk_1" required="" data-val="true" name="Code">
|
||||
|
||||
</div>
|
||||
<Button Color="ButtonColor.Primary" Type="ButtonType.Submit" class="btn-dark"
|
||||
style="text-align:center;height:30px" @onclick="ver">
|
||||
احراز
|
||||
</Button>
|
||||
</div>
|
||||
}
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@code {
|
||||
private bool visible = false;
|
||||
[Parameter] public EventCallback OnMultipleOfThree { get; set; }
|
||||
public string Username { get; set; }
|
||||
public int ID { get; set; } = 0;
|
||||
public string Code { get; set; } = string.Empty;
|
||||
}
|
||||
@functions{
|
||||
async Task Login()
|
||||
{
|
||||
visible = true;
|
||||
ID= await AuthService.login(Username);
|
||||
visible = false;
|
||||
}
|
||||
async Task ver()
|
||||
{
|
||||
visible = true;
|
||||
if(await AuthService.Verificationlogin(ID, Code))
|
||||
await OnMultipleOfThree.InvokeAsync();
|
||||
visible = false;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user