2baf29b3ae
Deliver encrypted health zone, observation API, baseline maturity pipeline, page-data bindings, and H5/WeChat channel integration for health P0. Co-authored-by: Cursor <cursoragent@cursor.com>
48 lines
2.0 KiB
HTML
48 lines
2.0 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
<meta name="robots" content="noindex,nofollow" />
|
|
<title>健康 Timeline 摘要</title>
|
|
<style>
|
|
body { font-family: system-ui, sans-serif; max-width: 42rem; margin: 2rem auto; padding: 0 1rem; color: #1f2937; line-height: 1.6; }
|
|
h1 { font-size: 1.35rem; margin-bottom: 0.25rem; }
|
|
.hint { color: #6b7280; font-size: 0.92rem; margin-bottom: 1.25rem; }
|
|
.day { border-top: 1px solid #e5e7eb; padding: 0.75rem 0; }
|
|
.day-date { font-weight: 600; }
|
|
ul { margin: 0.35rem 0 0; padding-left: 1.1rem; }
|
|
.footer { margin-top: 2rem; font-size: 0.85rem; color: #9ca3af; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h1>本人健康 Timeline 摘要</h1>
|
|
<p class="hint">此页仅供口令/登录访问。数据来自你确认过的健康记录,不是医疗诊断。</p>
|
|
<div id="timeline">加载中…</div>
|
|
<p class="footer">MeMind Health · 加密健康档案区</p>
|
|
<script>
|
|
(async function () {
|
|
const root = document.getElementById('timeline');
|
|
try {
|
|
const res = await fetch('/api/health/timeline?days=14', { credentials: 'include' });
|
|
if (!res.ok) throw new Error('无法读取 Timeline');
|
|
const data = await res.json();
|
|
const days = Array.isArray(data.timeline) ? data.timeline : [];
|
|
if (!days.length) {
|
|
root.textContent = '还没有确认过的健康记录。请先在健康助手通道录入。';
|
|
return;
|
|
}
|
|
root.innerHTML = days.map(function (day) {
|
|
const metrics = Object.values(day.metrics || {}).map(function (m) {
|
|
return '<li>' + m.label + ': ' + m.value + '</li>';
|
|
}).join('');
|
|
return '<section class="day"><div class="day-date">' + day.date + '</div><ul>' + metrics + '</ul></section>';
|
|
}).join('');
|
|
} catch (err) {
|
|
root.textContent = err instanceof Error ? err.message : '加载失败';
|
|
}
|
|
})();
|
|
</script>
|
|
</body>
|
|
</html>
|