diff --git a/src/app/app.module.ts b/src/app/app.module.ts index c24db42..3cd004d 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -18,7 +18,8 @@ import { InicioComponent } from './components/inicio/inicio.component'; import { BusquedaProductosComponent } from './components/busqueda-productos/busqueda-productos.component'; import { ConfirmacionCarritoComponent } from './components/confirmacion-carrito/confirmacion-carrito.component'; import { MasterComponent } from './components/master/master.component'; -import { PopoverComponent } from './components/popover/popover.component'; +import { PopoverPromosComponent } from './components/popover-promos/popover-promos.component'; +import { PopoverSinonimosComponent } from './components/popover-sinonimos/popover-sinonimos.component'; //#endregion @NgModule({ @@ -32,7 +33,8 @@ import { PopoverComponent } from './components/popover/popover.component'; BusquedaProductosComponent, ConfirmacionCarritoComponent, MasterComponent, - PopoverComponent + PopoverPromosComponent, + PopoverSinonimosComponent ], imports: [ BrowserModule, diff --git a/src/app/components/inicio/inicio.component.ts b/src/app/components/inicio/inicio.component.ts index 7156f97..d4a9956 100644 --- a/src/app/components/inicio/inicio.component.ts +++ b/src/app/components/inicio/inicio.component.ts @@ -16,6 +16,7 @@ export class InicioComponent implements OnInit { @ViewChild('pop', { static: false }) popoverDirective: PopoverDirective; private productoAcargar: Producto; + private promoAcargar: Promocion; private tienePromo = false; private productoEsPromo = false; @@ -58,13 +59,26 @@ export class InicioComponent implements OnInit { } private goPage(pageUrl) { + this.router.navigate([pageUrl]); } deshacerCarga() { - - this.productoAcargar = undefined; - this.tienePromo = false; + if(this.productoEsPromo) { + this.promoAcargar = undefined; + this.productoEsPromo = false; + this.popoverDirective.show(); + }else{ + this.productoAcargar = undefined; + this.tienePromo = false; + this.popoverDirective.hide(); + } + } + + promoSeleccionada($event : Promocion){ + + this.productoEsPromo = true; + this.promoAcargar = $event; this.popoverDirective.hide(); } diff --git a/src/app/components/popover-promos/popover-promos.component.html b/src/app/components/popover-promos/popover-promos.component.html new file mode 100644 index 0000000..0440807 --- /dev/null +++ b/src/app/components/popover-promos/popover-promos.component.html @@ -0,0 +1,51 @@ +
+ Este producto forma parte
+ de Combos y Promociones
+
{{promo.nombrePromo}}
++ {{producto.DetArt}} +
++ {{calcularPrecioDePromo(promo.productos) | currency}} +
+
- Este producto forma parte
- de Combos y Promociones
-
{{promo.nombrePromo}}
-- {{producto.DetArt}} -
-{{28 | currency}}
-