DeepLearning101 commited on
Commit
d5bc259
·
verified ·
1 Parent(s): 9f3eb4c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -68,6 +68,8 @@ def get_line_id_from_url(request: gr.Request):
68
  return ""
69
 
70
  def handle_booking(name, tel, email, date_str, time, pax, remarks, line_id):
 
 
71
  if not name or not tel or not date_str or not time:
72
  return "⚠️ 請完整填寫必填欄位"
73
 
@@ -129,7 +131,9 @@ theme = gr.themes.Soft(primary_hue="amber", neutral_hue="zinc").set(body_backgro
129
  custom_css = "footer {display: none !important;} .gradio-container, .block, .row, .column { overflow: visible !important; } .options, .wrap .options { background-color: #262626 !important; border: 1px solid #d4af37 !important; z-index: 10000 !important; box-shadow: 0 5px 15px rgba(0,0,0,0.5); } .item:hover, .options .item:hover { background-color: #d4af37 !important; color: black !important; } .legal-footer { text-align: center; margin-top: 15px; padding-top: 15px; border-top: 1px solid #333; color: #666; font-size: 0.75rem; }"
130
 
131
  with gr.Blocks(theme=theme, css=custom_css, title="Booking") as demo:
132
- line_id_box = gr.Textbox(visible=False)
 
 
133
  confirm_msg_box = gr.HTML()
134
  demo.load(get_line_id_from_url, None, line_id_box)
135
  demo.load(check_confirmation, None, confirm_msg_box)
 
68
  return ""
69
 
70
  def handle_booking(name, tel, email, date_str, time, pax, remarks, line_id):
71
+ # 👇👇👇 加入這一行除錯 👇👇👇
72
+ print(f"🔥 DEBUG: 收到訂單,Name={name}, Line_ID={line_id}")
73
  if not name or not tel or not date_str or not time:
74
  return "⚠️ 請完整填寫必填欄位"
75
 
 
131
  custom_css = "footer {display: none !important;} .gradio-container, .block, .row, .column { overflow: visible !important; } .options, .wrap .options { background-color: #262626 !important; border: 1px solid #d4af37 !important; z-index: 10000 !important; box-shadow: 0 5px 15px rgba(0,0,0,0.5); } .item:hover, .options .item:hover { background-color: #d4af37 !important; color: black !important; } .legal-footer { text-align: center; margin-top: 15px; padding-top: 15px; border-top: 1px solid #333; color: #666; font-size: 0.75rem; }"
132
 
133
  with gr.Blocks(theme=theme, css=custom_css, title="Booking") as demo:
134
+ # line_id_box = gr.Textbox(visible=False)
135
+ # 👇 把 False 改成 True,並加上標籤方便辨識
136
+ line_id_box = gr.Textbox(visible=True, label="【除錯用】接收到的 LINE ID")
137
  confirm_msg_box = gr.HTML()
138
  demo.load(get_line_id_from_url, None, line_id_box)
139
  demo.load(check_confirmation, None, confirm_msg_box)