правки
This commit is contained in:
gofnnp 2023-01-24 16:06:35 +04:00
parent df49c2a77e
commit e7a389b484
4 changed files with 7 additions and 6 deletions

View File

@ -1,4 +1,5 @@
<app-navbar></app-navbar> <app-navbar></app-navbar>
<p-toast position="top-center"></p-toast>
<div class="layout"> <div class="layout">
<router-outlet></router-outlet> <router-outlet></router-outlet>
</div> </div>

View File

@ -20,6 +20,7 @@ export class Order {
public deliveryData?: DeliveryData; public deliveryData?: DeliveryData;
public phone: string; public phone: string;
public token: string | undefined; public token: string | undefined;
public terminal_id: string;
constructor( constructor(
orderInfo: OrderInfo orderInfo: OrderInfo
@ -29,6 +30,7 @@ export class Order {
this.deliveryData = orderInfo.deliveryData; this.deliveryData = orderInfo.deliveryData;
this.phone = orderInfo.phone; this.phone = orderInfo.phone;
this.token = orderInfo.token; this.token = orderInfo.token;
this.terminal_id = orderInfo.terminal_id;
} }
get price(): number { get price(): number {
@ -53,7 +55,8 @@ export class Order {
delivery_comment: this.deliveryData?.comment, delivery_comment: this.deliveryData?.comment,
delivery: this.deliveryData?.deliveryType?.type, delivery: this.deliveryData?.deliveryType?.type,
delivery_address: this.deliveryData?.deliveryType?.type === "self_delivery" ? null : `${environment.cities[0]}, ул ${this.userData?.street}, ${this.userData?.house}`, delivery_address: this.deliveryData?.deliveryType?.type === "self_delivery" ? null : `${environment.cities[0]}, ул ${this.userData?.street}, ${this.userData?.house}`,
amount: this.price + 100 amount: this.price + 100,
terminal_id: this.terminal_id
}, },
} }
} }

View File

@ -85,7 +85,8 @@ export class CartComponent implements OnInit {
} }
orderSubmitted() { orderSubmitted() {
this.visibleSidebar = false
this.messageService.add({ severity: 'success', summary: 'Заказ оформлен!' });
} }
confirmClearCart() { confirmClearCart() {

View File

@ -149,10 +149,6 @@ export class OrderService {
true true
) )
.subscribe(); .subscribe();
this.messageService.add({
severity: 'success',
summary: 'Заказ создан',
});
}, },
}) })
); );