feat(ticket): record urges in thread, show urge count in admin, mail admins

- aksrt_ticket gains urge_count / last_urge_time (schema 3.1.0)
- cooldown moves from transient to an atomic conditional UPDATE
- urge inserts a system reply rendered as a centered notice (not quotable)
- admin list badge + info card row for urge count / last time
- new ticket_urge_admin mail event via aksrt_ticket_urged

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
kate522andClaude Fable 5 committed 2026-10-27 22:17:40 +08:00
1 parent ac3ed9c956
commit 5febdb35c8
14 files changed
+198 -25

No files matched your search

+22
View File
@@ -156,6 +156,28 @@
.aksrt-ticket-detail__reply { margin: 0; }
.aksrt-ticket-detail__reply.is-admin { margin-left: 32px; background: #f0f6fc; border-color: #c5d9ed; }
.aksrt-ticket-detail__reply.is-user { margin-right: 32px; }
/* 系统记录(催单等):居中细条,与对话气泡区分。 */
.aksrt-ticket-detail__system {
display: flex;
justify-content: center;
gap: 8px;
margin: 0;
color: var(--aksrt-tk-muted);
font-size: 12px;
}
.aksrt-ticket-detail__system span { color: #b32d2e; }
/* 催单徽标:列表标题旁 + 详情信息卡。 */
.aksrt-ticket-urge {
display: inline-block;
padding: 0 6px;
color: #b32d2e;
font-size: 12px;
line-height: 18px;
background: #fcf0f1;
border: 1px solid #f0c3c5;
border-radius: 9px;
vertical-align: middle;
}
.aksrt-ticket-detail__quote {
margin: 0 0 8px;
padding: 6px 10px;
+13
View File
@@ -545,6 +545,19 @@
.aksrt-ticket-msg { display: flex; gap: 10px; align-items: flex-start; }
.aksrt-ticket-msg.is-user { flex-direction: row-reverse; }
/* 系统记录(如催单):居中灰色提示条。 */
.aksrt-ticket-msg.is-system { justify-content: center; }
.aksrt-ticket-msg__system {
display: inline-flex;
gap: 6px;
align-items: center;
padding: 3px 12px;
border-radius: 999px;
background: color-mix(in srgb, var(--tickets-ink) 6%, transparent);
color: var(--tickets-muted);
font-size: 12px;
}
.aksrt-ticket-msg__avatar {
display: inline-grid;
flex: 0 0 32px;
+7
View File
@@ -406,6 +406,11 @@
}
function messageHtml(msg, canQuote) {
if (msg.author_type === 'system') {
// 系统记录(如催单):居中提示,不可引用。
return '<li class="aksrt-ticket-msg is-system"><span class="aksrt-ticket-msg__system">'
+ icon('fa-bell') + escapeHtml(msg.content) + timeTag(msg.created_at) + '</span></li>';
}
var admin = msg.author_type === 'admin';
var name = msg.author_name || (admin ? '客服' : '我');
var avatar = admin ? icon('fa-headset') : escapeHtml(Array.from(name)[0] || '我');
@@ -550,6 +555,8 @@
sendUrge(ctx.ticket).then(function (result) {
ctx.urgeUntil = Date.now() + (parseInt(result.data && result.data.urge_wait, 10) || 0) * 1000;
notyf('已提醒客服优先处理,请耐心等待', 'success');
// 重新拉取详情,让时间线出现本次的「用户催单」系统记录。
return fetchDetail(shell, ctx.ticket.id, { scrollEnd: true });
}).catch(function (error) {
var wait = parseInt(error && error.data && error.data.urge_wait, 10) || 0;
if (wait) ctx.urgeUntil = Date.now() + wait * 1000;