dev #14384 Правка ошибок отображения WPA КофеЛайк: fix login form
This commit is contained in:
parent
9e7394e848
commit
c9bcf3fc15
@ -41,7 +41,7 @@
|
||||
Используя приложение, вы принимаете <a href="https://docs.google.com/document/d/1tOZyI9DKerQpMY_N-hMExMB15j2F98E3VDqwIVMkk4I">условия</a>
|
||||
и соглашаетесь на получение рекламно-информационных сообщений
|
||||
</p>
|
||||
<button [disabled]="phoneForm.invalid && phoneForm.touched">Принять участие</button>
|
||||
<button>Принять участие</button>
|
||||
</form>
|
||||
|
||||
<ng-template #smsCode>
|
||||
|
||||
@ -5,6 +5,8 @@
|
||||
align-items: center;
|
||||
max-width: 600px;
|
||||
margin: 0 auto 52px;
|
||||
padding-left: 20px;
|
||||
padding-right: 20px;
|
||||
|
||||
h1 {
|
||||
margin-top: 20px;
|
||||
|
||||
@ -8,6 +8,7 @@ import {
|
||||
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { Router } from '@angular/router';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { MessageService } from 'primeng/api';
|
||||
|
||||
@Component({
|
||||
selector: 'app-login',
|
||||
@ -17,7 +18,7 @@ import { AuthService } from 'src/app/services/auth.service';
|
||||
export class LoginComponent implements OnInit {
|
||||
public isShowNumber: boolean = true;
|
||||
public phoneForm = new FormGroup({
|
||||
name: new FormControl('', []),
|
||||
name: new FormControl('', [Validators.required]),
|
||||
phone: new FormControl('', [Validators.required]),
|
||||
});
|
||||
public codeForm = new FormGroup({
|
||||
@ -31,6 +32,7 @@ export class LoginComponent implements OnInit {
|
||||
constructor(
|
||||
public authService: AuthService,
|
||||
private router: Router,
|
||||
private messageService: MessageService,
|
||||
) { }
|
||||
|
||||
ngOnInit(): void { }
|
||||
@ -102,6 +104,12 @@ export class LoginComponent implements OnInit {
|
||||
if (this.phoneForm.invalid) {
|
||||
this.phoneForm.markAsTouched();
|
||||
|
||||
this.messageService.add({
|
||||
severity: 'error',
|
||||
summary: 'Введите имя и телефон',
|
||||
life: 5000,
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
const data = this.phoneForm.value;
|
||||
|
||||
@ -90,7 +90,7 @@ export class AuthService {
|
||||
|
||||
this.cookiesService.setCookie('phone-number', this.userInfo!.phone?.slice(2));
|
||||
|
||||
this.getLastPurchase();
|
||||
this.getLastPurchase();
|
||||
}
|
||||
},
|
||||
error: (e) => {
|
||||
@ -247,13 +247,13 @@ export class AuthService {
|
||||
}
|
||||
|
||||
getLastPurchase() {
|
||||
if(this.userInfo) {
|
||||
this.wpJsonService.getLastPurchase(environment.systemId, this.token!).subscribe({
|
||||
next: (res) => {
|
||||
this.purchaseData.lastPurchase = res[this.userInfo!.id][0];
|
||||
},
|
||||
});
|
||||
}
|
||||
if (this.userInfo) {
|
||||
this.wpJsonService.getLastPurchase(environment.systemId, this.token!).subscribe({
|
||||
next: (res) => {
|
||||
this.purchaseData.lastPurchase = res[this.userInfo!.id][0];
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
getBalanceAmount(loyaltyPrograms: UserInfoWalletBalance[]) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user