Files
hms/apps/miniprogram/src/pages/index/index.scss
iven 8f353946e1 fix(mp): T40 UI 审计修复 — 28 项设计系统合规 + 安全加固 + 讨论记录
T40 UI 审计修复(60 页面全覆盖):
- 新增 $acc-d/$wrn-d 渐变中间色变量,修复首页轮播渐变硬编码
- 替换 8 处裸 white 为 $white 设计变量(5 个 SCSS 文件)
- 修复 7 处触摸目标 40/44px → 48px(健康/消息/咨询/预约/首页)
- 3 页面新增 Loading 状态(体征录入/个人中心/就诊人添加)
- statusTag 移除硬编码布局值,改用 SCSS mixin 控制
- 医生端 14 页面架构 Hook 层补充(useThrottledDidShow 替换 useEffect)
- 移除 action-inbox 未使用 import

安全 P0 修复:
- JWT 中间件加固:token 类型校验 + 过期预检 + 类型别名简化
- 速率限制增强:滑动窗口 + 暴力破解防护
- analytics handler 错误处理完善

文档:
- T40 审计报告(24 PASS / 36 PASS_WITH_ISSUES / 0 NEEDS_WORK)
- 5 份 DevTools/性能审计讨论记录
- wiki 症状导航 + 小程序章节更新
2026-05-14 23:12:54 +08:00

485 lines
7.9 KiB
SCSS

