From 90c21609e288832ecbc7b3a2eb7950a5c223e81e Mon Sep 17 00:00:00 2001 From: Marcelo Puebla Date: Fri, 28 Feb 2020 11:01:14 -0300 Subject: [PATCH] Fix Al seleccionar opcion de pago con tarjeta --- src/app/app-routing.module.ts | 2 +- .../indicaciones-pago-tarjeta.component.html | 6 +++--- src/app/modules/pago-tarjeta/pago-tarjeta.component.ts | 10 ++++++---- src/app/services/articulo/articulo.service.ts | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 097c1aa..3e3d605 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -39,7 +39,7 @@ const routes: Routes = [ loadChildren: () => import('./modules/pago-electronico/pago-electronico.module').then(m => m.PagoElectronicoModule) }, { - path: 'pago-tarjeta', + path: 'pago-tarjeta/:contactLess', loadChildren: () => import('./modules/pago-tarjeta/pago-tarjeta.module').then(m => m.PagoTarjetaModule) }, ] diff --git a/src/app/modules/indicaciones-pago-tarjeta/indicaciones-pago-tarjeta.component.html b/src/app/modules/indicaciones-pago-tarjeta/indicaciones-pago-tarjeta.component.html index 275ea0b..90cc580 100644 --- a/src/app/modules/indicaciones-pago-tarjeta/indicaciones-pago-tarjeta.component.html +++ b/src/app/modules/indicaciones-pago-tarjeta/indicaciones-pago-tarjeta.component.html @@ -16,7 +16,7 @@ class="p-5 mx-auto mt-4 h-30 align-self-center btn-effect border border-primary rounded reduce-card-1" [ngClass]="card.classList.contains('media-pantalla') ? 'col-md-4' : 'col-md-8'" - [routerLink]="['/pago-tarjeta']"> + [routerLink]="['/pago-tarjeta/false']">
+ [routerLink]="['/pago-tarjeta/false']">
+ [routerLink]="['/pago-tarjeta/true']">
; + @ViewChild('template', { static: true }) public template: TemplateRef; subscription: Subscription; constructor( private articuloService: ArticuloService, private router: Router, + private route: ActivatedRoute, private modalService: BsModalService, ) { } @@ -26,10 +27,11 @@ export class PagoTarjetaComponent implements OnInit, OnDestroy { this.router.navigate(['']); return; } - this.openModalEspera(this.template); const dataPago = { - pedidoAnombreDe: '' + pedidoAnombreDe: '', + contactLess: this.route.snapshot.params.contactLess }; + this.openModalEspera(this.template); this.subscription = this.articuloService.pay(dataPago) .subscribe((res: any) => { this.articuloService.idComanda = res.data; diff --git a/src/app/services/articulo/articulo.service.ts b/src/app/services/articulo/articulo.service.ts index cae38d5..8dd3524 100644 --- a/src/app/services/articulo/articulo.service.ts +++ b/src/app/services/articulo/articulo.service.ts @@ -87,7 +87,7 @@ export class ArticuloService { numeroPlanilla: APP_SETTINGS.numeroPlanilla, pedidoParaLlevar: localStorage.getItem('pedidoParaLlevar'), terminal: APP_SETTINGS.terminal, - contactLess: true, + contactLess: dataPago.contactLess === 'true' ? true : false, }) .subscribe((data) => { observer.next(data); -- 1.9.1