diff --git a/src/app/components/confirmacion-carrito/confirmacion-carrito.component.html b/src/app/components/confirmacion-carrito/confirmacion-carrito.component.html index d7d1c3e..84d9e49 100644 --- a/src/app/components/confirmacion-carrito/confirmacion-carrito.component.html +++ b/src/app/components/confirmacion-carrito/confirmacion-carrito.component.html @@ -50,7 +50,7 @@

- - {{p.cantidad * producto.cantidad}} {{p.DET_LAR}} + - {{producto.cantidad}} {{p.DET_LAR}}

diff --git a/src/app/components/inicio/inicio.component.ts b/src/app/components/inicio/inicio.component.ts index c0f0b7e..f60755b 100644 --- a/src/app/components/inicio/inicio.component.ts +++ b/src/app/components/inicio/inicio.component.ts @@ -33,7 +33,6 @@ export class InicioComponent implements OnInit, AfterViewInit { } else { this.busqueda += e.key; } - }; constructor( @@ -90,11 +89,15 @@ export class InicioComponent implements OnInit, AfterViewInit { }, error => { console.error(error); }) } - confirmarProducto() { + confirmarProducto(cantidad?: number) { let producto = this.promoAcargar ? this.promoAcargar : this.productoAcargar; - producto.cantidad = producto.cantidad ? producto.cantidad : 1; + if (cantidad) { + producto.cantidad = cantidad; + } else { + producto.cantidad = producto.cantidad ? producto.cantidad : 1; + } this.productoService.setProductos(producto); this.productoService.productoAcargar = this.promoAcargar = this.productoAcargar = undefined; @@ -147,9 +150,9 @@ export class InicioComponent implements OnInit, AfterViewInit { }) } - productosPersonalizados($event: Producto[]) { + productosPersonalizados($event: any) { - let productosPersonalizados = $event; + let productosPersonalizados = $event.productosAenviar; productosPersonalizados.forEach(productoElegido => { @@ -159,8 +162,7 @@ export class InicioComponent implements OnInit, AfterViewInit { }); this.promoAcargar.productos = this.promoAcargar.productos.concat(productosPersonalizados); - - this.confirmarProducto(); + this.confirmarProducto($event.cantidadPromo); } buscarByCodigoBarras(busqueda) { diff --git a/src/app/components/popover-promos/popover-promos.component.ts b/src/app/components/popover-promos/popover-promos.component.ts index 52fe0d1..96cd209 100644 --- a/src/app/components/popover-promos/popover-promos.component.ts +++ b/src/app/components/popover-promos/popover-promos.component.ts @@ -14,9 +14,9 @@ export class PopoverPromosComponent implements OnInit { @Output() promoSeleccionada = new EventEmitter(); constructor() { } - - ngOnInit() { - } + + ngOnInit() { + } hide() { this.popover.hide(); diff --git a/src/app/components/popover-sinonimos/popover-sinonimos.component.html b/src/app/components/popover-sinonimos/popover-sinonimos.component.html index 0b0f196..b16ea35 100644 --- a/src/app/components/popover-sinonimos/popover-sinonimos.component.html +++ b/src/app/components/popover-sinonimos/popover-sinonimos.component.html @@ -13,6 +13,32 @@
+
+
+
+ +
+ + {{cantidadPromo}} + +
+ +
+
+
+

@@ -36,6 +62,7 @@ {{producto.DetArt}}

+
@@ -37,7 +38,8 @@
diff --git a/src/etc/AppSettings..ts b/src/etc/AppSettings..ts new file mode 100644 index 0000000..dfa72dc --- /dev/null +++ b/src/etc/AppSettings..ts @@ -0,0 +1,5 @@ +export const appSettings = { + apiUrl: 'http://localhost:4705/autoservicio', + apiImagenes: 'http://localhost:5635', + apiClientes: 'http://localhost:1515/clientes' +};