Rating
Rating the food will help us give you personalised recommendation
-
-
Submit Feedback
+
Submit Feedback
diff --git a/src/app/orders/orders.component.scss b/src/app/orders/orders.component.scss
index 7785cd0..bd8b0f7 100644
--- a/src/app/orders/orders.component.scss
+++ b/src/app/orders/orders.component.scss
@@ -162,7 +162,45 @@ ul.orders {
}
.star-holder {
- text-align: center;
+ text-align: center;
+
+ &.star1 {
+ ion-icon:first-child {
+ color: #fbae17;
+ }
+ }
+
+ &.star2 {
+ @for $i from 1 through 2 {
+ ion-icon:nth-child(#{$i}) {
+ color: #fbae17;
+ }
+ }
+ }
+
+ &.star3 {
+ @for $i from 1 through 3 {
+ ion-icon:nth-child(#{$i}) {
+ color: #fbae17;
+ }
+ }
+ }
+
+ &.star4 {
+ @for $i from 1 through 4 {
+ ion-icon:nth-child(#{$i}) {
+ color: #fbae17;
+ }
+ }
+ }
+
+ &.star5 {
+ @for $i from 1 through 5 {
+ ion-icon:nth-child(#{$i}) {
+ color: #fbae17;
+ }
+ }
+ }
ion-icon {
color: var(--brand-grey);
@@ -204,6 +242,6 @@ ul.orders {
--background: var(--brand-blue);
font-size: 12px;
width: calc(100% - 30px);
- margin: 0 auto 15px;
+ margin: 0 auto 65px;
}
}
diff --git a/src/app/orders/orders.component.ts b/src/app/orders/orders.component.ts
index 244ac10..f73f582 100644
--- a/src/app/orders/orders.component.ts
+++ b/src/app/orders/orders.component.ts
@@ -13,20 +13,46 @@ import { ToastService } from '../services/toast.service';
export class OrdersComponent implements OnInit {
userOrders: any = [];
selected_order: any;
- selected_rating: number = 0;
- userInfo: any;
- show_rate_modal: boolean = false;
+ userInfo: any;
userCart: ICart = {
orderedlist: []
};
allOrderStatus: any = [];
+ selectedOrder: any;
+
+ tempReview = {
+ app_user: {
+ user_id: null
+ },
+ comment: '',
+ rating: null,
+ };
+
constructor(
private orderService: OrderService,
private router: Router,
private toastService: ToastService
) { }
+ submitFeedbackForOrder() {
+ this.tempReview.app_user.user_id = this.userInfo.id;
+ this.selectedOrder.rating = this.tempReview;
+ console.log(this.selectedOrder);
+ this.orderService.updateOrder(this.selectedOrder).then(() => {
+ this.selectedOrder = null;
+ this.tempReview = {
+ app_user: {
+ user_id: null
+ },
+ comment: '',
+ rating: null,
+ };
+ }, () => {
+ this.toastService.presentToast("Failed to send review, please try again", "danger");
+ })
+ }
+
ngOnInit() {
this.userInfo = JSON.parse(localStorage.userInfo)['User Info'];
diff --git a/src/app/services/order.service.ts b/src/app/services/order.service.ts
index 7404d89..a5c3124 100644
--- a/src/app/services/order.service.ts
+++ b/src/app/services/order.service.ts
@@ -94,4 +94,17 @@ export class OrderService {
return await this.http.get(URL + '/api/maioraservice/orders/getallOrderStatus', httpOptions).toPromise();
}
+
+
+ async updateOrder(order: any) {
+ const httpOptions = {
+ headers: new HttpHeaders({
+ 'Access-Control-Allow-Origin': '*',
+ 'Content-Type': 'application/json',
+ 'Authorization': 'Bearer ' + localStorage.access_Token
+ })
+ };
+
+ return await this.http.put(URL + '/api/maioraservice/orders/v1/update', order ,httpOptions).toPromise();
+ }
}
diff --git a/src/global.scss b/src/global.scss
index 7df9f3c..b54ddb5 100644
--- a/src/global.scss
+++ b/src/global.scss
@@ -175,7 +175,6 @@ figure {
padding: 15px;
font-size: 14px;
align-items: center;
- position: sticky;
position: -webkit-sticky;
top: 0;
z-index: 1;