Commit 5aee6bac60ec7cf84999572a91baefc72280ed6e
Exists in
master
and in
1 other branch
Merge branch 'master' into 'master'
Master(efernandez) See merge request !11
Showing
8 changed files
Show diff stats
src/app/app-routing.module.ts
1 | import { NgModule } from '@angular/core'; | 1 | import { NgModule } from '@angular/core'; |
2 | import { Routes, RouterModule } from '@angular/router'; | 2 | import { Routes, RouterModule } from '@angular/router'; |
3 | import { HomeComponent } from './components/home/home.component'; | 3 | import { HomeComponent } from './components/home/home.component'; |
4 | import { InicioComponent } from './components/inicio/inicio.component'; | 4 | import { InicioComponent } from './components/inicio/inicio.component'; |
5 | import { BusquedaProductosComponent } from './components/busqueda-productos/busqueda-productos.component'; | 5 | import { BusquedaProductosComponent } from './components/busqueda-productos/busqueda-productos.component'; |
6 | import { ConfirmacionCarritoComponent } from './components/confirmacion-carrito/confirmacion-carrito.component'; | ||
6 | 7 | ||
7 | const routes: Routes = [ | 8 | const routes: Routes = [ |
8 | { path: 'home', component: HomeComponent }, | 9 | { path: 'home', component: HomeComponent }, |
9 | { path: 'inicio', component: InicioComponent }, | 10 | { path: 'inicio', component: InicioComponent }, |
10 | { path: 'busqueda-productos', component: BusquedaProductosComponent }, | 11 | { path: 'busqueda-productos', component: BusquedaProductosComponent }, |
12 | { path: 'confirmacion-carrito', component: ConfirmacionCarritoComponent }, | ||
11 | { path: '**', redirectTo: '/home', pathMatch: 'full' }, | 13 | { path: '**', redirectTo: '/home', pathMatch: 'full' }, |
12 | ]; | 14 | ]; |
13 | 15 | ||
14 | @NgModule({ | 16 | @NgModule({ |
15 | imports: [RouterModule.forRoot(routes)], | 17 | imports: [RouterModule.forRoot(routes)], |
16 | exports: [RouterModule] | 18 | exports: [RouterModule] |
17 | }) | 19 | }) |
20 | |||
18 | export class AppRoutingModule { } | 21 | export class AppRoutingModule { } |
19 | 22 |
src/app/app.module.ts
1 | //#region MODULES | 1 | //#region MODULES |
2 | import { BrowserModule } from '@angular/platform-browser'; | 2 | import { BrowserModule } from '@angular/platform-browser'; |
3 | import { NgModule } from '@angular/core'; | 3 | import { NgModule } from '@angular/core'; |
4 | import { AppRoutingModule } from './app-routing.module'; | 4 | import { AppRoutingModule } from './app-routing.module'; |
5 | import { HttpClientModule } from '@angular/common/http'; | 5 | import { HttpClientModule } from '@angular/common/http'; |
6 | //#endregion | 6 | //#endregion |
7 | 7 | ||
8 | //#region COMPONENTS | 8 | //#region COMPONENTS |
9 | import { AppComponent } from './app.component'; | 9 | import { AppComponent } from './app.component'; |
10 | import { HeaderComponent } from './components/header/header.component'; | 10 | import { HeaderComponent } from './components/header/header.component'; |
11 | import { SidebarComponent } from './components/sidebar/sidebar.component'; | 11 | import { SidebarComponent } from './components/sidebar/sidebar.component'; |
12 | import { CarouselComponent } from './components/carousel/carousel.component'; | 12 | import { CarouselComponent } from './components/carousel/carousel.component'; |
13 | import { HomeComponent } from './components/home/home.component'; | 13 | import { HomeComponent } from './components/home/home.component'; |
14 | import { InicioComponent } from './components/inicio/inicio.component'; | 14 | import { InicioComponent } from './components/inicio/inicio.component'; |
15 | import { BusquedaProductosComponent } from './components/busqueda-productos/busqueda-productos.component'; | 15 | import { BusquedaProductosComponent } from './components/busqueda-productos/busqueda-productos.component'; |
16 | import { ConfirmacionCarritoComponent } from './components/confirmacion-carrito/confirmacion-carrito.component'; | ||
16 | //#endregion | 17 | //#endregion |
17 | 18 | ||
18 | @NgModule({ | 19 | @NgModule({ |
19 | declarations: [ | 20 | declarations: [ |
20 | AppComponent, | 21 | AppComponent, |
21 | HeaderComponent, | 22 | HeaderComponent, |
22 | SidebarComponent, | 23 | SidebarComponent, |
23 | CarouselComponent, | 24 | CarouselComponent, |
24 | HomeComponent, | 25 | HomeComponent, |
25 | InicioComponent, | 26 | InicioComponent, |
26 | BusquedaProductosComponent | 27 | BusquedaProductosComponent, |
28 | ConfirmacionCarritoComponent | ||
27 | ], | 29 | ], |
28 | imports: [ | 30 | imports: [ |
29 | BrowserModule, | 31 | BrowserModule, |
30 | AppRoutingModule, | 32 | AppRoutingModule, |
31 | HttpClientModule | 33 | HttpClientModule |
32 | ], | 34 | ], |
33 | providers: [], | 35 | providers: [], |
34 | bootstrap: [AppComponent] | 36 | bootstrap: [AppComponent] |
35 | }) | 37 | }) |
36 | export class AppModule { } | 38 | export class AppModule { } |
37 | 39 |
src/app/components/confirmacion-carrito/confirmacion-carrito.component.html
File was created | 1 | <app-header></app-header> | |
2 | <div class="row"> | ||
3 | <div class="col-10"> | ||
4 | |||
5 | <!-- NOMBRE DE SECCION --> | ||
6 | <div class="row m-0"> | ||
7 | <div class="col-12 p-0"> | ||
8 | <p class="h5 py-1 bg-light text-muted text-center">Pago <i class="fa fa-usd"></i></p> | ||
9 | </div> | ||
10 | </div> | ||
11 | |||
12 | <div class="row m-4 d-flex align-items-center"> | ||
13 | <div class="col-4"> | ||
14 | <h1>Mi Compra <i class="fa fa-shopping-cart "></i></h1> | ||
15 | </div> | ||
16 | <div class="col-8"> | ||
17 | <h2>¿Desea finalizar su compra?</h2> | ||
18 | <h3>Por favor, controle y confirme su compra.</h3> | ||
19 | </div> | ||
20 | <div class="col-sm-7"> | ||
21 | |||
22 | <div class="row pr-3 vh-50 overflow-scroll"> | ||
23 | <div | ||
24 | class="col-4 p-2" | ||
25 | *ngFor="let producto of productos"> | ||
26 | <div class="card card-effect bg-white rounded-sm shadow border-0"> | ||
27 | <img src="../../../assets/img/descarga.jpg" class="card-img-top w-75 m-auto"> | ||
28 | <div class="card-body"> | ||
29 | <p class="h5 text-left m-0">{{producto.variable}}</p> | ||
30 | <div class="text-left"> | ||
31 | <p class="m-0"><small>ASDASDSADASDSA</small></p> | ||
32 | <p class="m-0"><small>COD. 1222</small></p> | ||
33 | <p class="m-0"><strong>$ 563</strong></p> | ||
34 | </div> | ||
35 | </div> | ||
36 | </div> | ||
37 | </div> | ||
38 | </div> | ||
39 | </div> | ||
40 | <div class="col-sm-5"> | ||
41 | <h3>TOTAL: $553</h3> | ||
42 | </div> | ||
43 | </div> | ||
44 | |||
45 | <!-- SIDEBAR --> | ||
46 | </div> | ||
47 | <app-sidebar class="col-3 col-md-2 vh-100 bg-dark text-white"></app-sidebar> | ||
48 | </div> | ||
49 |
src/app/components/confirmacion-carrito/confirmacion-carrito.component.scss
src/app/components/confirmacion-carrito/confirmacion-carrito.component.spec.ts
File was created | 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | |
2 | |||
3 | import { ConfirmacionCarritoComponent } from './confirmacion-carrito.component'; | ||
4 | |||
5 | describe('ConfirmacionCarritoComponent', () => { | ||
6 | let component: ConfirmacionCarritoComponent; | ||
7 | let fixture: ComponentFixture<ConfirmacionCarritoComponent>; | ||
8 | |||
9 | beforeEach(async(() => { | ||
10 | TestBed.configureTestingModule({ | ||
11 | declarations: [ ConfirmacionCarritoComponent ] | ||
12 | }) | ||
13 | .compileComponents(); | ||
14 | })); | ||
15 | |||
16 | beforeEach(() => { | ||
17 | fixture = TestBed.createComponent(ConfirmacionCarritoComponent); | ||
18 | component = fixture.componentInstance; | ||
19 | fixture.detectChanges(); | ||
20 | }); | ||
21 | |||
22 | it('should create', () => { | ||
23 | expect(component).toBeTruthy(); | ||
24 | }); | ||
25 | }); | ||
26 |
src/app/components/confirmacion-carrito/confirmacion-carrito.component.ts
File was created | 1 | import { Component, OnInit } from '@angular/core'; | |
2 | |||
3 | @Component({ | ||
4 | selector: 'app-confirmacion-carrito', | ||
5 | templateUrl: './confirmacion-carrito.component.html', | ||
6 | styleUrls: ['./confirmacion-carrito.component.scss'] | ||
7 | }) | ||
8 | export class ConfirmacionCarritoComponent implements OnInit { | ||
9 | |||
10 | productos = [{}, {}, {}] | ||
11 | constructor() { } | ||
12 | |||
13 | ngOnInit() { | ||
14 | } | ||
15 | |||
16 | } | ||
17 |
src/app/components/inicio/inicio.component.html
1 | <div class="row m-0 fade-in"> | 1 | <div class="row m-0 fade-in"> |
2 | <div class="col-10 p-0"> | 2 | <div class="col-10 p-0"> |
3 | <!-- TOP HEADER --> | 3 | <!-- TOP HEADER --> |
4 | <app-header></app-header> | 4 | <app-header></app-header> |
5 | 5 | ||
6 | <!-- NOMBRE DE SECCION --> | 6 | <!-- NOMBRE DE SECCION --> |
7 | <div class="row m-0"> | 7 | <div class="row m-0"> |
8 | <div class="col-12 p-0"> | 8 | <div class="col-12 p-0"> |
9 | <p class="h5 py-1 bg-light text-muted text-center">Inicio</p> | 9 | <p class="h5 py-1 bg-light text-muted text-center">Inicio</p> |
10 | </div> | 10 | </div> |
11 | </div> | 11 | </div> |
12 | 12 | ||
13 | <div class="row m-4 d-flex align-items-center disable-user-select"> | 13 | <div class="row m-4 d-flex align-items-center disable-user-select"> |
14 | <div class="col-md-5 d-flex align-items-end flex-column"> | 14 | <div class="col-md-5 d-flex align-items-end flex-column"> |
15 | 15 | ||
16 | <!-- PROMOCIONES --> | 16 | <!-- PROMOCIONES --> |
17 | <div class="card card-effect bg-white border-0 shadow rounded w-100 mb-auto"> | 17 | <div class="card card-effect bg-white border-0 shadow rounded w-100 mb-auto"> |
18 | <div class="card-body text-left p-4"> | 18 | <div class="card-body text-left p-4"> |
19 | <p class="h3 card-title">Promociones</p> | 19 | <p class="h3 card-title">Promociones</p> |
20 | <p class="h5 card-text text-muted font-weight-light">Conozca las ofertas del momento.</p> | 20 | <p class="h5 card-text text-muted font-weight-light">Conozca las ofertas del momento.</p> |
21 | </div> | 21 | </div> |
22 | <div id="carouselIndicators" class="carousel slide mb-4" data-ride="carousel"> | 22 | <div id="carouselIndicators" class="carousel slide mb-4" data-ride="carousel"> |
23 | <ol class="carousel-indicators m-0"> | 23 | <ol class="carousel-indicators m-0"> |
24 | <li data-target="#carouselIndicators" data-slide-to="0" class="bg-dark active"></li> | 24 | <li data-target="#carouselIndicators" data-slide-to="0" class="bg-dark active"></li> |
25 | <li data-target="#carouselIndicators" data-slide-to="1" class="bg-dark"></li> | 25 | <li data-target="#carouselIndicators" data-slide-to="1" class="bg-dark"></li> |
26 | <li data-target="#carouselIndicators" data-slide-to="2" class="bg-dark"></li> | 26 | <li data-target="#carouselIndicators" data-slide-to="2" class="bg-dark"></li> |
27 | </ol> | 27 | </ol> |
28 | <div class="carousel-inner"> | 28 | <div class="carousel-inner"> |
29 | <div class="carousel-item active"> | 29 | <div class="carousel-item active"> |
30 | <img src="../../assets/img/descarga.jpg" class="d-block w-50 m-auto rounded" alt="..."> | 30 | <img src="../../assets/img/descarga.jpg" class="d-block w-50 m-auto rounded" alt="..."> |
31 | </div> | 31 | </div> |
32 | <div class="carousel-item"> | 32 | <div class="carousel-item"> |
33 | <img src="../../assets/img/descarga.jpg" class="d-block w-50 m-auto rounded" alt="..."> | 33 | <img src="../../assets/img/descarga.jpg" class="d-block w-50 m-auto rounded" alt="..."> |
34 | </div> | 34 | </div> |
35 | <div class="carousel-item"> | 35 | <div class="carousel-item"> |
36 | <img src="../../assets/img/descarga.jpg" class="d-block w-50 m-auto rounded" alt="..."> | 36 | <img src="../../assets/img/descarga.jpg" class="d-block w-50 m-auto rounded" alt="..."> |
37 | </div> | 37 | </div> |
38 | </div> | 38 | </div> |
39 | </div> | 39 | </div> |
40 | </div> | 40 | </div> |
41 | 41 | ||
42 | <!-- ORDENAR --> | 42 | <!-- ORDENAR --> |
43 | <div class="card card-effect bg-white border-0 shadow rounded w-100 mt-4"> | 43 | <div class="card card-effect bg-white border-0 shadow rounded w-100 mt-4"> |
44 | <div class="card-body text-left p-4"> | 44 | <div class="card-body text-left p-4"> |
45 | <p class="h3 card-title">Ordenar</p> | 45 | <p class="h3 card-title">Ordenar</p> |
46 | <p class="h5 card-text text-muted font-weight-light">Arme su pedido y solo pase a retirar.</p> | 46 | <p class="h5 card-text text-muted font-weight-light">Arme su pedido y solo pase a retirar.</p> |
47 | </div> | 47 | </div> |
48 | <img class="card-img-bottom d-block w-50 mx-auto mb-4 rounded" src="../../assets/img/descarga.jpg"> | 48 | <img class="card-img-bottom d-block w-50 mx-auto mb-4 rounded" src="../../assets/img/descarga.jpg"> |
49 | </div> | 49 | </div> |
50 | 50 | ||
51 | </div> | 51 | </div> |
52 | 52 | ||
53 | <div class="col-md-7 d-flex align-items-end flex-column"> | 53 | <div class="col-md-7 d-flex align-items-end flex-column"> |
54 | 54 | ||
55 | <!-- CARGAR PRODUCTOS --> | 55 | <!-- CARGAR PRODUCTOS --> |
56 | <div class="card card-effect bg-white border-0 shadow rounded w-100 mb-auto"> | 56 | <div class="card card-effect bg-white border-0 shadow rounded w-100 mb-auto"> |
57 | <div class="card-body text-left p-4"> | 57 | <div class="card-body text-left p-4"> |
58 | <p class="h3 card-title">Cargar Productos</p> | 58 | <p class="h3 card-title">Cargar Productos</p> |
59 | <p class="h5 card-text text-muted font-weight-light"> | 59 | <p class="h5 card-text text-muted font-weight-light"> |
60 | Coloque el código de<br> | 60 | Coloque el código de<br> |
61 | barras o QR frente al scanner. | 61 | barras o QR frente al scanner. |
62 | </p> | 62 | </p> |
63 | </div> | 63 | </div> |
64 | <div class="card bg-white border-0 w-75 mx-auto mb-4"> | 64 | <div class="card bg-white border-0 w-75 mx-auto mb-4"> |
65 | <img class="card-img-top d-block w-50 mx-auto rounded" src="../../assets/img/descarga.jpg"> | 65 | <img class="card-img-top d-block w-50 mx-auto rounded" src="../../assets/img/descarga.jpg"> |
66 | <div class="card-body text-left p-2"> | 66 | <div class="card-body text-left p-2"> |
67 | <p class="m-0 card-text text-muted">Galletas Oreo x117 grs Chocolate.</p> | 67 | <p class="m-0 card-text text-muted">Galletas Oreo x117 grs Chocolate.</p> |
68 | <p class="m-0 card-text text-muted">COD. 12121222</p> | 68 | <p class="m-0 card-text text-muted">COD. 12121222</p> |
69 | </div> | 69 | </div> |
70 | </div> | 70 | </div> |
71 | </div> | 71 | </div> |
72 | 72 | ||
73 | <!-- BUSCAR PRODUCTOS --> | 73 | <!-- BUSCAR PRODUCTOS --> |
74 | <div | 74 | <div |
75 | (click)="goPage('busqueda-productos')" | 75 | (click)="goPage('busqueda-productos')" |
76 | class="card card-effect bg-white border-0 shadow rounded w-100 mt-4"> | 76 | class="card card-effect bg-white border-0 shadow rounded w-100 mt-4"> |
77 | <div class="card-body text-left p-4"> | 77 | <div class="card-body text-left p-4"> |
78 | <p class="h3 card-title">Buscar Productos</p> | 78 | <p class="h3 card-title">Buscar Productos</p> |
79 | <p class="h5 card-text text-muted font-weight-light"> | 79 | <p class="h5 card-text text-muted font-weight-light"> |
80 | Busque aquí los productos<br> | 80 | Busque aquí los productos<br> |
81 | que no tienen código | 81 | que no tienen código |
82 | </p> | 82 | </p> |
83 | </div> | 83 | </div> |
84 | </div> | 84 | </div> |
85 | 85 | ||
86 | </div> | 86 | </div> |
87 | 87 | ||
88 | </div> | 88 | </div> |
89 | 89 | ||
90 | </div> | 90 | </div> |
91 | 91 | ||
92 | <!-- SIDEBAR --> | 92 | <!-- SIDEBAR --> |
93 | <app-sidebar class="col-3 col-md-2 vh-100 bg-dark text-white"></app-sidebar> | 93 | <app-sidebar class="col-3 col-md-2 vh-100 bg-dark text-white"></app-sidebar> |
94 | </div> | ||
94 | </div> |
src/app/components/sidebar/sidebar.component.html
1 | <div class="d-flex align-items-center flex-column h-100 bg-dark pt-2 text-center"> | 1 | <div class="d-flex align-items-center flex-column h-100 bg-dark pt-2 text-center"> |
2 | 2 | ||
3 | <h4 class="border-bottom border-white"> Mi compra </h4> | 3 | <h4 class="border-bottom border-white"> Mi compra </h4> |
4 | <div class="overflow-auto mb-2"> | 4 | <div class="overflow-auto mb-2"> |
5 | <div class="card my-2 bg-primary border-0" *ngFor="let prod of productos; let i = index"> | 5 | <div class="card my-2 bg-primary border-0" *ngFor="let prod of productos; let i = index"> |
6 | <img src="{{prod.img}}" class="card-img-top" alt="..."> | 6 | <img src="{{prod.img}}" class="card-img-top" alt="..."> |
7 | <div class="card-body row m-0 p-0 px-1 py-1 shadow rounded"> | 7 | <div class="card-body row m-0 p-0 px-1 py-1 shadow rounded"> |
8 | <div class="col-8 p-0 text-left my-auto"> | 8 | <div class="col-8 p-0 text-left my-auto"> |
9 | <p class="m-0 card-description">{{prod.desc}}</p> | 9 | <p class="m-0 card-description">{{prod.desc}}</p> |
10 | <p class="m-0 card-description">COD: {{prod.cod}}</p> | 10 | <p class="m-0 card-description">COD: {{prod.cod}}</p> |
11 | </div> | 11 | </div> |
12 | <div class="col-4 p-1 text-center my-auto"> | 12 | <div class="col-4 p-1 text-center my-auto"> |
13 | {{prod.precio | currency}} | 13 | {{prod.precio | currency}} |
14 | </div> | 14 | </div> |
15 | </div> | 15 | </div> |
16 | <div class="row m-0 p-0"> | 16 | <div class="row m-0 p-0"> |
17 | <div class="col p-1 pb-1 mt-2"> | 17 | <div class="col p-1 pb-1 mt-2"> |
18 | <button type="button" class="btn btn-light btn-sm float-left my-auto" (click)="deleteProducto(i)">X</button> | 18 | <button type="button" class="btn btn-light btn-sm float-left my-auto" (click)="deleteProducto(i)">X</button> |
19 | <button type="button" class="btn btn-light btn-sm my-auto">Y</button> | 19 | <button type="button" class="btn btn-light btn-sm my-auto">Y</button> |
20 | <div class="btn-group-sm btn-group float-right my-auto" role="group" aria-label="Basic example"> | 20 | <div class="btn-group-sm btn-group float-right my-auto" role="group" aria-label="Basic example"> |
21 | <button type="button" class="btn btn-light btn-sm mb-2" (click)="aumentarContador(i)">+</button> | 21 | <button type="button" class="btn btn-light btn-sm mb-2" (click)="aumentarContador(i)">+</button> |
22 | <label for="" class="border border.white px-1">{{prod.cantidad}}</label> | 22 | <label for="" class="border border.white px-1">{{prod.cantidad}}</label> |
23 | <button type="button" class="btn btn-light btn-sm mb-2" (click)="decrementarContador(i)">-</button> | 23 | <button type="button" class="btn btn-light btn-sm mb-2" (click)="decrementarContador(i)">-</button> |
24 | </div> | 24 | </div> |
25 | </div> | 25 | </div> |
26 | </div> | 26 | </div> |
27 | </div> | 27 | </div> |
28 | </div> | 28 | </div> |
29 | 29 | ||
30 | <div class="card mt-auto blue-gradient border-0"> | 30 | <div class="card mt-auto blue-gradient border-0"> |
31 | <div class="card-body row"> | 31 | <div class="card-body row"> |
32 | <div class="col"> | 32 | <div class="col"> |
33 | <h4 class="border-bottom border-secondary text-secondary" *ngIf="cont === 1">({{cont}}) item</h4> | 33 | <h4 class="border-bottom border-secondary text-secondary" *ngIf="cont === 1">({{cont}}) item</h4> |
34 | <h4 class="border-bottom border-secondary text-secondary" *ngIf="cont > 1">({{cont}}) items</h4> | 34 | <h4 class="border-bottom border-secondary text-secondary" *ngIf="cont > 1">({{cont}}) items</h4> |
35 | <h3 class="text-secondary">Total</h3> | 35 | <h3 class="text-secondary">Total</h3> |
36 | <h3 class="text-dark"><strong>{{total | currency}}</strong></h3> | 36 | <h3 class="text-dark"><strong>{{total | currency}}</strong></h3> |
37 | </div> | 37 | </div> |
38 | <div class="col 12 p-0"> | 38 | <div class="col 12 p-0"> |
39 | <button type="button" class="btn btn-light shadow mb-2"><strong>Finalizar y pagar</strong></button> | 39 | <button type="button" class="btn btn-light shadow mb-2" routerLink="/confirmacion-carrito"><strong>Finalizar y pagar</strong></button> |
40 | <button type="button" class="btn btn-light shadow btn-sm" (click)="clearCar()">Cancelar</button> | 40 | <button type="button" class="btn btn-light shadow btn-sm" (click)="clearCar()">Cancelar</button> |
41 | </div> | 41 | </div> |
42 | </div> | 42 | </div> |
43 | </div> | 43 | </div> |