dev #14562 Добавить меню для iOS WPA: remove back arrow on ios on guest card

This commit is contained in:
nikolay 2023-06-22 12:32:02 +04:00
parent 10e180613f
commit abdb5b790c
8 changed files with 36 additions and 31 deletions

View File

@ -1,5 +1,7 @@
<div class="container"> <div class="container">
<mat-icon style="cursor: pointer;" aria-hidden="false" aria-label="Назад" fontIcon="arrow_back_ios" class="back-arrow" (click)="back()"></mat-icon> <div>
<mat-icon *ngIf="backEvent" style="cursor: pointer;" aria-hidden="false" aria-label="Назад" fontIcon="arrow_back_ios" class="back-arrow" (click)="back()"></mat-icon>
</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

@ -14,7 +14,7 @@ import { Router } from '@angular/router';
}) })
export class NavbarComponent implements OnInit { export class NavbarComponent implements OnInit {
@Input() title: string = 'Название не задано' @Input() title: string = 'Название не задано'
@Output() backEvent = new EventEmitter<null>(); @Input() backEvent?: () => void;
showMenu: boolean = false; showMenu: boolean = false;
showDropdown: boolean = false; showDropdown: boolean = false;
@ -55,7 +55,9 @@ export class NavbarComponent implements OnInit {
} }
back() { back() {
this.backEvent.emit(null) if (this.backEvent) {
this.backEvent();
}
} }
addToWallet = () => { addToWallet = () => {

View File

@ -1,4 +1,4 @@
<app-navbar title="Карта гостя" (backEvent)="logout()"></app-navbar> <app-navbar title="Карта гостя" [backEvent]="showBack ? logout : undefined"></app-navbar>
<p-toast position="top-center"></p-toast> <p-toast position="top-center"></p-toast>
<ng-container *ngIf="!this.loyaltyProgram.purchaseData.$loading && customerInfo"> <ng-container *ngIf="!this.loyaltyProgram.purchaseData.$loading && customerInfo">
<div class="guest-card"> <div class="guest-card">

View File

@ -6,11 +6,10 @@ 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 { WpJsonService } from 'src/app/services/wp-json.service';
import { environment } from 'src/environments/environment'; import { environment } from 'src/environments/environment';
import moment from 'moment';
import { Moment, Purchase } from 'src/app/interface/data';
import { LoyaltyProgramService } from 'src/app/services/loyalty-program.service'; import { LoyaltyProgramService } from 'src/app/services/loyalty-program.service';
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';
@Component({ @Component({
selector: 'app-guest-card', selector: 'app-guest-card',
@ -22,6 +21,7 @@ export class GuestCardComponent implements OnInit {
private isQrCodeClicked: boolean = false; private isQrCodeClicked: boolean = false;
public customerInfo!: any; public customerInfo!: any;
public Math: Math = Math; public Math: Math = Math;
public showBack: boolean = false;
constructor( constructor(
private _bottomSheet: MatBottomSheet, private _bottomSheet: MatBottomSheet,
@ -34,6 +34,7 @@ export class GuestCardComponent implements OnInit {
) { } ) { }
ngOnInit(): void { ngOnInit(): void {
this.showBack = getTypeDevice() === DeviceType.android;
const token = this.cookiesService.getItem('token'); const token = this.cookiesService.getItem('token');
this.requestPermission(); this.requestPermission();

View File

@ -1,7 +1,7 @@
<app-navbar <app-navbar
*ngIf="phoneForm.value.phone && !isShowNumber" *ngIf="phoneForm.value.phone && !isShowNumber"
[title]="phoneForm.value.phone" [title]="phoneForm.value.phone"
(backEvent)="backToPhoneForm()" [backEvent]="backToPhoneForm"
[ngStyle]="{ [ngStyle]="{
position: 'absolute', position: 'absolute',
top: 0 top: 0

View File

@ -93,19 +93,19 @@ export class LoginComponent implements OnInit, AfterViewInit {
switch (i) { switch (i) {
case 0: case 0:
this.field.nativeElement.focus(); this.field.nativeElement.focus();
this.field.nativeElement.click(); this.field.nativeElement.click();
break; break;
case 1: case 1:
this.field1.nativeElement.focus(); this.field1.nativeElement.focus();
this.field1.nativeElement.click(); this.field1.nativeElement.click();
break; break;
case 2: case 2:
this.field2.nativeElement.focus(); this.field2.nativeElement.focus();
this.field2.nativeElement.click(); this.field2.nativeElement.click();
break; break;
case 3: case 3:
this.field3.nativeElement.focus(); this.field3.nativeElement.focus();
this.field3.nativeElement.click(); this.field3.nativeElement.click();
break; break;
} }
}, 0); }, 0);
@ -212,7 +212,7 @@ export class LoginComponent implements OnInit, AfterViewInit {
}); });
} }
backToPhoneForm() { backToPhoneForm = () => {
this.codeForm.setValue({ this.codeForm.setValue({
code: '', code: '',
code1: '', code1: '',

View File

@ -1,4 +1,4 @@
<app-navbar title="Программа лояльности" (backEvent)="goBack()"></app-navbar> <app-navbar title="Программа лояльности" [backEvent]="goBack"></app-navbar>
<ng-container *ngIf="loyaltyProgram.currentLvlPeriod"> <ng-container *ngIf="loyaltyProgram.currentLvlPeriod">
<div class="loyality-program"> <div class="loyality-program">

View File

@ -10,20 +10,20 @@ import { LoyaltyProgramService } from 'src/app/services/loyalty-program.service'
styleUrls: ['./loyality-program.component.scss'], styleUrls: ['./loyality-program.component.scss'],
}) })
export class LoyalityProgramComponent implements OnInit { export class LoyalityProgramComponent implements OnInit {
constructor( constructor(
private _location: Location, private _location: Location,
public loyaltyProgram: LoyaltyProgramService, public loyaltyProgram: LoyaltyProgramService,
) {} ) { }
public lvlPeriods: lvlPeriod[] = lvlPeriods; public lvlPeriods: lvlPeriod[] = lvlPeriods;
goBack() { goBack = () => {
this._location.back(); this._location.back();
} }
ngOnInit(): void { ngOnInit(): void {
if(this.loyaltyProgram.currentLvlPeriod == null) { if (this.loyaltyProgram.currentLvlPeriod == null) {
this._location.back(); this._location.back();
} }
} }
} }