Commit e7d1d50c261ade4059d57ea03febdda94d001975
1 parent
3e236fbaab
Exists in
develop
cambio forma de dirigirse al cliente a modo imperativo
Showing
4 changed files
with
6 additions
and
6 deletions
Show diff stats
src/app/modules/info-formas-pago/info-formas-pago.component.html
| 1 | <div class="h-92 bg-white fade-in-left"> | 1 | <div class="h-92 bg-white fade-in-left"> |
| 2 | <div class="row mx-0 h-15"> | 2 | <div class="row mx-0 h-15"> |
| 3 | <div class="col-12 px-0 h-80 my-auto"> | 3 | <div class="col-12 px-0 h-80 my-auto"> |
| 4 | <img | 4 | <img |
| 5 | draggable="false" | 5 | draggable="false" |
| 6 | ondragstart="return false;" | 6 | ondragstart="return false;" |
| 7 | (contextmenu)="false" | 7 | (contextmenu)="false" |
| 8 | class="d-block mx-auto h-100" | 8 | class="d-block mx-auto h-100" |
| 9 | src="assets/img/logo-spot.svg"> | 9 | src="assets/img/logo-spot.svg"> |
| 10 | </div> | 10 | </div> |
| 11 | </div> | 11 | </div> |
| 12 | <div class="h-85"> | 12 | <div class="h-85"> |
| 13 | <div class="row h-auto mt-6 mx-0 justify-content-center text-center"> | 13 | <div class="row h-auto mt-6 mx-0 justify-content-center text-center"> |
| 14 | <div | 14 | <div |
| 15 | [routerLink]="['/opcion-pedido']" | 15 | [routerLink]="['/opcion-pedido']" |
| 16 | class="col-11 col-sm-10 col-md-7 p-5 m-5 h-auto | 16 | class="col-11 col-sm-10 col-md-7 p-5 m-5 h-auto |
| 17 | btn-effect align-self-end border border-secondary rounded reduce-card-1"> | 17 | btn-effect align-self-end border border-secondary rounded reduce-card-1"> |
| 18 | <img | 18 | <img |
| 19 | draggable="false" | 19 | draggable="false" |
| 20 | ondragstart="return false;" | 20 | ondragstart="return false;" |
| 21 | (contextmenu)="false" | 21 | (contextmenu)="false" |
| 22 | class="img-in-top px-4 bg-white" | 22 | class="img-in-top px-4 bg-white" |
| 23 | src="assets/img/icono-tarjetas.svg"> | 23 | src="assets/img/icono-tarjetas.svg"> |
| 24 | <p class="h6 m-0">ESTA TERMINAL OPERA CON</p> | 24 | <p class="h6 m-0">ESTA TERMINAL OPERA CON</p> |
| 25 | <p class="h2 mb-3 text-secondary"> | 25 | <p class="h2 mb-3 text-secondary"> |
| 26 | tarjetas y | 26 | tarjetas y |
| 27 | <img | 27 | <img |
| 28 | draggable="false" | 28 | draggable="false" |
| 29 | ondragstart="return false;" | 29 | ondragstart="return false;" |
| 30 | (contextmenu)="false" | 30 | (contextmenu)="false" |
| 31 | class="icon-150" | 31 | class="icon-150" |
| 32 | src="assets/img/icono-mercado-pago.svg"> | 32 | src="assets/img/icono-mercado-pago.svg"> |
| 33 | </p> | 33 | </p> |
| 34 | <div class="d-inline-block py-1 btn-effect bg-secondary badge-pill text-white"> | 34 | <div class="d-inline-block py-1 btn-effect bg-secondary badge-pill text-white"> |
| 35 | CONTINUAR | 35 | CONTINUAR |
| 36 | <img | 36 | <img |
| 37 | draggable="false" | 37 | draggable="false" |
| 38 | ondragstart="return false;" | 38 | ondragstart="return false;" |
| 39 | (contextmenu)="false" | 39 | (contextmenu)="false" |
| 40 | class="icon-30" | 40 | class="icon-30" |
| 41 | src="assets/img/ir.svg"> | 41 | src="assets/img/ir.svg"> |
| 42 | </div> | 42 | </div> |
| 43 | </div> | 43 | </div> |
| 44 | <div | 44 | <div |
| 45 | class="col-11 col-sm-10 col-md-7 p-5 m-5 h-auto align-self-center | 45 | class="col-11 col-sm-10 col-md-7 p-5 m-5 h-auto align-self-center |
| 46 | btn-effect border border-primary rounded reduce-card-2" | 46 | btn-effect border border-primary rounded reduce-card-2" |
| 47 | (click)="openGoCaja(templateGoCaja)"> | 47 | (click)="openGoCaja(templateGoCaja)"> |
| 48 | <img | 48 | <img |
| 49 | draggable="false" | 49 | draggable="false" |
| 50 | ondragstart="return false;" | 50 | ondragstart="return false;" |
| 51 | (contextmenu)="false" | 51 | (contextmenu)="false" |
| 52 | class="img-in-top px-4 bg-white" | 52 | class="img-in-top px-4 bg-white" |
| 53 | src="assets/img/icono-efectivo.svg"> | 53 | src="assets/img/icono-efectivo.svg"> |
| 54 | <p class="h6 m-0">SI PREFERIS PAGAR EN EFECTIVO</p> | 54 | <p class="h6 m-0">SI PREFERIS PAGAR EN EFECTIVO</p> |
| 55 | <p class="h2 m-0 text-primary">haga su pedido<br>en caja</p> | 55 | <p class="h2 m-0 text-primary">haga su pedido<br>en caja</p> |
| 56 | </div> | 56 | </div> |
| 57 | </div> | 57 | </div> |
| 58 | </div> | 58 | </div> |
| 59 | </div> | 59 | </div> |
| 60 | 60 | ||
| 61 | <ng-template #templateGoCaja> | 61 | <ng-template #templateGoCaja> |
| 62 | <div class="col-12 bg-primary rounded shadow text-white"> | 62 | <div class="col-12 bg-primary rounded shadow text-white"> |
| 63 | <div class="row justify-content-center"> | 63 | <div class="row justify-content-center"> |
| 64 | <img | 64 | <img |
| 65 | draggable="false" | 65 | draggable="false" |
| 66 | ondragstart="return false;" | 66 | ondragstart="return false;" |
| 67 | (contextmenu)="false" | 67 | (contextmenu)="false" |
| 68 | class="align-self-center icon-60 mt-4" | 68 | class="align-self-center icon-60 mt-4" |
| 69 | src="assets/img/icono-cajero.svg"> | 69 | src="assets/img/icono-cajero.svg"> |
| 70 | </div> | 70 | </div> |
| 71 | <div class="modal-body text-center h1 mt-2 mb-4"> | 71 | <div class="modal-body text-center h1 mt-2 mb-4"> |
| 72 | haga su pedido<br>en caja. | 72 | hacé tu pedido<br>en caja. |
| 73 | </div> | 73 | </div> |
| 74 | </div> | 74 | </div> |
| 75 | </ng-template> | 75 | </ng-template> |
| 76 | 76 |
src/app/modules/pago-tarjeta/pago-tarjeta.component.html
| 1 | <div class="h-92 bg-white fade-in-left"> | 1 | <div class="h-92 bg-white fade-in-left"> |
| 2 | <div class="row mx-0 h-15"> | 2 | <div class="row mx-0 h-15"> |
| 3 | <div class="col-12 px-0 h-80 my-auto"> | 3 | <div class="col-12 px-0 h-80 my-auto"> |
| 4 | <img | 4 | <img |
| 5 | draggable="false" | 5 | draggable="false" |
| 6 | ondragstart="return false;" | 6 | ondragstart="return false;" |
| 7 | (contextmenu)="false" | 7 | (contextmenu)="false" |
| 8 | class="d-block mx-auto h-100" | 8 | class="d-block mx-auto h-100" |
| 9 | src="assets/img/logo-spot.svg"> | 9 | src="assets/img/logo-spot.svg"> |
| 10 | </div> | 10 | </div> |
| 11 | </div> | 11 | </div> |
| 12 | <div class="h-85 pago-tarjeta"> | 12 | <div class="h-85 pago-tarjeta"> |
| 13 | <div class="row h-50 mx-0 justify-content-center text-center"> | 13 | <div class="row h-50 mx-0 justify-content-center text-center"> |
| 14 | <div class="col-7 p-5 h-auto align-self-end border border-secondary rounded"> | 14 | <div class="col-7 p-5 h-auto align-self-end border border-secondary rounded"> |
| 15 | <img | 15 | <img |
| 16 | draggable="false" | 16 | draggable="false" |
| 17 | ondragstart="return false;" | 17 | ondragstart="return false;" |
| 18 | (contextmenu)="false" | 18 | (contextmenu)="false" |
| 19 | class="img-in-top px-4 bg-white" | 19 | class="img-in-top px-4 bg-white" |
| 20 | src="assets/img/icono-tarjetas.svg"> | 20 | src="assets/img/icono-tarjetas.svg"> |
| 21 | <p class="h6 m-0">AHORA ESPERÁ QUE SE ACTIVE EL POSNET</p> | 21 | <p class="h6 m-0">AHORA ESPERÁ QUE SE ACTIVE EL POSNET</p> |
| 22 | <p class="h2 mb-3 text-secondary"> | 22 | <p class="h2 mb-3 text-secondary"> |
| 23 | deslice su tarjeta | 23 | deslizá tu tarjeta |
| 24 | </p> | 24 | </p> |
| 25 | <p class="h6 m-0">Y SEGUÍ LAS INSTRUCCIONES DEL LECTOR</p> | 25 | <p class="h6 m-0">Y SEGUÍ LAS INSTRUCCIONES DEL LECTOR</p> |
| 26 | </div> | 26 | </div> |
| 27 | </div> | 27 | </div> |
| 28 | <div class="row mt-5 justify-content-center arrow-slide arrow-delay-1"> | 28 | <div class="row mt-5 justify-content-center arrow-slide arrow-delay-1"> |
| 29 | <div class="col-1"> | 29 | <div class="col-1"> |
| 30 | <img | 30 | <img |
| 31 | draggable="false" | 31 | draggable="false" |
| 32 | ondragstart="return false;" | 32 | ondragstart="return false;" |
| 33 | (contextmenu)="false" | 33 | (contextmenu)="false" |
| 34 | class="img-fluid" | 34 | class="img-fluid" |
| 35 | src="assets/img/down-chevron.svg"> | 35 | src="assets/img/down-chevron.svg"> |
| 36 | </div> | 36 | </div> |
| 37 | </div> | 37 | </div> |
| 38 | <div class="row justify-content-center arrow-slide arrow-delay-2"> | 38 | <div class="row justify-content-center arrow-slide arrow-delay-2"> |
| 39 | <div class="col-1"> | 39 | <div class="col-1"> |
| 40 | <img | 40 | <img |
| 41 | draggable="false" | 41 | draggable="false" |
| 42 | ondragstart="return false;" | 42 | ondragstart="return false;" |
| 43 | (contextmenu)="false" | 43 | (contextmenu)="false" |
| 44 | class="img-fluid" | 44 | class="img-fluid" |
| 45 | src="assets/img/down-chevron.svg"> | 45 | src="assets/img/down-chevron.svg"> |
| 46 | </div> | 46 | </div> |
| 47 | </div> | 47 | </div> |
| 48 | <div class="row justify-content-center arrow-slide arrow-delay-3"> | 48 | <div class="row justify-content-center arrow-slide arrow-delay-3"> |
| 49 | <div class="col-1"> | 49 | <div class="col-1"> |
| 50 | <img | 50 | <img |
| 51 | draggable="false" | 51 | draggable="false" |
| 52 | ondragstart="return false;" | 52 | ondragstart="return false;" |
| 53 | (contextmenu)="false" | 53 | (contextmenu)="false" |
| 54 | class="img-fluid" | 54 | class="img-fluid" |
| 55 | src="assets/img/down-chevron.svg"> | 55 | src="assets/img/down-chevron.svg"> |
| 56 | </div> | 56 | </div> |
| 57 | </div> | 57 | </div> |
| 58 | </div> | 58 | </div> |
| 59 | </div> | 59 | </div> |
| 60 | 60 | ||
| 61 | <ng-template #template> | 61 | <ng-template #template> |
| 62 | <div class="modal-body rounded bg-primary"> | 62 | <div class="modal-body rounded bg-primary"> |
| 63 | <h1 class="text-white text-center my-4">Por favor,<br>esperá un momento</h1> | 63 | <h1 class="text-white text-center my-4">Por favor,<br>esperá un momento</h1> |
| 64 | <div class="d-flex justify-content-center mt-2 mb-4"> | 64 | <div class="d-flex justify-content-center mt-2 mb-4"> |
| 65 | <div class="spinner-border text-white text-center" role="status"> | 65 | <div class="spinner-border text-white text-center" role="status"> |
| 66 | <span class="sr-only">Loading...</span> | 66 | <span class="sr-only">Loading...</span> |
| 67 | </div> | 67 | </div> |
| 68 | </div> | 68 | </div> |
| 69 | </div> | 69 | </div> |
| 70 | </ng-template> | 70 | </ng-template> |
| 71 | 71 |
src/app/shared/cancelar-compra/cancelar-compra.component.html
| 1 | <div class="row justify-content-center mt-2 h-15"> | 1 | <div class="row justify-content-center mt-2 h-15"> |
| 2 | <img class="h-100 w-auto my-auto" src="../../../assets/img/logo-spot.svg"> | 2 | <img class="h-100 w-auto my-auto" src="../../../assets/img/logo-spot.svg"> |
| 3 | </div> | 3 | </div> |
| 4 | <div class="row mx-auto h-70"> | 4 | <div class="row mx-auto h-70"> |
| 5 | <div class="col-12 align-self-center"> | 5 | <div class="col-12 align-self-center"> |
| 6 | <div class="row mt-5 mx-0 justify-content-around"> | 6 | <div class="row mt-5 mx-0 justify-content-around"> |
| 7 | <div class="col-12 col-sm-8 col-md-6 col-lg-4"> | 7 | <div class="col-12 col-sm-8 col-md-6 col-lg-4"> |
| 8 | <div class="p-3 bg-white text-center shadow-lg rounded"> | 8 | <div class="p-3 bg-white text-center shadow-lg rounded"> |
| 9 | <p class="mt-4 h4">NECESITA</p> | 9 | <p class="mt-4 h4">NECESITÁS</p> |
| 10 | <p class="font-weight-bold text-secondary my-4 h2">más tiempo</p> | 10 | <p class="font-weight-bold text-secondary my-4 h2">más tiempo</p> |
| 11 | <p class="mb-4 h4">PARA SU PEDIDO?</p> | 11 | <p class="mb-4 h4">PARA TU PEDIDO?</p> |
| 12 | </div> | 12 | </div> |
| 13 | </div> | 13 | </div> |
| 14 | </div> | 14 | </div> |
| 15 | <!-- BUTTONS --> | 15 | <!-- BUTTONS --> |
| 16 | <div class="row mx-0 mt-5 justify-content-center"> | 16 | <div class="row mx-0 mt-5 justify-content-center"> |
| 17 | <div class="col-auto px-0 align-self-start"> | 17 | <div class="col-auto px-0 align-self-start"> |
| 18 | <div | 18 | <div |
| 19 | class="row mx-0 py-1 btn-effect bg-primary badge-pill" | 19 | class="row mx-0 py-1 btn-effect bg-primary badge-pill" |
| 20 | (click)="volverPreviousPage()"> | 20 | (click)="volverPreviousPage()"> |
| 21 | <div class="col-auto align-self-center text-white">continuar compra</div> | 21 | <div class="col-auto align-self-center text-white">continuar compra</div> |
| 22 | <div class="col-auto align-self-center p-0"> | 22 | <div class="col-auto align-self-center p-0"> |
| 23 | <img | 23 | <img |
| 24 | draggable="false" | 24 | draggable="false" |
| 25 | ondragstart="return false;" | 25 | ondragstart="return false;" |
| 26 | (contextmenu)="false" | 26 | (contextmenu)="false" |
| 27 | class="p-1 icon-30" | 27 | class="p-1 icon-30" |
| 28 | src="assets/img/ir.svg"> | 28 | src="assets/img/ir.svg"> |
| 29 | </div> | 29 | </div> |
| 30 | </div> | 30 | </div> |
| 31 | </div> | 31 | </div> |
| 32 | </div> | 32 | </div> |
| 33 | <div class="row mx-0 mt-4 justify-content-center"> | 33 | <div class="row mx-0 mt-4 justify-content-center"> |
| 34 | <div class="col-auto px-0 align-self-start"> | 34 | <div class="col-auto px-0 align-self-start"> |
| 35 | <div | 35 | <div |
| 36 | class="row mx-0 py-1 btn-effect bg-grey badge-pill" | 36 | class="row mx-0 py-1 btn-effect bg-grey badge-pill" |
| 37 | (click)="limpiarCarritoYvolver()"> | 37 | (click)="limpiarCarritoYvolver()"> |
| 38 | <div class="col-auto align-self-center">cancelar compra</div> | 38 | <div class="col-auto align-self-center">cancelar compra</div> |
| 39 | <div class="col-auto align-self-center p-0"> | 39 | <div class="col-auto align-self-center p-0"> |
| 40 | <img | 40 | <img |
| 41 | draggable="false" | 41 | draggable="false" |
| 42 | ondragstart="return false;" | 42 | ondragstart="return false;" |
| 43 | (contextmenu)="false" | 43 | (contextmenu)="false" |
| 44 | class="p-1 icon-30" | 44 | class="p-1 icon-30" |
| 45 | src="assets/img/icono-cancelar-color.svg"> | 45 | src="assets/img/icono-cancelar-color.svg"> |
| 46 | </div> | 46 | </div> |
| 47 | </div> | 47 | </div> |
| 48 | </div> | 48 | </div> |
| 49 | </div> | 49 | </div> |
| 50 | </div> | 50 | </div> |
| 51 | </div> | 51 | </div> |
| 52 | 52 |
src/app/shared/header-publicidad/header-publicidad.component.ts
| 1 | import { Component, OnInit, TemplateRef } from '@angular/core'; | 1 | import { Component, OnInit, TemplateRef } from '@angular/core'; |
| 2 | import { APP_SETTINGS } from 'src/etc/AppSettings'; | 2 | import { APP_SETTINGS } from 'src/etc/AppSettings'; |
| 3 | import { IPublicidad } from 'src/app/interfaces/IPublicidad'; | 3 | import { IPublicidad } from 'src/app/interfaces/IPublicidad'; |
| 4 | import { PublicidadService } from 'src/app/services/publicidad/publicidad.service'; | 4 | import { PublicidadService } from 'src/app/services/publicidad/publicidad.service'; |
| 5 | import { IArticulo } from 'src/app/interfaces/IArticulo'; | 5 | import { IArticulo } from 'src/app/interfaces/IArticulo'; |
| 6 | import { PromocionComponent } from '../promocion/promocion.component'; | 6 | import { PromocionComponent } from '../promocion/promocion.component'; |
| 7 | import { BsModalService, BsModalRef } from 'ngx-bootstrap/modal'; | 7 | import { BsModalService, BsModalRef } from 'ngx-bootstrap/modal'; |
| 8 | import { ArticuloService } from 'src/app/services/articulo/articulo.service'; | 8 | import { ArticuloService } from 'src/app/services/articulo/articulo.service'; |
| 9 | import { ConfirmacionComponent } from '../confirmacion/confirmacion.component'; | 9 | import { ConfirmacionComponent } from '../confirmacion/confirmacion.component'; |
| 10 | import { SinonimoService } from 'src/app/services/sinonimo/sinonimo.service'; | 10 | import { SinonimoService } from 'src/app/services/sinonimo/sinonimo.service'; |
| 11 | import { ISinonimo } from 'src/app/interfaces/ISinonimo'; | 11 | import { ISinonimo } from 'src/app/interfaces/ISinonimo'; |
| 12 | import { SinonimoComponent } from '../sinonimo/sinonimo.component'; | 12 | import { SinonimoComponent } from '../sinonimo/sinonimo.component'; |
| 13 | import * as _ from 'lodash'; | 13 | import * as _ from 'lodash'; |
| 14 | 14 | ||
| 15 | @Component({ | 15 | @Component({ |
| 16 | selector: 'app-header-publicidad', | 16 | selector: 'app-header-publicidad', |
| 17 | templateUrl: './header-publicidad.component.html', | 17 | templateUrl: './header-publicidad.component.html', |
| 18 | styleUrls: ['./header-publicidad.component.scss'] | 18 | styleUrls: ['./header-publicidad.component.scss'] |
| 19 | }) | 19 | }) |
| 20 | export class HeaderPublicidadComponent implements OnInit { | 20 | export class HeaderPublicidadComponent implements OnInit { |
| 21 | urlImagenes = `${APP_SETTINGS.apiImagenes}/imagenes/`; | 21 | urlImagenes = `${APP_SETTINGS.apiImagenes}/imagenes/`; |
| 22 | publicidades: IPublicidad[] = []; | 22 | publicidades: IPublicidad[] = []; |
| 23 | modalRef: BsModalRef; | 23 | modalRef: BsModalRef; |
| 24 | modalSinonimo: BsModalRef; | 24 | modalSinonimo: BsModalRef; |
| 25 | 25 | ||
| 26 | constructor( | 26 | constructor( |
| 27 | private publicidadService: PublicidadService, | 27 | private publicidadService: PublicidadService, |
| 28 | private articuloService: ArticuloService, | 28 | private articuloService: ArticuloService, |
| 29 | private modalService: BsModalService, | 29 | private modalService: BsModalService, |
| 30 | private sinonimoService: SinonimoService | 30 | private sinonimoService: SinonimoService |
| 31 | ) { } | 31 | ) { } |
| 32 | 32 | ||
| 33 | ngOnInit() { | 33 | ngOnInit() { |
| 34 | this.getPublicidades(); | 34 | this.getPublicidades(); |
| 35 | this.mediaPantalla(); | 35 | this.mediaPantalla(); |
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | getPublicidades() { | 38 | getPublicidades() { |
| 39 | this.publicidadService.getAll() | 39 | this.publicidadService.getAll() |
| 40 | .subscribe((res: IPublicidad[]) => { | 40 | .subscribe((res: IPublicidad[]) => { |
| 41 | this.publicidades = res; | 41 | this.publicidades = res; |
| 42 | }, err => console.error(err)); | 42 | }, err => console.error(err)); |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | elegirArticulo(publicidad: IPublicidad) { | 45 | elegirArticulo(publicidad: IPublicidad) { |
| 46 | if (publicidad.id_articulo) this.getByID(publicidad.id_articulo); | 46 | if (publicidad.id_articulo) this.getByID(publicidad.id_articulo); |
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | getByID(id: number) { | 49 | getByID(id: number) { |
| 50 | this.articuloService.getById(id) | 50 | this.articuloService.getById(id) |
| 51 | .subscribe((res: IArticulo) => { | 51 | .subscribe((res: IArticulo) => { |
| 52 | if (res.FPP) { | 52 | if (res.FPP) { |
| 53 | this.openModalPromos(res); | 53 | this.openModalPromos(res); |
| 54 | return; | 54 | return; |
| 55 | } else { | 55 | } else { |
| 56 | this.openModalConfirmacion(res); | 56 | this.openModalConfirmacion(res); |
| 57 | return; | 57 | return; |
| 58 | } | 58 | } |
| 59 | }, err => console.error(err)); | 59 | }, err => console.error(err)); |
| 60 | } | 60 | } |
| 61 | 61 | ||
| 62 | openModalPromos(articulo: IArticulo) { | 62 | openModalPromos(articulo: IArticulo) { |
| 63 | if (this.modalRef) return; | 63 | if (this.modalRef) return; |
| 64 | this.modalRef = this.modalService.show(PromocionComponent, | 64 | this.modalRef = this.modalService.show(PromocionComponent, |
| 65 | { | 65 | { |
| 66 | initialState: { | 66 | initialState: { |
| 67 | idArticulo: articulo.id | 67 | idArticulo: articulo.id |
| 68 | }, | 68 | }, |
| 69 | class: 'modal-dialog-centered' | 69 | class: 'modal-dialog-centered' |
| 70 | }); | 70 | }); |
| 71 | } | 71 | } |
| 72 | 72 | ||
| 73 | openModalConfirmacion(articulo: IArticulo) { | 73 | openModalConfirmacion(articulo: IArticulo) { |
| 74 | if (this.modalRef) return; | 74 | if (this.modalRef) return; |
| 75 | this.articuloService.setArticulosSinImagen([articulo]); | 75 | this.articuloService.setArticulosSinImagen([articulo]); |
| 76 | this.modalRef = this.modalService.show(ConfirmacionComponent, | 76 | this.modalRef = this.modalService.show(ConfirmacionComponent, |
| 77 | { | 77 | { |
| 78 | initialState: { | 78 | initialState: { |
| 79 | titleMessage: articulo.DET_LAR, | 79 | titleMessage: articulo.DET_LAR, |
| 80 | imagenPath: articulo.imagenes.length ? articulo.imagenes[0].imagen : 'assets/img/imagen-no-encontrada.jpg', | 80 | imagenPath: articulo.imagenes.length ? articulo.imagenes[0].imagen : 'assets/img/imagen-no-encontrada.jpg', |
| 81 | footerMessageFirst: `¿DESEA AGREGAR ESTE COMBO`, | 81 | footerMessageFirst: `¿QUERÉS AGREGAR ESTE COMBO`, |
| 82 | footerMessageSecond: `a su carrito?`, | 82 | footerMessageSecond: `a tu carrito?`, |
| 83 | footerConfirmation: articulo.PreVen | 83 | footerConfirmation: articulo.PreVen |
| 84 | }, | 84 | }, |
| 85 | ignoreBackdropClick: true, | 85 | ignoreBackdropClick: true, |
| 86 | class: 'modal-dialog-centered' | 86 | class: 'modal-dialog-centered' |
| 87 | }); | 87 | }); |
| 88 | this.modalRef.content.onClose.subscribe((resClose) => { | 88 | this.modalRef.content.onClose.subscribe((resClose) => { |
| 89 | this.modalRef = null; | 89 | this.modalRef = null; |
| 90 | if (!resClose) return; | 90 | if (!resClose) return; |
| 91 | this.sinonimoService.getSinonimos(articulo.CodSec, articulo.CodArt) | 91 | this.sinonimoService.getSinonimos(articulo.CodSec, articulo.CodArt) |
| 92 | .subscribe((res: ISinonimo[]) => { | 92 | .subscribe((res: ISinonimo[]) => { |
| 93 | if (res.length) { | 93 | if (res.length) { |
| 94 | const sinonimos = []; | 94 | const sinonimos = []; |
| 95 | const gruposArticulos = _.groupBy(res[0].productos, 'ID_SIN'); | 95 | const gruposArticulos = _.groupBy(res[0].productos, 'ID_SIN'); |
| 96 | Object.keys(gruposArticulos).forEach(key => { | 96 | Object.keys(gruposArticulos).forEach(key => { |
| 97 | sinonimos.push({ productos: gruposArticulos[key] }); | 97 | sinonimos.push({ productos: gruposArticulos[key] }); |
| 98 | }); | 98 | }); |
| 99 | res = sinonimos; | 99 | res = sinonimos; |
| 100 | this.openModalSinonimos(res, articulo); | 100 | this.openModalSinonimos(res, articulo); |
| 101 | } else { | 101 | } else { |
| 102 | articulo.cantidad = 1; | 102 | articulo.cantidad = 1; |
| 103 | this.articuloService.setArticulo(articulo); | 103 | this.articuloService.setArticulo(articulo); |
| 104 | } | 104 | } |
| 105 | }, err => console.error(err)); | 105 | }, err => console.error(err)); |
| 106 | }); | 106 | }); |
| 107 | this.mediaPantalla(); | 107 | this.mediaPantalla(); |
| 108 | } | 108 | } |
| 109 | 109 | ||
| 110 | openModalSinonimos(sinonimosData: ISinonimo[], articulo: IArticulo) { | 110 | openModalSinonimos(sinonimosData: ISinonimo[], articulo: IArticulo) { |
| 111 | if (this.modalSinonimo) return; | 111 | if (this.modalSinonimo) return; |
| 112 | this.modalSinonimo = this.modalService.show(SinonimoComponent, { | 112 | this.modalSinonimo = this.modalService.show(SinonimoComponent, { |
| 113 | initialState: { | 113 | initialState: { |
| 114 | sinonimos: sinonimosData, | 114 | sinonimos: sinonimosData, |
| 115 | articulo | 115 | articulo |
| 116 | }, | 116 | }, |
| 117 | class: 'modal-dialog-centered' | 117 | class: 'modal-dialog-centered' |
| 118 | }); | 118 | }); |
| 119 | this.modalSinonimo.content.onClose | 119 | this.modalSinonimo.content.onClose |
| 120 | .subscribe((res: any) => { | 120 | .subscribe((res: any) => { |
| 121 | for (const a of articulo.productos) { | 121 | for (const a of articulo.productos) { |
| 122 | for (const aRes of res.articulos) { | 122 | for (const aRes of res.articulos) { |
| 123 | if (a.idSinonimo === aRes.ID_SIN) { | 123 | if (a.idSinonimo === aRes.ID_SIN) { |
| 124 | a.CODA = aRes.CodArt; | 124 | a.CODA = aRes.CodArt; |
| 125 | a.CodArt = aRes.CodArt; | 125 | a.CodArt = aRes.CodArt; |
| 126 | a.SECA = aRes.CodSec; | 126 | a.SECA = aRes.CodSec; |
| 127 | aRes.CodSec = aRes.CodSec; | 127 | aRes.CodSec = aRes.CodSec; |
| 128 | a.PreVen = aRes.PreVen; | 128 | a.PreVen = aRes.PreVen; |
| 129 | a.id = aRes.id; | 129 | a.id = aRes.id; |
| 130 | a.DET_LAR = aRes.DET_LAR; | 130 | a.DET_LAR = aRes.DET_LAR; |
| 131 | a.DetArt = aRes.DetArt; | 131 | a.DetArt = aRes.DetArt; |
| 132 | } | 132 | } |
| 133 | } | 133 | } |
| 134 | } | 134 | } |
| 135 | this.articuloService.setArticulo(articulo); | 135 | this.articuloService.setArticulo(articulo); |
| 136 | }); | 136 | }); |
| 137 | } | 137 | } |
| 138 | 138 | ||
| 139 | mediaPantalla() { | 139 | mediaPantalla() { |
| 140 | if ($('body').hasClass('media-pantalla')) { | 140 | if ($('body').hasClass('media-pantalla')) { |
| 141 | $('#headerPublicidad,#headerPad').addClass('media-pantalla'); | 141 | $('#headerPublicidad,#headerPad').addClass('media-pantalla'); |
| 142 | } | 142 | } |
| 143 | } | 143 | } |
| 144 | } | 144 | } |
| 145 | 145 |