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