pago-electronico.component.ts
1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { Component, OnInit } from '@angular/core';
import { ArticuloService } from 'src/app/services/articulo/articulo.service';
import { Router } from '@angular/router';
import { APP_SETTINGS } from 'src/etc/AppSettings';
@Component({
selector: 'app-pago-electronico',
templateUrl: './pago-electronico.component.html',
styleUrls: ['./pago-electronico.component.scss']
})
export class PagoElectronicoComponent implements OnInit {
urlQr = `${APP_SETTINGS.apiDeboSuite}/qr/${APP_SETTINGS.numeroPlanilla}/${APP_SETTINGS.codigoP}/tienda/${APP_SETTINGS.terminal}`;
constructor(
private articuloService: ArticuloService,
private router: Router,
) { }
ngOnInit() {
if (!this.articuloService.carrito.length) {
this.router.navigate(['']);
return;
}
const dataPago = {
pedidoAnombreDe: ''
};
dataPago.pedidoAnombreDe = '';
this.articuloService.pay(dataPago)
.subscribe((res: any) => {
this.articuloService.idComanda = res.data;
this.router.navigate(['mensaje-final']);
}, err => console.error(err));
this.mediaPantalla();
}
mediaPantalla() {
if ($('body').hasClass('media-pantalla')) {
$('.qr-mt').addClass('media-pantalla');
}
}
}