From 57d4d6b0c8dbf77e242320357839af64f14d42bf Mon Sep 17 00:00:00 2001 From: Danya_Mochalov Date: Wed, 25 Oct 2023 01:52:49 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B0=D1=87=D0=B8=D0=BD=D0=B0=D0=B5?= =?UTF-8?q?=D0=BC=20=D1=82=D1=80=D0=B5=D1=82=D1=8C=D1=8E=20(=D0=BA=D0=BE?= =?UTF-8?q?=D0=BC=D0=BC=D0=B8=D1=82=20=D0=B4=D0=BB=D1=8F=20=D1=80=D0=BE?= =?UTF-8?q?=D0=BB=D0=BB=D0=B1=D1=8D=D0=BA=D0=B0=20=D0=B2=20=D1=81=D0=BB?= =?UTF-8?q?=D1=83=D1=87=D0=B0=D0=B5=20=D0=B0=D0=BF=D0=BE=D0=BA=D0=B0=D0=BB?= =?UTF-8?q?=D0=B8=D0=BF=D1=81=D0=B8=D1=81=D0=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/example/shawarma/models/OrderModel.kt | 16 ++++++++-------- .../example/shawarma/screens/cart/CartScreen.kt | 8 ++++---- .../shawarma/screens/orders/OrdersScreen.kt | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/com/example/shawarma/models/OrderModel.kt b/app/src/main/java/com/example/shawarma/models/OrderModel.kt index 93dedc0..bf09a4c 100644 --- a/app/src/main/java/com/example/shawarma/models/OrderModel.kt +++ b/app/src/main/java/com/example/shawarma/models/OrderModel.kt @@ -6,17 +6,17 @@ import java.util.Date data class OrderModel( val id: Int, val status: OrderStatus, - val productsId: HashMap, + val productsId: HashMap, val userId: Int, val date: Date ) fun getOrdersByUserId() : List { - val map1 = HashMap() - map1[ProductModel(1, "Классика", 150)] = 2 + val map1 = HashMap() + map1[1] = 2 - val map2 = HashMap() - map2[ProductModel(1, "Классика", 150)] = 2 + val map2 = HashMap() + map2[1] = 2 return listOf( OrderModel(1, OrderStatus.Unpaid, map1, 1, Date()), OrderModel(2, OrderStatus.Preparing, map2 , 1, Date()) @@ -24,11 +24,11 @@ fun getOrdersByUserId() : List { } fun getAllOrders() : List { - val map1 = HashMap() - map1[ProductModel(1, "Классика", 150)] = 2 + val map1 = HashMap() + map1[1] = 2 return listOf( OrderModel(1, OrderStatus.Prepared, map1, 1, Date()), OrderModel(2, OrderStatus.Preparing, map1 , 1, Date()), - OrderModel(2, OrderStatus.Processed, map1 , 1, Date()) + OrderModel(3, OrderStatus.Processed, map1 , 1, Date()) ) } diff --git a/app/src/main/java/com/example/shawarma/screens/cart/CartScreen.kt b/app/src/main/java/com/example/shawarma/screens/cart/CartScreen.kt index bf877af..8ea124a 100644 --- a/app/src/main/java/com/example/shawarma/screens/cart/CartScreen.kt +++ b/app/src/main/java/com/example/shawarma/screens/cart/CartScreen.kt @@ -173,7 +173,7 @@ fun PaidItem(order : OrderModel) { .padding(horizontal = 20.dp) ){ Text( - text = order.productsId.keys.first().title, + text = "Классика", fontFamily = NunitoFamily, fontSize = 20.sp, modifier = Modifier.padding(top = 15.dp), @@ -187,7 +187,7 @@ fun PaidItem(order : OrderModel) { fontWeight = FontWeight.Bold ) Text( - text = order.productsId.keys.first().price.toString() + " руб.", + text = "150 руб.", fontFamily = NunitoFamily, fontSize = 20.sp, modifier = Modifier.padding(top = 15.dp), @@ -245,7 +245,7 @@ fun CartItem(order : OrderModel) { modifier = Modifier.fillMaxWidth() ){ Text( - text = order.productsId.keys.first().title, + text = "Классика", fontFamily = NunitoFamily, fontSize = 20.sp, fontWeight = FontWeight.Bold @@ -258,7 +258,7 @@ fun CartItem(order : OrderModel) { ) } Text( - text = order.productsId.keys.first().price.toString() + " руб.", + text = "150 руб.", fontFamily = NunitoFamily, fontSize = 20.sp, fontWeight = FontWeight.Bold diff --git a/app/src/main/java/com/example/shawarma/screens/orders/OrdersScreen.kt b/app/src/main/java/com/example/shawarma/screens/orders/OrdersScreen.kt index ee7beb7..c191be3 100644 --- a/app/src/main/java/com/example/shawarma/screens/orders/OrdersScreen.kt +++ b/app/src/main/java/com/example/shawarma/screens/orders/OrdersScreen.kt @@ -183,7 +183,7 @@ fun PreparingItem(order : OrderModel){ modifier = Modifier.fillMaxWidth() ){ Text( - text = order.productsId.keys.first().title, + text = "Классика", fontFamily = NunitoFamily, fontSize = 20.sp, fontWeight = FontWeight.Bold @@ -251,7 +251,7 @@ fun PreparedItem(order : OrderModel){ modifier = Modifier.fillMaxWidth() ){ Text( - text = order.productsId.keys.first().title, + text = "Классика", fontFamily = NunitoFamily, fontSize = 20.sp, fontWeight = FontWeight.Bold