Commit 12803ee663fbdd501638b1410e5cca5ebcb1eb01
1 parent
0bdaea4ac2
Exists in
develop
and in
1 other branch
arreglo bugs
Showing
3 changed files
with
53 additions
and
46 deletions
 
Show diff stats
src/app/modules/admin/admin.component.html
| 1 | <router-outlet click="restartTimer()"></router-outlet> | 1 | <router-outlet></router-outlet> | 
| 2 | <div class="h-8"> | 2 | <div class="h-8"> | 
| 3 | <app-footer></app-footer> | 3 | <app-footer></app-footer> | 
| 4 | </div> | 4 | </div> | 
| 5 | 5 | 
src/app/modules/admin/admin.component.ts
| 1 | import { Component, OnInit } from '@angular/core'; | 1 | import { Component, OnInit, HostListener } from '@angular/core'; | 
| 2 | import { Router } from '@angular/router'; | 2 | import { Router } from '@angular/router'; | 
| 3 | 3 | ||
| 4 | @Component({ | 4 | @Component({ | 
| 5 | selector: 'app-admin', | 5 | selector: 'app-admin', | 
| 6 | templateUrl: './admin.component.html', | 6 | templateUrl: './admin.component.html', | 
| 7 | styleUrls: ['./admin.component.scss'] | 7 | styleUrls: ['./admin.component.scss'] | 
| 8 | }) | 8 | }) | 
| 9 | |||
| 9 | export class AdminComponent implements OnInit { | 10 | export class AdminComponent implements OnInit { | 
| 10 | timerReposo: any; | 11 | timerReposo: any; | 
| 11 | 12 | ||
| 12 | constructor( | 13 | constructor( | 
| 13 | private router: Router, | 14 | private router: Router, | 
| 14 | ) { } | 15 | ) { } | 
| 16 | |||
| 17 | ngOnInit() { | ||
| 18 | this.startTimeOutInactividad(); | ||
| 19 | } | ||
| 15 | 20 | ||
| 16 | ngOnInit() { | 21 | @HostListener('document:click', ['$event']) | 
| 17 | this.startTimeOutInactividad(); | 22 | |
| 23 | documentClick(event: MouseEvent) { | ||
| 24 | if (event){ | ||
| 25 | this.restartTimer(); | ||
| 26 | } | ||
| 18 | } | 27 | } | 
| 19 | 28 | ||
| 20 | restartTimer() { | 29 | restartTimer() { | 
| 21 | clearTimeout(this.timerReposo); | 30 | clearTimeout(this.timerReposo); | 
| 22 | this.startTimeOutInactividad(); | 31 | this.startTimeOutInactividad(); | 
| 23 | } | 32 | } | 
| 24 | 33 | ||
| 25 | startTimeOutInactividad() { | 34 | startTimeOutInactividad() { | 
| 26 | setTimeout(() => { | 35 | this.timerReposo = setTimeout(() => { | 
| 27 | this.router.navigate(['cancelar-compra']); | 36 | this.router.navigate(['cancelar-compra']); | 
| 28 | }, 5000); | 37 | }, 90000); | 
| 29 | } | 38 | } | 
| 30 | 39 | ||
| 31 | } | 40 | } | 
| 32 | 41 | 
src/app/modules/cancelar-compra/cancelar-compra.component.html
| 1 | <div class="row justify-content-center mt-2"> | 1 | <div class="row justify-content-center mt-2 h-15"> | 
| 2 | <img class="w-15 h-15" src="../../../assets/img/logo-spot.svg"> | 2 | <img class="w-20 my-auto" src="../../../assets/img/logo-spot.svg"> | 
| 3 | </div> | 3 | </div> | 
| 4 | <div class="row mt-3 mx-0 justify-content-around h-75"> | 4 | <div class="row mt-5 mx-0 justify-content-around h-30"> | 
| 5 | <div class="col-5 col-md-6 col-lg-3 h-40"> | 5 | <div class="col-5 col-md-6 col-lg-3 h-100"> | 
| 6 | <div class="p-3 bg-white text-center shadow-lg rounded h-100"> | 6 | <div class="p-3 bg-white text-center shadow-lg rounded h-100"> | 
| 7 | <h5 class="pt-3 mt-3">NECESITA</h5> | 7 | <h4 class="pt-3 mt-5">NECESITA</h4> | 
| 8 | <h3 class="font-weight-bold text-secondary">más tiempo</h3> | 8 | <h2 class="font-weight-bold text-secondary mt-4">más tiempo</h2> | 
| 9 | <h5>PARA SU PEDIDO?</h5> | 9 | <h4 class="mt-4">PARA SU PEDIDO?</h4> | 
| 10 | </div> | 10 | </div> | 
| 11 | </div> | 11 | </div> | 
| 12 | </div> | 12 | </div> | 
| 13 | <!-- BUTTONS --> | 13 | <!-- BUTTONS --> | 
| 14 | <div class="h-25"> | 14 | <div class="row mt-5 h-auto justify-content-center mx-0"> | 
| 15 | <div class="row mt-5 h-auto justify-content-center mx-0"> | 15 | <div class="col-auto px-0 h-auto align-self-start"> | 
| 16 | <div class="col-auto px-0 h-auto align-self-start"> | 16 | <div | 
| 17 | <div | 17 | class="btn-effect col-auto align-self-center px-0 bg-white" | 
| 18 | class="btn-effect col-auto align-self-center px-0 bg-white" | 18 | (click)="volverPreviousPage()"> | 
| 19 | (click)="volverPreviousPage()"> | 19 | <div class="row mx-0 bg-primary badge-pill"> | 
| 20 | <div class="row mx-0 bg-primary badge-pill"> | 20 | <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> | 21 | <div class="col-auto align-self-center p-0"> | 
| 22 | <div class="col-auto align-self-center p-0"> | 22 | <img | 
| 23 | <img | ||
| 24 | draggable="false" | ||
| 25 | ondragstart="return false;" | ||
| 26 | (contextmenu)="false" | ||
| 27 | class="p-1 icon-30" | ||
| 28 | src="assets/img/ir.svg"> | ||
| 29 | </div> | ||
| 30 | </div> | ||
| 31 | </div> | ||
| 32 | </div> | ||
| 33 | </div> | ||
| 34 | <div class="row mt-4 h-auto justify-content-center mx-0"> | ||
| 35 | <div class="col-auto px-0 h-auto align-self-start"> | ||
| 36 | <div | ||
| 37 | class="btn-effect col-auto align-self-center px-0 bg-white" | ||
| 38 | (click)="limpiarCarritoYvolver()"> | ||
| 39 | <div class="row mx-0 cancelar-compra badge-pill"> | ||
| 40 | <div class="col-auto align-self-center">cancelar compra</div> | ||
| 41 | <div class="col-auto align-self-center p-0"> | ||
| 42 | <img | ||
| 43 | draggable="false" | 23 | draggable="false" | 
| 44 | ondragstart="return false;" | 24 | ondragstart="return false;" | 
| 45 | (contextmenu)="false" | 25 | (contextmenu)="false" | 
| 46 | class="p-1 icon-30" | 26 | class="p-1 icon-30" | 
| 47 | src="assets/img/icono-cancelar-color.svg"> | 27 | src="assets/img/ir.svg"> | 
| 48 | </div> | 28 | </div> | 
| 29 | </div> | ||
| 30 | </div> | ||
| 31 | </div> | ||
| 32 | </div> | ||
| 33 | <div class="row mt-4 h-auto justify-content-center mx-0"> | ||
| 34 | <div class="col-auto px-0 h-auto align-self-start"> |