Commit 195c30de668d86050c063a98d00851c799f1fc36
1 parent
3155fcd2d7
Exists in
develop
promos entran en una linea
Showing
2 changed files
with
8 additions
and
8 deletions
 
Show diff stats
src/app/modules/admin/admin.component.ts
| 1 | import { Component, OnInit, HostListener } 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 | ||
| 10 | export class AdminComponent implements OnInit { | 10 | export class AdminComponent implements OnInit { | 
| 11 | timerReposo: any; | 11 | timerReposo: any; | 
| 12 | 12 | ||
| 13 | constructor( | 13 | constructor( | 
| 14 | private router: Router, | 14 | private router: Router, | 
| 15 | ) { } | 15 | ) { } | 
| 16 | 16 | ||
| 17 | ngOnInit() { | 17 | ngOnInit() { | 
| 18 | // this.startTimeOutInactividad(); | 18 | this.startTimeOutInactividad(); | 
| 19 | } | 19 | } | 
| 20 | 20 | ||
| 21 | @HostListener('document:click', ['$event']) | 21 | @HostListener('document:click', ['$event']) | 
| 22 | 22 | ||
| 23 | // documentClick(event: MouseEvent) { | 23 | documentClick(event: MouseEvent) { | 
| 24 | // if (event) { | 24 | if (event) { | 
| 25 | // this.restartTimer(); | 25 | this.restartTimer(); | 
| 26 | // } | 26 | } | 
| 27 | // } | 27 | } | 
| 28 | 28 | ||
| 29 | restartTimer() { | 29 | restartTimer() { | 
| 30 | clearTimeout(this.timerReposo); | 30 | clearTimeout(this.timerReposo); | 
| 31 | this.startTimeOutInactividad(); | 31 | this.startTimeOutInactividad(); | 
| 32 | } | 32 | } | 
| 33 | 33 | ||
| 34 | startTimeOutInactividad() { | 34 | startTimeOutInactividad() { | 
| 35 | this.timerReposo = setTimeout(() => { | 35 | this.timerReposo = setTimeout(() => { | 
| 36 | this.router.navigate(['cancelar-compra']); | 36 | this.router.navigate(['cancelar-compra']); | 
| 37 | }, 90000); | 37 | }, 90000); | 
| 38 | } | 38 | } | 
| 39 | 39 | ||
| 40 | } | 40 | } | 
| 41 | 41 | 
src/app/shared/promocion/promocion.component.html
| 1 | <div class="modal-header bg-primary rounded-top"> | 1 | <div class="modal-header bg-primary rounded-top"> | 
| 2 | <div class="col-12"> | 2 | <div class="col-12"> | 
| 3 | <div class="row justify-content-between" *ngIf="articulosPromo.length"> | 3 | <div class="row justify-content-between" *ngIf="articulosPromo.length"> | 
| 4 | <div> | 4 | <div> | 
| 5 | <h3 class="ml-2 text-white mt-2">{{articulosPromo[0].DetArt}}</h3> | 5 | <h3 class="ml-2 text-white mt-2">{{articulosPromo[0].DetArt}}</h3> | 
| 6 | </div> | 6 | </div> | 
| 7 | <div> | 7 | <div> | 
| 8 | <div | 8 | <div | 
| 9 | class="row mr-3 justify-content-between bg-white badge-pill" | 9 | class="row mr-3 justify-content-between bg-white badge-pill" | 
| 10 | (click)="elegirPromo(articulosPromo[0])"> | 10 | (click)="elegirPromo(articulosPromo[0])"> | 
| 11 | <div class="col px-0 align-self-center text-primary"> | 11 | <div class="col px-0 align-self-center text-primary"> | 
| 12 | <p class="font-weight-bold">{{articulosPromo[0].PreVen | currency}}</p> | 12 | <p class="font-weight-bold">{{articulosPromo[0].PreVen | currency}}</p> | 
| 13 | </div> | 13 | </div> | 
| 14 | <div class="col-3 px-0"> | 14 | <div class="col-3 px-0"> | 
| 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="d-block ml-auto py-1 icon-30 mr-2 pt-2" | 19 | class="d-block ml-auto py-1 icon-30 mr-2 pt-2" | 
| 20 | src="assets/img/ir-color.svg"> | 20 | src="assets/img/ir-color.svg"> | 
| 21 | </div> | 21 | </div> | 
| 22 | </div> | 22 | </div> | 
| 23 | </div> | 23 | </div> | 
| 24 | </div> | 24 | </div> | 
| 25 | </div> | 25 | </div> | 
| 26 | </div> | 26 | </div> | 
| 27 | <div class="modal-body bg-primary rounded-bottom" *ngIf="articulosPromo.length"> | 27 | <div class="modal-body bg-primary rounded-bottom" *ngIf="articulosPromo.length"> | 
| 28 | <div class="row"> | 28 | <div class="row"> | 
| 29 | <div class="col-9"> | 29 | <div class="col-9"> | 
| 30 | <p class="text-white"><small>¿TE GUSTARÍA LLEVAR ESTE ARTÍCULO</small></p> | 30 | <p class="text-white"><small>¿TE GUSTARÍA LLEVAR ESTE ARTÍCULO</small></p> | 
| 31 | <h1 class="text-white mb-4">en un combo?</h1> | 31 | <h1 class="text-white mb-4">en un combo?</h1> | 
| 32 | <div *ngFor="let promo of promociones"> | 32 | <div *ngFor="let promo of promociones"> | 
| 33 | <div class="mx-0 mb-2 bg-white badge-pill text-primary" (click)="elegirPromo(promo)"> | 33 | <div class="mx-0 mb-2 bg-white badge-pill text-primary" (click)="elegirPromo(promo)"> | 
| 34 | <div class="row mx-0 justify-content-between"> | 34 | <div class="row mx-0 justify-content-between"> | 
| 35 | <p class="ml-4 text-truncate">{{promo.DetArt}}</p> | 35 | <p class="text-truncate"><small>{{promo.DetArt}}</small></p> | 
| 36 | <p class="mr-4 font-weight-bold">{{promo.PreVen | currency}}</p> | 36 | <p class="font-weight-bold">{{promo.PreVen | currency}}</p> | 
| 37 | </div> | 37 | </div> | 
| 38 | </div> | 38 | </div> | 
| 39 | </div> | 39 | </div> | 
| 40 | </div> | 40 | </div> | 
| 41 | <div class="col-3 rounded-circle"> | 41 | <div class="col-3 rounded-circle"> | 
| 42 | <img | 42 | <img | 
| 43 | draggable="false" | 43 | draggable="false" | 
| 44 | ondragstart="return false;" | 44 | ondragstart="return false;" | 
| 45 | (contextmenu)="false" | 45 | (contextmenu)="false" | 
| 46 | src="{{urlImagenes}}{{articulosPromo[0].imagenes[0].imagen}}" | 46 | src="{{urlImagenes}}{{articulosPromo[0].imagenes[0].imagen}}" | 
| 47 | onerror="this.src='assets/img/image-not-found.jpg'" | 47 | onerror="this.src='assets/img/image-not-found.jpg'" | 
| 48 | class="card-img-top img-fluid rounded-circle"> | 48 | class="card-img-top img-fluid rounded-circle"> | 
| 49 | </div> | 49 | </div> | 
| 50 | </div> | 50 | </div> | 
| 51 | </div> | 51 | </div> | 
| 52 | 52 |