From a1a8466f6b0434bd22d8885f869570147416ae1c Mon Sep 17 00:00:00 2001 From: Codex Date: Tue, 16 Jun 2026 04:28:19 +0800 Subject: [PATCH] fix: show payment records on separate lines --- app/app/static/app.js | 10 ++++++++-- app/app/static/styles.css | 4 ++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/app/app/static/app.js b/app/app/static/app.js index 8ef6d9c..4f3c5ee 100644 --- a/app/app/static/app.js +++ b/app/app/static/app.js @@ -63,6 +63,10 @@ function metric(label, value) { return `
${escapeHtml(label)}${escapeHtml(value)}
`; } +function metricHtml(label, valueHtml) { + return `
${escapeHtml(label)}${valueHtml}
`; +} + function makeRecordKey(row, index) { return row.record_id || JSON.stringify([index, row.date, row.time, row.student, row.duration, row.teacher, row.subject]); } @@ -257,7 +261,9 @@ function statusClass(status) { function renderPayments(payments) { if (!payments.length) return "暂无缴费记录"; - return payments.map((item) => `${item.date}:${fmtHours(item.hours)} 小时`).join(","); + return payments + .map((item) => `${escapeHtml(item.date)}:${fmtHours(item.hours)} 小时`) + .join(""); } function renderInlineAccount(account) { @@ -272,7 +278,7 @@ function renderInlineAccount(account) {
${metric("剩余课时", fmtHours(account.remaining))} ${metric("缴费次数", account.payments_count)} - ${metric("缴费记录", renderPayments(account.payments))} + ${metricHtml("缴费记录", renderPayments(account.payments))} ${metric("备注", account.note || "无")}
`; } diff --git a/app/app/static/styles.css b/app/app/static/styles.css index 8f2ab82..13d0218 100644 --- a/app/app/static/styles.css +++ b/app/app/static/styles.css @@ -293,6 +293,10 @@ select:focus { line-height: 1.2; } +.payment-line { + display: block; +} + .inline-account { padding: 14px 16px; border-bottom: 1px solid var(--line);