fix(miniprogram): 对齐设计原型 — 移除渐变头部+体征数值内联+卡片布局
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled

- 首页:移除渐变头部改为平铺背景,铃铛图标替代消息按钮
- 首页:体征数值与单位内联显示(同一行 baseline 对齐)
- 健康页:标题改为"健康数据",整体样式贴近原型紧凑风格
- 我的页:移除渐变头部改为平铺卡片,积分/打卡分两个独立卡片
- 我的页:菜单使用 emoji 图标替代文字图标,间距更紧凑
This commit is contained in:
iven
2026-04-30 23:04:36 +08:00
parent 50772878da
commit 63d8b7a65d
6 changed files with 280 additions and 272 deletions

View File

@@ -4,32 +4,32 @@
.health-page { .health-page {
min-height: 100vh; min-height: 100vh;
background: $bg; background: $bg;
padding-bottom: calc(120px + env(safe-area-inset-bottom)); padding: 20px 16px 100px;
padding-bottom: calc(100px + env(safe-area-inset-bottom));
} }
/* ─── 页头 ─── */ /* ─── 页头 ─── */
.health-header { .health-header {
padding: 24px 32px 8px; margin-bottom: 16px;
} }
.health-title { .health-title {
font-family: 'Georgia', 'Times New Roman', serif; font-size: 22px;
font-size: 36px; font-weight: 700;
font-weight: bold;
color: $tx; color: $tx;
} }
/* ─── 类型 Tab ─── */ /* ─── 类型 Tab ─── */
.vital-tabs { .vital-tabs {
display: flex; display: flex;
padding: 12px 24px; padding: 0 0 16px;
gap: 12px; gap: 8px;
} }
.vital-tab { .vital-tab {
flex: 1; flex: 1;
height: $tab-h; height: 40px;
border-radius: $r; border-radius: 12px;
background: $surface-alt; background: $surface-alt;
@include flex-center; @include flex-center;
position: relative; position: relative;
@@ -48,73 +48,74 @@
} }
.vital-tab-text { .vital-tab-text {
font-size: 26px; font-size: 15px;
font-weight: 600; font-weight: 600;
color: $tx2; color: $tx2;
} }
.vital-tab-dot { .vital-tab-dot {
position: absolute; position: absolute;
top: 10px; top: 8px;
right: 10px; right: 8px;
width: 8px; width: 6px;
height: 8px; height: 6px;
border-radius: 50%; border-radius: 50%;
background: $wrn; background: $wrn;
} }
/* ─── 录入区 ─── */ /* ─── 录入区 ─── */
.input-section { .input-section {
margin: 0 24px 24px; margin-bottom: 12px;
background: $card; background: $card;
border-radius: $r; border-radius: $r;
padding: 24px; padding: 16px;
box-shadow: $shadow-sm; box-shadow: $shadow-sm;
} }
.input-group { .input-group {
margin-bottom: 20px; margin-bottom: 12px;
} }
.input-label { .input-label {
font-size: 26px; font-size: 13px;
color: $tx; color: $tx3;
font-weight: 600;
display: block; display: block;
margin-bottom: 12px; margin-bottom: 4px;
} }
.input-field { .input-field {
height: 56px; height: 56px;
background: $bg; background: $bg;
border: 2px solid $bd; border: 2px solid $bd;
border-radius: $r-sm; border-radius: 12px;
padding: 0 20px; padding: 0 16px;
font-family: 'Georgia', 'Times New Roman', serif; font-family: 'Georgia', 'Times New Roman', serif;
font-size: 28px; font-size: 28px;
font-weight: 600;
color: $tx; color: $tx;
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
} }
.input-ref { .input-ref {
font-size: 22px; font-size: 13px;
color: $tx2; color: $tx3;
display: block; display: block;
margin-top: 12px; margin-top: 8px;
margin-bottom: 4px;
} }
/* ─── 血糖时段选择 ─── */ /* ─── 血糖时段选择 ─── */
.period-group { .period-group {
display: flex; display: flex;
gap: 12px; gap: 8px;
margin-top: 16px; margin-top: 12px;
} }
.period-btn { .period-btn {
flex: 1; flex: 1;
height: $btn-primary-h; height: 48px;
border-radius: $r-sm; border-radius: 12px;
background: $surface-alt; background: $surface-alt;
@include flex-center; @include flex-center;
@@ -132,53 +133,68 @@
} }
.period-btn-text { .period-btn-text {
font-size: 26px; font-size: 15px;
font-weight: 600; font-weight: 600;
color: $tx2; color: $tx2;
} }
/* ─── 保存按钮 ─── */ /* ─── 保存按钮 ─── */
.save-btn { .save-btn {
@include btn-primary; width: 100%;
margin-top: 24px; height: 52px;
border-radius: $r; border-radius: 14px;
background: $pri;
@include flex-center;
margin-top: 12px;
&:active {
opacity: 0.85;
}
} }
.save-btn-text { .save-btn-text {
font-size: 28px; font-size: 17px;
font-weight: 600; font-weight: 600;
color: #fff; color: #fff;
} }
/* ─── 趋势图 ─── */ /* ─── 趋势图 ─── */
.trend-section { .trend-section {
margin: 0 24px 24px; margin-bottom: 12px;
}
.section-title {
@include section-title;
} }
.trend-empty { .trend-empty {
background: $card; background: $card;
border-radius: $r; border-radius: $r;
padding: 36px; padding: 24px;
text-align: center; text-align: center;
box-shadow: $shadow-sm;
} }
.trend-empty-text { .trend-empty-text {
font-size: 24px; font-size: 14px;
color: $tx2; color: $tx2;
} }
.trend-chart { .trend-chart {
background: $card; background: $card;
border-radius: $r; border-radius: $r;
padding: 24px; padding: 16px;
box-shadow: $shadow-sm; box-shadow: $shadow-sm;
} }
.trend-bars { .trend-bars {
display: flex; display: flex;
align-items: flex-end; align-items: flex-end;
height: 200px; height: 120px;
gap: 8px; background: $bg;
border-radius: 12px;
padding: 12px 8px;
gap: 0;
} }
.trend-bar-col { .trend-bar-col {
@@ -191,10 +207,10 @@
} }
.trend-bar { .trend-bar {
width: 100%; width: 28px;
max-width: 40px;
border-radius: 6px 6px 0 0; border-radius: 6px 6px 0 0;
min-height: 16px; min-height: 8px;
opacity: 0.8;
&.trend-bar-normal { &.trend-bar-normal {
background: $pri; background: $pri;
@@ -206,22 +222,23 @@
} }
.trend-bar-label { .trend-bar-label {
font-size: 22px; font-size: 11px;
color: $tx2; color: $tx3;
margin-top: 8px; margin-top: 6px;
} }
/* ─── BLE 设备卡片 ─── */ /* ─── BLE 设备卡片 ─── */
.device-section { .device-section {
margin: 0 24px 16px; margin-bottom: 12px;
} }
.device-card { .device-card {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 12px;
background: $card; background: $card;
border-radius: $r; border-radius: $r;
padding: 24px; padding: 16px;
box-shadow: $shadow-sm; box-shadow: $shadow-sm;
&:active { &:active {
@@ -230,19 +247,16 @@
} }
.device-icon { .device-icon {
width: 56px; width: 44px;
height: 56px; height: 44px;
border-radius: $r-sm; border-radius: 12px;
background: $pri-l; background: $pri-l;
@include flex-center; @include flex-center;
margin-right: 16px;
flex-shrink: 0; flex-shrink: 0;
} }
.device-icon-text { .device-icon-text {
font-size: 26px; font-size: 22px;
font-weight: bold;
color: $pri;
} }
.device-info { .device-info {
@@ -251,31 +265,29 @@
} }
.device-name { .device-name {
font-size: 28px; font-size: 15px;
font-weight: 600; font-weight: 500;
color: $tx; color: $tx;
display: block; display: block;
margin-bottom: 4px;
} }
.device-desc { .device-desc {
font-size: 22px; font-size: 13px;
color: $tx2; color: $acc;
display: block; display: block;
} }
.device-arrow { .device-arrow {
font-size: 32px; font-size: 14px;
color: $tx3; color: $tx3;
flex-shrink: 0; flex-shrink: 0;
} }
/* ─── 健康资讯入口 ─── */ /* ─── 健康资讯入口 ─── */
.article-entry { .article-entry {
margin: 0 24px 24px;
background: $card; background: $card;
border-radius: $r; border-radius: $r;
padding: 24px; padding: 16px;
box-shadow: $shadow-sm; box-shadow: $shadow-sm;
&:active { &:active {
@@ -284,7 +296,7 @@
} }
.article-entry-text { .article-entry-text {
font-size: 26px; font-size: 15px;
color: $pri; color: $tx;
font-weight: 500; font-weight: 500;
} }

View File

@@ -159,7 +159,7 @@ export default function Health() {
<View className='health-page'> <View className='health-page'>
{/* 页头 */} {/* 页头 */}
<View className='health-header'> <View className='health-header'>
<Text className='health-title'></Text> <Text className='health-title'></Text>
</View> </View>
{/* 类型 Tab */} {/* 类型 Tab */}

View File

@@ -4,17 +4,16 @@
.home-page { .home-page {
min-height: 100vh; min-height: 100vh;
background: $bg; background: $bg;
padding-bottom: calc(120px + env(safe-area-inset-bottom)); padding: 20px 16px 100px;
padding-bottom: calc(100px + env(safe-area-inset-bottom));
} }
/* ─── 区域 1问候 + 日期 + 消息 ─── */ /* ─── 区域 1问候 + 日期 + 铃铛 ─── */
.greeting-section { .greeting-section {
background: linear-gradient(135deg, $pri 0%, $pri-d 100%);
padding: 48px 32px 60px;
color: #fff;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: flex-start;
margin-bottom: 16px;
} }
.greeting-left { .greeting-left {
@@ -22,45 +21,44 @@
} }
.greeting-text { .greeting-text {
font-size: 28px; font-size: 24px;
font-weight: bold; font-weight: 700;
color: $tx;
display: block; display: block;
margin-bottom: 6px; margin-bottom: 4px;
} }
.greeting-date { .greeting-date {
font-size: 22px; font-size: 14px;
opacity: 0.75; color: $tx3;
} }
.greeting-msg { .greeting-bell {
width: 56px; position: relative;
height: 56px; width: 40px;
border-radius: 50%; height: 40px;
background: rgba(255, 255, 255, 0.2);
@include flex-center; @include flex-center;
flex-shrink: 0;
&:active { &:active {
background: rgba(255, 255, 255, 0.1); opacity: 0.7;
} }
} }
.greeting-msg-icon { .greeting-bell-icon {
font-size: 22px; font-size: 22px;
color: #fff;
font-weight: 600;
} }
/* ─── 区域 2今日体征完成度 ─── */ /* ─── 区域 2今日体征完成度 ─── */
.checkin-card { .checkin-card {
background: $card; background: $card;
border-radius: $r; border-radius: $r;
box-shadow: $shadow-md; box-shadow: $shadow-sm;
margin: -28px 24px 24px; padding: 16px;
padding: 24px; margin-bottom: 12px;
display: flex; display: flex;
align-items: center; align-items: center;
gap: 24px; gap: 16px;
&:active { &:active {
opacity: 0.9; opacity: 0.9;
@@ -69,6 +67,7 @@
.checkin-left { .checkin-left {
flex-shrink: 0; flex-shrink: 0;
position: relative;
} }
.checkin-right { .checkin-right {
@@ -77,22 +76,22 @@
} }
.checkin-title { .checkin-title {
font-size: 26px; font-size: 16px;
font-weight: 600; font-weight: 600;
color: $tx; color: $tx;
display: block; display: block;
margin-bottom: 12px; margin-bottom: 8px;
} }
.checkin-capsules { .checkin-capsules {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 8px; gap: 6px;
} }
.capsule { .capsule {
font-size: 22px; font-size: 11px;
padding: 4px 12px; padding: 3px 8px;
border-radius: $r-pill; border-radius: $r-pill;
font-weight: 500; font-weight: 500;
@@ -103,27 +102,30 @@
&.capsule-pending { &.capsule-pending {
background: $surface-alt; background: $surface-alt;
color: $tx2; color: $tx3;
} }
} }
/* ─── 区域 3今日体征 2x2 ─── */ /* ─── 区域 3今日体征 2x2 ─── */
.vitals-section { .vitals-section {
margin: 0 24px 24px; margin-bottom: 12px;
}
.section-title {
@include section-title;
} }
.vitals-grid { .vitals-grid {
display: grid; display: grid;
grid-template-columns: 1fr 1fr; grid-template-columns: 1fr 1fr;
gap: 16px; gap: 10px;
} }
.vital-card { .vital-card {
background: $card; background: $card;
border-radius: $r; border-radius: $r;
padding: 20px; padding: 14px 16px;
box-shadow: $shadow-sm; box-shadow: $shadow-sm;
text-align: center;
&:active { &:active {
opacity: 0.7; opacity: 0.7;
@@ -131,40 +133,45 @@
} }
.vital-label { .vital-label {
font-size: 24px; font-size: 13px;
color: $tx2; color: $tx2;
display: block; display: block;
margin-bottom: 8px; margin-bottom: 4px;
}
.vital-value-row {
display: flex;
align-items: baseline;
margin-bottom: 4px;
} }
.vital-value { .vital-value {
@include serif-number; @include serif-number;
font-size: 48px; font-size: 32px;
font-weight: bold; font-weight: 700;
color: $tx; color: $tx;
display: block;
line-height: 1.1; line-height: 1.1;
margin-bottom: 8px; }
.vital-unit {
font-size: 12px;
color: $tx3;
margin-left: 2px;
} }
.vital-bottom { .vital-bottom {
display: flex; display: flex;
justify-content: center;
align-items: center; align-items: center;
gap: 8px; gap: 0;
}
.vital-unit {
font-size: 22px;
color: $tx2;
} }
.vital-tag { .vital-tag {
font-size: 22px; font-size: 12px;
font-weight: 500; font-weight: 500;
padding: 2px 10px; padding: 2px 8px;
border-radius: $r-sm; border-radius: $r-pill;
display: inline-block; display: inline-block;
margin-top: 4px;
&.tag-ok { &.tag-ok {
background: $acc-l; background: $acc-l;
@@ -178,25 +185,25 @@
&.tag-empty { &.tag-empty {
background: $surface-alt; background: $surface-alt;
color: $tx2; color: $tx3;
} }
} }
/* ─── 区域 4今日待办 ─── */ /* ─── 区域 4今日待办 ─── */
.todo-section { .todo-section {
margin: 0 24px 24px; margin-bottom: 12px;
} }
.todo-empty { .todo-empty {
background: $card; background: $card;
border-radius: $r; border-radius: $r;
padding: 36px 24px; padding: 24px;
text-align: center; text-align: center;
box-shadow: $shadow-sm; box-shadow: $shadow-sm;
} }
.todo-empty-text { .todo-empty-text {
font-size: 24px; font-size: 14px;
color: $tx2; color: $tx2;
} }
@@ -210,8 +217,9 @@
.todo-item { .todo-item {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 24px; gap: 10px;
border-bottom: 1px solid $bd-l; padding: 12px 16px;
border-bottom: 1px solid $bd;
&:last-child { &:last-child {
border-bottom: none; border-bottom: none;
@@ -223,17 +231,16 @@
} }
.todo-icon-wrap { .todo-icon-wrap {
width: 48px; width: 36px;
height: 48px; height: 36px;
border-radius: $r-sm; border-radius: 10px;
background: $pri-l; background: $pri-l;
@include flex-center; @include flex-center;
margin-right: 16px;
flex-shrink: 0; flex-shrink: 0;
} }
.todo-icon-char { .todo-icon-char {
font-size: 24px; font-size: 18px;
font-weight: bold; font-weight: bold;
color: $pri; color: $pri;
} }
@@ -244,16 +251,16 @@
} }
.todo-title { .todo-title {
font-size: 28px; font-size: 15px;
color: $tx; color: $tx;
font-weight: 600; font-weight: 500;
display: block; display: block;
margin-bottom: 4px; margin-bottom: 2px;
} }
.todo-sub { .todo-sub {
font-size: 22px; font-size: 13px;
color: $tx2; color: $tx3;
display: block; display: block;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
@@ -261,7 +268,7 @@
} }
.todo-arrow { .todo-arrow {
font-size: 32px; font-size: 14px;
color: $tx3; color: $tx3;
flex-shrink: 0; flex-shrink: 0;
} }
@@ -269,17 +276,17 @@
/* ─── 区域 5快捷操作 ─── */ /* ─── 区域 5快捷操作 ─── */
.action-section { .action-section {
display: flex; display: flex;
gap: 16px; gap: 10px;
margin: 0 24px 24px; margin-top: 16px;
} }
.action-btn { .action-btn {
flex: 1; flex: 1;
@include touch-target; height: 52px;
height: $btn-primary-h; border-radius: 14px;
border-radius: $r; font-size: 17px;
font-size: 28px;
font-weight: 600; font-weight: 600;
@include flex-center;
&:active { &:active {
opacity: 0.85; opacity: 0.85;
@@ -298,6 +305,6 @@
} }
.action-btn-text { .action-btn-text {
font-size: 28px; font-size: 17px;
font-weight: 600; font-weight: 600;
} }

View File

@@ -118,10 +118,10 @@ export default function Index() {
</Text> </Text>
</View> </View>
<View <View
className='greeting-msg' className='greeting-bell'
onClick={() => Taro.switchTab({ url: '/pages/messages/index' })} onClick={() => Taro.switchTab({ url: '/pages/messages/index' })}
> >
<Text className='greeting-msg-icon'></Text> <Text className='greeting-bell-icon'>🔔</Text>
</View> </View>
</View> </View>
@@ -165,9 +165,11 @@ export default function Index() {
onClick={() => Taro.navigateTo({ url: `/pages/pkg-health/trend/index?indicator=${item.indicator}` })} onClick={() => Taro.navigateTo({ url: `/pages/pkg-health/trend/index?indicator=${item.indicator}` })}
> >
<Text className='vital-label'>{item.label}</Text> <Text className='vital-label'>{item.label}</Text>
<Text className='vital-value'>{item.value}</Text> <View className='vital-value-row'>
<View className='vital-bottom'> <Text className='vital-value'>{item.value}</Text>
<Text className='vital-unit'>{item.unit}</Text> <Text className='vital-unit'>{item.unit}</Text>
</View>
<View className='vital-bottom'>
{tag && <Text className={`vital-tag ${tag.cls}`}>{tag.label}</Text>} {tag && <Text className={`vital-tag ${tag.cls}`}>{tag.label}</Text>}
{!item.status && <Text className='vital-tag tag-empty'></Text>} {!item.status && <Text className='vital-tag tag-empty'></Text>}
</View> </View>

View File

@@ -4,103 +4,92 @@
.profile-page { .profile-page {
min-height: 100vh; min-height: 100vh;
background: $bg; background: $bg;
padding-bottom: calc(120px + env(safe-area-inset-bottom)); padding: 20px 16px 100px;
padding-bottom: calc(100px + env(safe-area-inset-bottom));
} }
/* ─── 用户信息 ─── */ /* ─── 用户信息卡片 ─── */
.profile-header { .profile-user-card {
background: linear-gradient(135deg, $pri 0%, $pri-d 100%); background: $card;
padding: 60px 32px 40px; border-radius: $r;
padding: 16px;
display: flex; display: flex;
flex-direction: column;
align-items: center; align-items: center;
gap: 14px;
box-shadow: $shadow-sm;
margin-bottom: 10px;
} }
.profile-avatar { .profile-avatar {
width: 120px; width: 60px;
height: 120px; height: 60px;
border-radius: 50%; border-radius: 30px;
background: rgba(255, 255, 255, 0.25); background: $pri-l;
@include flex-center; @include flex-center;
margin-bottom: 16px; flex-shrink: 0;
} }
.profile-avatar-text { .profile-avatar-icon {
font-family: 'Georgia', 'Times New Roman', serif; font-size: 28px;
font-size: 48px; }
color: #fff;
font-weight: bold; .profile-user-info {
line-height: 1; flex: 1;
min-width: 0;
} }
.profile-name { .profile-name {
font-family: 'Georgia', 'Times New Roman', serif; font-size: 20px;
font-size: 34px; font-weight: 700;
color: #fff; color: $tx;
font-weight: bold; display: block;
margin-bottom: 4px; margin-bottom: 2px;
} }
.profile-phone { .profile-phone {
font-size: 26px; font-size: 14px;
color: rgba(255, 255, 255, 0.75); color: $tx3;
} }
/* ─── 积分 + 打卡排 ─── */ /* ─── 积分 + 打卡排 ─── */
.profile-stats { .profile-stats-row {
display: flex; display: flex;
align-items: center; gap: 10px;
margin-top: 28px; margin-bottom: 12px;
background: rgba(255, 255, 255, 0.12);
border: 1px solid rgba(255, 255, 255, 0.18);
border-radius: $r;
padding: 20px 32px;
width: 100%;
box-sizing: border-box;
&:active {
background: rgba(255, 255, 255, 0.08);
}
} }
.stat-card { .stat-card {
flex: 1; flex: 1;
display: flex; background: $card;
flex-direction: column; border-radius: $r;
align-items: center; padding: 16px;
text-align: center;
box-shadow: $shadow-sm;
} }
.stat-value { .stat-value {
@include serif-number; @include serif-number;
font-size: 28px; font-size: 24px;
font-weight: bold; font-weight: 700;
color: #fff; display: block;
margin-bottom: 4px; margin-bottom: 4px;
}
.stat-value-pri { &.stat-pri {
color: #FFD6C7; color: $pri;
} }
.stat-value-acc { &.stat-acc {
color: #C8E6C9; color: $acc;
}
} }
.stat-label { .stat-label {
font-size: 22px; font-size: 13px;
color: rgba(255, 255, 255, 0.7); color: $tx3;
}
.stat-divider {
width: 1px;
height: 48px;
background: rgba(255, 255, 255, 0.2);
margin: 0 24px;
} }
/* ─── 菜单 ─── */ /* ─── 菜单 ─── */
.profile-menu { .profile-menu {
margin: 24px;
background: $card; background: $card;
border-radius: $r; border-radius: $r;
overflow: hidden; overflow: hidden;
@@ -110,10 +99,9 @@
.menu-item { .menu-item {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 28px 24px; gap: 14px;
min-height: $menu-item-h; padding: 18px 16px;
box-sizing: border-box; border-bottom: 1px solid $bd;
border-bottom: 1px solid $bd-l;
&:last-child { &:last-child {
border-bottom: none; border-bottom: none;
@@ -125,50 +113,36 @@
} }
.menu-icon { .menu-icon {
width: 48px; width: 40px;
height: 48px; height: 40px;
border-radius: $r-sm; border-radius: 12px;
background: $pri-l;
@include flex-center; @include flex-center;
margin-right: 20px;
flex-shrink: 0; flex-shrink: 0;
} }
.menu-icon-char { .menu-icon-text {
font-family: 'Georgia', 'Times New Roman', serif; font-size: 20px;
font-size: 24px;
font-weight: bold;
color: $pri;
line-height: 1;
} }
.menu-label { .menu-label {
flex: 1; flex: 1;
font-size: 28px; font-size: 16px;
color: $tx; color: $tx;
} }
.menu-arrow { .menu-arrow {
font-size: 32px; font-size: 14px;
color: $tx3; color: $tx3;
flex-shrink: 0; flex-shrink: 0;
} }
/* ─── 退出登录 ─── */ /* ─── 退出登录 ─── */
.profile-logout { .profile-logout {
margin: 24px; margin-top: 24px;
background: $card;
border-radius: $r;
padding: 28px;
text-align: center; text-align: center;
box-shadow: $shadow-sm;
&:active {
opacity: 0.7;
}
} }
.logout-text { .logout-text {
font-size: 28px; font-size: 14px;
color: $dan; color: $tx3;
} }

View File

@@ -6,21 +6,37 @@ import { usePointsStore } from '../../stores/points';
import './index.scss'; import './index.scss';
const MENU_ITEMS = [ const MENU_ITEMS = [
{ label: '积分商城', char: '', path: '/pages/mall/index' }, { label: '积分商城', icon: '🎁', bg: '#FDEAEA' },
{ label: '我的订单', char: '', path: '/pages/pkg-mall/orders/index' }, { label: '我的订单', icon: '📦', bg: '#E8F0F8' },
{ label: '积分明细', char: '', path: '/pages/pkg-mall/detail/index' }, { label: '就诊人管理', icon: '👨‍👩‍👧', bg: '#F0DDD4' },
{ label: '就诊人管理', char: '', path: '/pages/pkg-profile/family/index' }, { label: '我的报告', icon: '📄', bg: '#E8F0E8' },
{ label: '我的报告', char: '', path: '/pages/pkg-profile/reports/index' }, { label: '健康记录', icon: '📝', bg: '#E8F0F8' },
{ label: '健康记录', char: '', path: '/pages/pkg-profile/health-records/index' }, { label: '诊断记录', icon: '📋', bg: '#E8F0E8' },
{ label: '诊断记录', char: '', path: '/pages/pkg-profile/diagnoses/index' }, { label: '我的随访', icon: '🏥', bg: '#F3E8F8' },
{ label: '我的随访', char: '', path: '/pages/pkg-profile/followups/index' }, { label: '用药提醒', icon: '💊', bg: '#FFF3E0' },
{ label: '用药提醒', char: '', path: '/pages/pkg-profile/medication/index' }, { label: '透析记录', icon: '💉', bg: '#E8F0F8' },
{ label: '透析记录', char: '', path: '/pages/pkg-profile/dialysis-records/index' }, { label: '透析处方', icon: '💊', bg: '#E8F0E8' },
{ label: '透析处方', char: '', path: '/pages/pkg-profile/dialysis-prescriptions/index' }, { label: '知情同意', icon: '📋', bg: '#F3E8F8' },
{ label: '知情同意', char: '', path: '/pages/pkg-profile/consents/index' }, { label: '积分明细', icon: '📊', bg: '#F0DDD4' },
{ label: '设置', char: '', path: '/pages/pkg-profile/settings/index' }, { label: '设置', icon: '⚙️', bg: '#f0f0f0' },
]; ];
const MENU_PATHS: Record<string, string> = {
'积分商城': '/pages/mall/index',
'我的订单': '/pages/pkg-mall/orders/index',
'积分明细': '/pages/pkg-mall/detail/index',
'就诊人管理': '/pages/pkg-profile/family/index',
'我的报告': '/pages/pkg-profile/reports/index',
'健康记录': '/pages/pkg-profile/health-records/index',
'诊断记录': '/pages/pkg-profile/diagnoses/index',
'我的随访': '/pages/pkg-profile/followups/index',
'用药提醒': '/pages/pkg-profile/medication/index',
'透析记录': '/pages/pkg-profile/dialysis-records/index',
'透析处方': '/pages/pkg-profile/dialysis-prescriptions/index',
'知情同意': '/pages/pkg-profile/consents/index',
'设置': '/pages/pkg-profile/settings/index',
};
export default function Profile() { export default function Profile() {
const { user, logout } = useAuthStore(); const { user, logout } = useAuthStore();
const { account: pointsAccount, checkinStatus: checkinInfo, refresh: refreshPoints } = usePointsStore(); const { account: pointsAccount, checkinStatus: checkinInfo, refresh: refreshPoints } = usePointsStore();
@@ -29,8 +45,9 @@ export default function Profile() {
refreshPoints(); refreshPoints();
}); });
const handleMenuClick = (path: string) => { const handleMenuClick = (label: string) => {
Taro.navigateTo({ url: path }); const path = MENU_PATHS[label];
if (path) Taro.navigateTo({ url: path });
}; };
const handleLogout = () => { const handleLogout = () => {
@@ -46,30 +63,26 @@ export default function Profile() {
return ( return (
<View className='profile-page'> <View className='profile-page'>
{/* 用户信息 */} {/* 用户信息卡片 */}
<View className='profile-header'> <View className='profile-user-card'>
<View className='profile-avatar'> <View className='profile-avatar'>
<Text className='profile-avatar-text'> <Text className='profile-avatar-icon'>👤</Text>
{user?.display_name?.[0] || '?'}
</Text>
</View> </View>
<Text className='profile-name'>{user?.display_name || '未登录'}</Text> <View className='profile-user-info'>
<Text className='profile-phone'>{user?.phone || ''}</Text> <Text className='profile-name'>{user?.display_name || '未登录'}</Text>
<Text className='profile-phone'>{user?.phone || ''}</Text>
</View>
</View>
{/* 积分 + 连续打卡横排 */} {/* 积分 + 打卡 — 两个独立卡片并排 */}
<View className='profile-stats'> <View className='profile-stats-row'>
<View <View className='stat-card'>
className='stat-card' <Text className='stat-value stat-pri'>{(pointsAccount?.balance ?? 0).toLocaleString()}</Text>
onClick={() => Taro.navigateTo({ url: '/pages/pkg-mall/detail/index' })} <Text className='stat-label'></Text>
> </View>
<Text className='stat-value stat-value-pri'>{(pointsAccount?.balance ?? 0).toLocaleString()}</Text> <View className='stat-card'>
<Text className='stat-label'></Text> <Text className='stat-value stat-acc'>{checkinInfo?.consecutive_days ?? 0}</Text>
</View> <Text className='stat-label'></Text>
<View className='stat-divider' />
<View className='stat-card'>
<Text className='stat-value stat-value-acc'>{checkinInfo?.consecutive_days ?? 0}</Text>
<Text className='stat-label'>()</Text>
</View>
</View> </View>
</View> </View>
@@ -79,10 +92,10 @@ export default function Profile() {
<View <View
className='menu-item' className='menu-item'
key={item.label} key={item.label}
onClick={() => handleMenuClick(item.path)} onClick={() => handleMenuClick(item.label)}
> >
<View className='menu-icon'> <View className='menu-icon' style={`background:${item.bg};`}>
<Text className='menu-icon-char'>{item.char}</Text> <Text className='menu-icon-text'>{item.icon}</Text>
</View> </View>
<Text className='menu-label'>{item.label}</Text> <Text className='menu-label'>{item.label}</Text>
<Text className='menu-arrow'></Text> <Text className='menu-arrow'></Text>