fix(miniprogram): 对齐设计原型 — 移除渐变头部+体征数值内联+卡片布局
- 首页:移除渐变头部改为平铺背景,铃铛图标替代消息按钮 - 首页:体征数值与单位内联显示(同一行 baseline 对齐) - 健康页:标题改为"健康数据",整体样式贴近原型紧凑风格 - 我的页:移除渐变头部改为平铺卡片,积分/打卡分两个独立卡片 - 我的页:菜单使用 emoji 图标替代文字图标,间距更紧凑
This commit is contained in:
@@ -4,17 +4,16 @@
|
||||
.home-page {
|
||||
min-height: 100vh;
|
||||
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 {
|
||||
background: linear-gradient(135deg, $pri 0%, $pri-d 100%);
|
||||
padding: 48px 32px 60px;
|
||||
color: #fff;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
align-items: flex-start;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.greeting-left {
|
||||
@@ -22,45 +21,44 @@
|
||||
}
|
||||
|
||||
.greeting-text {
|
||||
font-size: 28px;
|
||||
font-weight: bold;
|
||||
font-size: 24px;
|
||||
font-weight: 700;
|
||||
color: $tx;
|
||||
display: block;
|
||||
margin-bottom: 6px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.greeting-date {
|
||||
font-size: 22px;
|
||||
opacity: 0.75;
|
||||
font-size: 14px;
|
||||
color: $tx3;
|
||||
}
|
||||
|
||||
.greeting-msg {
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
border-radius: 50%;
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
.greeting-bell {
|
||||
position: relative;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
@include flex-center;
|
||||
flex-shrink: 0;
|
||||
|
||||
&:active {
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
opacity: 0.7;
|
||||
}
|
||||
}
|
||||
|
||||
.greeting-msg-icon {
|
||||
.greeting-bell-icon {
|
||||
font-size: 22px;
|
||||
color: #fff;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* ─── 区域 2:今日体征完成度 ─── */
|
||||
.checkin-card {
|
||||
background: $card;
|
||||
border-radius: $r;
|
||||
box-shadow: $shadow-md;
|
||||
margin: -28px 24px 24px;
|
||||
padding: 24px;
|
||||
box-shadow: $shadow-sm;
|
||||
padding: 16px;
|
||||
margin-bottom: 12px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 24px;
|
||||
gap: 16px;
|
||||
|
||||
&:active {
|
||||
opacity: 0.9;
|
||||
@@ -69,6 +67,7 @@
|
||||
|
||||
.checkin-left {
|
||||
flex-shrink: 0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.checkin-right {
|
||||
@@ -77,22 +76,22 @@
|
||||
}
|
||||
|
||||
.checkin-title {
|
||||
font-size: 26px;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: $tx;
|
||||
display: block;
|
||||
margin-bottom: 12px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.checkin-capsules {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.capsule {
|
||||
font-size: 22px;
|
||||
padding: 4px 12px;
|
||||
font-size: 11px;
|
||||
padding: 3px 8px;
|
||||
border-radius: $r-pill;
|
||||
font-weight: 500;
|
||||
|
||||
@@ -103,27 +102,30 @@
|
||||
|
||||
&.capsule-pending {
|
||||
background: $surface-alt;
|
||||
color: $tx2;
|
||||
color: $tx3;
|
||||
}
|
||||
}
|
||||
|
||||
/* ─── 区域 3:今日体征 2x2 ─── */
|
||||
.vitals-section {
|
||||
margin: 0 24px 24px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
@include section-title;
|
||||
}
|
||||
|
||||
.vitals-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 16px;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.vital-card {
|
||||
background: $card;
|
||||
border-radius: $r;
|
||||
padding: 20px;
|
||||
padding: 14px 16px;
|
||||
box-shadow: $shadow-sm;
|
||||
text-align: center;
|
||||
|
||||
&:active {
|
||||
opacity: 0.7;
|
||||
@@ -131,40 +133,45 @@
|
||||
}
|
||||
|
||||
.vital-label {
|
||||
font-size: 24px;
|
||||
font-size: 13px;
|
||||
color: $tx2;
|
||||
display: block;
|
||||
margin-bottom: 8px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.vital-value-row {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.vital-value {
|
||||
@include serif-number;
|
||||
font-size: 48px;
|
||||
font-weight: bold;
|
||||
font-size: 32px;
|
||||
font-weight: 700;
|
||||
color: $tx;
|
||||
display: block;
|
||||
line-height: 1.1;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.vital-unit {
|
||||
font-size: 12px;
|
||||
color: $tx3;
|
||||
margin-left: 2px;
|
||||
}
|
||||
|
||||
.vital-bottom {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.vital-unit {
|
||||
font-size: 22px;
|
||||
color: $tx2;
|
||||
gap: 0;
|
||||
}
|
||||
|
||||
.vital-tag {
|
||||
font-size: 22px;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
padding: 2px 10px;
|
||||
border-radius: $r-sm;
|
||||
padding: 2px 8px;
|
||||
border-radius: $r-pill;
|
||||
display: inline-block;
|
||||
margin-top: 4px;
|
||||
|
||||
&.tag-ok {
|
||||
background: $acc-l;
|
||||
@@ -178,25 +185,25 @@
|
||||
|
||||
&.tag-empty {
|
||||
background: $surface-alt;
|
||||
color: $tx2;
|
||||
color: $tx3;
|
||||
}
|
||||
}
|
||||
|
||||
/* ─── 区域 4:今日待办 ─── */
|
||||
.todo-section {
|
||||
margin: 0 24px 24px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.todo-empty {
|
||||
background: $card;
|
||||
border-radius: $r;
|
||||
padding: 36px 24px;
|
||||
padding: 24px;
|
||||
text-align: center;
|
||||
box-shadow: $shadow-sm;
|
||||
}
|
||||
|
||||
.todo-empty-text {
|
||||
font-size: 24px;
|
||||
font-size: 14px;
|
||||
color: $tx2;
|
||||
}
|
||||
|
||||
@@ -210,8 +217,9 @@
|
||||
.todo-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 24px;
|
||||
border-bottom: 1px solid $bd-l;
|
||||
gap: 10px;
|
||||
padding: 12px 16px;
|
||||
border-bottom: 1px solid $bd;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
@@ -223,17 +231,16 @@
|
||||
}
|
||||
|
||||
.todo-icon-wrap {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
border-radius: $r-sm;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
border-radius: 10px;
|
||||
background: $pri-l;
|
||||
@include flex-center;
|
||||
margin-right: 16px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.todo-icon-char {
|
||||
font-size: 24px;
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
color: $pri;
|
||||
}
|
||||
@@ -244,16 +251,16 @@
|
||||
}
|
||||
|
||||
.todo-title {
|
||||
font-size: 28px;
|
||||
font-size: 15px;
|
||||
color: $tx;
|
||||
font-weight: 600;
|
||||
font-weight: 500;
|
||||
display: block;
|
||||
margin-bottom: 4px;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
.todo-sub {
|
||||
font-size: 22px;
|
||||
color: $tx2;
|
||||
font-size: 13px;
|
||||
color: $tx3;
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
@@ -261,7 +268,7 @@
|
||||
}
|
||||
|
||||
.todo-arrow {
|
||||
font-size: 32px;
|
||||
font-size: 14px;
|
||||
color: $tx3;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
@@ -269,17 +276,17 @@
|
||||
/* ─── 区域 5:快捷操作 ─── */
|
||||
.action-section {
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
margin: 0 24px 24px;
|
||||
gap: 10px;
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.action-btn {
|
||||
flex: 1;
|
||||
@include touch-target;
|
||||
height: $btn-primary-h;
|
||||
border-radius: $r;
|
||||
font-size: 28px;
|
||||
height: 52px;
|
||||
border-radius: 14px;
|
||||
font-size: 17px;
|
||||
font-weight: 600;
|
||||
@include flex-center;
|
||||
|
||||
&:active {
|
||||
opacity: 0.85;
|
||||
@@ -298,6 +305,6 @@
|
||||
}
|
||||
|
||||
.action-btn-text {
|
||||
font-size: 28px;
|
||||
font-size: 17px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
@@ -118,10 +118,10 @@ export default function Index() {
|
||||
</Text>
|
||||
</View>
|
||||
<View
|
||||
className='greeting-msg'
|
||||
className='greeting-bell'
|
||||
onClick={() => Taro.switchTab({ url: '/pages/messages/index' })}
|
||||
>
|
||||
<Text className='greeting-msg-icon'>消</Text>
|
||||
<Text className='greeting-bell-icon'>🔔</Text>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
@@ -165,9 +165,11 @@ export default function Index() {
|
||||
onClick={() => Taro.navigateTo({ url: `/pages/pkg-health/trend/index?indicator=${item.indicator}` })}
|
||||
>
|
||||
<Text className='vital-label'>{item.label}</Text>
|
||||
<Text className='vital-value'>{item.value}</Text>
|
||||
<View className='vital-bottom'>
|
||||
<View className='vital-value-row'>
|
||||
<Text className='vital-value'>{item.value}</Text>
|
||||
<Text className='vital-unit'>{item.unit}</Text>
|
||||
</View>
|
||||
<View className='vital-bottom'>
|
||||
{tag && <Text className={`vital-tag ${tag.cls}`}>{tag.label}</Text>}
|
||||
{!item.status && <Text className='vital-tag tag-empty'>未记录</Text>}
|
||||
</View>
|
||||
|
||||
Reference in New Issue
Block a user