Commit 48813d5b6feedc53419e3d52f1a2dd3121de8de7
1 parent
c337433eaf
Exists in
develop
Add
Componente para cambiar la cantidad de un articulo
Showing
7 changed files
with
83 additions
and
55 deletions
 
Show diff stats
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 carrito-content"> | 5 | <div class="h-75 carrito-content"> | 
| 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 | 16 | <div | 
| 17 | class="row mx-2 mt-4 h-80 h-lg-60 align-content-start scroll-y-visible" | 17 | class="row mx-2 mt-4 h-80 h-lg-60 align-content-start scroll-y-visible" | 
| 18 | (scroll)="scrollEvent($event)"> | 18 | (scroll)="scrollEvent($event)"> | 
| 19 | <!-- MENSAJE DE ADVERTENCIA --> | 19 | <!-- MENSAJE DE ADVERTENCIA --> | 
| 20 | <div class="col-10 align-self-center alert alert-primary" *ngIf="!articuloService.carrito.length"> | 20 | <div class="col-10 align-self-center alert alert-primary" *ngIf="!articuloService.carrito.length"> | 
| 21 | <p class="h5 text-center">No hay artículos en el carrito</p> | 21 | <p class="h5 text-center">No hay artículos en el carrito</p> | 
| 22 | </div> | 22 | </div> | 
| 23 | <!-- ARTICULOS --> | 23 | <!-- ARTICULOS --> | 
| 24 | <div | 24 | <div | 
| 25 | class="col-12 col-xl-6 p-2 h-50 h-md-25 h-xl-40 text-center text-truncate carrito-articulo" | 25 | class="col-12 col-xl-6 p-2 h-50 h-md-25 h-xl-40 text-center text-truncate carrito-articulo" | 
| 26 | *ngFor="let articulo of articuloService.carrito; let i = index;" | 26 | *ngFor="let articulo of articuloService.carrito; let i = index;" | 
| 27 | @EnterLeave> | 27 | @EnterLeave> | 
| 28 | <!-- ARTICULO --> | 28 | <!-- ARTICULO --> | 
| 29 | <div class="h-100 border border-primary rounded-sm"> | 29 | <div class="h-100 border border-primary rounded-sm"> | 
| 30 | <div class="row align-items-center mx-0 h-100"> | 30 | <div class="row align-items-center mx-0 h-100"> | 
| 31 | <!-- NOMBRE E IMAGEN --> | 31 | <!-- NOMBRE E IMAGEN --> | 
| 32 | <div class="col-6 col-md-3 h-50 h-md-100 border-right border-primary"> | 32 | <div class="col-6 col-md-3 h-50 h-md-100 border-right border-primary"> | 
| 33 | <img | 33 | <img | 
| 34 | draggable="false" | 34 | draggable="false" | 
| 35 | ondragstart="return false;" | 35 | ondragstart="return false;" | 
| 36 | (contextmenu)="false" | 36 | (contextmenu)="false" | 
| 37 | class="d-none d-md-block mx-auto h-55 rounded-sm shadow-sm" | 37 | class="d-none d-md-block mx-auto h-55 rounded-sm shadow-sm" | 
| 38 | src="{{urlImagenes}}{{articulo.imagenes[0].imagen}}" | 38 | src="{{urlImagenes}}{{articulo.imagenes[0].imagen}}" | 
| 39 | onerror="this.src='assets/img/image-not-found.jpg'"> | 39 | onerror="this.src='assets/img/image-not-found.jpg'"> | 
| 40 | <div class="row mx-0 h-100 h-md-45"> | 40 | <div class="row mx-0 h-100 h-md-45"> | 
| 41 | <p class="col text-primary text-truncate align-self-center"> | 41 | <p class="col text-primary text-truncate align-self-center"> | 
| 42 | <small>{{articulo.DetArt}}</small> | 42 | <small>{{articulo.DetArt}}</small> | 
| 43 | </p> | 43 | </p> | 
| 44 | </div> | 44 | </div> | 
| 45 | </div> | 45 | </div> | 
| 46 | <!-- CANTIDAD --> | 46 | <!-- CANTIDAD --> | 
| 47 | <div class="col-6 col-md-3 h-50 h-md-100 border-right border-primary"> | 47 | <div class="col-6 col-md-3 h-50 h-md-100 border-right border-primary"> | 
| 48 | <p class="h-40"><small>CANT</small></p> | 48 | <p class="h-40"><small>CANT</small></p> | 
| 49 | <div class="row mx-0 justify-content-between bg-primary badge-pill"> | 49 | <articulo-cantidad [articulo]="articulo"></articulo-cantidad> | 
| 50 | <!-- BOTON MENOS --> | ||
| 51 | <div class="col-auto px-0 my-auto"> | ||
| 52 | <img | ||
| 53 | draggable="false" | ||
| 54 | ondragstart="return false;" | ||
| 55 | (contextmenu)="false" | ||
| 56 | class="d-block ml-auto py-2 icon-20 btn-effect" | ||
| 57 | src="assets/img/menos-blanco.svg" | ||
| 58 | (click)="substractCant(articulo)"> | ||
| 59 | </div> | ||
| 60 | <!-- CANTIDAD --> | ||
| 61 | <div class="col px-0 py-2 my-auto text-white"> | ||
| 62 | <p><small>{{articulo.cantidad}}</small></p> | ||
| 63 | </div> | ||
| 64 | <!-- BOTON MAS --> | ||
| 65 | <div class="col-auto px-0 my-auto"> | ||
| 66 | <img | ||
| 67 | draggable="false" | ||
| 68 | ondragstart="return false;" | ||
| 69 | (contextmenu)="false" | ||
| 70 | class="d-block ml-auto py-2 icon-20 btn-effect" | ||
| 71 | src="assets/img/mas-blanco.svg" | ||
| 72 | (click)="addCant(articulo)"> | ||
| 73 | </div> | ||
| 74 | </div> | ||
| 75 | </div> | 50 | </div> | 
| 76 | <!-- PRECIO --> | 51 | <!-- PRECIO --> | 
| 77 | <div class="col-6 col-md-3 h-50 h-md-100 border-right border-primary"> | 52 | <div class="col-6 col-md-3 h-50 h-md-100 border-right border-primary"> | 
| 78 | <p class="h-40"><small>PRECIO</small></p> | 53 | <p class="h-40"><small>PRECIO</small></p> | 
| 79 | <div class="py-2 badge-pill bg-dark text-white"> | 54 | <div class="py-1 badge-pill bg-dark text-white"> | 
| 80 | <p><small>{{articulo.PreVen | currency}}</small></p> | 55 | <p><small>{{articulo.PreVen | currency}}</small></p> | 
| 81 | </div> | 56 | </div> | 
| 82 | </div> | 57 | </div> | 
| 83 | <!-- ELIMINAR --> | 58 | <!-- ELIMINAR --> | 
| 84 | <div class="col-6 col-md-3 align-self-center"> | 59 | <div class="col-6 col-md-3 align-self-center"> | 
| 85 | <div class="row mx-0 justify-content-center"> | 60 | <div class="row mx-0 justify-content-center"> | 
| 86 | <div | 61 | <div | 
| 87 | class="col-auto px-3 py-1 btn-effect bg-primary badge-pill text-white" | 62 | class="col-auto px-3 py-1 btn-effect bg-primary badge-pill text-white" | 
| 88 | (click)="deleteArticulo(i)"> | 63 | (click)="deleteArticulo(i)"> | 
| 89 | <span> | 64 | <span> | 
| 90 | <small class="pr-2">ELIMINAR</small> | 65 | <small class="pr-2">ELIMINAR</small> | 
| 91 | <img | 66 | <img | 
| 92 | draggable="false" | 67 | draggable="false" | 
| 93 | ondragstart="return false;" | 68 | ondragstart="return false;" | 
| 94 | (contextmenu)="false" | 69 | (contextmenu)="false" | 
| 95 | class="icon-20 rotate-45" | 70 | class="icon-20 rotate-45" | 
| 96 | src="assets/img/mas-blanco.svg"> | 71 | src="assets/img/mas-blanco.svg"> | 
| 97 | </span> | 72 | </span> | 
| 98 | </div> | 73 | </div> | 
| 99 | </div> | 74 | </div> | 
| 100 | </div> | 75 | </div> | 
| 101 | </div> | 76 | </div> | 
| 102 | </div> | 77 | </div> | 
| 103 | </div> | 78 | </div> | 
| 104 | </div> | 79 | </div> | 
| 105 | <!-- TOTAL --> | 80 | <!-- TOTAL --> | 
| 106 | <div class="row mx-3 mt-2 h-auto justify-content-end"> | 81 | <div class="row mx-3 mt-2 h-auto justify-content-end"> | 
| 107 | <div class="col-auto align-self-center text-primary"><small>TOTAL</small></div> | 82 | <div class="col-auto align-self-center text-primary"><small>TOTAL</small></div> | 
| 108 | <div class="col-auto px-3 bg-primary badge-pill"> | 83 | <div class="col-auto px-3 bg-primary badge-pill"> | 
| 109 | <p class="text-center text-white py-1">{{articuloService.subTotal | currency}}</p> | 84 | <p class="text-center text-white py-1">{{articuloService.subTotal | currency}}</p> | 
| 110 | </div> | 85 | </div> | 
| 111 | </div> | 86 | </div> | 
| 112 | <!-- CONTINUAR --> | 87 | <!-- CONTINUAR --> | 
| 113 | <div | 88 | <div | 
| 114 | *ngIf="articuloService.carrito.length" | 89 | *ngIf="articuloService.carrito.length" | 
| 115 | class="row mx-3 mt-4 h-auto justify-content-end"> | 90 | class="row mx-3 mt-4 h-auto justify-content-end"> | 
| 116 | <div | 91 | <div | 
| 117 | class="col-auto py-2 px-3 align-self-center btn-effect bg-primary badge-pill text-white" | 92 | class="col-auto py-2 px-3 align-self-center btn-effect bg-primary badge-pill text-white" | 
| 118 | [routerLink]="['/forma-pago']"> | 93 | [routerLink]="['/forma-pago']"> | 
| 119 | <span> | 94 | <span> | 
| 120 | <small class="pr-2">CONTINUAR</small> | 95 | <small class="pr-2">CONTINUAR</small> | 
| 121 | <img | 96 | <img | 
| 122 | draggable="false" | 97 | draggable="false" | 
| 123 | ondragstart="return false;" | 98 | ondragstart="return false;" | 
| 124 | (contextmenu)="false" | 99 | (contextmenu)="false" | 
| 125 | class="icon-20" | 100 | class="icon-20" | 
| 126 | src="assets/img/ir.svg"> | 101 | src="assets/img/ir.svg"> | 
| 127 | </span> | 102 | </span> | 
| 128 | </div> | 103 | </div> | 
| 129 | </div> | 104 | </div> | 
| 130 | </div> | 105 | </div> | 
| 131 | 106 | ||
| 132 | </div> | 107 | </div> | 
| 133 | 108 | 
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 py-1 | 36 | class="col-12 px-0 box-categorias border border-primary py-1 | 
| 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 rounded-sm shadow': allActive, 'border-bottom-effect': !allActive, | 41 | [ngClass]="{ 'active rounded-sm shadow': 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 img-fluid align-self-end d-none d-sm-block rounded-circle" | 48 | class="col-12 img-fluid 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 rounded-sm shadow': categoria.selected, 'border-bottom-effect': !categoria.selected, | 54 | [ngClass]="{ 'active rounded-sm shadow': 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 img-fluid align-self-end d-none d-sm-block rounded-circle" | 62 | class="col-12 img-fluid align-self-end d-none d-sm-block rounded-circle" | 
| 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-1 my-1 h-100 h-md-25 align-self-end text-center text-truncate">{{categoria.detalle}}</small> | 66 | <small class="col-12 px-1 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 | 88 | <div | 
| 89 | class="col px-2 my-1 my-md-3 h-auto" | 89 | class="col px-2 my-1 my-md-3 h-auto" | 
| 90 | *ngFor="let articulo of auxArticulos | slice:0:showQuantity;"> | 90 | *ngFor="let articulo of auxArticulos | slice:0:showQuantity;"> | 
| 91 | <div | 91 | <div | 
| 92 | class="swing-in-top-fwd btn-effect card h-auto" | 92 | class="swing-in-top-fwd btn-effect card h-auto" | 
| 93 | (click)="selectArticulo(articulo)"> | 93 | (click)="selectArticulo(articulo)"> | 
| 94 | <img | 94 | <img | 
| 95 | draggable="false" | 95 | draggable="false" | 
| 96 | ondragstart="return false;" | 96 | ondragstart="return false;" | 
| 97 | (contextmenu)="false" | 97 | (contextmenu)="false" | 
| 98 | src="{{urlImagenes}}{{articulo.imagenes[0].imagen}}" | 98 | src="{{urlImagenes}}{{articulo.imagenes[0].imagen}}" | 
| 99 | onerror="this.src='assets/img/image-not-found.jpg'" | 99 | onerror="this.src='assets/img/image-not-found.jpg'" | 
| 100 | class="card-img-top h-30 h-md-55 rounded-sm"> | 100 | class="card-img-top h-30 h-md-55 rounded-sm"> | 
| 101 | <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"> | 
| 102 | <p | 102 | <p | 
| 103 | [ngClass]="{'text-primary': articulo.PRO, 'text-secondary': !articulo.PRO}" | 103 | [ngClass]="{'text-primary': articulo.PRO, 'text-secondary': !articulo.PRO}" | 
| 104 | 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"> | 
| 105 | {{articulo.DetArt.toUpperCase()}} | 105 | {{articulo.DetArt.toUpperCase()}} | 
| 106 | </p> | 106 | </p> | 
| 107 | <div class="col-12 px-1 align-self-end h-auto"> | 107 | <div class="col-12 px-1 align-self-end h-auto"> | 
| 108 | <div | 108 | <div | 
| 109 | [ngClass]="{'bg-primary': articulo.PRO, 'bg-secondary': !articulo.PRO}" | 109 | [ngClass]="{'bg-primary': articulo.PRO, 'bg-secondary': !articulo.PRO}" | 
| 110 | class="row mx-0 justify-content-between badge-pill"> | 110 | class="row mx-0 justify-content-between badge-pill"> | 
| 111 | <div class="col px-0 align-self-center text-white text-right"> | 111 | <div class="col px-0 align-self-center text-white text-right"> | 
| 112 | {{articulo.PreVen | currency}} | 112 | {{articulo.PreVen | currency}} | 
| 113 | </div> | 113 | </div> | 
| 114 | <div class="col-5 px-0"> | 114 | <div class="col-5 px-0"> | 
| 115 | <img | 115 | <img | 
| 116 | draggable="false" | 116 | draggable="false" | 
| 117 | ondragstart="return false;" | 117 | ondragstart="return false;" | 
| 118 | (contextmenu)="false" | 118 | (contextmenu)="false" | 
| 119 | class="d-block ml-auto py-1 icon-30" | 119 | class="d-block ml-auto py-1 icon-30" | 
| 120 | src="assets/img/ir.svg"> | 120 | src="assets/img/ir.svg"> | 
| 121 | </div> | 121 | </div> | 
| 122 | </div> | 122 | </div> | 
| 123 | </div> | 123 | </div> | 
| 124 | </div> | 124 | </div> | 
| 125 | </div> | 125 | </div> | 
| 126 | </div> | 126 | </div> | 
| 127 | </div> | 127 | </div> | 
| 128 | <!-- BOTON VER MAS --> | 128 | <!-- BOTON VER MAS --> | 
| 129 | <div class="row mx-0"> | 129 | <div class="row mx-0"> | 
| 130 | <div | 130 | <div | 
| 131 | *ngIf="showQuantity <= auxArticulos.slice(0, showQuantity).length" | 131 | *ngIf="showQuantity <= auxArticulos.slice(0, showQuantity).length" | 
| 132 | class="col-12 px-0 mb-2"> | 132 | class="col-12 px-0 mb-2"> | 
| 133 | <button | 133 | <button | 
| 134 | (click)="increaseShow()" | 134 | (click)="increaseShow()" | 
| 135 | class="btn btn-block btn-outline-primary"> | 135 | class="btn btn-block btn-outline-primary"> | 
| 136 | Ver Más | 136 | Ver Más | 
| 137 | </button> | 137 | </button> | 
| 138 | </div> | 138 | </div> | 
| 139 | </div> | 139 | </div> | 
| 140 | </div> | 140 | </div> | 
| 141 | </div> | 141 | </div> | 
| 142 | </div> | 142 | </div> | 
| 143 | </div> | 143 | </div> | 
| 144 | <!-- FOOTER CARRITO DE COMPRAS --> | 144 | <!-- FOOTER CARRITO DE COMPRAS --> | 
| 145 | <div class="row w-90 mx-auto h-auto justify-content-center"> | 145 | <div class="row w-90 mx-auto h-auto justify-content-center"> | 
| 146 | <div class="h-75 px-0 border border-primary rounded" #boxCarrito | 146 | <div class="h-75 px-0 border border-primary rounded" #boxCarrito | 
| 147 | [ngClass]="boxCarrito.classList.contains('media-pantalla') | 147 | [ngClass]="boxCarrito.classList.contains('media-pantalla') | 
| 148 | ? 'col-8' : 'col-12'" id="boxCarrito"> | 148 | ? 'col-8' : 'col-12'" id="boxCarrito"> | 
| 149 | <!-- CABECERA --> | 149 | <!-- CABECERA --> | 
| 150 | <div class="row mx-0 h-15 border-bottom border-primary"> | 150 | <div class="row mx-0 h-15 border-bottom border-primary"> | 
| 151 | <p class="col align-self-center text-truncate"><small>ARTÍCULOS EN TÚ CARRITO DE COMPRAS</small></p> | 151 | <p class="col align-self-center text-truncate"><small>ARTÍCULOS EN TÚ CARRITO DE COMPRAS</small></p> | 
| 152 | </div> | 152 | </div> | 
| 153 | <!-- CUERPO --> | 153 | <!-- CUERPO --> | 
| 154 | <div class="row h-85 mx-0 justify-content-around"> | 154 | <div class="row h-85 mx-0 justify-content-around"> | 
| 155 | <!-- BOTON SCROLL IZQUIERDA --> | 155 | <!-- BOTON SCROLL IZQUIERDA --> | 
| 156 | <div *ngIf="articuloService.carrito.length" class="col-auto btn-effect h-20 align-self-center"> | 156 | <div *ngIf="articuloService.carrito.length" class="col-auto btn-effect h-20 align-self-center"> | 
| 157 | <img | 157 | <img | 
| 158 | draggable="false" | 158 | draggable="false" | 
| 159 | ondragstart="return false;" | 159 | ondragstart="return false;" | 
| 160 | (contextmenu)="false" | 160 | (contextmenu)="false" | 
| 161 | class="icon-30 rotate-180-neg" | 161 | class="icon-30 rotate-180-neg" | 
| 162 | src="assets/img/ir-fondo-color.svg" | 162 | src="assets/img/ir-fondo-color.svg" | 
| 163 | (mousedown)="scrollX(templateCarrito, -100)" | 163 | (mousedown)="scrollX(templateCarrito, -100)" | 
| 164 | (mouseup)="mouseup()" | 164 | (mouseup)="mouseup()" | 
| 165 | (mouseleave)="mouseup()"> | 165 | (mouseleave)="mouseup()"> | 
| 166 | </div> | 166 | </div> | 
| 167 | <!-- CARRITO --> | 167 | <!-- CARRITO --> | 
| 168 | <div class="col-6 col-sm-8 col-lg-10 h-100"> | 168 | <div class="col-6 col-sm-8 col-lg-10 h-100"> | 
| 169 | <div | 169 | <div | 
| 170 | #templateCarrito | 170 | #templateCarrito | 
| 171 | class="row flex-row flex-nowrap h-100 mx-0 my-2 scroll-x" | 171 | class="row flex-row flex-nowrap h-100 mx-0 my-2 scroll-x" | 
| 172 | (scroll)="scrollEvent($event)"> | 172 | (scroll)="scrollEvent($event)"> | 
| 173 | <!-- ARTICULOS --> | 173 | <!-- ARTICULOS --> | 
| 174 | <div | 174 | <div | 
| 175 | class="col-10 col-sm-4 col-lg-2 px-2 px-xl-4 align-self-center border-right border-primary" | 175 | class="col-10 col-sm-4 col-lg-2 px-2 px-xl-4 align-self-center border-right border-primary" | 
| 176 | *ngFor="let articulo of articuloService.carrito; let i = index;" | 176 | *ngFor="let articulo of articuloService.carrito; let i = index;" | 
| 177 | @EnterLeave> | 177 | @EnterLeave> | 
| 178 | <img | 178 | <img | 
| 179 | class="btn-effect icon-20 mr-2 position-absolute right-0" | 179 | class="btn-effect icon-20 mr-2 position-absolute right-0" | 
| 180 | src="assets/img/icono-cancelar-color.svg" | 180 | src="assets/img/icono-cancelar-color.svg" | 
| 181 | (click)="deleteArticulo(i)"> | 181 | (click)="deleteArticulo(i)"> | 
| 182 | <img | 182 | <img | 
| 183 | draggable="false" | 183 | draggable="false" | 
| 184 | ondragstart="return false;" | 184 | ondragstart="return false;" | 
| 185 | (contextmenu)="false" | 185 | (contextmenu)="false" | 
| 186 | class="d-block img-fluid p-2 mx-auto rounded" | 186 | class="d-block img-fluid p-2 mx-auto rounded" | 
| 187 | src="{{urlImagenes}}{{articulo.imagenes[0].imagen}}" | 187 | src="{{urlImagenes}}{{articulo.imagenes[0].imagen}}" | 
| 188 | onerror="this.src='assets/img/image-not-found.jpg'"> | 188 | onerror="this.src='assets/img/image-not-found.jpg'"> | 
| 189 | <p class="d-block mt-auto text-center text-primary text-truncate"> | 189 | <p class="d-block mt-auto text-center text-primary text-truncate"> | 
| 190 | <small>{{articulo.DetArt}}</small> | 190 | <small>{{articulo.DetArt}}</small> | 
| 191 | </p> | 191 | </p> | 
| 192 | <div class="row mx-0 justify-content-between bg-primary badge-pill"> | 192 | <articulo-cantidad [articulo]="articulo"></articulo-cantidad> | 
| 193 | <!-- BOTON MENOS --> | ||
| 194 | <div class="col-auto px-0 my-auto"> | ||
| 195 | <img | ||
| 196 | draggable="false" | ||
| 197 | ondragstart="return false;" | ||
| 198 | (contextmenu)="false" | ||
| 199 | class="d-block ml-auto py-2 icon-15 btn-effect" | ||
| 200 | src="assets/img/menos-blanco.svg" | ||
| 201 | (click)="substractCant(articulo)"> | ||
| 202 | </div> | ||
| 203 | <!-- CANTIDAD --> | ||
| 204 | <div class="col px-0 my-auto text-white text-center"> | ||
| 205 | <p><small>{{articulo.cantidad}}</small></p> | ||
| 206 | </div> | ||
| 207 | <!-- BOTON MAS --> | ||
| 208 | <div class="col-auto px-0 my-auto"> | ||
| 209 | <img | ||
| 210 | draggable="false" | ||
| 211 | ondragstart="return false;" | ||
| 212 | (contextmenu)="false" | ||
| 213 | class="d-block ml-auto py-2 icon-15 btn-effect" | ||
| 214 | src="assets/img/mas-blanco.svg" | ||
| 215 | (click)="addCant(articulo)"> | ||
| 216 | </div> | ||
| 217 | </div> | ||
| 218 | </div> | 193 | </div> | 
| 219 | <!-- MENSAJE DE ADVERTENCIA --> | 194 | <!-- MENSAJE DE ADVERTENCIA --> | 
| 220 | <div *ngIf="!articuloService.carrito.length" class="col h-100"> | 195 | <div *ngIf="!articuloService.carrito.length" class="col h-100"> | 
| 221 | <p class="text-center py-5">No hay articulos en el carrito</p> | 196 | <p class="text-center py-5">No hay articulos en el carrito</p> | 
| 222 | </div> | 197 | </div> | 
| 223 | </div> | 198 | </div> | 
| 224 | </div> | 199 | </div> | 
| 225 | <!-- BOTON SCROLL DERECHA --> | 200 | <!-- BOTON SCROLL DERECHA --> | 
| 226 | <div *ngIf="articuloService.carrito.length" class="col-auto btn-effect h-20 align-self-center"> | 201 | <div *ngIf="articuloService.carrito.length" class="col-auto btn-effect h-20 align-self-center"> | 
| 227 | <img | 202 | <img | 
| 228 | draggable="false" | 203 | draggable="false" | 
| 229 | ondragstart="return false;" | 204 | ondragstart="return false;" | 
| 230 | (contextmenu)="false" | 205 | (contextmenu)="false" | 
| 231 | class="icon-30" | 206 | class="icon-30" | 
| 232 | src="assets/img/ir-fondo-color.svg" | 207 | src="assets/img/ir-fondo-color.svg" | 
| 233 | (mousedown)="scrollX(templateCarrito, 100)" | 208 | (mousedown)="scrollX(templateCarrito, 100)" | 
| 234 | (mouseup)="mouseup()" | 209 | (mouseup)="mouseup()" | 
| 235 | (mouseleave)="mouseup()"> | 210 | (mouseleave)="mouseup()"> | 
| 236 | </div> | 211 | </div> | 
| 237 | </div> | 212 | </div> | 
| 238 | </div> | 213 | </div> | 
| 239 | <!-- TOTAL--> | 214 | <!-- TOTAL--> | 
| 240 | <div | 215 | <div | 
| 241 | class="col-auto mt-2 ml-auto h-20"> | 216 | class="col-auto mt-2 ml-auto h-20"> | 
| 242 | <div class="row mx-0"> | 217 | <div class="row mx-0"> | 
| 243 | <div class="col-auto align-self-center text-primary">TOTAL</div> | 218 | <div class="col-auto align-self-center text-primary">TOTAL</div> | 
| 244 | <div class="col-auto bg-primary badge-pill"> | 219 | <div class="col-auto bg-primary badge-pill"> | 
| 245 | <p class="text-center text-white mt-1 py-1">{{articuloService.subTotal | currency}}</p> | 220 | <p class="text-center text-white mt-1 py-1">{{articuloService.subTotal | currency}}</p> | 
| 246 | </div> | 221 | </div> | 
| 247 | </div> | 222 | </div> | 
| 248 | </div> | 223 | </div> | 
| 249 | 224 | ||
| 250 | <!-- VER CARRITO --> | 225 | <!-- VER CARRITO --> | 
| 251 | <div | 226 | <div | 
| 252 | class="col-auto px-0 mt-2 h-20" | 227 | class="col-auto px-0 mt-2 h-20" | 
| 253 | *ngIf="articuloService.carrito.length" | 228 | *ngIf="articuloService.carrito.length" | 
| 254 | [ngClass]="{'ml-auto pb-3' : boxCarrito.classList.contains('media-pantalla')}"> | 229 | [ngClass]="{'ml-auto pb-3' : boxCarrito.classList.contains('media-pantalla')}"> | 
| 255 | <div | 230 | <div | 
| 256 | class="btn-effect col-auto px-0 align-self-center bg-white" | 231 | class="btn-effect col-auto px-0 align-self-center bg-white" | 
| 257 | [routerLink]="['/carrito']"> | 232 | [routerLink]="['/carrito']"> | 
| 258 | <div class="row mx-0 bg-light"> | 233 | <div class="row mx-0 bg-light"> | 
| 259 | <div class="col-auto p-0 bg-primary"> | 234 | <div class="col-auto p-0 bg-primary"> | 
| 260 | <img | 235 | <img | 
| 261 | draggable="false" | 236 | draggable="false" | 
| 262 | ondragstart="return false;" | 237 | ondragstart="return false;" | 
| 263 | (contextmenu)="false" | 238 | (contextmenu)="false" | 
| 264 | class="p-2 icon-40" | 239 | class="p-2 icon-40" | 
| 265 | src="assets/img/carrito.svg"> | 240 | src="assets/img/carrito.svg"> | 
| 266 | </div> | 241 | </div> | 
| 267 | <div class="col-auto align-self-center text-primary d-none d-sm-block">IR AL CARRITO</div> | 242 | <div class="col-auto align-self-center text-primary d-none d-sm-block">IR AL CARRITO</div> | 
| 268 | </div> | 243 | </div> | 
| 269 | </div> | 244 | </div> | 
| 270 | </div> | 245 | </div> | 
| 271 | 246 | ||
| 272 | </div> | 247 | </div> | 
| 273 | </div> | 248 | </div> | 
| 274 | 249 | ||
| 275 | </div> | 250 | </div> | 
| 276 | 251 | 
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 { SinonimoComponent } from 'src/app/shared/sinonimo/sinonimo.component'; | 10 | import { SinonimoComponent } from 'src/app/shared/sinonimo/sinonimo.component'; | 
| 11 | import { FormsModule } from '@angular/forms'; | 11 | import { FormsModule } from '@angular/forms'; | 
| 12 | import { ConfirmacionComponent } from 'src/app/shared/confirmacion/confirmacion.component'; | 12 | import { ConfirmacionComponent } from 'src/app/shared/confirmacion/confirmacion.component'; | 
| 13 | import { ArticuloCantidadComponent } from 'src/app/shared/articulo-cantidad/articulo-cantidad.component'; | ||
| 13 | 14 | ||
| 14 | @NgModule({ | 15 | @NgModule({ | 
| 15 | declarations: [ | 16 | declarations: [ | 
| 16 | SeleccionArticulosComponent, | 17 | SeleccionArticulosComponent, | 
| 17 | HeaderPublicidadComponent, | 18 | HeaderPublicidadComponent, | 
| 18 | PromocionComponent, | 19 | PromocionComponent, | 
| 19 | SinonimoComponent, | 20 | SinonimoComponent, | 
| 20 | ConfirmacionComponent | 21 | ConfirmacionComponent, | 
| 22 | ArticuloCantidadComponent, | ||
| 21 | ], | 23 | ], | 
| 22 | imports: [ | 24 | imports: [ | 
| 23 | CommonModule, | 25 | CommonModule, | 
| 24 | SeleccionArticulosRoutingModule, | 26 | SeleccionArticulosRoutingModule, | 
| 25 | FormsModule, | 27 | FormsModule, | 
| 26 | ModalModule.forRoot(), | 28 | ModalModule.forRoot(), | 
| 27 | CarouselModule.forRoot(), | 29 | CarouselModule.forRoot(), | 
| 28 | SharedModule | 30 | SharedModule | 
| 29 | ], | 31 | ], | 
| 30 | exports: [HeaderPublicidadComponent], | 32 | exports: [HeaderPublicidadComponent, ArticuloCantidadComponent], | 
| 31 | entryComponents: [PromocionComponent, ConfirmacionComponent, SinonimoComponent] | 33 | entryComponents: [PromocionComponent, ConfirmacionComponent, SinonimoComponent] | 
| 32 | }) | 34 | }) | 
| 33 | export class SeleccionArticulosModule { } | 35 | export class SeleccionArticulosModule { } | 
| 34 | 36 | 
src/app/shared/articulo-cantidad/articulo-cantidad.component.html
| File was created | 1 | <div class="row mx-0 justify-content-between bg-primary badge-pill"> | |
| 2 | <!-- BOTON MENOS --> | ||
| 3 | <div class="col-auto px-0 my-auto"> | ||
| 4 | <img | ||
| 5 | draggable="false" | ||
| 6 | ondragstart="return false;" | ||
| 7 | (contextmenu)="false" | ||
| 8 | class="d-block ml-auto py-2 icon-15 btn-effect" | ||
| 9 | src="assets/img/menos-blanco.svg" | ||
| 10 | (click)="substractCant(articulo)"> | ||
| 11 | </div> | ||
| 12 | <!-- CANTIDAD --> | ||
| 13 | <div class="col px-0 my-auto text-white text-center"> | ||
| 14 | <p><small>{{articulo.cantidad}}</small></p> | ||
| 15 | </div> | ||
| 16 | <!-- BOTON MAS --> | ||
| 17 | <div class="col-auto px-0 my-auto"> | ||
| 18 | <img | ||
| 19 | draggable="false" | ||
| 20 | ondragstart="return false;" | ||
| 21 | (contextmenu)="false" | ||
| 22 | class="d-block ml-auto py-2 icon-15 btn-effect" | ||
| 23 | src="assets/img/mas-blanco.svg" | ||
| 24 | (click)="addCant(articulo)"> | ||
| 25 | </div> | ||
| 26 | </div> | ||
| 27 | 
src/app/shared/articulo-cantidad/articulo-cantidad.component.scss
src/app/shared/articulo-cantidad/articulo-cantidad.component.spec.ts
| File was created | 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | |
| 2 | |||
| 3 | import { ArticuloCantidadComponent } from './articulo-cantidad.component'; | ||
| 4 | |||
| 5 | describe('ArticuloCantidadComponent', () => { | ||
| 6 | let component: ArticuloCantidadComponent; | ||
| 7 | let fixture: ComponentFixture<ArticuloCantidadComponent>; | ||
| 8 | |||
| 9 | beforeEach(async(() => { | ||
| 10 | TestBed.configureTestingModule({ | ||
| 11 | declarations: [ ArticuloCantidadComponent ] | ||
| 12 | }) | ||
| 13 | .compileComponents(); | ||
| 14 | })); | ||
| 15 | |||
| 16 | beforeEach(() => { | ||
| 17 | fixture = TestBed.createComponent(ArticuloCantidadComponent); | ||
| 18 | component = fixture.componentInstance; | ||
| 19 | fixture.detectChanges(); | ||
| 20 | }); | ||
| 21 | |||
| 22 | it('should create', () => { | ||
| 23 | expect(component).toBeTruthy(); | ||
| 24 | }); | ||
| 25 | }); | ||
| 26 | 
src/app/shared/articulo-cantidad/articulo-cantidad.component.ts
| File was created | 1 | import { Component, OnInit, Input } from '@angular/core'; | |
| 2 | import { IArticulo } from 'src/app/interfaces/IArticulo'; | ||
| 3 | import { ArticuloService } from 'src/app/services/articulo/articulo.service'; | ||
| 4 | |||
| 5 | @Component({ | ||
| 6 | selector: 'articulo-cantidad', | ||
| 7 | templateUrl: './articulo-cantidad.component.html', | ||
| 8 | styleUrls: ['./articulo-cantidad.component.scss'] | ||
| 9 | }) | ||
| 10 | export class ArticuloCantidadComponent implements OnInit { | ||
| 11 | @Input() articulo: IArticulo; | ||
| 12 | |||
| 13 | constructor(private articuloService: ArticuloService) { } | ||
| 14 | |||
| 15 | ngOnInit() { } | ||
| 16 | |||
| 17 | substractCant(articulo: IArticulo) { | ||
| 18 | this.articuloService.substractCant(articulo); | ||
| 19 | } | ||
| 20 | |||
| 21 | addCant(articulo: IArticulo) { | ||
| 22 | this.articuloService.addCant(articulo); | ||
| 23 | } | ||
| 24 | |||
| 25 | } | ||
| 26 |