feat: 电子药箱小程序 - 4Tab药品管理

- 电子药箱: 药品库存管理 + 手动录入 + 今日用药打卡
- 药品百科: 搜索 + 分类筛选 + 20种药品静态数据
- 惠教中心: 4条药品使用指南课程
- 我的: 家庭成员信息管理
- 自定义TabBar + navigation-bar组件
- SVG药品分类插图
This commit is contained in:
陈誉午
2026-07-29 11:20:52 +08:00
commit 994b267f5c
683 changed files with 43849 additions and 0 deletions
@@ -0,0 +1,250 @@
.page {
min-height: 100vh;
background: #f5f5f5;
padding-bottom: 140rpx;
box-sizing: border-box;
overflow-x: hidden;
}
/* ========== Header / Tab Switch ========== */
.header {
background: #07C160;
padding: 16rpx 24rpx;
}
.tab-switch {
display: flex;
background: rgba(0, 0, 0, 0.15);
border-radius: 24rpx;
padding: 6rpx;
}
.tab-btn {
flex: 1;
text-align: center;
padding: 16rpx 0;
border-radius: 20rpx;
font-size: 28rpx;
color: rgba(255, 255, 255, 0.7);
font-weight: 500;
}
.tab-btn.on {
background: #ffffff;
color: #07C160;
font-weight: 600;
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1);
}
/* ========== 我的药箱 ========== */
.content {
padding: 24rpx;
}
.stats-row {
display: flex;
gap: 16rpx;
margin-bottom: 18rpx;
}
.stat-card {
flex: 1;
background: #ffffff;
border-radius: 18rpx;
padding: 26rpx 16rpx;
text-align: center;
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.03);
}
.stat-num {
font-size: 48rpx;
font-weight: 700;
color: #07C160;
}
.stat-card.warn .stat-num { color: #FF9500; }
.stat-card.alert .stat-num { color: #FF3B30; }
.stat-label {
font-size: 22rpx;
color: #999;
margin-top: 4rpx;
}
.expire-alert {
display: flex;
align-items: center;
gap: 12rpx;
background: #fff8e8;
border-radius: 14rpx;
padding: 18rpx 22rpx;
margin-bottom: 18rpx;
border: 1rpx solid #ffe0a0;
}
.alert-icon { font-size: 30rpx; }
.alert-text { flex: 1; font-size: 24rpx; color: #996600; line-height: 1.4; }
.med-list { display: flex; flex-direction: column; gap: 16rpx; }
.med-card {
display: flex;
align-items: center;
background: #ffffff;
border-radius: 20rpx;
padding: 26rpx 22rpx;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.03);
}
.med-card:active { background: #f9f9f9; }
.med-icon {
width: 72rpx; height: 72rpx;
display: flex; align-items: center; justify-content: center;
background: #f0faf3;
border-radius: 16rpx;
font-size: 38rpx;
margin-right: 18rpx;
}
.med-info { flex: 1; overflow: hidden; }
.med-name {
font-size: 30rpx; font-weight: 600; color: #333;
white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.med-meta { font-size: 24rpx; color: #999; margin: 6rpx 0; }
.med-tags { display: flex; gap: 10rpx; }
.med-tag {
font-size: 20rpx; padding: 4rpx 12rpx; border-radius: 8rpx;
background: #e8f8ee; color: #07C160;
}
.med-tag.slots { background: #e8f0fa; color: #4A90D9; }
.med-right { text-align: right; margin-left: 14rpx; min-width: 100rpx; }
.med-qty { font-size: 26rpx; color: #333; font-weight: 600; }
.med-expiry { font-size: 20rpx; color: #aaa; margin-top: 4rpx; }
.med-del {
width: 56rpx; height: 56rpx;
display: flex; align-items: center; justify-content: center;
font-size: 30rpx; opacity: 0.4; margin-left: 6rpx;
}
.med-del:active { opacity: 1; }
.empty-state { display: flex; flex-direction: column; align-items: center; padding: 100rpx 40rpx; }
.empty-icon { font-size: 120rpx; margin-bottom: 24rpx; }
.empty-title { font-size: 32rpx; font-weight: 600; color: #666; margin-bottom: 12rpx; }
.empty-desc { font-size: 26rpx; color: #aaa; text-align: center; }
/* ========== 今日打卡 ========== */
.checkin-content { padding: 24rpx; }
.checkin-header {
background: #ffffff; border-radius: 20rpx; padding: 30rpx;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.03); margin-bottom: 18rpx;
}
.date-label {
font-size: 34rpx; font-weight: bold; color: #333;
text-align: center; margin-bottom: 24rpx;
}
.progress-section { display: flex; align-items: center; gap: 24rpx; }
.progress-ring {
width: 120rpx; height: 120rpx; border-radius: 50%;
border: 8rpx solid #e8e8e8;
display: flex; align-items: center; justify-content: center;
flex-shrink: 0; background: #fafafa; box-sizing: border-box;
}
.progress-ring.half { border-color: #ffc966; }
.progress-ring.full { border-color: #07C160; background: #f0faf3; }
.ring-text { font-size: 28rpx; font-weight: 700; color: #07C160; }
.progress-ring.half .ring-text { color: #FF9500; }
.progress-info { flex: 1; }
.progress-detail { font-size: 28rpx; color: #555; margin-bottom: 6rpx; }
.progress-hint { font-size: 26rpx; color: #07C160; font-weight: 500; }
.week-row {
display: flex; background: #ffffff; border-radius: 18rpx;
padding: 20rpx 10rpx; margin-bottom: 18rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.02);
}
.week-day { flex: 1; text-align: center; padding: 10rpx 0; border-radius: 12rpx; }
.week-day.is-today { background: #e8f8ee; }
.wd-day { font-size: 22rpx; color: #999; margin-bottom: 8rpx; }
.week-day.is-today .wd-day { color: #07C160; font-weight: 600; }
.wd-dot { padding: 0 6rpx; }
.wd-bar-bg { height: 6rpx; background: #f0f0f0; border-radius: 3rpx; overflow: hidden; }
.wd-bar-fill { height: 100%; background: #07C160; border-radius: 3rpx; }
.wd-none { font-size: 20rpx; color: #ddd; }
.slot-list { display: flex; flex-direction: column; gap: 18rpx; }
.slot-group {
background: #ffffff; border-radius: 20rpx; padding: 24rpx;
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.03);
}
.slot-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16rpx; }
.slot-label { font-size: 28rpx; font-weight: 600; color: #333; }
.slot-time { font-size: 22rpx; color: #aaa; font-weight: 400; }
.slot-badge { font-size: 28rpx; }
.slot-meds { display: flex; flex-direction: column; gap: 10rpx; }
.slot-med {
display: flex; align-items: center; gap: 16rpx;
padding: 18rpx 16rpx; background: #f9fafb; border-radius: 14rpx;
border: 2rpx solid transparent;
}
.slot-med.done { background: #f0faf3; border-color: #c8e6d0; }
.sm-check {
width: 44rpx; height: 44rpx; border-radius: 50%;
border: 2rpx solid #ddd;
display: flex; align-items: center; justify-content: center;
font-size: 24rpx; color: transparent; flex-shrink: 0;
}
.sm-check.checked { background: #07C160; border-color: #07C160; color: #ffffff; }
.sm-info { flex: 1; }
.sm-name { font-size: 28rpx; color: #333; font-weight: 500; }
.sm-dosage { font-size: 22rpx; color: #999; margin-top: 4rpx; }
.sm-cat { font-size: 20rpx; color: #aaa; background: #f0f0f0; padding: 6rpx 14rpx; border-radius: 8rpx; }
.slot-empty { text-align: center; padding: 20rpx 0; }
.se-text { font-size: 24rpx; color: #ccc; }
.checkin-empty { display: flex; flex-direction: column; align-items: center; padding: 80rpx 40rpx; }
.go-add-btn {
margin-top: 30rpx; padding: 20rpx 50rpx;
background: linear-gradient(135deg, #07C160, #06AD56);
color: #ffffff; font-size: 28rpx; font-weight: 600; border-radius: 36rpx;
}
/* FAB */
.fab {
position: fixed; bottom: 200rpx; right: 40rpx;
width: 96rpx; height: 96rpx;
background: linear-gradient(135deg, #07C160, #06AD56);
color: #ffffff; font-size: 48rpx; border-radius: 50%;
display: flex; align-items: center; justify-content: center;
box-shadow: 0 8rpx 24rpx rgba(7, 193, 96, 0.4);
z-index: 100; font-weight: 300;
}
.fab:active { transform: scale(0.9); }