Commit 6f920dbea40153c32b9a7d0acf4770199e9d412a
Exists in
develop
Merge branch 'master' into 'develop'
Master(benjamin) See merge request !98
Showing
4 changed files
Show diff stats
src/app/modules/info-formas-pago/info-formas-pago.component.ts
... | ... | @@ -22,7 +22,7 @@ export class InfoFormasPagoComponent implements OnInit, OnDestroy { |
22 | 22 | } |
23 | 23 | |
24 | 24 | openGoCaja(templateRef: TemplateRef<any>) { |
25 | - const modalRef = this.modalService.show(templateRef, { class: 'modal-dialog-centered' }); | |
25 | + const modalRef = this.modalService.show(templateRef, { class: 'modal-lg modal-dialog-centered' }); | |
26 | 26 | this.timer = setTimeout(() => { |
27 | 27 | modalRef.hide(); |
28 | 28 | }, 3000); |
src/app/modules/pago-tarjeta/pago-tarjeta.component.html
... | ... | @@ -57,3 +57,14 @@ |
57 | 57 | </div> |
58 | 58 | </div> |
59 | 59 | </div> |
60 | + | |
61 | +<ng-template #template> | |
62 | + <div class="modal-body rounded bg-primary"> | |
63 | + <h1 class="text-white text-center my-4">Por favor,<br>espera un momento</h1> | |
64 | + <div class="d-flex justify-content-center mt-2 mb-4"> | |
65 | + <div class="spinner-border text-white text-center" role="status"> | |
66 | + <span class="sr-only">Loading...</span> | |
67 | + </div> | |
68 | + </div> | |
69 | + </div> | |
70 | +</ng-template> |
src/app/modules/pago-tarjeta/pago-tarjeta.component.scss
src/app/modules/pago-tarjeta/pago-tarjeta.component.ts
1 | -import { Component, OnInit, OnDestroy } from '@angular/core'; | |
1 | +import { Component, OnInit, TemplateRef, OnDestroy, ViewChild } from '@angular/core'; | |
2 | 2 | import { ArticuloService } from 'src/app/services/articulo/articulo.service'; |
3 | 3 | import { Router } from '@angular/router'; |
4 | 4 | import { BsModalService } from 'ngx-bootstrap/modal'; |
... | ... | @@ -10,6 +10,8 @@ import { ErrorFormaPagoComponent } from 'src/app/shared/error-forma-pago/error-f |
10 | 10 | styleUrls: ['./pago-tarjeta.component.scss'] |
11 | 11 | }) |
12 | 12 | export class PagoTarjetaComponent implements OnInit, OnDestroy { |
13 | + timer: any; | |
14 | + @ViewChild('template', {static: true}) public template: TemplateRef<any>; | |
13 | 15 | |
14 | 16 | constructor( |
15 | 17 | private articuloService: ArticuloService, |
... | ... | @@ -22,6 +24,7 @@ export class PagoTarjetaComponent implements OnInit, OnDestroy { |
22 | 24 | this.router.navigate(['']); |
23 | 25 | return; |
24 | 26 | } |
27 | + this.openModalEspera(this.template); | |
25 | 28 | const dataPago = { |
26 | 29 | pedidoAnombreDe: '' |
27 | 30 | }; |
... | ... | @@ -39,6 +42,7 @@ export class PagoTarjetaComponent implements OnInit, OnDestroy { |
39 | 42 | } |
40 | 43 | |
41 | 44 | ngOnDestroy() { |
45 | + if (this.timer) clearTimeout(this.timer); | |
42 | 46 | for (let i = 1; i <= this.modalService.getModalsCount(); i++) { |
43 | 47 | this.modalService.hide(i); |
44 | 48 | } |
... | ... | @@ -49,4 +53,11 @@ export class PagoTarjetaComponent implements OnInit, OnDestroy { |
49 | 53 | $('.pago-tarjeta').addClass('media-pantalla'); |
50 | 54 | } |
51 | 55 | } |
56 | + | |
57 | + openModalEspera(templateRef: TemplateRef<any>) { | |
58 | + const modalRef = this.modalService.show(templateRef, { class: 'modal-lg modal-dialog-centered' }); | |
59 | + this.timer = setTimeout(() => { | |
60 | + modalRef.hide(); | |
61 | + }, 5000); | |
62 | + } | |
52 | 63 | } |