Commit 1525f49f4efc91c0bad05e40af00d40f5f0d975c
1 parent
8d599c3d3e
Exists in
20200117-axion-responsive
correcciones merge request
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
src/app/modules/cancelar-compra/cancelar-compra.component.ts
1 | import { Component, OnInit } from '@angular/core'; | 1 | import { Component, OnInit } from '@angular/core'; |
2 | import { Location } from '@angular/common'; | 2 | import { Location } from '@angular/common'; |
3 | import { ArticuloService } from 'src/app/services/articulo/articulo.service'; | 3 | import { ArticuloService } from 'src/app/services/articulo/articulo.service'; |
4 | import { Router } from '@angular/router'; | 4 | import { Router } from '@angular/router'; |
5 | 5 | ||
6 | @Component({ | 6 | @Component({ |
7 | selector: 'app-cancelar-compra', | 7 | selector: 'app-cancelar-compra', |
8 | templateUrl: './cancelar-compra.component.html', | 8 | templateUrl: './cancelar-compra.component.html', |
9 | styleUrls: ['./cancelar-compra.component.scss'] | 9 | styleUrls: ['./cancelar-compra.component.scss'] |
10 | }) | 10 | }) |
11 | export class CancelarCompraComponent implements OnInit { | 11 | export class CancelarCompraComponent implements OnInit { |
12 | 12 | ||
13 | constructor( | 13 | constructor( |
14 | private location: Location, | 14 | private location: Location, |
15 | private router: Router, | 15 | private router: Router, |
16 | private articuloService: ArticuloService | 16 | private articuloService: ArticuloService |
17 | ) {} | 17 | ) {} |
18 | 18 | ||
19 | ngOnInit() { | 19 | ngOnInit() { |
20 | setTimeout(() => { | 20 | setTimeout(() => { |
21 | this.limpiarCarritoYvolver(); | 21 | this.limpiarCarritoYvolver(); |
22 | }, 90000); | 22 | }, 90000); |
23 | this.mediaPantalla(); | 23 | this.mediaPantalla(); |
24 | } | 24 | } |
25 | 25 | ||
26 | volverPreviousPage() { | 26 | volverPreviousPage() { |
27 | this.location.back(); | 27 | this.location.back(); |
28 | } | 28 | } |
29 | 29 | ||
30 | limpiarCarritoYvolver() { | 30 | limpiarCarritoYvolver() { |
31 | this.articuloService.carrito = undefined; | 31 | this.articuloService.carrito = undefined; |
32 | this.router.navigate(['/']); | 32 | this.router.navigate(['/']); |
33 | } | 33 | } |
34 | 34 | ||
35 | mediaPantalla() { | 35 | mediaPantalla() { |
36 | if ($('body').hasClass('media-pantalla')) { | 36 | if ($('body').hasClass('media-pantalla')) { |
37 | $('#cancelImg,#cancelCard').addClass('media-pantalla'); | 37 | $('#cancelImg,#cancelCard').addClass('media-pantalla'); |
38 | } | 38 | } |
39 | } | 39 | } |
40 | } | ||
40 | } |