Commit 076cefb1de04a8307324ef512ab8160f0fab16a2
Exists in
develop
Merge branch 'develop' of git.focasoftware.com:angular/autoservicio-axion
Showing
2 changed files
Show diff stats
src/app/modules/pago-electronico/pago-electronico.component.ts
1 | import { Component, OnInit } from '@angular/core'; | 1 | import { Component, OnInit } from '@angular/core'; |
2 | import { ArticuloService } from 'src/app/services/articulo/articulo.service'; | 2 | import { ArticuloService } from 'src/app/services/articulo/articulo.service'; |
3 | import { Router } from '@angular/router'; | 3 | import { Router } from '@angular/router'; |
4 | import { APP_SETTINGS } from 'src/etc/AppSettings'; | 4 | import { APP_SETTINGS } from 'src/etc/AppSettings'; |
5 | 5 | ||
6 | @Component({ | 6 | @Component({ |
7 | selector: 'app-pago-electronico', | 7 | selector: 'app-pago-electronico', |
8 | templateUrl: './pago-electronico.component.html', | 8 | templateUrl: './pago-electronico.component.html', |
9 | styleUrls: ['./pago-electronico.component.scss'] | 9 | styleUrls: ['./pago-electronico.component.scss'] |
10 | }) | 10 | }) |
11 | export class PagoElectronicoComponent implements OnInit { | 11 | export class PagoElectronicoComponent implements OnInit { |
12 | urlQr = `${APP_SETTINGS.apiDeboSuite}/qr/dev/${APP_SETTINGS.codigoP}/tienda/${APP_SETTINGS.terminal}`; | 12 | urlQr = `${APP_SETTINGS.apiDeboSuite}/qr/${APP_SETTINGS.deploy}/${APP_SETTINGS.codigoP}/tienda/${APP_SETTINGS.terminal}`; |
13 | 13 | ||
14 | constructor( | 14 | constructor( |
15 | private articuloService: ArticuloService, | 15 | private articuloService: ArticuloService, |
16 | private router: Router, | 16 | private router: Router, |
17 | ) { } | 17 | ) { } |
18 | 18 | ||
19 | ngOnInit() { | 19 | ngOnInit() { |
20 | if (!this.articuloService.carrito.length) { | 20 | if (!this.articuloService.carrito.length) { |
21 | this.router.navigate(['']); | 21 | this.router.navigate(['']); |
22 | return; | 22 | return; |
23 | } | 23 | } |
24 | const dataPago = { | 24 | const dataPago = { |
25 | pedidoAnombreDe: '' | 25 | pedidoAnombreDe: '' |
26 | }; | 26 | }; |
27 | dataPago.pedidoAnombreDe = ''; | 27 | dataPago.pedidoAnombreDe = ''; |
28 | this.articuloService.pay(dataPago) | 28 | this.articuloService.pay(dataPago) |
29 | .subscribe((res: any) => { | 29 | .subscribe((res: any) => { |
30 | this.articuloService.idComanda = res.data; | 30 | this.articuloService.idComanda = res.data; |
31 | this.router.navigate(['mensaje-final']); | 31 | this.router.navigate(['mensaje-final']); |
32 | }, err => console.error(err)); | 32 | }, err => console.error(err)); |
33 | } | 33 | } |
34 | 34 | ||
35 | } | 35 | } |
36 | 36 |
src/etc/AppSettings.ejemplo.ts
File was created | 1 | // export const APP_SETTINGS = { | |
2 | // apiDeboSuite: 'http://localhost:1515', | ||
3 | // puntoVenta: 9998, | ||
4 | // numeroPlanilla: 1111, | ||
5 | // codigoP: 99996, | ||
6 | // terminal: 101, | ||
7 | // deploy: 'dev' | ||
8 | // }; | ||
9 |