Commit 2652f5c904f736f23d9206558d7b84cd74990b27
1 parent
53e6b9a948
Exists in
develop
and in
1 other branch
agrego total en carrito
Showing
5 changed files
with
16 additions
and
5 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/modules/carrito/carrito.component.html
1 | <div class="h-92 bg-white fade-in-left"> | 1 | <div class="h-92 bg-white fade-in-left"> |
2 | <!-- PUBLICIDADES --> | 2 | <!-- PUBLICIDADES --> |
3 | <app-header-publicidad></app-header-publicidad> | 3 | <app-header-publicidad></app-header-publicidad> |
4 | 4 | ||
5 | <div class="h-75"> | 5 | <div class="h-75"> |
6 | <!-- CABECERA --> | 6 | <!-- CABECERA --> |
7 | <div class="row mx-3 h-auto border border-primary rounded-sm"> | 7 | <div class="row mx-3 h-auto border border-primary rounded-sm"> |
8 | <div class="col-12 px-0 py-2 align-self-center"> | 8 | <div class="col-12 px-0 py-2 align-self-center"> |
9 | <div class="px-3"> | 9 | <div class="px-3"> |
10 | <p class="h6 text-truncate">ESTE ES TÚ CARRITO DE COMPRAS</p> | 10 | <p class="h6 text-truncate">ESTE ES TÚ CARRITO DE COMPRAS</p> |
11 | </div> | 11 | </div> |
12 | </div> | 12 | </div> |
13 | </div> | 13 | </div> |
14 | 14 | ||
15 | <!-- CARRITO --> | 15 | <!-- CARRITO --> |
16 | <div class="row mx-2 mt-4 h-80 justify-content-center align-content-start scroll-y-visible"> | 16 | <div class="row mx-2 mt-4 h-80 justify-content-center align-content-start scroll-y-visible"> |
17 | <!-- MENSAJE DE ADVERTENCIA --> | 17 | <!-- MENSAJE DE ADVERTENCIA --> |
18 | <div class="col-10 align-self-center alert alert-primary" *ngIf="!articuloService.carrito.length"> | 18 | <div class="col-10 align-self-center alert alert-primary" *ngIf="!articuloService.carrito.length"> |
19 | <p class="h5 text-center">No hay artículos en el carrito</p> | 19 | <p class="h5 text-center">No hay artículos en el carrito</p> |
20 | </div> | 20 | </div> |
21 | <!-- ARTICULOS --> | 21 | <!-- ARTICULOS --> |
22 | <div | 22 | <div |
23 | class="col-12 col-xl-6 p-2 h-25 text-center text-truncate" | 23 | class="col-12 col-xl-6 p-2 h-25 text-center text-truncate" |
24 | *ngFor="let articulo of articuloService.carrito; let i = index;" | 24 | *ngFor="let articulo of articuloService.carrito; let i = index;" |
25 | @EnterLeave> | 25 | @EnterLeave> |
26 | <!-- ARTICULO --> | 26 | <!-- ARTICULO --> |
27 | <div class="h-100 px-2 py-4 border border-primary rounded-sm"> | 27 | <div class="h-100 px-2 py-4 border border-primary rounded-sm"> |
28 | <div class="row mx-0 h-100"> | 28 | <div class="row mx-0 h-100"> |
29 | <!-- NOMBRE E IMAGEN --> | 29 | <!-- NOMBRE E IMAGEN --> |
30 | <div class="col-3 h-100 border-right border-primary align-self-center"> | 30 | <div class="col-3 h-100 border-right border-primary align-self-center"> |
31 | <img | 31 | <img |
32 | draggable="false" | 32 | draggable="false" |
33 | ondragstart="return false;" | 33 | ondragstart="return false;" |
34 | (contextmenu)="false" | 34 | (contextmenu)="false" |
35 | class="d-block mx-auto h-55 rounded-sm shadow-sm" | 35 | class="d-block mx-auto h-55 rounded-sm shadow-sm" |
36 | src="{{urlImagenes}}{{articulo.imagenes[0].imagen}}" | 36 | src="{{urlImagenes}}{{articulo.imagenes[0].imagen}}" |
37 | onerror="this.src='assets/img/image-not-found.jpg'"> | 37 | onerror="this.src='assets/img/image-not-found.jpg'"> |
38 | <div class="row mx-0 h-45"> | 38 | <div class="row mx-0 h-45"> |
39 | <p class="col text-primary text-truncate align-self-end"> | 39 | <p class="col text-primary text-truncate align-self-end"> |
40 | <small>{{articulo.DetArt}}</small> | 40 | <small>{{articulo.DetArt}}</small> |
41 | </p> | 41 | </p> |
42 | </div> | 42 | </div> |
43 | </div> | 43 | </div> |
44 | <!-- CANTIDAD --> | 44 | <!-- CANTIDAD --> |
45 | <div class="col-3 border-right border-primary"> | 45 | <div class="col-3 border-right border-primary"> |
46 | <p><small>CANT</small></p> | 46 | <p><small>CANT</small></p> |
47 | <div class="row mt-2 mx-0"> | 47 | <div class="row mt-2 mx-0"> |
48 | <div class="col-12 h-auto"> | 48 | <div class="col-12 h-auto"> |
49 | <div class="row mx-0 justify-content-between bg-primary badge-pill"> | 49 | <div class="row mx-0 justify-content-between bg-primary badge-pill"> |
50 | <!-- BOTON MENOS --> | 50 | <!-- BOTON MENOS --> |
51 | <div class="col-auto px-0"> | 51 | <div class="col-auto px-0"> |
52 | <img | 52 | <img |
53 | draggable="false" | 53 | draggable="false" |
54 | ondragstart="return false;" | 54 | ondragstart="return false;" |
55 | (contextmenu)="false" | 55 | (contextmenu)="false" |
56 | class="d-block ml-auto py-2 icon-20 btn-effect" | 56 | class="d-block ml-auto py-2 icon-20 btn-effect" |
57 | src="assets/img/menos-blanco.svg" | 57 | src="assets/img/menos-blanco.svg" |
58 | (click)="substractCant(articulo)"> | 58 | (click)="substractCant(articulo)"> |
59 | </div> | 59 | </div> |
60 | <!-- CANTIDAD --> | 60 | <!-- CANTIDAD --> |
61 | <div class="col px-0 align-self-center text-white"> | 61 | <div class="col px-0 align-self-center text-white"> |
62 | <p><small>{{articulo.cantidad}}</small></p> | 62 | <p><small>{{articulo.cantidad}}</small></p> |
63 | </div> | 63 | </div> |
64 | <!-- BOTON MAS --> | 64 | <!-- BOTON MAS --> |
65 | <div class="col-auto px-0"> | 65 | <div class="col-auto px-0"> |
66 | <img | 66 | <img |
67 | draggable="false" | 67 | draggable="false" |
68 | ondragstart="return false;" | 68 | ondragstart="return false;" |
69 | (contextmenu)="false" | 69 | (contextmenu)="false" |
70 | class="d-block ml-auto py-2 icon-20 btn-effect" | 70 | class="d-block ml-auto py-2 icon-20 btn-effect" |
71 | src="assets/img/mas-blanco.svg" | 71 | src="assets/img/mas-blanco.svg" |
72 | (click)="addCant(articulo)"> | 72 | (click)="addCant(articulo)"> |
73 | </div> | 73 | </div> |
74 | </div> | 74 | </div> |
75 | </div> | 75 | </div> |
76 | </div> | 76 | </div> |
77 | </div> | 77 | </div> |
78 | <!-- OPCIONALES --> | 78 | <!-- OPCIONALES --> |
79 | <!-- <div class="col-3 border-right border-primary"> | 79 | <!-- <div class="col-3 border-right border-primary"> |
80 | <p><small>OPCIONALES</small></p> | 80 | <p><small>OPCIONALES</small></p> |
81 | <div class="py-1 badge-pill bg-dark text-white"><p><small>{{'AZÚCAR'}}</small></p></div> | 81 | <div class="py-1 badge-pill bg-dark text-white"><p><small>{{'AZÚCAR'}}</small></p></div> |
82 | <div class="row mx-0 mt-2 justify-content-center"> | 82 | <div class="row mx-0 mt-2 justify-content-center"> |
83 | <div class="col-auto pl-3 btn-effect bg-primary badge-pill text-white"> | 83 | <div class="col-auto pl-3 btn-effect bg-primary badge-pill text-white"> |
84 | <span> | 84 | <span> |
85 | <small class="pr-2">CAMBIAR</small> | 85 | <small class="pr-2">CAMBIAR</small> |
86 | <img | 86 | <img |
87 | draggable="false" | 87 | draggable="false" |
88 | ondragstart="return false;" | 88 | ondragstart="return false;" |
89 | (contextmenu)="false" | 89 | (contextmenu)="false" |
90 | class="icon-20" | 90 | class="icon-20" |
91 | src="assets/img/ir.svg"> | 91 | src="assets/img/ir.svg"> |
92 | </span> | 92 | </span> |
93 | </div> | 93 | </div> |
94 | </div> --> | 94 | </div> --> |
95 | <!-- PRECIO --> | 95 | <!-- PRECIO --> |
96 | <div class="col-3 border-right border-primary"> | 96 | <div class="col-3 border-right border-primary"> |
97 | <p><small>PRECIO</small></p> | 97 | <p><small>PRECIO</small></p> |
98 | <div class="py-1 mt-2 badge-pill bg-dark text-white"> | 98 | <div class="py-1 mt-2 badge-pill bg-dark text-white"> |
99 | <p><small>{{articulo.PreVen | currency}}</small></p> | 99 | <p><small>{{articulo.PreVen | currency}}</small></p> |
100 | </div> | 100 | </div> |
101 | </div> | 101 | </div> |
102 | <!-- ELIMINAR --> | 102 | <!-- ELIMINAR --> |
103 | <div class="col-3 align-self-center"> | 103 | <div class="col-3 align-self-center"> |
104 | <div class="row mx-0 justify-content-center"> | 104 | <div class="row mx-0 justify-content-center"> |
105 | <div | 105 | <div |
106 | class="col-auto px-3 py-1 btn-effect bg-primary badge-pill text-white" | 106 | class="col-auto px-3 py-1 btn-effect bg-primary badge-pill text-white" |
107 | (click)="deleteArticulo(i)"> | 107 | (click)="deleteArticulo(i)"> |
108 | <span> | 108 | <span> |
109 | <small class="pr-2">ELIMINAR</small> | 109 | <small class="pr-2">ELIMINAR</small> |
110 | <img | 110 | <img |
111 | draggable="false" | 111 | draggable="false" |
112 | ondragstart="return false;" | 112 | ondragstart="return false;" |
113 | (contextmenu)="false" | 113 | (contextmenu)="false" |
114 | class="icon-20 rotate-45" | 114 | class="icon-20 rotate-45" |
115 | src="assets/img/mas-blanco.svg"> | 115 | src="assets/img/mas-blanco.svg"> |
116 | </span> | 116 | </span> |
117 | </div> | 117 | </div> |
118 | </div> | 118 | </div> |
119 | </div> | 119 | </div> |
120 | </div> | 120 | </div> |
121 | </div> | 121 | </div> |
122 | </div> | 122 | </div> |
123 | </div> | 123 | </div> |
124 | <!-- TOTAL --> | ||
125 | <div class="row mx-3 mt-2 h-auto justify-content-end"> | ||
126 | <div class="col-auto align-self-center text-primary"><small>TOTAL</small></div> | ||
127 | <div class="col-auto p-0 bg-primary d-none d-sm-block bg-total"> | ||
128 | <p class="text-center text-white mt-1 py-1">{{articuloService.subTotal | currency}}</p> | ||
129 | </div> | ||
130 | </div> | ||
124 | <!-- CONTINUAR --> | 131 | <!-- CONTINUAR --> |
125 | <div | 132 | <div |
126 | *ngIf="articuloService.carrito.length" | 133 | *ngIf="articuloService.carrito.length" |
127 | class="row mx-3 mt-4 h-auto justify-content-end"> | 134 | class="row mx-3 mt-4 h-auto justify-content-end"> |
128 | <div | 135 | <div |
129 | class="col-auto py-2 px-3 align-self-center btn-effect bg-primary badge-pill text-white" | 136 | class="col-auto py-2 px-3 align-self-center btn-effect bg-primary badge-pill text-white" |
130 | [routerLink]="['/forma-pago']"> | 137 | [routerLink]="['/forma-pago']"> |
131 | <span> | 138 | <span> |
132 | <small class="pr-2">CONTINUAR</small> | 139 | <small class="pr-2">CONTINUAR</small> |
133 | <img | 140 | <img |
134 | draggable="false" | 141 | draggable="false" |
135 | ondragstart="return false;" | 142 | ondragstart="return false;" |
136 | (contextmenu)="false" | 143 | (contextmenu)="false" |
137 | class="icon-20" | 144 | class="icon-20" |
138 | src="assets/img/ir.svg"> | 145 | src="assets/img/ir.svg"> |
139 | </span> | 146 | </span> |
140 | </div> | 147 | </div> |
141 | </div> | 148 | </div> |
142 | <!-- SEGUIR COMPRANDO --> | 149 | <!-- SEGUIR COMPRANDO --> |
143 | <div class="row mx-3 mt-2 h-auto justify-content-end"> | 150 | <!-- <div class="row mx-3 mt-2 h-auto justify-content-end"> |
144 | <div | 151 | <div |
145 | class="col-auto py-2 px-3 align-self-center btn-effect bg-primary badge-pill text-white" | 152 | class="col-auto py-2 px-3 align-self-center btn-effect bg-primary badge-pill text-white" |
146 | (click)="goBack()"> | 153 | (click)="goBack()"> |
147 | <span> | 154 | <span> |
148 | <small class="pr-2">SEGUIR COMPRANDO</small> | 155 | <small class="pr-2">SEGUIR COMPRANDO</small> |
149 | <img | 156 | <img |
150 | draggable="false" | 157 | draggable="false" |
151 | ondragstart="return false;" | 158 | ondragstart="return false;" |
152 | (contextmenu)="false" | 159 | (contextmenu)="false" |
153 | class="icon-20" | 160 | class="icon-20" |
154 | src="assets/img/ir.svg"> | 161 | src="assets/img/ir.svg"> |
155 | </span> | 162 | </span> |
156 | </div> | 163 | </div> |
157 | </div> | 164 | </div> --> |
158 | </div> | 165 | </div> |
159 | 166 | ||
160 | </div> | 167 | </div> |
161 | 168 |
src/app/modules/carrito/carrito.component.scss
1 | .bg-total { | ||
2 | width: 75px; | ||
3 | border-radius: 1.5rem; | ||
4 | } | ||
5 |
src/app/modules/seleccion-articulos/seleccion-articulos.component.html
1 | <div class="h-92 bg-white fade-in-left"> | 1 | <div class="h-92 bg-white fade-in-left"> |
2 | <!-- PUBLICIDADES --> | 2 | <!-- PUBLICIDADES --> |
3 | <app-header-publicidad></app-header-publicidad> | 3 | <app-header-publicidad></app-header-publicidad> |
4 | 4 | ||
5 | <div class="row mx-0 h-80 align-items-end"> | 5 | <div class="row mx-0 h-80 align-items-end"> |
6 | <!-- CABECERA --> | 6 | <!-- CABECERA --> |
7 | <div class="row w-100 mx-3 h-auto border border-primary rounded-sm"> | 7 | <div class="row w-100 mx-3 h-auto border border-primary rounded-sm"> |
8 | <div class="col-12 p-2 align-self-center"> | 8 | <div class="col-12 p-2 align-self-center"> |
9 | <div class="px-3"> | 9 | <div class="px-3"> |
10 | <p class="h6 text-truncate">SELECCIONÁ TÚ COMIDA Y/O BEBIDA</p> | 10 | <p class="h6 text-truncate">SELECCIONÁ TÚ COMIDA Y/O BEBIDA</p> |
11 | </div> | 11 | </div> |
12 | </div> | 12 | </div> |
13 | </div> | 13 | </div> |
14 | <!-- CUERPO --> | 14 | <!-- CUERPO --> |
15 | <div class="row w-100 mr-4 h-70"> | 15 | <div class="row w-100 mr-4 h-70"> |
16 | <div class="col-12 h-100 px-0 py-3"> | 16 | <div class="col-12 h-100 px-0 py-3"> |
17 | <div class="row mx-0 h-100"> | 17 | <div class="row mx-0 h-100"> |
18 | <!-- FILTRO CATEGORIAS --> | 18 | <!-- FILTRO CATEGORIAS --> |
19 | <div class="col-5 col-sm-3 col-xl-2 h-100"> | 19 | <div class="col-5 col-sm-3 col-xl-2 h-100"> |
20 | <p class="h6 h-6 m-0 text-center"><small>CATEGORÍAS</small></p> | 20 | <p class="h6 h-6 m-0 text-center"><small>CATEGORÍAS</small></p> |
21 | <div class="row mx-0 h-94 justify-content-center align-items-center"> | 21 | <div class="row mx-0 h-94 justify-content-center align-items-center"> |
22 | <div class="col-auto btn-effect h-5"> | 22 | <div class="col-auto btn-effect h-5"> |
23 | <img | 23 | <img |
24 | draggable="false" | 24 | draggable="false" |
25 | ondragstart="return false;" | 25 | ondragstart="return false;" |
26 | (contextmenu)="false" | 26 | (contextmenu)="false" |
27 | class="h-100 d-block mx-auto rotate-90-neg" | 27 | class="h-100 d-block mx-auto rotate-90-neg" |
28 | src="assets/img/ir-color.svg" | 28 | src="assets/img/ir-color.svg" |
29 | (mousedown)="scrollY(templateCategorias, -100)" | 29 | (mousedown)="scrollY(templateCategorias, -100)" |
30 | (mouseup)="mouseup()" | 30 | (mouseup)="mouseup()" |
31 | (mouseleave)="mouseup()"> | 31 | (mouseleave)="mouseup()"> |
32 | </div> | 32 | </div> |
33 | <!-- CATEGORIAS --> | 33 | <!-- CATEGORIAS --> |
34 | <div | 34 | <div |
35 | #templateCategorias | 35 | #templateCategorias |
36 | class="col-12 px-0 box-categorias border border-primary border-left-0 rounded-right scroll-y"> | 36 | class="col-12 px-0 box-categorias border border-primary border-left-0 rounded-right scroll-y"> |
37 | <div | 37 | <div |
38 | class="row mx-4 mb-2 h-32 justify-content-center tab" | 38 | class="row mx-4 mb-2 h-32 justify-content-center tab" |
39 | [ngClass]="{ 'active': allActive, 'border-bottom-effect': !allActive }" | 39 | [ngClass]="{ 'active': allActive, 'border-bottom-effect': !allActive }" |
40 | (click)="selectCategoria(-1, 0)"> | 40 | (click)="selectCategoria(-1, 0)"> |
41 | <img | 41 | <img |
42 | draggable="false" | 42 | draggable="false" |
43 | ondragstart="return false;" | 43 | ondragstart="return false;" |
44 | (contextmenu)="false" | 44 | (contextmenu)="false" |
45 | class="col-12 h-50 align-self-end d-none d-sm-block rounded-circle" | 45 | class="col-12 h-50 align-self-end d-none d-sm-block rounded-circle" |
46 | src="assets/img/ir-color.svg"> | 46 | src="assets/img/ir-color.svg"> |
47 | <small class="col-12 px-0 my-1 h-25 align-self-end text-center text-truncate">Todos</small> | 47 | <small class="col-12 px-0 my-1 h-25 align-self-end text-center text-truncate">Todos</small> |
48 | </div> | 48 | </div> |
49 | <div | 49 | <div |
50 | class="row mx-4 mb-2 h-32 justify-content-center tab" | 50 | class="row mx-4 mb-2 h-32 justify-content-center tab" |
51 | [ngClass]="{ 'active': categoria.selected, 'border-bottom-effect': !categoria.selected }" | 51 | [ngClass]="{ 'active': categoria.selected, 'border-bottom-effect': !categoria.selected }" |
52 | (click)="selectCategoria(i, categoria.id)" | 52 | (click)="selectCategoria(i, categoria.id)" |
53 | *ngFor="let categoria of categorias; let i = index;"> | 53 | *ngFor="let categoria of categorias; let i = index;"> |
54 | <img | 54 | <img |
55 | draggable="false" | 55 | draggable="false" |
56 | ondragstart="return false;" | 56 | ondragstart="return false;" |
57 | (contextmenu)="false" | 57 | (contextmenu)="false" |
58 | class="col-12 h-50 align-self-end d-none d-sm-block rounded-circle" | 58 | class="col-12 h-50 align-self-end d-none d-sm-block rounded-circle" |
59 | src="assets/img/ir-color.svg"> | 59 | src="assets/img/ir-color.svg"> |
60 | <small class="col-12 px-0 my-1 h-25 align-self-end text-center text-truncate">{{categoria.detalle}}</small> | 60 | <small class="col-12 px-0 my-1 h-25 align-self-end text-center text-truncate">{{categoria.detalle}}</small> |
61 | </div> | 61 | </div> |
62 | </div> | 62 | </div> |
63 | <div class="col-auto btn-effect h-5"> | 63 | <div class="col-auto btn-effect h-5"> |
64 | <img | 64 | <img |
65 | draggable="false" | 65 | draggable="false" |
66 | ondragstart="return false;" | 66 | ondragstart="return false;" |
67 | (contextmenu)="false" | 67 | (contextmenu)="false" |
68 | class="h-100 d-block mx-auto rotate-90" | 68 | class="h-100 d-block mx-auto rotate-90" |
69 | src="assets/img/ir-color.svg" | 69 | src="assets/img/ir-color.svg" |
70 | (mousedown)="scrollY(templateCategorias, 100)" | 70 | (mousedown)="scrollY(templateCategorias, 100)" |
71 | (mouseup)="mouseup()" | 71 | (mouseup)="mouseup()" |
72 | (mouseleave)="mouseup()"> | 72 | (mouseleave)="mouseup()"> |
73 | </div> | 73 | </div> |
74 | </div> | 74 | </div> |
75 | </div> | 75 | </div> |
76 | <!-- LISTA DE ARTICULOS --> | 76 | <!-- LISTA DE ARTICULOS --> |
77 | <div class="col-7 col-sm-9 col-xl-10 pb-3 h-80 align-self-center scroll-y-visible"> | 77 | <div class="col-7 col-sm-9 col-xl-10 pb-3 h-80 align-self-center scroll-y-visible"> |
78 | <div class="row row-cols-1 row-cols-sm-3 row-cols-xl-6"> | 78 | <div class="row row-cols-1 row-cols-sm-3 row-cols-xl-6"> |
79 | <!-- ARTICULO --> | 79 | <!-- ARTICULO --> |
80 | <div | 80 | <div |
81 | class="col px-2 my-1 my-md-3 h-auto" | 81 | class="col px-2 my-1 my-md-3 h-auto" |
82 | *ngFor="let articulo of auxArticulos | slice:0:showQuantity;"> | 82 | *ngFor="let articulo of auxArticulos | slice:0:showQuantity;"> |
83 | <div class="swing-in-top-fwd card h-auto"> | 83 | <div class="swing-in-top-fwd card h-auto"> |
84 | <img | 84 | <img |
85 | draggable="false" | 85 | draggable="false" |
86 | ondragstart="return false;" | 86 | ondragstart="return false;" |
87 | (contextmenu)="false" | 87 | (contextmenu)="false" |
88 | src="{{urlImagenes}}{{articulo.imagenes[0].imagen}}" | 88 | src="{{urlImagenes}}{{articulo.imagenes[0].imagen}}" |
89 | onerror="this.src='assets/img/image-not-found.jpg'" | 89 | onerror="this.src='assets/img/image-not-found.jpg'" |
90 | class="card-img-top h-55 rounded-sm"> | 90 | class="card-img-top h-55 rounded-sm"> |
91 | <div class="row mx-0 py-1 h-auto justify-content-center"> | 91 | <div class="row mx-0 py-1 h-auto justify-content-center"> |
92 | <p class="col-12 px-1 h6 h-auto text-primary text-center">{{articulo.DetArt}}</p> | 92 | <p class="col-12 px-1 h6 h-auto text-primary text-center">{{articulo.DetArt}}</p> |
93 | <p class="col-12 px-1 h-auto text-center line-height-sm"> | 93 | <p class="col-12 px-1 h-auto text-center line-height-sm"> |
94 | <small>{{articulo.DET_LAR}}</small> | 94 | <small>{{articulo.DET_LAR}}</small> |
95 | </p> | 95 | </p> |
96 | <div class="col-12 px-1 align-self-end btn-effect h-auto"> | 96 | <div class="col-12 px-1 align-self-end btn-effect h-auto"> |
97 | <div | 97 | <div |
98 | [ngClass]="{'bg-secondary': articulo.promo}" | 98 | [ngClass]="{'bg-secondary': articulo.promo}" |
99 | class="row mx-0 justify-content-between bg-primary badge-pill" | 99 | class="row mx-0 justify-content-between bg-primary badge-pill" |
100 | (click)="elegirArticulo(articulo)"> | 100 | (click)="elegirArticulo(articulo)"> |
101 | <div class="col px-0 align-self-center text-white text-right"> | 101 | <div class="col px-0 align-self-center text-white text-right"> |
102 | {{articulo.PreVen | currency}} | 102 | {{articulo.PreVen | currency}} |
103 | </div> | 103 | </div> |
104 | <div class="col-5 px-0"> | 104 | <div class="col-5 px-0"> |
105 | <img | 105 | <img |
106 | draggable="false" | 106 | draggable="false" |
107 | ondragstart="return false;" | 107 | ondragstart="return false;" |
108 | (contextmenu)="false" | 108 | (contextmenu)="false" |
109 | class="d-block ml-auto py-1 icon-30" | 109 | class="d-block ml-auto py-1 icon-30" |
110 | src="assets/img/ir.svg"> | 110 | src="assets/img/ir.svg"> |
111 | </div> | 111 | </div> |
112 | </div> | 112 | </div> |
113 | </div> | 113 | </div> |
114 | </div> | 114 | </div> |
115 | </div> | 115 | </div> |
116 | </div> | 116 | </div> |
117 | </div> | 117 | </div> |
118 | <!-- BOTON VER MAS --> | 118 | <!-- BOTON VER MAS --> |
119 | <div class="row mx-0"> | 119 | <div class="row mx-0"> |
120 | <div | 120 | <div |
121 | *ngIf="showQuantity <= auxArticulos.slice(0, showQuantity).length" | 121 | *ngIf="showQuantity <= auxArticulos.slice(0, showQuantity).length" |
122 | class="col-12 px-0 mb-2"> | 122 | class="col-12 px-0 mb-2"> |
123 | <button | 123 | <button |
124 | (click)="increaseShow()" | 124 | (click)="increaseShow()" |
125 | class="btn btn-block btn-outline-primary"> | 125 | class="btn btn-block btn-outline-primary"> |
126 | Ver Más | 126 | Ver Más |
127 | </button> | 127 | </button> |
128 | </div> | 128 | </div> |
129 | </div> | 129 | </div> |
130 | </div> | 130 | </div> |
131 | </div> | 131 | </div> |
132 | </div> | 132 | </div> |
133 | </div> | 133 | </div> |
134 | <!-- FOOTER CARRITO DE COMPRAS --> | 134 | <!-- FOOTER CARRITO DE COMPRAS --> |
135 | <div class="row w-90 mx-auto h-auto justify-content-center"> | 135 | <div class="row w-90 mx-auto h-auto justify-content-center"> |
136 | <div class="col-12 h-75 px-0 border border-primary rounded"> | 136 | <div class="col-12 h-75 px-0 border border-primary rounded"> |
137 | <!-- CABECERA --> | 137 | <!-- CABECERA --> |
138 | <div class="row mx-0 h-15 border-bottom border-primary"> | 138 | <div class="row mx-0 h-15 border-bottom border-primary"> |
139 | <p class="col align-self-center text-truncate"><small>ARTÍCULOS EN TÚ CARRITO DE COMPRAS</small></p> | 139 | <p class="col align-self-center text-truncate"><small>ARTÍCULOS EN TÚ CARRITO DE COMPRAS</small></p> |
140 | </div> | 140 | </div> |
141 | <!-- CUERPO --> | 141 | <!-- CUERPO --> |
142 | <div class="row h-85 mx-0 justify-content-around"> | 142 | <div class="row h-85 mx-0 justify-content-around"> |
143 | <!-- BOTON SCROLL IZQUIERDA --> | 143 | <!-- BOTON SCROLL IZQUIERDA --> |
144 | <div *ngIf="articuloService.carrito.length" class="col-auto btn-effect h-20 align-self-center"> | 144 | <div *ngIf="articuloService.carrito.length" class="col-auto btn-effect h-20 align-self-center"> |
145 | <img | 145 | <img |
146 | draggable="false" | 146 | draggable="false" |
147 | ondragstart="return false;" | 147 | ondragstart="return false;" |
148 | (contextmenu)="false" | 148 | (contextmenu)="false" |
149 | class="icon-30 rotate-180-neg" | 149 | class="icon-30 rotate-180-neg" |
150 | src="assets/img/ir-fondo-color.svg" | 150 | src="assets/img/ir-fondo-color.svg" |
151 | (mousedown)="scrollX(templateCarrito, -100)" | 151 | (mousedown)="scrollX(templateCarrito, -100)" |
152 | (mouseup)="mouseup()" | 152 | (mouseup)="mouseup()" |
153 | (mouseleave)="mouseup()"> | 153 | (mouseleave)="mouseup()"> |
154 | </div> | 154 | </div> |
155 | <!-- CARRITO --> | 155 | <!-- CARRITO --> |
156 | <div class="col-6 col-sm-8 col-md-9 col-lg-10 h-100"> | 156 | <div class="col-6 col-sm-8 col-md-9 col-lg-10 h-100"> |
157 | <div #templateCarrito class="row flex-row flex-nowrap h-100 mx-0 my-2 scroll-x"> | 157 | <div #templateCarrito class="row flex-row flex-nowrap h-100 mx-0 my-2 scroll-x"> |
158 | <!-- MENSAJE DE ADVERTENCIA --> | 158 | <!-- MENSAJE DE ADVERTENCIA --> |
159 | <div *ngIf="!articuloService.carrito.length" class="col h-100"> | 159 | <div *ngIf="!articuloService.carrito.length" class="col h-100"> |
160 | <p class="text-center py-5">No hay articulos en el carrito</p> | 160 | <p class="text-center py-5">No hay articulos en el carrito</p> |
161 | </div> | 161 | </div> |
162 | <!-- ARTICULOS --> | 162 | <!-- ARTICULOS --> |
163 | <div | 163 | <div |
164 | class="col-10 col-sm-4 col-lg-2 px-2 px-xl-4 align-self-center border-right border-primary" | 164 | class="col-10 col-sm-4 col-lg-2 px-2 px-xl-4 align-self-center border-right border-primary" |
165 | *ngFor="let articulo of articuloService.carrito; let i = index;"> | 165 | *ngFor="let articulo of articuloService.carrito; let i = index;"> |
166 | <div class="swing-in-top-fwd"> | 166 | <div class="swing-in-top-fwd"> |
167 | <img | 167 | <img |
168 | draggable="false" | 168 | draggable="false" |
169 | ondragstart="return false;" | 169 | ondragstart="return false;" |
170 | (contextmenu)="false" | 170 | (contextmenu)="false" |
171 | class="d-block img-fluid p-2 mx-auto rounded" | 171 | class="d-block img-fluid p-2 mx-auto rounded" |
172 | src="{{urlImagenes}}{{articulo.imagenes[0].imagen}}" | 172 | src="{{urlImagenes}}{{articulo.imagenes[0].imagen}}" |
173 | onerror="this.src='assets/img/image-not-found.jpg'"> | 173 | onerror="this.src='assets/img/image-not-found.jpg'"> |
174 | <p class="d-block mt-auto text-center text-primary text-truncate"> | 174 | <p class="d-block mt-auto text-center text-primary text-truncate"> |
175 | <small>{{articulo.DetArt}}</small> | 175 | <small>{{articulo.DetArt}}</small> |
176 | </p> | 176 | </p> |
177 | </div> | 177 | </div> |
178 | </div> | 178 | </div> |
179 | </div> | 179 | </div> |
180 | </div> | 180 | </div> |
181 | <!-- BOTON SCROLL DERECHA --> | 181 | <!-- BOTON SCROLL DERECHA --> |
182 | <div *ngIf="articuloService.carrito.length" class="col-auto btn-effect h-20 align-self-center"> | 182 | <div *ngIf="articuloService.carrito.length" class="col-auto btn-effect h-20 align-self-center"> |
183 | <img | 183 | <img |
184 | draggable="false" | 184 | draggable="false" |
185 | ondragstart="return false;" | 185 | ondragstart="return false;" |
186 | (contextmenu)="false" | 186 | (contextmenu)="false" |
187 | class="icon-30" | 187 | class="icon-30" |
188 | src="assets/img/ir-fondo-color.svg" | 188 | src="assets/img/ir-fondo-color.svg" |
189 | (mousedown)="scrollX(templateCarrito, 100)" | 189 | (mousedown)="scrollX(templateCarrito, 100)" |
190 | (mouseup)="mouseup()" | 190 | (mouseup)="mouseup()" |
191 | (mouseleave)="mouseup()"> | 191 | (mouseleave)="mouseup()"> |
192 | </div> | 192 | </div> |
193 | </div> | 193 | </div> |
194 | </div> | 194 | </div> |
195 | <!-- VER CARRITO Y TOTAL--> | 195 | <!-- VER CARRITO Y TOTAL--> |
196 | <div | 196 | <div |
197 | class="col-auto p-0 mt-2 ml-auto h-20" | 197 | class="col-auto p-0 mt-2 ml-auto h-20" |
198 | *ngIf="articuloService.carrito.length"> | 198 | *ngIf="articuloService.carrito.length"> |
199 | <div | 199 | <div |
200 | class="btn-effect col-auto align-self-center px-0 bg-white" | 200 | class="btn-effect col-auto align-self-center px-0 bg-white" |
201 | [routerLink]="['/carrito']"> | 201 | [routerLink]="['/carrito']"> |
202 | <div class="row justify-content-between mx-0"> | 202 | <div class="row justify-content-between mx-0"> |
203 | <div class="col-auto align-self-center text-primary">TOTAL</div> | 203 | <div class="col-auto align-self-center text-primary">TOTAL</div> |
204 | <div class="col-auto p-0 bg-primary d-none d-sm-block total-background"> | 204 | <div class="col-auto p-0 bg-primary d-none d-sm-block bg-total"> |
205 | <p class="text-center text-white mt-1 py-1">{{articuloService.subTotal | currency}}</p> | 205 | <p class="text-center text-white mt-1 py-1">{{articuloService.subTotal | currency}}</p> |
206 | </div> | 206 | </div> |
207 | <div class="col-auto align-self-center text-primary ml-2 bg-light">VER CARRITO</div> | 207 | <div class="col-auto align-self-center text-primary ml-2 bg-light">VER CARRITO</div> |
208 | <div class="col-auto p-0 bg-primary d-none d-sm-block"> | 208 | <div class="col-auto p-0 bg-primary d-none d-sm-block"> |
209 | <img | 209 | <img |
210 | draggable="false" | 210 | draggable="false" |
211 | ondragstart="return false;" | 211 | ondragstart="return false;" |
212 | (contextmenu)="false" | 212 | (contextmenu)="false" |
213 | class="p-2 icon-40" | 213 | class="p-2 icon-40" |
214 | src="assets/img/carrito.svg"> | 214 | src="assets/img/carrito.svg"> |
215 | </div> | 215 | </div> |
216 | </div> | 216 | </div> |
217 | </div> | 217 | </div> |
218 | </div> | 218 | </div> |
219 | 219 | ||
220 | </div> | 220 | </div> |
221 | </div> | 221 | </div> |
222 | 222 | ||
223 | </div> | 223 | </div> |
224 | 224 |
src/app/modules/seleccion-articulos/seleccion-articulos.component.scss
1 | $primary: #aa006b; | 1 | $primary: #aa006b; |
2 | 2 | ||
3 | .box-categorias { | 3 | .box-categorias { |
4 | height: calc(100% - 100px) !important; | 4 | height: calc(100% - 100px) !important; |
5 | } | 5 | } |
6 | 6 | ||
7 | .active { | 7 | .active { |
8 | background-color: white; | 8 | background-color: white; |
9 | border-bottom: 3px solid $primary !important; | 9 | border-bottom: 3px solid $primary !important; |
10 | } | 10 | } |
11 | 11 | ||
12 | .border-bottom-effect { | 12 | .border-bottom-effect { |
13 | border: none; | 13 | border: none; |
14 | position: relative; | 14 | position: relative; |
15 | &:hover { | 15 | &:hover { |
16 | border: none; | 16 | border: none; |
17 | } | 17 | } |
18 | &::after { | 18 | &::after { |
19 | content: ""; | 19 | content: ""; |
20 | position: absolute; | 20 | position: absolute; |
21 | width: 0px; | 21 | width: 0px; |
22 | height: 3px; | 22 | height: 3px; |
23 | left: 50%; | 23 | left: 50%; |
24 | bottom: 0; | 24 | bottom: 0; |
25 | background-color: $primary; | 25 | background-color: $primary; |
26 | transition: all ease-in-out 0.2s; | 26 | transition: all ease-in-out 0.2s; |
27 | } | 27 | } |
28 | &:hover::after { | 28 | &:hover::after { |
29 | width: 100%; | 29 | width: 100%; |
30 | left: 0; | 30 | left: 0; |
31 | } | 31 | } |
32 | } | 32 | } |
33 | 33 | ||
34 | .card { | 34 | .card { |
35 | border: none; | 35 | border: none; |
36 | } | 36 | } |
37 | 37 | ||
38 | .line-height-sm { | 38 | .line-height-sm { |
39 | line-height: 1.2; | 39 | line-height: 1.2; |
40 | } | 40 | } |
41 | 41 | ||
42 | .total-background { | 42 | .bg-total { |
43 | width: 110px; | 43 | width: 110px; |
44 | border-radius: 1.5rem; | 44 | border-radius: 1.5rem; |
45 | } | 45 | } |
46 | 46 |