dev #14384 Правка ошибок отображения WPA КофеЛайк: fix logout and login, change ios header

This commit is contained in:
nikolay 2023-06-23 11:06:28 +04:00
parent 4e0a41b644
commit 3ff34525ed
11 changed files with 45 additions and 32 deletions

View File

@ -2,7 +2,6 @@
padding: 24px 16px 0px; padding: 24px 16px 0px;
& > h2 { & > h2 {
font-family: Montserrat;
font-style: normal; font-style: normal;
font-weight: 700; font-weight: 700;
font-size: 15px; font-size: 15px;

View File

@ -1,7 +1,7 @@
<div class="container"> <div class="container">
<div> <div class="back">
<mat-icon *ngIf="backEvent" style="cursor: pointer;" aria-hidden="false" aria-label="Назад" fontIcon="arrow_back_ios" class="back-arrow" (click)="back()"></mat-icon> <mat-icon *ngIf="backEvent" style="cursor: pointer;" aria-hidden="false" aria-label="Назад" fontIcon="arrow_back_ios" class="back-arrow" (click)="back()"></mat-icon>
</div> </div>
<h1 class="title">{{title}}</h1> <h1 class="title">{{title}}</h1>
<!-- <div class="plug"></div> --> <!-- <div class="plug"></div> -->
<div *ngIf="showDropdown" class="backdrop" (click)="closeMenu()"></div> <div *ngIf="showDropdown" class="backdrop" (click)="closeMenu()"></div>

View File

@ -20,6 +20,9 @@
grid-template-columns: auto auto auto; grid-template-columns: auto auto auto;
justify-items: center; justify-items: center;
align-items: center; align-items: center;
.back {
width: 40px;
}
.back-arrow { .back-arrow {
font-size: 16px; font-size: 16px;
display: flex; display: flex;
@ -32,7 +35,6 @@
visibility: hidden; visibility: hidden;
} }
.title { .title {
font-family: "Montserrat", sans-serif;
font-weight: 700; font-weight: 700;
font-size: 17px; font-size: 17px;
line-height: 22px; line-height: 22px;

View File

@ -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 { MessagingService } from 'src/app/services/messaging.service';
import { getTypeDevice, DeviceType } from 'src/app/utils'; import { getTypeDevice, DeviceType } from 'src/app/utils';
import { AppleWalletService } from 'src/app/services/apple-wallet.service'; import { AppleWalletService } from 'src/app/services/apple-wallet.service';
import { CookiesService } from 'src/app/services/cookies.service'; import { CookiesService } from 'src/app/services/cookies.service';
import { MatBottomSheet } from '@angular/material/bottom-sheet'; import { MatBottomSheet } from '@angular/material/bottom-sheet';
import { ExitComponent } from 'src/app/components/exit/exit.component'; import { ExitComponent } from 'src/app/components/exit/exit.component';
import { Router } from '@angular/router'; import { AuthService } from 'src/app/services/auth.service';
@Component({ @Component({
selector: 'app-navbar[title]', selector: 'app-navbar[title]',
@ -24,7 +24,7 @@ export class NavbarComponent implements OnInit {
private appleWalletService: AppleWalletService, private appleWalletService: AppleWalletService,
private cookiesService: CookiesService, private cookiesService: CookiesService,
private _bottomSheet: MatBottomSheet, private _bottomSheet: MatBottomSheet,
private router: Router, private authService: AuthService,
) { } ) { }
handler(cb: () => void): (e: any) => void { handler(cb: () => void): (e: any) => void {
@ -73,8 +73,7 @@ export class NavbarComponent implements OnInit {
bottomSheet.afterDismissed().subscribe({ bottomSheet.afterDismissed().subscribe({
next: (val) => { next: (val) => {
if (val) { if (val) {
this.deleteToken(); this.authService.logout();
this.router.navigate(['/login']);
} }
}, },
}); });

View File

@ -104,7 +104,6 @@
h2 { h2 {
font-style: normal; font-style: normal;
font-family: Montserrat;
font-weight: 700; font-weight: 700;
font-size: 17px; font-size: 17px;
line-height: 22px; line-height: 22px;

View File

@ -1,11 +1,7 @@
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { MatBottomSheet } from '@angular/material/bottom-sheet'; 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 { ExitComponent } from 'src/app/components/exit/exit.component';
import { CookiesService } from 'src/app/services/cookies.service'; 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 { MessageService } from 'primeng/api';
import { MessagingService } from 'src/app/services/messaging.service'; import { MessagingService } from 'src/app/services/messaging.service';
import { DeviceType, getTypeDevice } from 'src/app/utils'; import { DeviceType, getTypeDevice } from 'src/app/utils';
@ -25,16 +21,14 @@ export class GuestCardComponent implements OnInit {
constructor( constructor(
private _bottomSheet: MatBottomSheet, private _bottomSheet: MatBottomSheet,
public cookiesService: CookiesService, public cookiesService: CookiesService,
private router: Router,
private wpJsonService: WpJsonService,
private messagingService: MessagingService, private messagingService: MessagingService,
private messageService: MessageService, private messageService: MessageService,
public authService: AuthService, public authService: AuthService,
) { } ) { }
ngOnInit(): void { ngOnInit(): void {
this.showBack = getTypeDevice() === DeviceType.android; this.showBack = getTypeDevice() === DeviceType.android;
this.requestPermission(); this.requestPermission();
} }
@ -66,13 +60,12 @@ export class GuestCardComponent implements OnInit {
this.cookiesService.logout(); this.cookiesService.logout();
} }
logout() { logout = () => {
const bottomSheet = this._bottomSheet.open(ExitComponent); const bottomSheet = this._bottomSheet.open(ExitComponent);
bottomSheet.afterDismissed().subscribe({ bottomSheet.afterDismissed().subscribe({
next: (val) => { next: (val) => {
if (val) { if (val) {
this.deleteToken(); this.authService.logout();
this.router.navigate(['/login']);
} }
}, },
}); });

View File

@ -0,0 +1 @@
nikolay@arch.6700:1687496762

View File

@ -93,10 +93,10 @@
</form> </form>
<p class="resend-code"> <p class="resend-code">
Не пришло SMS?<br /> Не пришло SMS?<br />
<ng-container *ngIf="timeLeft"> <ng-container *ngIf="authService.timeLeft">
Отправим повторно через {{timeLeft}}с Отправим повторно через {{authService.timeLeft}}с
</ng-container> </ng-container>
<ng-container *ngIf="!timeLeft"> <ng-container *ngIf="!authService.timeLeft">
<span class="resend" (click)="submitNumber()">Отправить повторно</span> <span class="resend" (click)="submitNumber()">Отправить повторно</span>
</ng-container> </ng-container>
</p> </p>

View File

@ -26,11 +26,10 @@ export class LoginComponent implements OnInit {
code2: new FormControl('', [Validators.required]), code2: new FormControl('', [Validators.required]),
code3: new FormControl('', [Validators.required]), code3: new FormControl('', [Validators.required]),
}); });
private inputIds = ['field', 'field1', 'field2', 'field3']; private inputIds = ['field', 'field1', 'field2', 'field3'];
timeLeft: number = 0;
constructor( constructor(
private authService: AuthService, public authService: AuthService,
private router: Router, private router: Router,
) { } ) { }

View File

@ -100,6 +100,12 @@ export class AuthService {
}); });
} }
logout() {
this.userInfo = undefined;
this.cookiesService.logout();
this.router.navigate(['/login']);
}
sendVerifyByPhone(phone: string) { sendVerifyByPhone(phone: string) {
if (this.timeLeft) { if (this.timeLeft) {
this.messageService.add({ this.messageService.add({
@ -175,17 +181,13 @@ export class AuthService {
RpcService.authService, RpcService.authService,
true true
).subscribe({ ).subscribe({
next: (value) => { next: () => {
this.router.navigate(['/']); this.router.navigate(['/']);
this.getUserInfo(); this.getUserInfo();
}, },
error: (err) => { error: (err) => {
console.error(err); console.error(err);
}, },
complete: () => {
this.loading = false;
}
}) })
} else if (result.code === 230) { } else if (result.code === 230) {
this.messageService.add({ this.messageService.add({
@ -197,6 +199,9 @@ export class AuthService {
error: (error) => { error: (error) => {
console.error(error); console.error(error);
}, },
complete: () => {
this.loading = false;
}
}); });
} }

View File

@ -135,6 +135,22 @@ body {
border-color: var(--button-text-color) !important; 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 { hr {
width: 100%; width: 100%;
border-top: 1px solid #BDBDBD; border-top: 1px solid #BDBDBD;