diff --git a/angular/src/app/presentation-options/default-option/components/last-order/last-order.component.scss b/angular/src/app/presentation-options/default-option/components/last-order/last-order.component.scss index 6b2ec43..d63ac59 100644 --- a/angular/src/app/presentation-options/default-option/components/last-order/last-order.component.scss +++ b/angular/src/app/presentation-options/default-option/components/last-order/last-order.component.scss @@ -2,7 +2,6 @@ padding: 24px 16px 0px; & > h2 { - font-family: Montserrat; font-style: normal; font-weight: 700; font-size: 15px; diff --git a/angular/src/app/presentation-options/default-option/components/navbar/navbar.component.html b/angular/src/app/presentation-options/default-option/components/navbar/navbar.component.html index 733ee6b..3068813 100644 --- a/angular/src/app/presentation-options/default-option/components/navbar/navbar.component.html +++ b/angular/src/app/presentation-options/default-option/components/navbar/navbar.component.html @@ -1,7 +1,7 @@
-
+
-
+

{{title}}

diff --git a/angular/src/app/presentation-options/default-option/components/navbar/navbar.component.scss b/angular/src/app/presentation-options/default-option/components/navbar/navbar.component.scss index 5320bae..ecc2439 100644 --- a/angular/src/app/presentation-options/default-option/components/navbar/navbar.component.scss +++ b/angular/src/app/presentation-options/default-option/components/navbar/navbar.component.scss @@ -20,6 +20,9 @@ grid-template-columns: auto auto auto; justify-items: center; align-items: center; + .back { + width: 40px; + } .back-arrow { font-size: 16px; display: flex; @@ -32,7 +35,6 @@ visibility: hidden; } .title { - font-family: "Montserrat", sans-serif; font-weight: 700; font-size: 17px; line-height: 22px; diff --git a/angular/src/app/presentation-options/default-option/components/navbar/navbar.component.ts b/angular/src/app/presentation-options/default-option/components/navbar/navbar.component.ts index 3441fef..7e76690 100644 --- a/angular/src/app/presentation-options/default-option/components/navbar/navbar.component.ts +++ b/angular/src/app/presentation-options/default-option/components/navbar/navbar.component.ts @@ -1,11 +1,11 @@ -import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { MessagingService } from 'src/app/services/messaging.service'; import { getTypeDevice, DeviceType } from 'src/app/utils'; import { AppleWalletService } from 'src/app/services/apple-wallet.service'; import { CookiesService } from 'src/app/services/cookies.service'; import { MatBottomSheet } from '@angular/material/bottom-sheet'; import { ExitComponent } from 'src/app/components/exit/exit.component'; -import { Router } from '@angular/router'; +import { AuthService } from 'src/app/services/auth.service'; @Component({ selector: 'app-navbar[title]', @@ -24,7 +24,7 @@ export class NavbarComponent implements OnInit { private appleWalletService: AppleWalletService, private cookiesService: CookiesService, private _bottomSheet: MatBottomSheet, - private router: Router, + private authService: AuthService, ) { } handler(cb: () => void): (e: any) => void { @@ -73,8 +73,7 @@ export class NavbarComponent implements OnInit { bottomSheet.afterDismissed().subscribe({ next: (val) => { if (val) { - this.deleteToken(); - this.router.navigate(['/login']); + this.authService.logout(); } }, }); diff --git a/angular/src/app/presentation-options/default-option/pages/guest-card/guest-card.component.scss b/angular/src/app/presentation-options/default-option/pages/guest-card/guest-card.component.scss index 2a24b0a..c4b9e03 100644 --- a/angular/src/app/presentation-options/default-option/pages/guest-card/guest-card.component.scss +++ b/angular/src/app/presentation-options/default-option/pages/guest-card/guest-card.component.scss @@ -104,7 +104,6 @@ h2 { font-style: normal; - font-family: Montserrat; font-weight: 700; font-size: 17px; line-height: 22px; diff --git a/angular/src/app/presentation-options/default-option/pages/guest-card/guest-card.component.ts b/angular/src/app/presentation-options/default-option/pages/guest-card/guest-card.component.ts index b2cb925..f216f42 100644 --- a/angular/src/app/presentation-options/default-option/pages/guest-card/guest-card.component.ts +++ b/angular/src/app/presentation-options/default-option/pages/guest-card/guest-card.component.ts @@ -1,11 +1,7 @@ import { Component, OnInit } from '@angular/core'; import { MatBottomSheet } from '@angular/material/bottom-sheet'; -import { Router } from '@angular/router'; -import { Observable } from 'rxjs'; import { ExitComponent } from 'src/app/components/exit/exit.component'; import { CookiesService } from 'src/app/services/cookies.service'; -import { WpJsonService } from 'src/app/services/wp-json.service'; -import { environment } from 'src/environments/environment'; import { MessageService } from 'primeng/api'; import { MessagingService } from 'src/app/services/messaging.service'; import { DeviceType, getTypeDevice } from 'src/app/utils'; @@ -25,16 +21,14 @@ export class GuestCardComponent implements OnInit { constructor( private _bottomSheet: MatBottomSheet, public cookiesService: CookiesService, - private router: Router, - private wpJsonService: WpJsonService, private messagingService: MessagingService, private messageService: MessageService, - public authService: AuthService, + public authService: AuthService, ) { } ngOnInit(): void { this.showBack = getTypeDevice() === DeviceType.android; - + this.requestPermission(); } @@ -66,13 +60,12 @@ export class GuestCardComponent implements OnInit { this.cookiesService.logout(); } - logout() { + logout = () => { const bottomSheet = this._bottomSheet.open(ExitComponent); bottomSheet.afterDismissed().subscribe({ next: (val) => { if (val) { - this.deleteToken(); - this.router.navigate(['/login']); + this.authService.logout(); } }, }); diff --git a/angular/src/app/presentation-options/default-option/pages/login/.#login.component.ts b/angular/src/app/presentation-options/default-option/pages/login/.#login.component.ts new file mode 120000 index 0000000..f3c7064 --- /dev/null +++ b/angular/src/app/presentation-options/default-option/pages/login/.#login.component.ts @@ -0,0 +1 @@ +nikolay@arch.6700:1687496762 \ No newline at end of file diff --git a/angular/src/app/presentation-options/default-option/pages/login/login.component.html b/angular/src/app/presentation-options/default-option/pages/login/login.component.html index 82192cb..68842b1 100644 --- a/angular/src/app/presentation-options/default-option/pages/login/login.component.html +++ b/angular/src/app/presentation-options/default-option/pages/login/login.component.html @@ -93,10 +93,10 @@

Не пришло SMS?
- - Отправим повторно через {{timeLeft}}с + + Отправим повторно через {{authService.timeLeft}}с - + Отправить повторно

diff --git a/angular/src/app/presentation-options/default-option/pages/login/login.component.ts b/angular/src/app/presentation-options/default-option/pages/login/login.component.ts index c1299c0..88a1f40 100644 --- a/angular/src/app/presentation-options/default-option/pages/login/login.component.ts +++ b/angular/src/app/presentation-options/default-option/pages/login/login.component.ts @@ -26,11 +26,10 @@ export class LoginComponent implements OnInit { code2: new FormControl('', [Validators.required]), code3: new FormControl('', [Validators.required]), }); - private inputIds = ['field', 'field1', 'field2', 'field3']; - timeLeft: number = 0; + private inputIds = ['field', 'field1', 'field2', 'field3']; constructor( - private authService: AuthService, + public authService: AuthService, private router: Router, ) { } diff --git a/angular/src/app/services/auth.service.ts b/angular/src/app/services/auth.service.ts index 6697b58..9949530 100644 --- a/angular/src/app/services/auth.service.ts +++ b/angular/src/app/services/auth.service.ts @@ -100,6 +100,12 @@ export class AuthService { }); } + logout() { + this.userInfo = undefined; + this.cookiesService.logout(); + this.router.navigate(['/login']); + } + sendVerifyByPhone(phone: string) { if (this.timeLeft) { this.messageService.add({ @@ -175,17 +181,13 @@ export class AuthService { RpcService.authService, true ).subscribe({ - next: (value) => { + next: () => { this.router.navigate(['/']); this.getUserInfo(); }, error: (err) => { console.error(err); - }, - complete: () => { - this.loading = false; - } }) } else if (result.code === 230) { this.messageService.add({ @@ -197,6 +199,9 @@ export class AuthService { error: (error) => { console.error(error); }, + complete: () => { + this.loading = false; + } }); } diff --git a/angular/src/styles.scss b/angular/src/styles.scss index 44c615d..f284643 100644 --- a/angular/src/styles.scss +++ b/angular/src/styles.scss @@ -135,6 +135,22 @@ body { border-color: var(--button-text-color) !important; } +.mat-h1, +.mat-headline-5, +.mat-typography .mat-h1, +.mat-typography .mat-headline-5, +.mat-typography h1 { + font-family: Montserrat; +} + +.mat-h2, +.mat-headline-6, +.mat-typography .mat-h2, +.mat-typography .mat-headline-6, +.mat-typography h2 { + font-family: Montserrat, sans-serif; +} + hr { width: 100%; border-top: 1px solid #BDBDBD;