Commit a06557473a19947e6ae5c3995955075a4ab428d2
1 parent
08da9f7ace
Exists in
master
and in
1 other branch
agregada y maquetada pantalla de pago con tarjeta.
Showing
26 changed files
with
204 additions
and
5 deletions
Show diff stats
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 | import { FormsModule, ReactiveFormsModule } from '@angular/forms'; | 6 | import { FormsModule, ReactiveFormsModule } from '@angular/forms'; |
7 | import { TooltipModule } from 'ngx-bootstrap/tooltip'; | 7 | import { TooltipModule } from 'ngx-bootstrap/tooltip'; |
8 | import { PopoverModule } from 'ngx-bootstrap/popover'; | 8 | import { PopoverModule } from 'ngx-bootstrap/popover'; |
9 | import { CarouselModule } from 'ngx-bootstrap/carousel'; | 9 | import { CarouselModule } from 'ngx-bootstrap/carousel'; |
10 | import { PaginationModule } from 'ngx-bootstrap/pagination'; | 10 | import { PaginationModule } from 'ngx-bootstrap/pagination'; |
11 | import { ModalModule } from 'ngx-bootstrap/modal'; | ||
11 | //#endregion | 12 | //#endregion |
12 | 13 | ||
13 | //#region Keyboard | 14 | //#region Keyboard |
14 | import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; | 15 | import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; |
15 | import { MatButtonModule } from '@angular/material/button'; | 16 | import { MatButtonModule } from '@angular/material/button'; |
16 | import { MatKeyboardModule } from '@ngx-material-keyboard/core'; | 17 | import { MatKeyboardModule } from '@ngx-material-keyboard/core'; |
17 | //#endregion | 18 | //#endregion |
18 | 19 | ||
19 | //#region COMPONENTS | 20 | //#region COMPONENTS |
20 | import { AppComponent } from './app.component'; | 21 | import { AppComponent } from './app.component'; |
21 | import { HeaderComponent } from './components/header/header.component'; | 22 | import { HeaderComponent } from './components/header/header.component'; |
22 | import { SidebarComponent } from './components/sidebar/sidebar.component'; | 23 | import { SidebarComponent } from './components/sidebar/sidebar.component'; |
23 | import { HomeComponent } from './components/home/home.component'; | 24 | import { HomeComponent } from './components/home/home.component'; |
24 | import { InicioComponent } from './components/inicio/inicio.component'; | 25 | import { InicioComponent } from './components/inicio/inicio.component'; |
25 | import { BusquedaProductosComponent } from './components/busqueda-productos/busqueda-productos.component'; | 26 | import { BusquedaProductosComponent } from './components/busqueda-productos/busqueda-productos.component'; |
26 | import { ConfirmacionCarritoComponent } from './components/confirmacion-carrito/confirmacion-carrito.component'; | 27 | import { ConfirmacionCarritoComponent } from './components/confirmacion-carrito/confirmacion-carrito.component'; |
27 | import { MasterComponent } from './components/master/master.component'; | 28 | import { MasterComponent } from './components/master/master.component'; |
28 | import { PopoverPromosComponent } from './components/popover-promos/popover-promos.component'; | 29 | import { PopoverPromosComponent } from './components/popover-promos/popover-promos.component'; |
29 | import { PopoverSinonimosComponent } from './components/popover-sinonimos/popover-sinonimos.component'; | 30 | import { PopoverSinonimosComponent } from './components/popover-sinonimos/popover-sinonimos.component'; |
30 | import { CancelarCompraComponent } from './components/cancelar-compra/cancelar-compra.component'; | 31 | import { CancelarCompraComponent } from './components/cancelar-compra/cancelar-compra.component'; |
31 | import { MensajeFinalComponent } from './components/mensaje-final/mensaje-final.component'; | 32 | import { MensajeFinalComponent } from './components/mensaje-final/mensaje-final.component'; |
32 | import { ComandaComponent } from './components/comanda/comanda.component'; | 33 | import { ComandaComponent } from './components/comanda/comanda.component'; |
33 | import { PedidosSalientesComponent } from './components/pedidos-salientes/pedidos-salientes.component'; | 34 | import { PedidosSalientesComponent } from './components/pedidos-salientes/pedidos-salientes.component'; |
35 | import { PagoConTarjetaComponent } from './components/pago-con-tarjeta/pago-con-tarjeta.component'; | ||
34 | //#endregion | 36 | //#endregion |
35 | 37 | ||
36 | @NgModule({ | 38 | @NgModule({ |
37 | declarations: [ | 39 | declarations: [ |
38 | AppComponent, | 40 | AppComponent, |
39 | HeaderComponent, | 41 | HeaderComponent, |
40 | SidebarComponent, | 42 | SidebarComponent, |
41 | HomeComponent, | 43 | HomeComponent, |
42 | InicioComponent, | 44 | InicioComponent, |
43 | BusquedaProductosComponent, | 45 | BusquedaProductosComponent, |
44 | ConfirmacionCarritoComponent, | 46 | ConfirmacionCarritoComponent, |
45 | MasterComponent, | 47 | MasterComponent, |
46 | PopoverPromosComponent, | 48 | PopoverPromosComponent, |
47 | PopoverSinonimosComponent, | 49 | PopoverSinonimosComponent, |
48 | CancelarCompraComponent, | 50 | CancelarCompraComponent, |
49 | MensajeFinalComponent, | 51 | MensajeFinalComponent, |
50 | ComandaComponent, | 52 | ComandaComponent, |
51 | PedidosSalientesComponent | 53 | PedidosSalientesComponent, |
54 | PagoConTarjetaComponent | ||
52 | ], | 55 | ], |
53 | imports: [ | 56 | imports: [ |
54 | BrowserModule, | 57 | BrowserModule, |
55 | AppRoutingModule, | 58 | AppRoutingModule, |
56 | HttpClientModule, | 59 | HttpClientModule, |
57 | FormsModule, | 60 | FormsModule, |
58 | ReactiveFormsModule, | 61 | ReactiveFormsModule, |
59 | ReactiveFormsModule.withConfig({ warnOnNgModelWithFormControl: 'never' }), | 62 | ReactiveFormsModule.withConfig({ warnOnNgModelWithFormControl: 'never' }), |
60 | TooltipModule.forRoot(), | 63 | TooltipModule.forRoot(), |
61 | PopoverModule.forRoot(), | 64 | PopoverModule.forRoot(), |
62 | BrowserAnimationsModule, | 65 | BrowserAnimationsModule, |
63 | MatKeyboardModule, | 66 | MatKeyboardModule, |
64 | MatButtonModule, | 67 | MatButtonModule, |
65 | CarouselModule.forRoot(), | 68 | CarouselModule.forRoot(), |
66 | PaginationModule.forRoot() | 69 | PaginationModule.forRoot(), |
70 | ModalModule.forRoot(), | ||
67 | ], | 71 | ], |
68 | providers: [], | 72 | providers: [], |
69 | bootstrap: [AppComponent] | 73 | bootstrap: [AppComponent], |
74 | entryComponents: [PagoConTarjetaComponent] | ||
70 | }) | 75 | }) |
71 | export class AppModule { } | 76 | export class AppModule { } |
72 | 77 |
src/app/components/confirmacion-carrito/confirmacion-carrito.component.html
1 | <div | 1 | <div |
2 | *ngIf="!compraConEfectivofinalizada && !compraConQRfinalizada" | 2 | *ngIf="!compraConEfectivofinalizada && !compraConQRfinalizada" |
3 | class="row m-0 fade-in bg-primary-gradient disable-user-select" | 3 | class="row m-0 fade-in bg-primary-gradient disable-user-select" |
4 | (click)="reiniciarTimer()"> | 4 | (click)="reiniciarTimer()"> |
5 | <div class="col-12 p-0 vh-100"> | 5 | <div class="col-12 p-0 vh-100"> |
6 | <!-- TOP HEADER --> | 6 | <!-- TOP HEADER --> |
7 | <app-header></app-header> | 7 | <app-header></app-header> |
8 | 8 | ||
9 | <!-- NOMBRE DE SECCION --> | 9 | <!-- NOMBRE DE SECCION --> |
10 | <div class="row m-0"> | 10 | <div class="row m-0"> |
11 | <div class="col-12 p-0"> | 11 | <div class="col-12 p-0"> |
12 | <p class="h5 py-1 bg-gray text-muted text-center m-0"> | 12 | <p class="h5 py-1 bg-gray text-muted text-center m-0"> |
13 | | 13 | |
14 | </p> | 14 | </p> |
15 | </div> | 15 | </div> |
16 | </div> | 16 | </div> |
17 | 17 | ||
18 | <div class="row m-0"> | 18 | <div class="row m-0"> |
19 | <div class="col-10 px-1"> | 19 | <div class="col-10 px-1"> |
20 | <!-- TEXTO DE IZQUIERDA --> | 20 | <!-- TEXTO DE IZQUIERDA --> |
21 | <div *ngIf="!verQR" class="row mx-2 mt-4 text-white"> | 21 | <div *ngIf="!verQR" class="row mx-2 mt-4 text-white"> |
22 | <div class="col-sm-auto my-auto"> | 22 | <div class="col-sm-auto my-auto"> |
23 | <p class="h2">Mi Compra | 23 | <p class="h2">Mi Compra |
24 | <i class="fa fa-shopping-cart "></i> | 24 | <i class="fa fa-shopping-cart "></i> |
25 | </p> | 25 | </p> |
26 | </div> | 26 | </div> |
27 | <div class="col-sm-9 my-auto"> | 27 | <div class="col-sm-9 my-auto"> |
28 | <p class="h4">Por favor, controle y confirme su compra.</p> | 28 | <p class="h4">Por favor, controle y confirme su compra.</p> |
29 | </div> | 29 | </div> |
30 | </div> | 30 | </div> |
31 | 31 | ||
32 | <div [ngClass]="{'mt-5': verQR}" class="row m-0"> | 32 | <div [ngClass]="{'mt-5': verQR}" class="row m-0"> |
33 | <!-- GRILLA DE PRODUCTOS DE MI COMPRA --> | 33 | <!-- GRILLA DE PRODUCTOS DE MI COMPRA --> |
34 | <div *ngIf="!verQR" class="col-sm-9 pr-1"> | 34 | <div *ngIf="!verQR" class="col-sm-9 pr-1"> |
35 | <div class="row mx-1 pr-1 vh-70 overflow-scroll text-dark"> | 35 | <div class="row mx-1 pr-1 vh-70 overflow-scroll text-dark"> |
36 | <div class="mh-100 col-4 p-2" *ngFor="let producto of productos"> | 36 | <div class="mh-100 col-4 p-2" *ngFor="let producto of productos"> |
37 | <div class="row m-0 h-100 bg-white rounded-sm shadow border-0"> | 37 | <div class="row m-0 h-100 bg-white rounded-sm shadow border-0"> |
38 | <div class="d-flex align-items-end flex-column"> | 38 | <div class="d-flex align-items-end flex-column"> |
39 | <div class="w-100"> | 39 | <div class="w-100"> |
40 | <img | 40 | <img |
41 | src="{{apiImagenes}}/imagenes/{{producto.imagenes[0].imagen}}" | 41 | src="{{apiImagenes}}/imagenes/{{producto.imagenes[0].imagen}}" |
42 | class="shadow rounded-sm w-100 m-auto"> | 42 | class="shadow rounded-sm w-100 m-auto"> |
43 | </div> | 43 | </div> |
44 | <div class="w-100 pt-2 px-2"> | 44 | <div class="w-100 pt-2 px-2"> |
45 | <p class="h6 text-left"> | 45 | <p class="h6 text-left"> |
46 | <small class="font-weight-bold"> | 46 | <small class="font-weight-bold"> |
47 | {{producto.DET_LAR}} | 47 | {{producto.DET_LAR}} |
48 | </small> | 48 | </small> |
49 | </p> | 49 | </p> |
50 | <div *ngIf="producto.tieneSinonimos"> | 50 | <div *ngIf="producto.tieneSinonimos"> |
51 | <p *ngFor="let p of producto.productos" class="h6 text-left m-0"> | 51 | <p *ngFor="let p of producto.productos" class="h6 text-left m-0"> |
52 | <small> | 52 | <small> |
53 | - {{p.cantidad * producto.cantidad}} {{p.DET_LAR}} | 53 | - {{p.cantidad * producto.cantidad}} {{p.DET_LAR}} |
54 | </small> | 54 | </small> |
55 | </p> | 55 | </p> |
56 | </div> | 56 | </div> |
57 | </div> | 57 | </div> |
58 | <div class="w-100 d-flex justify-content-between mt-auto mb-1 px-2"> | 58 | <div class="w-100 d-flex justify-content-between mt-auto mb-1 px-2"> |
59 | <span class="text-left m-0 px-1 h6"> | 59 | <span class="text-left m-0 px-1 h6"> |
60 | {{producto.cantidad}} x {{producto.PreVen | currency}} | 60 | {{producto.cantidad}} x {{producto.PreVen | currency}} |
61 | </span> | 61 | </span> |
62 | <span class="text-right m-0 px-1 h6"> | 62 | <span class="text-right m-0 px-1 h6"> |
63 | {{producto.cantidad * producto.PreVen | currency}} | 63 | {{producto.cantidad * producto.PreVen | currency}} |
64 | </span> | 64 | </span> |
65 | </div> | 65 | </div> |
66 | </div> | 66 | </div> |
67 | </div> | 67 | </div> |
68 | </div> | 68 | </div> |
69 | </div> | 69 | </div> |
70 | </div> | 70 | </div> |
71 | 71 | ||
72 | <!-- CODIGO QR --> | 72 | <!-- CODIGO QR --> |
73 | <div *ngIf="verQR" class="col-sm-9"> | 73 | <div *ngIf="verQR" class="col-sm-9"> |
74 | <div class="col-6 offset-3 border-0 mb-auto"> | 74 | <div class="col-6 offset-3 border-0 mb-auto"> |
75 | <img | 75 | <img |
76 | src="{{apiImagenes}}/imagenes/qrmp.jpg" | 76 | src="{{apiImagenes}}/imagenes/qrmp.jpg" |
77 | class="w-100 mx-auto d-block shadow rounded-sm"> | 77 | class="w-100 mx-auto d-block shadow rounded-sm"> |
78 | </div> | 78 | </div> |
79 | </div> | 79 | </div> |
80 | 80 | ||
81 | <!-- TICKET --> | 81 | <!-- TICKET --> |
82 | <div class="col-sm-3 px-1"> | 82 | <div class="col-sm-3 px-1"> |
83 | <div class="card shadow"> | 83 | <div class="card shadow"> |
84 | <div class="card-body"> | 84 | <div class="card-body"> |
85 | <p class="h5 card-title">Su Ticket</p> | 85 | <p class="h5 card-title">Su Ticket</p> |
86 | <div class="row mt-4 m-0"> | 86 | <div class="row mt-4 m-0"> |
87 | <div class="col-12 p-0 mb-2"> | 87 | <div class="col-12 p-0 mb-2"> |
88 | <p class="h6 m-0 card-text text-left"> | 88 | <p class="h6 m-0 card-text text-left"> |
89 | <small class="font-weight-bold">DESCRIPCIÓN</small> | 89 | <small class="font-weight-bold">DESCRIPCIÓN</small> |
90 | </p> | 90 | </p> |
91 | <p class="h6 m-0 card-text text-left"> | 91 | <p class="h6 m-0 card-text text-left"> |
92 | <small class="font-weight-bold">CANTIDAD X PRECIO UNITARIO</small> | 92 | <small class="font-weight-bold">CANTIDAD X PRECIO UNITARIO</small> |
93 | </p> | 93 | </p> |
94 | </div> | 94 | </div> |
95 | </div> | 95 | </div> |
96 | <div class="row vh-50 px-2 overflow-scroll m-0"> | 96 | <div class="row vh-50 px-2 overflow-scroll m-0"> |
97 | <div class="col-12 p-0 mb-2" *ngFor="let producto of productos"> | 97 | <div class="col-12 p-0 mb-2" *ngFor="let producto of productos"> |
98 | <p class="h6 m-0 card-text text-left"> | 98 | <p class="h6 m-0 card-text text-left"> |
99 | <small>{{producto.DET_LAR}}</small> | 99 | <small>{{producto.DET_LAR}}</small> |
100 | </p> | 100 | </p> |
101 | <div class="row d-flex justify-content-between m-0"> | 101 | <div class="row d-flex justify-content-between m-0"> |
102 | <div class="col p-0"> | 102 | <div class="col p-0"> |
103 | <p class="h6 m-0 card-text text-left"> | 103 | <p class="h6 m-0 card-text text-left"> |
104 | <small>{{producto.cantidad}} x {{producto.PreVen | currency}}</small> | 104 | <small>{{producto.cantidad}} x {{producto.PreVen | currency}}</small> |
105 | </p> | 105 | </p> |
106 | </div> | 106 | </div> |
107 | <div class="col p-0"> | 107 | <div class="col p-0"> |
108 | <p class="h6 m-0 card-text text-right"> | 108 | <p class="h6 m-0 card-text text-right"> |
109 | <small>{{(producto.PreVen) * (producto.cantidad) | currency}}</small> | 109 | <small>{{(producto.PreVen) * (producto.cantidad) | currency}}</small> |
110 | </p> | 110 | </p> |
111 | </div> | 111 | </div> |
112 | </div> | 112 | </div> |
113 | </div> | 113 | </div> |
114 | </div> | 114 | </div> |
115 | <p class="h4 font-weight-bold card-text text-right mt-3 mb-0"> | 115 | <p class="h4 font-weight-bold card-text text-right mt-3 mb-0"> |
116 | Total {{getTotal() | currency}} | 116 | Total {{getTotal() | currency}} |
117 | </p> | 117 | </p> |
118 | </div> | 118 | </div> |
119 | </div> | 119 | </div> |
120 | </div> | 120 | </div> |
121 | </div> | 121 | </div> |
122 | 122 | ||
123 | <!-- OPCIONES ABAJO DERECHA --> | 123 | <!-- OPCIONES ABAJO DERECHA --> |
124 | <div class="row m-0 fixed-bottom"> | 124 | <div class="row m-0 fixed-bottom"> |
125 | <div class="col-sm-2 offset-sm-10 p-0 mt-auto"> | 125 | <div class="col-sm-2 offset-sm-10 p-0 mt-auto"> |
126 | <div class="card m-2 rounded-top-sm mt-auto blue-gradient border-0"> | 126 | <div class="card m-2 rounded-top-sm mt-auto blue-gradient border-0"> |
127 | <div class="card-body row m-0 p-1"> | 127 | <div class="card-body row m-0 p-1"> |
128 | <div class="col-12 p-3"> | 128 | <div class="col-12 p-3"> |
129 | <button | 129 | <button |
130 | type="button" | 130 | type="button" |
131 | class="btn btn-block btn-light shadow btn-sm shadow" | 131 | class="btn btn-block btn-light shadow btn-sm shadow" |
132 | (click)="volverPreviousPage()"> | 132 | (click)="volverPreviousPage()"> |
133 | <span class="pr-2">Volver</span> | 133 | <span class="pr-2">Volver</span> |
134 | <i class="fa fa-undo text-warning"></i> | 134 | <i class="fa fa-undo text-warning"></i> |
135 | </button> | 135 | </button> |
136 | <button | 136 | <button |
137 | type="button" | 137 | type="button" |
138 | class="btn btn-block btn-light shadow btn-sm shadow" | 138 | class="btn btn-block btn-light shadow btn-sm shadow" |
139 | [routerLink]="['/cancelar-compra']"> | 139 | [routerLink]="['/cancelar-compra']"> |
140 | <span class="pr-2">Cancelar</span> | 140 | <span class="pr-2">Cancelar</span> |
141 | <i class="fa fa-times text-danger"></i> | 141 | <i class="fa fa-times text-danger"></i> |
142 | </button> | 142 | </button> |
143 | </div> | 143 | </div> |
144 | </div> | 144 | </div> |
145 | </div> | 145 | </div> |
146 | </div> | 146 | </div> |
147 | </div> | 147 | </div> |
148 | </div> | 148 | </div> |
149 | 149 | ||
150 | <!-- FORMAS DE PAGO --> | 150 | <!-- FORMAS DE PAGO --> |
151 | <div *ngIf="!verQR" class="col-2 px-1"> | 151 | <div *ngIf="!verQR" class="col-2 px-1"> |
152 | <p class="h4 text-white text-center mt-4 mx-2 pb-2 border-bottom border-white"> | 152 | <p class="h4 text-white text-center mt-4 mx-2 pb-2 border-bottom border-white"> |
153 | Forma de pago | 153 | Forma de pago |
154 | </p> | 154 | </p> |
155 | 155 | ||
156 | <!-- EFECTIVO --> | 156 | <!-- EFECTIVO --> |
157 | <div | 157 | <div |
158 | class="row card-effect card-forma-pago mx-1 my-3 rounded-sm shadow-sm bg-white" | 158 | class="row card-effect card-forma-pago mx-1 my-3 rounded-sm shadow-sm bg-white" |
159 | (click)="pagar(1)"> | 159 | (click)="pagar(1)"> |
160 | <div class="col-7 text-center my-auto px-2"> | 160 | <div class="col-7 text-center my-auto px-2"> |
161 | <span class="h5 font-weight-bold">Efectivo</span> | 161 | <span class="h5 font-weight-bold">Efectivo</span> |
162 | </div> | 162 | </div> |
163 | <div class="col-5 my-auto p-0"> | 163 | <div class="col-5 my-auto p-0"> |
164 | <img | 164 | <img |
165 | src="{{apiImagenes}}/imagenes/efectivo.png" | 165 | src="{{apiImagenes}}/imagenes/efectivo.png" |
166 | class="w-100 float-right"> | 166 | class="w-100 float-right"> |
167 | </div> | 167 | </div> |
168 | </div> | 168 | </div> |
169 | 169 | ||
170 | <!-- TARJETA --> | 170 | <!-- TARJETA --> |
171 | <div class="row card-effect card-forma-pago mx-1 my-3 rounded-sm shadow-sm bg-white"> | 171 | <div class="row card-effect card-forma-pago mx-1 my-3 rounded-sm shadow-sm bg-white" |
172 | (click)="abrirPagoConTarjeta()"> | ||
172 | <div class="col-7 text-center my-auto px-2"> | 173 | <div class="col-7 text-center my-auto px-2"> |
173 | <span class="h5 font-weight-bold">Tarjeta</span> | 174 | <span class="h5 font-weight-bold">Tarjeta</span> |
174 | </div> | 175 | </div> |
175 | <div class="col-5 my-auto p-0"> | 176 | <div class="col-5 my-auto p-0"> |
176 | <img | 177 | <img |
177 | src="{{apiImagenes}}/imagenes/tarjeta.png" | 178 | src="{{apiImagenes}}/imagenes/tarjeta.png" |
178 | class="w-100 float-right"> | 179 | class="w-100 float-right"> |
179 | </div> | 180 | </div> |
180 | </div> | 181 | </div> |
181 | 182 | ||
182 | <!-- QR --> | 183 | <!-- QR --> |
183 | <div | 184 | <div |
184 | class="row card-effect card-forma-pago mx-1 my-3 rounded-sm shadow-sm bg-white" | 185 | class="row card-effect card-forma-pago mx-1 my-3 rounded-sm shadow-sm bg-white" |
185 | (click)="pagar(9)"> | 186 | (click)="pagar(9)"> |
186 | <div class="col-7 text-center my-auto px-2"> | 187 | <div class="col-7 text-center my-auto px-2"> |
187 | <span class="h5 font-weight-bold">Pago Electrónico</span> | 188 | <span class="h5 font-weight-bold">Pago Electrónico</span> |
188 | </div> | 189 | </div> |
189 | <div class="col-5 my-auto p-0"> | 190 | <div class="col-5 my-auto p-0"> |
190 | <img | 191 | <img |
191 | src="{{apiImagenes}}/imagenes/qr.png" | 192 | src="{{apiImagenes}}/imagenes/qr.png" |
192 | class="w-100 float-right"> | 193 | class="w-100 float-right"> |
193 | </div> | 194 | </div> |
194 | </div> | 195 | </div> |
195 | </div> | 196 | </div> |
196 | </div> | 197 | </div> |
197 | 198 | ||
198 | </div> | 199 | </div> |
199 | </div> | 200 | </div> |
200 | 201 | ||
201 | <div | 202 | <div |
202 | *ngIf="compraConQRfinalizada" | 203 | *ngIf="compraConQRfinalizada" |
203 | [routerLink]="['/mensaje-final']" | 204 | [routerLink]="['/mensaje-final']" |
204 | class="row m-0 fade-in bg-primary-gradient disable-user-select vh-100"> | 205 | class="row m-0 fade-in bg-primary-gradient disable-user-select vh-100"> |
205 | <div class="col-12 text-center text-white my-auto"> | 206 | <div class="col-12 text-center text-white my-auto"> |
206 | <p class="font-weight-bold display-4"> | 207 | <p class="font-weight-bold display-4"> |
207 | Su pago fue<br> | 208 | Su pago fue<br> |
208 | acreditado | 209 | acreditado |
209 | exitosamente | 210 | exitosamente |
210 | </p> | 211 | </p> |
211 | <p class="font-weight-bold display-4">Recuerde retirar su ticket</p> | 212 | <p class="font-weight-bold display-4">Recuerde retirar su ticket</p> |
212 | </div> | 213 | </div> |
213 | <div class="row z-index-0 fixed-top m-0 w-100"> | 214 | <div class="row z-index-0 fixed-top m-0 w-100"> |
214 | <div class="col-12 p-3"> | 215 | <div class="col-12 p-3"> |
215 | <img class="w-15 float-right" src="../../../assets/img/debo-gray.png"> | 216 | <img class="w-15 float-right" src="../../../assets/img/debo-gray.png"> |
216 | </div> | 217 | </div> |
217 | </div> | 218 | </div> |
218 | </div> | 219 | </div> |
219 | 220 | ||
220 | <div | 221 | <div |
221 | *ngIf="compraConEfectivofinalizada" | 222 | *ngIf="compraConEfectivofinalizada" |
222 | [routerLink]="['/mensaje-final']" | 223 | [routerLink]="['/mensaje-final']" |
223 | class="row m-0 fade-in bg-primary-gradient disable-user-select vh-100"> | 224 | class="row m-0 fade-in bg-primary-gradient disable-user-select vh-100"> |
224 | <div class="col-12 text-center text-white my-auto"> | 225 | <div class="col-12 text-center text-white my-auto"> |
225 | <p class="font-weight-bold display-4"> | 226 | <p class="font-weight-bold display-4"> |
226 | Retire su ticket<br> | 227 | Retire su ticket<br> |
227 | y diríjase a caja para<br> | 228 | y diríjase a caja para<br> |
228 | efectuar el pago. | 229 | efectuar el pago. |
229 | </p> | 230 | </p> |
230 | </div> | 231 | </div> |
231 | <div class="row z-index-0 fixed-top m-0 w-100"> | 232 | <div class="row z-index-0 fixed-top m-0 w-100"> |
232 | <div class="col-12 p-3"> | 233 | <div class="col-12 p-3"> |
233 | <img class="w-15 float-right" src="../../../assets/img/debo-gray.png"> | 234 | <img class="w-15 float-right" src="../../../assets/img/debo-gray.png"> |
234 | </div> | 235 | </div> |
235 | </div> | 236 | </div> |
236 | </div> | 237 | </div> |
237 | 238 |
src/app/components/confirmacion-carrito/confirmacion-carrito.component.ts
1 | import { Component, OnInit, OnDestroy } from '@angular/core'; | 1 | import { Component, OnInit, OnDestroy } from '@angular/core'; |
2 | import { appSettings } from 'src/etc/AppSettings'; | 2 | import { appSettings } from 'src/etc/AppSettings'; |
3 | import { Location } from '@angular/common'; | 3 | import { Location } from '@angular/common'; |
4 | import { ProductoService } from 'src/app/services/producto.service'; | 4 | import { ProductoService } from 'src/app/services/producto.service'; |
5 | import { Producto } from 'src/app/wrappers/producto'; | 5 | import { Producto } from 'src/app/wrappers/producto'; |
6 | import { Router } from '@angular/router'; | 6 | import { Router } from '@angular/router'; |
7 | import { Subscription } from 'rxjs'; | 7 | import { Subscription } from 'rxjs'; |
8 | import { BsModalService } from 'ngx-bootstrap'; | ||
9 | import { PagoConTarjetaComponent } from '../pago-con-tarjeta/pago-con-tarjeta.component'; | ||
8 | 10 | ||
9 | @Component({ | 11 | @Component({ |
10 | selector: 'app-confirmacion-carrito', | 12 | selector: 'app-confirmacion-carrito', |
11 | templateUrl: './confirmacion-carrito.component.html', | 13 | templateUrl: './confirmacion-carrito.component.html', |
12 | styleUrls: ['./confirmacion-carrito.component.scss'] | 14 | styleUrls: ['./confirmacion-carrito.component.scss'] |
13 | }) | 15 | }) |
14 | export class ConfirmacionCarritoComponent implements OnInit, OnDestroy { | 16 | export class ConfirmacionCarritoComponent implements OnInit, OnDestroy { |
15 | 17 | ||
16 | private productos: Producto[] = []; | 18 | private productos: Producto[] = []; |
17 | private total: number = 0; | 19 | private total: number = 0; |
18 | private apiImagenes: string = appSettings.apiImagenes; | 20 | private apiImagenes: string = appSettings.apiImagenes; |
19 | private timerReposo: any; | 21 | private timerReposo: any; |
20 | private compraConEfectivofinalizada: boolean = false; | 22 | private compraConEfectivofinalizada: boolean = false; |
21 | private compraConQRfinalizada: boolean = false; | 23 | private compraConQRfinalizada: boolean = false; |
22 | private verQR: boolean = false; | 24 | private verQR: boolean = false; |
23 | private subscribePago: Subscription; | 25 | private subscribePago: Subscription; |
24 | 26 | ||
25 | constructor( | 27 | constructor( |
26 | private location: Location, | 28 | private location: Location, |
27 | private productoService: ProductoService, | 29 | private productoService: ProductoService, |
28 | private router: Router | 30 | private router: Router, |
31 | private modalService: BsModalService, | ||
29 | ) { } | 32 | ) { } |
30 | 33 | ||
31 | ngOnInit() { | 34 | ngOnInit() { |
32 | 35 | ||
33 | this.timerReposo = setTimeout(() => { | 36 | this.timerReposo = setTimeout(() => { |
34 | 37 | ||
35 | this.router.navigate(['cancelar-compra']); | 38 | this.router.navigate(['cancelar-compra']); |
36 | }, 90000) | 39 | }, 90000) |
37 | this.productos = this.productoService.productos; | 40 | this.productos = this.productoService.productos; |
38 | } | 41 | } |
39 | 42 | ||
40 | ngOnDestroy() { | 43 | ngOnDestroy() { |
41 | 44 | ||
42 | this.subscribePago.unsubscribe(); | 45 | this.subscribePago.unsubscribe(); |
43 | clearTimeout(this.timerReposo); | 46 | clearTimeout(this.timerReposo); |
44 | } | 47 | } |
45 | 48 | ||
46 | volverPreviousPage() { | 49 | volverPreviousPage() { |
47 | 50 | ||
48 | this.subscribePago.unsubscribe(); | 51 | this.subscribePago.unsubscribe(); |
49 | 52 | ||
50 | if (this.verQR) { | 53 | if (this.verQR) { |
51 | this.verQR = !this.verQR; | 54 | this.verQR = !this.verQR; |
52 | return; | 55 | return; |
53 | } | 56 | } |
54 | 57 | ||
55 | this.location.back(); | 58 | this.location.back(); |
56 | } | 59 | } |
57 | 60 | ||
58 | getTotal() { | 61 | getTotal() { |
59 | 62 | ||
60 | var subTotal = 0; | 63 | var subTotal = 0; |
61 | this.productos.forEach(producto => { | 64 | this.productos.forEach(producto => { |
62 | 65 | ||
63 | subTotal = subTotal + (producto.PreVen * producto.cantidad); | 66 | subTotal = subTotal + (producto.PreVen * producto.cantidad); |
64 | }); | 67 | }); |
65 | return this.total = subTotal; | 68 | return this.total = subTotal; |
66 | } | 69 | } |
67 | 70 | ||
68 | reiniciarTimer() { | 71 | reiniciarTimer() { |
69 | 72 | ||
70 | clearTimeout(this.timerReposo); | 73 | clearTimeout(this.timerReposo); |
71 | this.timerReposo = setTimeout(() => { | 74 | this.timerReposo = setTimeout(() => { |
72 | 75 | ||
73 | this.router.navigate(['cancelar-compra']); | 76 | this.router.navigate(['cancelar-compra']); |
74 | }, 90000) | 77 | }, 90000) |
75 | } | 78 | } |
76 | 79 | ||
77 | //#region METODOS PARA LA FORMA DE PAGO | 80 | //#region METODOS PARA LA FORMA DE PAGO |
78 | pagar(medioPago: number) { | 81 | pagar(medioPago: number) { |
79 | 82 | ||
80 | if (medioPago === 9) { | 83 | if (medioPago === 9) { |
81 | 84 | ||
82 | this.verQR = true; | 85 | this.verQR = true; |
83 | } | 86 | } |
84 | 87 | ||
85 | this.subscribePago = this.productoService.pagar(medioPago) | 88 | this.subscribePago = this.productoService.pagar(medioPago) |
86 | .subscribe(() => { | 89 | .subscribe(() => { |
87 | 90 | ||
88 | clearTimeout(this.timerReposo); | 91 | clearTimeout(this.timerReposo); |
89 | 92 | ||
90 | if (medioPago === 1) { | 93 | if (medioPago === 1) { |
91 | 94 | ||
92 | this.compraConEfectivofinalizada = true; | 95 | this.compraConEfectivofinalizada = true; |
93 | } else if (medioPago === 9) { | 96 | } else if (medioPago === 9) { |
94 | 97 | ||
95 | this.compraConQRfinalizada = true; | 98 | this.compraConQRfinalizada = true; |
96 | } | 99 | } |
97 | 100 | ||
98 | setTimeout(() => { | 101 | setTimeout(() => { |
99 | 102 | ||
100 | this.router.navigate(['mensaje-final']); | 103 | this.router.navigate(['mensaje-final']); |
101 | }, 10000); | 104 | }, 10000); |
102 | }, err => { | 105 | }, err => { |
103 | console.log(err); | 106 | console.log(err); |
104 | alert('algo salió mal'); | 107 | alert('algo salió mal'); |
105 | }) | 108 | }) |
106 | } | 109 | } |
107 | //#endregion | 110 | //#endregion |
108 | 111 | ||
112 | abrirPagoConTarjeta() { | ||
113 | |||
114 | this.modalService.show(PagoConTarjetaComponent, { | ||
115 | class: 'modal-lg', | ||
116 | ignoreBackdropClick: true, | ||
117 | initialState: { importeTotal: this.total }, | ||
118 | }); | ||
119 | } | ||
109 | } | 120 | } |
110 | 121 |
src/app/components/pago-con-tarjeta/pago-con-tarjeta.component.html
File was created | 1 | <div class="modal-header p-2"> | |
2 | <div class="row m-0 w-100"> | ||
3 | <div class="col"> | ||
4 | <span class="h4 m-0">Pago con tarjeta</span> | ||
5 | </div> | ||
6 | </div> | ||
7 | </div> | ||
8 | |||
9 | <div class="modal-body" id="modal-body"> | ||
10 | <div class="w-75 mx-auto card-columns"> | ||
11 | <div | ||
12 | class="card card-effect shadow-sm rounded-sm" | ||
13 | *ngFor="let tarjeta of tarjetas" | ||
14 | [ngClass]="{'active': tarjetaSeleccionada && tarjetaSeleccionada.ID === tarjeta.ID}" | ||
15 | (click)="seleccionarTarjeta(tarjeta)"> | ||
16 | <img | ||
17 | class="w-100 p-1" | ||
18 | src="../../../assets/img/{{tarjeta.nombreImagen ? tarjeta.nombreImagen : 'generica.png'}}"> | ||
19 | </div> | ||
20 | </div> | ||
21 | <div class="border-top w-75 mx-auto" *ngIf="showForm"> | ||
22 | <div class="row mt-2 fade-in"> | ||
23 | <form class="col"> | ||
24 | <div class="row py-3"> | ||
25 | <div class="col-auto pr-1"> | ||
26 | <span class="font-weight-bold">{{tarjetaSeleccionada.ID}}</span> | ||
27 | </div> | ||
28 | <div class="col-auto pl-2"> | ||
29 | <span class="font-weight-bold">{{tarjetaSeleccionada.NOM}}</span> | ||
30 | </div> | ||
31 | </div> | ||
32 | <div class="row pb-3"> | ||
33 | <div class="col-auto pr-1"> | ||
34 | <span>Importe</span> | ||
35 | </div> | ||
36 | <div class="col-auto pl-2"> | ||
37 | <span class="font-weight-bold">{{ importeTotal | currency}}</span> | ||
38 | </div> | ||
39 | </div> | ||
40 | <div class="row pb-3"> | ||
41 | <div class="col-auto pr-1 my-auto"> | ||
42 | <span>Terminal Nº</span> | ||
43 | </div> | ||
44 | <div class="col-12 col-md-auto pl-md-1"> | ||
45 | <input | ||
46 | class="form-control form-control-sm" | ||
47 | type="number"> | ||
48 | </div> | ||
49 | </div> | ||
50 | <div class="row pb-3"> | ||
51 | <div class="col-auto pr-1 my-auto"> | ||
52 | <span>Número de Cupón</span> | ||
53 | </div> | ||
54 | <div class="col-12 col-md-auto pl-md-1"> | ||
55 | <input | ||
56 | class="form-control form-control-sm" | ||
57 | type="number"> | ||
58 | </div> | ||
59 | </div> | ||
60 | <div class="row pb-3"> | ||
61 | <div class="col-auto pr-1 my-auto"> | ||
62 | <span>Cuotas</span> | ||
63 | </div> | ||
64 | <div class="col-12 col-md-auto pl-md-1"> | ||
65 | <input | ||
66 | class="form-control form-control-sm" | ||
67 | type="number"> | ||
68 | </div> | ||
69 | </div> | ||
70 | </form> | ||
71 | </div> | ||
72 | </div> | ||
73 | </div> | ||
74 | |||
75 | <div class="modal-footer py-1"> | ||
76 | <button | ||
77 | class="btn btn-sm btn-secondary" | ||
78 | type="button" | ||
79 | (click)="close()"> | ||
80 | Cancelar | ||
81 | </button> | ||
82 | <button | ||
83 | class="btn btn-sm btn-primary" | ||
84 | type="button"> | ||
85 | Guardar | ||
86 | </button> | ||
87 | </div> | ||
88 |
src/app/components/pago-con-tarjeta/pago-con-tarjeta.component.scss
File was created | 1 | app-pago-con-tarjeta { | |
2 | user-select: none !important; | ||
3 | } | ||
4 | |||
5 | .card-columns { | ||
6 | column-count: 6 !important; | ||
7 | column-gap: 0.5rem !important; | ||
8 | @media (max-width: 576px) { | ||
9 | column-count: 3 !important; | ||
10 | } | ||
11 | } | ||
12 | |||
13 | .card-effect { | ||
14 | border-width: 2px !important; | ||
15 | &:hover { | ||
16 | background-color: #c9c9c9b3 !important; | ||
17 | transition: background-color 0.3s; | ||
18 | } | ||
19 | &:active { | ||
20 | border-color: #2872ae !important; | ||
21 | transition: background-color 0.3s; | ||
22 | } | ||
23 | } | ||
24 | |||
25 | .active { | ||
26 | border-color: #2872ae !important; | ||
27 | transition: background-color 0.3s; | ||
28 | } | ||
29 |
src/app/components/pago-con-tarjeta/pago-con-tarjeta.component.spec.ts
File was created | 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | |
2 | |||
3 | import { PagoConTarjetaComponent } from './pago-con-tarjeta.component'; | ||
4 | |||
5 | describe('PagoConTarjetaComponent', () => { | ||
6 | let component: PagoConTarjetaComponent; | ||
7 | let fixture: ComponentFixture<PagoConTarjetaComponent>; | ||
8 | |||
9 | beforeEach(async(() => { | ||
10 | TestBed.configureTestingModule({ | ||
11 | declarations: [ PagoConTarjetaComponent ] | ||
12 | }) | ||
13 | .compileComponents(); | ||
14 | })); | ||
15 | |||
16 | beforeEach(() => { | ||
17 | fixture = TestBed.createComponent(PagoConTarjetaComponent); | ||
18 | component = fixture.componentInstance; | ||
19 | fixture.detectChanges(); | ||
20 | }); | ||
21 | |||
22 | it('should create', () => { | ||
23 | expect(component).toBeTruthy(); | ||
24 | }); | ||
25 | }); | ||
26 |
src/app/components/pago-con-tarjeta/pago-con-tarjeta.component.ts
File was created | 1 | import { Component, OnInit } from '@angular/core'; | |
2 | import { BsModalRef } from 'ngx-bootstrap'; | ||
3 | import { TarjetasService } from 'src/app/services/tarjetas.service'; | ||
4 | import { Tarjeta } from 'src/app/wrappers/tarjeta'; | ||
5 | |||
6 | @Component({ | ||
7 | selector: 'app-pago-con-tarjeta', | ||
8 | templateUrl: './pago-con-tarjeta.component.html', | ||
9 | styleUrls: ['./pago-con-tarjeta.component.scss'], | ||
10 | }) | ||
11 | export class PagoConTarjetaComponent implements OnInit { | ||
12 | |||
13 | private tarjetas: Tarjeta[] = []; | ||
14 | private tarjetaSeleccionada: Tarjeta; | ||
15 | private showForm = false; | ||
16 | private importeTotal: number; | ||
17 | |||
18 | constructor( | ||
19 | private modalRef: BsModalRef, | ||
20 | private tarjetasService: TarjetasService, | ||
21 | ) { } | ||
22 | |||
23 | ngOnInit() { | ||
24 | |||
25 | this.tarjetasService.getTarjetas() | ||
26 | .subscribe((res: Tarjeta[]) => { | ||
27 | |||
28 | this.tarjetas = res; | ||
29 | }, err => console.error(err)); | ||
30 | } | ||
31 | |||
32 | seleccionarTarjeta(tarjeta: Tarjeta) { | ||
33 | |||
34 | this.tarjetaSeleccionada = tarjeta; | ||
35 | this.showForm = true; | ||
36 | } | ||
37 | |||
38 | close() { | ||
39 | |||
40 | this.modalRef.hide() | ||
41 | } | ||
42 | } | ||
43 |
src/assets/img/americanExpress.png
10.4 KB
src/assets/img/argencard.png
7.48 KB
src/assets/img/cabal.png
7.38 KB
src/assets/img/cencosud.png
10.6 KB
src/assets/img/galiciaRural.png
10.1 KB
src/assets/img/generica.png
6.44 KB
src/assets/img/macro.png
9.1 KB
src/assets/img/macroAgro.png
11.8 KB
src/assets/img/maestro.png
9 KB
src/assets/img/mastercard.png
9.46 KB
src/assets/img/mercadoPago.png
13.9 KB
src/assets/img/naranja.png
10.4 KB
src/assets/img/nativa.png
12.1 KB
src/assets/img/tarjetaShopping.png
15.2 KB
src/assets/img/visa.png
7.03 KB
src/assets/img/visaCredito.png
10.3 KB
src/assets/img/visaDebito.png
10.1 KB
src/assets/img/visaElectron.png
9.8 KB