v0.2,不会接受字数大于5的展览查询,添加展览详细信息展示,返回详细错误信息

This commit is contained in:
2024-08-24 22:20:42 +08:00
parent 80a9b4d565
commit d5eeea6c80
11 changed files with 279 additions and 51 deletions

View File

@ -7,31 +7,52 @@ body {
font-family: "Source Han Sans", sans-serif;
}
.container, .header, .content, .footer, .details, .image {
border: 1px solid black;
box-sizing: border-box;
.background {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-size: cover;
filter: blur(40%);
z-index: -1;
}
.container {
width: 98%;
margin: 1%;
padding: 10px;
background-color: rgba(255, 255, 255, 0.8);
border: 1px solid #fff;
box-sizing: border-box;
background-color: rgba(255, 255, 255, 0.8); /* 半透明白色背景 */
}
.header, .designer {
.header {
border: 1px solid black;
padding: 5px;
margin-bottom: 10px;
text-align: center;
font-size: 10px;
font-weight: bold;
padding: 5px;
margin: 10px 0;
}
.content {
display: flex;
border: 1px solid black;
margin-bottom: 10px;
padding: 5px;
position: relative;
box-sizing: border-box;
}
.detail_content {
display: flex;
border: 1px solid black;
height: 201px;
margin-bottom: 10px;
padding: 5px;
position: relative;
box-sizing: border-box;
}
.image {
@ -39,6 +60,37 @@ body {
height: 201px;
border: 1px solid rgba(128, 64, 128, 0.5);
text-align: center;
box-sizing: border-box;
}
.vector_icon {
width: 20px;
height: 20px;
vertical-align: bottom;
margin-left: 5px;
}
.banner {
margin-bottom: 15px;
border: 2px solid #000; /* 为 banner 添加边框 */
display: flex;
justify-content: center; /* 居中对齐图片 */
align-items: center; /* 垂直居中对齐图片 */
}
.banner img {
width: 450px;
height: 253px;
}
.details .ticket_box {
display: inline-block; /* 根据内容的宽度自动调整 */
background-color: rgba(255, 255, 255, 0.1); /* 半透明白色背景 */
border-radius: 15px; /* 圆角半径 */
padding: 20px; /* 内边距 */
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* 添加阴影以增强视觉效果 */
text-align: center; /* 内容水平居中 */
width: auto; /* 根据内容宽度自动调整 */
}
.details {
@ -46,38 +98,31 @@ body {
padding-left: 10px;
display: flex;
flex-direction: column;
position: relative; /* 使子元素绝对定位相对于这个父元素 */
font-size: 10px;
position: relative;
}
.details .title {
font-weight: bold;
font-weight: bold; /* 加粗字体 */
margin-bottom: 5px;
}
.details .venue_name,
.details .guests,
.details .placeholder,
.details .price,
.details .wish,
.details .start-time,
.details .end-time {
.details .placeholder {
margin-bottom: 5px;
}
.details .sale_flag,
.details .id {
position: absolute;
font-size: 10px;
}
.details .sale_flag {
color: red;
position: absolute;
top: 5px;
right: 5px;
}
.details .id {
color: black;
position: absolute;
top: 20px;
right: 5px;
}
@ -85,35 +130,56 @@ body {
.details .price {
color: #fb7299;
font-weight: bold;
position: absolute;
bottom: 5px;
left: 5px;
}
.details .status {
position: absolute;
display: flex;
bottom: 5px;
}
.details .wish {
color: gray;
position: absolute;
bottom: 5px;
left: 60px;
left: 60px; /* 适当调整以避免与price重叠 */
}
.details .start-time {
bottom: 20px;
position: absolute;
bottom: 20px; /* 与end-time有一定的高度差异 */
right: 5px;
}
.details .end-time {
position: absolute;
bottom: 5px;
right: 5px;
}
.footer {
border: 1px solid black;
flex: 1;
padding-left: 10px;
display: flex;
flex-direction: column;
justify-content: space-between;
font-size: 10px;
position: relative;
font-size: 10px;
}
.footer .pages,
.footer .designer {
text-align: center;
font-weight: bold;
font-size: 10px;
padding: 5px;
margin: 10px 0;
}
.footer .pages,
.footer .total_results {
position: absolute;
font-size: 10px;

View File

@ -0,0 +1,65 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<title>展览信息</title>
<link rel="stylesheet" href="./css/style.css" />
<style>
body {
background-image: url("{{ bgimage }}");
}
</style>
</head>
<body>
<div class="background"></div>
<div class="container">
<div class="header">展览信息</div>
<!-- Banner 图 -->
<div class="banner">
<img src="{{ show.banner_url }}" alt="Banner" style="width: 450px; height: 253px;" />
</div>
<!-- 单个展览内容 -->
<div class="detail_content">
<div class="details">
<div class="title">{{ show.name }}</div>
<div class="venue_name">地点:{{ show.venue_name }} {{show.venue_detail}}</div>
<div class="start-time">开始时间:{{ show.start_time }}</div>
<div class="end-time">结束时间:{{ show.end_time }}</div>
<div class="organizer">主办方:{{ show.organizer }}</div>
<div class="status">
{% macro icon(name) %}
<img src="./svg/{{ name }}.svg" class="vector_icon" width="8px" height="8px">
{% endmacro %}
{% if show.is_refund == 0 %}
{{ icon('no') }} 不可退
{% endif %}
{% if show.id_bind == 1 %}
{{ icon('yes') }} 实名制
{% endif %}
{% if show.has_eticket == True %}
{{ icon('yes') }} 电子票/兑换票
{% endif %}
</div>
<div class="placeholder"></div>
</div>
</div>
<div class="details">
{% for ticket in show.ticket_info %}
<div class="ticket_box">{{ ticket.description }} {{ ticket.sale_start }} -- {{ ticket.sale_end }} ¥{{ ticket.price / 100 }} ({{ ticket.status }})</div>
{% endfor %}
</div>
<!-- 页脚 -->
<div class="footer">
<div class="designer">Designed by Asankilp?</div>
<div class="project_name">nonebot-plugin-acgnshow</div>
<div class="notice_text">本页信息仅供参考,具体内容请访问展览官方详情页,并自行检索实际信息</div>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1724505806097" class="icon" viewBox="0 0 1028 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10250" xmlns:xlink="http://www.w3.org/1999/xlink" width="200.78125" height="200"><path d="M875.086452 153.730058C676.053818-45.302575 353.260522-45.302575 154.128323 153.730058s-199.032634 521.825929 0 720.958129 521.825929 199.032634 720.958129 0 199.032634-521.825929 0-720.958129zM725.836868 725.438604c-9.757478 9.757478-25.488922 9.757478-35.246399 0L514.557604 549.405739 338.624306 725.438604c-9.757478 9.757478-25.488922 9.757478-35.2464 0s-9.757478-25.488922 0-35.2464l176.032865-176.032864-176.032865-175.933299c-9.757478-9.757478-9.757478-25.488922 0-35.246399 9.757478-9.757478 25.488922-9.757478 35.2464 0l176.032864 176.032865 176.032865-176.032865c9.757478-9.757478 25.488922-9.757478 35.246399 0 9.757478 9.757478 9.757478 25.488922 0 35.246399L549.804004 514.15934 725.836868 690.192204c9.657912 9.757478 9.657912 25.488922 0 35.2464z" fill="#F56C6C" p-id="10251"></path></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1724506220274" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="13079" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M512 76.8c-236.8 0-435.2 192-435.2 435.2s192 435.2 435.2 435.2 435.2-192 435.2-435.2S748.8 76.8 512 76.8z m249.6 320L480 704c-12.8 12.8-38.4 12.8-51.2 0L288 556.8c-12.8-12.8-12.8-38.4 0-51.2 12.8-12.8 38.4-12.8 51.2 0l115.2 115.2L704 339.2c12.8-12.8 38.4-12.8 51.2 0 25.6 12.8 25.6 38.4 6.4 57.6z" fill="#68D279" p-id="13080"></path><path d="M710.4 339.2l-256 281.6-115.2-115.2c-12.8-12.8-38.4-12.8-51.2 0-12.8 12.8-12.8 38.4 0 51.2l147.2 140.8c12.8 12.8 38.4 12.8 51.2 0L768 390.4c12.8-12.8 12.8-38.4 0-51.2-19.2-12.8-44.8-12.8-57.6 0z" fill="#FFFFFF" p-id="13081"></path></svg>

After

Width:  |  Height:  |  Size: 913 B