Files
BYW-VoiceHub/app/components/year-review/ShareCard.vue
T
Henry_Du 3eff710d5d feat(微信订阅): 接入歌曲排期模板并加固部署流程
订阅消息(小程序侧唯一能主动触达用户的通道):
- 新增 server/utils/wechatSubscribeFields.ts:按微信字段类型裁剪值(thing≤20、
  phrase 必须 5 个汉字、time/date/character_string 各自上限),空白压成一行,
  北京时间 time 由 playTime 的开始时间生成,解析不出退化为当天 00:00。
- wechatSubscribeService 内置 SONG_SELECTED 模板(站长新给的那个模板 ID),
  并转发上述纯函数;notificationService.createSongSelectedNotification 现在会带上
  playDate/playTime/sequence,三个排期接口(schedule / publish / bulk-publish)补传 sequence。
- 新增 test/wechatSubscribeFields.test.mjs(10 例,node --test 全绿)。
- test-subscribe 管理接口支持 vars 覆盖并返回真实发送值,方便站长核对字段名。

部署流程(Gitea Actions 容器里没有 buildx 插件,旧流程在此硬失败):
- 每个 job 各自安装/探测 docker-buildx(v0.19.3,走 gh-proxy 再退直连),
  不把 `buildx version` 当唯一依据;装不上时降级为普通 `docker build` 继续发布,
  不再因为缺插件整条流水线失败。

注意:SONG_SELECTED 的字段名(thing2/date4/time1/character_string3/phrase5)是按常见
命名推断的,需在公众平台后台核对;不一致时用环境变量覆盖,模板 ID 变更后老用户需重新授权。
2026-10-11 00:04:14 +08:00

218 lines
4.5 KiB
Vue

<template>
<div ref="shareCardRef" class="share-card">
<div class="card-background">
<div class="gradient-overlay" />
<div class="noise-overlay" />
</div>
<div class="card-content">
<div class="header">
<div class="logo">宝一外校园点歌系统</div>
<div class="year">{{ data.year }}</div>
</div>
<div class="title-section">
<h1 class="main-title">年度点歌报告</h1>
<p class="subtitle">Music Journey</p>
</div>
<div class="stats-grid">
<div class="stat-item">
<div class="stat-value">{{ data.totalRequests }}</div>
<div class="stat-label">点歌次数</div>
</div>
<div class="stat-item">
<div class="stat-value">{{ data.playedRequests }}</div>
<div class="stat-label">已播放</div>
</div>
<div class="stat-item">
<div class="stat-value">{{ data.totalVotes }}</div>
<div class="stat-label">投票数</div>
</div>
</div>
<div class="footer">
<div class="footer-text">用音乐记录每一刻</div>
<div class="footer-line" />
</div>
</div>
</div>
</template>
<script setup>
import { ref } from 'vue'
defineProps({
data: {
type: Object,
required: true
}
})
const shareCardRef = ref(null)
defineExpose({
shareCardRef
})
</script>
<style scoped>
.share-card {
position: relative;
width: 100%;
height: 100%;
min-height: 600px;
overflow: hidden;
background: linear-gradient(135deg, var(--bg-secondary, #0f0f23) 0%, #1a1a2e 50%, #16213e 100%);
}
.card-background {
position: absolute;
inset: 0;
}
.gradient-overlay {
position: absolute;
inset: 0;
background:
radial-gradient(circle at 20% 30%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
radial-gradient(circle at 80% 70%, rgba(244, 114, 182, 0.15) 0%, transparent 50%),
radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.1) 0%, transparent 60%);
}
.noise-overlay {
position: absolute;
inset: 0;
opacity: 0.03;
background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}
.card-content {
position: relative;
z-index: 10;
display: flex;
flex-direction: column;
justify-content: space-between;
height: 100%;
padding: 3rem;
}
.header {
display: flex;
justify-content: space-between;
align-items: center;
}
.logo {
font-size: 1.5rem;
font-weight: 900;
background: linear-gradient(135deg, #8b5cf6, #ec4899);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
}
.year {
font-size: 3rem;
font-weight: 900;
color: rgba(255, 255, 255, 0.1);
line-height: 1;
}
.title-section {
text-align: center;
margin: 2rem 0;
}
.main-title {
font-size: 3.5rem;
font-weight: 900;
background: linear-gradient(135deg, var(--card-bg, #ffffff) 0%, #e5e7eb 50%, #9ca3af 100%);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
margin-bottom: 0.5rem;
letter-spacing: -0.02em;
}
.subtitle {
font-size: 1.25rem;
color: rgba(255, 255, 255, 0.5);
letter-spacing: 0.3em;
text-transform: uppercase;
}
.stats-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 2rem;
margin: 2rem 0;
}
.stat-item {
text-align: center;
padding: 1.5rem;
background: rgba(255, 255, 255, 0.03);
border-radius: 1rem;
border: 1px solid rgba(255, 255, 255, 0.08);
backdrop-filter: blur(10px);
}
.stat-value {
font-size: 2.5rem;
font-weight: 900;
background: linear-gradient(135deg, #60a5fa, #3b82f6);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
margin-bottom: 0.5rem;
}
.stat-label {
font-size: 0.875rem;
color: rgba(255, 255, 255, 0.5);
letter-spacing: 0.05em;
}
.footer {
text-align: center;
padding-top: 2rem;
}
.footer-text {
font-size: 0.875rem;
color: rgba(255, 255, 255, 0.4);
letter-spacing: 0.1em;
margin-bottom: 1rem;
}
.footer-line {
width: 100px;
height: 2px;
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
margin: 0 auto;
}
@media (max-width: 768px) {
.card-content {
padding: 2rem;
}
.main-title {
font-size: 2.5rem;
}
.stats-grid {
gap: 1rem;
}
.stat-value {
font-size: 1.75rem;
}
.year {
font-size: 2rem;
}
}
</style>