+
+
-

-
-
Title
-
Text
-
-
-
-
-
-
-
-
-
+ class="card-comanda fade-in d-flex align-items-end flex-column bg-danger rounded-xs shadow-sm border-0 h-100"
+ [ngClass]="
+ {
+ 'bg-light': comanda.estado === 1,
+ 'bg-danger': comanda.estado === 2,
+ 'bg-success': comanda.estado === 3
+ }">
+

+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/app/components/comanda/comanda.component.scss b/src/app/components/comanda/comanda.component.scss
index ded63f7..27a5c1c 100644
--- a/src/app/components/comanda/comanda.component.scss
+++ b/src/app/components/comanda/comanda.component.scss
@@ -9,20 +9,88 @@
}
}
-.h7 {
- font-size: 0.75rem;
+.bg-danger {
+ background-color: #8c000e !important;
+ p {
+ color: #fff;
+ }
}
-.red-card {
- background-color: #8c000e;
- .card-body {
+.bg-success {
+ background-color: #00751b !important;
+ p {
color: #fff;
}
}
-.green-card {
- background-color: #00751B;
- .card-body {
- color: #fff;
+.bg-light {
+ background-color: white !important;
+ p {
+ color: #212529;
+ }
+}
+
+.rounded-xs {
+ border-radius: 0.5rem;
+}
+
+.card-comanda {
+ min-height: 250px;
+}
+
+.swing-out-top-bck {
+ -webkit-animation: swing-out-top-bck 0.45s
+ cubic-bezier(0.6, -0.28, 0.735, 0.045) 10s both;
+ animation: swing-out-top-bck 0.8s cubic-bezier(0.6, -0.28, 0.735, 0.045) 10s
+ both;
+}
+
+@-webkit-keyframes swing-out-top-bck {
+ 0% {
+ -webkit-transform: rotateX(0deg);
+ transform: rotateX(0deg);
+ -webkit-transform-origin: top;
+ transform-origin: top;
+ opacity: 1;
+ }
+ 75% {
+ -webkit-transform: rotateX(-100deg);
+ transform: rotateX(-100deg);
+ -webkit-transform-origin: top;
+ transform-origin: top;
+ }
+ 100% {
+ -webkit-transform: rotateX(-100deg);
+ transform: rotateX(-100deg);
+ -webkit-transform-origin: top;
+ transform-origin: top;
+ opacity: 0;
+ display: none;
+ position: absolute;
+ }
+}
+
+@keyframes swing-out-top-bck {
+ 0% {
+ -webkit-transform: rotateX(0deg);
+ transform: rotateX(0deg);
+ -webkit-transform-origin: top;
+ transform-origin: top;
+ opacity: 1;
+ }
+ 75% {
+ -webkit-transform: rotateX(-100deg);
+ transform: rotateX(-100deg);
+ -webkit-transform-origin: top;
+ transform-origin: top;
+ }
+ 100% {
+ -webkit-transform: rotateX(-100deg);
+ transform: rotateX(-100deg);
+ -webkit-transform-origin: top;
+ transform-origin: top;
+ opacity: 0;
+ display: none;
+ position: absolute;
}
}
diff --git a/src/app/components/comanda/comanda.component.ts b/src/app/components/comanda/comanda.component.ts
index c256e85..c990054 100644
--- a/src/app/components/comanda/comanda.component.ts
+++ b/src/app/components/comanda/comanda.component.ts
@@ -1,5 +1,7 @@
import { Component, OnInit } from '@angular/core';
import { appSettings } from 'src/etc/AppSettings';
+import { ComandaService } from 'src/app/services/comanda.service';
+import { Comanda } from 'src/app/wrappers/comanda';
@Component({
selector: 'app-comanda',
@@ -9,11 +11,31 @@ import { appSettings } from 'src/etc/AppSettings';
export class ComandaComponent implements OnInit {
private apiImagenes = appSettings.apiImagenes;
- private itemsArray = [{},{},{},{},{},{},{},{}]
+ private comandas: Comanda[] = [];
- constructor() { }
+ constructor(
+ private comandaService: ComandaService
+ ) { }
ngOnInit() {
+
+ this.comandaService.getAll()
+ .subscribe((res: Comanda[]) => {
+
+ this.comandas = res;
+ }, e => console.error(e))
+ }
+
+ updateComanda(comanda: Comanda, estadoNuevo: number, observacionNueva: string) {
+
+ this.comandaService.updateComanda(comanda.id, estadoNuevo, observacionNueva)
+ .subscribe(res => {
+
+ if (res.data) {
+ comanda.estado = estadoNuevo;
+ comanda.observacion = observacionNueva;
+ }
+ }, e => console.error(e))
}
}