Commit 986aef12649f095ea0768390337c707ce7772645

Authored by Eric Fernandez
Exists in master and in 1 other branch validar_pve

conflicts

src/app/components/busqueda-productos/busqueda-productos.component.html
... ... @@ -20,6 +20,12 @@
20 20 </div>
21 21 <ul class="list-group">
22 22 <li
  23 + [ngClass]="{active: categoriaActive == 0}"
  24 + (click)="categoriaActive = 0; filterItems()"
  25 + class="list-group-item list-group-item-action text-center my-1 p-2 h6">
  26 + Todos
  27 + </li>
  28 + <li
23 29 *ngFor="let categoria of categorias"
24 30 [ngClass]="{active: categoriaActive == categoria.id}"
25 31 (click)="categoriaActive = categoria.id; filterItems()"
... ... @@ -53,8 +59,8 @@
53 59 <i class="fa fa-undo text-warning" aria-hidden="true"></i>
54 60 </button>
55 61 </div>
56   - <div class="col-sm-12 my-2">
57   - <span class="badge badge-light px-2">Más vendidos</span>
  62 + <div class="col-sm-12 my-2 h5">
  63 + <span class="badge badge-light px-2 text-muted shadow-sm">Más vendidos</span>
58 64 </div>
59 65 </div>
60 66 <!-- LISTA DE PRODUCTOS -->
src/app/components/busqueda-productos/busqueda-productos.component.ts
... ... @@ -33,7 +33,7 @@ export class BusquedaProductosComponent implements OnInit {
33 33 this.productoService.getCategorias()
34 34 .subscribe((categorias: Categoria[]) => {
35 35 this.categorias = categorias;
36   - this.categoriaActive = this.verCategorias ? 1 : categorias[0].id;
  36 + this.categoriaActive = this.verCategorias ? 0 : categorias[0].id;
37 37 });
38 38  
39 39 this.productoService.productoAcargar = undefined;
... ... @@ -51,8 +51,13 @@ export class BusquedaProductosComponent implements OnInit {
51 51 filterItems() {
52 52  
53 53 this.auxProductos = this.productos.filter(x => {
54   - return x.DetArt.toLowerCase().includes(this.searchTerm.toLowerCase()) &&
55   - x.categoria_selfservice == this.categoriaActive;
  54 + if (this.categoriaActive === 0) {
  55 + return x.DetArt.toLowerCase().includes(this.searchTerm.toLowerCase())
  56 + }
  57 + else {
  58 + return x.DetArt.toLowerCase().includes(this.searchTerm.toLowerCase()) &&
  59 + x.categoria_selfservice === this.categoriaActive;
  60 + }
56 61 });
57 62 }
58 63  
... ... @@ -80,7 +85,7 @@ export class BusquedaProductosComponent implements OnInit {
80 85 },
81 86 error => { console.error(error); }
82 87 );
83   - }else {
  88 + } else {
84 89  
85 90 this.productoService.productoAcargar = producto;
86 91 this.router.navigate(['inicio']);
src/app/components/home/home.component.html
... ... @@ -5,7 +5,7 @@
5 5 <div class="row m-0">
6 6 <div class="col p-0">
7 7 <div
8   - class="vh-100 fade-in d-flex align-content-between flex-wrap disable-user-select"
  8 + class="vh-100 fade-in d-flex align-items-start flex-column disable-user-select"
9 9 [routerLink]="['/inicio']">
10 10  
11 11 <!-- HEADER -->
... ... @@ -16,31 +16,31 @@
16 16 </div>
17 17  
18 18 <!-- INFO DE BIENVENIDA -->
19   - <div class="row h-50 w-100">
20   - <div class="col-4 offset-2 my-auto">
  19 + <div class="row my-auto h-50 w-100">
  20 + <div class="col-3 col-lg-4 offset-lg-1 h-100 my-auto">
21 21  
22   - <div id="carouselExampleSlidesOnly" class="carousel slide" data-ride="carousel">
23   - <div class="carousel-inner">
24   - <div class="carousel-item active">
  22 + <div id="carouselExampleSlidesOnly" class="carousel slide h-100" data-ride="carousel">
  23 + <div class="carousel-inner h-100">
  24 + <div class="carousel-item active h-100">
25 25 <img
26 26 src="{{apiUrl}}/imagenes/coca1.jpg"
27   - class="d-block rounded-sm shadow w-75 mx-auto">
  27 + class="d-block rounded-sm shadow mw-100 h-100 w-auto mx-auto">
28 28 </div>
29   - <div class="carousel-item">
  29 + <div class="carousel-item h-100">
30 30 <img
31 31 src="{{apiUrl}}/imagenes/coca2.jpg"
32   - class="d-block rounded-sm shadow w-75 mx-auto">
  32 + class="d-block rounded-sm shadow mw-100 h-100 w-auto mx-auto">
33 33 </div>
34   - <div class="carousel-item">
  34 + <div class="carousel-item h-100">
35 35 <img
36 36 src="{{apiUrl}}/imagenes/coca3.jpg"
37   - class="d-block rounded-sm shadow w-75 mx-auto">
  37 + class="d-block rounded-sm shadow mw-100 h-100 w-auto mx-auto">
38 38 </div>
39 39 </div>
40 40 </div>
41 41  
42 42 </div>
43   - <div class="col-6 text-center text-white my-auto">
  43 + <div class="col-9 col-lg-7 text-center text-white my-auto">
44 44 <p class="display-2 font-weight-bold mb-5">¡BIENVENIDO!</p>
45 45 <p class="display-3 m-0 font-weight-bold">Toque la pantalla<br>para comenzar</p>
46 46 </div>
src/app/components/inicio/inicio.component.html
... ... @@ -149,14 +149,6 @@
149 149 class="col-5 pr-0"
150 150 *ngIf="promociones.length > 0">
151 151 <button
152   - *ngIf="sinonimos.length > 0"
153   - type="button"
154   - class="btn btn-light btn-block shadow-sm"
155   - (click)="pop.show()">
156   - <span class="pr-2">Personalizar</span>
157   - <i class="fa fa-hand-o-up text-purple" aria-hidden="true"></i>
158   - </button>
159   - <button
160 152 *ngIf="!promoAcargar || sinonimos.length == 0"
161 153 type="button"
162 154 class="btn btn-primary btn-block shadow-sm"
src/app/components/master/master.component.html
1   -<div class="row m-0 fade-in">
  1 +<div
  2 + class="row m-0 fade-in"
  3 + (click)="reiniciarTimer">
2 4 <div class="col-10 p-0 vh-100">
3 5  
4 6 <!-- TOP HEADER -->
src/app/components/master/master.component.ts
1   -import { Component, OnInit } from '@angular/core';
  1 +import { Component, OnInit, OnDestroy } from '@angular/core';
  2 +import { Router } from '@angular/router';
2 3  
3 4 @Component({
4 5 selector: 'app-master',
5 6 templateUrl: './master.component.html',
6 7 styleUrls: ['./master.component.scss']
7 8 })
8   -export class MasterComponent implements OnInit {
  9 +export class MasterComponent implements OnInit, OnDestroy {
9 10  
10   - constructor() { }
  11 + private timerReposo: any
  12 +
  13 + constructor(
  14 + private router: Router
  15 + ) { }
11 16  
12 17 ngOnInit() {
  18 +
  19 + this.timerReposo = setTimeout(() => {
  20 +
  21 + this.router.navigate(['cancelar-compra']);
  22 + }, 90000)
  23 + }
  24 +
  25 + ngOnDestroy() {
  26 +
  27 + clearTimeout(this.timerReposo);
  28 + }
  29 +
  30 + reiniciarTimer() {
  31 +
  32 + clearTimeout(this.timerReposo);
  33 + this.timerReposo = setTimeout(() => {
  34 +
  35 + this.router.navigate(['cancelar-compra']);
  36 + }, 90000)
  37 +
13 38 }
14 39  
15 40 }
src/app/components/pago/pago.component.html
... ... @@ -27,7 +27,9 @@
27 27 <div class="col-sm-7">
28 28 <div class="row ml-4 pr-3 vh-70 overflow-scroll text-dark">
29 29 <div class="col-4 p-2">
30   - <div class="bg-white rounded-sm shadow border-0">
  30 + <div
  31 + class="bg-white rounded-sm shadow border-0"
  32 + (click)="pagoEfectivo()">
31 33 <img src="{{apiUrl}}/imagenes/efectivo.png" class="rounded-sm w-75 py-2 mx-auto d-block">
32 34 <div class="p-2 card-text text-center">
33 35 <p class="h6 text-center m-0">Efectivo</p>
src/app/components/pago/pago.component.ts
... ... @@ -31,13 +31,22 @@ export class PagoComponent implements OnInit {
31 31 this.productos = this.productoService.productos;
32 32 }
33 33  
  34 + pagoEfectivo() {
  35 +
  36 + this.compraConEfectivofinalizada = true;
  37 + setTimeout(() => {
  38 +
  39 + this.router.navigate(['mensaje-final']);
  40 + }, 3000);
  41 + }
  42 +
34 43 pagar() {
35 44  
36 45 this.verQR = true;
37 46  
38 47 this.productoService.pagar()
39 48 .subscribe(() => {
40   -
  49 +
41 50 // alert('Compra finalizada');
42 51 this.compraConQRfinalizada = true;
43 52 setTimeout(() => {
1 1 <!doctype html>
2 2 <html lang="en">
  3 +
3 4 <head>
4 5 <meta charset="utf-8">
5 6 <title>Autoservicio</title>
... ... @@ -9,7 +10,9 @@
9 10 <meta name="viewport" content="width=device-width, initial-scale=1">
10 11 <link rel="icon" type="image/x-icon" href="favicon.ico">
11 12 </head>
12   -<body>
  13 +
  14 +<body oncontextmenu="return false">
13 15 <app-root></app-root>
14 16 </body>
  17 +
15 18 </html>