Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,7 +8,34 @@ import pandas as pd
|
|
| 8 |
# ====== 菜单数据结构(英文 + 编号 + 描述) ======
|
| 9 |
MENU_DATA = {
|
| 10 |
"Appetizers": [
|
| 11 |
-
{"id": "A1", "name": "Spring Rolls", "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
{"id": "A2", "name": "Dumplings", "desc": "(Pork, chives, soy sauce) – Steamed dumplings with savory filling.", "price": 5.0},
|
| 13 |
{"id": "A3", "name": "Salad", "desc": "(Lettuce, tomato, cucumber) – Fresh garden salad with vinaigrette.", "price": 3.5},
|
| 14 |
{"id": "A4", "name": "Tofu Skewers", "desc": "(Tofu, sesame, chili) – Grilled tofu with sweet soy glaze.", "price": 4.0},
|
|
@@ -88,7 +115,12 @@ with gr.Blocks() as demo:
|
|
| 88 |
for item in items:
|
| 89 |
with gr.Row():
|
| 90 |
gr.Image(value=get_image(), width=100, height=100, show_label=False, container=False)
|
| 91 |
-
gr.Markdown(f"**{item['id']} - {item['name']}**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
|
| 93 |
submit_btn = gr.Button("✅ I have made my selection")
|
| 94 |
output_box = gr.Textbox(visible=False)
|
|
|
|
| 8 |
# ====== 菜单数据结构(英文 + 编号 + 描述) ======
|
| 9 |
MENU_DATA = {
|
| 10 |
"Appetizers": [
|
| 11 |
+
{"id": "A1", "name": "Spring Rolls", "ingredients": "Cabbage, carrot, glass noodles", "desc": "Crispy rolls with vegetables. Light and crunchy.", "price": 4.5},
|
| 12 |
+
{"id": "A2", "name": "Dumplings", "ingredients": "Pork, chives, soy sauce", "desc": "Steamed dumplings with savory filling.", "price": 5.0},
|
| 13 |
+
{"id": "A3", "name": "Salad", "ingredients": "Lettuce, tomato, cucumber", "desc": "Fresh garden salad with vinaigrette.", "price": 3.5},
|
| 14 |
+
{"id": "A4", "name": "Tofu Skewers", "ingredients": "Tofu, sesame, chili", "desc": "Grilled tofu with sweet soy glaze.", "price": 4.0},
|
| 15 |
+
{"id": "A5", "name": "Edamame", "ingredients": "Soybeans, salt", "desc": "Boiled soybeans. A healthy starter.", "price": 3.0}
|
| 16 |
+
],
|
| 17 |
+
"Main Dishes": [
|
| 18 |
+
{"id": "B1", "name": "Beef Pho", "ingredients": "Beef, rice noodles, herbs", "desc": "Vietnamese soup with rich broth.", "price": 9.5},
|
| 19 |
+
{"id": "B2", "name": "Chicken Curry", "ingredients": "Chicken, coconut milk, vegetables", "desc": "Spicy curry with rice.", "price": 10.0},
|
| 20 |
+
{"id": "B3", "name": "Fried Rice", "ingredients": "Rice, egg, peas, carrots", "desc": "Classic fried rice in soy sauce.", "price": 8.0},
|
| 21 |
+
{"id": "B4", "name": "Grilled Fish", "ingredients": "White fish, lemongrass, garlic", "desc": "Smoky and herbed fillet.", "price": 11.0},
|
| 22 |
+
{"id": "B5", "name": "Veggie Stir Fry", "ingredients": "Broccoli, bell pepper, mushroom", "desc": "Mixed vegetables in garlic sauce.", "price": 8.5}
|
| 23 |
+
],
|
| 24 |
+
"Desserts": [
|
| 25 |
+
{"id": "C1", "name": "Mango Sticky Rice", "ingredients": "Mango, coconut milk, sticky rice", "desc": "Sweet tropical Thai dessert.", "price": 5.0},
|
| 26 |
+
{"id": "C2", "name": "Taro Cake", "ingredients": "Taro, rice flour, sugar", "desc": "Soft steamed purple taro cake.", "price": 4.5},
|
| 27 |
+
{"id": "C3", "name": "Coconut Jelly", "ingredients": "Coconut milk, gelatin, sugar", "desc": "Chilled and silky treat.", "price": 4.0},
|
| 28 |
+
{"id": "C4", "name": "Sweet Bean Soup", "ingredients": "Red beans, citrus zest", "desc": "Warm dessert soup with a twist.", "price": 3.5},
|
| 29 |
+
{"id": "C5", "name": "Sesame Balls", "ingredients": "Glutinous rice, sesame paste", "desc": "Fried golden and gooey.", "price": 3.5}
|
| 30 |
+
],
|
| 31 |
+
"Drinks": [
|
| 32 |
+
{"id": "D1", "name": "Lime Soda", "ingredients": "Soda, lime juice", "desc": "Zesty and refreshing cooler.", "price": 2.5},
|
| 33 |
+
{"id": "D2", "name": "Iced Tea", "ingredients": "Black tea, lemon, sugar", "desc": "Cold brew with a citrus hint.", "price": 2.0},
|
| 34 |
+
{"id": "D3", "name": "Coconut Water", "ingredients": "Young coconut", "desc": "Natural and hydrating.", "price": 3.0},
|
| 35 |
+
{"id": "D4", "name": "Soy Milk", "ingredients": "Soybeans, sugar", "desc": "Sweetened and smooth.", "price": 2.0},
|
| 36 |
+
{"id": "D5", "name": "Bottled Water", "ingredients": "Mineral water", "desc": "Sealed and clean.", "price": 1.5}
|
| 37 |
+
]
|
| 38 |
+
},
|
| 39 |
{"id": "A2", "name": "Dumplings", "desc": "(Pork, chives, soy sauce) – Steamed dumplings with savory filling.", "price": 5.0},
|
| 40 |
{"id": "A3", "name": "Salad", "desc": "(Lettuce, tomato, cucumber) – Fresh garden salad with vinaigrette.", "price": 3.5},
|
| 41 |
{"id": "A4", "name": "Tofu Skewers", "desc": "(Tofu, sesame, chili) – Grilled tofu with sweet soy glaze.", "price": 4.0},
|
|
|
|
| 115 |
for item in items:
|
| 116 |
with gr.Row():
|
| 117 |
gr.Image(value=get_image(), width=100, height=100, show_label=False, container=False)
|
| 118 |
+
gr.Markdown(f"**{item['id']} - {item['name']}**
|
| 119 |
+
|
| 120 |
+
🥬 _Ingredients: {item['ingredients']}_
|
| 121 |
+
{item['desc']}
|
| 122 |
+
|
| 123 |
+
💰 €{item['price']:.2f}")
|
| 124 |
|
| 125 |
submit_btn = gr.Button("✅ I have made my selection")
|
| 126 |
output_box = gr.Textbox(visible=False)
|