@import '../../styles/variables.scss';
@import '../../styles/mixins.scss';
/* ═══════════════════════════════════════
登录后首页
═══════════════════════════════════════ */
.home-page {
min-height: 100vh;
background: $bg;
padding: 20px 24px 100px;
padding-bottom: calc(100px + env(safe-area-inset-bottom));
}
/* ─── 问候区 ─── */
.greeting-section {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: 24px;
}
.greeting-left {
flex: 1;
}
.greeting-text {
@include serif-number;
font-size: var(--tk-font-h1);
font-weight: 700;
color: $tx;
display: block;
margin-bottom: 4px;
}
.greeting-date {
font-size: var(--tk-font-cap);
color: var(--tk-text-secondary);
}
.greeting-bell {
position: relative;
width: 48px;
height: 48px;
border-radius: $r-pill;
background: $pri-l;
@include flex-center;
flex-shrink: 0;
&:active {
opacity: 0.7;
}
}
.greeting-bell-icon {
font-size: var(--tk-font-body-sm);
color: $pri-d;
}
.greeting-bell-dot {
position: absolute;
top: 6px;
right: 6px;
width: 8px;
height: 8px;
border-radius: $r-xs;
background: $dan;
}
/* ─── 今日体征进度 ─── */
.checkin-card {
background: $card;
border-radius: $r;
box-shadow: $shadow-md;
padding: 20px;
margin-bottom: 16px;
display: flex;
align-items: center;
gap: 16px;
&:active {
opacity: 0.9;
}
}
.checkin-left {
flex-shrink: 0;
position: relative;
}
.checkin-right {
flex: 1;
min-width: 0;
}
.checkin-title {
font-size: var(--tk-font-body-sm);
font-weight: 600;
color: $tx;
display: block;
margin-bottom: 8px;
}
.checkin-capsules {
display: flex;
flex-wrap: wrap;
gap: 6px;
}
.capsule {
font-size: var(--tk-font-micro);
padding: 3px 8px;
border-radius: $r-pill;
font-weight: 500;
&.capsule-done {
background: $acc-l;
color: $acc;
}
&.capsule-pending {
background: $surface-alt;
color: $tx3;
}
}
/* ─── 今日体征 2x2 ─── */
.vitals-section {
margin-bottom: 16px;
}
.section-title {
@include section-title;
}
.vitals-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px;
}
.vital-card {
background: $card;
border-radius: $r;
padding: 14px 16px;
box-shadow: $shadow-sm;
&:active {
opacity: 0.7;
}
}
.vital-label {
font-size: var(--tk-font-cap);
color: $tx2;
display: block;
margin-bottom: 6px;
}
.vital-value-row {
display: flex;
align-items: baseline;
margin-bottom: 6px;
}
.vital-value {
@include serif-number;
font-size: var(--tk-font-num);
font-weight: 700;
color: $tx;
line-height: 1;
}
.vital-unit {
font-size: var(--tk-font-micro);
color: var(--tk-text-secondary);
margin-left: 3px;
}
.vital-bottom {
display: flex;
align-items: center;
}
.vital-tag {
font-size: var(--tk-font-micro);
font-weight: 500;
padding: 2px 8px;
border-radius: $r-pill;
display: inline-block;
margin-top: 4px;
&.tag-ok {
background: $acc-l;
color: $acc;
}
&.tag-warn {
background: $wrn-l;
color: $wrn;
}
&.tag-empty {
background: $surface-alt;
color: $tx3;
}
}
/* ─── 智能提醒卡片 ─── */
.reminder-card {
background: linear-gradient(135deg, $pri 0%, $pri-d 100%);
border-radius: $r;
padding: 18px;
margin-bottom: 16px;
color: $white;
}
.reminder-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
}
.reminder-title {
font-size: var(--tk-font-cap);
font-weight: 600;
color: $white;
}
.reminder-count {
font-size: var(--tk-font-micro);
opacity: 0.7;
color: $white;
}
.reminder-item {
display: flex;
align-items: center;
gap: 8px;
padding: 8px 0;
&:active {
opacity: 0.8;
}
}
.reminder-item-border {
border-top: 1px solid rgba(255, 255, 255, 0.15);
}
.reminder-tag {
font-size: var(--tk-font-micro);
padding: 2px 6px;
border-radius: $r-xs;
background: rgba(255, 255, 255, 0.2);
font-weight: 500;
color: $white;
flex-shrink: 0;
}
.reminder-text {
font-size: var(--tk-font-cap);
flex: 1;
color: $white;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.reminder-arrow {
opacity: 0.5;
color: $white;
flex-shrink: 0;
}
/* ─── 快捷操作 ─── */
.action-section {
display: flex;
gap: 10px;
margin-top: 8px;
}
.action-btn {
flex: 1;
height: 52px;
border-radius: $r-sm;
@include flex-center;
&:active {
opacity: 0.85;
}
}
.action-primary {
background: $pri;
color: $white;
box-shadow: 0 2px 8px rgba(196, 98, 58, 0.25);
}
.action-outline {
background: transparent;
color: $pri;
border: 2px solid $pri;
}
.action-btn-text {
font-size: var(--tk-font-body-sm);
font-weight: 600;
}
/* ═══════════════════════════════════════
访客首页
═══════════════════════════════════════ */
.guest-page {
min-height: 100vh;
background: $bg;
padding-bottom: calc(120px + env(safe-area-inset-bottom));
}
/* ─── 轮播图 ─── */
.guest-swiper {
width: 100%;
height: 360px;
}
.guest-slide {
width: 100%;
height: 100%;
position: relative;
overflow: hidden;
}
.guest-slide-bg {
position: absolute;
inset: 0;
&--1 {
background: linear-gradient(135deg, $pri-d 0%, $pri 60%, $pri-l 100%);
}
&--2 {
background: linear-gradient(135deg, $acc 0%, $acc-d 60%, $acc-l 100%);
}
&--3 {
background: linear-gradient(135deg, $wrn-d 0%, $wrn 60%, $wrn-l 100%);
}
}
.guest-slide-content {
position: relative;
z-index: 1;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
padding: 40px 32px;
}
.guest-slide-title {
font-family: 'Georgia', 'Times New Roman', serif;
font-size: var(--tk-font-h1);
font-weight: 700;
color: $white;
display: block;
margin-bottom: 8px;
}
.guest-slide-desc {
font-size: var(--tk-font-body-sm);
color: rgba(255, 255, 255, 0.85);
display: block;
}
/* ─── 健康资讯 ─── */
.guest-section {
padding: 24px 24px 0;
}
.guest-section-title {
font-family: 'Georgia', 'Times New Roman', serif;
font-size: var(--tk-font-body);
font-weight: bold;
color: $tx;
display: block;
margin-bottom: 16px;
}
.guest-articles {
display: flex;
flex-direction: column;
gap: 12px;
}
.guest-article-card {
background: $card;
border-radius: $r;
overflow: hidden;
box-shadow: $shadow-sm;
display: flex;
&:active {
opacity: 0.85;
}
}
.guest-article-cover {
width: 100px;
height: 80px;
flex-shrink: 0;
}
.guest-article-body {
padding: 12px 14px;
flex: 1;
min-width: 0;
}
.guest-article-title {
font-size: var(--tk-font-body-sm);
font-weight: 600;
color: $tx;
display: block;
margin-bottom: 4px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.guest-article-summary {
font-size: var(--tk-font-cap);
color: var(--tk-text-secondary);
display: block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.guest-empty {
padding: 40px 0;
text-align: center;
}
.guest-empty-text {
font-size: var(--tk-font-cap);
color: var(--tk-text-secondary);
}
/* ─── 底部登录引导 ─── */
.guest-login-prompt {
margin: 24px 24px 0;
background: $card;
border-radius: $r;
padding: 20px;
box-shadow: $shadow-md;
display: flex;
align-items: center;
gap: 16px;
}
.guest-login-text {
flex: 1;
font-size: var(--tk-font-cap);
color: $tx2;
}
.guest-login-btn {
height: 56px;
padding: 0 28px;
background: $pri;
border-radius: $r-pill;
@include flex-center;
flex-shrink: 0;
&:active {
opacity: 0.85;
}
}
.guest-login-btn-text {
font-size: var(--tk-font-h2);
font-weight: 600;
color: $white;
}