Commit 5c7b72302be2e60b7ecf2dcaaf2077e350eb9826

Authored by Marcelo Puebla
1 parent 086c124c6f
Exists in develop

Change

Movido modulo cancelar-compra
src/app/app-routing.module.ts
... ... @@ -53,7 +53,7 @@ const routes: Routes = [
53 53 },
54 54 {
55 55 path: 'cancelar-compra',
56   - loadChildren: () => import('./modules/cancelar-compra/cancelar-compra.module').then(m => m.CancelarCompraModule)
  56 + loadChildren: () => import('./shared/cancelar-compra/cancelar-compra.module').then(m => m.CancelarCompraModule)
57 57 },
58 58 { path: '**', redirectTo: '', pathMatch: 'full' },
59 59 ];
src/app/modules/cancelar-compra/cancelar-compra-routing.module.ts
... ... @@ -1,14 +0,0 @@
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
... ... @@ -1,51 +0,0 @@
1   -<div class="row justify-content-center mt-2 h-15">
2   - <img class="h-100 w-auto my-auto" src="../../../assets/img/logo-spot.svg">
3   -</div>
4   -<div class="row mx-auto h-70">
5   - <div class="col-12 align-self-center">
6   - <div class="row mt-5 mx-0 justify-content-around">
7   - <div class="col-12 col-sm-8 col-md-6 col-lg-4">
8   - <div class="p-3 bg-white text-center shadow-lg rounded">
9   - <p class="mt-4 h4">NECESITA</p>
10   - <p class="font-weight-bold text-secondary my-4 h2">más tiempo</p>
11   - <p class="mb-4 h4">PARA SU PEDIDO?</p>
12   - </div>
13   - </div>
14   - </div>
15   - <!-- BUTTONS -->
16   - <div class="row mx-0 mt-5 justify-content-center">
17   - <div class="col-auto px-0 align-self-start">
18   - <div
19   - class="row mx-0 py-1 btn-effect bg-primary badge-pill"
20   - (click)="volverPreviousPage()">
21   - <div class="col-auto align-self-center text-white">continuar compra</div>
22   - <div class="col-auto align-self-center p-0">
23   - <img
24   - draggable="false"
25   - ondragstart="return false;"
26   - (contextmenu)="false"
27   - class="p-1 icon-30"
28   - src="assets/img/ir.svg">
29   - </div>
30   - </div>
31   - </div>
32   - </div>
33   - <div class="row mx-0 mt-4 justify-content-center">
34   - <div class="col-auto px-0 align-self-start">
35   - <div
36   - class="row mx-0 py-1 btn-effect bg-grey badge-pill"
37   - (click)="limpiarCarritoYvolver()">
38   - <div class="col-auto align-self-center">cancelar compra</div>
39   - <div class="col-auto align-self-center p-0">
40   - <img
41   - draggable="false"
42   - ondragstart="return false;"
43   - (contextmenu)="false"
44   - class="p-1 icon-30"
45   - src="assets/img/icono-cancelar-color.svg">
46   - </div>
47   - </div>
48   - </div>
49   - </div>
50   - </div>
51   -</div>
src/app/modules/cancelar-compra/cancelar-compra.component.scss
... ... @@ -1,3 +0,0 @@
1   -.bg-grey {
2   - background-color: rgb(212, 212, 212);
3   -}
src/app/modules/cancelar-compra/cancelar-compra.component.spec.ts
... ... @@ -1,25 +0,0 @@
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
... ... @@ -1,38 +0,0 @@
1   -import { Component, OnInit, OnDestroy } 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, OnDestroy {
12   - timer: any;
13   -
14   - constructor(
15   - private location: Location,
16   - private router: Router,
17   - private articuloService: ArticuloService
18   - ) { }
19   -
20   - ngOnInit() {
21   - this.timer = setTimeout(() => {
22   - this.limpiarCarritoYvolver();
23   - }, 90000);
24   - }
25   -
26   - ngOnDestroy() {
27   - clearTimeout(this.timer);
28   - }
29   -
30   - volverPreviousPage() {
31   - this.location.back();
32   - }
33   -
34   - limpiarCarritoYvolver() {
35   - this.articuloService.carrito = [];
36   - this.router.navigate(['/']);
37   - }
38   -}
src/app/modules/cancelar-compra/cancelar-compra.module.ts
... ... @@ -1,15 +0,0 @@
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/shared/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/shared/cancelar-compra/cancelar-compra.component.html
... ... @@ -0,0 +1,51 @@
  1 +<div class="row justify-content-center mt-2 h-15">
  2 + <img class="h-100 w-auto my-auto" src="../../../assets/img/logo-spot.svg">
  3 +</div>
  4 +<div class="row mx-auto h-70">
  5 + <div class="col-12 align-self-center">
  6 + <div class="row mt-5 mx-0 justify-content-around">
  7 + <div class="col-12 col-sm-8 col-md-6 col-lg-4">
  8 + <div class="p-3 bg-white text-center shadow-lg rounded">
  9 + <p class="mt-4 h4">NECESITA</p>
  10 + <p class="font-weight-bold text-secondary my-4 h2">más tiempo</p>
  11 + <p class="mb-4 h4">PARA SU PEDIDO?</p>
  12 + </div>
  13 + </div>
  14 + </div>
  15 + <!-- BUTTONS -->
  16 + <div class="row mx-0 mt-5 justify-content-center">
  17 + <div class="col-auto px-0 align-self-start">
  18 + <div
  19 + class="row mx-0 py-1 btn-effect bg-primary badge-pill"
  20 + (click)="volverPreviousPage()">
  21 + <div class="col-auto align-self-center text-white">continuar compra</div>
  22 + <div class="col-auto align-self-center p-0">
  23 + <img
  24 + draggable="false"
  25 + ondragstart="return false;"
  26 + (contextmenu)="false"
  27 + class="p-1 icon-30"
  28 + src="assets/img/ir.svg">
  29 + </div>
  30 + </div>
  31 + </div>
  32 + </div>
  33 + <div class="row mx-0 mt-4 justify-content-center">
  34 + <div class="col-auto px-0 align-self-start">
  35 + <div
  36 + class="row mx-0 py-1 btn-effect bg-grey badge-pill"
  37 + (click)="limpiarCarritoYvolver()">
  38 + <div class="col-auto align-self-center">cancelar compra</div>
  39 + <div class="col-auto align-self-center p-0">
  40 + <img
  41 + draggable="false"
  42 + ondragstart="return false;"
  43 + (contextmenu)="false"
  44 + class="p-1 icon-30"
  45 + src="assets/img/icono-cancelar-color.svg">
  46 + </div>
  47 + </div>
  48 + </div>
  49 + </div>
  50 + </div>
  51 +</div>
src/app/shared/cancelar-compra/cancelar-compra.component.scss
... ... @@ -0,0 +1,3 @@
  1 +.bg-grey {
  2 + background-color: rgb(212, 212, 212);
  3 +}
src/app/shared/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/shared/cancelar-compra/cancelar-compra.component.ts
... ... @@ -0,0 +1,38 @@
  1 +import { Component, OnInit, OnDestroy } 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, OnDestroy {
  12 + timer: any;
  13 +
  14 + constructor(
  15 + private location: Location,
  16 + private router: Router,
  17 + private articuloService: ArticuloService
  18 + ) { }
  19 +
  20 + ngOnInit() {
  21 + this.timer = setTimeout(() => {
  22 + this.limpiarCarritoYvolver();
  23 + }, 90000);
  24 + }
  25 +
  26 + ngOnDestroy() {
  27 + clearTimeout(this.timer);
  28 + }
  29 +
  30 + volverPreviousPage() {
  31 + this.location.back();
  32 + }
  33 +
  34 + limpiarCarritoYvolver() {
  35 + this.articuloService.carrito = [];
  36 + this.router.navigate(['/']);
  37 + }
  38 +}
src/app/shared/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 { }