v1.7版本更新

This commit is contained in:
2026-05-21 20:15:56 +08:00
parent 74a71ddaf5
commit cb0c367eb7
54 changed files with 2292 additions and 1785 deletions

View File

@@ -31,6 +31,7 @@ include __DIR__ . '/../includes/header.php';
<div class="child-info">
<div class="child-name" id="childName">--</div>
<div class="child-no" id="childNo">--</div>
<div class="child-no" id="childDormitory" style="display:none;"></div>
</div>
<div class="stats-grid">
<div class="stat-card">
@@ -41,6 +42,10 @@ include __DIR__ . '/../includes/header.php';
<div class="stat-label">班级排名</div>
<div class="stat-value" id="studentRank">--</div>
</div>
<div class="stat-card">
<div class="stat-label">缺交次数</div>
<div class="stat-value" id="homeworkMissing">--</div>
</div>
</div>
<div class="initial-points-hint" id="initialPointsHint"></div>
</div>
@@ -71,6 +76,10 @@ async function loadDashboard() {
document.getElementById('childName').textContent = res.data.student_name;
document.getElementById('childNo').textContent = res.data.student_no;
document.getElementById('totalPoints').textContent = res.data.total_points;
if (res.data.dormitory_number) {
document.getElementById('childDormitory').textContent = '宿舍号: ' + res.data.dormitory_number;
document.getElementById('childDormitory').style.display = '';
}
}
// 加载排名信息
@@ -83,6 +92,16 @@ async function loadDashboard() {
document.getElementById('studentRank').textContent = '--';
}
}
// 加载作业缺交次数
const hwRes = await apiGet('/api/parent/child/homework');
if (hwRes && hwRes.success && hwRes.data.homework) {
const homework = hwRes.data.homework;
const total = homework.length;
const notSubmitted = homework.filter(h => h.status === 'not_submitted' || h.status === 'late').length;
document.getElementById('homeworkMissing').textContent = `缺交 ${notSubmitted}/${total} 次`;
}
// 显示初始分提示
const initialPoints = window.STUDENT_INITIAL_POINTS || 60;
document.getElementById('initialPointsHint').textContent = `初始操行分为 ${initialPoints} 分`;

View File

@@ -84,7 +84,7 @@ async function loadHistory(page) {
html += `<tr>
<td>${formatDateTime(record.created_at)}</td>
<td>${escapeHtml(record.related_type || '手动')}</td>
<td>${escapeHtml(record.reason || '-')}</td>
<td class="preserve-newlines">${escapeHtml(record.reason || '-')}</td>
<td><span class="record-points ${pointsClass}">${pointsText}</span></td>
<td>${escapeHtml(record.recorder_name || '-')}</td>
</tr>`;