Wanswan commited on
Commit
938550b
·
verified ·
1 Parent(s): acb03ea

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -21
app.py CHANGED
@@ -8,32 +8,32 @@ import pandas as pd
8
  # ====== 菜单数据结构(英文 + 编号) ======
9
  MENU_DATA = {
10
  "Appetizers": [
11
- {"id": "A1", "name": "Spring Rolls", "desc": "Crispy rolls with vegetables", "price": 4.5, "img": "https://via.placeholder.com/100"},
12
- {"id": "A2", "name": "Dumplings", "desc": "Steamed pork dumplings", "price": 5.0, "img": "https://via.placeholder.com/100"},
13
- {"id": "A3", "name": "Salad", "desc": "Fresh vegetable salad", "price": 3.5, "img": "https://via.placeholder.com/100"},
14
- {"id": "A4", "name": "Tofu Skewers", "desc": "Grilled tofu with sauce", "price": 4.0, "img": "https://via.placeholder.com/100"},
15
- {"id": "A5", "name": "Edamame", "desc": "Boiled soybeans with salt", "price": 3.0, "img": "https://via.placeholder.com/100"},
16
  ],
17
  "Main Dishes": [
18
- {"id": "B1", "name": "Beef Pho", "desc": "Traditional Vietnamese noodle soup", "price": 9.5, "img": "https://via.placeholder.com/100"},
19
- {"id": "B2", "name": "Chicken Curry", "desc": "Spicy chicken curry with rice", "price": 10.0, "img": "https://via.placeholder.com/100"},
20
- {"id": "B3", "name": "Fried Rice", "desc": "Fried rice with egg and vegetables", "price": 8.0, "img": "https://via.placeholder.com/100"},
21
- {"id": "B4", "name": "Grilled Fish", "desc": "Grilled fish with herbs", "price": 11.0, "img": "https://via.placeholder.com/100"},
22
- {"id": "B5", "name": "Veggie Stir Fry", "desc": "Mixed vegetables stir-fried with sauce", "price": 8.5, "img": "https://via.placeholder.com/100"},
23
  ],
24
  "Desserts": [
25
- {"id": "C1", "name": "Mango Sticky Rice", "desc": "Sweet coconut rice with mango", "price": 5.0, "img": "https://via.placeholder.com/100"},
26
- {"id": "C2", "name": "Taro Cake", "desc": "Steamed taro cake", "price": 4.5, "img": "https://via.placeholder.com/100"},
27
- {"id": "C3", "name": "Coconut Jelly", "desc": "Chilled coconut milk jelly", "price": 4.0, "img": "https://via.placeholder.com/100"},
28
- {"id": "C4", "name": "Sweet Bean Soup", "desc": "Warm red bean dessert soup", "price": 3.5, "img": "https://via.placeholder.com/100"},
29
- {"id": "C5", "name": "Sesame Balls", "desc": "Fried sesame rice balls", "price": 3.5, "img": "https://via.placeholder.com/100"},
30
  ],
31
  "Drinks": [
32
- {"id": "D1", "name": "Lime Soda", "desc": "Refreshing soda with lime", "price": 2.5, "img": "https://via.placeholder.com/100"},
33
- {"id": "D2", "name": "Iced Tea", "desc": "Chilled black tea with lemon", "price": 2.0, "img": "https://via.placeholder.com/100"},
34
- {"id": "D3", "name": "Coconut Water", "desc": "Natural coconut juice", "price": 3.0, "img": "https://via.placeholder.com/100"},
35
- {"id": "D4", "name": "Soy Milk", "desc": "Sweetened soy milk", "price": 2.0, "img": "https://via.placeholder.com/100"},
36
- {"id": "D5", "name": "Bottled Water", "desc": "Still mineral water", "price": 1.5, "img": "https://via.placeholder.com/100"},
37
  ],
38
  }
39
 
@@ -68,7 +68,7 @@ with gr.Blocks() as demo:
68
  with gr.Tab(label=category):
69
  for item in items:
70
  with gr.Row():
71
- gr.Image(value=item["img"], width=100, height=100)
72
  gr.Markdown(f"**{item['id']} - {item['name']}**\n\n{item['desc']}\n\n💰 €{item['price']:.2f}")
73
 
74
  submit_btn = gr.Button("✅ I have made my selection")
 
8
  # ====== 菜单数据结构(英文 + 编号) ======
9
  MENU_DATA = {
10
  "Appetizers": [
11
+ {"id": "A1", "name": "Spring Rolls", "desc": "Crispy rolls with vegetables", "price": 4.5},
12
+ {"id": "A2", "name": "Dumplings", "desc": "Steamed pork dumplings", "price": 5.0},
13
+ {"id": "A3", "name": "Salad", "desc": "Fresh vegetable salad", "price": 3.5},
14
+ {"id": "A4", "name": "Tofu Skewers", "desc": "Grilled tofu with sauce", "price": 4.0},
15
+ {"id": "A5", "name": "Edamame", "desc": "Boiled soybeans with salt", "price": 3.0},
16
  ],
17
  "Main Dishes": [
18
+ {"id": "B1", "name": "Beef Pho", "desc": "Traditional Vietnamese noodle soup", "price": 9.5},
19
+ {"id": "B2", "name": "Chicken Curry", "desc": "Spicy chicken curry with rice", "price": 10.0},
20
+ {"id": "B3", "name": "Fried Rice", "desc": "Fried rice with egg and vegetables", "price": 8.0},
21
+ {"id": "B4", "name": "Grilled Fish", "desc": "Grilled fish with herbs", "price": 11.0},
22
+ {"id": "B5", "name": "Veggie Stir Fry", "desc": "Mixed vegetables stir-fried with sauce", "price": 8.5},
23
  ],
24
  "Desserts": [
25
+ {"id": "C1", "name": "Mango Sticky Rice", "desc": "Sweet coconut rice with mango", "price": 5.0},
26
+ {"id": "C2", "name": "Taro Cake", "desc": "Steamed taro cake", "price": 4.5},
27
+ {"id": "C3", "name": "Coconut Jelly", "desc": "Chilled coconut milk jelly", "price": 4.0},
28
+ {"id": "C4", "name": "Sweet Bean Soup", "desc": "Warm red bean dessert soup", "price": 3.5},
29
+ {"id": "C5", "name": "Sesame Balls", "desc": "Fried sesame rice balls", "price": 3.5},
30
  ],
31
  "Drinks": [
32
+ {"id": "D1", "name": "Lime Soda", "desc": "Refreshing soda with lime", "price": 2.5},
33
+ {"id": "D2", "name": "Iced Tea", "desc": "Chilled black tea with lemon", "price": 2.0},
34
+ {"id": "D3", "name": "Coconut Water", "desc": "Natural coconut juice", "price": 3.0},
35
+ {"id": "D4", "name": "Soy Milk", "desc": "Sweetened soy milk", "price": 2.0},
36
+ {"id": "D5", "name": "Bottled Water", "desc": "Still mineral water", "price": 1.5},
37
  ],
38
  }
39
 
 
68
  with gr.Tab(label=category):
69
  for item in items:
70
  with gr.Row():
71
+ gr.Image(value="user_avatar.jpg", width=100, height=100, show_label=False, interactive=False)
72
  gr.Markdown(f"**{item['id']} - {item['name']}**\n\n{item['desc']}\n\n💰 €{item['price']:.2f}")
73
 
74
  submit_btn = gr.Button("✅ I have made my selection")