|
5 | 5 | from urllib.parse import urlparse, parse_qs
|
6 | 6 |
|
7 | 7 | import gradio as gr
|
| 8 | +from gradio_calendar import Calendar |
8 | 9 | from loguru import logger
|
9 | 10 |
|
10 | 11 | from config import main_request, get_application_tmp_path
|
11 |
| -from gradio_calendar import Calendar |
12 | 12 |
|
13 | 13 | buyer_value = []
|
14 | 14 | addr_value = []
|
@@ -136,7 +136,7 @@ def on_submit_ticket_id(num):
|
136 | 136 | value=f"{extracted_id_message}\n获取票信息成功:\n展会名称:{project_name}\n"
|
137 | 137 | f"开展时间:{project_start_time} - {project_end_time}\n场馆地址:{venue_name} {venue_address}",
|
138 | 138 | visible=True,
|
139 |
| - ), gr.update(visible=True, value=sales_dates[0] if sales_dates_show else gr.update()) |
| 139 | + ), gr.update(visible=True, value=sales_dates[0]) if sales_dates_show else gr.update(visible=False) |
140 | 140 | ]
|
141 | 141 | except Exception as e:
|
142 | 142 | return [
|
@@ -316,7 +316,7 @@ def on_submit_date(_date):
|
316 | 316 | f" - 【起售时间:{sale_start}】")
|
317 | 317 | ticket_str_list.append(ticket_str)
|
318 | 318 | ticket_value.append({"project_id": project_id, "ticket": ticket})
|
319 |
| - return [gr.update(_date), gr.update(choices=ticket_str_list), |
| 319 | + return [gr.update(value=_date, visible=True), gr.update(choices=ticket_str_list), |
320 | 320 | gr.update(value=f"当前票日期更新为: {_date}")]
|
321 | 321 | except Exception as e:
|
322 | 322 | return [gr.update(), gr.update(), gr.update(value=e, visible=True)]
|
|
0 commit comments