From bdfdb8709c835fd912fe46facf728430e6b2c3d1 Mon Sep 17 00:00:00 2001 From: Luis Suarez Date: Tue, 28 Jan 2020 08:16:22 -0400 Subject: [PATCH] optimizar espacios en pantalla completa --- src/app/modules/carrito/carrito.component.html | 3 +- src/app/modules/carrito/carrito.component.ts | 9 +++-- .../modules/forma-pago/forma-pago.component.scss | 4 +-- .../info-formas-pago/info-formas-pago.component.ts | 13 +++++-- .../mensaje-final/mensaje-final.component.html | 3 +- .../mensaje-final/mensaje-final.component.ts | 2 +- .../opcion-pedido/opcion-pedido.component.scss | 8 ++--- .../opcion-pedido/opcion-pedido.component.ts | 4 +-- .../pago-electronico.component.html | 4 +-- .../pago-electronico.component.scss | 4 +++ .../pago-electronico/pago-electronico.component.ts | 9 +++-- .../filtro-categorias.component.html | 18 ++++++---- .../filtro-categorias.component.scss | 3 +- .../filtro-categorias.component.ts | 13 ++++++- .../seleccion-articulos.component.html | 7 ++-- .../seleccion-articulos.component.scss | 9 +++++ .../seleccion-articulos.component.ts | 5 ++- src/app/shared/footer/footer.component.html | 2 +- src/app/shared/footer/footer.component.ts | 7 ++-- src/app/shared/promocion/promocion.component.html | 42 +--------------------- src/app/shared/promocion/promocion.component.ts | 3 +- src/styles.scss | 8 +---- 22 files changed, 95 insertions(+), 85 deletions(-) diff --git a/src/app/modules/carrito/carrito.component.html b/src/app/modules/carrito/carrito.component.html index 8ed7512..04825e2 100644 --- a/src/app/modules/carrito/carrito.component.html +++ b/src/app/modules/carrito/carrito.component.html @@ -2,7 +2,7 @@ -
+
@@ -23,6 +23,7 @@
diff --git a/src/app/modules/carrito/carrito.component.ts b/src/app/modules/carrito/carrito.component.ts index dab9fd2..ae538f2 100644 --- a/src/app/modules/carrito/carrito.component.ts +++ b/src/app/modules/carrito/carrito.component.ts @@ -42,7 +42,9 @@ export class CarritoComponent implements OnInit, OnDestroy { this.router.navigate(['']); return; } - this.mediaPantallaP(); + // console.log('COMPONENTE INICIADO'); + + this.mediaPantalla(); } ngOnDestroy() { @@ -69,9 +71,10 @@ export class CarritoComponent implements OnInit, OnDestroy { this.inactiveScreen.startTimeOutInactividad(); } - mediaPantallaP() { + mediaPantalla() { if ($('body').hasClass('media-pantalla')) { - $('.carrito-content,.carrito-articulo').addClass('media-pantalla'); + $(`.carrito-content`).addClass('media-pantalla').addBack('media-pantalla'); } + console.log('AGARRA CONIOO'); } } diff --git a/src/app/modules/forma-pago/forma-pago.component.scss b/src/app/modules/forma-pago/forma-pago.component.scss index d7fb0a2..a138d17 100644 --- a/src/app/modules/forma-pago/forma-pago.component.scss +++ b/src/app/modules/forma-pago/forma-pago.component.scss @@ -4,7 +4,7 @@ -webkit-box-flex: 0; flex: 0 0 41.6666666667%; max-width: 41.6666666667%; - left: 10%; + left: 20%; margin-left: 0 !important; } @@ -14,6 +14,6 @@ -webkit-box-flex: 0; flex: 0 0 41.6666666667%; max-width: 41.6666666667%; - right: 10%; + right: 20%; margin-right: 0 !important; } diff --git a/src/app/modules/info-formas-pago/info-formas-pago.component.ts b/src/app/modules/info-formas-pago/info-formas-pago.component.ts index 93bc95e..ce8cd0e 100644 --- a/src/app/modules/info-formas-pago/info-formas-pago.component.ts +++ b/src/app/modules/info-formas-pago/info-formas-pago.component.ts @@ -7,14 +7,15 @@ import { BsModalService } from 'ngx-bootstrap/modal'; styleUrls: ['./info-formas-pago.component.scss'] }) export class InfoFormasPagoComponent implements OnInit, OnDestroy { - mediaPantalla = false; timer: any; constructor( private modalService: BsModalService, ) { } - ngOnInit() { } + ngOnInit() { + this.mediaPantalla(); + } ngOnDestroy() { if (this.timer) clearTimeout(this.timer); @@ -26,4 +27,12 @@ export class InfoFormasPagoComponent implements OnInit, OnDestroy { modalRef.hide(); }, 3000); } + + mediaPantalla() { + if ($('body').hasClass('media-pantalla')) { + $('.reduce-card-1,.reduce-card-2') + .addClass('media-pantalla') + .addBack('media-pantalla'); + } + } } diff --git a/src/app/modules/mensaje-final/mensaje-final.component.html b/src/app/modules/mensaje-final/mensaje-final.component.html index 9a88991..36abb4f 100644 --- a/src/app/modules/mensaje-final/mensaje-final.component.html +++ b/src/app/modules/mensaje-final/mensaje-final.component.html @@ -52,7 +52,8 @@
FINALIZAR { this.goToSplash(); - }, 10000); + }, 10000000); this.mediaPantalla(); } diff --git a/src/app/modules/opcion-pedido/opcion-pedido.component.scss b/src/app/modules/opcion-pedido/opcion-pedido.component.scss index d7fb0a2..890f6cd 100644 --- a/src/app/modules/opcion-pedido/opcion-pedido.component.scss +++ b/src/app/modules/opcion-pedido/opcion-pedido.component.scss @@ -2,8 +2,8 @@ position: absolute; bottom: 150px; -webkit-box-flex: 0; - flex: 0 0 41.6666666667%; - max-width: 41.6666666667%; + flex: 0 0 35%; + max-width: 35%; left: 10%; margin-left: 0 !important; } @@ -12,8 +12,8 @@ position: absolute; bottom: 150px; -webkit-box-flex: 0; - flex: 0 0 41.6666666667%; - max-width: 41.6666666667%; + flex: 0 0 35%; + max-width: 35%; right: 10%; margin-right: 0 !important; } diff --git a/src/app/modules/opcion-pedido/opcion-pedido.component.ts b/src/app/modules/opcion-pedido/opcion-pedido.component.ts index f0a03a6..7fb24af 100644 --- a/src/app/modules/opcion-pedido/opcion-pedido.component.ts +++ b/src/app/modules/opcion-pedido/opcion-pedido.component.ts @@ -13,7 +13,7 @@ export class OpcionPedidoComponent implements OnInit { ) { } ngOnInit() { - this.reducirPantalla(); + this.mediaPantalla(); } goTo(path) { @@ -25,7 +25,7 @@ export class OpcionPedidoComponent implements OnInit { localStorage.setItem('pedidoParaLlevar', lugar); } - reducirPantalla() { + mediaPantalla() { if ($('body').hasClass('media-pantalla')) { $('.reduce-card-1,.reduce-card-2').addClass('media-pantalla'); } diff --git a/src/app/modules/pago-electronico/pago-electronico.component.html b/src/app/modules/pago-electronico/pago-electronico.component.html index f681cf7..89497b2 100644 --- a/src/app/modules/pago-electronico/pago-electronico.component.html +++ b/src/app/modules/pago-electronico/pago-electronico.component.html @@ -27,12 +27,12 @@ class="d-block mx-auto h-100 w-auto shadow rounded" src="assets/img/qr-skin.jpg">
-
+
diff --git a/src/app/modules/pago-electronico/pago-electronico.component.scss b/src/app/modules/pago-electronico/pago-electronico.component.scss index 90d6e77..821cf7a 100644 --- a/src/app/modules/pago-electronico/pago-electronico.component.scss +++ b/src/app/modules/pago-electronico/pago-electronico.component.scss @@ -1,3 +1,7 @@ .mt-7 { margin-top: 6rem; } + +.qr-mt.media-pantalla { + margin-top: 2rem !important;; +} diff --git a/src/app/modules/pago-electronico/pago-electronico.component.ts b/src/app/modules/pago-electronico/pago-electronico.component.ts index ecae5ba..c70f341 100644 --- a/src/app/modules/pago-electronico/pago-electronico.component.ts +++ b/src/app/modules/pago-electronico/pago-electronico.component.ts @@ -9,7 +9,7 @@ import { APP_SETTINGS } from 'src/etc/AppSettings'; styleUrls: ['./pago-electronico.component.scss'] }) export class PagoElectronicoComponent implements OnInit { - urlQr = `${APP_SETTINGS.apiDeboSuite}/qr/${APP_SETTINGS.deploy}/${APP_SETTINGS.codigoP}/tienda/${APP_SETTINGS.terminal}`; + urlQr = `${APP_SETTINGS.apiDeboSuite}/qr/${APP_SETTINGS.numeroPlanilla}/${APP_SETTINGS.codigoP}/tienda/${APP_SETTINGS.terminal}`; constructor( private articuloService: ArticuloService, @@ -30,6 +30,11 @@ export class PagoElectronicoComponent implements OnInit { 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'); + } } - } diff --git a/src/app/modules/seleccion-articulos/filtro-categorias/filtro-categorias.component.html b/src/app/modules/seleccion-articulos/filtro-categorias/filtro-categorias.component.html index 1651a98..7f8b40f 100644 --- a/src/app/modules/seleccion-articulos/filtro-categorias/filtro-categorias.component.html +++ b/src/app/modules/seleccion-articulos/filtro-categorias/filtro-categorias.component.html @@ -19,29 +19,35 @@ border-left-0 rounded-right scroll-y cat-box" (scroll)="scrollEvent($event)">
Todos
+ {{categoria.detalle}}
diff --git a/src/app/modules/seleccion-articulos/filtro-categorias/filtro-categorias.component.scss b/src/app/modules/seleccion-articulos/filtro-categorias/filtro-categorias.component.scss index a65def2..1996356 100644 --- a/src/app/modules/seleccion-articulos/filtro-categorias/filtro-categorias.component.scss +++ b/src/app/modules/seleccion-articulos/filtro-categorias/filtro-categorias.component.scss @@ -35,7 +35,8 @@ $primary: #aa006b; } } -.cat-content.media-pantalla { +.cat-content.media-pantalla, +#cat-content.media-pantalla { margin: 0.5rem 0.7rem !important; height: 76% !important; } diff --git a/src/app/modules/seleccion-articulos/filtro-categorias/filtro-categorias.component.ts b/src/app/modules/seleccion-articulos/filtro-categorias/filtro-categorias.component.ts index 5de594e..3b7e83b 100644 --- a/src/app/modules/seleccion-articulos/filtro-categorias/filtro-categorias.component.ts +++ b/src/app/modules/seleccion-articulos/filtro-categorias/filtro-categorias.component.ts @@ -25,7 +25,9 @@ export class FiltroCategoriasComponent implements OnInit { private inactiveScreen: InactiveScreenService, ) { } - ngOnInit() { } + ngOnInit() { + this.mediaPantalla(); + } getCategorias() { this.categoriaService.getAll() @@ -54,6 +56,7 @@ export class FiltroCategoriasComponent implements OnInit { this.getProductos.emit() : this.setProductos.emit(); }); + this.mediaPantalla(); } selectCategoria(index: number, idCategoria?: number) { @@ -83,4 +86,12 @@ export class FiltroCategoriasComponent implements OnInit { el.scroll({ behavior: 'smooth', top: value + el.scrollTop }); }, 500); } + + mediaPantalla() { + if ($('body').hasClass('media-pantalla')) { + $('.cat-content,#cat-content') + .addClass('media-pantalla') + .addBack('media-pantalla'); + } + } } diff --git a/src/app/modules/seleccion-articulos/seleccion-articulos.component.html b/src/app/modules/seleccion-articulos/seleccion-articulos.component.html index 8a3c607..5e114f5 100644 --- a/src/app/modules/seleccion-articulos/seleccion-articulos.component.html +++ b/src/app/modules/seleccion-articulos/seleccion-articulos.component.html @@ -40,7 +40,7 @@ (contextmenu)="false" src="{{urlImagenes}}{{articulo.imagenes[0].imagen}}" onerror="this.src='assets/img/image-not-found.jpg'" - class="card-img-top h-30 h-md-55 rounded-sm"> + class="card-img-top w-100 h-auto h-md-55 rounded-sm">

@@ -144,7 +144,8 @@

-
+
+
ADAPTAR PANTALLA
diff --git a/src/app/shared/footer/footer.component.ts b/src/app/shared/footer/footer.component.ts index fa71c96..0f4c935 100644 --- a/src/app/shared/footer/footer.component.ts +++ b/src/app/shared/footer/footer.component.ts @@ -16,8 +16,7 @@ export class FooterComponent implements OnInit { } reducirPantalla() { - $(` - body, + $(`body, .reduce-card-1, .reduce-card-2, #content, @@ -31,7 +30,9 @@ export class FooterComponent implements OnInit { .carrito-articulo, .carrito-content, .pago-tarjeta, - .modal-promo`) + .modal-promo, + .modal-content, + .qr-mt`) .toggleClass('media-pantalla'); } } diff --git a/src/app/shared/promocion/promocion.component.html b/src/app/shared/promocion/promocion.component.html index e74e708..f884d17 100644 --- a/src/app/shared/promocion/promocion.component.html +++ b/src/app/shared/promocion/promocion.component.html @@ -1,5 +1,5 @@
+ *ngIf="loading">
Loading...
@@ -44,43 +44,3 @@
- -
\ No newline at end of file diff --git a/src/app/shared/promocion/promocion.component.ts b/src/app/shared/promocion/promocion.component.ts index ada3da6..b67cb18 100644 --- a/src/app/shared/promocion/promocion.component.ts +++ b/src/app/shared/promocion/promocion.component.ts @@ -51,6 +51,7 @@ export class PromocionComponent implements OnInit { } openModalSinonimos(sinonimosData: ISinonimo[], articulo: IArticulo) { + console.log('lanzado open sinonimos'); const modalSinonimo = this.modalService.show(SinonimoComponent, { initialState: { sinonimos: sinonimosData }, class: 'modal-promo modal-dialog-centered' @@ -75,7 +76,7 @@ export class PromocionComponent implements OnInit { }); } - getPromociones() { + getPromociones() { const sector = this.articulosPromo[0].CodSec; const codigo = this.articulosPromo[0].CodArt; this.promocionService.getPromociones(sector, codigo) diff --git a/src/styles.scss b/src/styles.scss index b57c210..b38cdf1 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -27,6 +27,7 @@ body.media-pantalla { position: absolute; bottom: 0; width: 100%; + background-color: #3d3d3d; } .btn-effect { @@ -85,13 +86,6 @@ p { opacity: 0.5; } -body.media-pantalla { - height: 50% !important; - position: absolute; - bottom: 0; - width: 100%; -} - .modal-content.media-pantalla { margin-top: auto !important; margin-bottom: 50px !important; -- 1.9.1