Commit 21b2eaff240c422d56468cf8608ab0773669171e
1 parent
6754f21036
Exists in
develop
and in
1 other branch
total hardcodeado
Showing
3 changed files
with
31 additions
and
4 deletions
Show diff stats
src/app/modules/seleccion-articulos/seleccion-articulos.component.html
... | ... | @@ -192,15 +192,21 @@ |
192 | 192 | </div> |
193 | 193 | </div> |
194 | 194 | </div> |
195 | - <!-- VER CARRITO --> | |
195 | + <div class="row"> | |
196 | + <!-- VER CARRITO Y TOTAL--> | |
196 | 197 | <div |
197 | 198 | class="col-auto p-0 mt-2 ml-auto h-20" |
198 | 199 | *ngIf="articuloService.carrito.length"> |
199 | 200 | <div |
200 | 201 | class="btn-effect col-auto align-self-center px-0 bg-white" |
201 | 202 | [routerLink]="['/carrito']"> |
202 | - <div class="row mx-0 bg-light"> | |
203 | - <div class="col-auto align-self-center text-primary">VER CARRITO</div> | |
203 | + <div class="row justify-content-between mx-0 bg-light"> | |
204 | + <div class="col-auto align-self-center text-primary">TOTAL</div> | |
205 | + <div class="col-auto p-0 bg-primary d-none d-sm-block total-background"> | |
206 | + <p class="text-center text-white mt-1 py-1">$---</p> | |
207 | + </div> | |
208 | + <div class="lala"></div> | |
209 | + <div class="col-auto align-self-center text-primary ml-2">VER CARRITO</div> | |
204 | 210 | <div class="col-auto p-0 bg-primary d-none d-sm-block"> |
205 | 211 | <img |
206 | 212 | draggable="false" |
... | ... | @@ -213,6 +219,8 @@ |
213 | 219 | </div> |
214 | 220 | </div> |
215 | 221 | |
222 | + | |
223 | + | |
216 | 224 | </div> |
217 | 225 | </div> |
218 | 226 |
src/app/modules/seleccion-articulos/seleccion-articulos.component.scss
src/app/modules/seleccion-articulos/seleccion-articulos.component.ts
... | ... | @@ -25,6 +25,7 @@ export class SeleccionArticulosComponent implements OnInit { |
25 | 25 | ordenandoByVendidos = true; |
26 | 26 | allActive = true; |
27 | 27 | modalRef: BsModalRef; |
28 | + total: number = 0; | |
28 | 29 | |
29 | 30 | constructor( |
30 | 31 | public articuloService: ArticuloService, |
... | ... | @@ -84,6 +85,14 @@ export class SeleccionArticulosComponent implements OnInit { |
84 | 85 | }); |
85 | 86 | } |
86 | 87 | |
88 | + getTotal() { | |
89 | + var subTotal = 0; | |
90 | + this.articulos.forEach(producto => { | |
91 | + subTotal = subTotal + (producto.PreVen * producto.cantidad); | |
92 | + }); | |
93 | + return this.total = subTotal; | |
94 | + } | |
95 | + | |
87 | 96 | setProductos() { |
88 | 97 | this.articulos = JSON.parse(localStorage.getItem('articulos')); |
89 | 98 | this.filterItems(); |