Commit f68a44db2bd259fe6d5141e8ccaf2dd70ffc53b4

Authored by Luis Suarez
Exists in develop

solving merge

src/app/modules/info-formas-pago/info-formas-pago.component.html
1 <div class="h-92 bg-white fade-in-left"> 1 <div class="h-92 bg-white fade-in-left">
2 <div class="row mx-0 h-15"> 2 <div class="row mx-0 h-15">
3 <div class="col-12 px-0 h-80 my-auto"> 3 <div class="col-12 px-0 h-80 my-auto">
4 <img 4 <img
5 draggable="false" 5 draggable="false"
6 ondragstart="return false;" 6 ondragstart="return false;"
7 (contextmenu)="false" 7 (contextmenu)="false"
8 class="d-block mx-auto h-100" 8 class="d-block mx-auto h-100"
9 src="assets/img/logo-spot.svg"> 9 src="assets/img/logo-spot.svg">
10 </div> 10 </div>
11 </div> 11 </div>
12 <div class="h-85"> 12 <div class="h-85">
13 <div class="row h-auto mt-6 mx-0 justify-content-center text-center"> 13 <div class="row h-auto mt-6 mx-0 justify-content-center text-center">
14 <div class="col-7 col-lg-4 p-5 m-5 h-auto align-self-end border 14 <<<<<<< HEAD
15 border-secondary rounded reduce-card-1"> 15 <div class="col-7 col-lg-4 p-5 m-5 h-auto align-self-end border
16 <img 16 border-secondary rounded reduce-card-1">
17 draggable="false" 17 =======
18 ondragstart="return false;" 18 <div class="col-7 col-xl-4 p-5 m-5 h-auto align-self-end border border-secondary rounded">
19 (contextmenu)="false" 19 >>>>>>> 7004c1df495d5ac2e703f7ff659d1d8c3b384953
20 class="img-in-top px-4 bg-white" 20 <img
21 src="assets/img/icono-tarjetas.svg"> 21 draggable="false"
22 <p class="h6 m-0">ESTA TERMINAL OPERA CON</p> 22 ondragstart="return false;"
23 <p class="h2 mb-3 text-secondary"> 23 (contextmenu)="false"
24 tarjetas y 24 class="img-in-top px-4 bg-white"
25 <img 25 src="assets/img/icono-tarjetas.svg">
26 draggable="false" 26 <p class="h6 m-0">ESTA TERMINAL OPERA CON</p>
27 ondragstart="return false;" 27 <p class="h2 mb-3 text-secondary">
28 (contextmenu)="false" 28 tarjetas y
29 class="w-15" 29 <img
30 src="assets/img/icono-mercado-pago.svg"> 30 draggable="false"
31 </p> 31 ondragstart="return false;"
32 <div 32 (contextmenu)="false"
33 class="d-inline-block py-1 btn-effect bg-secondary badge-pill text-white" 33 class="icon-150"
34 [routerLink]="['/opcion-pedido']"> 34 src="assets/img/icono-mercado-pago.svg">
35 CONTINUAR 35 </p>
36 <img 36 <div
37 draggable="false" 37 class="d-inline-block py-1 btn-effect bg-secondary badge-pill text-white"
38 ondragstart="return false;" 38 [routerLink]="['/opcion-pedido']">
39 (contextmenu)="false" 39 CONTINUAR
40 class="icon-30" 40 <img
41 src="assets/img/ir.svg"> 41 draggable="false"
42 </div> 42 ondragstart="return false;"
43 </div> 43 (contextmenu)="false"
44 <div class="col-7 col-lg-4 p-5 m-5 h-auto align-self-center border 44 class="icon-30"
45 border-primary rounded reduce-card-2"> 45 src="assets/img/ir.svg">
46 <img 46 </div>
47 draggable="false" 47 </div>
48 ondragstart="return false;" 48 <div class="col-7 col-lg-4 p-5 m-5 h-auto align-self-center border
49 (contextmenu)="false" 49 border-primary rounded reduce-card-2">
50 class="img-in-top px-4 bg-white" 50 <img
51 src="assets/img/icono-efectivo.svg"> 51 draggable="false"
52 <p class="h6 m-0">SI PREFERIS PAGAR EN EFECTIVO</p> 52 ondragstart="return false;"
53 <p class="h2 m-0 text-primary">te esperamos en la caja</p> 53 (contextmenu)="false"
54 </div> 54 class="img-in-top px-4 bg-white"
55 </div> 55 src="assets/img/icono-efectivo.svg">
56 </div> 56 <p class="h6 m-0">SI PREFERIS PAGAR EN EFECTIVO</p>
57 </div> 57 <p class="h2 m-0 text-primary">te esperamos en la caja</p>
58 58 </div>
59 </div>
60 </div>
61 </div>
62
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-50 h-md-70" id="content"> 15 <div class="row w-100 mr-4 h-50 h-md-70" id="content">
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 cat-btn"> 22 <div class="col-auto btn-effect h-5 cat-btn">
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 36 class="col-12 px-0 box-categorias border border-primary
37 border-left-0 rounded-right scroll-y cat-box" 37 border-left-0 rounded-right scroll-y cat-box"
38 (scroll)="scrollEvent($event)"> 38 (scroll)="scrollEvent($event)">
39 <div 39 <div
40 class="row mx-4 mb-2 h-25 h-md-32 h-lg-45 justify-content-center tab cat-content" 40 class="row mx-4 mb-2 h-25 h-md-32 h-lg-45 justify-content-center tab cat-content"
41 [ngClass]="{ 'active': allActive, 'border-bottom-effect': !allActive, 41 [ngClass]="{ 'active': allActive, 'border-bottom-effect': !allActive,
42 'media-pantalla' : boxCarrito.classList.contains('media-pantalla') }" 42 'media-pantalla' : boxCarrito.classList.contains('media-pantalla') }"
43 (click)="selectCategoria(-1, 0)"> 43 (click)="selectCategoria(-1, 0)">
44 <img 44 <img
45 draggable="false" 45 draggable="false"
46 ondragstart="return false;" 46 ondragstart="return false;"
47 (contextmenu)="false" 47 (contextmenu)="false"
48 class="col-12 h-50 align-self-end d-none d-sm-block rounded-circle" 48 class="col-12 h-50 align-self-end d-none d-sm-block rounded-circle"
49 src="assets/img/logo-spot.svg"> 49 src="assets/img/logo-spot.svg">
50 <small class="col-12 px-0 my-1 h-100 h-md-25 align-self-end text-center text-truncate">Todos</small> 50 <small class="col-12 px-0 my-1 h-100 h-md-25 align-self-end text-center text-truncate">Todos</small>
51 </div> 51 </div>
52 <div 52 <div
53 class="row mx-4 mb-2 h-25 h-md-32 h-lg-45 justify-content-center tab cat-content" 53 class="row mx-4 mb-2 h-25 h-md-32 h-lg-45 justify-content-center tab cat-content"
54 [ngClass]="{ 'active': categoria.selected, 'border-bottom-effect': !categoria.selected, 54 [ngClass]="{ 'active': categoria.selected, 'border-bottom-effect': !categoria.selected,
55 'media-pantalla' : boxCarrito.classList.contains('media-pantalla') }" 55 'media-pantalla' : boxCarrito.classList.contains('media-pantalla') }"
56 (click)="selectCategoria(i, categoria.id)" 56 (click)="selectCategoria(i, categoria.id)"
57 *ngFor="let categoria of categorias; let i = index;"> 57 *ngFor="let categoria of categorias; let i = index;">
58 <img 58 <img
59 draggable="false" 59 draggable="false"
60 ondragstart="return false;" 60 ondragstart="return false;"
61 (contextmenu)="false" 61 (contextmenu)="false"
62 class="col-12 h-50 align-self-end d-none d-sm-block rounded-circle img-categoria" 62 class="col-12 h-50 align-self-end d-none d-sm-block rounded-circle img-categoria"
63 [ngClass]="{'media-pantalla' : boxCarrito.classList.contains('media-pantalla')}" 63 [ngClass]="{'media-pantalla' : boxCarrito.classList.contains('media-pantalla')}"
64 src="{{urlImagenes}}{{categoria.path_imagen}}" 64 src="{{urlImagenes}}{{categoria.path_imagen}}"
65 onerror="this.src='assets/img/image-not-found.jpg'"> 65 onerror="this.src='assets/img/image-not-found.jpg'">
66 <small class="col-12 px-0 my-1 h-100 h-md-25 align-self-end text-center text-truncate">{{categoria.detalle}}</small> 66 <small class="col-12 px-0 my-1 h-100 h-md-25 align-self-end text-center text-truncate">{{categoria.detalle}}</small>
67 </div> 67 </div>
68 </div> 68 </div>
69 <div class="col-auto btn-effect h-5 cat-btn"> 69 <div class="col-auto btn-effect h-5 cat-btn">
70 <img 70 <img
71 draggable="false" 71 draggable="false"
72 ondragstart="return false;" 72 ondragstart="return false;"
73 (contextmenu)="false" 73 (contextmenu)="false"
74 class="h-100 d-block mx-auto rotate-90" 74 class="h-100 d-block mx-auto rotate-90"
75 src="assets/img/ir-color.svg" 75 src="assets/img/ir-color.svg"
76 (mousedown)="scrollY(templateCategorias, 100)" 76 (mousedown)="scrollY(templateCategorias, 100)"
77 (mouseup)="mouseup()" 77 (mouseup)="mouseup()"
78 (mouseleave)="mouseup()"> 78 (mouseleave)="mouseup()">
79 </div> 79 </div>
80 </div> 80 </div>
81 </div> 81 </div>
82 <!-- LISTA DE ARTICULOS --> 82 <!-- LISTA DE ARTICULOS -->
83 <div 83 <div
84 class="col-7 col-sm-9 col-xl-10 pb-3 h-100 align-self-center scroll-y-visible" 84 class="col-7 col-sm-9 col-xl-10 pb-3 h-100 align-self-center scroll-y-visible"
85 (scroll)="scrollEvent($event)"> 85 (scroll)="scrollEvent($event)">
86 <div class="row row-cols-1 row-cols-sm-3 row-cols-xl-6"> 86 <div class="row row-cols-1 row-cols-sm-3 row-cols-xl-6">
87 <!-- ARTICULO --> 87 <!-- ARTICULO -->
88 <div
89 class="col px-2 my-1 my-md-3 h-auto"
88 <div 90 *ngFor="let articulo of auxArticulos | slice:0:showQuantity;">
89 class="col px-2 my-1 my-md-3 h-auto" 91 <div
90 *ngFor="let articulo of auxArticulos | slice:0:showQuantity;"> 92 class="swing-in-top-fwd btn-effect card h-auto"
91 <div class="swing-in-top-fwd card h-auto"> 93 (click)="elegirArticulo(articulo)">
92 <img 94 <img
93 draggable="false" 95 draggable="false"
94 ondragstart="return false;" 96 ondragstart="return false;"
95 (contextmenu)="false" 97 (contextmenu)="false"
96 src="{{urlImagenes}}{{articulo.imagenes[0].imagen}}" 98 src="{{urlImagenes}}{{articulo.imagenes[0].imagen}}"
97 onerror="this.src='assets/img/image-not-found.jpg'" 99 onerror="this.src='assets/img/image-not-found.jpg'"
98 class="card-img-top h-30 h-md-55 rounded-sm"> 100 class="card-img-top h-30 h-md-55 rounded-sm">
99 <div class="row mx-0 py-1 h-auto justify-content-center"> 101 <div class="row mx-0 py-1 h-auto justify-content-center">
100 <p 102 <p
101 [ngClass]="{'text-primary': articulo.PRO, 'text-secondary': !articulo.PRO}" 103 [ngClass]="{'text-primary': articulo.PRO, 'text-secondary': !articulo.PRO}"
102 class="col-12 px-1 h6 h-auto text-center min-h-60"> 104 class="col-12 px-1 h6 h-auto text-center min-h-60">
103 {{articulo.DetArt}} 105 {{articulo.DetArt}}
104 </p> 106 </p>
105 <p class="col-12 px-1 h-auto text-center line-height-sm min-h-50"> 107 <p class="col-12 px-1 h-auto text-center line-height-sm min-h-50">
106 <small>{{articulo.DET_LAR}}</small> 108 <small>{{articulo.DET_LAR}}</small>
107 </p> 109 </p>
108 <div class="col-12 px-1 align-self-end btn-effect h-auto">
109 <div 110 <div class="col-12 px-1 align-self-end h-auto">
110 [ngClass]="{'bg-primary': articulo.PRO, 'bg-secondary': !articulo.PRO}" 111 <div
111 class="row mx-0 justify-content-between badge-pill" 112 [ngClass]="{'bg-primary': articulo.PRO, 'bg-secondary': !articulo.PRO}"
112 (click)="elegirArticulo(articulo)"> 113 class="row mx-0 justify-content-between badge-pill">
113 <div class="col px-0 align-self-center text-white text-right"> 114 <div class="col px-0 align-self-center text-white text-right">
114 {{articulo.PreVen | currency}} 115 {{articulo.PreVen | currency}}
115 </div> 116 </div>
116 <div class="col-5 px-0"> 117 <div class="col-5 px-0">
117 <img 118 <img
118 draggable="false" 119 draggable="false"
119 ondragstart="return false;" 120 ondragstart="return false;"
120 (contextmenu)="false" 121 (contextmenu)="false"
121 class="d-block ml-auto py-1 icon-30" 122 class="d-block ml-auto py-1 icon-30"
122 src="assets/img/ir.svg"> 123 src="assets/img/ir.svg">
123 </div> 124 </div>
124 </div> 125 </div>
125 </div> 126 </div>
126 </div> 127 </div>
127 </div> 128 </div>
128 </div> 129 </div>
129 </div> 130 </div>
130 <!-- BOTON VER MAS --> 131 <!-- BOTON VER MAS -->
131 <div class="row mx-0"> 132 <div class="row mx-0">
132 <div 133 <div
133 *ngIf="showQuantity <= auxArticulos.slice(0, showQuantity).length" 134 *ngIf="showQuantity <= auxArticulos.slice(0, showQuantity).length"
134 class="col-12 px-0 mb-2"> 135 class="col-12 px-0 mb-2">
135 <button 136 <button
136 (click)="increaseShow()" 137 (click)="increaseShow()"
137 class="btn btn-block btn-outline-primary"> 138 class="btn btn-block btn-outline-primary">
138 Ver Más 139 Ver Más
139 </button> 140 </button>
140 </div> 141 </div>
141 </div> 142 </div>
142 </div> 143 </div>
143 </div> 144 </div>
144 </div> 145 </div>
145 </div> 146 </div>
146 <!-- FOOTER CARRITO DE COMPRAS --> 147 <!-- FOOTER CARRITO DE COMPRAS -->
147 <div class="row w-90 mx-auto h-auto justify-content-center"> 148 <div class="row w-90 mx-auto h-auto justify-content-center">
148 <div class="h-75 px-0 border border-primary rounded" #boxCarrito 149 <div class="h-75 px-0 border border-primary rounded" #boxCarrito
149 [ngClass]="boxCarrito.classList.contains('media-pantalla') 150 [ngClass]="boxCarrito.classList.contains('media-pantalla')
150 ? 'col-8' : 'col-12'" id="boxCarrito"> 151 ? 'col-8' : 'col-12'" id="boxCarrito">
151 <!-- CABECERA --> 152 <!-- CABECERA -->
152 <div class="row mx-0 h-15 border-bottom border-primary"> 153 <div class="row mx-0 h-15 border-bottom border-primary">
153 <p class="col align-self-center text-truncate"><small>ARTÍCULOS EN TÚ CARRITO DE COMPRAS</small></p> 154 <p class="col align-self-center text-truncate"><small>ARTÍCULOS EN TÚ CARRITO DE COMPRAS</small></p>
154 </div> 155 </div>
155 <!-- CUERPO --> 156 <!-- CUERPO -->
156 <div class="row h-85 mx-0 justify-content-around"> 157 <div class="row h-85 mx-0 justify-content-around">
157 <!-- BOTON SCROLL IZQUIERDA --> 158 <!-- BOTON SCROLL IZQUIERDA -->
158 <div *ngIf="articuloService.carrito.length" class="col-auto btn-effect h-20 align-self-center"> 159 <div *ngIf="articuloService.carrito.length" class="col-auto btn-effect h-20 align-self-center">
159 <img 160 <img
160 draggable="false" 161 draggable="false"
161 ondragstart="return false;" 162 ondragstart="return false;"
162 (contextmenu)="false" 163 (contextmenu)="false"
163 class="icon-30 rotate-180-neg" 164 class="icon-30 rotate-180-neg"
164 src="assets/img/ir-fondo-color.svg" 165 src="assets/img/ir-fondo-color.svg"
165 (mousedown)="scrollX(templateCarrito, -100)" 166 (mousedown)="scrollX(templateCarrito, -100)"
166 (mouseup)="mouseup()" 167 (mouseup)="mouseup()"
167 (mouseleave)="mouseup()"> 168 (mouseleave)="mouseup()">
168 </div> 169 </div>
169 <!-- CARRITO --> 170 <!-- CARRITO -->
170 <div class="col-6 col-sm-8 col-md-9 col-lg-10 h-100"> 171 <div class="col-6 col-sm-8 col-md-9 col-lg-10 h-100">
171 <div 172 <div
172 #templateCarrito 173 #templateCarrito
173 class="row flex-row flex-nowrap h-100 mx-0 my-2 scroll-x" 174 class="row flex-row flex-nowrap h-100 mx-0 my-2 scroll-x"
174 (scroll)="scrollEvent($event)"> 175 (scroll)="scrollEvent($event)">
175 <!-- MENSAJE DE ADVERTENCIA --> 176 <!-- MENSAJE DE ADVERTENCIA -->
176 <div *ngIf="!articuloService.carrito.length" class="col h-100"> 177 <div *ngIf="!articuloService.carrito.length" class="col h-100">
177 <p class="text-center py-5">No hay articulos en el carrito</p> 178 <p class="text-center py-5">No hay articulos en el carrito</p>
178 </div> 179 </div>
180 <!-- ARTICULOS -->
181 <div
182 class="col-10 col-sm-4 col-lg-2 px-2 px-xl-4 align-self-center border-right border-primary"
183 *ngFor="let articulo of articuloService.carrito; let i = index;">
179 <!-- ARTICULOS --> 184 <div class="swing-in-top-fwd">
180 <div 185 <img
181 class="col-10 col-sm-4 col-lg-2 px-2 px-xl-4 align-self-center border-right border-primary" 186 class="btn-effect icon-20 position-absolute right-0"
182 *ngFor="let articulo of articuloService.carrito; let i = index;"> 187 src="assets/img/icono-cancelar-color.svg"
183 <div class="swing-in-top-fwd"> 188 (click)="deleteArticulo(i)">
184 <img 189 <img
185 draggable="false" 190 draggable="false"
186 ondragstart="return false;" 191 ondragstart="return false;"
187 (contextmenu)="false" 192 (contextmenu)="false"
188 class="d-block img-fluid p-2 mx-auto rounded" 193 class="d-block img-fluid p-2 mx-auto rounded"
189 src="{{urlImagenes}}{{articulo.imagenes[0].imagen}}" 194 src="{{urlImagenes}}{{articulo.imagenes[0].imagen}}"
190 onerror="this.src='assets/img/image-not-found.jpg'"> 195 onerror="this.src='assets/img/image-not-found.jpg'">
191 <p class="d-block mt-auto text-center text-primary text-truncate"> 196 <p class="d-block mt-auto text-center text-primary text-truncate">
192 <small>{{articulo.DetArt}}</small> 197 <small>{{articulo.DetArt}}</small>
193 </p> 198 </p>
194 </div> 199 </div>
195 </div> 200 </div>
196 </div> 201 </div>
197 </div> 202 </div>
198 <!-- BOTON SCROLL DERECHA --> 203 <!-- BOTON SCROLL DERECHA -->
199 <div *ngIf="articuloService.carrito.length" class="col-auto btn-effect h-20 align-self-center"> 204 <div *ngIf="articuloService.carrito.length" class="col-auto btn-effect h-20 align-self-center">
200 <img 205 <img
201 draggable="false" 206 draggable="false"
202 ondragstart="return false;" 207 ondragstart="return false;"
203 (contextmenu)="false" 208 (contextmenu)="false"
204 class="icon-30" 209 class="icon-30"
205 src="assets/img/ir-fondo-color.svg" 210 src="assets/img/ir-fondo-color.svg"
206 (mousedown)="scrollX(templateCarrito, 100)" 211 (mousedown)="scrollX(templateCarrito, 100)"
207 (mouseup)="mouseup()" 212 (mouseup)="mouseup()"
208 (mouseleave)="mouseup()"> 213 (mouseleave)="mouseup()">
209 </div> 214 </div>
210 </div> 215 </div>
211 </div> 216 </div>
212 <!-- TOTAL--> 217 <!-- TOTAL-->
213 <div 218 <div
214 class="col-auto mt-2 ml-auto h-20"> 219 class="col-auto mt-2 ml-auto h-20">
215 <div class="row mx-0"> 220 <div class="row mx-0">
216 <div class="col-auto align-self-center text-primary">TOTAL</div> 221 <div class="col-auto align-self-center text-primary">TOTAL</div>
217 <div class="col-auto bg-primary badge-pill"> 222 <div class="col-auto bg-primary badge-pill">
218 <p class="text-center text-white mt-1 py-1">{{articuloService.subTotal | currency}}</p> 223 <p class="text-center text-white mt-1 py-1">{{articuloService.subTotal | currency}}</p>
219 </div> 224 </div>
220 </div> 225 </div>
221 </div> 226 </div>
222 227
223 <!-- VER CARRITO --> 228 <!-- VER CARRITO -->
224 <div 229 <div
225 class="col-auto px-0 mt-2 h-20"
226 *ngIf="articuloService.carrito.length" 230 class="col-auto px-0 mt-2 h-20"
227 [ngClass]="{'ml-auto pb-3' : boxCarrito.classList.contains('media-pantalla')}"> 231 *ngIf="articuloService.carrito.length"
228 <div 232 [ngClass]="{'ml-auto pb-3' : boxCarrito.classList.contains('media-pantalla')}">
229 class="btn-effect col-auto px-0 align-self-center bg-white" 233 <div
230 [routerLink]="['/carrito']"> 234 class="btn-effect col-auto px-0 align-self-center bg-white"
231 <div class="row mx-0 bg-light"> 235 [routerLink]="['/carrito']">
232 <div class="col-auto align-self-center text-primary d-none d-sm-block">VER CARRITO</div> 236 <div class="row mx-0 bg-light">
233 <div class="col-auto p-0 bg-primary"> 237 <div class="col-auto p-0 bg-primary">
238 <img
234 <img 239 draggable="false"
235 draggable="false" 240 ondragstart="return false;"
236 ondragstart="return false;" 241 (contextmenu)="false"
237 (contextmenu)="false" 242 class="p-2 icon-40"
238 class="p-2 icon-40" 243 src="assets/img/carrito.svg">
239 src="assets/img/carrito.svg"> 244 </div>
240 </div> 245 <div class="col-auto align-self-center text-primary d-none d-sm-block">IR AL CARRITO</div>
241 </div> 246 </div>
242 </div> 247 </div>
243 </div> 248 </div>
244 249
245 </div> 250 </div>
246 </div> 251 </div>
247 252
src/app/modules/seleccion-articulos/seleccion-articulos.component.ts
1 import { Component, OnInit, TemplateRef, OnDestroy, HostListener } from '@angular/core'; 1 import { Component, OnInit, TemplateRef, OnDestroy, HostListener } from '@angular/core';
2 import { BsModalRef, BsModalService } from 'ngx-bootstrap/modal'; 2 import { BsModalRef, BsModalService } from 'ngx-bootstrap/modal';
3 import { ArticuloService } from 'src/app/services/articulo/articulo.service'; 3 import { ArticuloService } from 'src/app/services/articulo/articulo.service';
4 import { IArticulo } from 'src/app/interfaces/IArticulo'; 4 import { IArticulo } from 'src/app/interfaces/IArticulo';
5 import { APP_SETTINGS } from 'src/etc/AppSettings'; 5 import { APP_SETTINGS } from 'src/etc/AppSettings';
6 import { ICategoria } from 'src/app/interfaces/ICategoria'; 6 import { ICategoria } from 'src/app/interfaces/ICategoria';
7 import { CategoriaService } from 'src/app/services/categoria/categoria.service'; 7 import { CategoriaService } from 'src/app/services/categoria/categoria.service';
8 import { PromocionService } from 'src/app/services/promocion/promocion.service'; 8 import { PromocionService } from 'src/app/services/promocion/promocion.service';
9 import { PromocionComponent } from 'src/app/shared/promocion/promocion.component'; 9 import { PromocionComponent } from 'src/app/shared/promocion/promocion.component';
10 import { InactiveScreenService } from 'src/app/services/inactive-screen/inactive-screen.service'; 10 import { InactiveScreenService } from 'src/app/services/inactive-screen/inactive-screen.service';
11 11
12 @Component({ 12 @Component({
13 selector: 'app-seleccion-articulos', 13 selector: 'app-seleccion-articulos',
14 templateUrl: './seleccion-articulos.component.html', 14 templateUrl: './seleccion-articulos.component.html',
15 styleUrls: ['./seleccion-articulos.component.scss'] 15 styleUrls: ['./seleccion-articulos.component.scss']
16 }) 16 })
17 export class SeleccionArticulosComponent implements OnInit, OnDestroy { 17 export class SeleccionArticulosComponent implements OnInit, OnDestroy {
18 showSpinner = true; 18 showSpinner = true;
19 timeoutHandler: any; 19 timeoutHandler: any;
20 urlImagenes = `${APP_SETTINGS.apiDeboSuite}/imagenes/`; 20 urlImagenes = `${APP_SETTINGS.apiDeboSuite}/imagenes/`;
21 articulos: IArticulo[] = []; 21 articulos: IArticulo[] = [];
22 auxArticulos: IArticulo[] = []; 22 auxArticulos: IArticulo[] = [];
23 showQuantity = 100; 23 showQuantity = 100;
24 queMostrar = 'todos'; 24 queMostrar = 'todos';
25 categoriaActive = null; 25 categoriaActive = null;
26 categorias: ICategoria[] = []; 26 categorias: ICategoria[] = [];
27 searchTerm = ''; 27 searchTerm = '';
28 ordenandoByVendidos = true; 28 ordenandoByVendidos = true;
29 allActive = true; 29 allActive = true;
30 modalRef: BsModalRef; 30 modalRef: BsModalRef;
31 total = 0; 31 total = 0;
32 32
33 constructor( 33 constructor(
34 public articuloService: ArticuloService, 34 public articuloService: ArticuloService,
35 private categoriaService: CategoriaService, 35 private categoriaService: CategoriaService,
36 private modalService: BsModalService, 36 private modalService: BsModalService,
37 private inactiveScreen: InactiveScreenService, 37 private inactiveScreen: InactiveScreenService,
38 ) { } 38 ) { }
39 39
40 ngOnInit() { 40 ngOnInit() {
41 this.getCategorias(); 41 this.getCategorias();
42 this.mediaPantalla(); 42 this.mediaPantalla();
43 } 43 }
44 44
45 ngOnDestroy() { 45 ngOnDestroy() {
46 if (this.modalRef) this.modalRef.hide(); 46 if (this.modalRef) this.modalRef.hide();
47 } 47 }
48 48
49 getCategorias() { 49 getCategorias() {
50 this.categoriaService.getAll() 50 this.categoriaService.getAll()
51 .subscribe((categorias: ICategoria[]) => { 51 .subscribe((categorias: ICategoria[]) => {
52 switch (this.queMostrar) { 52 switch (this.queMostrar) {
53 case 'todos': 53 case 'todos':
54 this.categorias = categorias; 54 this.categorias = categorias;
55 this.categoriaActive = 0; 55 this.categoriaActive = 0;
56 break; 56 break;
57 case 'promociones': 57 case 'promociones':
58 this.categorias = categorias; 58 this.categorias = categorias;
59 this.categoriaActive = 19; 59 this.categoriaActive = 19;
60 break; 60 break;
61 case 'ordenar': 61 case 'ordenar':
62 this.categorias = categorias.filter((categoria: ICategoria) => { 62 this.categorias = categorias.filter((categoria: ICategoria) => {
63 return categoria.ES_PEDIDO; 63 return categoria.ES_PEDIDO;
64 }); 64 });
65 this.categoriaActive = 4; 65 this.categoriaActive = 4;
66 break; 66 break;
67 default: 67 default:
68 this.categorias = categorias; 68 this.categorias = categorias;
69 this.categoriaActive = 0; 69 this.categoriaActive = 0;
70 break; 70 break;
71 } 71 }
72 !localStorage.getItem('articulos') ? 72 !localStorage.getItem('articulos') ?
73 this.getProductos() : 73 this.getProductos() :
74 this.setProductos(); 74 this.setProductos();
75 }); 75 });
76 } 76 }
77 77
78 getProductos() { 78 getProductos() {
79 this.articuloService.getAll() 79 this.articuloService.getAll()
80 .subscribe((result: IArticulo[]) => { 80 .subscribe((result: IArticulo[]) => {
81 this.articuloService.setArticulosSinImagen(result); 81 this.articuloService.setArticulosSinImagen(result);
82 if (this.queMostrar === 'ordenar') { 82 if (this.queMostrar === 'ordenar') {
83 this.categorias.forEach((categoria: ICategoria) => { 83 this.categorias.forEach((categoria: ICategoria) => {
84 const tempArticulos = result.filter((articulo: IArticulo) => { 84 const tempArticulos = result.filter((articulo: IArticulo) => {
85 return articulo.categoria_selfservice === categoria.id; 85 return articulo.categoria_selfservice === categoria.id;
86 }); 86 });
87 result = tempArticulos; 87 result = tempArticulos;
88 }); 88 });
89 } 89 }
90 localStorage.setItem('articulos', JSON.stringify(result)); 90 localStorage.setItem('articulos', JSON.stringify(result));
91 this.setProductos(); 91 this.setProductos();
92 }, (error) => { 92 }, (error) => {
93 this.showSpinner = false; 93 this.showSpinner = false;
94 console.error(error); 94 console.error(error);
95 }); 95 });
96 } 96 }
97 97
98 setProductos() { 98 setProductos() {
99 this.articulos = JSON.parse(localStorage.getItem('articulos')); 99 this.articulos = JSON.parse(localStorage.getItem('articulos'));
100 this.filterItems(); 100 this.filterItems();
101 } 101 }
102 102
103 filterItems() { 103 filterItems() {
104 if (this.categoriaActive === 0) { 104 if (this.categoriaActive === 0) {
105 this.auxArticulos = this.articulos; 105 this.auxArticulos = this.articulos;
106 return; 106 return;
107 } 107 }
108 this.auxArticulos = this.articulos.filter(x => { 108 this.auxArticulos = this.articulos.filter(x => {
109 return x.categoria_selfservice === this.categoriaActive; 109 return x.categoria_selfservice === this.categoriaActive;
110 }); 110 });
111 this.ordenar(); 111 this.ordenar();
112 } 112 }
113 113
114 ordenar() { 114 ordenar() {
115 if (this.ordenandoByVendidos) { 115 if (this.ordenandoByVendidos) {
116 this.auxArticulos.sort((a, b) => { 116 this.auxArticulos.sort((a, b) => {
117 return b.cantidadVendida - a.cantidadVendida; 117 return b.cantidadVendida - a.cantidadVendida;
118 }); 118 });
119 } 119 }
120 } 120 }
121 121
122 selectCategoria(index: number, idCategoria?: number) { 122 selectCategoria(index: number, idCategoria?: number) {
123 if (this.categoriaActive === idCategoria) return; 123 if (this.categoriaActive === idCategoria) return;
124 this.categoriaActive = idCategoria; 124 this.categoriaActive = idCategoria;
125 this.allActive = idCategoria === 0 ? true : false; 125 this.allActive = idCategoria === 0 ? true : false;
126 this.categorias.forEach((categoria, i) => { 126 this.categorias.forEach((categoria, i) => {
127 categoria.selected = index === i ? true : false; 127 categoria.selected = index === i ? true : false;
128 }); 128 });
129 this.filterItems(); 129 this.filterItems();
130 } 130 }
131 131
132 elegirArticulo(articulo: IArticulo) { 132 elegirArticulo(articulo: IArticulo) {
133 if (!articulo.FPP) { 133 if (!articulo.FPP) {
134 this.getByID(articulo.id); 134 this.getByID(articulo.id);
135 } else { 135 } else {
136 this.openModalPromos(articulo); 136 this.openModalPromos(articulo);
137 } 137 }
138 } 138 }
139 139
140 getByID(id: number) { 140 getByID(id: number) {
141 this.articuloService.getById(id) 141 this.articuloService.getById(id)
142 .subscribe((res: IArticulo) => { 142 .subscribe((res: IArticulo) => {
143 res.cantidad = 1; 143 res.cantidad = 1;
144 this.articuloService.setArticulo(res); 144 this.articuloService.setArticulo(res);
145 }, err => console.error(err)); 145 }, err => console.error(err));
146 } 146 }
147 147
148 openModalPromos(articulo: IArticulo) { 148 openModalPromos(articulo: IArticulo) {
149 this.modalRef = this.modalService.show(PromocionComponent, 149 this.modalRef = this.modalService.show(PromocionComponent,
150 { 150 {
151 initialState: { 151 initialState: {
152 idArticulo: articulo.id 152 idArticulo: articulo.id
153 }, 153 },
154 class: 'modal-promo modal-dialog-centered' 154 class: 'modal-promo modal-dialog-centered'
155 }); 155 });
156 } 156 }
157
158 deleteArticulo(index: number) {
159 this.articuloService.carrito.splice(index, 1);
160 this.articuloService.calcularTotal();
161 }
157 162
158 increaseShow() { 163 increaseShow() {
159 this.showQuantity += 100; 164 this.showQuantity += 100;
160 } 165 }
161 166
162 @HostListener("scroll", ['$event']) 167 @HostListener('scroll', ['$event'])
163 scrollEvent(event: Event) { 168 scrollEvent(event: Event) {
164 clearTimeout(this.inactiveScreen.timerReposo); 169 clearTimeout(this.inactiveScreen.timerReposo);
165 this.inactiveScreen.startTimeOutInactividad(); 170 this.inactiveScreen.startTimeOutInactividad();
166 } 171 }
167 172
168 mouseup() { 173 mouseup() {
169 if (!this.timeoutHandler) return; 174 if (!this.timeoutHandler) return;
170 clearInterval(this.timeoutHandler); 175 clearInterval(this.timeoutHandler);
171 } 176 }
172 177
173 scrollY(el: HTMLElement, value) { 178 scrollY(el: HTMLElement, value) {
174 el.scroll({ behavior: 'smooth', top: value + el.scrollTop }); 179 el.scroll({ behavior: 'smooth', top: value + el.scrollTop });
175 this.timeoutHandler = setInterval(() => { 180 this.timeoutHandler = setInterval(() => {
176 el.scroll({ behavior: 'smooth', top: value + el.scrollTop }); 181 el.scroll({ behavior: 'smooth', top: value + el.scrollTop });
177 }, 500); 182 }, 500);
178 } 183 }
179 184
180 scrollX(el: HTMLElement, value) { 185 scrollX(el: HTMLElement, value) {
181 el.scroll({ behavior: 'smooth', left: value + el.scrollLeft }); 186 el.scroll({ behavior: 'smooth', left: value + el.scrollLeft });
182 this.timeoutHandler = setInterval(() => { 187 this.timeoutHandler = setInterval(() => {
183 el.scroll({ behavior: 'smooth', left: value + el.scrollLeft }); 188 el.scroll({ behavior: 'smooth', left: value + el.scrollLeft });
184 }, 500); 189 }, 500);
185 } 190 }
186 191
187 mediaPantalla() { 192 mediaPantalla() {
188 if ($('body').hasClass('media-pantalla')) { 193 if ($('body').hasClass('media-pantalla')) {
189 $('.cat-content,#content,.cat-btn,#boxCarrito,.cat-box,.img-categoria').addClass('media-pantalla').addBack('media-pantalla'); 194 $('.cat-content,#content,.cat-btn,#boxCarrito,.cat-box,.img-categoria').addClass('media-pantalla').addBack('media-pantalla');
190 } 195 }
191 } 196 }
192 } 197 }
193 198
src/app/modules/seleccion-articulos/seleccion-articulos.module.ts
1 import { NgModule } from '@angular/core'; 1 import { NgModule } from '@angular/core';
2 import { CommonModule } from '@angular/common'; 2 import { CommonModule } from '@angular/common';
3 import { SeleccionArticulosRoutingModule } from './seleccion-articulos-routing.module'; 3 import { SeleccionArticulosRoutingModule } from './seleccion-articulos-routing.module';
4 import { SeleccionArticulosComponent } from './seleccion-articulos.component'; 4 import { SeleccionArticulosComponent } from './seleccion-articulos.component';
5 import { HeaderPublicidadComponent } from 'src/app/shared/header-publicidad/header-publicidad.component'; 5 import { HeaderPublicidadComponent } from 'src/app/shared/header-publicidad/header-publicidad.component';
6 import { ModalModule } from 'ngx-bootstrap/modal'; 6 import { ModalModule } from 'ngx-bootstrap/modal';
7 import { CarouselModule } from 'ngx-bootstrap/carousel'; 7 import { CarouselModule } from 'ngx-bootstrap/carousel';
8 import { PromocionComponent } from 'src/app/shared/promocion/promocion.component'; 8 import { PromocionComponent } from 'src/app/shared/promocion/promocion.component';
9 import { SharedModule } from '../shared/shared.module'; 9 import { SharedModule } from '../shared/shared.module';
10 import { ConfirmacionComponent } from 'src/app/shared/confirmacion/confirmacion.component';
10 11
11 @NgModule({ 12 @NgModule({
12 declarations: [ 13 declarations: [
13 SeleccionArticulosComponent, 14 SeleccionArticulosComponent,
14 HeaderPublicidadComponent, 15 HeaderPublicidadComponent,
15 PromocionComponent 16 PromocionComponent,
17 ConfirmacionComponent
16 ], 18 ],
17 imports: [ 19 imports: [
18 CommonModule, 20 CommonModule,
19 SeleccionArticulosRoutingModule, 21 SeleccionArticulosRoutingModule,
20 ModalModule.forRoot(), 22 ModalModule.forRoot(),
21 CarouselModule.forRoot(), 23 CarouselModule.forRoot(),
22 SharedModule 24 SharedModule
23 ], 25 ],
24 exports: [HeaderPublicidadComponent], 26 exports: [HeaderPublicidadComponent],
25 entryComponents: [PromocionComponent] 27 entryComponents: [PromocionComponent, ConfirmacionComponent]
26 }) 28 })
27 export class SeleccionArticulosModule { } 29 export class SeleccionArticulosModule { }
28 30
src/app/modules/splash-screen/splash-screen.component.html
1 <div *ngIf="showSplashScreen" class="h-100 bg-splash"> 1 <div *ngIf="showSplashScreen" class="h-100 bg-splash">
2 <div class="row mx-0 h-100"> 2 <div
3 class="row mx-0 h-100"
4 [routerLink]="['/info-formas-pago']">
3 <div class="col-12 px-0 h-30 my-auto"> 5 <div class="col-12 px-0 h-30 my-auto">
4 <img 6 <img
5 draggable="false" 7 draggable="false"
6 ondragstart="return false;" 8 ondragstart="return false;"
7 (contextmenu)="false" 9 (contextmenu)="false"
8 class="d-block mx-auto h-100 focus-in-blur" 10 class="d-block mx-auto h-100 focus-in-blur"
9 src="assets/img/logo-spot.svg"> 11 src="assets/img/logo-spot.svg">
10 </div> 12 </div>
11 </div> 13 </div>
12 </div> 14 </div>
13 15
14 <div *ngIf="!showSplashScreen" class="h-100 bg-primary fade-in"> 16 <div *ngIf="!showSplashScreen" class="h-100 bg-primary fade-in">
15 <div class="row mx-0 h-100"> 17 <div
18 class="row mx-0 h-100"
19 [routerLink]="['/info-formas-pago']">
16 <div class="col-12 px-0 h-100 my-auto"> 20 <div class="col-12 px-0 h-100 my-auto">
17 <div class="row mx-0 h-15"> 21 <div class="row mx-0 h-15">
18 <div class="col-12 px-0 h-80 my-auto"> 22 <div class="col-12 px-0 h-80 my-auto">
19 <img 23 <img
20 draggable="false" 24 draggable="false"
21 ondragstart="return false;" 25 ondragstart="return false;"
22 (contextmenu)="false" 26 (contextmenu)="false"
23 class="d-block mx-auto h-100" 27 class="d-block mx-auto h-100"
24 src="assets/img/negativo-spot.svg"> 28 src="assets/img/negativo-spot.svg">
25 </div> 29 </div>
26 </div> 30 </div>
27 <div class="row mx-0 h-75 justify-content-center text-white text-center"> 31 <div class="row mx-0 h-75 justify-content-center text-white text-center">
28 <div class="col-7 h-auto px-0 py-5 mb-5 align-self-end box"> 32 <div class="col-7 h-auto px-0 py-5 mb-5 align-self-end box">
29 <div class="h6 m-0 welcome-text text-info"> 33 <div class="h6 m-0 welcome-text text-info">
30 <span *ngFor="let letter of textWelcome | split textWelcome">{{letter}}</span> 34 <span *ngFor="let letter of textWelcome | split textWelcome">{{letter}}</span>
31 </div> 35 </div>
32 <div class="h1 m-0 como-estas-text"> 36 <div class="h1 m-0 como-estas-text">
33 <span *ngFor="let letter of textComoEstas | split textComoEstas">{{letter}}</span> 37 <span *ngFor="let letter of textComoEstas | split textComoEstas">{{letter}}</span>
34 </div> 38 </div>
35 </div> 39 </div>
36 <div class="col-7 h-auto px-0 py-5 mt-5 align-self-start box2"> 40 <div class="col-7 h-auto px-0 py-5 mt-5 align-self-start box2">
37 <div class="h6 m-0 invitamos-text text-info"> 41 <div class="h6 m-0 invitamos-text text-info">
38 <span *ngFor="let letter of textInvitamos | split textInvitamos">{{letter}}</span> 42 <span *ngFor="let letter of textInvitamos | split textInvitamos">{{letter}}</span>
39 </div> 43 </div>
40 <div class="h1 m-0 tu-pedido-text"> 44 <div class="h1 m-0 tu-pedido-text">
41 <span *ngFor="let letter of textTuPedido | split textTuPedido">{{letter}}</span> 45 <span *ngFor="let letter of textTuPedido | split textTuPedido">{{letter}}</span>
42 </div> 46 </div>
43 </div> 47 </div>
44 </div> 48 </div>
45 <div 49 <div class="row mx-0 h-10 loop-color cursor-pointer">
46 class="row mx-0 h-10 loop-color cursor-pointer"
47 [routerLink]="['/info-formas-pago']">
48 <div class="col-12 text-center align-self-center px-0"> 50 <div class="col-12 text-center align-self-center px-0">
49 <p class="h6 text-white">TOCA PARA COMENZAR</p> 51 <p class="h6 text-white">TOCA PARA COMENZAR</p>
50 </div> 52 </div>
51 </div> 53 </div>
52 </div> 54 </div>
53 </div> 55 </div>
src/app/shared/confirmacion/confirmacion.component.html
File was created 1 <div class="modal-header bg-primary rounded-top pt-4 px-2">
2 <div class="row mx-0 w-100 justify-content-between">
3 <div class="col-8">
4 <p *ngIf="titleMessage" class="h3 text-white">{{titleMessage}}</p>
5 </div>
6 </div>
7 <div *ngIf="imagenPath" class="col-4 align-self-center">
8 <img
9 draggable="false"
10 ondragstart="return false;"
11 (contextmenu)="false"
12 src="{{urlImagenes}}{{imagenPath}}"
13 onerror="this.src='assets/img/image-not-found.jpg'"
14 class="card-img-top img-fluid rounded-circle">
15 </div>
16 </div>
17 <div class=" col-12 modal-body bg-primary rounded-bottom pb-3 px-2">
18 <div class="row justify-content-between mx-0 w-100">
19 <div class="col-8">
20 <p *ngIf="footerMessageFirst" class="text-white"><small>{{footerMessageFirst}}</small></p >
21 <h1 *ngIf="footerMessageSecond" class="text-white mb-4">{{footerMessageSecond}}</h1>
22 </div>
23 <div class="col-4">
24 <div
25 class="mx-0"
26 (click)="confirmarArticulo()">
27 <div class="col-auto bg-white badge-pill">
28 <div class="row justify-content-between">
29 <div *ngIf="footerConfirmation" class="col-auto px-0 align-self-center text-primary pl-3">
30 <p class="font-weight-bold">{{footerConfirmation | currency}}</p>
31 </div>
32 <div class="col-auto px-0">
33 <img
34 draggable="false"
35 ondragstart="return false;"
36 (contextmenu)="false"
37 class="d-block ml-auto my-1 icon-30 pr-2"
38 src="assets/img/ir-color.svg">
39 </div>
40 </div>
41 </div>
42 </div>
43 <div *ngIf="footerClose" class="bg-white badge-pill mt-2">
44 <div class="row justify-content-between">
45 <div
46 class="col-auto mx-0 "
47 (click)="close()">
48 <p class="font-weight-bold text-center text-primary">{{footerClose}}</p>
49 </div>
50 <i class="fas fa-undo-alt text-info mr-3 my-auto"></i>
51 </div>
52 </div>
53 </div>
54 </div>
55 </div>
56
src/app/shared/confirmacion/confirmacion.component.scss
src/app/shared/confirmacion/confirmacion.component.spec.ts
File was created 1 import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2
3 import { ConfirmacionComponent } from './confirmacion.component';
4
5 describe('ConfirmacionComponent', () => {
6 let component: ConfirmacionComponent;
7 let fixture: ComponentFixture<ConfirmacionComponent>;
8
9 beforeEach(async(() => {
10 TestBed.configureTestingModule({
11 declarations: [ ConfirmacionComponent ]
12 })
13 .compileComponents();
14 }));
15
16 beforeEach(() => {
17 fixture = TestBed.createComponent(ConfirmacionComponent);
18 component = fixture.componentInstance;
19 fixture.detectChanges();
20 });
21
22 it('should create', () => {
23 expect(component).toBeTruthy();
24 });
25 });
26
src/app/shared/confirmacion/confirmacion.component.ts
File was created 1 import { Component, OnInit, HostListener } from '@angular/core';
2 import { ArticuloService } from 'src/app/services/articulo/articulo.service';
3 import { IArticulo } from 'src/app/interfaces/IArticulo';
4 import { BsModalRef } from 'ngx-bootstrap/modal';
5 import { InactiveScreenService } from 'src/app/services/inactive-screen/inactive-screen.service';
6 import { Subject } from 'rxjs';
7
8 @Component({
9 selector: 'app-confirmacion',
10 templateUrl: './confirmacion.component.html',
11 styleUrls: ['./confirmacion.component.scss']
12 })
13 export class ConfirmacionComponent implements OnInit {
14 idArticulo: number;
15 imagenArticulo: any;
16 detLarArticulo: string;
17 preVenArticulo: any;
18 onClose: Subject<any>;
19
20 constructor(
21 public modalRef: BsModalRef,
22 private inactiveScreen: InactiveScreenService,
23 ) {
24 this.onClose = new Subject();
25 }
26
27 ngOnInit() {
28 }
29
30 confirmarArticulo() {
31 this.onClose.next();
32 this.modalRef.hide();
33 }
34
35 close() {
36 this.modalRef.hide();
37 }
38
39 @HostListener('document:click', ['$event'])
40 eventListener(event: Event) {
41 clearTimeout(this.inactiveScreen.timerReposo);
42 this.inactiveScreen.startTimeOutInactividad();
43 }
44 }
45
src/app/shared/header-publicidad/header-publicidad.component.ts
1 import { Component, OnInit } from '@angular/core'; 1 import { Component, OnInit, TemplateRef } from '@angular/core';
2 import { APP_SETTINGS } from 'src/etc/AppSettings'; 2 import { APP_SETTINGS } from 'src/etc/AppSettings';
3 import { IPublicidad } from 'src/app/interfaces/IPublicidad'; 3 import { IPublicidad } from 'src/app/interfaces/IPublicidad';
4 import { PublicidadService } from 'src/app/services/publicidad/publicidad.service'; 4 import { PublicidadService } from 'src/app/services/publicidad/publicidad.service';
5 import { IArticulo } from 'src/app/interfaces/IArticulo'; 5 import { IArticulo } from 'src/app/interfaces/IArticulo';
6 import { PromocionComponent } from '../promocion/promocion.component'; 6 import { PromocionComponent } from '../promocion/promocion.component';
7 import { BsModalService, BsModalRef } from 'ngx-bootstrap/modal'; 7 import { BsModalService, BsModalRef } from 'ngx-bootstrap/modal';
8 import { ArticuloService } from 'src/app/services/articulo/articulo.service'; 8 import { ArticuloService } from 'src/app/services/articulo/articulo.service';
9 import { ConfirmacionComponent } from '../confirmacion/confirmacion.component';
9 10
10 @Component({ 11 @Component({
11 selector: 'app-header-publicidad', 12 selector: 'app-header-publicidad',
12 templateUrl: './header-publicidad.component.html', 13 templateUrl: './header-publicidad.component.html',
13 styleUrls: ['./header-publicidad.component.scss'] 14 styleUrls: ['./header-publicidad.component.scss']
14 }) 15 })
15 export class HeaderPublicidadComponent implements OnInit { 16 export class HeaderPublicidadComponent implements OnInit {
16 urlImagenes = `${APP_SETTINGS.apiDeboSuite}/imagenes/`; 17 urlImagenes = `${APP_SETTINGS.apiDeboSuite}/imagenes/`;
17 publicidades: IPublicidad[] = []; 18 publicidades: IPublicidad[] = [];
18 modalRef: BsModalRef; 19 modalRef: BsModalRef;
19 20
20 constructor( 21 constructor(
21 private publicidadService: PublicidadService, 22 private publicidadService: PublicidadService,
22 private articuloService: ArticuloService, 23 private articuloService: ArticuloService,
23 private modalService: BsModalService, 24 private modalService: BsModalService,
24 ) { } 25 ) { }
25 26
26 ngOnInit() { 27 ngOnInit() {
27 this.getPublicidades(); 28 this.getPublicidades();
28 this.mediaPantalla(); 29 this.mediaPantalla();
29 } 30 }
30 31
31 getPublicidades() { 32 getPublicidades() {
32 this.publicidadService.getAll() 33 this.publicidadService.getAll()
33 .subscribe((res: IPublicidad[]) => { 34 .subscribe((res: IPublicidad[]) => {
34 this.publicidades = res; 35 this.publicidades = res;
35 }, err => console.error(err)); 36 }, err => console.error(err));
36 } 37 }
37 38
38 elegirArticulo(publicidad: IPublicidad) { 39 elegirArticulo(publicidad: IPublicidad) {
39 if (publicidad.id_articulo) this.getByID(publicidad.id_articulo); 40 if (publicidad.id_articulo) this.getByID(publicidad.id_articulo);
40 } 41 }
41 42
42 getByID(id: number) { 43 getByID(id: number) {
43 this.articuloService.getById(id) 44 this.articuloService.getById(id)
44 .subscribe((res: IArticulo) => { 45 .subscribe((res: IArticulo) => {
45 if (res.FPP) { 46 if (res.FPP) {
46 this.openModalPromos(res); 47 this.openModalPromos(res);
48 return;
49 } else {
50 this.openModalConfirmacion(res);
47 return; 51 return;
48 }
49 res.cantidad = 1;
50 this.articuloService.setArticulo(res); 52 }
51 }, err => console.error(err)); 53 }, err => console.error(err));
52 } 54 }
53 55
54 openModalPromos(articulo: IArticulo) { 56 openModalPromos(articulo: IArticulo) {
55 this.modalRef = this.modalService.show(PromocionComponent, 57 this.modalRef = this.modalService.show(PromocionComponent,
56 { 58 {
57 initialState: { 59 initialState: {
58 idArticulo: articulo.id 60 idArticulo: articulo.id
59 }, 61 },
60 class: 'modal-promo modal-dialog-centered' 62 class: 'modal-promo modal-dialog-centered'
61 }); 63 });
62 } 64 }
65
66 openModalConfirmacion(articulo: IArticulo) {
67 this.modalRef = this.modalService.show(ConfirmacionComponent,
68 {
69 initialState: {
70 titleMessage: articulo.DET_LAR,
71 imagenPath: articulo.imagenes,
72 footerMessageFirst: `¿DESEA AGREGAR ESTE ARTÍCULO`,
73 footerMessageSecond: `a su carrito?`,
74 footerConfirmation: articulo.PreVen,
75 footerClose: `volver`
76 },
77 class: 'modal-promo modal-dialog-centered'
78 });
79 this.modalRef.content.onClose.subscribe(() => {
80 articulo.cantidad = 1;
81 this.articuloService.setArticulo(articulo);
82 });
83 }
63 84
64 mediaPantalla() { 85 mediaPantalla() {
65 if ($('body').hasClass('media-pantalla')) { 86 if ($('body').hasClass('media-pantalla')) {
66 $('#headerPublicidad,#headerPad').addClass('media-pantalla'); 87 $('#headerPublicidad,#headerPad').addClass('media-pantalla');
67 } 88 }
68 } 89 }
1 @import "scss/styles-bootstrap.scss"; 1 @import "scss/styles-bootstrap.scss";
2 @import "scss/typography.scss"; 2 @import "scss/typography.scss";
3 @import "scss/height-width.scss"; 3 @import "scss/height-width.scss";
4 @import "scss/animations.scss"; 4 @import "scss/animations.scss";
5 @import "scss/icons.scss"; 5 @import "scss/icons.scss";
6 @import "scss/scroll.scss"; 6 @import "scss/scroll.scss";
7 @import "node_modules/bootstrap/scss/_variables.scss"; 7 @import "node_modules/bootstrap/scss/_variables.scss";
8 8
9 @font-face { 9 @font-face {
10 font-family: "Gotham"; 10 font-family: "Gotham";
11 font-style: normal; 11 font-style: normal;
12 font-weight: normal; 12 font-weight: normal;
13 src: url("assets/fonts/gotham-medium.woff") format("woff"); 13 src: url("assets/fonts/gotham-medium.woff") format("woff");
14 } 14 }
15 15
16 html, 16 html,
17 body { 17 body {
18 max-height: 100vh; 18 max-height: 100vh;
19 height: 100%; 19 height: 100%;
20 font-family: "Gotham"; 20 font-family: "Gotham";
21 overflow: hidden; 21 overflow: hidden;
22 user-select: none; 22 user-select: none;
23 } 23 }
24 24
25 .btn-effect { 25 .btn-effect {
26 transition: all 0.3s; 26 transition: all 0.3s !important;
27 &:hover { 27 &:hover {
28 cursor: pointer; 28 cursor: pointer !important;
29 opacity: 0.7; 29 opacity: 0.7 !important;
30 } 30 }
31 &:active { 31 &:active {
32 transform: scale(1.02); 32 transform: scale(1.02) !important;
33 } 33 }
34 } 34 }
35 35
36 .cursor-pointer { 36 .cursor-pointer {
37 cursor: pointer; 37 cursor: pointer;
38 } 38 }
39 39
40 p { 40 p {
41 margin: 0 !important; 41 margin: 0 !important;
42 } 42 }
43 43
44 .img-in-top { 44 .img-in-top {
45 position: absolute; 45 position: absolute;
46 top: -35px; 46 top: -35px;
47 left: 50%; 47 left: 50%;
48 height: 70px; 48 height: 70px;
49 -webkit-transform: translateX(-50%); 49 -webkit-transform: translateX(-50%);
50 transform: translateX(-50%); 50 transform: translateX(-50%);
51 } 51 }
52 52
53 .right-0 {
54 right: 0;
55 }
56
57 .left-0 {
58 left: 0;
59 }
60
53 .rotate-45 { 61 .rotate-45 {
54 transform: rotate(45deg); 62 transform: rotate(45deg);
55 } 63 }
56 64
57 .rotate-90 { 65 .rotate-90 {
58 transform: rotate(90deg); 66 transform: rotate(90deg);
59 } 67 }
60 68
61 .rotate-90-neg { 69 .rotate-90-neg {
62 transform: rotate(-90deg); 70 transform: rotate(-90deg);
63 } 71 }
64 72
65 .rotate-180-neg { 73 .rotate-180-neg {
66 transform: rotate(-180deg); 74 transform: rotate(-180deg);
67 } 75 }
68 76
69 body.media-pantalla { 77 body.media-pantalla {
70 height: 50% !important; 78 height: 50% !important;
71 position: absolute; 79 position: absolute;
72 bottom: 0; 80 bottom: 0;
73 width: 100%; 81 width: 100%;
74 } 82 }
75 83
76 .modal-content.media-pantalla { 84 .modal-content.media-pantalla {
77 margin-top: auto !important; 85 margin-top: auto !important;
78 margin-bottom: 50px !important; 86 margin-bottom: 50px !important;
79 } 87 }
80 88