ErisPulse-Raffle 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- Raffle/Core.py +858 -0
- Raffle/__init__.py +1 -0
- Raffle/templates/__init__.py +0 -0
- Raffle/templates/view.css +433 -0
- Raffle/templates/view.html +295 -0
- Raffle/templates/view.js +921 -0
- erispulse_raffle-1.0.0.dist-info/METADATA +123 -0
- erispulse_raffle-1.0.0.dist-info/RECORD +11 -0
- erispulse_raffle-1.0.0.dist-info/WHEEL +5 -0
- erispulse_raffle-1.0.0.dist-info/entry_points.txt +2 -0
- erispulse_raffle-1.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
<h1 class="page-title">抽奖管理</h1>
|
|
2
|
+
<p class="page-desc" style="margin-bottom:20px">创建和管理抽奖活动,查看参与者名单,一键开奖</p>
|
|
3
|
+
|
|
4
|
+
<div class="raffle-grid-4" style="margin-bottom:24px">
|
|
5
|
+
<div class="card">
|
|
6
|
+
<div class="card-body" style="text-align:center">
|
|
7
|
+
<div id="rf-stat-current" style="font-size:14px;font-weight:600;margin-bottom:4px">--</div>
|
|
8
|
+
<div style="font-size:12px;color:var(--tx-s)">当前活动</div>
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
<div class="card">
|
|
12
|
+
<div class="card-body" style="text-align:center">
|
|
13
|
+
<div id="rf-stat-confirmed" style="font-size:24px;font-weight:700;color:var(--accent)">0</div>
|
|
14
|
+
<div style="font-size:12px;color:var(--tx-s)">已确认</div>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
<div class="card">
|
|
18
|
+
<div class="card-body" style="text-align:center">
|
|
19
|
+
<div id="rf-stat-draw" style="font-size:24px;font-weight:700;color:var(--pr-c)">0</div>
|
|
20
|
+
<div style="font-size:12px;color:var(--tx-s)">开奖人数</div>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
<div class="card">
|
|
24
|
+
<div class="card-body" style="text-align:center">
|
|
25
|
+
<div id="rf-stat-status" style="font-size:16px;font-weight:600">--</div>
|
|
26
|
+
<div style="font-size:12px;color:var(--tx-s)">活动状态</div>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<div class="grid-2" style="margin-bottom:20px">
|
|
32
|
+
<div class="card">
|
|
33
|
+
<div class="card-header">
|
|
34
|
+
<span>活动列表</span>
|
|
35
|
+
<button class="btn btn-primary btn-sm" onclick="rfShowCreate()">+ 创建活动</button>
|
|
36
|
+
</div>
|
|
37
|
+
<div class="card-body">
|
|
38
|
+
<div id="rf-activity-list" style="font-size:14px;color:var(--tx-s)">加载中...</div>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<div class="card" id="rf-create-panel" style="display:none">
|
|
43
|
+
<div class="card-header">
|
|
44
|
+
<span id="rf-create-title">创建新活动</span>
|
|
45
|
+
<button class="btn btn-secondary btn-sm" onclick="rfHideCreate()">取消</button>
|
|
46
|
+
</div>
|
|
47
|
+
<div class="card-body">
|
|
48
|
+
<div class="rf-form-group">
|
|
49
|
+
<label class="rf-label">活动 ID</label>
|
|
50
|
+
<input type="text" id="rf-f-id" class="form-input" placeholder="如: 100rc (留空自动生成)" style="width:100%">
|
|
51
|
+
</div>
|
|
52
|
+
<div class="rf-form-group">
|
|
53
|
+
<label class="rf-label">活动名称</label>
|
|
54
|
+
<input type="text" id="rf-f-name" class="form-input" placeholder="如: 社区纪念周边抽奖" style="width:100%">
|
|
55
|
+
</div>
|
|
56
|
+
<div class="rf-form-group">
|
|
57
|
+
<label class="rf-label">活动描述</label>
|
|
58
|
+
<input type="text" id="rf-f-desc" class="form-input" placeholder="简短描述活动内容" style="width:100%">
|
|
59
|
+
</div>
|
|
60
|
+
<div class="rf-form-group">
|
|
61
|
+
<label class="rf-label">开奖人数</label>
|
|
62
|
+
<input type="number" id="rf-f-draw" class="form-input" value="5" min="1" style="width:120px">
|
|
63
|
+
</div>
|
|
64
|
+
<div class="rf-form-group">
|
|
65
|
+
<label class="rf-label">触发关键词 <span style="color:var(--tx-t);font-weight:400">(逗号分隔)</span></label>
|
|
66
|
+
<input type="text" id="rf-f-keywords" class="form-input" placeholder="我想要礼物,想要礼物,参与抽奖" style="width:100%">
|
|
67
|
+
</div>
|
|
68
|
+
<div class="rf-form-group">
|
|
69
|
+
<label class="rf-label">自动确认参与 <span style="color:var(--tx-t);font-weight:400">(跳过待录入直接加入参与组)</span></label>
|
|
70
|
+
<div style="display:flex;align-items:center;gap:8px">
|
|
71
|
+
<label class="rf-switch"><input type="checkbox" id="rf-f-autoconfirm"><span class="rf-switch-slider"></span></label>
|
|
72
|
+
<span id="rf-f-autoconfirm-label" style="font-size:13px;color:var(--tx-s)">关闭</span>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
<div class="rf-form-group">
|
|
76
|
+
<label class="rf-label">白名单模式 <span style="color:var(--tx-t);font-weight:400">(仅白名单用户可参与)</span></label>
|
|
77
|
+
<div style="display:flex;align-items:center;gap:8px">
|
|
78
|
+
<label class="rf-switch"><input type="checkbox" id="rf-f-whitelist"><span class="rf-switch-slider"></span></label>
|
|
79
|
+
<span id="rf-f-whitelist-label" style="font-size:13px;color:var(--tx-s)">关闭</span>
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
<div class="rf-form-group">
|
|
83
|
+
<label class="rf-label">允许的群聊</label>
|
|
84
|
+
<div style="display:flex;gap:8px;margin-bottom:8px">
|
|
85
|
+
<select id="rf-f-platform" class="form-select" style="width:140px">
|
|
86
|
+
<option value="">选择平台</option>
|
|
87
|
+
</select>
|
|
88
|
+
<input type="text" id="rf-f-groupid" class="form-input" placeholder="群聊 ID" style="flex:1">
|
|
89
|
+
<button class="btn btn-secondary btn-sm" onclick="rfAddGroup()">添加</button>
|
|
90
|
+
</div>
|
|
91
|
+
<div id="rf-groups-list"></div>
|
|
92
|
+
</div>
|
|
93
|
+
<div style="margin-top:12px">
|
|
94
|
+
<button class="btn btn-primary" onclick="rfSaveActivity()">保存活动</button>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
|
|
100
|
+
<div class="card" style="margin-bottom:20px" id="rf-participants-card">
|
|
101
|
+
<div class="card-header">
|
|
102
|
+
<span>参与者名单 <span id="rf-participant-count" style="color:var(--tx-t);font-weight:400"></span></span>
|
|
103
|
+
<div style="display:flex;gap:8px;align-items:center">
|
|
104
|
+
<div class="rf-tab-group" id="rf-group-tabs">
|
|
105
|
+
<button class="rf-tab rf-tab-active" onclick="rfSwitchGroup('all')" data-group="all">全部</button>
|
|
106
|
+
<button class="rf-tab" onclick="rfSwitchGroup('confirmed')" data-group="confirmed">已确认</button>
|
|
107
|
+
<button class="rf-tab" onclick="rfSwitchGroup('pending')" data-group="pending">待录入</button>
|
|
108
|
+
</div>
|
|
109
|
+
<input type="text" id="rf-search" class="form-input" placeholder="搜索..." style="width:160px;display:inline-block" oninput="rfFilterParticipants()">
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
<div class="card-body">
|
|
113
|
+
<div id="rf-participants-empty" style="text-align:center;padding:24px;color:var(--tx-t)">请先选择一个活动</div>
|
|
114
|
+
<table id="rf-participants-table" class="rf-table" style="display:none;width:100%">
|
|
115
|
+
<thead>
|
|
116
|
+
<tr>
|
|
117
|
+
<th style="width:40px">#</th>
|
|
118
|
+
<th>昵称</th>
|
|
119
|
+
<th>用户 ID</th>
|
|
120
|
+
<th>平台</th>
|
|
121
|
+
<th>分组</th>
|
|
122
|
+
<th>加入时间</th>
|
|
123
|
+
<th style="width:140px">操作</th>
|
|
124
|
+
</tr>
|
|
125
|
+
</thead>
|
|
126
|
+
<tbody id="rf-participants-body"></tbody>
|
|
127
|
+
</table>
|
|
128
|
+
</div>
|
|
129
|
+
</div>
|
|
130
|
+
|
|
131
|
+
<div class="grid-2" style="margin-bottom:20px">
|
|
132
|
+
<div class="card">
|
|
133
|
+
<div class="card-header">
|
|
134
|
+
<span>开奖</span>
|
|
135
|
+
</div>
|
|
136
|
+
<div class="card-body">
|
|
137
|
+
<div id="rf-draw-idle">
|
|
138
|
+
<p style="color:var(--tx-s);margin-bottom:12px">选择活动后,点击开奖按钮随机从「已确认」参与者中抽取获奖者</p>
|
|
139
|
+
<button class="btn btn-primary" id="rf-draw-btn" onclick="rfStartDraw()" disabled>开奖</button>
|
|
140
|
+
<button class="btn btn-secondary" id="rf-draw-result-btn" onclick="rfShowResult()" style="display:none">查看结果</button>
|
|
141
|
+
<button class="btn btn-danger btn-sm" id="rf-draw-revert-btn" onclick="rfRevertDraw()" style="display:none">撤回开奖</button>
|
|
142
|
+
</div>
|
|
143
|
+
<div id="rf-draw-animating" style="display:none;text-align:center;padding:32px">
|
|
144
|
+
<div id="rf-draw-slot" class="rf-draw-slot">???</div>
|
|
145
|
+
<p style="margin-top:12px;color:var(--tx-s)">正在抽取中...</p>
|
|
146
|
+
</div>
|
|
147
|
+
<div id="rf-draw-done" style="display:none">
|
|
148
|
+
<div style="text-align:center;margin-bottom:16px">
|
|
149
|
+
<h3 style="color:var(--ok-c);margin-bottom:8px">抽奖结果</h3>
|
|
150
|
+
<p id="rf-draw-summary" style="color:var(--tx-s)"></p>
|
|
151
|
+
</div>
|
|
152
|
+
<div id="rf-winners-list"></div>
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
156
|
+
|
|
157
|
+
<div class="card">
|
|
158
|
+
<div class="card-header">
|
|
159
|
+
<span>名单管理</span>
|
|
160
|
+
</div>
|
|
161
|
+
<div class="card-body">
|
|
162
|
+
<div class="rf-form-group">
|
|
163
|
+
<label class="rf-label">黑名单 <span style="color:var(--tx-t);font-weight:400">(被加入的用户无法参与)</span></label>
|
|
164
|
+
<div style="display:flex;gap:8px;margin-bottom:8px">
|
|
165
|
+
<input type="text" id="rf-bl-input" class="form-input" placeholder="输入用户 ID" style="flex:1">
|
|
166
|
+
<input type="text" id="rf-bl-name" class="form-input" placeholder="备注名(可选)" style="width:120px">
|
|
167
|
+
<button class="btn btn-secondary btn-sm" onclick="rfAddBlacklist()">添加</button>
|
|
168
|
+
</div>
|
|
169
|
+
<div id="rf-blacklist-tags"></div>
|
|
170
|
+
</div>
|
|
171
|
+
<div class="rf-form-group" style="margin-top:16px">
|
|
172
|
+
<label class="rf-label">白名单 <span style="color:var(--tx-t);font-weight:400">(白名单模式下仅这些用户可参与)</span></label>
|
|
173
|
+
<div style="display:flex;gap:8px;margin-bottom:8px">
|
|
174
|
+
<input type="text" id="rf-wl-input" class="form-input" placeholder="输入用户 ID" style="flex:1">
|
|
175
|
+
<input type="text" id="rf-wl-name" class="form-input" placeholder="备注名(可选)" style="width:120px">
|
|
176
|
+
<button class="btn btn-secondary btn-sm" onclick="rfAddWhitelist()">添加</button>
|
|
177
|
+
</div>
|
|
178
|
+
<div id="rf-whitelist-tags"></div>
|
|
179
|
+
</div>
|
|
180
|
+
</div>
|
|
181
|
+
</div>
|
|
182
|
+
</div>
|
|
183
|
+
|
|
184
|
+
<div class="card">
|
|
185
|
+
<div class="card-header">
|
|
186
|
+
<span>回复模板</span>
|
|
187
|
+
</div>
|
|
188
|
+
<div class="card-body">
|
|
189
|
+
<div class="grid-2">
|
|
190
|
+
<div>
|
|
191
|
+
<div class="rf-form-group">
|
|
192
|
+
<label class="rf-label">报名成功 <span style="color:var(--tx-t);font-weight:400">变量: {name}, {count}, {activity_name}</span></label>
|
|
193
|
+
<textarea id="rf-tpl-success" class="form-input" rows="3" style="width:100%;resize:vertical"></textarea>
|
|
194
|
+
</div>
|
|
195
|
+
<div class="rf-form-group">
|
|
196
|
+
<label class="rf-label">已报名提示 <span style="color:var(--tx-t);font-weight:400">变量: {name}</span></label>
|
|
197
|
+
<textarea id="rf-tpl-joined" class="form-input" rows="2" style="width:100%;resize:vertical"></textarea>
|
|
198
|
+
</div>
|
|
199
|
+
<div class="rf-form-group">
|
|
200
|
+
<label class="rf-label">待确认提示 <span style="color:var(--tx-t);font-weight:400">变量: {name}</span></label>
|
|
201
|
+
<textarea id="rf-tpl-pending" class="form-input" rows="2" style="width:100%;resize:vertical"></textarea>
|
|
202
|
+
</div>
|
|
203
|
+
</div>
|
|
204
|
+
<div>
|
|
205
|
+
<div class="rf-form-group">
|
|
206
|
+
<label class="rf-label">引导提示</label>
|
|
207
|
+
<textarea id="rf-tpl-hint" class="form-input" rows="2" style="width:100%;resize:vertical"></textarea>
|
|
208
|
+
</div>
|
|
209
|
+
<div class="rf-form-group">
|
|
210
|
+
<label class="rf-label">无活动提示</label>
|
|
211
|
+
<textarea id="rf-tpl-noactivity" class="form-input" rows="1" style="width:100%;resize:vertical"></textarea>
|
|
212
|
+
</div>
|
|
213
|
+
<div class="rf-form-group">
|
|
214
|
+
<label class="rf-label">被黑名单拦截</label>
|
|
215
|
+
<textarea id="rf-tpl-blacklisted" class="form-input" rows="1" style="width:100%;resize:vertical"></textarea>
|
|
216
|
+
</div>
|
|
217
|
+
<div class="rf-form-group">
|
|
218
|
+
<label class="rf-label">非白名单拦截</label>
|
|
219
|
+
<textarea id="rf-tpl-notwhitelist" class="form-input" rows="1" style="width:100%;resize:vertical"></textarea>
|
|
220
|
+
</div>
|
|
221
|
+
</div>
|
|
222
|
+
</div>
|
|
223
|
+
<div style="margin-top:16px">
|
|
224
|
+
<div class="rf-form-group">
|
|
225
|
+
<label class="rf-label">活动通知模板 <span style="color:var(--tx-t);font-weight:400">变量: {activity_name}, {description}, {draw_count}, {keywords}</span></label>
|
|
226
|
+
<textarea id="rf-tpl-notify" class="form-input" rows="4" style="width:100%;resize:vertical"></textarea>
|
|
227
|
+
</div>
|
|
228
|
+
<div class="rf-form-group">
|
|
229
|
+
<label class="rf-label">开奖广播模板 <span style="color:var(--tx-t);font-weight:400">变量: {activity_name}, {winner_names}, {winner_count}, {total_participants}</span></label>
|
|
230
|
+
<textarea id="rf-tpl-broadcast" class="form-input" rows="3" style="width:100%;resize:vertical"></textarea>
|
|
231
|
+
</div>
|
|
232
|
+
</div>
|
|
233
|
+
<div style="margin-top:12px">
|
|
234
|
+
<button class="btn btn-primary" onclick="rfSaveTemplates()">保存模板</button>
|
|
235
|
+
</div>
|
|
236
|
+
</div>
|
|
237
|
+
</div>
|
|
238
|
+
|
|
239
|
+
<div id="rf-notify-modal" class="rf-modal" style="display:none">
|
|
240
|
+
<div class="rf-modal-overlay" onclick="rfHideNotify()"></div>
|
|
241
|
+
<div class="rf-modal-box">
|
|
242
|
+
<div class="rf-modal-header">
|
|
243
|
+
<span>发送活动通知</span>
|
|
244
|
+
<button class="btn btn-icon" onclick="rfHideNotify()" style="font-size:20px;padding:0 4px;line-height:1">×</button>
|
|
245
|
+
</div>
|
|
246
|
+
<div class="rf-modal-tabs">
|
|
247
|
+
<button class="rf-tab rf-tab-active" onclick="rfNotifyTab('send')" data-ntab="send">发送通知</button>
|
|
248
|
+
<button class="rf-tab" onclick="rfNotifyTab('history')" data-ntab="history">发送历史</button>
|
|
249
|
+
</div>
|
|
250
|
+
<div class="rf-modal-body">
|
|
251
|
+
<div id="rf-notify-send">
|
|
252
|
+
<div style="margin-bottom:12px">
|
|
253
|
+
<div style="font-size:14px;font-weight:600;margin-bottom:4px" id="rf-notify-act-name">--</div>
|
|
254
|
+
<div style="font-size:12px;color:var(--tx-t)" id="rf-notify-act-desc"></div>
|
|
255
|
+
</div>
|
|
256
|
+
<div class="rf-form-group">
|
|
257
|
+
<label class="rf-label">发送目标</label>
|
|
258
|
+
<div style="display:flex;gap:6px;margin-bottom:8px;flex-wrap:wrap">
|
|
259
|
+
<select id="rf-nf-platform" class="form-select" style="width:120px;font-size:13px;padding:4px 8px">
|
|
260
|
+
<option value="">平台</option>
|
|
261
|
+
</select>
|
|
262
|
+
<select id="rf-nf-type" class="form-select" style="width:100px;font-size:13px;padding:4px 8px">
|
|
263
|
+
<option value="user">私聊</option>
|
|
264
|
+
<option value="group" selected>群聊</option>
|
|
265
|
+
<option value="channel">频道</option>
|
|
266
|
+
<option value="guild">服务器</option>
|
|
267
|
+
<option value="thread">话题</option>
|
|
268
|
+
</select>
|
|
269
|
+
<input type="text" id="rf-nf-targetid" class="form-input" placeholder="目标 ID" style="flex:1;min-width:100px;font-size:13px;padding:4px 8px">
|
|
270
|
+
<input type="text" id="rf-nf-accountid" class="form-input" placeholder="机器人账号(可选)" style="width:130px;font-size:13px;padding:4px 8px">
|
|
271
|
+
<button class="btn btn-secondary btn-sm" onclick="rfAddNotifyTarget()">添加</button>
|
|
272
|
+
</div>
|
|
273
|
+
<div id="rf-notify-targets"></div>
|
|
274
|
+
</div>
|
|
275
|
+
<div class="rf-form-group">
|
|
276
|
+
<label class="rf-label">自定义备注 <span style="color:var(--tx-t);font-weight:400">追加到通知末尾</span></label>
|
|
277
|
+
<textarea id="rf-nf-custom" class="form-input" rows="2" style="width:100%;resize:vertical;font-size:13px" oninput="rfPreviewNotify()" placeholder="可选,会追加到模板内容下方"></textarea>
|
|
278
|
+
</div>
|
|
279
|
+
<div class="rf-form-group">
|
|
280
|
+
<label class="rf-label">消息预览</label>
|
|
281
|
+
<div id="rf-notify-preview" class="rf-notify-preview">加载中...</div>
|
|
282
|
+
</div>
|
|
283
|
+
</div>
|
|
284
|
+
<div id="rf-notify-history" style="display:none">
|
|
285
|
+
<div id="rf-history-list">
|
|
286
|
+
<div style="text-align:center;padding:24px;color:var(--tx-t)">暂无发送记录</div>
|
|
287
|
+
</div>
|
|
288
|
+
</div>
|
|
289
|
+
</div>
|
|
290
|
+
<div class="rf-modal-footer">
|
|
291
|
+
<button class="btn btn-secondary" onclick="rfHideNotify()">取消</button>
|
|
292
|
+
<button class="btn btn-primary rf-notify-send-btn" onclick="rfSendNotify()" id="rf-notify-send-btn">发送</button>
|
|
293
|
+
</div>
|
|
294
|
+
</div>
|
|
295
|
+
</div>
|