Commit d37959514711466cbce67839a6fe7fa33c0ceae1
Exists in
develop
and in
1 other branch
Merge branch 'master' into 'develop'
Master(benjamin) See merge request !20
Showing
15 changed files
Show diff stats
src/app/app-routing.module.ts
... | ... | @@ -51,6 +51,10 @@ const routes: Routes = [ |
51 | 51 | path: 'comanda', |
52 | 52 | loadChildren: () => import('./modules/comanda/comanda.module').then(m => m.ComandaModule) |
53 | 53 | }, |
54 | + { | |
55 | + path: 'cancelar-compra', | |
56 | + loadChildren: () => import('./modules/cancelar-compra/cancelar-compra.module').then(m => m.CancelarCompraModule) | |
57 | + }, | |
54 | 58 | { path: '**', redirectTo: '', pathMatch: 'full' }, |
55 | 59 | ]; |
56 | 60 |
src/app/modules/admin/admin.component.ts
1 | -import { Component, OnInit } from '@angular/core'; | |
1 | +import { Component, OnInit, HostListener } from '@angular/core'; | |
2 | +import { Router } from '@angular/router'; | |
2 | 3 | |
3 | 4 | @Component({ |
4 | 5 | selector: 'app-admin', |
5 | 6 | templateUrl: './admin.component.html', |
6 | 7 | styleUrls: ['./admin.component.scss'] |
7 | 8 | }) |
9 | + | |
8 | 10 | export class AdminComponent implements OnInit { |
11 | + timerReposo: any; | |
12 | + | |
13 | + constructor( | |
14 | + private router: Router, | |
15 | + ) { } | |
16 | + | |
17 | + ngOnInit() { | |
18 | + this.startTimeOutInactividad(); | |
19 | + } | |
20 | + | |
21 | + @HostListener('document:click', ['$event']) | |
22 | + | |
23 | + documentClick(event: MouseEvent) { | |
24 | + if (event) { | |
25 | + this.restartTimer(); | |
26 | + } | |
27 | + } | |
9 | 28 | |
10 | - constructor() { } | |
29 | + restartTimer() { | |
30 | + clearTimeout(this.timerReposo); | |
31 | + this.startTimeOutInactividad(); | |
32 | + } | |
11 | 33 | |
12 | - ngOnInit() { } | |
34 | + startTimeOutInactividad() { | |
35 | + this.timerReposo = setTimeout(() => { | |
36 | + this.router.navigate(['cancelar-compra']); | |
37 | + }, 90000); | |
38 | + } | |
13 | 39 | |
14 | 40 | } |
src/app/modules/cancelar-compra/cancelar-compra-routing.module.ts
... | ... | @@ -0,0 +1,14 @@ |
1 | +import { NgModule, Component } from '@angular/core'; | |
2 | +import { Routes, RouterModule } from '@angular/router'; | |
3 | +import { CancelarCompraComponent } from './cancelar-compra.component'; | |
4 | + | |
5 | + | |
6 | +const routes: Routes = [ | |
7 | + { path: '', component: CancelarCompraComponent } | |
8 | +]; | |
9 | + | |
10 | +@NgModule({ | |
11 | + imports: [RouterModule.forChild(routes)], | |
12 | + exports: [RouterModule] | |
13 | +}) | |
14 | +export class CancelarCompraRoutingModule { } |
src/app/modules/cancelar-compra/cancelar-compra.component.html
... | ... | @@ -0,0 +1,51 @@ |
1 | +<div class="row justify-content-center mt-2 h-15"> | |
2 | + <img class="w-20 my-auto" src="../../../assets/img/logo-spot.svg"> | |
3 | +</div> | |
4 | +<div class="row mt-5 mx-0 justify-content-around h-30"> | |
5 | + <div class="col-5 col-md-6 col-lg-3 h-100"> | |
6 | + <div class="p-3 bg-white text-center shadow-lg rounded h-100"> | |
7 | + <h4 class="pt-3 mt-5">NECESITA</h4> | |
8 | + <h2 class="font-weight-bold text-secondary mt-4">mรกs tiempo</h2> | |
9 | + <h4 class="mt-4">PARA SU PEDIDO?</h4> | |
10 | + </div> | |
11 | + </div> | |
12 | +</div> | |
13 | +<!-- BUTTONS --> | |
14 | +<div class="row mt-5 h-auto justify-content-center mx-0"> | |
15 | + <div class="col-auto px-0 h-auto align-self-start"> | |
16 | + <div | |
17 | + class="btn-effect col-auto align-self-center px-0 bg-white" | |
18 | + (click)="volverPreviousPage()"> | |
19 | + <div class="row mx-0 bg-primary badge-pill"> | |
20 | + <div class="col-auto align-self-center text-white">continuar compra</div> | |
21 | + <div class="col-auto align-self-center p-0"> | |
22 | + <img | |
23 | + draggable="false" | |
24 | + ondragstart="return false;" | |
25 | + (contextmenu)="false" | |
26 | + class="p-1 icon-30" | |
27 | + src="assets/img/ir.svg"> | |
28 | + </div> | |
29 | + </div> | |
30 | + </div> | |
31 | + </div> | |
32 | +</div> | |
33 | +<div class="row mt-4 h-auto justify-content-center mx-0"> | |
34 | + <div class="col-auto px-0 h-auto align-self-start"> | |
35 | + <div | |
36 | + class="btn-effect col-auto align-self-center px-0 bg-white" | |
37 | + (click)="limpiarCarritoYvolver()"> | |
38 | + <div class="row mx-0 bg-grey badge-pill"> | |
39 | + <div class="col-auto align-self-center">cancelar compra</div> | |
40 | + <div class="col-auto align-self-center p-0"> | |
41 | + <img | |
42 | + draggable="false" | |
43 | + ondragstart="return false;" | |
44 | + (contextmenu)="false" | |
45 | + class="p-1 icon-30" | |
46 | + src="assets/img/icono-cancelar-color.svg"> | |
47 | + </div> | |
48 | + </div> | |
49 | + </div> | |
50 | + </div> | |
51 | +</div> |
src/app/modules/cancelar-compra/cancelar-compra.component.scss
src/app/modules/cancelar-compra/cancelar-compra.component.spec.ts
... | ... | @@ -0,0 +1,25 @@ |
1 | +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | |
2 | + | |
3 | +import { CancelarCompraComponent } from './cancelar-compra.component'; | |
4 | + | |
5 | +describe('CancelarCompraComponent', () => { | |
6 | + let component: CancelarCompraComponent; | |
7 | + let fixture: ComponentFixture<CancelarCompraComponent>; | |
8 | + | |
9 | + beforeEach(async(() => { | |
10 | + TestBed.configureTestingModule({ | |
11 | + declarations: [ CancelarCompraComponent ] | |
12 | + }) | |
13 | + .compileComponents(); | |
14 | + })); | |
15 | + | |
16 | + beforeEach(() => { | |
17 | + fixture = TestBed.createComponent(CancelarCompraComponent); | |
18 | + component = fixture.componentInstance; | |
19 | + fixture.detectChanges(); | |
20 | + }); | |
21 | + | |
22 | + it('should create', () => { | |
23 | + expect(component).toBeTruthy(); | |
24 | + }); | |
25 | +}); |
src/app/modules/cancelar-compra/cancelar-compra.component.ts
... | ... | @@ -0,0 +1,33 @@ |
1 | +import { Component, OnInit } from '@angular/core'; | |
2 | +import { Location } from '@angular/common'; | |
3 | +import { ArticuloService } from 'src/app/services/articulo/articulo.service'; | |
4 | +import { Router } from '@angular/router'; | |
5 | + | |
6 | +@Component({ | |
7 | + selector: 'app-cancelar-compra', | |
8 | + templateUrl: './cancelar-compra.component.html', | |
9 | + styleUrls: ['./cancelar-compra.component.scss'] | |
10 | +}) | |
11 | +export class CancelarCompraComponent implements OnInit { | |
12 | + | |
13 | + constructor( | |
14 | + private location: Location, | |
15 | + private router: Router, | |
16 | + private articuloService: ArticuloService | |
17 | + ) { } | |
18 | + | |
19 | + ngOnInit() { | |
20 | + setTimeout(() => { | |
21 | + this.limpiarCarritoYvolver(); | |
22 | + }, 90000); | |
23 | + } | |
24 | + | |
25 | + volverPreviousPage() { | |
26 | + this.location.back(); | |
27 | + } | |
28 | + | |
29 | + limpiarCarritoYvolver() { | |
30 | + this.articuloService.carrito = undefined; | |
31 | + this.router.navigate(['/']); | |
32 | + } | |
33 | +} |
src/app/modules/cancelar-compra/cancelar-compra.module.ts
... | ... | @@ -0,0 +1,15 @@ |
1 | +import { NgModule } from '@angular/core'; | |
2 | +import { CommonModule } from '@angular/common'; | |
3 | + | |
4 | +import { CancelarCompraRoutingModule } from './cancelar-compra-routing.module'; | |
5 | +import { CancelarCompraComponent } from './cancelar-compra.component'; | |
6 | + | |
7 | + | |
8 | +@NgModule({ | |
9 | + declarations: [CancelarCompraComponent], | |
10 | + imports: [ | |
11 | + CommonModule, | |
12 | + CancelarCompraRoutingModule | |
13 | + ] | |
14 | +}) | |
15 | +export class CancelarCompraModule { } |
src/app/modules/carrito/carrito.component.html
... | ... | @@ -121,6 +121,13 @@ |
121 | 121 | </div> |
122 | 122 | </div> |
123 | 123 | </div> |
124 | + <!-- TOTAL --> | |
125 | + <div class="row mx-3 mt-2 h-auto justify-content-end"> | |
126 | + <div class="col-auto align-self-center text-primary"><small>TOTAL</small></div> | |
127 | + <div class="col-auto p-0 bg-primary d-none d-sm-block bg-total"> | |
128 | + <p class="text-center text-white mt-1 py-1">{{articuloService.subTotal | currency}}</p> | |
129 | + </div> | |
130 | + </div> | |
124 | 131 | <!-- CONTINUAR --> |
125 | 132 | <div |
126 | 133 | *ngIf="articuloService.carrito.length" |
... | ... | @@ -140,7 +147,7 @@ |
140 | 147 | </div> |
141 | 148 | </div> |
142 | 149 | <!-- SEGUIR COMPRANDO --> |
143 | - <div class="row mx-3 mt-2 h-auto justify-content-end"> | |
150 | + <!-- <div class="row mx-3 mt-2 h-auto justify-content-end"> | |
144 | 151 | <div |
145 | 152 | class="col-auto py-2 px-3 align-self-center btn-effect bg-primary badge-pill text-white" |
146 | 153 | (click)="goBack()"> |
... | ... | @@ -154,7 +161,7 @@ |
154 | 161 | src="assets/img/ir.svg"> |
155 | 162 | </span> |
156 | 163 | </div> |
157 | - </div> | |
164 | + </div> --> | |
158 | 165 | </div> |
159 | 166 | |
160 | 167 | </div> |
src/app/modules/carrito/carrito.component.scss
src/app/modules/comanda/comanda.component.ts
... | ... | @@ -52,7 +52,7 @@ export class ComandaComponent implements OnInit { |
52 | 52 | } |
53 | 53 | |
54 | 54 | updateComanda(comanda: IComanda, estadoNuevo: number, observacionNueva: string) { |
55 | - let data = { | |
55 | + const data = { | |
56 | 56 | idComanda: comanda.id, |
57 | 57 | estado: estadoNuevo, |
58 | 58 | observacion: observacionNueva, |
src/app/modules/seleccion-articulos/seleccion-articulos.component.html
... | ... | @@ -201,7 +201,7 @@ |
201 | 201 | [routerLink]="['/carrito']"> |
202 | 202 | <div class="row justify-content-between mx-0"> |
203 | 203 | <div class="col-auto align-self-center text-primary">TOTAL</div> |
204 | - <div class="col-auto p-0 bg-primary d-none d-sm-block total-background"> | |
204 | + <div class="col-auto p-0 bg-primary d-none d-sm-block bg-total"> | |
205 | 205 | <p class="text-center text-white mt-1 py-1">{{articuloService.subTotal | currency}}</p> |
206 | 206 | </div> |
207 | 207 | <div class="col-auto align-self-center text-primary ml-2 bg-light">VER CARRITO</div> |
src/app/modules/seleccion-articulos/seleccion-articulos.component.scss
src/app/services/articulo/articulo.service.ts
src/assets/img/icono-cancelar-color.svg
... | ... | @@ -0,0 +1,19 @@ |
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> | |
3 | +<!-- Creator: CorelDRAW X7 --> | |
4 | +<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="19.8306mm" height="19.8306mm" version="1.1" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd" | |
5 | +viewBox="0 0 1652 1652" | |
6 | + xmlns:xlink="http://www.w3.org/1999/xlink"> | |
7 | + <defs> | |
8 | + <style type="text/css"> | |
9 | + <![CDATA[ | |
10 | + .fil0 {fill:#AA006B;fill-rule:nonzero} | |
11 | + ]]> | |
12 | + </style> | |
13 | + </defs> | |
14 | + <g id="Capa_x0020_1"> | |
15 | + <metadata id="CorelCorpID_0Corel-Layer"/> | |
16 | + <polygon class="fil0" points="494,409 826,766 1158,409 1214,457 882,826 1214,1196 1158,1244 826,886 494,1244 439,1196 770,826 439,457 "/> | |
17 | + <path class="fil0" d="M1360 292c-136,-137 -325,-221 -534,-221 -208,0 -397,84 -534,221 -137,137 -221,326 -221,534 0,209 84,398 221,534 137,137 326,222 534,222 209,0 398,-85 534,-222 137,-136 222,-325 222,-534 0,-208 -85,-397 -222,-534zm-534 -292c228,0 435,92 584,242 150,149 242,356 242,584 0,228 -92,435 -242,584 -149,150 -356,242 -584,242 -228,0 -435,-92 -584,-242 -150,-149 -242,-356 -242,-584 0,-228 92,-435 242,-584 149,-150 356,-242 584,-242z"/> | |
18 | + </g> | |
19 | +</svg> |