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