Commit e3899772c182228c834d87e6fca33fdb5007f851
Exists in
master
and in
1 other branch
Merge branch 'master' into 'master'
Master(mpuebla) See merge request !24
Showing
23 changed files
Show diff stats
src/app/app.module.ts
... | ... | @@ -18,7 +18,8 @@ import { InicioComponent } from './components/inicio/inicio.component'; |
18 | 18 | import { BusquedaProductosComponent } from './components/busqueda-productos/busqueda-productos.component'; |
19 | 19 | import { ConfirmacionCarritoComponent } from './components/confirmacion-carrito/confirmacion-carrito.component'; |
20 | 20 | import { MasterComponent } from './components/master/master.component'; |
21 | -import { PopoverComponent } from './components/popover/popover.component'; | |
21 | +import { PopoverPromosComponent } from './components/popover-promos/popover-promos.component'; | |
22 | +import { PopoverSinonimosComponent } from './components/popover-sinonimos/popover-sinonimos.component'; | |
22 | 23 | import { AmbImagenesComponent } from './components/amb-imagenes/amb-imagenes.component'; |
23 | 24 | //#endregion |
24 | 25 | |
... | ... | @@ -33,7 +34,8 @@ import { AmbImagenesComponent } from './components/amb-imagenes/amb-imagenes.com |
33 | 34 | BusquedaProductosComponent, |
34 | 35 | ConfirmacionCarritoComponent, |
35 | 36 | MasterComponent, |
36 | - PopoverComponent, | |
37 | + PopoverPromosComponent, | |
38 | + PopoverSinonimosComponent, | |
37 | 39 | AmbImagenesComponent |
38 | 40 | ], |
39 | 41 | imports: [ |
src/app/components/busqueda-productos/busqueda-productos.component.html
... | ... | @@ -96,7 +96,7 @@ |
96 | 96 | <div |
97 | 97 | class="card-effect bg-white rounded-sm shadow border-0" |
98 | 98 | (click)="mostrarBotonCargar(producto)"> |
99 | - <img src="{{apiUrl}}/imagenes/cafe.jpg" class="rounded-sm w-100 m-auto"> | |
99 | + <img src="{{apiUrl}}/imagenes/testImg.jpg" class="rounded-sm w-100 m-auto"> | |
100 | 100 | <div class="p-2"> |
101 | 101 | <p class="h6 text-left m-0">{{producto.DetArt}}</p> |
102 | 102 | <div class="row justify-content-between m-0"> |
src/app/components/inicio/inicio.component.html
... | ... | @@ -27,13 +27,13 @@ |
27 | 27 | <div id="carouselIndicators" class="carousel slide" data-ride="carousel"> |
28 | 28 | <div class="carousel-inner"> |
29 | 29 | <div class="carousel-item active"> |
30 | - <img src="{{apiUrl}}/imagenes/cafe.jpg" class="d-block w-100 m-auto rounded"> | |
30 | + <img src="{{apiUrl}}/imagenes/testImg3.jpg" class="d-block w-100 m-auto rounded"> | |
31 | 31 | </div> |
32 | 32 | <div class="carousel-item"> |
33 | - <img src="{{apiUrl}}/imagenes/cafe.jpg" class="d-block w-100 m-auto rounded"> | |
33 | + <img src="{{apiUrl}}/imagenes/testImg3.jpg" class="d-block w-100 m-auto rounded"> | |
34 | 34 | </div> |
35 | 35 | <div class="carousel-item"> |
36 | - <img src="{{apiUrl}}/imagenes/cafe.jpg" class="d-block w-100 m-auto rounded"> | |
36 | + <img src="{{apiUrl}}/imagenes/testImg3.jpg" class="d-block w-100 m-auto rounded"> | |
37 | 37 | </div> |
38 | 38 | </div> |
39 | 39 | </div> |
... | ... | @@ -44,7 +44,7 @@ |
44 | 44 | <div class="card-body text-left px-4 py-3"> |
45 | 45 | <div class="row"> |
46 | 46 | <div class="col-5"> |
47 | - <p class="h3 card-title">Ordenar</p> | |
47 | + <p class="h3 card-title">Ordenar Pedido</p> | |
48 | 48 | </div> |
49 | 49 | <div class="col-7 p-0"> |
50 | 50 | <img src="{{apiUrl}}/imagenes/primario.ordenar.png" class="icon-dim"> |
... | ... | @@ -62,11 +62,19 @@ |
62 | 62 | |
63 | 63 | <!-- CARGAR PRODUCTOS --> |
64 | 64 | <ng-template #popTemplate> |
65 | - <app-popover | |
65 | + <app-popover-promos | |
66 | + *ngIf="productoAcargar && !productoEsPromo" | |
66 | 67 | [popover]="popoverDirective" |
67 | - [popoverContent]="popoverContent" | |
68 | - class="fade-in text-white rounded-sm border-0"> | |
69 | - </app-popover> | |
68 | + [popoverContent]="promociones" | |
69 | + (promoSeleccionada)="promoSeleccionada($event)" | |
70 | + class="text-white rounded-sm border-0"> | |
71 | + </app-popover-promos> | |
72 | + <app-popover-sinonimos | |
73 | + *ngIf="promoAcargar && productoEsPromo" | |
74 | + [popover]="popoverDirective" | |
75 | + [popoverContent]="sinonimos" | |
76 | + class="text-white rounded-sm border-0"> | |
77 | + </app-popover-sinonimos> | |
70 | 78 | </ng-template> |
71 | 79 | <div |
72 | 80 | placement="left" |
... | ... | @@ -91,32 +99,51 @@ |
91 | 99 | </div> |
92 | 100 | <div class="row m-4"> |
93 | 101 | <div class="col card bg-white shadow border-0 w-75 p-0 mx-auto rounded-sm"> |
102 | + <!-- IMAGEN DE ESCANER --> | |
94 | 103 | <img |
95 | 104 | *ngIf="!productoAcargar" |
96 | 105 | class="card-img-top d-block w-100 mx-auto rounded-sm" |
97 | 106 | src="{{apiUrl}}/imagenes/escanner.jpg"> |
98 | - <div *ngIf="productoAcargar"> | |
107 | + | |
108 | + <!-- PRODUCTO A CARGAR --> | |
109 | + <div class="fade-in m-0" *ngIf="productoAcargar && !productoEsPromo"> | |
99 | 110 | <img |
100 | 111 | class="card-img-top d-block w-100 mx-auto rounded-sm" |
101 | - src="{{apiUrl}}/imagenes/cafe.jpg"> | |
112 | + src="{{apiUrl}}/imagenes/testImg3.jpg"> | |
102 | 113 | |
103 | 114 | <div class="row justify-content-between m-3"> |
104 | - <div class="col-auto text-left px-1"> | |
115 | + <div class="col-12 text-left px-1"> | |
105 | 116 | <p class="h6 font-weight-bold mb-0">{{productoAcargar.DetArt}}</p> |
106 | - <p class="h6 mb-0"><small>{{productoAcargar.DetArt}}</small></p> | |
107 | 117 | </div> |
108 | - <div class="col-4 text-right my-auto"> | |
118 | + <div class="col-12 text-right mt-2"> | |
109 | 119 | <p class="h5 font-weight-bold mb-0">{{productoAcargar.PreVen | currency}}</p> |
110 | 120 | </div> |
111 | 121 | </div> |
112 | 122 | </div> |
123 | + | |
124 | + <!-- PROMO A CARGAR --> | |
125 | + <div class="fade-in m-0" *ngIf="promoAcargar && productoEsPromo"> | |
126 | + <img | |
127 | + class="card-img-top d-block w-100 mx-auto rounded-sm" | |
128 | + src="{{apiUrl}}/imagenes/testImg3.jpg"> | |
129 | + | |
130 | + <div class="row justify-content-between m-3"> | |
131 | + <div class="col-12 text-left px-1"> | |
132 | + <p class="h6 font-weight-bold mb-0">{{promoAcargar.nombrePromo}}</p> | |
133 | + </div> | |
134 | + <div class="col-12 text-right mt-2 align-self-end"> | |
135 | + <p class="h5 font-weight-bold mb-0">{{productoAcargar.PreVen | currency}}</p> | |
136 | + </div> | |
137 | + </div> | |
138 | + </div> | |
139 | + | |
113 | 140 | </div> |
114 | - <!-- BOTONES --> | |
141 | + <!-- BOTONES DE CARGAR PRODUCTOS--> | |
115 | 142 | <div |
116 | 143 | class="col-5 pr-0" |
117 | 144 | *ngIf="productoAcargar && tienePromo"> |
118 | 145 | <button |
119 | - *ngIf="productoEsPromo" | |
146 | + *ngIf="productoEsPromo && promoAcargar.sinonimos" | |
120 | 147 | type="button" |
121 | 148 | class="btn btn-light btn-block shadow-sm" |
122 | 149 | (click)="pop.show()"> |
src/app/components/inicio/inicio.component.ts
... | ... | @@ -5,6 +5,7 @@ import { Producto } from 'src/app/wrappers/producto'; |
5 | 5 | import { ProductoService } from 'src/app/services/producto.service'; |
6 | 6 | import { Router } from '@angular/router'; |
7 | 7 | import { Promocion } from 'src/app/wrappers/promocion'; |
8 | +import { Sinonimo } from 'src/app/wrappers/sinonimo'; | |
8 | 9 | |
9 | 10 | |
10 | 11 | @Component({ |
... | ... | @@ -16,10 +17,12 @@ export class InicioComponent implements OnInit { |
16 | 17 | |
17 | 18 | @ViewChild('pop', { static: false }) popoverDirective: PopoverDirective; |
18 | 19 | private productoAcargar: Producto; |
20 | + private promoAcargar: Promocion; | |
19 | 21 | private tienePromo = false; |
20 | 22 | private productoEsPromo = false; |
21 | 23 | |
22 | - popoverContent: Promocion[] = [] | |
24 | + promociones: Promocion[] = []; | |
25 | + sinonimos: Sinonimo[] = []; | |
23 | 26 | apiUrl: string = appSettings.apiUrl |
24 | 27 | |
25 | 28 | constructor( |
... | ... | @@ -33,9 +36,9 @@ export class InicioComponent implements OnInit { |
33 | 36 | var sector = this.productoAcargar.CodSec; |
34 | 37 | var codigo = this.productoAcargar.CodArt; |
35 | 38 | this.productoService.getPromocion(sector, codigo) |
36 | - .subscribe((promociones: Promocion[]) => { | |
39 | + .subscribe((res: Promocion[]) => { | |
37 | 40 | |
38 | - if (promociones.length === 0) { | |
41 | + if (res.length === 0) { | |
39 | 42 | //Si no tiene promociones la cargarรก al carrito despues de un tiempo |
40 | 43 | setTimeout(() => { |
41 | 44 | this.productoService.productos.push(this.productoAcargar); |
... | ... | @@ -44,7 +47,7 @@ export class InicioComponent implements OnInit { |
44 | 47 | }, 2000) |
45 | 48 | } else { |
46 | 49 | |
47 | - this.popoverContent = promociones; | |
50 | + this.promociones = res; | |
48 | 51 | this.tienePromo = true; |
49 | 52 | this.popoverDirective.show(); |
50 | 53 | } |
... | ... | @@ -58,14 +61,37 @@ export class InicioComponent implements OnInit { |
58 | 61 | } |
59 | 62 | |
60 | 63 | private goPage(pageUrl) { |
64 | + | |
61 | 65 | this.router.navigate([pageUrl]); |
62 | 66 | } |
63 | 67 | |
64 | 68 | deshacerCarga() { |
69 | + if (this.productoEsPromo) { | |
70 | + this.promoAcargar = undefined; | |
71 | + this.productoEsPromo = false; | |
72 | + this.popoverDirective.show(); | |
73 | + } else { | |
74 | + this.productoAcargar = undefined; | |
75 | + this.tienePromo = false; | |
76 | + this.popoverDirective.hide(); | |
77 | + } | |
78 | + } | |
65 | 79 | |
66 | - this.productoAcargar = undefined; | |
67 | - this.tienePromo = false; | |
80 | + promoSeleccionada($event: Promocion) { | |
81 | + | |
82 | + this.productoEsPromo = true; | |
83 | + this.promoAcargar = $event; | |
68 | 84 | this.popoverDirective.hide(); |
85 | + if (this.promoAcargar.sinonimos) { | |
86 | + var sector = this.promoAcargar.sector; | |
87 | + var codigo = this.promoAcargar.codigo; | |
88 | + this.productoService.getPromocionSinonimos(sector, codigo) | |
89 | + .subscribe((res : Sinonimo[]) => { | |
90 | + | |
91 | + this.sinonimos = res; | |
92 | + this.showPopover(); | |
93 | + }) | |
94 | + } | |
69 | 95 | } |
70 | 96 | |
71 | 97 | } |
src/app/components/popover-promos/popover-promos.component.html
... | ... | @@ -0,0 +1,48 @@ |
1 | +<div class="card-body fade-left"> | |
2 | + <div class="row"> | |
3 | + <div class="col text-left"> | |
4 | + <p class="h5 card-title"> | |
5 | + Este producto forma parte<br> | |
6 | + de Combos y Promociones | |
7 | + </p> | |
8 | + </div> | |
9 | + </div> | |
10 | + | |
11 | + <div class="overflow-scroll popover-size pr-2"> | |
12 | + <div | |
13 | + class="row my-2" | |
14 | + *ngFor="let promo of popoverContent"> | |
15 | + <div class="col text-dark"> | |
16 | + <div | |
17 | + class="bg-white card-effect rounded-sm p-2 px-3" | |
18 | + (click)="seleccionarPromo(promo)"> | |
19 | + <div class="row justify-content-between"> | |
20 | + <div class="col-12 text-left"> | |
21 | + <p class="h5 mb-0"> | |
22 | + <small class="font-weight-bold">{{promo.nombrePromo}}</small> | |
23 | + </p> | |
24 | + </div> | |
25 | + <div class="col-12 text-right mt-2"> | |
26 | + <p class="h4 font-weight-bold mb-0"> | |
27 | + {{calcularPrecioDePromo(promo.productos) | currency}} | |
28 | + </p> | |
29 | + </div> | |
30 | + </div> | |
31 | + </div> | |
32 | + </div> | |
33 | + </div> | |
34 | + </div> | |
35 | + | |
36 | + <div class="row mt-3 justify-content-end"> | |
37 | + <div class="col-auto"> | |
38 | + <button | |
39 | + type="button" | |
40 | + class="btn btn-sm btn-light shadow" | |
41 | + (click)="hide()"> | |
42 | + <span class="pr-2">No, gracias</span> | |
43 | + <i class="fa fa-times text-danger" aria-hidden="true"></i> | |
44 | + </button> | |
45 | + </div> | |
46 | + </div> | |
47 | + | |
48 | +</div> |
src/app/components/popover-promos/popover-promos.component.scss
src/app/components/popover-promos/popover-promos.component.spec.ts
... | ... | @@ -0,0 +1,24 @@ |
1 | +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | |
2 | +import { PopoverPromosComponent } from './popover-promos.component'; | |
3 | + | |
4 | +describe('PopoverPromosComponent', () => { | |
5 | + let component: PopoverPromosComponent; | |
6 | + let fixture: ComponentFixture<PopoverPromosComponent>; | |
7 | + | |
8 | + beforeEach(async(() => { | |
9 | + TestBed.configureTestingModule({ | |
10 | + declarations: [ PopoverPromosComponent ] | |
11 | + }) | |
12 | + .compileComponents(); | |
13 | + })); | |
14 | + | |
15 | + beforeEach(() => { | |
16 | + fixture = TestBed.createComponent(PopoverPromosComponent); | |
17 | + component = fixture.componentInstance; | |
18 | + fixture.detectChanges(); | |
19 | + }); | |
20 | + | |
21 | + it('should create', () => { | |
22 | + expect(component).toBeTruthy(); | |
23 | + }); | |
24 | +}); |
src/app/components/popover-promos/popover-promos.component.ts
... | ... | @@ -0,0 +1,41 @@ |
1 | +import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; | |
2 | +import { PopoverDirective } from 'ngx-bootstrap/popover'; | |
3 | +import { Promocion } from 'src/app/wrappers/promocion'; | |
4 | +import { Producto } from 'src/app/wrappers/producto'; | |
5 | + | |
6 | +@Component({ | |
7 | + selector: 'app-popover-promos', | |
8 | + templateUrl: './popover-promos.component.html', | |
9 | + styleUrls: ['./popover-promos.component.scss'] | |
10 | +}) | |
11 | +export class PopoverPromosComponent implements OnInit { | |
12 | + | |
13 | + @Input() popover: PopoverDirective; | |
14 | + @Input() popoverContent: Promocion[]; | |
15 | + @Output() promoSeleccionada = new EventEmitter<Promocion>(); | |
16 | + | |
17 | + constructor() { } | |
18 | + | |
19 | + ngOnInit() { | |
20 | + } | |
21 | + | |
22 | + hide() { | |
23 | + this.popover.hide(); | |
24 | + } | |
25 | + | |
26 | + seleccionarPromo(promo: Promocion) { | |
27 | + | |
28 | + this.promoSeleccionada.emit(promo); | |
29 | + } | |
30 | + | |
31 | + calcularPrecioDePromo(productos: Producto[]) { | |
32 | + | |
33 | + var precio = 0; | |
34 | + productos.forEach(producto => { | |
35 | + precio += producto.PreVen; | |
36 | + }) | |
37 | + | |
38 | + return precio; | |
39 | + } | |
40 | + | |
41 | +} |
src/app/components/popover-sinonimos/popover-sinonimos.component.html
... | ... | @@ -0,0 +1,50 @@ |
1 | +<div class="card-body fade-left"> | |
2 | + | |
3 | + <div class="row m-0"> | |
4 | + <div class="col text-left"> | |
5 | + <p class="h4 card-title"> | |
6 | + Personalice su pedido | |
7 | + </p> | |
8 | + </div> | |
9 | + </div> | |
10 | + | |
11 | + <div class="row m-0"> | |
12 | + <div class="col text-left"> | |
13 | + <p class="h5 card-title"> | |
14 | + Elija una opciรณn | |
15 | + </p> | |
16 | + </div> | |
17 | + </div> | |
18 | + | |
19 | + <div class="row m-0 overflow-scroll popover-size pr-2 my-2"> | |
20 | + <div class="col"> | |
21 | + <div class="row" *ngFor="let sinonimo of popoverContent"> | |
22 | + <div class="col pl-4 h6"> | |
23 | + <div class="custom-control custom-radio"> | |
24 | + <input | |
25 | + type="radio" | |
26 | + id="{{sinonimo.CodArt}}" | |
27 | + name="sinonimoOpciones" | |
28 | + class="custom-control-input" | |
29 | + (click)="setSinonimo(sinonimo)"> | |
30 | + <label | |
31 | + class="font-weight-normal custom-control-label" | |
32 | + for="{{sinonimo.CodArt}}"> | |
33 | + {{sinonimo.DetArt}} | |
34 | + </label> | |
35 | + </div> | |
36 | + </div> | |
37 | + </div> | |
38 | + </div> | |
39 | + </div> | |
40 | + | |
41 | + <div class="row mt-3 justify-content-end"> | |
42 | + <div class="col-auto"> | |
43 | + <button type="button" class="btn btn-sm btn-light shadow" (click)="hidePopover()"> | |
44 | + <span class="font-weight-bold pr-2">Continuar</span> | |
45 | + <i class="fa fa-check text-success" aria-hidden="true"></i> | |
46 | + </button> | |
47 | + </div> | |
48 | + </div> | |
49 | + | |
50 | +</div> |
src/app/components/popover-sinonimos/popover-sinonimos.component.scss
src/app/components/popover-sinonimos/popover-sinonimos.component.spec.ts
... | ... | @@ -0,0 +1,25 @@ |
1 | +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | |
2 | + | |
3 | +import { PopoverSinonimosComponent } from './popover-sinonimos.component'; | |
4 | + | |
5 | +describe('PopoverSinonimosComponent', () => { | |
6 | + let component: PopoverSinonimosComponent; | |
7 | + let fixture: ComponentFixture<PopoverSinonimosComponent>; | |
8 | + | |
9 | + beforeEach(async(() => { | |
10 | + TestBed.configureTestingModule({ | |
11 | + declarations: [ PopoverSinonimosComponent ] | |
12 | + }) | |
13 | + .compileComponents(); | |
14 | + })); | |
15 | + | |
16 | + beforeEach(() => { | |
17 | + fixture = TestBed.createComponent(PopoverSinonimosComponent); | |
18 | + component = fixture.componentInstance; | |
19 | + fixture.detectChanges(); | |
20 | + }); | |
21 | + | |
22 | + it('should create', () => { | |
23 | + expect(component).toBeTruthy(); | |
24 | + }); | |
25 | +}); |
src/app/components/popover-sinonimos/popover-sinonimos.component.ts
... | ... | @@ -0,0 +1,32 @@ |
1 | +import { Component, OnInit, Input } from '@angular/core'; | |
2 | +import { PopoverDirective } from 'ngx-bootstrap'; | |
3 | +import { Sinonimo } from 'src/app/wrappers/sinonimo'; | |
4 | + | |
5 | +@Component({ | |
6 | + selector: 'app-popover-sinonimos', | |
7 | + templateUrl: './popover-sinonimos.component.html', | |
8 | + styleUrls: ['./popover-sinonimos.component.scss'] | |
9 | +}) | |
10 | +export class PopoverSinonimosComponent implements OnInit { | |
11 | + | |
12 | + //Directiva del popover, para poder cerrarlo desde este componente | |
13 | + @Input() popover: PopoverDirective; | |
14 | + @Input() popoverContent: Sinonimo[]; | |
15 | + sinonimoAelegir: Sinonimo; | |
16 | + | |
17 | + constructor() { } | |
18 | + | |
19 | + ngOnInit() { | |
20 | + } | |
21 | + | |
22 | + hidePopover() { | |
23 | + | |
24 | + this.popover.hide(); | |
25 | + } | |
26 | + | |
27 | + setSinonimo(sinonimo: Sinonimo) { | |
28 | + | |
29 | + this.sinonimoAelegir = sinonimo; | |
30 | + } | |
31 | + | |
32 | +} |
src/app/components/popover/popover.component.html
... | ... | @@ -1,47 +0,0 @@ |
1 | -<div class="card-body"> | |
2 | - <div class="row"> | |
3 | - <div class="col text-left"> | |
4 | - <p class="h5 card-title"> | |
5 | - Este producto forma parte<br> | |
6 | - de Combos y Promociones | |
7 | - </p> | |
8 | - </div> | |
9 | - </div> | |
10 | - | |
11 | - <div class="overflow-scroll popover-size pr-2"> | |
12 | - <div | |
13 | - class="row my-2" | |
14 | - *ngFor="let promo of popoverContent"> | |
15 | - <div class="col text-dark"> | |
16 | - <div class="bg-white rounded-sm p-2 px-3"> | |
17 | - <div class="row justify-content-between"> | |
18 | - <div class="col-auto text-left"> | |
19 | - <p class="h5 font-weight-bold mb-0">{{promo.nombrePromo}}</p> | |
20 | - <p | |
21 | - class="h6 mb-0" | |
22 | - *ngFor="let producto of promo.productos"> | |
23 | - {{producto.DetArt}} | |
24 | - </p> | |
25 | - </div> | |
26 | - <div class="col-auto text-right align-self-end"> | |
27 | - <p class="h4 font-weight-bold mb-0">{{28 | currency}}</p> | |
28 | - </div> | |
29 | - </div> | |
30 | - </div> | |
31 | - </div> | |
32 | - </div> | |
33 | - </div> | |
34 | - | |
35 | - <div class="row mt-3 justify-content-end"> | |
36 | - <div class="col-auto"> | |
37 | - <button | |
38 | - type="button" | |
39 | - class="btn btn-sm btn-light shadow" | |
40 | - (click)="hide()"> | |
41 | - <span class="pr-2">No, gracias</span> | |
42 | - <i class="fa fa-times text-danger" aria-hidden="true"></i> | |
43 | - </button> | |
44 | - </div> | |
45 | - </div> | |
46 | - | |
47 | -</div> |
src/app/components/popover/popover.component.scss
src/app/components/popover/popover.component.spec.ts
... | ... | @@ -1,25 +0,0 @@ |
1 | -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | |
2 | - | |
3 | -import { PopoverComponent } from './popover.component'; | |
4 | - | |
5 | -describe('PopoverComponent', () => { | |
6 | - let component: PopoverComponent; | |
7 | - let fixture: ComponentFixture<PopoverComponent>; | |
8 | - | |
9 | - beforeEach(async(() => { | |
10 | - TestBed.configureTestingModule({ | |
11 | - declarations: [ PopoverComponent ] | |
12 | - }) | |
13 | - .compileComponents(); | |
14 | - })); | |
15 | - | |
16 | - beforeEach(() => { | |
17 | - fixture = TestBed.createComponent(PopoverComponent); | |
18 | - component = fixture.componentInstance; | |
19 | - fixture.detectChanges(); | |
20 | - }); | |
21 | - | |
22 | - it('should create', () => { | |
23 | - expect(component).toBeTruthy(); | |
24 | - }); | |
25 | -}); |
src/app/components/popover/popover.component.ts
... | ... | @@ -1,24 +0,0 @@ |
1 | -import { Component, OnInit, Input } from '@angular/core'; | |
2 | -import { PopoverDirective } from 'ngx-bootstrap/popover'; | |
3 | -import { Promocion } from 'src/app/wrappers/promocion'; | |
4 | - | |
5 | -@Component({ | |
6 | - selector: 'app-popover', | |
7 | - templateUrl: './popover.component.html', | |
8 | - styleUrls: ['./popover.component.scss'] | |
9 | -}) | |
10 | -export class PopoverComponent implements OnInit { | |
11 | - | |
12 | - @Input() popover: PopoverDirective; | |
13 | - @Input() popoverContent: Promocion[]; | |
14 | - | |
15 | - constructor() { } | |
16 | - | |
17 | - ngOnInit() { | |
18 | - } | |
19 | - | |
20 | - hide() { | |
21 | - this.popover.hide(); | |
22 | - } | |
23 | - | |
24 | -} |
src/app/services/producto.service.ts
... | ... | @@ -25,8 +25,16 @@ export class ProductoService { |
25 | 25 | } |
26 | 26 | |
27 | 27 | getPromocion(sector, codigo): Observable<any> { |
28 | + | |
29 | + var url = `${appSettings.apiUrl}/promociones/incluir-articulo/${sector}/${codigo}`; | |
30 | + // var url = `${appSettings.apiUrl}/promociones/incluir-articulo/${2}/${1306}`; | |
31 | + return this.http.get(url); | |
32 | + } | |
28 | 33 | |
34 | + getPromocionSinonimos(sector, codigo): Observable<any> { | |
35 | + | |
29 | 36 | var url = `${appSettings.apiUrl}/promociones/incluir-articulo/${sector}/${codigo}`; |
37 | + // var url = `${appSettings.apiUrl}/sinonimos/promo/${2}/${7}`; | |
30 | 38 | return this.http.get(url); |
31 | 39 | } |
32 | 40 |
src/app/wrappers/producto.ts
src/app/wrappers/promocion.ts
src/app/wrappers/sinonimo.ts
... | ... | @@ -0,0 +1,106 @@ |
1 | +export interface Sinonimo { | |
2 | + EMP: number; | |
3 | + ID_SIN: number; | |
4 | + SEC: number; | |
5 | + COD: string; | |
6 | + DET: string; | |
7 | + E_HD: string[]; | |
8 | + C_HD: string[]; | |
9 | + CodSec: number; | |
10 | + CodArt: number; | |
11 | + DetArt: string; | |
12 | + CodRub: number; | |
13 | + Costo: number; | |
14 | + PreNet: number; | |
15 | + ImpInt: number; | |
16 | + UniVen: number; | |
17 | + FecCos: Date; | |
18 | + UltAct: Date; | |
19 | + CodPro: number; | |
20 | + ExiDep: number; | |
21 | + ExiVta: number; | |
22 | + MinDep: number; | |
23 | + MaxDep: number; | |
24 | + MinPVE: number; | |
25 | + MaxPVE: number; | |
26 | + ENTTur: number; | |
27 | + SINTur: number; | |
28 | + SALTur: number; | |
29 | + IvaSN: boolean; | |
30 | + DepSN: boolean; | |
31 | + RubMay: number; | |
32 | + PreVen: number; | |
33 | + IvaCO: number; | |
34 | + TIP: string; | |
35 | + IMPIVA: number; | |
36 | + ENTADM: number; | |
37 | + SALADM: number; | |
38 | + CODIIN: number; | |
39 | + PRO: boolean; | |
40 | + FPP: boolean; | |
41 | + ESS: boolean; | |
42 | + FID: Date; | |
43 | + NID: number; | |
44 | + FIV: Date; | |
45 | + NIV: number; | |
46 | + COO: string; | |
47 | + CAG: string; | |
48 | + CAP: number; | |
49 | + UTL: number; | |
50 | + NHA: boolean; | |
51 | + PID: boolean; | |
52 | + PRV: number; | |
53 | + PRD: number; | |
54 | + ImpInt2: number; | |
55 | + CLA: number; | |
56 | + UNICAP: number; | |
57 | + ELBPRO: string; | |
58 | + PPP: number; | |
59 | + ALI: number; | |
60 | + BAL_TIPO: string; | |
61 | + PER_MAY: boolean; | |
62 | + ES_MAY: boolean; | |
63 | + CLA_MAY: number; | |
64 | + PME_CMP: string; | |
65 | + USA_BAL: boolean; | |
66 | + DET_LAR: string; | |
67 | + ROTULO: string; | |
68 | + REC_MANUAL: boolean; | |
69 | + E_HD1: string; | |
70 | + C_HD1: string; | |
71 | + ImpInt3: number; | |
72 | + FUA_MAE_YPF: Date; | |
73 | + CPQ: number; | |
74 | + EPQ: string; | |
75 | + BPQ: number; | |
76 | + PUPQ: number; | |
77 | + CORVTO: boolean; | |
78 | + CORVTO_COSTO: number; | |
79 | + UTLFR: number; | |
80 | + FAMILIA: number; | |
81 | + ES_LUB: boolean; | |
82 | + ES_FERT: boolean; | |
83 | + AutoFac: boolean; | |
84 | + LitrosPCD: number; | |
85 | + LisPCD: number; | |
86 | + id: number; | |
87 | + ImpLey23966: boolean; | |
88 | + es_bio: boolean; | |
89 | + ExpArbaRev: boolean; | |
90 | + ES_AGROQ: boolean; | |
91 | + ES_PLAST: boolean; | |
92 | + es_bio_por: string; | |
93 | + ID_MARCA: number; | |
94 | + ID_ATRB1: number; | |
95 | + ID_ATRB2: number; | |
96 | + ID_ART_REF: number; | |
97 | + ILPC: boolean; | |
98 | + CantAgrupar: number; | |
99 | + E_HD2: string; | |
100 | + PPV: number; | |
101 | + PPD: number; | |
102 | + MOD_DET: boolean; | |
103 | + C_HD2: string; | |
104 | + nombreImagen?: any; | |
105 | + IMP_IMP_INT: boolean; | |
106 | +} |
src/assets/scss/animation.scss
... | ... | @@ -37,17 +37,17 @@ |
37 | 37 | } |
38 | 38 | } |
39 | 39 | |
40 | -.fade-left { | |
40 | +.fade-right { | |
41 | 41 | margin-top: 25px; |
42 | 42 | font-size: 21px; |
43 | 43 | text-align: center; |
44 | - animation: fadeleft 1s; | |
45 | - -moz-animation: fadeleft 1s; /* Firefox */ | |
46 | - -webkit-animation: fadeleft 1s; /* Safari and Chrome */ | |
47 | - -o-animation: fadeleft 1s; /* Opera */ | |
44 | + animation: faderight 1s; | |
45 | + -moz-animation: faderight 1s; /* Firefox */ | |
46 | + -webkit-animation: faderight 1s; /* Safari and Chrome */ | |
47 | + -o-animation: faderight 1s; /* Opera */ | |
48 | 48 | } |
49 | 49 | |
50 | -@keyframes fadeleft { | |
50 | +@keyframes faderight { | |
51 | 51 | from { |
52 | 52 | opacity: 0; |
53 | 53 | transform: translateX(-20px); |
... | ... | @@ -58,7 +58,7 @@ |
58 | 58 | } |
59 | 59 | } |
60 | 60 | |
61 | -@-moz-keyframes fadeleft { | |
61 | +@-moz-keyframes faderight { | |
62 | 62 | /* Firefox */ |
63 | 63 | from { |
64 | 64 | opacity: 0; |
... | ... | @@ -70,7 +70,7 @@ |
70 | 70 | } |
71 | 71 | } |
72 | 72 | |
73 | -@-webkit-keyframes fadeleft { | |
73 | +@-webkit-keyframes faderight { | |
74 | 74 | /* Safari and Chrome */ |
75 | 75 | from { |
76 | 76 | opacity: 0; |
... | ... | @@ -81,3 +81,43 @@ |
81 | 81 | -webkit-transform: translateX(0); |
82 | 82 | } |
83 | 83 | } |
84 | + | |
85 | +.fade-left { | |
86 | + | |
87 | + -webkit-animation: fadeleft .5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both; | |
88 | + animation: fadeleft .5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both; | |
89 | +} | |
90 | + | |
91 | +@-webkit-keyframes fadeleft { | |
92 | + 0% { | |
93 | + -webkit-transform: scaleX(0); | |
94 | + transform: scaleX(0); | |
95 | + -webkit-transform-origin: 100% 100%; | |
96 | + transform-origin: 100% 100%; | |
97 | + opacity: 1; | |
98 | + } | |
99 | + 100% { | |
100 | + -webkit-transform: scaleX(1); | |
101 | + transform: scaleX(1); | |
102 | + -webkit-transform-origin: 100% 100%; | |
103 | + transform-origin: 100% 100%; | |
104 | + opacity: 1; | |
105 | + } | |
106 | +} | |
107 | + | |
108 | +@keyframes fadeleft { | |
109 | + 0% { | |
110 | + -webkit-transform: scaleX(0); | |
111 | + transform: scaleX(0); | |
112 | + -webkit-transform-origin: 100% 100%; | |
113 | + transform-origin: 100% 100%; | |
114 | + opacity: 1; | |
115 | + } | |
116 | + 100% { | |
117 | + -webkit-transform: scaleX(1); | |
118 | + transform: scaleX(1); | |
119 | + -webkit-transform-origin: 100% 100%; | |
120 | + transform-origin: 100% 100%; | |
121 | + opacity: 1; | |
122 | + } | |
123 | +} |
src/assets/scss/bootstrap-override.scss
... | ... | @@ -10,9 +10,9 @@ $theme-colors: ( |
10 | 10 | ); |
11 | 11 | |
12 | 12 | .popover { |
13 | - transform: translate3d(-464px, 0, -34px) !important; | |
14 | - min-width: 200px !important; | |
15 | - max-width: 525px !important; | |
13 | + transform: translate3d(-480px, 0, -34px) !important; | |
14 | + min-width: 485px !important; | |
15 | + max-width: 485px !important; | |
16 | 16 | border: none !important; |
17 | 17 | border-radius: 1.5rem !important; |
18 | 18 | padding: 0 !important; |
... | ... | @@ -47,4 +47,25 @@ $theme-colors: ( |
47 | 47 | border-color: $primary !important; |
48 | 48 | } |
49 | 49 | |
50 | +.custom-radio .custom-control-label::before { | |
51 | + background-color: $primary !important; | |
52 | + border-color: $white !important; | |
53 | + border-width: 2px !important; | |
54 | +} | |
55 | + | |
56 | +.custom-control-input { | |
57 | + border-color: $white !important; | |
58 | + background-color: $primary !important; | |
59 | + color: $primary !important; | |
60 | + &:checked ~ .custom-control-label::before { | |
61 | + border-color: $white !important; | |
62 | + color: #fff !important; | |
63 | + background-color: $primary !important; | |
64 | + } | |
65 | + &:focus ~ .custom-control-label::before { | |
66 | + border-color: $white !important; | |
67 | + box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.7) !important; | |
68 | + } | |
69 | +} | |
70 | + | |
50 | 71 | @import "../../../node_modules/bootstrap/scss/bootstrap"; |