From ffc28c98f555969773f2207dcf034d6f6fcce0bb Mon Sep 17 00:00:00 2001 From: Asankilp Date: Sat, 24 Aug 2024 23:00:06 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=80v0.2.2=EF=BC=8C=E7=A5=A8=E7=A7=8D?= =?UTF-8?q?=E6=8C=89=E5=A4=A9=E5=88=86=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nonebot_plugin_acgnshow/acgnapis.py | 3 ++- nonebot_plugin_acgnshow/res/details.html | 24 ++++++++++++++++++------ pyproject.toml | 2 +- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/nonebot_plugin_acgnshow/acgnapis.py b/nonebot_plugin_acgnshow/acgnapis.py index 502707b..81a189b 100644 --- a/nonebot_plugin_acgnshow/acgnapis.py +++ b/nonebot_plugin_acgnshow/acgnapis.py @@ -101,7 +101,8 @@ def process_show_details_data_to_template(show_details_data: dict): "price": ticket.get("price", 0), "sale_start": convert_timestamp(ticket.get("saleStart", 0)), "sale_end": convert_timestamp(ticket.get("saleEnd", 0)), - "status": ticket.get("sale_flag", {}).get("display_name", "") + "status": ticket.get("sale_flag", {}).get("display_name", ""), + "screen_name": ticket.get("screen_name") }) guests_list = data["guests"] if guests_list != None: diff --git a/nonebot_plugin_acgnshow/res/details.html b/nonebot_plugin_acgnshow/res/details.html index 4cf6899..bc3fe67 100644 --- a/nonebot_plugin_acgnshow/res/details.html +++ b/nonebot_plugin_acgnshow/res/details.html @@ -26,10 +26,13 @@
{{ show.name }}
-
地点:{{ show.venue_name }} {{show.venue_detail}}
+
地点:{{ show.venue_name }} {{ show.venue_detail }}
开始时间:{{ show.start_time }}
结束时间:{{ show.end_time }}
主办方:{{ show.organizer }}
+ {% if show.guests %} +
嘉宾:{{ show.guests }}
+ {% endif %}
{% macro icon(name) %} @@ -40,18 +43,27 @@ {% if show.id_bind == 1 %} {{ icon('yes') }} 实名制 {% endif %} - {% if show.has_eticket == True %} + {% if show.has_eticket %} {{ icon('yes') }} 电子票/兑换票 {% endif %}
-
- {% for ticket in show.ticket_info %} -
{{ ticket.description }} {{ ticket.sale_start }} -- {{ ticket.sale_end }} ¥{{ ticket.price / 100 }} ({{ ticket.status }})
- {% endfor %} + + + {% for screen_name, tickets in show.ticket_info | groupby('screen_name') %} +
+

{{ screen_name }}

+
+ {% for ticket in tickets %} +
+ {{ ticket.description }} {{ ticket.sale_start }} -- {{ ticket.sale_end }} ¥{{ ticket.price / 100 }} ({{ ticket.status }}) +
+ {% endfor %} +
+ {% endfor %}