Commit 70f4b98e8960f55ed396f81b5bfdbc27da907e5e
Exists in
develop
Merge branch 'develop' of http://git.focasoftware.com/angular/autoservicio-axion into develop
bajando version mas reciente
Showing
45 changed files
Show diff stats
main.js
package-lock.json
... | ... | @@ -4200,9 +4200,9 @@ |
4200 | 4200 | } |
4201 | 4201 | }, |
4202 | 4202 | "defer-to-connect": { |
4203 | - "version": "1.1.1", | |
4204 | - "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.1.tgz", | |
4205 | - "integrity": "sha512-J7thop4u3mRTkYRQ+Vpfwy2G5Ehoy82I14+14W4YMDLKdWloI9gSzRbV30s/NckQGVJtPkWNcW4oMAUigTdqiQ==", | |
4203 | + "version": "1.1.3", | |
4204 | + "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", | |
4205 | + "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==", | |
4206 | 4206 | "dev": true |
4207 | 4207 | }, |
4208 | 4208 | "define-properties": { |
... | ... | @@ -4473,9 +4473,9 @@ |
4473 | 4473 | "dev": true |
4474 | 4474 | }, |
4475 | 4475 | "electron": { |
4476 | - "version": "7.1.6", | |
4477 | - "resolved": "https://registry.npmjs.org/electron/-/electron-7.1.6.tgz", | |
4478 | - "integrity": "sha512-0QSxQYYzSrBRbctKgAWS79k/I+vm95I7bz/zTuF0Qv4PvTtQf5hK21q6wtyKVPPJFFXnmSyvfQ2ce6iktfgK8g==", | |
4476 | + "version": "7.1.11", | |
4477 | + "resolved": "https://registry.npmjs.org/electron/-/electron-7.1.11.tgz", | |
4478 | + "integrity": "sha512-YDXfnovKY+8iZ5ISQh1kRqYIRKbpOSxGXCx2WVxPFPutEQ7Q/Xzr3h4GePEY25/NXMytMfhKaAZAYjtWUm3r9Q==", | |
4479 | 4479 | "dev": true, |
4480 | 4480 | "requires": { |
4481 | 4481 | "@electron/get": "^1.0.1", |
... | ... | @@ -4484,9 +4484,9 @@ |
4484 | 4484 | }, |
4485 | 4485 | "dependencies": { |
4486 | 4486 | "@types/node": { |
4487 | - "version": "12.12.21", | |
4488 | - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.21.tgz", | |
4489 | - "integrity": "sha512-8sRGhbpU+ck1n0PGAUgVrWrWdjSW2aqNeyC15W88GRsMpSwzv6RJGlLhE7s2RhVSOdyDmxbqlWSeThq4/7xqlA==", | |
4487 | + "version": "12.12.26", | |
4488 | + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.26.tgz", | |
4489 | + "integrity": "sha512-UmUm94/QZvU5xLcUlNR8hA7Ac+fGpO1EG/a8bcWVz0P0LqtxFmun9Y2bbtuckwGboWJIT70DoWq1r3hb56n3DA==", | |
4490 | 4490 | "dev": true |
4491 | 4491 | } |
4492 | 4492 | } |
... | ... | @@ -5596,9 +5596,9 @@ |
5596 | 5596 | }, |
5597 | 5597 | "dependencies": { |
5598 | 5598 | "core-js": { |
5599 | - "version": "3.6.0", | |
5600 | - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.6.0.tgz", | |
5601 | - "integrity": "sha512-AHPTNKzyB+YwgDWoSOCaid9PUSEF6781vsfiK8qUz62zRR448/XgK2NtCbpiUGizbep8Lrpt0Du19PpGGZvw3Q==", | |
5599 | + "version": "3.6.4", | |
5600 | + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.6.4.tgz", | |
5601 | + "integrity": "sha512-4paDGScNgZP2IXXilaffL9X7968RuvwlkK3xWtZRVqgd8SYNiVKRJvkFd1aqqEuPfN7E68ZHEp9hDj6lHj4Hyw==", | |
5602 | 5602 | "dev": true, |
5603 | 5603 | "optional": true |
5604 | 5604 | } |
package.json
1 | 1 | { |
2 | 2 | "name": "autoservicio-axion", |
3 | - "version": "0.0.1", | |
3 | + "version": "1.0.0", | |
4 | 4 | "main": "main.js", |
5 | 5 | "scripts": { |
6 | 6 | "ng": "ng", |
7 | 7 | "start": "ng serve --port 4206 --host 0.0.0.0 --disableHostCheck", |
8 | 8 | "build": "ng build", |
9 | - "build-prod": "ng build --prod --aot=true --build--optimizer=true", | |
9 | + "build-prod": "ng build --prod", | |
10 | 10 | "test": "ng test", |
11 | 11 | "lint": "ng lint", |
12 | 12 | "e2e": "ng e2e", |
13 | 13 | "electron": "electron .", |
14 | - "electron-build": "ng build --prod --aot=true --build--optimizer=true && electron .", | |
15 | - "build-exe": "electron-packager . --platform=win32 --arch=x64" | |
14 | + "electron-build": "ng build --prod && electron .", | |
15 | + "build-exe": "electron-packager . --platform=win32 --arch=x64 --asar --icon=src/favicon.ico" | |
16 | 16 | }, |
17 | 17 | "private": true, |
18 | 18 | "dependencies": { |
... | ... | @@ -50,7 +50,7 @@ |
50 | 50 | "@types/node": "~8.9.4", |
51 | 51 | "codelyzer": "^5.0.0", |
52 | 52 | "devtron": "^1.4.0", |
53 | - "electron": "^7.1.6", | |
53 | + "electron": "^7.1.11", | |
54 | 54 | "jasmine-core": "~3.4.0", |
55 | 55 | "jasmine-spec-reporter": "~4.2.1", |
56 | 56 | "karma": "~4.1.0", |
src/app/interfaces/IArticulo.ts
src/app/interfaces/IComanda.ts
src/app/modules/carrito/carrito.component.ts
... | ... | @@ -14,7 +14,7 @@ import { ANIMATIONS } from 'src/app/utils/animations'; |
14 | 14 | animations: [ANIMATIONS.EnterLeaveX] |
15 | 15 | }) |
16 | 16 | export class CarritoComponent implements OnInit, OnDestroy { |
17 | - urlImagenes = `${APP_SETTINGS.apiDeboSuite}/imagenes/`; | |
17 | + urlImagenes = `${APP_SETTINGS.apiImagenes}/imagenes/`; | |
18 | 18 | maxCantidad = 50; |
19 | 19 | modalRef: BsModalRef; |
20 | 20 |
src/app/modules/comanda/comanda.component.html
... | ... | @@ -18,7 +18,7 @@ |
18 | 18 | <div class="card-body p-2"> |
19 | 19 | <div class="row justify-content-between"> |
20 | 20 | <img |
21 | - src="../../../assets/img/para-llevar-fondo-sombra.png" | |
21 | + src="assets/img/para-llevar-fondo-sombra.png" | |
22 | 22 | class="w-25 h-25 float-left ml-0 mt-n3" |
23 | 23 | *ngIf="comanda.paraLlevar == true"> |
24 | 24 | <div></div> |
... | ... | @@ -50,12 +50,12 @@ |
50 | 50 | }"> |
51 | 51 | <!-- DETALLE Y CANTIDAD --> |
52 | 52 | <p> |
53 | - <small>{{detalle.DetLar}}</small><br> | |
53 | + <small>{{detalle.MKT_DESC ? detalle.MKT_DESC.toUpperCase() : detalle.DetArt.toUpperCase()}}</small><br> | |
54 | 54 | <small>CANT.{{detalle.cantidad}}</small> |
55 | 55 | </p> |
56 | 56 | <div *ngFor="let componente of detalle.componentes"> |
57 | 57 | <p *ngIf="componente.DetArt !== 'Producto ingrediente general'"> |
58 | - <small>{{componente.DetArt.toUpperCase()}}</small> | |
58 | + <small>{{componente.DetArt.toLowerCase()}}</small> | |
59 | 59 | </p> |
60 | 60 | </div> |
61 | 61 | </div> |
... | ... | @@ -72,13 +72,13 @@ |
72 | 72 | (click)="updateComanda(comanda, 2, 'En elaboracion')"> |
73 | 73 | <div class="row justify-content-between"> |
74 | 74 | <div></div> |
75 | - <p class="ml-4" style="color: #fff;">Elaborar</p> | |
75 | + <p class="ml-4 text-white">Elaborar</p> | |
76 | 76 | <img |
77 | - draggable="false" | |
78 | - ondragstart="return false;" | |
79 | - (contextmenu)="false" | |
80 | - class="icon-30 mr-2" | |
81 | - src="assets/img/ir.svg"> | |
77 | + draggable="false" | |
78 | + ondragstart="return false;" | |
79 | + (contextmenu)="false" | |
80 | + class="icon-30 mr-2" | |
81 | + src="assets/img/ir.svg"> | |
82 | 82 | </div> |
83 | 83 | </button> |
84 | 84 | <button |
src/app/modules/info-formas-pago/info-formas-pago.component.html
src/app/modules/info-formas-pago/info-formas-pago.component.ts
... | ... | @@ -22,7 +22,7 @@ export class InfoFormasPagoComponent implements OnInit, OnDestroy { |
22 | 22 | } |
23 | 23 | |
24 | 24 | openGoCaja(templateRef: TemplateRef<any>) { |
25 | - const modalRef = this.modalService.show(templateRef, { class: 'modal-promo modal-dialog-centered' }); | |
25 | + const modalRef = this.modalService.show(templateRef, { class: 'modal-lg modal-dialog-centered' }); | |
26 | 26 | this.timer = setTimeout(() => { |
27 | 27 | modalRef.hide(); |
28 | 28 | }, 3000); |
src/app/modules/mensaje-final/mensaje-final.component.html
... | ... | @@ -24,7 +24,7 @@ |
24 | 24 | (contextmenu)="false" |
25 | 25 | class="img-in-top px-4 bg-white" |
26 | 26 | src="assets/img/ticket.svg"> |
27 | - <p class="h6 mb-2"><small>PRESENTร EL TICKET EN CAJA Y AGUARDร TU PEDIDO</small></p> | |
27 | + <p class="h6 mb-2"><small>NO TE VAYAS SIN TU TICKET.<br>PRESENTALO AL RETIRAR TU PEDIDO.</small></p> | |
28 | 28 | <p class="h2 text-primary">Nรบmero de pedido {{articuloService.idComanda}}</p> |
29 | 29 | </div> |
30 | 30 | </div> |
src/app/modules/mensaje-final/mensaje-final.component.ts
src/app/modules/pago-electronico/pago-electronico.component.ts
1 | -import { Component, OnInit } from '@angular/core'; | |
1 | +import { Component, OnInit, OnDestroy } from '@angular/core'; | |
2 | 2 | import { ArticuloService } from 'src/app/services/articulo/articulo.service'; |
3 | 3 | import { Router } from '@angular/router'; |
4 | 4 | import { APP_SETTINGS } from 'src/etc/AppSettings'; |
5 | +import { BsModalService } from 'ngx-bootstrap/modal'; | |
6 | +import { ErrorFormaPagoComponent } from 'src/app/shared/error-forma-pago/error-forma-pago.component'; | |
7 | +import { Subscription } from 'rxjs'; | |
5 | 8 | |
6 | 9 | @Component({ |
7 | 10 | selector: 'app-pago-electronico', |
8 | 11 | templateUrl: './pago-electronico.component.html', |
9 | 12 | styleUrls: ['./pago-electronico.component.scss'] |
10 | 13 | }) |
11 | -export class PagoElectronicoComponent implements OnInit { | |
12 | - urlQr = `${APP_SETTINGS.apiDeboSuite}/qr/${APP_SETTINGS.deploy}/${APP_SETTINGS.codigoP}/tienda/${APP_SETTINGS.terminal}`; | |
14 | +export class PagoElectronicoComponent implements OnInit, OnDestroy { | |
15 | + urlQr = `${APP_SETTINGS.apiImagenes}/qr/${APP_SETTINGS.deploy}/${APP_SETTINGS.codigoP}/tienda/${APP_SETTINGS.terminal}`; | |
16 | + subscription: Subscription; | |
13 | 17 | |
14 | 18 | constructor( |
15 | 19 | private articuloService: ArticuloService, |
16 | 20 | private router: Router, |
21 | + private modalService: BsModalService, | |
17 | 22 | ) { } |
18 | 23 | |
19 | 24 | ngOnInit() { |
... | ... | @@ -25,13 +30,26 @@ export class PagoElectronicoComponent implements OnInit { |
25 | 30 | pedidoAnombreDe: '' |
26 | 31 | }; |
27 | 32 | dataPago.pedidoAnombreDe = ''; |
28 | - this.articuloService.pay(dataPago) | |
33 | + this.subscription = this.articuloService.pay(dataPago) | |
29 | 34 | .subscribe((res: any) => { |
30 | 35 | this.articuloService.idComanda = res.data; |
31 | 36 | this.router.navigate(['mensaje-final']); |
32 | - }, err => console.error(err)); | |
37 | + }, (err) => { | |
38 | + this.modalService.show(ErrorFormaPagoComponent, { | |
39 | + class: 'modal-lg modal-dialog-centered', | |
40 | + ignoreBackdropClick: true, | |
41 | + }); | |
42 | + }); | |
33 | 43 | this.mediaPantalla(); |
34 | 44 | } |
45 | + | |
46 | + ngOnDestroy() { | |
47 | + if (this.subscription) this.subscription.unsubscribe(); | |
48 | + for (let i = 1; i <= this.modalService.getModalsCount(); i++) { | |
49 | + this.modalService.hide(i); | |
50 | + } | |
51 | + } | |
52 | + | |
35 | 53 | mediaPantalla() { |
36 | 54 | if ($('body').hasClass('media-pantalla')) { |
37 | 55 | $('.qr-mt').addClass('media-pantalla'); |
src/app/modules/pago-electronico/pago-electronico.module.ts
... | ... | @@ -3,13 +3,16 @@ import { CommonModule } from '@angular/common'; |
3 | 3 | |
4 | 4 | import { PagoElectronicoRoutingModule } from './pago-electronico-routing.module'; |
5 | 5 | import { PagoElectronicoComponent } from './pago-electronico.component'; |
6 | +import { PagoTarjetaModule } from '../pago-tarjeta/pago-tarjeta.module'; | |
6 | 7 | |
7 | 8 | |
8 | 9 | @NgModule({ |
9 | 10 | declarations: [PagoElectronicoComponent], |
10 | 11 | imports: [ |
11 | 12 | CommonModule, |
12 | - PagoElectronicoRoutingModule | |
13 | - ] | |
13 | + PagoElectronicoRoutingModule, | |
14 | + PagoTarjetaModule, | |
15 | + ], | |
16 | + entryComponents: [] | |
14 | 17 | }) |
15 | 18 | export class PagoElectronicoModule { } |
src/app/modules/pago-tarjeta/pago-tarjeta.component.html
... | ... | @@ -18,9 +18,9 @@ |
18 | 18 | (contextmenu)="false" |
19 | 19 | class="img-in-top px-4 bg-white" |
20 | 20 | src="assets/img/icono-tarjetas.svg"> |
21 | - <p class="h6 m-0">AHORA</p> | |
21 | + <p class="h6 m-0">AHORA ESPERร QUE SE ACTIVE EL POSNET</p> | |
22 | 22 | <p class="h2 mb-3 text-secondary"> |
23 | - introducรญ o insertรก tu tarjeta | |
23 | + deslizรก tu tarjeta | |
24 | 24 | </p> |
25 | 25 | <p class="h6 m-0">Y SEGUร LAS INSTRUCCIONES DEL LECTOR</p> |
26 | 26 | </div> |
... | ... | @@ -57,3 +57,14 @@ |
57 | 57 | </div> |
58 | 58 | </div> |
59 | 59 | </div> |
60 | + | |
61 | +<ng-template #template> | |
62 | + <div class="modal-body rounded bg-primary"> | |
63 | + <h1 class="text-white text-center my-4">Por favor,<br>esperรก un momento</h1> | |
64 | + <div class="d-flex justify-content-center mt-2 mb-4"> | |
65 | + <div class="spinner-border text-white text-center" role="status"> | |
66 | + <span class="sr-only">Loading...</span> | |
67 | + </div> | |
68 | + </div> | |
69 | + </div> | |
70 | +</ng-template> |
src/app/modules/pago-tarjeta/pago-tarjeta.component.scss
src/app/modules/pago-tarjeta/pago-tarjeta.component.ts
1 | -import { Component, OnInit } from '@angular/core'; | |
1 | +import { Component, OnInit, TemplateRef, OnDestroy, ViewChild } from '@angular/core'; | |
2 | 2 | import { ArticuloService } from 'src/app/services/articulo/articulo.service'; |
3 | 3 | import { Router } from '@angular/router'; |
4 | +import { BsModalService } from 'ngx-bootstrap/modal'; | |
5 | +import { ErrorFormaPagoComponent } from 'src/app/shared/error-forma-pago/error-forma-pago.component'; | |
6 | +import { Subscription } from 'rxjs'; | |
4 | 7 | |
5 | 8 | @Component({ |
6 | 9 | selector: 'app-pago-tarjeta', |
7 | 10 | templateUrl: './pago-tarjeta.component.html', |
8 | 11 | styleUrls: ['./pago-tarjeta.component.scss'] |
9 | 12 | }) |
10 | -export class PagoTarjetaComponent implements OnInit { | |
13 | +export class PagoTarjetaComponent implements OnInit, OnDestroy { | |
14 | + timer: any; | |
15 | + @ViewChild('template', {static: true}) public template: TemplateRef<any>; | |
16 | + subscription: Subscription; | |
11 | 17 | |
12 | 18 | constructor( |
13 | 19 | private articuloService: ArticuloService, |
14 | 20 | private router: Router, |
21 | + private modalService: BsModalService, | |
15 | 22 | ) { } |
16 | 23 | |
17 | 24 | ngOnInit() { |
... | ... | @@ -19,20 +26,41 @@ export class PagoTarjetaComponent implements OnInit { |
19 | 26 | this.router.navigate(['']); |
20 | 27 | return; |
21 | 28 | } |
29 | + this.openModalEspera(this.template); | |
22 | 30 | const dataPago = { |
23 | 31 | pedidoAnombreDe: '' |
24 | 32 | }; |
25 | - this.articuloService.pay(dataPago) | |
33 | + this.subscription = this.articuloService.pay(dataPago) | |
26 | 34 | .subscribe((res: any) => { |
27 | 35 | this.articuloService.idComanda = res.data; |
28 | 36 | this.router.navigate(['mensaje-final']); |
29 | - }, err => console.error(err)); | |
37 | + }, (err) => { | |
38 | + this.modalService.show(ErrorFormaPagoComponent, { | |
39 | + class: 'modal-lg modal-dialog-centered', | |
40 | + ignoreBackdropClick: true, | |
41 | + }); | |
42 | + }); | |
30 | 43 | this.mediaPantalla(); |
31 | 44 | } |
32 | 45 | |
46 | + ngOnDestroy() { | |
47 | + if (this.subscription) this.subscription.unsubscribe(); | |
48 | + if (this.timer) clearTimeout(this.timer); | |
49 | + for (let i = 1; i <= this.modalService.getModalsCount(); i++) { | |
50 | + this.modalService.hide(i); | |
51 | + } | |
52 | + } | |
53 | + | |
33 | 54 | mediaPantalla() { |
34 | 55 | if ($('body').hasClass('media-pantalla')) { |
35 | 56 | $('.pago-tarjeta').addClass('media-pantalla'); |
36 | 57 | } |
37 | 58 | } |
59 | + | |
60 | + openModalEspera(templateRef: TemplateRef<any>) { | |
61 | + const modalRef = this.modalService.show(templateRef, { class: 'modal-lg modal-dialog-centered' }); | |
62 | + this.timer = setTimeout(() => { | |
63 | + modalRef.hide(); | |
64 | + }, 6000); | |
65 | + } | |
38 | 66 | } |
src/app/modules/pago-tarjeta/pago-tarjeta.module.ts
... | ... | @@ -3,13 +3,20 @@ import { CommonModule } from '@angular/common'; |
3 | 3 | |
4 | 4 | import { PagoTarjetaRoutingModule } from './pago-tarjeta-routing.module'; |
5 | 5 | import { PagoTarjetaComponent } from './pago-tarjeta.component'; |
6 | +import { ErrorFormaPagoComponent } from 'src/app/shared/error-forma-pago/error-forma-pago.component'; | |
7 | +import { ModalModule } from 'ngx-bootstrap/modal'; | |
6 | 8 | |
7 | 9 | |
8 | 10 | @NgModule({ |
9 | - declarations: [PagoTarjetaComponent], | |
11 | + declarations: [ | |
12 | + PagoTarjetaComponent, | |
13 | + ErrorFormaPagoComponent, | |
14 | + ], | |
10 | 15 | imports: [ |
11 | 16 | CommonModule, |
12 | - PagoTarjetaRoutingModule | |
13 | - ] | |
17 | + PagoTarjetaRoutingModule, | |
18 | + ModalModule.forRoot(), | |
19 | + ], | |
20 | + entryComponents: [ErrorFormaPagoComponent] | |
14 | 21 | }) |
15 | 22 | export class PagoTarjetaModule { } |
src/app/modules/pedidos-salientes/pedidos-salientes.component.html
src/app/modules/seleccion-articulos/filtro-categorias/filtro-categorias.component.html
... | ... | @@ -27,7 +27,7 @@ |
27 | 27 | ondragstart="return false;" |
28 | 28 | (contextmenu)="false" |
29 | 29 | class="col-12 img-fluid align-self-end d-none |
30 | - d-sm-block rounded-circle w-100 h-auto" | |
30 | + d-sm-block rounded-circle h-50" | |
31 | 31 | src="assets/img/logo-spot.svg"> |
32 | 32 | <small class="col-12 px-0 my-1 h-100 h-md-25 align-self-end text-center text-truncate">Todos</small> |
33 | 33 | </div> |
... | ... | @@ -43,8 +43,7 @@ |
43 | 43 | draggable="false" |
44 | 44 | ondragstart="return false;" |
45 | 45 | (contextmenu)="false" |
46 | - class="col-12 img-fluid align-self-end d-none | |
47 | - d-sm-block rounded-circle w-100 h-auto" | |
46 | + class="d-none d-sm-block rounded-circle w-auto h-75" | |
48 | 47 | src="{{urlImagenes}}{{categoria.path_imagen}}" |
49 | 48 | onerror="this.src='assets/img/imagen-no-encontrada.jpg'"> |
50 | 49 | <small class="col-12 px-1 my-1 h-100 h-md-25 align-self-end text-center text-truncate">{{categoria.detalle}}</small> |
src/app/modules/seleccion-articulos/filtro-categorias/filtro-categorias.component.ts
... | ... | @@ -18,7 +18,7 @@ export class FiltroCategoriasComponent implements OnInit { |
18 | 18 | categoriaActive = null; |
19 | 19 | allActive = true; |
20 | 20 | queMostrar = 'todos'; |
21 | - urlImagenes = `${APP_SETTINGS.apiDeboSuite}/imagenes/`; | |
21 | + urlImagenes = `${APP_SETTINGS.apiImagenes}/imagenes/`; | |
22 | 22 | |
23 | 23 | constructor( |
24 | 24 | private categoriaService: CategoriaService, |
src/app/modules/seleccion-articulos/seleccion-articulos.component.html
... | ... | @@ -28,6 +28,14 @@ |
28 | 28 | <div |
29 | 29 | class="col-7 col-sm-9 col-xl-10 pb-3 h-100 align-self-center scroll-y-visible" |
30 | 30 | (scroll)="scrollEvent($event)"> |
31 | + <!-- SPINNER --> | |
32 | + <div | |
33 | + class="d-flex justify-content-center" | |
34 | + *ngIf="loading"> | |
35 | + <div class="spinner-border text-primary mt-5" role="status"> | |
36 | + <span class="sr-only">Loading...</span> | |
37 | + </div> | |
38 | + </div> | |
31 | 39 | <div class="row row-cols-1 row-cols-sm-3 row-cols-xl-6"> |
32 | 40 | <!-- ARTICULO --> |
33 | 41 | <div |
src/app/modules/seleccion-articulos/seleccion-articulos.component.scss
src/app/modules/seleccion-articulos/seleccion-articulos.component.ts
... | ... | @@ -20,9 +20,9 @@ import { ANIMATIONS } from 'src/app/utils/animations'; |
20 | 20 | animations: [ANIMATIONS.EnterLeaveY] |
21 | 21 | }) |
22 | 22 | export class SeleccionArticulosComponent implements OnInit, AfterViewInit, OnDestroy { |
23 | - showSpinner = true; | |
23 | + loading = true; | |
24 | 24 | timeoutHandler: any; |
25 | - urlImagenes = `${APP_SETTINGS.apiDeboSuite}/imagenes/`; | |
25 | + urlImagenes = `${APP_SETTINGS.apiImagenes}/imagenes/`; | |
26 | 26 | articulos: IArticulo[] = []; |
27 | 27 | auxArticulos: IArticulo[] = []; |
28 | 28 | showQuantity = 100; |
... | ... | @@ -67,7 +67,6 @@ export class SeleccionArticulosComponent implements OnInit, AfterViewInit, OnDes |
67 | 67 | localStorage.setItem('articulos', JSON.stringify(result)); |
68 | 68 | this.setProductos(); |
69 | 69 | }, (error) => { |
70 | - this.showSpinner = false; | |
71 | 70 | console.error(error); |
72 | 71 | }); |
73 | 72 | } |
... | ... | @@ -75,6 +74,7 @@ export class SeleccionArticulosComponent implements OnInit, AfterViewInit, OnDes |
75 | 74 | setProductos() { |
76 | 75 | this.articulos = JSON.parse(localStorage.getItem('articulos')); |
77 | 76 | this.filterItems(); |
77 | + this.loading = false; | |
78 | 78 | } |
79 | 79 | |
80 | 80 | filterItems() { |
... | ... | @@ -129,24 +129,32 @@ export class SeleccionArticulosComponent implements OnInit, AfterViewInit, OnDes |
129 | 129 | } |
130 | 130 | |
131 | 131 | openModalPromos(articulo: IArticulo) { |
132 | + if (this.modalRef) return; | |
133 | + this.articuloService.setArticulosSinImagen([articulo]); | |
132 | 134 | this.modalRef = this.modalService.show(PromocionComponent, { |
133 | 135 | initialState: { articulosPromo: [articulo] }, |
134 | - class: 'modal-promo modal-dialog-centered' | |
136 | + class: 'modal-dialog-centered', | |
137 | + ignoreBackdropClick: true, | |
135 | 138 | }); |
139 | + this.modalRef.content.onClose | |
140 | + .subscribe(() => this.modalRef = null); | |
136 | 141 | this.mediaPantalla(); |
137 | 142 | } |
138 | 143 | |
139 | 144 | openModalSinonimos(sinonimosData: ISinonimo[], articulo: IArticulo) { |
145 | + if (this.modalRef) return; | |
140 | 146 | this.modalRef = this.modalService.show(SinonimoComponent, { |
141 | 147 | initialState: { |
142 | 148 | sinonimos: sinonimosData, |
143 | 149 | articulo |
144 | 150 | }, |
145 | - class: 'modal-promo modal-dialog-centered' | |
151 | + class: 'modal-dialog-centered', | |
152 | + ignoreBackdropClick: true, | |
146 | 153 | }); |
147 | 154 | |
148 | 155 | this.modalRef.content.onClose |
149 | 156 | .subscribe((res: any) => { |
157 | + this.modalRef = null; | |
150 | 158 | for (const a of articulo.productos) { |
151 | 159 | for (const aRes of res.articulos) { |
152 | 160 | if (a.idSinonimo === aRes.ID_SIN) { |
src/app/services/articulo/articulo.service.ts
... | ... | @@ -57,7 +57,7 @@ export class ArticuloService { |
57 | 57 | setArticulo(articulo: IArticulo) { |
58 | 58 | articulo.cantidad = 1; |
59 | 59 | for (const articuloCarrito of this.carrito) { |
60 | - if (articuloCarrito.id === articulo.id && !articulo.productos.length) { | |
60 | + if (articuloCarrito.id === articulo.id && !articulo.productos) { | |
61 | 61 | articuloCarrito.cantidad++; |
62 | 62 | this.calcularTotal(); |
63 | 63 | return; |
... | ... | @@ -87,10 +87,14 @@ export class ArticuloService { |
87 | 87 | pedidoAnombreDe: dataPago.pedidoAnombreDe, |
88 | 88 | numeroPlanilla: APP_SETTINGS.numeroPlanilla, |
89 | 89 | pedidoParaLlevar: localStorage.getItem('pedidoParaLlevar'), |
90 | + terminal: APP_SETTINGS.terminal | |
90 | 91 | }) |
91 | 92 | .subscribe((data) => { |
92 | 93 | observer.next(data); |
93 | 94 | observer.complete(); |
95 | + }, err => { | |
96 | + observer.error(err); | |
97 | + observer.complete(); | |
94 | 98 | }); |
95 | 99 | }); |
96 | 100 | }); |
... | ... | @@ -100,6 +104,7 @@ export class ArticuloService { |
100 | 104 | this.articuloAcargar = undefined; |
101 | 105 | this.promoAcargar = undefined; |
102 | 106 | this.carrito = []; |
107 | + this.calcularTotal(); | |
103 | 108 | } |
104 | 109 | |
105 | 110 | setArticulosSinImagen(articulos: IArticulo[]) { |
src/app/services/inactive-screen/inactive-screen.service.ts
... | ... | @@ -13,7 +13,11 @@ export class InactiveScreenService { |
13 | 13 | |
14 | 14 | startTimeOutInactividad() { |
15 | 15 | this.timerReposo = setTimeout(() => { |
16 | - this.router.navigate(['cancelar-compra']); | |
16 | + if (this.router.url === '/pago-electronico' || this.router.url === '/pago-tarjeta') { | |
17 | + this.startTimeOutInactividad(); | |
18 | + } else { | |
19 | + this.router.navigate(['cancelar-compra']); | |
20 | + } | |
17 | 21 | }, 90000); |
18 | 22 | } |
19 | 23 | } |
src/app/shared/cancelar-compra/cancelar-compra.component.html
1 | 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"> | |
2 | + <img class="h-100 w-auto my-auto" src="assets/img/logo-spot.svg"> | |
3 | 3 | </div> |
4 | 4 | <div class="row mx-auto h-70"> |
5 | 5 | <div class="col-12 align-self-center"> |
6 | 6 | <div class="row mt-5 mx-0 justify-content-around"> |
7 | 7 | <div class="col-12 col-sm-8 col-md-6 col-lg-4"> |
8 | 8 | <div class="p-3 bg-white text-center shadow-lg rounded"> |
9 | - <p class="mt-4 h4">NECESITA</p> | |
9 | + <p class="mt-4 h4">NECESITรS</p> | |
10 | 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> | |
11 | + <p class="mb-4 h4">PARA TU PEDIDO?</p> | |
12 | 12 | </div> |
13 | 13 | </div> |
14 | 14 | </div> |
src/app/shared/cancelar-compra/cancelar-compra.component.ts
src/app/shared/confirmacion/confirmacion.component.html
1 | -<div class="modal-header bg-primary rounded-top pt-4 px-2"> | |
2 | - <div class="row mx-0 w-100 justify-content-between"> | |
3 | - <div class="col-8"> | |
4 | - <p *ngIf="titleMessage" class="h3 text-white">{{titleMessage}}</p> | |
5 | - </div> | |
6 | - </div> | |
7 | - <div *ngIf="imagenPath" class="col-4 align-self-center"> | |
1 | +<div class="bg-primary rounded"> | |
2 | + <div class="modal-header"> | |
8 | 3 | <img |
9 | - draggable="false" | |
10 | - ondragstart="return false;" | |
11 | - (contextmenu)="false" | |
12 | - src="{{urlImagenes}}{{imagenPath}}" | |
13 | - onerror="this.src='assets/img/imagen-no-encontrada.jpg'" | |
14 | - class="card-img-top img-fluid rounded-circle"> | |
15 | - </div> | |
16 | -</div> | |
17 | -<div class=" col-12 modal-body bg-primary rounded-bottom pb-3 px-2"> | |
18 | - <div class="row justify-content-between mx-0 w-100"> | |
19 | - <div class="col-8"> | |
20 | - <p *ngIf="footerMessageFirst" class="text-white"><small>{{footerMessageFirst}}</small></p > | |
21 | - <h1 *ngIf="footerMessageSecond" class="text-white mb-4">{{footerMessageSecond}}</h1> | |
4 | + draggable="false" | |
5 | + ondragstart="return false;" | |
6 | + (contextmenu)="false" | |
7 | + (click)="close()" | |
8 | + class="btn-effect icon-30 mt-2 mr-2 position-absolute right-0 top-0 z-index" | |
9 | + src="assets/img/icono-cancelar-blanco.svg"> | |
10 | + <div class="row no-gutters w-100 justify-content-between"> | |
11 | + <div class="col align-self-center"> | |
12 | + <p *ngIf="titleMessage" class="h3 text-white">{{titleMessage}}</p> | |
13 | + </div> | |
14 | + <div *ngIf="imagenPath" class="col-4 px-3 pt-3 align-self-center"> | |
15 | + <img | |
16 | + draggable="false" | |
17 | + ondragstart="return false;" | |
18 | + (contextmenu)="false" | |
19 | + src="{{urlImagenes}}{{imagenPath}}" | |
20 | + onerror="this.src='assets/img/imagen-no-encontrada.jpg'" | |
21 | + class="d-block mx-auto img-fluid rounded-circle"> | |
22 | + </div> | |
22 | 23 | </div> |
23 | - <div class="col-4"> | |
24 | - <div | |
25 | - class="mx-0" | |
26 | - (click)="confirmarArticulo()"> | |
27 | - <div class="col-auto bg-white badge-pill"> | |
28 | - <div class="row justify-content-between"> | |
29 | - <div *ngIf="footerConfirmation" class="col-auto px-0 align-self-center text-primary pl-3"> | |
30 | - <p class="font-weight-bold">{{footerConfirmation | currency}}</p> | |
31 | - </div> | |
32 | - <div class="col-auto px-0"> | |
33 | - <img | |
34 | - draggable="false" | |
35 | - ondragstart="return false;" | |
36 | - (contextmenu)="false" | |
37 | - class="d-block ml-auto my-1 icon-30 pr-2" | |
38 | - src="assets/img/ir-color.svg"> | |
39 | - </div> | |
24 | + </div> | |
25 | + <div class="modal-body"> | |
26 | + <div class="row justify-content-between mx-0 w-100"> | |
27 | + <div class="col-7 col-md-8 pl-0 align-self-center"> | |
28 | + <p *ngIf="footerMessageFirst" class="text-white"><small>{{footerMessageFirst}}</small></p > | |
29 | + <p *ngIf="footerMessageSecond" class="h1 text-white">{{footerMessageSecond}}</p> | |
30 | + </div> | |
31 | + <div class="col-5 col-md-4 align-self-center"> | |
32 | + <div | |
33 | + class="row justify-content-between bg-white badge-pill btn-effect" | |
34 | + *ngIf="footerConfirmation" | |
35 | + (click)="confirmar()"> | |
36 | + <div class="col-auto px-0 align-self-center text-primary pl-3"> | |
37 | + <p class="font-weight-bold">{{footerConfirmation | currency}}</p> | |
38 | + </div> | |
39 | + <div class="col-auto px-0"> | |
40 | + <img | |
41 | + draggable="false" | |
42 | + ondragstart="return false;" | |
43 | + (contextmenu)="false" | |
44 | + class="d-block ml-auto my-1 icon-20" | |
45 | + src="assets/img/ir-color.svg"> | |
40 | 46 | </div> |
41 | 47 | </div> |
42 | - </div> | |
43 | - <div *ngIf="footerClose" class="bg-white badge-pill mt-2"> | |
44 | - <div class="row justify-content-between"> | |
45 | - <div | |
46 | - class="col-auto mx-0 " | |
47 | - (click)="close()"> | |
48 | - <p class="font-weight-bold text-center text-primary">{{footerClose}}</p> | |
48 | + <div | |
49 | + *ngIf="footerClose" | |
50 | + class="row justify-content-center bg-white badge-pill btn-effect mt-2" | |
51 | + (click)="close()"> | |
52 | + <div class="col-auto px-0 ml-auto"> | |
53 | + <p class="font-weight-bold text-primary">{{footerClose}}</p> | |
49 | 54 | </div> |
50 | - <i class="fas fa-undo-alt text-info mr-3 my-auto"></i> | |
55 | + <i class="fas fa-undo-alt text-info ml-auto my-auto"></i> | |
51 | 56 | </div> |
52 | 57 | </div> |
53 | 58 | </div> |
src/app/shared/confirmacion/confirmacion.component.ts
... | ... | @@ -17,7 +17,7 @@ export class ConfirmacionComponent implements OnInit { |
17 | 17 | footerConfirmation: number; |
18 | 18 | footerClose: string; |
19 | 19 | onClose: Subject<any>; |
20 | - urlImagenes = `${APP_SETTINGS.apiDeboSuite}/imagenes/`; | |
20 | + urlImagenes = `${APP_SETTINGS.apiImagenes}/imagenes/`; | |
21 | 21 | |
22 | 22 | constructor( |
23 | 23 | public modalRef: BsModalRef, |
... | ... | @@ -29,12 +29,13 @@ export class ConfirmacionComponent implements OnInit { |
29 | 29 | ngOnInit() { |
30 | 30 | } |
31 | 31 | |
32 | - confirmarArticulo() { | |
33 | - this.onClose.next(); | |
32 | + confirmar() { | |
33 | + this.onClose.next(true); | |
34 | 34 | this.modalRef.hide(); |
35 | 35 | } |
36 | 36 | |
37 | 37 | close() { |
38 | + this.onClose.next(); | |
38 | 39 | this.modalRef.hide(); |
39 | 40 | } |
40 | 41 |
src/app/shared/error-forma-pago/error-forma-pago.component.html
... | ... | @@ -0,0 +1,17 @@ |
1 | +<div class="bg-primary text-center rounded"> | |
2 | + <div class="modal-body"> | |
3 | + <p class="h1 text-white text-center mx-3">Algo saliรณ mal, intentalo de nuevo o</p> | |
4 | + <p class="h1 text-white text-center mx-3 mb-3">probรก con otra forma de pago</p> | |
5 | + <div | |
6 | + class="d-inline-block py-1 btn-effect bg-white badge-pill" | |
7 | + (click)="continuar()"> | |
8 | + CONTINUAR | |
9 | + <img | |
10 | + draggable="false" | |
11 | + ondragstart="return false;" | |
12 | + (contextmenu)="false" | |
13 | + class="icon-30" | |
14 | + src="assets/img/ir-color.svg"> | |
15 | + </div> | |
16 | + </div> | |
17 | +</div> |
src/app/shared/error-forma-pago/error-forma-pago.component.scss
src/app/shared/error-forma-pago/error-forma-pago.component.spec.ts
... | ... | @@ -0,0 +1,25 @@ |
1 | +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | |
2 | + | |
3 | +import { ErrorFormaPagoComponent } from './error-forma-pago.component'; | |
4 | + | |
5 | +describe('ErrorFormaPagoComponent', () => { | |
6 | + let component: ErrorFormaPagoComponent; | |
7 | + let fixture: ComponentFixture<ErrorFormaPagoComponent>; | |
8 | + | |
9 | + beforeEach(async(() => { | |
10 | + TestBed.configureTestingModule({ | |
11 | + declarations: [ ErrorFormaPagoComponent ] | |
12 | + }) | |
13 | + .compileComponents(); | |
14 | + })); | |
15 | + | |
16 | + beforeEach(() => { | |
17 | + fixture = TestBed.createComponent(ErrorFormaPagoComponent); | |
18 | + component = fixture.componentInstance; | |
19 | + fixture.detectChanges(); | |
20 | + }); | |
21 | + | |
22 | + it('should create', () => { | |
23 | + expect(component).toBeTruthy(); | |
24 | + }); | |
25 | +}); |
src/app/shared/error-forma-pago/error-forma-pago.component.ts
... | ... | @@ -0,0 +1,24 @@ |
1 | +import { Component, OnInit } from '@angular/core'; | |
2 | +import { Location } from '@angular/common'; | |
3 | +import { BsModalRef } from 'ngx-bootstrap/modal'; | |
4 | + | |
5 | +@Component({ | |
6 | + selector: 'app-error-forma-pago', | |
7 | + templateUrl: './error-forma-pago.component.html', | |
8 | + styleUrls: ['./error-forma-pago.component.scss'] | |
9 | +}) | |
10 | +export class ErrorFormaPagoComponent implements OnInit { | |
11 | + | |
12 | + constructor( | |
13 | + private location: Location, | |
14 | + private modalRef: BsModalRef, | |
15 | + ) { } | |
16 | + | |
17 | + ngOnInit() { } | |
18 | + | |
19 | + continuar() { | |
20 | + this.location.back(); | |
21 | + this.modalRef.hide(); | |
22 | + } | |
23 | + | |
24 | +} |
src/app/shared/footer/footer.component.ts
src/app/shared/header-publicidad/header-publicidad.component.html
src/app/shared/header-publicidad/header-publicidad.component.ts
... | ... | @@ -18,9 +18,10 @@ import * as _ from 'lodash'; |
18 | 18 | styleUrls: ['./header-publicidad.component.scss'] |
19 | 19 | }) |
20 | 20 | export class HeaderPublicidadComponent implements OnInit { |
21 | - urlImagenes = `${APP_SETTINGS.apiDeboSuite}/imagenes/`; | |
21 | + urlImagenes = `${APP_SETTINGS.apiImagenes}/imagenes/`; | |
22 | 22 | publicidades: IPublicidad[] = []; |
23 | 23 | modalRef: BsModalRef; |
24 | + modalSinonimo: BsModalRef; | |
24 | 25 | |
25 | 26 | constructor( |
26 | 27 | private publicidadService: PublicidadService, |
... | ... | @@ -59,29 +60,34 @@ export class HeaderPublicidadComponent implements OnInit { |
59 | 60 | } |
60 | 61 | |
61 | 62 | openModalPromos(articulo: IArticulo) { |
63 | + if (this.modalRef) return; | |
62 | 64 | this.modalRef = this.modalService.show(PromocionComponent, |
63 | 65 | { |
64 | 66 | initialState: { |
65 | 67 | idArticulo: articulo.id |
66 | 68 | }, |
67 | - class: 'modal-promo modal-dialog-centered' | |
69 | + class: 'modal-dialog-centered' | |
68 | 70 | }); |
69 | 71 | } |
70 | 72 | |
71 | 73 | openModalConfirmacion(articulo: IArticulo) { |
74 | + if (this.modalRef) return; | |
75 | + this.articuloService.setArticulosSinImagen([articulo]); | |
72 | 76 | this.modalRef = this.modalService.show(ConfirmacionComponent, |
73 | 77 | { |
74 | 78 | initialState: { |
75 | 79 | titleMessage: articulo.DET_LAR, |
76 | 80 | imagenPath: articulo.imagenes.length ? articulo.imagenes[0].imagen : 'assets/img/imagen-no-encontrada.jpg', |
77 | - footerMessageFirst: `ยฟDESEA AGREGAR ESTE ARTรCULO`, | |
78 | - footerMessageSecond: `a su carrito?`, | |
79 | - footerConfirmation: articulo.PreVen, | |
80 | - footerClose: `volver` | |
81 | + footerMessageFirst: `ยฟQUERรS AGREGAR ESTE COMBO`, | |
82 | + footerMessageSecond: `a tu carrito?`, | |
83 | + footerConfirmation: articulo.PreVen | |
81 | 84 | }, |
82 | - class: 'modal-promo modal-dialog-centered' | |
85 | + ignoreBackdropClick: true, | |
86 | + class: 'modal-dialog-centered' | |
83 | 87 | }); |
84 | - this.modalRef.content.onClose.subscribe(() => { | |
88 | + this.modalRef.content.onClose.subscribe((resClose) => { | |
89 | + this.modalRef = null; | |
90 | + if (!resClose) return; | |
85 | 91 | this.sinonimoService.getSinonimos(articulo.CodSec, articulo.CodArt) |
86 | 92 | .subscribe((res: ISinonimo[]) => { |
87 | 93 | if (res.length) { |
... | ... | @@ -102,14 +108,15 @@ export class HeaderPublicidadComponent implements OnInit { |
102 | 108 | } |
103 | 109 | |
104 | 110 | openModalSinonimos(sinonimosData: ISinonimo[], articulo: IArticulo) { |
105 | - const modalSinonimo = this.modalService.show(SinonimoComponent, { | |
111 | + if (this.modalSinonimo) return; | |
112 | + this.modalSinonimo = this.modalService.show(SinonimoComponent, { | |
106 | 113 | initialState: { |
107 | 114 | sinonimos: sinonimosData, |
108 | 115 | articulo |
109 | 116 | }, |
110 | - class: 'modal-promo modal-dialog-centered' | |
117 | + class: 'modal-dialog-centered' | |
111 | 118 | }); |
112 | - modalSinonimo.content.onClose | |
119 | + this.modalSinonimo.content.onClose | |
113 | 120 | .subscribe((res: any) => { |
114 | 121 | for (const a of articulo.productos) { |
115 | 122 | for (const aRes of res.articulos) { |
src/app/shared/promocion/promocion.component.html
1 | -<!-- <div class="d-flex justify-content-center" | |
2 | - *ngIf="loading"> | |
3 | - <div class="spinner-border text-primary" role="status"> | |
4 | - <span class="sr-only">Loading...</span> | |
5 | - </div> | |
6 | -</div> --> | |
7 | -<div class="modal-header bg-primary rounded-top pt-4 px-2" *ngIf="articulosPromo.length"> | |
8 | - <img | |
9 | - draggable="false" | |
10 | - ondragstart="return false;" | |
11 | - (contextmenu)="false" | |
12 | - (click)="selectPromo(articulosPromo[0])" | |
13 | - class="btn-effect mt-n3 icon-30 mr-2 position-absolute right-0" | |
14 | - src="assets/img/icono-cancelar-blanco.svg"> | |
15 | - <div class="row mx-0 w-100 justify-content-between mt-3"> | |
16 | - <div class="col-8"> | |
17 | - <p class="h3 mt-n2 text-white">{{articulosPromo[0].DetArt}}</p> | |
18 | - </div> | |
19 | - <div class="col-4 align-self-center"> | |
20 | - <div | |
21 | - class="row mx-0 justify-content-between bg-white badge-pill" | |
22 | - (click)="selectPromo(articulosPromo[0])"> | |
23 | - <div class="col px-0 align-self-center text-primary"> | |
24 | - <p class="font-weight-bold">{{articulosPromo[0].PreVen | currency}}</p> | |
25 | - </div> | |
26 | - <div class="col-3 px-0"> | |
27 | - <img | |
28 | - draggable="false" | |
29 | - ondragstart="return false;" | |
30 | - (contextmenu)="false" | |
31 | - class="d-block ml-auto py-1 icon-30 mr-2 pt-2" | |
32 | - src="assets/img/ir-color.svg"> | |
33 | - </div> | |
1 | +<div class="bg-primary rounded"> | |
2 | + <div class="modal-header" *ngIf="articulosPromo.length"> | |
3 | + <img | |
4 | + draggable="false" | |
5 | + ondragstart="return false;" | |
6 | + (contextmenu)="false" | |
7 | + (click)="selectPromo(articulosPromo[0])" | |
8 | + class="btn-effect icon-30 mt-2 mr-2 position-absolute top-0 right-0 z-index" | |
9 | + src="assets/img/icono-cancelar-blanco.svg"> | |
10 | + <div class="row w-100 no-gutters justify-content-between"> | |
11 | + <div class="col align-self-center"> | |
12 | + <p class="h3 text-white">{{articulosPromo[0].MKT_DESC ? articulosPromo[0].MKT_DESC.toUpperCase() : articulosPromo[0].DetArt.toUpperCase()}}</p> | |
34 | 13 | </div> |
35 | - </div> | |
36 | - </div> | |
37 | -</div> | |
38 | -<div class="modal-body bg-primary rounded-bottom pb-3 px-2" *ngIf="articulosPromo.length"> | |
39 | - <div class="row mx-0 w-100"> | |
40 | - <div class="col-9"> | |
41 | - <p class="text-white"><small>ยฟTE GUSTARรA LLEVAR ESTE ARTรCULO</small></p> | |
42 | - <h1 class="text-white mb-4">en un combo?</h1> | |
43 | - </div> | |
44 | - <div class="col-3"> | |
45 | - <img | |
46 | - draggable="false" | |
47 | - ondragstart="return false;" | |
48 | - (contextmenu)="false" | |
49 | - src="{{urlImagenes}}{{articulosPromo[0].imagenes[0].imagen}}" | |
50 | - onerror="this.src='assets/img/imagen-no-encontrada.jpg'" | |
51 | - class="card-img-top img-fluid rounded-circle"> | |
52 | - </div> | |
53 | - </div> | |
54 | - <div | |
55 | - class="row mx-0 lista-promociones scroll-y-visible" | |
56 | - (scroll)="scrollEvent($event)"> | |
57 | - <div class="col-12"> | |
58 | - <div *ngFor="let promo of promociones"> | |
14 | + <div class="col-auto align-self-center mt-4 pl-2"> | |
59 | 15 | <div |
60 | - class="mx-0 mb-2 btn-effect bg-white badge-pill text-primary" | |
61 | - (click)="selectPromo(promo)"> | |
62 | - <div class="d-flex"> | |
63 | - <p class="text-truncate mr-auto my-auto"><small>{{promo.DetArt}}</small></p> | |
64 | - <p class="font-weight-bold my-auto pr-2"> | |
65 | - <span>{{promo.PreVen | currency}}</span> | |
66 | - </p> | |
16 | + class="row mx-0 justify-content-between bg-white badge-pill btn-effect" | |
17 | + (click)="selectPromo(articulosPromo[0])"> | |
18 | + <div class="col-auto align-self-center text-primary"> | |
19 | + <p class="font-weight-bold">{{articulosPromo[0].PreVen | currency}}</p> | |
20 | + </div> | |
21 | + <div class="col-auto px-0"> | |
67 | 22 | <img |
68 | 23 | draggable="false" |
69 | 24 | ondragstart="return false;" |
70 | 25 | (contextmenu)="false" |
71 | - class="d-block ml-auto py-1 icon-30 mr-2 pt-2" | |
26 | + class="d-block ml-auto my-1 icon-20" | |
72 | 27 | src="assets/img/ir-color.svg"> |
73 | 28 | </div> |
74 | 29 | </div> |
75 | 30 | </div> |
76 | 31 | </div> |
77 | 32 | </div> |
33 | + <div class="modal-body" *ngIf="articulosPromo.length"> | |
34 | + <div class="row no-gutters w-100"> | |
35 | + <div class="col-9 col-9 align-self-center"> | |
36 | + <p class="text-white"><small>ยฟTE GUSTARรA LLEVAR ESTE ARTรCULO</small></p> | |
37 | + <p class="h1 text-white">en un combo?</p> | |
38 | + </div> | |
39 | + <div class="col-3"> | |
40 | + <img | |
41 | + draggable="false" | |
42 | + ondragstart="return false;" | |
43 | + (contextmenu)="false" | |
44 | + src="{{urlImagenes}}{{articulosPromo[0].imagenes[0].imagen}}" | |
45 | + onerror="this.src='assets/img/imagen-no-encontrada.jpg'" | |
46 | + class="card-img-top img-fluid rounded-circle"> | |
47 | + </div> | |
48 | + </div> | |
49 | + <div | |
50 | + class="d-flex justify-content-center mt-2" | |
51 | + *ngIf="loading"> | |
52 | + <div class="spinner-border text-white" role="status"> | |
53 | + <span class="sr-only">Loading...</span> | |
54 | + </div> | |
55 | + </div> | |
56 | + <div | |
57 | + class="row mt-3 no-gutters lista-promociones scroll-y-visible" | |
58 | + (scroll)="scrollEvent($event)"> | |
59 | + <div class="col-12"> | |
60 | + <div *ngFor="let promo of promociones; let i = index"> | |
61 | + <div | |
62 | + [ngClass]="{ 'mt-2': i !== 0 }" | |
63 | + class="btn-effect bg-white badge-pill text-primary" | |
64 | + (click)="selectPromo(promo)"> | |
65 | + <div class="d-flex"> | |
66 | + <p class="text-truncate mr-auto my-auto"><small>{{promo.MKT_DESC ? promo.MKT_DESC.toUpperCase() : promo.DetArt.toUpperCase()}}</small></p> | |
67 | + <p class="font-weight-bold ml-auto my-auto pr-2"> | |
68 | + <span>{{promo.PreVen | currency}}</span> | |
69 | + </p> | |
70 | + <img | |
71 | + draggable="false" | |
72 | + ondragstart="return false;" | |
73 | + (contextmenu)="false" | |
74 | + class="d-block py-1 icon-30" | |
75 | + src="assets/img/ir-color.svg"> | |
76 | + </div> | |
77 | + </div> | |
78 | + </div> | |
79 | + </div> | |
80 | + </div> | |
81 | + </div> | |
78 | 82 | </div> |
src/app/shared/promocion/promocion.component.ts
... | ... | @@ -20,10 +20,13 @@ export class PromocionComponent implements OnInit { |
20 | 20 | articulosPromo: IArticulo[] = []; |
21 | 21 | promociones: IArticulo[] = []; |
22 | 22 | onClose: Subject<any>; |
23 | - urlImagenes = `${APP_SETTINGS.apiDeboSuite}/imagenes/`; | |
23 | + urlImagenes = `${APP_SETTINGS.apiImagenes}/imagenes/`; | |
24 | + loading = true; | |
25 | + modalSinonimo: BsModalRef; | |
26 | + isPromoSelected = false; | |
24 | 27 | |
25 | 28 | constructor( |
26 | - public modalPromocion: BsModalRef, | |
29 | + private modalPromocion: BsModalRef, | |
27 | 30 | private modalService: BsModalService, |
28 | 31 | private articuloService: ArticuloService, |
29 | 32 | private promocionService: PromocionService, |
... | ... | @@ -38,6 +41,8 @@ export class PromocionComponent implements OnInit { |
38 | 41 | } |
39 | 42 | |
40 | 43 | selectPromo(promo: IArticulo) { |
44 | + if (this.isPromoSelected) return; | |
45 | + this.isPromoSelected = true; | |
41 | 46 | this.sinonimoService.getSinonimos(promo.CodSec, promo.CodArt) |
42 | 47 | .subscribe((res: ISinonimo[]) => { |
43 | 48 | if (res.length) { |
... | ... | @@ -51,6 +56,7 @@ export class PromocionComponent implements OnInit { |
51 | 56 | } else { |
52 | 57 | promo.cantidad = 1; |
53 | 58 | this.articuloService.setArticulo(promo); |
59 | + this.onClose.next(); | |
54 | 60 | this.modalPromocion.hide(); |
55 | 61 | } |
56 | 62 | }, err => console.error(err)); |
... | ... | @@ -58,16 +64,24 @@ export class PromocionComponent implements OnInit { |
58 | 64 | } |
59 | 65 | |
60 | 66 | openModalSinonimos(sinonimosData: ISinonimo[], articulo: IArticulo) { |
61 | - const modalSinonimo = this.modalService.show(SinonimoComponent, { | |
67 | + if (this.modalSinonimo) return; | |
68 | + this.modalSinonimo = this.modalService.show(SinonimoComponent, { | |
62 | 69 | initialState: { |
63 | 70 | sinonimos: sinonimosData, |
64 | 71 | articulo |
65 | 72 | }, |
66 | - class: 'modal-promo modal-dialog-centered' | |
73 | + class: 'modal-dialog-centered', | |
74 | + ignoreBackdropClick: true, | |
67 | 75 | }); |
68 | 76 | |
69 | - modalSinonimo.content.onClose | |
77 | + this.modalSinonimo.content.onClose | |
70 | 78 | .subscribe((res: any) => { |
79 | + this.modalSinonimo = null; | |
80 | + if (!res) { | |
81 | + this.onClose.next(); | |
82 | + this.modalPromocion.hide(); | |
83 | + return; | |
84 | + } | |
71 | 85 | for (const a of articulo.productos) { |
72 | 86 | for (const aRes of res.articulos) { |
73 | 87 | if (a.idSinonimo === aRes.ID_SIN) { |
... | ... | @@ -83,6 +97,7 @@ export class PromocionComponent implements OnInit { |
83 | 97 | } |
84 | 98 | } |
85 | 99 | this.articuloService.setArticulo(articulo); |
100 | + this.onClose.next(); | |
86 | 101 | this.modalPromocion.hide(); |
87 | 102 | }); |
88 | 103 | } |
... | ... | @@ -93,6 +108,7 @@ export class PromocionComponent implements OnInit { |
93 | 108 | this.promocionService.getPromociones(sector, codigo) |
94 | 109 | .subscribe((res: IArticulo[]) => { |
95 | 110 | this.promociones = res; |
111 | + this.loading = false; | |
96 | 112 | }, error => { console.error(error); }); |
97 | 113 | } |
98 | 114 |
src/app/shared/sinonimo/sinonimo.component.html
1 | 1 | <div class="bg-primary rounded text-white"> |
2 | 2 | <div class="modal-header"> |
3 | - <p class="col-7 h4 px-0 align-self-center">{{articulo.DetArt}}</p> | |
4 | - <div class="col-5 pr-0 text-right"> | |
3 | + <img | |
4 | + draggable="false" | |
5 | + ondragstart="return false;" | |
6 | + (contextmenu)="false" | |
7 | + (click)="close()" | |
8 | + class="btn-effect icon-30 mt-2 mr-2 position-absolute right-0 top-0 z-index" | |
9 | + src="assets/img/icono-cancelar-blanco.svg"> | |
10 | + <p class="col-7 h4 px-0 align-self-center">{{ articulo.MKT_DESC ? articulo.MKT_DESC.toUpperCase() : articulo.DetArt.toUpperCase() }}</p> | |
11 | + <div class="col-5 pt-4 pr-0 text-right"> | |
5 | 12 | <p *ngFor="let s of sinonimos; let i = index"> |
6 | 13 | <span |
7 | 14 | class="btn-effect" |
src/app/shared/sinonimo/sinonimo.component.ts
... | ... | @@ -17,6 +17,7 @@ export class SinonimoComponent implements OnInit { |
17 | 17 | onClose: Subject<any>; |
18 | 18 | articulosSelected: IArticulo[] = []; |
19 | 19 | articulo: IArticulo; |
20 | + isSinonimoSelected = false; | |
20 | 21 | |
21 | 22 | constructor( |
22 | 23 | private modalRef: BsModalRef, |
... | ... | @@ -50,6 +51,8 @@ export class SinonimoComponent implements OnInit { |
50 | 51 | |
51 | 52 | continue() { |
52 | 53 | if (!this.isValid) return; |
54 | + if (this.isSinonimoSelected) return; | |
55 | + this.isSinonimoSelected = true; | |
53 | 56 | const ID_SINS = []; |
54 | 57 | const observables = []; |
55 | 58 | |
... | ... | @@ -77,7 +80,12 @@ export class SinonimoComponent implements OnInit { |
77 | 80 | |
78 | 81 | scrollTo(index: number) { |
79 | 82 | const el = document.getElementById(index.toString()); |
80 | - el.scrollIntoView({ behavior: 'smooth', block: 'center' }); | |
83 | + el.scrollIntoView({ behavior: 'smooth' }); | |
84 | + } | |
85 | + | |
86 | + close() { | |
87 | + this.modalRef.hide(); | |
88 | + this.onClose.next(); | |
81 | 89 | } |
82 | 90 | |
83 | 91 | } |
src/assets/img/x-amarilla.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="28.6378mm" height="28.6378mm" version="1.1" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd" | |
5 | +viewBox="0 0 1704 1704" | |
6 | + xmlns:xlink="http://www.w3.org/1999/xlink"> | |
7 | + <defs> | |
8 | + <style type="text/css"> | |
9 | + <![CDATA[ | |
10 | + .fil0 {fill:#F4B223;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="510,422 852,790 1194,422 1252,471 910,852 1252,1233 1194,1283 852,914 510,1283 452,1233 794,852 452,471 "/> | |
17 | + <path class="fil0" d="M852 0c235,0 448,95 603,250 154,154 249,367 249,602 0,235 -95,448 -249,603 -155,154 -368,249 -603,249 -235,0 -448,-95 -602,-249 -155,-155 -250,-368 -250,-603 0,-235 95,-448 250,-602 154,-155 367,-250 602,-250zm562 290c-144,-143 -343,-232 -562,-232 -219,0 -418,89 -562,232 -143,144 -232,343 -232,562 0,219 89,418 232,562 144,144 343,232 562,232 219,0 418,-88 562,-232 144,-144 232,-343 232,-562 0,-219 -88,-418 -232,-562z"/> | |
18 | + </g> | |
19 | +</svg> |
src/etc/AppSettings.ejemplo.ts
src/scss/scroll.scss
... | ... | @@ -2,6 +2,7 @@ |
2 | 2 | |
3 | 3 | .scroll-y { |
4 | 4 | overflow-y: auto; |
5 | + overflow-x: hidden; | |
5 | 6 | scrollbar-width: none; |
6 | 7 | &::-webkit-scrollbar { |
7 | 8 | display: none; |
... | ... | @@ -10,6 +11,7 @@ |
10 | 11 | |
11 | 12 | .scroll-y-visible { |
12 | 13 | overflow-y: auto; |
14 | + overflow-x: hidden; | |
13 | 15 | &::-webkit-scrollbar { |
14 | 16 | width: 0.75em; |
15 | 17 | } |
... | ... | @@ -37,6 +39,7 @@ |
37 | 39 | |
38 | 40 | .scroll-x { |
39 | 41 | overflow-x: auto; |
42 | + overflow-y: hidden; | |
40 | 43 | scrollbar-width: none; |
41 | 44 | &::-webkit-scrollbar { |
42 | 45 | display: none; |
src/scss/styles-bootstrap.scss
... | ... | @@ -69,10 +69,8 @@ $border-radius-sm: 0.5rem; |
69 | 69 | background-color: #0000004d; |
70 | 70 | } |
71 | 71 | |
72 | -.modal-promo > div { | |
72 | +.modal-content { | |
73 | 73 | border: none !important; |
74 | - border-radius: $border-radius; | |
75 | - margin-left: 10px !important; | |
76 | 74 | } |
77 | 75 | |
78 | 76 | .modal-content.media-pantalla { |
src/styles.scss