parent
baf5300439
commit
359a1a1966
@ -86,6 +86,11 @@
|
|||||||
></p-progressSpinner>
|
></p-progressSpinner>
|
||||||
</button>
|
</button>
|
||||||
</p>
|
</p>
|
||||||
|
<p class="form-row" style="margin-top: 6px">
|
||||||
|
Не пришел код?
|
||||||
|
<span class="resend-code" (click)="getCode($event)">Отправить повторно </span>
|
||||||
|
<span *ngIf="timeLeft">через {{timeLeft}}с</span>
|
||||||
|
</p>
|
||||||
<p style="color: red; margin: 0" *ngIf="errorConfirmCode">
|
<p style="color: red; margin: 0" *ngIf="errorConfirmCode">
|
||||||
Пароль введен неверно
|
Пароль введен неверно
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
:host {
|
:host {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
.woocommerce-form-login__submit {
|
.woocommerce-form-login__submit {
|
||||||
width: 150px;
|
width: 150px;
|
||||||
}
|
}
|
||||||
@ -18,6 +19,7 @@
|
|||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
line-height: 24px;
|
line-height: 24px;
|
||||||
|
|
||||||
&::before {
|
&::before {
|
||||||
content: "";
|
content: "";
|
||||||
width: 19px;
|
width: 19px;
|
||||||
@ -48,6 +50,7 @@
|
|||||||
width: 80%;
|
width: 80%;
|
||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
max-width: 400px;
|
max-width: 400px;
|
||||||
|
|
||||||
.button {
|
.button {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
@ -62,6 +65,7 @@
|
|||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
label {
|
label {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
@ -72,6 +76,7 @@
|
|||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
line-height: 22px;
|
line-height: 22px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-text {
|
.input-text {
|
||||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
|
||||||
Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
|
Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
|
||||||
@ -87,9 +92,15 @@
|
|||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.resend-code {
|
||||||
|
color: #0d457e;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.decoration-pattern {
|
.decoration-pattern {
|
||||||
width: calc(100% - 24px);
|
width: calc(100% - 24px);
|
||||||
height: 34px;
|
height: 34px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -21,6 +21,7 @@ export class AuthComponent {
|
|||||||
public phoneToConfirm!: string;
|
public phoneToConfirm!: string;
|
||||||
public loading = false;
|
public loading = false;
|
||||||
public errorConfirmCode: boolean = false;
|
public errorConfirmCode: boolean = false;
|
||||||
|
timeLeft: number = 0;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private phoneFormatter: FormatPhoneService,
|
private phoneFormatter: FormatPhoneService,
|
||||||
@ -32,10 +33,18 @@ export class AuthComponent {
|
|||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
getCode(event: SubmitEvent): void {
|
getCode(event: any): void {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.phoneToConfirm = '+' + this.phone.replace(/\D/g, '');
|
this.phoneToConfirm = '+' + this.phone.replace(/\D/g, '');
|
||||||
|
if (this.timeLeft) {
|
||||||
|
this.messageService.add({
|
||||||
|
severity: 'custom',
|
||||||
|
summary: `Отправить повторно можно через ${this.timeLeft}с`,
|
||||||
|
});
|
||||||
|
this.loading = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.jsonrpc.rpc({
|
this.jsonrpc.rpc({
|
||||||
method: 'sendVerifyByPhone',
|
method: 'sendVerifyByPhone',
|
||||||
params: [this.phoneToConfirm]
|
params: [this.phoneToConfirm]
|
||||||
@ -49,6 +58,14 @@ export class AuthComponent {
|
|||||||
}
|
}
|
||||||
if (result.code === 0) {
|
if (result.code === 0) {
|
||||||
this.isCodeConfirm = true;
|
this.isCodeConfirm = true;
|
||||||
|
this.timeLeft = 60;
|
||||||
|
const interval = setInterval(() => {
|
||||||
|
if(this.timeLeft > 0) {
|
||||||
|
this.timeLeft--;
|
||||||
|
} else {
|
||||||
|
clearInterval(interval);
|
||||||
|
}
|
||||||
|
},1000)
|
||||||
}
|
}
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user