Commit c46216a6bb13c07d8694cf35485d5715f4b110f1
Exists in
develop
Merge branch 'develop' of git.focasoftware.com:angular/autoservicio-axion
Showing
8 changed files
Show diff stats
src/app/modules/admin/admin.component.ts
1 | -import { Component, OnInit, HostListener } from '@angular/core'; | |
1 | +import { Component, OnInit, HostListener, OnDestroy } from '@angular/core'; | |
2 | 2 | import { Router } from '@angular/router'; |
3 | 3 | |
4 | 4 | @Component({ |
... | ... | @@ -7,7 +7,7 @@ import { Router } from '@angular/router'; |
7 | 7 | styleUrls: ['./admin.component.scss'] |
8 | 8 | }) |
9 | 9 | |
10 | -export class AdminComponent implements OnInit { | |
10 | +export class AdminComponent implements OnInit, OnDestroy { | |
11 | 11 | timerReposo: any; |
12 | 12 | |
13 | 13 | constructor( |
... | ... | @@ -18,15 +18,12 @@ export class AdminComponent implements OnInit { |
18 | 18 | this.startTimeOutInactividad(); |
19 | 19 | } |
20 | 20 | |
21 | - @HostListener('document:click', ['$event']) | |
22 | - | |
23 | - documentClick(event: MouseEvent) { | |
24 | - if (event) { | |
25 | - this.restartTimer(); | |
26 | - } | |
21 | + ngOnDestroy() { | |
22 | + clearTimeout(this.timerReposo); | |
27 | 23 | } |
28 | 24 | |
29 | - restartTimer() { | |
25 | + @HostListener('document:click', ['$event']) | |
26 | + documentClick(event: MouseEvent) { | |
30 | 27 | clearTimeout(this.timerReposo); |
31 | 28 | this.startTimeOutInactividad(); |
32 | 29 | } |
src/app/modules/cancelar-compra/cancelar-compra.component.ts
1 | -import { Component, OnInit } from '@angular/core'; | |
1 | +import { Component, OnInit, OnDestroy } from '@angular/core'; | |
2 | 2 | import { Location } from '@angular/common'; |
3 | 3 | import { ArticuloService } from 'src/app/services/articulo/articulo.service'; |
4 | 4 | import { Router } from '@angular/router'; |
... | ... | @@ -8,7 +8,8 @@ import { Router } from '@angular/router'; |
8 | 8 | templateUrl: './cancelar-compra.component.html', |
9 | 9 | styleUrls: ['./cancelar-compra.component.scss'] |
10 | 10 | }) |
11 | -export class CancelarCompraComponent implements OnInit { | |
11 | +export class CancelarCompraComponent implements OnInit, OnDestroy { | |
12 | + timer: any; | |
12 | 13 | |
13 | 14 | constructor( |
14 | 15 | private location: Location, |
... | ... | @@ -17,11 +18,15 @@ export class CancelarCompraComponent implements OnInit { |
17 | 18 | ) { } |
18 | 19 | |
19 | 20 | ngOnInit() { |
20 | - setTimeout(() => { | |
21 | + this.timer = setTimeout(() => { | |
21 | 22 | this.limpiarCarritoYvolver(); |
22 | 23 | }, 90000); |
23 | 24 | } |
24 | 25 | |
26 | + ngOnDestroy() { | |
27 | + clearTimeout(this.timer); | |
28 | + } | |
29 | + | |
25 | 30 | volverPreviousPage() { |
26 | 31 | this.location.back(); |
27 | 32 | } |
src/app/modules/pedidos-salientes/pedidos-salientes.component.html
... | ... | @@ -18,7 +18,7 @@ |
18 | 18 | *ngFor="let pedido of pedidosPendientes; let i = index" |
19 | 19 | [hidden]="i > 3" |
20 | 20 | class="font-weight-bold mb-2 text-muted"> |
21 | - <h1 class="display-4">{{rellenar(pedido.id.toString().slice(1), 2)}}</h1> | |
21 | + <h1 class="display-4">{{rellenar(pedido.id.toString().slice(1), 3)}}</h1> | |
22 | 22 | </div> |
23 | 23 | </div> |
24 | 24 | </div> |
... | ... | @@ -27,7 +27,7 @@ |
27 | 27 | <h5 class="pt-3">LISTO PARA</h5> |
28 | 28 | <h3 class="font-weight-bold text-primary">retirar</h3> |
29 | 29 | <div *ngIf="pedidoFinalizado.length"> |
30 | - <h1 class="display-1 mt-4 text-primary mb-0">{{rellenar(pedidoFinalizado[0].id.toString().slice(1), 2)}}</h1> | |
30 | + <h1 class="display-1 mt-4 text-primary mb-0">{{rellenar(pedidoFinalizado[0].id.toString().slice(1), 3)}}</h1> | |
31 | 31 | <hr class="line mt-0"> |
32 | 32 | </div> |
33 | 33 | <h3 class="font-weight-bold text-info mt-4">¡Que lo disfrutes!</h3> |
src/app/modules/seleccion-articulos/seleccion-articulos.component.html
... | ... | @@ -56,7 +56,8 @@ |
56 | 56 | ondragstart="return false;" |
57 | 57 | (contextmenu)="false" |
58 | 58 | class="col-12 h-50 align-self-end d-none d-sm-block rounded-circle" |
59 | - src="{{urlImagenes}}{{categoria.path_imagen}}"> | |
59 | + src="{{urlImagenes}}{{categoria.path_imagen}}" | |
60 | + onerror="this.src='assets/img/image-not-found.jpg'"> | |
60 | 61 | <small class="col-12 px-0 my-1 h-25 align-self-end text-center text-truncate">{{categoria.detalle}}</small> |
61 | 62 | </div> |
62 | 63 | </div> |
... | ... | @@ -81,9 +82,6 @@ |
81 | 82 | class="col px-2 my-1 my-md-3 h-auto" |
82 | 83 | *ngFor="let articulo of auxArticulos | slice:0:showQuantity;"> |
83 | 84 | <div class="swing-in-top-fwd card h-auto"> |
84 | - <div *ngIf="articulo.PRO"> | |
85 | - <i class="fas fa-piggy-bank"></i> | |
86 | - </div> | |
87 | 85 | <img |
88 | 86 | draggable="false" |
89 | 87 | ondragstart="return false;" |
... | ... | @@ -92,14 +90,18 @@ |
92 | 90 | onerror="this.src='assets/img/image-not-found.jpg'" |
93 | 91 | class="card-img-top h-55 rounded-sm"> |
94 | 92 | <div class="row mx-0 py-1 h-auto justify-content-center"> |
95 | - <p class="col-12 px-1 h6 h-auto text-primary text-center min-h-60">{{articulo.DetArt}}</p> | |
93 | + <p | |
94 | + [ngClass]="{'text-primary': articulo.PRO, 'text-secondary': !articulo.PRO}" | |
95 | + class="col-12 px-1 h6 h-auto text-center min-h-60"> | |
96 | + {{articulo.DetArt}} | |
97 | + </p> | |
96 | 98 | <p class="col-12 px-1 h-auto text-center line-height-sm min-h-50"> |
97 | 99 | <small>{{articulo.DET_LAR}}</small> |
98 | 100 | </p> |
99 | 101 | <div class="col-12 px-1 align-self-end btn-effect h-auto"> |
100 | 102 | <div |
101 | - [ngClass]="{'bg-secondary': articulo.PRO}" | |
102 | - class="row mx-0 justify-content-between bg-primary badge-pill" | |
103 | + [ngClass]="{'bg-primary': articulo.PRO, 'bg-secondary': !articulo.PRO}" | |
104 | + class="row mx-0 justify-content-between badge-pill" | |
103 | 105 | (click)="elegirArticulo(articulo)"> |
104 | 106 | <div class="col px-0 align-self-center text-white text-right"> |
105 | 107 | {{articulo.PreVen | currency}} |
src/app/modules/splash-screen/splash-screen.component.ts
src/app/services/articulo/articulo.service.ts
... | ... | @@ -44,8 +44,8 @@ export class ArticuloService { |
44 | 44 | setArticulo(articulo: IArticulo) { |
45 | 45 | for (const articuloCarrito of this.carrito) { |
46 | 46 | if (articuloCarrito.id === articulo.id) { |
47 | - if (articulo.PRO) break; | |
48 | 47 | articuloCarrito.cantidad++; |
48 | + this.calcularTotal(); | |
49 | 49 | return; |
50 | 50 | } |
51 | 51 | } |
src/app/shared/promocion/promocion.component.html
1 | -<div class="modal-header bg-primary rounded-top"> | |
2 | - <div class="col-12"> | |
3 | - <div class="row justify-content-between" *ngIf="articulosPromo.length"> | |
4 | - <div> | |
5 | - <h3 class="ml-2 text-white mt-2">{{articulosPromo[0].DetArt}}</h3> | |
6 | - </div> | |
7 | - <div> | |
8 | - <div | |
9 | - class="row mr-3 justify-content-between bg-white badge-pill" | |
10 | - (click)="elegirPromo(articulosPromo[0])"> | |
11 | - <div class="col px-0 align-self-center text-primary"> | |
12 | - <p class="font-weight-bold">{{articulosPromo[0].PreVen | currency}}</p> | |
13 | - </div> | |
14 | - <div class="col-3 px-0"> | |
15 | - <img | |
16 | - draggable="false" | |
17 | - ondragstart="return false;" | |
18 | - (contextmenu)="false" | |
19 | - class="d-block ml-auto py-1 icon-30 mr-2 pt-2" | |
20 | - src="assets/img/ir-color.svg"> | |
21 | - </div> | |
1 | +<div class="modal-header px-0 bg-primary rounded-top"> | |
2 | + <div class="row mx-0 w-100 justify-content-between" *ngIf="articulosPromo.length"> | |
3 | + <div class="col-8"> | |
4 | + <p class="h3 text-white">{{articulosPromo[0].DetArt}}</p> | |
5 | + </div> | |
6 | + <div class="col-4 align-self-center"> | |
7 | + <div | |
8 | + class="row mx-0 justify-content-between bg-white badge-pill" | |
9 | + (click)="elegirPromo(articulosPromo[0])"> | |
10 | + <div class="col px-0 align-self-center text-primary"> | |
11 | + <p class="font-weight-bold">{{articulosPromo[0].PreVen | currency}}</p> | |
12 | + </div> | |
13 | + <div class="col-3 px-0"> | |
14 | + <img | |
15 | + draggable="false" | |
16 | + ondragstart="return false;" | |
17 | + (contextmenu)="false" | |
18 | + class="d-block ml-auto py-1 icon-30 mr-2 pt-2" | |
19 | + src="assets/img/ir-color.svg"> | |
22 | 20 | </div> |
23 | 21 | </div> |
24 | 22 | </div> |
25 | 23 | </div> |
26 | 24 | </div> |
27 | -<div class="modal-body bg-primary rounded-bottom" *ngIf="articulosPromo.length"> | |
28 | - <div class="row"> | |
25 | +<div class="modal-body px-0 bg-primary rounded-bottom" *ngIf="articulosPromo.length"> | |
26 | + <div class="row mx-0 w-100"> | |
29 | 27 | <div class="col-9"> |
30 | 28 | <p class="text-white"><small>¿TE GUSTARÍA LLEVAR ESTE ARTÍCULO</small></p> |
31 | 29 | <h1 class="text-white mb-4">en un combo?</h1> |
30 | + </div> | |
31 | + <div class="col-3 rounded-circle"> | |
32 | + <img | |
33 | + draggable="false" | |
34 | + ondragstart="return false;" | |
35 | + (contextmenu)="false" | |
36 | + src="{{urlImagenes}}{{articulosPromo[0].imagenes[0].imagen}}" | |
37 | + onerror="this.src='assets/img/image-not-found.jpg'" | |
38 | + class="card-img-top img-fluid rounded-circle"> | |
39 | + </div> | |
40 | + </div> | |
41 | + <div class="row mx-0 lista-promociones scroll-y-visible"> | |
42 | + <div class="col-12"> | |
32 | 43 | <div *ngFor="let promo of promociones"> |
33 | 44 | <div class="mx-0 mb-2 bg-white badge-pill text-primary" (click)="elegirPromo(promo)"> |
34 | - <div class="row mx-0 justify-content-between"> | |
35 | - <p class="text-truncate"><small>{{promo.DetArt}}</small></p> | |
36 | - <p class="font-weight-bold">{{promo.PreVen | currency}}</p> | |
45 | + <div class="d-flex"> | |
46 | + <p class="text-truncate mr-auto my-auto"><small>{{promo.DetArt}}</small></p> | |
47 | + <p class="font-weight-bold my-auto pr-2"> | |
48 | + <span>{{promo.PreVen | currency}}</span> | |
49 | + </p> | |
50 | + <img | |
51 | + draggable="false" | |
52 | + ondragstart="return false;" | |
53 | + (contextmenu)="false" | |
54 | + class="d-block icon-30 py-1" | |
55 | + src="assets/img/ir-color.svg"> | |
37 | 56 | </div> |
38 | 57 | </div> |
39 | 58 | </div> |
40 | 59 | </div> |
41 | - <div class="col-3 rounded-circle"> | |
42 | - <img | |
43 | - draggable="false" | |
44 | - ondragstart="return false;" | |
45 | - (contextmenu)="false" | |
46 | - src="{{urlImagenes}}{{articulosPromo[0].imagenes[0].imagen}}" | |
47 | - onerror="this.src='assets/img/image-not-found.jpg'" | |
48 | - class="card-img-top img-fluid rounded-circle"> | |
49 | - </div> | |
50 | 60 | </div> |
51 | 61 | </div> |
src/app/shared/promocion/promocion.component.scss