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">
<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>
<!-- <div class="plug"></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 {
@Input() title: string = 'Название не задано'
@Output() backEvent = new EventEmitter<null>();
@Input() backEvent?: () => void;
showMenu: boolean = false;
showDropdown: boolean = false;
@ -55,7 +55,9 @@ export class NavbarComponent implements OnInit {
}
back() {
this.backEvent.emit(null)
if (this.backEvent) {
this.backEvent();
}
}
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>
<ng-container *ngIf="!this.loyaltyProgram.purchaseData.$loading && customerInfo">
<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 { WpJsonService } from 'src/app/services/wp-json.service';
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 { MessageService } from 'primeng/api';
import { MessagingService } from 'src/app/services/messaging.service';
import { DeviceType, getTypeDevice } from 'src/app/utils';
@Component({
selector: 'app-guest-card',
@ -22,6 +21,7 @@ export class GuestCardComponent implements OnInit {
private isQrCodeClicked: boolean = false;
public customerInfo!: any;
public Math: Math = Math;
public showBack: boolean = false;
constructor(
private _bottomSheet: MatBottomSheet,
@ -34,6 +34,7 @@ export class GuestCardComponent implements OnInit {
) { }
ngOnInit(): void {
this.showBack = getTypeDevice() === DeviceType.android;
const token = this.cookiesService.getItem('token');
this.requestPermission();

View File

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

View File

@ -55,7 +55,7 @@ export class LoginComponent implements OnInit, AfterViewInit {
@HostListener('window:input', ['$event'])
HandlKeyEvents(event: any) {
if (!event.target.classList.contains('field')) return;
if (!event.target.classList.contains('field')) return;
const key = event.data
let elementId = '';
@ -93,19 +93,19 @@ export class LoginComponent implements OnInit, AfterViewInit {
switch (i) {
case 0:
this.field.nativeElement.focus();
this.field.nativeElement.click();
this.field.nativeElement.click();
break;
case 1:
this.field1.nativeElement.focus();
this.field1.nativeElement.click();
this.field1.nativeElement.click();
break;
case 2:
this.field2.nativeElement.focus();
this.field2.nativeElement.click();
this.field2.nativeElement.click();
break;
case 3:
this.field3.nativeElement.focus();
this.field3.nativeElement.click();
this.field3.nativeElement.click();
break;
}
}, 0);
@ -159,7 +159,7 @@ export class LoginComponent implements OnInit, AfterViewInit {
}
submitCode() {
const data = this.codeForm.value;
const data = this.codeForm.value;
this.jsonrpc
.rpc(
{
@ -212,7 +212,7 @@ export class LoginComponent implements OnInit, AfterViewInit {
});
}
backToPhoneForm() {
backToPhoneForm = () => {
this.codeForm.setValue({
code: '',
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">
<div class="loyality-program">

View File

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