Commit 7ba68592a5ea99ab0e7101df1a9ce4fa30cea675
1 parent
401229e99a
Exists in
master
and in
2 other branches
Creado componente carrito
Showing
17 changed files
with
196 additions
and
8 deletions
Show diff stats
src/app/app-routing.module.ts
... | ... | @@ -21,6 +21,10 @@ const routes: Routes = [ |
21 | 21 | path: 'seleccion-articulos', |
22 | 22 | loadChildren: () => import('./modules/seleccion-articulos/seleccion-articulos.module').then(m => m.SeleccionArticulosModule) |
23 | 23 | }, |
24 | + { | |
25 | + path: 'carrito', | |
26 | + loadChildren: () => import('./modules/carrito/carrito.module').then(m => m.CarritoModule) | |
27 | + }, | |
24 | 28 | ] |
25 | 29 | }, |
26 | 30 | { path: '**', redirectTo: '', pathMatch: 'full' }, |
src/app/modules/carrito/carrito-routing.module.ts
... | ... | @@ -0,0 +1,13 @@ |
1 | +import { NgModule } from '@angular/core'; | |
2 | +import { Routes, RouterModule } from '@angular/router'; | |
3 | +import { CarritoComponent } from './carrito.component'; | |
4 | + | |
5 | +const routes: Routes = [ | |
6 | + { path: '', component: CarritoComponent } | |
7 | +]; | |
8 | + | |
9 | +@NgModule({ | |
10 | + imports: [RouterModule.forChild(routes)], | |
11 | + exports: [RouterModule] | |
12 | +}) | |
13 | +export class CarritoRoutingModule { } |
src/app/modules/carrito/carrito.component.html
src/app/modules/carrito/carrito.component.scss
src/app/modules/carrito/carrito.component.spec.ts
... | ... | @@ -0,0 +1,25 @@ |
1 | +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | |
2 | + | |
3 | +import { CarritoComponent } from './carrito.component'; | |
4 | + | |
5 | +describe('CarritoComponent', () => { | |
6 | + let component: CarritoComponent; | |
7 | + let fixture: ComponentFixture<CarritoComponent>; | |
8 | + | |
9 | + beforeEach(async(() => { | |
10 | + TestBed.configureTestingModule({ | |
11 | + declarations: [ CarritoComponent ] | |
12 | + }) | |
13 | + .compileComponents(); | |
14 | + })); | |
15 | + | |
16 | + beforeEach(() => { | |
17 | + fixture = TestBed.createComponent(CarritoComponent); | |
18 | + component = fixture.componentInstance; | |
19 | + fixture.detectChanges(); | |
20 | + }); | |
21 | + | |
22 | + it('should create', () => { | |
23 | + expect(component).toBeTruthy(); | |
24 | + }); | |
25 | +}); |
src/app/modules/carrito/carrito.component.ts
... | ... | @@ -0,0 +1,15 @@ |
1 | +import { Component, OnInit } from '@angular/core'; | |
2 | + | |
3 | +@Component({ | |
4 | + selector: 'app-carrito', | |
5 | + templateUrl: './carrito.component.html', | |
6 | + styleUrls: ['./carrito.component.scss'] | |
7 | +}) | |
8 | +export class CarritoComponent implements OnInit { | |
9 | + | |
10 | + constructor() { } | |
11 | + | |
12 | + ngOnInit() { | |
13 | + } | |
14 | + | |
15 | +} |
src/app/modules/carrito/carrito.module.ts
... | ... | @@ -0,0 +1,12 @@ |
1 | +import { NgModule } from "@angular/core"; | |
2 | +import { CommonModule } from "@angular/common"; | |
3 | + | |
4 | +import { CarritoRoutingModule } from "./carrito-routing.module"; | |
5 | +import { CarritoComponent } from "./carrito.component"; | |
6 | +import { SeleccionArticulosModule } from '../seleccion-articulos/seleccion-articulos.module'; | |
7 | + | |
8 | +@NgModule({ | |
9 | + declarations: [CarritoComponent], | |
10 | + imports: [CommonModule, CarritoRoutingModule, SeleccionArticulosModule] | |
11 | +}) | |
12 | +export class CarritoModule { } |
src/app/modules/seleccion-articulos/seleccion-articulos.component.html
... | ... | @@ -131,7 +131,9 @@ |
131 | 131 | </div> |
132 | 132 | </div> |
133 | 133 | <div class="col-auto p-0 mt-2 ml-auto h-20"> |
134 | - <div class="btn-effect col-auto align-self-center px-0 bg-white"> | |
134 | + <div | |
135 | + class="btn-effect col-auto align-self-center px-0 bg-white" | |
136 | + [routerLink]="['/carrito']"> | |
135 | 137 | <div class="row mx-0 bg-light"> |
136 | 138 | <div class="col-auto align-self-center text-primary">VER CARRITO</div> |
137 | 139 | <div class="col-auto p-0 bg-primary d-none d-sm-block"> |
src/app/modules/seleccion-articulos/seleccion-articulos.module.ts
1 | -import { NgModule } from "@angular/core"; | |
2 | -import { CommonModule } from "@angular/common"; | |
1 | +import { NgModule } from '@angular/core'; | |
2 | +import { CommonModule } from '@angular/common'; | |
3 | 3 | |
4 | -import { SeleccionArticulosRoutingModule } from "./seleccion-articulos-routing.module"; | |
5 | -import { SeleccionArticulosComponent } from "./seleccion-articulos.component"; | |
6 | -import { HeaderPublicidadComponent } from "src/app/shared/header-publicidad/header-publicidad.component"; | |
4 | +import { SeleccionArticulosRoutingModule } from './seleccion-articulos-routing.module'; | |
5 | +import { SeleccionArticulosComponent } from './seleccion-articulos.component'; | |
6 | +import { HeaderPublicidadComponent } from 'src/app/shared/header-publicidad/header-publicidad.component'; | |
7 | 7 | |
8 | 8 | @NgModule({ |
9 | 9 | declarations: [SeleccionArticulosComponent, HeaderPublicidadComponent], |
10 | - imports: [CommonModule, SeleccionArticulosRoutingModule] | |
10 | + imports: [CommonModule, SeleccionArticulosRoutingModule], | |
11 | + exports: [HeaderPublicidadComponent] | |
11 | 12 | }) |
12 | -export class SeleccionArticulosModule {} | |
13 | +export class SeleccionArticulosModule { } |
src/app/shared/footer/footer.component.html
... | ... | @@ -0,0 +1,20 @@ |
1 | +<div class="row w-90 mx-auto h-100 justify-content-between bg-white"> | |
2 | + <div class="col-auto align-self-center px-0 bg-white"> | |
3 | + <div class="btn-effect row mx-0 bg-light"> | |
4 | + <div class="col-auto align-self-center text-primary">ESTAMOS PARA AYUDARTE</div> | |
5 | + <div class="col-auto p-0 bg-primary d-none d-sm-block"> | |
6 | + <img class="p-2 img-accesibilidad" src="assets/img/iconos-accesibilidad.svg"> | |
7 | + </div> | |
8 | + </div> | |
9 | + </div> | |
10 | + <div | |
11 | + class="btn-effect col-auto align-self-center px-0 bg-white" | |
12 | + (click)="goBack()"> | |
13 | + <div class="row mx-0 bg-light"> | |
14 | + <div class="col-auto align-self-center text-primary">VOLVER</div> | |
15 | + <div class="col-auto p-0 bg-primary d-none d-sm-block"> | |
16 | + <img class="p-2 img-volver" src="assets/img/icono-volver.svg"> | |
17 | + </div> | |
18 | + </div> | |
19 | + </div> | |
20 | +</div> |
src/app/shared/footer/footer.component.scss
src/app/shared/footer/footer.component.spec.ts
... | ... | @@ -0,0 +1,25 @@ |
1 | +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | |
2 | + | |
3 | +import { FooterComponent } from './footer.component'; | |
4 | + | |
5 | +describe('FooterComponent', () => { | |
6 | + let component: FooterComponent; | |
7 | + let fixture: ComponentFixture<FooterComponent>; | |
8 | + | |
9 | + beforeEach(async(() => { | |
10 | + TestBed.configureTestingModule({ | |
11 | + declarations: [ FooterComponent ] | |
12 | + }) | |
13 | + .compileComponents(); | |
14 | + })); | |
15 | + | |
16 | + beforeEach(() => { | |
17 | + fixture = TestBed.createComponent(FooterComponent); | |
18 | + component = fixture.componentInstance; | |
19 | + fixture.detectChanges(); | |
20 | + }); | |
21 | + | |
22 | + it('should create', () => { | |
23 | + expect(component).toBeTruthy(); | |
24 | + }); | |
25 | +}); |
src/app/shared/footer/footer.component.ts
... | ... | @@ -0,0 +1,17 @@ |
1 | +import { Component, OnInit } from "@angular/core"; | |
2 | +import { Location } from "@angular/common"; | |
3 | + | |
4 | +@Component({ | |
5 | + selector: "app-footer", | |
6 | + templateUrl: "./footer.component.html", | |
7 | + styleUrls: ["./footer.component.scss"] | |
8 | +}) | |
9 | +export class FooterComponent implements OnInit { | |
10 | + constructor(private location: Location) {} | |
11 | + | |
12 | + ngOnInit() {} | |
13 | + | |
14 | + goBack() { | |
15 | + this.location.back(); | |
16 | + } | |
17 | +} |
src/app/shared/header-publicidad/header-publicidad.component.html
src/app/shared/header-publicidad/header-publicidad.component.scss
src/app/shared/header-publicidad/header-publicidad.component.spec.ts
... | ... | @@ -0,0 +1,25 @@ |
1 | +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | |
2 | + | |
3 | +import { HeaderPublicidadComponent } from './header-publicidad.component'; | |
4 | + | |
5 | +describe('HeaderPublicidadComponent', () => { | |
6 | + let component: HeaderPublicidadComponent; | |
7 | + let fixture: ComponentFixture<HeaderPublicidadComponent>; | |
8 | + | |
9 | + beforeEach(async(() => { | |
10 | + TestBed.configureTestingModule({ | |
11 | + declarations: [ HeaderPublicidadComponent ] | |
12 | + }) | |
13 | + .compileComponents(); | |
14 | + })); | |
15 | + | |
16 | + beforeEach(() => { | |
17 | + fixture = TestBed.createComponent(HeaderPublicidadComponent); | |
18 | + component = fixture.componentInstance; | |
19 | + fixture.detectChanges(); | |
20 | + }); | |
21 | + | |
22 | + it('should create', () => { | |
23 | + expect(component).toBeTruthy(); | |
24 | + }); | |
25 | +}); |
src/app/shared/header-publicidad/header-publicidad.component.ts
... | ... | @@ -0,0 +1,15 @@ |
1 | +import { Component, OnInit } from '@angular/core'; | |
2 | + | |
3 | +@Component({ | |
4 | + selector: 'app-header-publicidad', | |
5 | + templateUrl: './header-publicidad.component.html', | |
6 | + styleUrls: ['./header-publicidad.component.scss'] | |
7 | +}) | |
8 | +export class HeaderPublicidadComponent implements OnInit { | |
9 | + | |
10 | + constructor() { } | |
11 | + | |
12 | + ngOnInit() { | |
13 | + } | |
14 | + | |
15 | +} |