diff --git a/src/vitals/web/app.py b/src/vitals/web/app.py index 7e136c5..2c08488 100644 --- a/src/vitals/web/app.py +++ b/src/vitals/web/app.py @@ -4179,15 +4179,24 @@ def get_exercise_page_html() -> str: .nav a:hover { color: #667eea; } + /* 移动端适配 */ @media (max-width: 768px) { - .nav { - flex-wrap: wrap; - gap: 10px; - } - .modal-content { - margin: 5% auto; - width: 95%; - } + .nav { display: none !important; } + body { padding-bottom: 80px; } + .container { padding: 12px; } + header { padding: 18px 14px; margin-bottom: 16px; } + header h1 { font-size: 1.4rem; } + .grid { grid-template-columns: 1fr 1fr; gap: 10px; } + .card { padding: 12px; } + .card .value { font-size: 1.4rem; } + .fab { bottom: 84px; right: 16px; width: 52px; height: 52px; } + .modal-content { margin: 5% auto; width: 95%; padding: 16px; } + /* 表格转卡片 */ + table, thead, tbody, th, td, tr { display: block; } + thead { display: none; } + tr { background: white; margin-bottom: 12px; padding: 12px; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); } + td { padding: 6px 0; border: none; display: flex; justify-content: space-between; } + td:before { content: attr(data-label); font-weight: 600; color: #666; } } @@ -4496,6 +4505,45 @@ def get_exercise_page_html() -> str: document.getElementById('addExerciseForm').addEventListener('submit', submitExerciseForm); loadExerciseStats(); loadExerciseList(); + + // 检查管理员状态 + const user = JSON.parse(localStorage.getItem('user') || '{}'); + if (user.is_admin) { + const adminLink = document.getElementById('admin-link'); + if (adminLink) adminLink.style.display = 'block'; + } + + + + + + + @@ -4754,16 +4802,31 @@ def get_meal_page_html() -> str: button:disabled { opacity: 0.7; cursor: not-allowed; } .nav a { transition: color 0.2s; } .nav a:hover { color: #f59e0b; } + /* 移动端适配 */ @media (max-width: 768px) { - .nav { - flex-wrap: wrap; - gap: 10px; - } - .calendar .day { - min-height: 60px; - padding: 8px; - } - .modal-content { margin: 5% auto; width: 95%; } + .nav { display: none !important; } + body { padding-bottom: 80px; } + .container { padding: 12px; } + header { padding: 18px 14px; margin-bottom: 16px; } + header h1 { font-size: 1.4rem; } + .grid { grid-template-columns: 1fr 1fr; gap: 10px; } + .card { padding: 12px; } + .card .value { font-size: 1.4rem; } + .fab { bottom: 84px; right: 16px; width: 52px; height: 52px; } + .modal-content { margin: 5% auto; width: 95%; padding: 16px; } + .calendar { grid-template-columns: repeat(7, 1fr); gap: 4px; } + .calendar .day { min-height: 50px; padding: 6px; font-size: 0.75rem; } + .photo-grid { grid-template-columns: repeat(2, 1fr); } + .photo-grid img { height: 100px; } + /* 表格转卡片 */ + table, thead, tbody, th, td, tr { display: block; } + thead { display: none; } + tr { background: white; margin-bottom: 12px; padding: 12px; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); } + td { padding: 6px 0; border: none; display: flex; justify-content: space-between; } + td:before { content: attr(data-label); font-weight: 600; color: #666; } + } + @media (max-width: 480px) { + .grid { grid-template-columns: 1fr; } } @@ -5230,6 +5293,45 @@ def get_meal_page_html() -> str: document.getElementById('addMealForm').addEventListener('submit', submitMealForm); loadMealStats(); + + // 检查管理员状态 + const user = JSON.parse(localStorage.getItem('user') || '{}'); + if (user.is_admin) { + const adminLink = document.getElementById('admin-link'); + if (adminLink) adminLink.style.display = 'block'; + } + + + + + + +