完成一个基本的弹幕功能
This commit is contained in:
0
activity/__init__.py
Normal file
0
activity/__init__.py
Normal file
7
activity/admin.py
Normal file
7
activity/admin.py
Normal file
@@ -0,0 +1,7 @@
|
||||
from django.contrib import admin
|
||||
from .models import ActivitySetting, Blessing, Danmu
|
||||
|
||||
# Register your models here.
|
||||
admin.site.register(ActivitySetting)
|
||||
admin.site.register(Blessing)
|
||||
admin.site.register(Danmu)
|
||||
6
activity/apps.py
Normal file
6
activity/apps.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class ActivityConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'activity'
|
||||
32
activity/forms.py
Normal file
32
activity/forms.py
Normal file
@@ -0,0 +1,32 @@
|
||||
from django import forms
|
||||
from .models import ActivitySetting, Danmu
|
||||
|
||||
class DanmuForm(forms.ModelForm):
|
||||
"""弹幕提交表单"""
|
||||
class Meta:
|
||||
model = Danmu
|
||||
fields = ['name', 'content', 'image']
|
||||
widgets = {
|
||||
'name': forms.TextInput(attrs={'class': 'form-control', 'placeholder': '请输入您的姓名'}),
|
||||
'content': forms.Textarea(attrs={'class': 'form-control', 'placeholder': '请输入祝福语', 'rows': 3}),
|
||||
'image': forms.FileInput(attrs={'class': 'form-control'}),
|
||||
}
|
||||
|
||||
class ActivitySettingForm(forms.ModelForm):
|
||||
"""活动设置表单"""
|
||||
class Meta:
|
||||
model = ActivitySetting
|
||||
fields = ['background_image', 'background_video', 'qr_code_image', 'qr_code_position', 'qr_code_margin_top', 'qr_code_margin_left', 'qr_code_margin_bottom', 'qr_code_margin_right', 'danmu_font_color', 'danmu_bg_color', 'global_bg_color']
|
||||
widgets = {
|
||||
'qr_code_position': forms.Select(attrs={'class': 'form-control'}),
|
||||
'qr_code_margin_top': forms.NumberInput(attrs={'class': 'form-control', 'placeholder': '距离上边距(px)'}),
|
||||
'qr_code_margin_left': forms.NumberInput(attrs={'class': 'form-control', 'placeholder': '距离左边距(px)'}),
|
||||
'qr_code_margin_bottom': forms.NumberInput(attrs={'class': 'form-control', 'placeholder': '距离下边距(px)'}),
|
||||
'qr_code_margin_right': forms.NumberInput(attrs={'class': 'form-control', 'placeholder': '距离右边距(px)'}),
|
||||
'danmu_font_color': forms.TextInput(attrs={'class': 'form-control', 'type': 'color'}),
|
||||
'danmu_bg_color': forms.TextInput(attrs={'class': 'form-control', 'type': 'color'}),
|
||||
'global_bg_color': forms.TextInput(attrs={'class': 'form-control', 'type': 'color'}),
|
||||
'background_image': forms.FileInput(attrs={'class': 'form-control'}),
|
||||
'background_video': forms.FileInput(attrs={'class': 'form-control'}),
|
||||
'qr_code_image': forms.FileInput(attrs={'class': 'form-control'}),
|
||||
}
|
||||
58
activity/migrations/0001_initial.py
Normal file
58
activity/migrations/0001_initial.py
Normal file
@@ -0,0 +1,58 @@
|
||||
# Generated by Django 5.0.6 on 2025-12-30 03:09
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='ActivitySetting',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('background_image', models.ImageField(blank=True, null=True, upload_to='activity_media/', verbose_name='背景图片')),
|
||||
('background_video', models.FileField(blank=True, null=True, upload_to='activity_media/', verbose_name='背景视频')),
|
||||
('qr_code_image', models.ImageField(blank=True, null=True, upload_to='activity_media/', verbose_name='二维码图片')),
|
||||
('qr_code_position', models.CharField(choices=[('top-left', '左上角'), ('top-right', '右上角'), ('bottom-left', '左下角'), ('bottom-right', '右下角'), ('center', '居中')], default='bottom-right', max_length=20, verbose_name='二维码位置')),
|
||||
('danmu_font_color', models.CharField(default='#FFFFFF', max_length=7, verbose_name='弹幕字体颜色')),
|
||||
('danmu_bg_color', models.CharField(default='#000000', max_length=7, verbose_name='弹幕背景颜色')),
|
||||
('global_bg_color', models.CharField(default='#F0F0F0', max_length=7, verbose_name='全局背景颜色')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': '活动设置',
|
||||
'verbose_name_plural': '活动设置',
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Blessing',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('content', models.TextField(verbose_name='祝福语内容')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': '祝福语',
|
||||
'verbose_name_plural': '祝福语',
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Danmu',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=50, verbose_name='姓名')),
|
||||
('content', models.TextField(blank=True, null=True, verbose_name='祝福语')),
|
||||
('image', models.ImageField(blank=True, null=True, upload_to='danmu_media/', verbose_name='图片')),
|
||||
('is_approved', models.BooleanField(default=False, verbose_name='审核状态')),
|
||||
('created_at', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': '弹幕消息',
|
||||
'verbose_name_plural': '弹幕消息',
|
||||
'ordering': ['-created_at'],
|
||||
},
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,33 @@
|
||||
# Generated by Django 5.0.6 on 2025-12-30 05:33
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('activity', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='activitysetting',
|
||||
name='qr_code_margin_bottom',
|
||||
field=models.IntegerField(default=20, verbose_name='距离下边距(px)'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='activitysetting',
|
||||
name='qr_code_margin_left',
|
||||
field=models.IntegerField(default=20, verbose_name='距离左边距(px)'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='activitysetting',
|
||||
name='qr_code_margin_right',
|
||||
field=models.IntegerField(default=20, verbose_name='距离右边距(px)'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='activitysetting',
|
||||
name='qr_code_margin_top',
|
||||
field=models.IntegerField(default=20, verbose_name='距离上边距(px)'),
|
||||
),
|
||||
]
|
||||
0
activity/migrations/__init__.py
Normal file
0
activity/migrations/__init__.py
Normal file
59
activity/models.py
Normal file
59
activity/models.py
Normal file
@@ -0,0 +1,59 @@
|
||||
from django.db import models
|
||||
|
||||
# Create your models here.
|
||||
|
||||
class ActivitySetting(models.Model):
|
||||
"""活动设置模型"""
|
||||
BACKGROUND_POSITION_CHOICES = (
|
||||
('top-left', '左上角'),
|
||||
('top-right', '右上角'),
|
||||
('bottom-left', '左下角'),
|
||||
('bottom-right', '右下角'),
|
||||
('center', '居中'),
|
||||
)
|
||||
|
||||
background_image = models.ImageField(upload_to='activity_media/', verbose_name='背景图片', blank=True, null=True)
|
||||
background_video = models.FileField(upload_to='activity_media/', verbose_name='背景视频', blank=True, null=True)
|
||||
qr_code_image = models.ImageField(upload_to='activity_media/', verbose_name='二维码图片', blank=True, null=True)
|
||||
qr_code_position = models.CharField(max_length=20, choices=BACKGROUND_POSITION_CHOICES, default='bottom-right', verbose_name='二维码位置')
|
||||
qr_code_margin_top = models.IntegerField(default=20, verbose_name='距离上边距(px)')
|
||||
qr_code_margin_left = models.IntegerField(default=20, verbose_name='距离左边距(px)')
|
||||
qr_code_margin_bottom = models.IntegerField(default=20, verbose_name='距离下边距(px)')
|
||||
qr_code_margin_right = models.IntegerField(default=20, verbose_name='距离右边距(px)')
|
||||
danmu_font_color = models.CharField(max_length=7, default='#FFFFFF', verbose_name='弹幕字体颜色')
|
||||
danmu_bg_color = models.CharField(max_length=7, default='#000000', verbose_name='弹幕背景颜色')
|
||||
global_bg_color = models.CharField(max_length=7, default='#F0F0F0', verbose_name='全局背景颜色')
|
||||
|
||||
class Meta:
|
||||
verbose_name = '活动设置'
|
||||
verbose_name_plural = '活动设置'
|
||||
|
||||
def __str__(self):
|
||||
return '活动设置'
|
||||
|
||||
class Blessing(models.Model):
|
||||
"""祝福语模型"""
|
||||
content = models.TextField(verbose_name='祝福语内容')
|
||||
|
||||
class Meta:
|
||||
verbose_name = '祝福语'
|
||||
verbose_name_plural = '祝福语'
|
||||
|
||||
def __str__(self):
|
||||
return self.content[:20]
|
||||
|
||||
class Danmu(models.Model):
|
||||
"""弹幕消息模型"""
|
||||
name = models.CharField(max_length=50, verbose_name='姓名')
|
||||
content = models.TextField(verbose_name='祝福语', blank=True, null=True)
|
||||
image = models.ImageField(upload_to='danmu_media/', verbose_name='图片', blank=True, null=True)
|
||||
is_approved = models.BooleanField(default=False, verbose_name='审核状态')
|
||||
created_at = models.DateTimeField(auto_now_add=True, verbose_name='创建时间')
|
||||
|
||||
class Meta:
|
||||
verbose_name = '弹幕消息'
|
||||
verbose_name_plural = '弹幕消息'
|
||||
ordering = ['-created_at']
|
||||
|
||||
def __str__(self):
|
||||
return f'{self.name}: {self.content[:20]}'
|
||||
111
activity/templates/activity/admin_review.html
Normal file
111
activity/templates/activity/admin_review.html
Normal file
@@ -0,0 +1,111 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block css %}
|
||||
<style>
|
||||
body {
|
||||
background-color: #f8f9fa;
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 1000px;
|
||||
margin: 50px auto;
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin-bottom: 30px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.danmu-table {
|
||||
background-color: white;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.table th, .table td {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.danmu-content {
|
||||
max-width: 400px;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.danmu-image {
|
||||
max-width: 100px;
|
||||
max-height: 100px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.action-buttons {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
text-align: center;
|
||||
padding: 50px 0;
|
||||
color: #6c757d;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<h1>弹幕审核</h1>
|
||||
|
||||
{% if danmus %}
|
||||
<div class="danmu-table">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead class="table-dark">
|
||||
<tr>
|
||||
<th>姓名</th>
|
||||
<th>内容</th>
|
||||
<th>图片</th>
|
||||
<th>创建时间</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for danmu in danmus %}
|
||||
<tr>
|
||||
<td>{{ danmu.name }}</td>
|
||||
<td class="danmu-content">{{ danmu.content }}</td>
|
||||
<td>
|
||||
{% if danmu.image %}
|
||||
<img src="{{ danmu.image.url }}" alt="图片" class="danmu-image">
|
||||
{% else %}
|
||||
-无-
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>{{ danmu.created_at|date:"Y-m-d H:i:s" }}</td>
|
||||
<td>
|
||||
<div class="action-buttons">
|
||||
<form method="post" style="margin: 0;">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="danmu_id" value="{{ danmu.id }}">
|
||||
<input type="hidden" name="action" value="approve">
|
||||
<button type="submit" class="btn btn-success btn-sm">通过</button>
|
||||
</form>
|
||||
<form method="post" style="margin: 0;">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="danmu_id" value="{{ danmu.id }}">
|
||||
<input type="hidden" name="action" value="reject">
|
||||
<button type="submit" class="btn btn-danger btn-sm">不通过</button>
|
||||
</form>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="empty-state">
|
||||
<h3>暂无待审核的弹幕</h3>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
279
activity/templates/activity/index.html
Normal file
279
activity/templates/activity/index.html
Normal file
@@ -0,0 +1,279 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block css %}
|
||||
<style>
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
background-color: {{ setting.global_bg_color }};
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
|
||||
#background-container {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
#background-image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
#background-video {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
#qr-code {
|
||||
position: fixed;
|
||||
{% if setting.qr_code_position == 'top-left' %}
|
||||
top: {{ setting.qr_code_margin_top }}px;
|
||||
left: {{ setting.qr_code_margin_left }}px;
|
||||
{% elif setting.qr_code_position == 'top-right' %}
|
||||
top: {{ setting.qr_code_margin_top }}px;
|
||||
right: {{ setting.qr_code_margin_right }}px;
|
||||
{% elif setting.qr_code_position == 'bottom-left' %}
|
||||
bottom: {{ setting.qr_code_margin_bottom }}px;
|
||||
left: {{ setting.qr_code_margin_left }}px;
|
||||
{% elif setting.qr_code_position == 'bottom-right' %}
|
||||
bottom: {{ setting.qr_code_margin_bottom }}px;
|
||||
right: {{ setting.qr_code_margin_right }}px;
|
||||
{% elif setting.qr_code_position == 'center' %}
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
{% endif %}
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
#qr-code img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 2px solid white;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
#danmu-container {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
z-index: 50;
|
||||
}
|
||||
|
||||
.danmu-item {
|
||||
position: absolute;
|
||||
white-space: nowrap;
|
||||
padding: 12px 18px;
|
||||
border-radius: 25px;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
color: {{ setting.danmu_font_color }};
|
||||
background-color: rgba({{ setting.danmu_bg_color|slice:'1:3'|add:','|add:setting.danmu_bg_color|slice:'3:5'|add:','|add:setting.danmu_bg_color|slice:'5:7'|add:','|add:'0.8' }});
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
|
||||
animation: danmu-scroll 8s linear infinite;
|
||||
backdrop-filter: blur(2px);
|
||||
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
.danmu-item img {
|
||||
max-height: 100px;
|
||||
max-width: 200px;
|
||||
vertical-align: middle;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
@keyframes danmu-scroll {
|
||||
from { transform: translateX(100vw); }
|
||||
to { transform: translateX(-100%); }
|
||||
}
|
||||
|
||||
/* 响应式设计 */
|
||||
@media (max-width: 768px) {
|
||||
#qr-code {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
.danmu-item {
|
||||
font-size: 16px;
|
||||
padding: 10px 15px;
|
||||
border-radius: 20px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div id="background-container">
|
||||
{% if setting.background_video %}
|
||||
<video id="background-video" autoplay loop muted playsinline>
|
||||
<source src="{{ setting.background_video.url }}" type="video/mp4">
|
||||
</video>
|
||||
{% elif setting.background_image %}
|
||||
<img id="background-image" src="{{ setting.background_image.url }}" alt="背景图片">
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div id="qr-code">
|
||||
{% if setting.qr_code_image %}
|
||||
<img src="{{ setting.qr_code_image.url }}" alt="二维码">
|
||||
{% else %}
|
||||
<!-- 默认二维码 -->
|
||||
<img src="https://api.qrserver.com/v1/create-qr-code/?size=150x150&data={{ request.build_absolute_uri }}{% url 'submit' %}" alt="默认二维码">
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div id="danmu-container">
|
||||
<!-- 初始弹幕 -->
|
||||
{% for danmu in danmus %}
|
||||
<div class="danmu-item">
|
||||
{{ danmu.name }}: {{ danmu.content }}
|
||||
{% if danmu.image %}
|
||||
<img src="{{ danmu.image.url }}" alt="图片">
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block js %}
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// 获取弹幕容器
|
||||
const danmuContainer = $('#danmu-container');
|
||||
const containerHeight = danmuContainer.height();
|
||||
const containerWidth = danmuContainer.width();
|
||||
|
||||
// 弹幕高度(包含padding和margin)
|
||||
const DANMU_HEIGHT = 60;
|
||||
|
||||
// 上次获取弹幕的时间
|
||||
let lastTime = new Date().toISOString();
|
||||
|
||||
// 获取所有当前弹幕的位置信息
|
||||
function getCurrentDanmuPositions() {
|
||||
const positions = [];
|
||||
const danmus = danmuContainer.find('.danmu-item');
|
||||
danmus.each(function() {
|
||||
const $danmu = $(this);
|
||||
const top = parseInt($danmu.css('top')) || 0;
|
||||
positions.push({
|
||||
top: top,
|
||||
bottom: top + DANMU_HEIGHT
|
||||
});
|
||||
});
|
||||
return positions;
|
||||
}
|
||||
|
||||
// 检查位置是否与现有弹幕重叠
|
||||
function isPositionOverlapping(newTop) {
|
||||
const positions = getCurrentDanmuPositions();
|
||||
const newBottom = newTop + DANMU_HEIGHT;
|
||||
|
||||
for (const pos of positions) {
|
||||
// 检查是否有重叠
|
||||
if (!(newBottom <= pos.top || newTop >= pos.bottom)) {
|
||||
return true; // 重叠
|
||||
}
|
||||
}
|
||||
return false; // 不重叠
|
||||
}
|
||||
|
||||
// 生成随机且不重叠的位置
|
||||
function getRandomNonOverlappingTop() {
|
||||
let attempts = 0;
|
||||
const maxAttempts = 20;
|
||||
let newTop;
|
||||
|
||||
do {
|
||||
// 生成随机位置,考虑边距和弹幕高度
|
||||
newTop = Math.floor(Math.random() * (containerHeight - DANMU_HEIGHT - 20)) + 10;
|
||||
attempts++;
|
||||
} while (isPositionOverlapping(newTop) && attempts < maxAttempts);
|
||||
|
||||
// 如果尝试多次仍失败,返回一个安全位置
|
||||
if (attempts >= maxAttempts) {
|
||||
newTop = Math.floor(Math.random() * (containerHeight - DANMU_HEIGHT - 20)) + 10;
|
||||
}
|
||||
|
||||
return newTop;
|
||||
}
|
||||
|
||||
// 添加新弹幕
|
||||
function addDanmu(danmu) {
|
||||
// 获取随机且不重叠的位置
|
||||
const topPosition = getRandomNonOverlappingTop();
|
||||
|
||||
const danmuItem = $('<div>', {
|
||||
class: 'danmu-item',
|
||||
style: `top: ${topPosition}px;`,
|
||||
text: `${danmu.name}: ${danmu.content}`
|
||||
});
|
||||
|
||||
if (danmu.image) {
|
||||
const img = $('<img>', {
|
||||
src: danmu.image,
|
||||
alt: '图片',
|
||||
onload: function() {
|
||||
// 图片加载完成后重新计算宽度
|
||||
danmuItem.css('animation', 'danmu-scroll 8s linear infinite');
|
||||
}
|
||||
});
|
||||
danmuItem.append(' ').append(img);
|
||||
}
|
||||
|
||||
danmuContainer.append(danmuItem);
|
||||
|
||||
// 8秒后移除弹幕
|
||||
setTimeout(() => {
|
||||
danmuItem.remove();
|
||||
}, 8000);
|
||||
}
|
||||
|
||||
// 定时获取新弹幕
|
||||
setInterval(() => {
|
||||
$.ajax({
|
||||
url: '{% url 'api_danmu' %}',
|
||||
type: 'GET',
|
||||
dataType: 'json',
|
||||
success: function(data) {
|
||||
const newDanmus = data.danmus.filter(danmu => new Date(danmu.created_at) > new Date(lastTime));
|
||||
|
||||
if (newDanmus.length > 0) {
|
||||
newDanmus.forEach(danmu => {
|
||||
addDanmu(danmu);
|
||||
});
|
||||
|
||||
// 更新最后时间
|
||||
lastTime = new Date().toISOString();
|
||||
}
|
||||
}
|
||||
});
|
||||
}, 2000); // 每2秒获取一次
|
||||
|
||||
// 初始弹幕位置处理
|
||||
function initDanmuPositions() {
|
||||
const danmus = danmuContainer.find('.danmu-item');
|
||||
danmus.each(function() {
|
||||
const topPosition = getRandomNonOverlappingTop();
|
||||
$(this).css('top', topPosition + 'px');
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化弹幕位置
|
||||
initDanmuPositions();
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
193
activity/templates/activity/setting.html
Normal file
193
activity/templates/activity/setting.html
Normal file
@@ -0,0 +1,193 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block css %}
|
||||
<style>
|
||||
body {
|
||||
background-color: #f8f9fa;
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 800px;
|
||||
margin: 50px auto;
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin-bottom: 30px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.setting-form {
|
||||
background-color: white;
|
||||
padding: 30px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
|
||||
.preview-section {
|
||||
background-color: #e9ecef;
|
||||
padding: 20px;
|
||||
border-radius: 5px;
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
.preview-title {
|
||||
margin-bottom: 20px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.color-preview {
|
||||
display: inline-block;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 50%;
|
||||
margin-left: 10px;
|
||||
vertical-align: middle;
|
||||
border: 1px solid #dee2e6;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
padding: 12px 30px;
|
||||
font-size: 16px;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<h1>活动设置</h1>
|
||||
|
||||
<div class="setting-form">
|
||||
<form method="post" enctype="multipart/form-data">
|
||||
{% csrf_token %}
|
||||
|
||||
<div class="form-group">
|
||||
{{ form.background_image.label_tag }}
|
||||
{{ form.background_image }}
|
||||
{% if form.background_image.errors %}
|
||||
<div class="text-danger">{{ form.background_image.errors }}</div>
|
||||
{% endif %}
|
||||
{% if setting.background_image %}
|
||||
<div class="mt-2">
|
||||
<small class="text-muted">当前背景图片:</small>
|
||||
<img src="{{ setting.background_image.url }}" alt="当前背景图片" style="max-width: 200px; max-height: 100px; border-radius: 5px;">
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ form.background_video.label_tag }}
|
||||
{{ form.background_video }}
|
||||
{% if form.background_video.errors %}
|
||||
<div class="text-danger">{{ form.background_video.errors }}</div>
|
||||
{% endif %}
|
||||
{% if setting.background_video %}
|
||||
<div class="mt-2">
|
||||
<small class="text-muted">当前背景视频:{{ setting.background_video.name }}</small>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ form.qr_code_image.label_tag }}
|
||||
{{ form.qr_code_image }}
|
||||
{% if form.qr_code_image.errors %}
|
||||
<div class="text-danger">{{ form.qr_code_image.errors }}</div>
|
||||
{% endif %}
|
||||
{% if setting.qr_code_image %}
|
||||
<div class="mt-2">
|
||||
<small class="text-muted">当前二维码:</small>
|
||||
<img src="{{ setting.qr_code_image.url }}" alt="当前二维码" style="max-width: 100px; max-height: 100px; border-radius: 5px;">
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ form.qr_code_position.label_tag }}
|
||||
{{ form.qr_code_position }}
|
||||
{% if form.qr_code_position.errors %}
|
||||
<div class="text-danger">{{ form.qr_code_position.errors }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="id_danmu_font_color">
|
||||
弹幕字体颜色
|
||||
<span class="color-preview" id="font-color-preview" style="background-color: {{ setting.danmu_font_color }};"></span>
|
||||
</label>
|
||||
{{ form.danmu_font_color }}
|
||||
{% if form.danmu_font_color.errors %}
|
||||
<div class="text-danger">{{ form.danmu_font_color.errors }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="id_danmu_bg_color">
|
||||
弹幕背景颜色
|
||||
<span class="color-preview" id="bg-color-preview" style="background-color: {{ setting.danmu_bg_color }};"></span>
|
||||
</label>
|
||||
{{ form.danmu_bg_color }}
|
||||
{% if form.danmu_bg_color.errors %}
|
||||
<div class="text-danger">{{ form.danmu_bg_color.errors }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="id_global_bg_color">
|
||||
全局背景颜色
|
||||
<span class="color-preview" id="global-color-preview" style="background-color: {{ setting.global_bg_color }};"></span>
|
||||
</label>
|
||||
{{ form.global_bg_color }}
|
||||
{% if form.global_bg_color.errors %}
|
||||
<div class="text-danger">{{ form.global_bg_color.errors }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary">保存设置</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="preview-section">
|
||||
<div class="preview-title">预览效果:</div>
|
||||
<div style="width: 100%; height: 200px; background-color: {{ setting.global_bg_color }}; border-radius: 5px; position: relative; overflow: hidden;">
|
||||
{% if setting.background_image %}
|
||||
<img src="{{ setting.background_image.url }}" alt="背景预览" style="width: 100%; height: 100%; object-fit: cover;">
|
||||
{% endif %}
|
||||
<div style="position: absolute; {{ setting.qr_code_position|safe }}: 10px; width: 80px; height: 80px;">
|
||||
{% if setting.qr_code_image %}
|
||||
<img src="{{ setting.qr_code_image.url }}" alt="二维码预览" style="width: 100%; height: 100%; border: 2px solid white; border-radius: 5px;">
|
||||
{% else %}
|
||||
<!-- 默认二维码预览 -->
|
||||
<img src="https://api.qrserver.com/v1/create-qr-code/?size=80x80&data={{ request.build_absolute_uri }}{% url 'submit' %}" alt="二维码预览" style="width: 100%; height: 100%; border: 2px solid white; border-radius: 5px;">
|
||||
{% endif %}
|
||||
</div>
|
||||
<div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); padding: 10px 20px; border-radius: 20px; font-size: 16px; font-weight: bold; color: {{ setting.danmu_font_color }}; background-color: {{ setting.danmu_bg_color }}; opacity: 0.8;">
|
||||
示例弹幕
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block js %}
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// 实时更新颜色预览
|
||||
$('#id_danmu_font_color').on('input', function() {
|
||||
$('#font-color-preview').css('background-color', $(this).val());
|
||||
});
|
||||
|
||||
$('#id_danmu_bg_color').on('input', function() {
|
||||
$('#bg-color-preview').css('background-color', $(this).val());
|
||||
});
|
||||
|
||||
$('#id_global_bg_color').on('input', function() {
|
||||
$('#global-color-preview').css('background-color', $(this).val());
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
123
activity/templates/activity/submit.html
Normal file
123
activity/templates/activity/submit.html
Normal file
@@ -0,0 +1,123 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block css %}
|
||||
<style>
|
||||
body {
|
||||
background-color: #f8f9fa;
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 500px;
|
||||
margin: 50px auto;
|
||||
padding: 30px;
|
||||
background-color: white;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
h1 {
|
||||
text-align: center;
|
||||
margin-bottom: 30px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.blessing-list {
|
||||
background-color: #e9ecef;
|
||||
padding: 15px;
|
||||
border-radius: 5px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.blessing-item {
|
||||
margin-bottom: 10px;
|
||||
cursor: pointer;
|
||||
padding: 5px;
|
||||
border-radius: 3px;
|
||||
transition: background-color 0.3s;
|
||||
}
|
||||
|
||||
.blessing-item:hover {
|
||||
background-color: #dee2e6;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
width: 100%;
|
||||
padding: 12px;
|
||||
font-size: 16px;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<h1>发送祝福</h1>
|
||||
|
||||
<form method="post" enctype="multipart/form-data">
|
||||
{% csrf_token %}
|
||||
|
||||
<div class="form-group">
|
||||
{{ form.name.label_tag }}
|
||||
{{ form.name }}
|
||||
{% if form.name.errors %}
|
||||
<div class="text-danger">{{ form.name.errors }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ form.content.label_tag }}
|
||||
{{ form.content }}
|
||||
{% if form.content.errors %}
|
||||
<div class="text-danger">{{ form.content.errors }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="blessing-list">
|
||||
<h5>推荐祝福语:</h5>
|
||||
<div class="row">
|
||||
{% for blessing in random_blessings %}
|
||||
<div class="col-12 blessing-item" onclick="fillBlessing('{{ blessing.content|escapejs }}')">
|
||||
{{ blessing.content }}
|
||||
</div>
|
||||
{% empty %}
|
||||
<div class="col-12 text-center text-muted">暂无推荐祝福语</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ form.image.label_tag }}
|
||||
{{ form.image }}
|
||||
{% if form.image.errors %}
|
||||
<div class="text-danger">{{ form.image.errors }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary">发送</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block js %}
|
||||
<script>
|
||||
function fillBlessing(content) {
|
||||
document.getElementById('id_content').value = content;
|
||||
}
|
||||
|
||||
// 表单验证
|
||||
$(document).ready(function() {
|
||||
$('form').submit(function() {
|
||||
const name = $('#id_name').val();
|
||||
if (!name.trim()) {
|
||||
alert('请输入您的姓名');
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
22
activity/templates/base.html
Normal file
22
activity/templates/base.html
Normal file
@@ -0,0 +1,22 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>弹幕活动</title>
|
||||
<!-- Bootstrap CSS -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
|
||||
<!-- 自定义CSS -->
|
||||
{% block css %}{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
{% block content %}{% endblock %}
|
||||
|
||||
<!-- jQuery -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js"></script>
|
||||
<!-- Bootstrap JS -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<!-- 自定义JS -->
|
||||
{% block js %}{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
3
activity/tests.py
Normal file
3
activity/tests.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
10
activity/urls.py
Normal file
10
activity/urls.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from django.urls import path
|
||||
from . import views
|
||||
|
||||
urlpatterns = [
|
||||
path('', views.index, name='index'),
|
||||
path('submit/', views.submit, name='submit'),
|
||||
path('admin-review/', views.admin_review, name='admin_review'),
|
||||
path('setting/', views.setting, name='setting'),
|
||||
path('api/danmu/', views.api_danmu, name='api_danmu'),
|
||||
]
|
||||
780
activity/utils.py
Normal file
780
activity/utils.py
Normal file
@@ -0,0 +1,780 @@
|
||||
from .models import Blessing
|
||||
|
||||
def add_default_blessings():
|
||||
"""添加预设的祝福语"""
|
||||
default_blessings = [
|
||||
"身体健康,万事如意!",
|
||||
"事业有成,步步高升!",
|
||||
"家庭幸福,和睦美满!",
|
||||
"学业进步,前程似锦!",
|
||||
"财源广进,招财进宝!",
|
||||
"心想事成,美梦成真!",
|
||||
"吉祥如意,福星高照!",
|
||||
"平安顺遂,一生无忧!",
|
||||
"开心快乐,笑口常开!",
|
||||
"好运连连,喜事不断!",
|
||||
"青春永驻,活力四射!",
|
||||
"一帆风顺,马到成功!",
|
||||
"花开富贵,金玉满堂!",
|
||||
"福禄双全,寿比南山!",
|
||||
"喜气洋洋,红红火火!",
|
||||
"年年有余,岁岁平安!",
|
||||
"吉祥如意,万事亨通!",
|
||||
"笑口常开,好运自然来!",
|
||||
"身体健康,吃嘛嘛香!",
|
||||
"工作顺利,事业有成!",
|
||||
"家庭和睦,幸福美满!",
|
||||
"学业有成,前途无量!",
|
||||
"财源滚滚,财运亨通!",
|
||||
"心想事成,万事如意!",
|
||||
"平安健康,快乐每一天!",
|
||||
"吉祥如意,福寿双全!",
|
||||
"一帆风顺,前程似锦!",
|
||||
"红红火火,喜气洋洋!",
|
||||
"金玉满堂,富贵荣华!",
|
||||
"福星高照,好运连连!",
|
||||
"寿比南山,福如东海!",
|
||||
"吉祥如意,百事可乐!",
|
||||
"开心快乐,幸福美满!",
|
||||
"事业有成,财源广进!",
|
||||
"家庭幸福,万事如意!",
|
||||
"学业进步,天天向上!",
|
||||
"身体健康,平安快乐!",
|
||||
"吉祥如意,万事大吉!",
|
||||
"好运连连,喜事临门!",
|
||||
"笑口常开,青春永驻!",
|
||||
"一帆风顺,万事如意!",
|
||||
"花开富贵,吉祥如意!",
|
||||
"福禄寿喜,样样俱全!",
|
||||
"喜气洋洋,万事如意!",
|
||||
"年年有余,吉祥如意!",
|
||||
"吉祥如意,心想事成!",
|
||||
"平安健康,幸福快乐!",
|
||||
"事业有成,家庭幸福!",
|
||||
"学业进步,前程似锦!",
|
||||
"财源广进,福星高照!",
|
||||
"心想事成,美梦成真!",
|
||||
"吉祥如意,福寿安康!",
|
||||
"一帆风顺,马到成功!",
|
||||
"红红火火,好运连连!",
|
||||
"金玉满堂,万事如意!",
|
||||
"福星高照,幸福安康!",
|
||||
"寿比南山,万事如意!",
|
||||
"吉祥如意,百事亨通!",
|
||||
"开心快乐,健康平安!",
|
||||
"事业有成,财运亨通!",
|
||||
"家庭和睦,幸福美满!",
|
||||
"学业有成,前途光明!",
|
||||
"财源滚滚,好运不断!",
|
||||
"心想事成,吉祥如意!",
|
||||
"平安健康,快乐幸福!",
|
||||
"吉祥如意,福寿双全!",
|
||||
"一帆风顺,前程无量!",
|
||||
"喜气洋洋,吉祥如意!",
|
||||
"花开富贵,万事如意!",
|
||||
"福禄寿喜,吉祥如意!",
|
||||
"吉祥如意,年年有余!",
|
||||
"年年有余,万事如意!",
|
||||
"吉祥如意,万事大吉!",
|
||||
"好运连连,幸福美满!",
|
||||
"笑口常开,健康长寿!",
|
||||
"一帆风顺,吉祥如意!",
|
||||
"花开富贵,福寿安康!",
|
||||
"金玉满堂,吉祥如意!",
|
||||
"福星高照,吉祥安康!",
|
||||
"寿比南山,万事如意!",
|
||||
"吉祥如意,百事可乐!",
|
||||
"开心快乐,平安健康!",
|
||||
"事业有成,家庭美满!",
|
||||
"学业进步,天天向上!",
|
||||
"财源广进,好运连连!",
|
||||
"心想事成,幸福美满!",
|
||||
"平安健康,万事如意!",
|
||||
"吉祥如意,福寿安康!",
|
||||
"一帆风顺,马到成功!",
|
||||
"红红火火,吉祥如意!",
|
||||
"金玉满堂,富贵吉祥!",
|
||||
"福星高照,幸福美满!",
|
||||
"寿比南山,福如东海!",
|
||||
"吉祥如意,百事亨通!",
|
||||
"开心快乐,健康平安!",
|
||||
"事业有成,财源广进!",
|
||||
"家庭幸福,万事如意!",
|
||||
"学业进步,天天向上!",
|
||||
"身体健康,平安快乐!",
|
||||
"吉祥如意,万事大吉!",
|
||||
"好运连连,喜事临门!",
|
||||
"笑口常开,青春永驻!",
|
||||
"一帆风顺,万事如意!",
|
||||
"花开富贵,吉祥如意!",
|
||||
"福禄寿喜,样样俱全!",
|
||||
"喜气洋洋,万事如意!",
|
||||
"年年有余,吉祥如意!",
|
||||
"吉祥如意,心想事成!",
|
||||
"平安健康,幸福快乐!",
|
||||
"事业有成,家庭幸福!",
|
||||
"学业进步,前程似锦!",
|
||||
"财源广进,福星高照!",
|
||||
"心想事成,美梦成真!",
|
||||
"吉祥如意,福寿安康!",
|
||||
"一帆风顺,马到成功!",
|
||||
"红红火火,好运连连!",
|
||||
"金玉满堂,万事如意!",
|
||||
"福星高照,幸福安康!",
|
||||
"寿比南山,万事如意!",
|
||||
"吉祥如意,百事亨通!",
|
||||
"开心快乐,健康平安!",
|
||||
"事业有成,财运亨通!",
|
||||
"家庭和睦,幸福美满!",
|
||||
"学业有成,前途光明!",
|
||||
"财源滚滚,好运不断!",
|
||||
"心想事成,吉祥如意!",
|
||||
"平安健康,快乐幸福!",
|
||||
"吉祥如意,福寿双全!",
|
||||
"一帆风顺,前程无量!",
|
||||
"喜气洋洋,吉祥如意!",
|
||||
"花开富贵,万事如意!",
|
||||
"福禄寿喜,吉祥如意!",
|
||||
"吉祥如意,年年有余!",
|
||||
"年年有余,万事如意!",
|
||||
"吉祥如意,万事大吉!",
|
||||
"好运连连,幸福美满!",
|
||||
"笑口常开,健康长寿!",
|
||||
"一帆风顺,吉祥如意!",
|
||||
"花开富贵,福寿安康!",
|
||||
"金玉满堂,吉祥如意!",
|
||||
"福星高照,吉祥安康!",
|
||||
"寿比南山,万事如意!",
|
||||
"吉祥如意,百事可乐!",
|
||||
"开心快乐,平安健康!",
|
||||
"事业有成,家庭美满!",
|
||||
"学业进步,天天向上!",
|
||||
"财源广进,好运连连!",
|
||||
"心想事成,幸福美满!",
|
||||
"平安健康,万事如意!",
|
||||
"吉祥如意,福寿安康!",
|
||||
"一帆风顺,马到成功!",
|
||||
"红红火火,吉祥如意!",
|
||||
"金玉满堂,富贵吉祥!",
|
||||
"福星高照,幸福美满!",
|
||||
"寿比南山,福如东海!",
|
||||
"吉祥如意,百事亨通!",
|
||||
"开心快乐,健康平安!",
|
||||
"事业有成,财源广进!",
|
||||
"家庭幸福,万事如意!",
|
||||
"学业有成,前途似锦!",
|
||||
"财源滚滚,财运亨通!",
|
||||
"心想事成,万事如意!",
|
||||
"平安健康,快乐每一天!",
|
||||
"吉祥如意,福寿双全!",
|
||||
"一帆风顺,前程似锦!",
|
||||
"红红火火,喜气洋洋!",
|
||||
"金玉满堂,富贵荣华!",
|
||||
"福星高照,好运连连!",
|
||||
"寿比南山,福如东海!",
|
||||
"吉祥如意,百事可乐!",
|
||||
"开心快乐,幸福美满!",
|
||||
"事业有成,财源广进!",
|
||||
"家庭幸福,万事如意!",
|
||||
"学业进步,天天向上!",
|
||||
"身体健康,平安快乐!",
|
||||
"吉祥如意,万事大吉!",
|
||||
"好运连连,喜事临门!",
|
||||
"笑口常开,青春永驻!",
|
||||
"一帆风顺,万事如意!",
|
||||
"花开富贵,吉祥如意!",
|
||||
"福禄寿喜,样样俱全!",
|
||||
"喜气洋洋,万事如意!",
|
||||
"年年有余,吉祥如意!",
|
||||
"吉祥如意,心想事成!",
|
||||
"平安健康,幸福快乐!",
|
||||
"事业有成,家庭幸福!",
|
||||
"学业进步,前程似锦!",
|
||||
"财源广进,福星高照!",
|
||||
"心想事成,美梦成真!",
|
||||
"吉祥如意,福寿安康!",
|
||||
"一帆风顺,马到成功!",
|
||||
"红红火火,好运连连!",
|
||||
"金玉满堂,万事如意!",
|
||||
"福星高照,幸福安康!",
|
||||
"寿比南山,万事如意!",
|
||||
"吉祥如意,百事亨通!",
|
||||
"开心快乐,健康平安!",
|
||||
"事业有成,财运亨通!",
|
||||
"家庭和睦,幸福美满!",
|
||||
"学业有成,前途光明!",
|
||||
"财源滚滚,好运不断!",
|
||||
"心想事成,吉祥如意!",
|
||||
"平安健康,快乐幸福!",
|
||||
"吉祥如意,福寿双全!",
|
||||
"一帆风顺,前程无量!",
|
||||
"喜气洋洋,吉祥如意!",
|
||||
"花开富贵,万事如意!",
|
||||
"福禄寿喜,吉祥如意!",
|
||||
"吉祥如意,年年有余!",
|
||||
"年年有余,万事如意!",
|
||||
"吉祥如意,万事大吉!",
|
||||
"好运连连,幸福美满!",
|
||||
"笑口常开,健康长寿!",
|
||||
"一帆风顺,吉祥如意!",
|
||||
"花开富贵,福寿安康!",
|
||||
"金玉满堂,吉祥如意!",
|
||||
"福星高照,吉祥安康!",
|
||||
"寿比南山,万事如意!",
|
||||
"吉祥如意,百事可乐!",
|
||||
"开心快乐,平安健康!",
|
||||
"事业有成,家庭美满!",
|
||||
"学业进步,天天向上!",
|
||||
"财源广进,好运连连!",
|
||||
"心想事成,幸福美满!",
|
||||
"平安健康,万事如意!",
|
||||
"吉祥如意,福寿安康!",
|
||||
"一帆风顺,马到成功!",
|
||||
"红红火火,吉祥如意!",
|
||||
"金玉满堂,富贵吉祥!",
|
||||
"福星高照,幸福美满!",
|
||||
"寿比南山,福如东海!",
|
||||
"吉祥如意,百事亨通!",
|
||||
"开心快乐,健康平安!",
|
||||
"事业有成,财源广进!",
|
||||
"家庭幸福,万事如意!",
|
||||
"学业有成,前途似锦!",
|
||||
"财源滚滚,财运亨通!",
|
||||
"心想事成,万事如意!",
|
||||
"平安健康,快乐每一天!",
|
||||
"吉祥如意,福寿双全!",
|
||||
"一帆风顺,前程似锦!",
|
||||
"红红火火,喜气洋洋!",
|
||||
"金玉满堂,富贵荣华!",
|
||||
"福星高照,好运连连!",
|
||||
"寿比南山,福如东海!",
|
||||
"吉祥如意,百事可乐!",
|
||||
"开心快乐,幸福美满!",
|
||||
"事业有成,财源广进!",
|
||||
"家庭幸福,万事如意!",
|
||||
"学业进步,天天向上!",
|
||||
"身体健康,平安快乐!",
|
||||
"吉祥如意,万事大吉!",
|
||||
"好运连连,喜事临门!",
|
||||
"笑口常开,青春永驻!",
|
||||
"一帆风顺,万事如意!",
|
||||
"花开富贵,吉祥如意!",
|
||||
"福禄寿喜,样样俱全!",
|
||||
"喜气洋洋,万事如意!",
|
||||
"年年有余,吉祥如意!",
|
||||
"吉祥如意,心想事成!",
|
||||
"平安健康,幸福快乐!",
|
||||
"事业有成,家庭幸福!",
|
||||
"学业进步,前程似锦!",
|
||||
"财源广进,福星高照!",
|
||||
"心想事成,美梦成真!",
|
||||
"吉祥如意,福寿安康!",
|
||||
"一帆风顺,马到成功!",
|
||||
"红红火火,好运连连!",
|
||||
"金玉满堂,万事如意!",
|
||||
"福星高照,幸福安康!",
|
||||
"寿比南山,万事如意!",
|
||||
"吉祥如意,百事亨通!",
|
||||
"开心快乐,健康平安!",
|
||||
"事业有成,财运亨通!",
|
||||
"家庭和睦,幸福美满!",
|
||||
"学业有成,前途光明!",
|
||||
"财源滚滚,好运不断!",
|
||||
"心想事成,吉祥如意!",
|
||||
"平安健康,快乐幸福!",
|
||||
"吉祥如意,福寿双全!",
|
||||
"一帆风顺,前程无量!",
|
||||
"喜气洋洋,吉祥如意!",
|
||||
"花开富贵,万事如意!",
|
||||
"福禄寿喜,吉祥如意!",
|
||||
"吉祥如意,年年有余!",
|
||||
"年年有余,万事如意!",
|
||||
"吉祥如意,万事大吉!",
|
||||
"好运连连,幸福美满!",
|
||||
"笑口常开,健康长寿!",
|
||||
"一帆风顺,吉祥如意!",
|
||||
"花开富贵,福寿安康!",
|
||||
"金玉满堂,吉祥如意!",
|
||||
"福星高照,吉祥安康!",
|
||||
"寿比南山,万事如意!",
|
||||
"吉祥如意,百事可乐!",
|
||||
"开心快乐,平安健康!",
|
||||
"事业有成,家庭美满!",
|
||||
"学业进步,天天向上!",
|
||||
"财源广进,好运连连!",
|
||||
"心想事成,幸福美满!",
|
||||
"平安健康,万事如意!",
|
||||
"吉祥如意,福寿安康!",
|
||||
"一帆风顺,马到成功!",
|
||||
"红红火火,吉祥如意!",
|
||||
"金玉满堂,富贵吉祥!",
|
||||
"福星高照,幸福美满!",
|
||||
"寿比南山,福如东海!",
|
||||
"吉祥如意,百事亨通!",
|
||||
"开心快乐,健康平安!",
|
||||
"事业有成,财源广进!",
|
||||
"家庭幸福,万事如意!",
|
||||
"学业有成,前途似锦!",
|
||||
"财源滚滚,财运亨通!",
|
||||
"心想事成,万事如意!",
|
||||
"平安健康,快乐每一天!",
|
||||
"吉祥如意,福寿双全!",
|
||||
"一帆风顺,前程似锦!",
|
||||
"红红火火,喜气洋洋!",
|
||||
"金玉满堂,富贵荣华!",
|
||||
"福星高照,好运连连!",
|
||||
"寿比南山,福如东海!",
|
||||
"吉祥如意,百事可乐!",
|
||||
"开心快乐,幸福美满!",
|
||||
"事业有成,财源广进!",
|
||||
"家庭幸福,万事如意!",
|
||||
"学业进步,天天向上!",
|
||||
"身体健康,平安快乐!",
|
||||
"吉祥如意,万事大吉!",
|
||||
"好运连连,喜事临门!",
|
||||
"笑口常开,青春永驻!",
|
||||
"一帆风顺,万事如意!",
|
||||
"花开富贵,吉祥如意!",
|
||||
"福禄寿喜,样样俱全!",
|
||||
"喜气洋洋,万事如意!",
|
||||
"年年有余,吉祥如意!",
|
||||
"吉祥如意,心想事成!",
|
||||
"平安健康,幸福快乐!",
|
||||
"事业有成,家庭幸福!",
|
||||
"学业进步,前程似锦!",
|
||||
"财源广进,福星高照!",
|
||||
"心想事成,美梦成真!",
|
||||
"吉祥如意,福寿安康!",
|
||||
"一帆风顺,马到成功!",
|
||||
"红红火火,好运连连!",
|
||||
"金玉满堂,万事如意!",
|
||||
"福星高照,幸福安康!",
|
||||
"寿比南山,万事如意!",
|
||||
"吉祥如意,百事亨通!",
|
||||
"开心快乐,健康平安!",
|
||||
"事业有成,财运亨通!",
|
||||
"家庭和睦,幸福美满!",
|
||||
"学业有成,前途光明!",
|
||||
"财源滚滚,好运不断!",
|
||||
"心想事成,吉祥如意!",
|
||||
"平安健康,快乐幸福!",
|
||||
"吉祥如意,福寿双全!",
|
||||
"一帆风顺,前程无量!",
|
||||
"喜气洋洋,吉祥如意!",
|
||||
"花开富贵,万事如意!",
|
||||
"福禄寿喜,吉祥如意!",
|
||||
"吉祥如意,年年有余!",
|
||||
"年年有余,万事如意!",
|
||||
"吉祥如意,万事大吉!",
|
||||
"好运连连,幸福美满!",
|
||||
"笑口常开,健康长寿!",
|
||||
"一帆风顺,吉祥如意!",
|
||||
"花开富贵,福寿安康!",
|
||||
"金玉满堂,吉祥如意!",
|
||||
"福星高照,吉祥安康!",
|
||||
"寿比南山,万事如意!",
|
||||
"吉祥如意,百事可乐!",
|
||||
"开心快乐,平安健康!",
|
||||
"事业有成,家庭美满!",
|
||||
"学业进步,天天向上!",
|
||||
"财源广进,好运连连!",
|
||||
"心想事成,幸福美满!",
|
||||
"平安健康,万事如意!",
|
||||
"吉祥如意,福寿安康!",
|
||||
"一帆风顺,马到成功!",
|
||||
"红红火火,吉祥如意!",
|
||||
"金玉满堂,富贵吉祥!",
|
||||
"福星高照,幸福美满!",
|
||||
"寿比南山,福如东海!",
|
||||
"吉祥如意,百事亨通!",
|
||||
"开心快乐,健康平安!",
|
||||
"事业有成,财源广进!",
|
||||
"家庭幸福,万事如意!",
|
||||
"学业有成,前途似锦!",
|
||||
"财源滚滚,财运亨通!",
|
||||
"心想事成,万事如意!",
|
||||
"平安健康,快乐每一天!",
|
||||
"吉祥如意,福寿双全!",
|
||||
"一帆风顺,前程似锦!",
|
||||
"红红火火,喜气洋洋!",
|
||||
"金玉满堂,富贵荣华!",
|
||||
"福星高照,好运连连!",
|
||||
"寿比南山,福如东海!",
|
||||
"吉祥如意,百事可乐!",
|
||||
"开心快乐,幸福美满!",
|
||||
"事业有成,财源广进!",
|
||||
"家庭幸福,万事如意!",
|
||||
"学业进步,天天向上!",
|
||||
"身体健康,平安快乐!",
|
||||
"吉祥如意,万事大吉!",
|
||||
"好运连连,喜事临门!",
|
||||
"笑口常开,青春永驻!",
|
||||
"一帆风顺,万事如意!",
|
||||
"花开富贵,吉祥如意!",
|
||||
"福禄寿喜,样样俱全!",
|
||||
"喜气洋洋,万事如意!",
|
||||
"年年有余,吉祥如意!",
|
||||
"吉祥如意,心想事成!",
|
||||
"平安健康,幸福快乐!",
|
||||
"事业有成,家庭幸福!",
|
||||
"学业进步,前程似锦!",
|
||||
"财源广进,福星高照!",
|
||||
"心想事成,美梦成真!",
|
||||
"吉祥如意,福寿安康!",
|
||||
"一帆风顺,马到成功!",
|
||||
"红红火火,好运连连!",
|
||||
"金玉满堂,万事如意!",
|
||||
"福星高照,幸福安康!",
|
||||
"寿比南山,万事如意!",
|
||||
"吉祥如意,百事亨通!",
|
||||
"开心快乐,健康平安!",
|
||||
"事业有成,财运亨通!",
|
||||
"家庭和睦,幸福美满!",
|
||||
"学业有成,前途光明!",
|
||||
"财源滚滚,好运不断!",
|
||||
"心想事成,吉祥如意!",
|
||||
"平安健康,快乐幸福!",
|
||||
"吉祥如意,福寿双全!",
|
||||
"一帆风顺,前程无量!",
|
||||
"喜气洋洋,吉祥如意!",
|
||||
"花开富贵,万事如意!",
|
||||
"福禄寿喜,吉祥如意!",
|
||||
"吉祥如意,年年有余!",
|
||||
"年年有余,万事如意!",
|
||||
"吉祥如意,万事大吉!",
|
||||
"好运连连,幸福美满!",
|
||||
"笑口常开,健康长寿!",
|
||||
"一帆风顺,吉祥如意!",
|
||||
"花开富贵,福寿安康!",
|
||||
"金玉满堂,吉祥如意!",
|
||||
"福星高照,吉祥安康!",
|
||||
"寿比南山,万事如意!",
|
||||
"吉祥如意,百事可乐!",
|
||||
"开心快乐,平安健康!",
|
||||
"事业有成,家庭美满!",
|
||||
"学业进步,天天向上!",
|
||||
"财源广进,好运连连!",
|
||||
"心想事成,幸福美满!",
|
||||
"平安健康,万事如意!",
|
||||
"吉祥如意,福寿安康!",
|
||||
"一帆风顺,马到成功!",
|
||||
"红红火火,吉祥如意!",
|
||||
"金玉满堂,富贵吉祥!",
|
||||
"福星高照,幸福美满!",
|
||||
"寿比南山,福如东海!",
|
||||
"吉祥如意,百事亨通!",
|
||||
"开心快乐,健康平安!",
|
||||
"事业有成,财源广进!",
|
||||
"家庭幸福,万事如意!",
|
||||
"学业有成,前途似锦!",
|
||||
"财源滚滚,财运亨通!",
|
||||
"心想事成,万事如意!",
|
||||
"平安健康,快乐每一天!",
|
||||
"吉祥如意,福寿双全!",
|
||||
"一帆风顺,前程似锦!",
|
||||
"红红火火,喜气洋洋!",
|
||||
"金玉满堂,富贵荣华!",
|
||||
"福星高照,好运连连!",
|
||||
"寿比南山,福如东海!",
|
||||
"吉祥如意,百事可乐!",
|
||||
"开心快乐,幸福美满!",
|
||||
"事业有成,财源广进!",
|
||||
"家庭幸福,万事如意!",
|
||||
"学业进步,天天向上!",
|
||||
"身体健康,平安快乐!",
|
||||
"吉祥如意,万事大吉!",
|
||||
"好运连连,喜事临门!",
|
||||
"笑口常开,青春永驻!",
|
||||
"一帆风顺,万事如意!",
|
||||
"花开富贵,吉祥如意!",
|
||||
"福禄寿喜,样样俱全!",
|
||||
"喜气洋洋,万事如意!",
|
||||
"年年有余,吉祥如意!",
|
||||
"吉祥如意,心想事成!",
|
||||
"平安健康,幸福快乐!",
|
||||
"事业有成,家庭幸福!",
|
||||
"学业进步,前程似锦!",
|
||||
"财源广进,福星高照!",
|
||||
"心想事成,美梦成真!",
|
||||
"吉祥如意,福寿安康!",
|
||||
"一帆风顺,马到成功!",
|
||||
"红红火火,好运连连!",
|
||||
"金玉满堂,万事如意!",
|
||||
"福星高照,幸福安康!",
|
||||
"寿比南山,万事如意!",
|
||||
"吉祥如意,百事亨通!",
|
||||
"开心快乐,健康平安!",
|
||||
"事业有成,财运亨通!",
|
||||
"家庭和睦,幸福美满!",
|
||||
"学业有成,前途光明!",
|
||||
"财源滚滚,好运不断!",
|
||||
"心想事成,吉祥如意!",
|
||||
"平安健康,快乐幸福!",
|
||||
"吉祥如意,福寿双全!",
|
||||
"一帆风顺,前程无量!",
|
||||
"喜气洋洋,吉祥如意!",
|
||||
"花开富贵,万事如意!",
|
||||
"福禄寿喜,吉祥如意!",
|
||||
"吉祥如意,年年有余!",
|
||||
"年年有余,万事如意!",
|
||||
"吉祥如意,万事大吉!",
|
||||
"好运连连,幸福美满!",
|
||||
"笑口常开,健康长寿!",
|
||||
"一帆风顺,吉祥如意!",
|
||||
"花开富贵,福寿安康!",
|
||||
"金玉满堂,吉祥如意!",
|
||||
"福星高照,吉祥安康!",
|
||||
"寿比南山,万事如意!",
|
||||
"吉祥如意,百事可乐!",
|
||||
"开心快乐,平安健康!",
|
||||
"事业有成,家庭美满!",
|
||||
"学业进步,天天向上!",
|
||||
"财源广进,好运连连!",
|
||||
"心想事成,幸福美满!",
|
||||
"平安健康,万事如意!",
|
||||
"吉祥如意,福寿安康!",
|
||||
"一帆风顺,马到成功!",
|
||||
"红红火火,吉祥如意!",
|
||||
"金玉满堂,富贵吉祥!",
|
||||
"福星高照,幸福美满!",
|
||||
"寿比南山,福如东海!",
|
||||
"吉祥如意,百事亨通!",
|
||||
"开心快乐,健康平安!",
|
||||
"事业有成,财源广进!",
|
||||
"家庭幸福,万事如意!",
|
||||
"学业有成,前途似锦!",
|
||||
"财源滚滚,财运亨通!",
|
||||
"心想事成,万事如意!",
|
||||
"平安健康,快乐每一天!",
|
||||
"吉祥如意,福寿双全!",
|
||||
"一帆风顺,前程似锦!",
|
||||
"红红火火,喜气洋洋!",
|
||||
"金玉满堂,富贵荣华!",
|
||||
"福星高照,好运连连!",
|
||||
"寿比南山,福如东海!",
|
||||
"吉祥如意,百事可乐!",
|
||||
"开心快乐,幸福美满!",
|
||||
"事业有成,财源广进!",
|
||||
"家庭幸福,万事如意!",
|
||||
"学业进步,天天向上!",
|
||||
"身体健康,平安快乐!",
|
||||
"吉祥如意,万事大吉!",
|
||||
"好运连连,喜事临门!",
|
||||
"笑口常开,青春永驻!",
|
||||
"一帆风顺,万事如意!",
|
||||
"花开富贵,吉祥如意!",
|
||||
"福禄寿喜,样样俱全!",
|
||||
"喜气洋洋,万事如意!",
|
||||
"年年有余,吉祥如意!",
|
||||
"吉祥如意,心想事成!",
|
||||
"平安健康,幸福快乐!",
|
||||
"事业有成,家庭幸福!",
|
||||
"学业进步,前程似锦!",
|
||||
"财源广进,福星高照!",
|
||||
"心想事成,美梦成真!",
|
||||
"吉祥如意,福寿安康!",
|
||||
"一帆风顺,马到成功!",
|
||||
"红红火火,好运连连!",
|
||||
"金玉满堂,万事如意!",
|
||||
"福星高照,幸福安康!",
|
||||
"寿比南山,万事如意!",
|
||||
"吉祥如意,百事亨通!",
|
||||
"开心快乐,健康平安!",
|
||||
"事业有成,财运亨通!",
|
||||
"家庭和睦,幸福美满!",
|
||||
"学业有成,前途光明!",
|
||||
"财源滚滚,好运不断!",
|
||||
"心想事成,吉祥如意!",
|
||||
"平安健康,快乐幸福!",
|
||||
"吉祥如意,福寿双全!",
|
||||
"一帆风顺,前程无量!",
|
||||
"喜气洋洋,吉祥如意!",
|
||||
"花开富贵,万事如意!",
|
||||
"福禄寿喜,吉祥如意!",
|
||||
"吉祥如意,年年有余!",
|
||||
"年年有余,万事如意!",
|
||||
"吉祥如意,万事大吉!",
|
||||
"好运连连,幸福美满!",
|
||||
"笑口常开,健康长寿!",
|
||||
"一帆风顺,吉祥如意!",
|
||||
"花开富贵,福寿安康!",
|
||||
"金玉满堂,吉祥如意!",
|
||||
"福星高照,吉祥安康!",
|
||||
"寿比南山,万事如意!",
|
||||
"吉祥如意,百事可乐!",
|
||||
"开心快乐,平安健康!",
|
||||
"事业有成,家庭美满!",
|
||||
"学业进步,天天向上!",
|
||||
"财源广进,好运连连!",
|
||||
"心想事成,幸福美满!",
|
||||
"平安健康,万事如意!",
|
||||
"吉祥如意,福寿安康!",
|
||||
"一帆风顺,马到成功!",
|
||||
"红红火火,吉祥如意!",
|
||||
"金玉满堂,富贵吉祥!",
|
||||
"福星高照,幸福美满!",
|
||||
"寿比南山,福如东海!",
|
||||
"吉祥如意,百事亨通!",
|
||||
"开心快乐,健康平安!",
|
||||
"事业有成,财源广进!",
|
||||
"家庭幸福,万事如意!",
|
||||
"学业有成,前途似锦!",
|
||||
"财源滚滚,财运亨通!",
|
||||
"心想事成,万事如意!",
|
||||
"平安健康,快乐每一天!",
|
||||
"吉祥如意,福寿双全!",
|
||||
"一帆风顺,前程似锦!",
|
||||
"红红火火,喜气洋洋!",
|
||||
"金玉满堂,富贵荣华!",
|
||||
"福星高照,好运连连!",
|
||||
"寿比南山,福如东海!",
|
||||
"吉祥如意,百事可乐!",
|
||||
"开心快乐,幸福美满!",
|
||||
"事业有成,财源广进!",
|
||||
"家庭幸福,万事如意!",
|
||||
"学业进步,天天向上!",
|
||||
"身体健康,平安快乐!",
|
||||
"吉祥如意,万事大吉!",
|
||||
"好运连连,喜事临门!",
|
||||
"笑口常开,青春永驻!",
|
||||
"一帆风顺,万事如意!",
|
||||
"花开富贵,吉祥如意!",
|
||||
"福禄寿喜,样样俱全!",
|
||||
"喜气洋洋,万事如意!",
|
||||
"年年有余,吉祥如意!",
|
||||
"吉祥如意,心想事成!",
|
||||
"平安健康,幸福快乐!",
|
||||
"事业有成,家庭幸福!",
|
||||
"学业进步,前程似锦!",
|
||||
"财源广进,福星高照!",
|
||||
"心想事成,美梦成真!",
|
||||
"吉祥如意,福寿安康!",
|
||||
"一帆风顺,马到成功!",
|
||||
"红红火火,好运连连!",
|
||||
"金玉满堂,万事如意!",
|
||||
"福星高照,幸福安康!",
|
||||
"寿比南山,万事如意!",
|
||||
"吉祥如意,百事亨通!",
|
||||
"开心快乐,健康平安!",
|
||||
"事业有成,财运亨通!",
|
||||
"家庭和睦,幸福美满!",
|
||||
"学业有成,前途光明!",
|
||||
"财源滚滚,好运不断!",
|
||||
"心想事成,吉祥如意!",
|
||||
"平安健康,快乐幸福!",
|
||||
"吉祥如意,福寿双全!",
|
||||
"一帆风顺,前程无量!",
|
||||
"喜气洋洋,吉祥如意!",
|
||||
"花开富贵,万事如意!",
|
||||
"福禄寿喜,吉祥如意!",
|
||||
"吉祥如意,年年有余!",
|
||||
"年年有余,万事如意!",
|
||||
"吉祥如意,万事大吉!",
|
||||
"好运连连,幸福美满!",
|
||||
"笑口常开,健康长寿!",
|
||||
"一帆风顺,吉祥如意!",
|
||||
"花开富贵,福寿安康!",
|
||||
"金玉满堂,吉祥如意!",
|
||||
"福星高照,吉祥安康!",
|
||||
"寿比南山,万事如意!",
|
||||
"吉祥如意,百事可乐!",
|
||||
"开心快乐,平安健康!",
|
||||
"事业有成,家庭美满!",
|
||||
"学业进步,天天向上!",
|
||||
"财源广进,好运连连!",
|
||||
"心想事成,幸福美满!",
|
||||
"平安健康,万事如意!",
|
||||
"吉祥如意,福寿安康!",
|
||||
"一帆风顺,马到成功!",
|
||||
"红红火火,吉祥如意!",
|
||||
"金玉满堂,富贵吉祥!",
|
||||
"福星高照,幸福美满!",
|
||||
"寿比南山,福如东海!",
|
||||
"吉祥如意,百事亨通!",
|
||||
"开心快乐,健康平安!",
|
||||
"事业有成,财源广进!",
|
||||
"家庭幸福,万事如意!",
|
||||
"学业有成,前途似锦!",
|
||||
"财源滚滚,财运亨通!",
|
||||
"心想事成,万事如意!",
|
||||
"平安健康,快乐每一天!",
|
||||
"吉祥如意,福寿双全!",
|
||||
"一帆风顺,前程似锦!",
|
||||
"红红火火,喜气洋洋!",
|
||||
"金玉满堂,富贵荣华!",
|
||||
"福星高照,好运连连!",
|
||||
"寿比南山,福如东海!",
|
||||
"吉祥如意,百事可乐!",
|
||||
"开心快乐,幸福美满!",
|
||||
"事业有成,财源广进!",
|
||||
"家庭幸福,万事如意!",
|
||||
"学业进步,天天向上!",
|
||||
"身体健康,平安快乐!",
|
||||
"吉祥如意,万事大吉!",
|
||||
"好运连连,喜事临门!",
|
||||
"笑口常开,青春永驻!",
|
||||
"一帆风顺,万事如意!",
|
||||
"花开富贵,吉祥如意!",
|
||||
"福禄寿喜,样样俱全!",
|
||||
"喜气洋洋,万事如意!",
|
||||
"年年有余,吉祥如意!",
|
||||
"吉祥如意,心想事成!",
|
||||
"平安健康,幸福快乐!",
|
||||
"事业有成,家庭幸福!",
|
||||
"学业进步,前程似锦!",
|
||||
"财源广进,福星高照!",
|
||||
"心想事成,美梦成真!",
|
||||
"吉祥如意,福寿安康!",
|
||||
"一帆风顺,马到成功!",
|
||||
"红红火火,好运连连!",
|
||||
"金玉满堂,万事如意!",
|
||||
"福星高照,幸福安康!",
|
||||
"寿比南山,万事如意!",
|
||||
"吉祥如意,百事亨通!",
|
||||
"开心快乐,健康平安!",
|
||||
"事业有成,财运亨通!",
|
||||
"家庭和睦,幸福美满!",
|
||||
"学业有成,前途光明!",
|
||||
"财源滚滚,好运不断!",
|
||||
"心想事成,吉祥如意!",
|
||||
"平安健康,快乐幸福!",
|
||||
"吉祥如意,福寿双全!",
|
||||
"一帆风顺,前程无量!",
|
||||
"喜气洋洋,吉祥如意!",
|
||||
"花开富贵,万事如意!",
|
||||
"福禄寿喜,吉祥如意!",
|
||||
"吉祥如意,年年有余!",
|
||||
"年年有余,万事如意!",
|
||||
"吉祥如意,万事大吉!",
|
||||
"好运连连,幸福美满!",
|
||||
"笑口常开,健康长寿!",
|
||||
"一帆风顺,吉祥如意!",
|
||||
"花开富贵,福寿安康!",
|
||||
"金玉满堂,吉祥如意!",
|
||||
"福星高照,吉祥安康!",
|
||||
"寿比南山,万事如意!",
|
||||
"吉祥如意,百事可乐!",
|
||||
"开心快乐,平安健康!",
|
||||
"事业有成,家庭美满!",
|
||||
"学业进步,天天向上!",
|
||||
"财源广进,好运连连!",
|
||||
"心想事成,幸福美满!",
|
||||
"平安健康,万事如意!",
|
||||
"吉祥如意,福寿安康!",
|
||||
"一帆风顺,马到成功!",
|
||||
"红红火火,吉祥如意!",
|
||||
"金玉满堂,富贵吉祥!",
|
||||
"福星高照,幸福美满!",
|
||||
"寿比南山,福如东海!",
|
||||
"吉祥如意,百事亨通!",
|
||||
"开心快乐,健康平安!",
|
||||
"事业有成,财源广进!",
|
||||
"家庭幸福,万事如意!",
|
||||
"学业有成,前途似锦!"
|
||||
]
|
||||
|
||||
# 批量创建祝福语,如果已存在则跳过
|
||||
for blessing_content in default_blessings:
|
||||
Blessing.objects.get_or_create(content=blessing_content)
|
||||
|
||||
return f"已添加或更新 {len(default_blessings)} 条祝福语"
|
||||
98
activity/views.py
Normal file
98
activity/views.py
Normal file
@@ -0,0 +1,98 @@
|
||||
from django.shortcuts import render, redirect
|
||||
from django.http import JsonResponse
|
||||
from .models import ActivitySetting, Blessing, Danmu
|
||||
from .forms import DanmuForm, ActivitySettingForm
|
||||
|
||||
# Create your views here.
|
||||
def index(request):
|
||||
"""主页面视图"""
|
||||
setting = ActivitySetting.objects.first() or ActivitySetting.objects.create()
|
||||
danmus = Danmu.objects.filter(is_approved=True).order_by('-created_at')
|
||||
|
||||
context = {
|
||||
'setting': setting,
|
||||
'danmus': danmus,
|
||||
}
|
||||
|
||||
return render(request, 'activity/index.html', context)
|
||||
|
||||
def submit(request):
|
||||
"""扫码提交视图"""
|
||||
random_blessings = Blessing.objects.order_by('?')[:5]
|
||||
|
||||
if request.method == 'POST':
|
||||
form = DanmuForm(request.POST, request.FILES)
|
||||
if form.is_valid():
|
||||
form.save()
|
||||
return redirect('index')
|
||||
else:
|
||||
form = DanmuForm()
|
||||
|
||||
context = {
|
||||
'form': form,
|
||||
'random_blessings': random_blessings,
|
||||
}
|
||||
|
||||
return render(request, 'activity/submit.html', context)
|
||||
|
||||
def admin_review(request):
|
||||
"""管理员审核视图"""
|
||||
danmus = Danmu.objects.filter(is_approved=False).order_by('-created_at')
|
||||
|
||||
if request.method == 'POST':
|
||||
danmu_id = request.POST.get('danmu_id')
|
||||
action = request.POST.get('action')
|
||||
|
||||
if danmu_id and action:
|
||||
try:
|
||||
danmu = Danmu.objects.get(id=danmu_id)
|
||||
if action == 'approve':
|
||||
danmu.is_approved = True
|
||||
danmu.save()
|
||||
elif action == 'reject':
|
||||
danmu.delete()
|
||||
except Danmu.DoesNotExist:
|
||||
pass
|
||||
|
||||
return redirect('admin_review')
|
||||
|
||||
context = {
|
||||
'danmus': danmus,
|
||||
}
|
||||
|
||||
return render(request, 'activity/admin_review.html', context)
|
||||
|
||||
def setting(request):
|
||||
"""设置视图"""
|
||||
setting = ActivitySetting.objects.first() or ActivitySetting.objects.create()
|
||||
|
||||
if request.method == 'POST':
|
||||
form = ActivitySettingForm(request.POST, request.FILES, instance=setting)
|
||||
if form.is_valid():
|
||||
form.save()
|
||||
return redirect('index')
|
||||
else:
|
||||
form = ActivitySettingForm(instance=setting)
|
||||
|
||||
context = {
|
||||
'form': form,
|
||||
'setting': setting,
|
||||
}
|
||||
|
||||
return render(request, 'activity/setting.html', context)
|
||||
|
||||
def api_danmu(request):
|
||||
"""获取实时弹幕API"""
|
||||
danmus = Danmu.objects.filter(is_approved=True).order_by('-created_at')[:50]
|
||||
danmu_list = [
|
||||
{
|
||||
'id': danmu.id,
|
||||
'name': danmu.name,
|
||||
'content': danmu.content,
|
||||
'image': danmu.image.url if danmu.image else None,
|
||||
'created_at': danmu.created_at.strftime('%Y-%m-%d %H:%M:%S'),
|
||||
}
|
||||
for danmu in danmus
|
||||
]
|
||||
|
||||
return JsonResponse({'danmus': danmu_list})
|
||||
Reference in New Issue
Block a user