👀v0.2.2,票种按天分组

This commit is contained in:
Asankilp 2024-08-24 23:00:06 +08:00
parent a427dadae9
commit ffc28c98f5
3 changed files with 21 additions and 8 deletions

View File

@ -101,7 +101,8 @@ def process_show_details_data_to_template(show_details_data: dict):
"price": ticket.get("price", 0), "price": ticket.get("price", 0),
"sale_start": convert_timestamp(ticket.get("saleStart", 0)), "sale_start": convert_timestamp(ticket.get("saleStart", 0)),
"sale_end": convert_timestamp(ticket.get("saleEnd", 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"] guests_list = data["guests"]
if guests_list != None: if guests_list != None:

View File

@ -30,6 +30,9 @@
<div class="start-time">开始时间:{{ show.start_time }}</div> <div class="start-time">开始时间:{{ show.start_time }}</div>
<div class="end-time">结束时间:{{ show.end_time }}</div> <div class="end-time">结束时间:{{ show.end_time }}</div>
<div class="organizer">主办方:{{ show.organizer }}</div> <div class="organizer">主办方:{{ show.organizer }}</div>
{% if show.guests %}
<div class="guests">嘉宾:{{ show.guests }}</div>
{% endif %}
<div class="status"> <div class="status">
{% macro icon(name) %} {% macro icon(name) %}
<img src="./svg/{{ name }}.svg" class="vector_icon" width="8px" height="8px"> <img src="./svg/{{ name }}.svg" class="vector_icon" width="8px" height="8px">
@ -40,18 +43,27 @@
{% if show.id_bind == 1 %} {% if show.id_bind == 1 %}
{{ icon('yes') }} 实名制 {{ icon('yes') }} 实名制
{% endif %} {% endif %}
{% if show.has_eticket == True %} {% if show.has_eticket %}
{{ icon('yes') }} 电子票/兑换票 {{ icon('yes') }} 电子票/兑换票
{% endif %} {% endif %}
</div> </div>
<div class="placeholder"></div> <div class="placeholder"></div>
</div> </div>
</div> </div>
<!-- 按 screen_name 分组的票务信息 -->
{% for screen_name, tickets in show.ticket_info | groupby('screen_name') %}
<div class="screen_name_group">
<h3>{{ screen_name }}</h3>
<div class="details"> <div class="details">
{% for ticket in show.ticket_info %} {% for ticket in tickets %}
<div class="ticket_box">{{ ticket.description }} {{ ticket.sale_start }} -- {{ ticket.sale_end }} ¥{{ ticket.price / 100 }} ({{ ticket.status }})</div> <div class="ticket_box">
{{ ticket.description }} {{ ticket.sale_start }} -- {{ ticket.sale_end }} ¥{{ ticket.price / 100 }} ({{ ticket.status }})
</div>
{% endfor %} {% endfor %}
</div> </div>
</div>
{% endfor %}
<!-- 页脚 --> <!-- 页脚 -->
<div class="footer"> <div class="footer">

View File

@ -1,6 +1,6 @@
[project] [project]
name = "nonebot-plugin-acgnshow" name = "nonebot-plugin-acgnshow"
version = "0.2.1" version = "0.2.2"
description = "Nonebot2插件从哔哩哔哩会员购获取简易展览数据" description = "Nonebot2插件从哔哩哔哩会员购获取简易展览数据"
readme = "README.md" readme = "README.md"
requires-python = "<4.0,>=3.9" requires-python = "<4.0,>=3.9"