feat(mp): Veepoo M2 BLE 管线扩展 — 精准睡眠数据 + 自动测量 + UI 重构
- 新增 VeepooBridge API:精准睡眠读取(readPreciseSleepData)、B3自动测量配置 (readAutoTestConfig/setAutoTestConfig)、开关设置(setAutoHeartRate/BP/Temp)、 体温自动数据读取(readAutoTemperatureData),共 10 个新 API - 新增 SDK 事件类型:SDK_EVENT_SLEEP(4)、SDK_EVENT_AUTO_TEST(54) - VeepooPipeline 新增:readSleepData/readAllSleepData(enableAutoMeasurement 睡眠数据 Promise 化读取 + 自动测量一键开启 - VeepooHistoryReader 新增:uploadSleepReadings 睡眠数据上传 - stores/veepoo.ts 实装:注册 onSleepData 回调、syncHistory 实际读取+上传、 readSleepData 状态管理、enableAutoMeasurement、连接后自动触发三件事 - 原生页面(native/pkg-veepoo):_onReady 后自动读取 3 天睡眠 + 开启自动测量, 新增 _readSleepData/_handleSleepEvent/_enableAutoMeasurement - UI 重构:测量页药丸式选择器+SVG 圆环仪表盘+健康评估标签 - 数据上传页:2 列结果卡片网格+彩色条标识+睡眠数据卡片(★评分+总时长) - 修复上传按钮无响应 bug:patientId 增加 URL fallback + 错误提示不再静默 - 设计原型:docs/design/veepoo-measure-prototype.html(4 状态预览)
This commit is contained in:
@@ -1,355 +1,462 @@
|
||||
/* Veepoo M2 原生页面样式 */
|
||||
/**
|
||||
* Veepoo M2 原生页面样式
|
||||
* 设计原型: docs/design/veepoo-measure-prototype.html
|
||||
* 复刻小程序 design token
|
||||
*/
|
||||
|
||||
page {
|
||||
background: #F5F5F4;
|
||||
--pri: #C4623A;
|
||||
--pri-l: #F0DDD4;
|
||||
--bg: #F5F0EB;
|
||||
--card: #FFFFFF;
|
||||
--tx: #2D2A26;
|
||||
--tx2: #5A554F;
|
||||
--tx3: #78716C;
|
||||
--bd: #E8E2DC;
|
||||
--acc: #5B7A5E;
|
||||
--acc-l: #E8F0E8;
|
||||
--dan: #B54A4A;
|
||||
--dan-l: #FDEAEA;
|
||||
background: var(--bg);
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
/* ═══ 连接屏幕 ═══ */
|
||||
|
||||
/* ═══════════════════════════════════════
|
||||
连接页面(未连接/连接中/错误)
|
||||
═══════════════════════════════════════ */
|
||||
.connect-screen {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 100vh;
|
||||
padding: 40rpx;
|
||||
padding: 0 40px;
|
||||
}
|
||||
|
||||
.connect-anim {
|
||||
position: relative;
|
||||
width: 200rpx;
|
||||
height: 200rpx;
|
||||
margin-bottom: 48rpx;
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
margin-bottom: 28px;
|
||||
}
|
||||
|
||||
.connect-ring {
|
||||
position: absolute;
|
||||
top: 0; left: 0;
|
||||
width: 100%; height: 100%;
|
||||
inset: 0;
|
||||
border-radius: 50%;
|
||||
border: 4rpx solid #D6D3D1;
|
||||
border: 3px solid var(--pri);
|
||||
animation: pulse-ring 2s ease-out infinite;
|
||||
}
|
||||
|
||||
.connect-ring--active {
|
||||
border-color: #C4623A;
|
||||
animation: pulse 1.5s ease-in-out infinite;
|
||||
}
|
||||
|
||||
@keyframes pulse {
|
||||
0%, 100% { transform: scale(1); opacity: 0.6; }
|
||||
50% { transform: scale(1.1); opacity: 1; }
|
||||
border-color: var(--pri);
|
||||
animation: pulse-ring 1.5s ease-out infinite;
|
||||
}
|
||||
|
||||
.connect-center {
|
||||
position: absolute;
|
||||
top: 50%; left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
width: 80rpx; height: 80rpx;
|
||||
inset: 20px;
|
||||
border-radius: 50%;
|
||||
background: #292524;
|
||||
background: var(--pri);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.connect-bt {
|
||||
color: #FAFAF9;
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: #fff;
|
||||
font-size: 20px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.connect-title {
|
||||
font-size: 36rpx;
|
||||
font-weight: 600;
|
||||
color: #1C1917;
|
||||
margin-bottom: 16rpx;
|
||||
font-family: Georgia, 'Times New Roman', serif;
|
||||
font-size: 22px;
|
||||
font-weight: 700;
|
||||
color: var(--tx);
|
||||
margin-bottom: 8px;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.connect-hint {
|
||||
font-size: 26rpx;
|
||||
color: #78716C;
|
||||
margin-bottom: 48rpx;
|
||||
font-size: 14px;
|
||||
color: var(--tx3);
|
||||
margin-bottom: 32px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.connect-error {
|
||||
background: #FEF2F2;
|
||||
border-radius: 16rpx;
|
||||
padding: 24rpx 32rpx;
|
||||
margin-bottom: 32rpx;
|
||||
width: 100%;
|
||||
max-width: 600rpx;
|
||||
margin-bottom: 16px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.connect-error-text {
|
||||
font-size: 26rpx;
|
||||
color: #DC2626;
|
||||
font-size: 14px;
|
||||
color: var(--dan);
|
||||
}
|
||||
|
||||
.connect-btn-wrap {
|
||||
width: 100%;
|
||||
max-width: 600rpx;
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.connect-back {
|
||||
width: 100%;
|
||||
max-width: 600rpx;
|
||||
margin-top: 24rpx;
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
/* ═══ 按钮 ═══ */
|
||||
|
||||
.btn-primary {
|
||||
background: #C4623A;
|
||||
color: #FFFFFF;
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
text-align: center;
|
||||
padding: 24rpx 0;
|
||||
border-radius: 16rpx;
|
||||
@keyframes pulse-ring {
|
||||
0% { transform: scale(1); opacity: 1; }
|
||||
100% { transform: scale(1.4); opacity: 0; }
|
||||
}
|
||||
|
||||
.btn-secondary {
|
||||
background: #FFFFFF;
|
||||
color: #44403C;
|
||||
font-size: 30rpx;
|
||||
font-weight: 500;
|
||||
text-align: center;
|
||||
padding: 24rpx 0;
|
||||
border-radius: 16rpx;
|
||||
border: 2rpx solid #D6D3D1;
|
||||
}
|
||||
|
||||
.btn-large {
|
||||
width: 100%;
|
||||
max-width: 600rpx;
|
||||
}
|
||||
|
||||
.actions-row {
|
||||
display: flex;
|
||||
gap: 24rpx;
|
||||
width: 100%;
|
||||
max-width: 600rpx;
|
||||
}
|
||||
|
||||
.actions-row .btn-secondary,
|
||||
.actions-row .btn-primary {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
/* ═══ 测量页面 ═══ */
|
||||
|
||||
/* ═══════════════════════════════════════
|
||||
测量页面(就绪态)
|
||||
═══════════════════════════════════════ */
|
||||
.measure-page {
|
||||
padding: 24rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 100vh;
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
|
||||
/* ── Header ── */
|
||||
|
||||
.header {
|
||||
/* ── 设备状态栏 ── */
|
||||
.device-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 16rpx 24rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 16rpx;
|
||||
margin-bottom: 24rpx;
|
||||
padding: 10px 20px;
|
||||
background: var(--card);
|
||||
border-bottom: 1px solid var(--bd);
|
||||
}
|
||||
|
||||
.header-device {
|
||||
.device-bar__left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12rpx;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.header-dot {
|
||||
width: 16rpx; height: 16rpx;
|
||||
.device-bar__dot {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
background: #A8A29E;
|
||||
background: var(--acc);
|
||||
}
|
||||
|
||||
.header-dot--on {
|
||||
background: #22C55E;
|
||||
}
|
||||
|
||||
.header-name {
|
||||
font-size: 28rpx;
|
||||
.device-bar__name {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #1C1917;
|
||||
color: var(--tx);
|
||||
}
|
||||
|
||||
.header-battery {
|
||||
font-size: 24rpx;
|
||||
color: #78716C;
|
||||
.device-bar__battery {
|
||||
font-size: 13px;
|
||||
color: var(--tx3);
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
.header-disconnect {
|
||||
font-size: 26rpx;
|
||||
color: #C4623A;
|
||||
.device-bar__disconnect {
|
||||
font-size: 13px;
|
||||
color: var(--tx3);
|
||||
padding: 6px 12px;
|
||||
background: transparent;
|
||||
border: 1px solid var(--bd);
|
||||
border-radius: 999px;
|
||||
}
|
||||
|
||||
/* ── Selector ── */
|
||||
|
||||
/* ── 指标选择器(药丸式) ── */
|
||||
.selector {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
padding: 24rpx 0;
|
||||
background: #FFFFFF;
|
||||
border-radius: 16rpx;
|
||||
margin-bottom: 24rpx;
|
||||
white-space: nowrap;
|
||||
padding: 16px 20px;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.selector-item {
|
||||
.selector__pill {
|
||||
flex-shrink: 0;
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
padding: 10px 14px;
|
||||
border-radius: 16px;
|
||||
position: relative;
|
||||
min-width: 64px;
|
||||
transition: all 200ms ease;
|
||||
}
|
||||
|
||||
.selector__pill--active {
|
||||
background: var(--card);
|
||||
box-shadow: 0 2px 12px rgba(45,42,38,0.10);
|
||||
}
|
||||
|
||||
.selector__pill--done::after {
|
||||
content: '✓';
|
||||
position: absolute;
|
||||
top: 4px;
|
||||
right: 6px;
|
||||
font-size: 10px;
|
||||
color: #fff;
|
||||
background: var(--acc);
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.selector__icon-wrap {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
border-radius: 12px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: transform 200ms ease;
|
||||
}
|
||||
|
||||
.selector__pill--active .selector__icon-wrap {
|
||||
transform: scale(1.15);
|
||||
}
|
||||
|
||||
.selector__icon {
|
||||
font-size: 18px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.selector__label {
|
||||
font-size: 13px;
|
||||
color: var(--tx3);
|
||||
}
|
||||
|
||||
.selector__pill--active .selector__label {
|
||||
color: var(--tx);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* ── 仪表盘 ── */
|
||||
.gauge-section {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 8rpx;
|
||||
padding: 12rpx 16rpx;
|
||||
border-radius: 12rpx;
|
||||
padding: 16px 0 24px;
|
||||
}
|
||||
|
||||
.gauge {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.selector-item--active {
|
||||
background: #FFF7ED;
|
||||
.gauge--measuring {
|
||||
animation: gauge-breathe 2s ease-in-out infinite;
|
||||
}
|
||||
|
||||
.selector-item--done::after {
|
||||
content: '';
|
||||
@keyframes gauge-breathe {
|
||||
0%, 100% { transform: scale(1); }
|
||||
50% { transform: scale(1.03); }
|
||||
}
|
||||
|
||||
.selector-icon {
|
||||
font-size: 40rpx;
|
||||
.gauge__ring-wrap {
|
||||
position: relative;
|
||||
width: 220px;
|
||||
height: 220px;
|
||||
}
|
||||
|
||||
.selector-label {
|
||||
font-size: 22rpx;
|
||||
color: #57534E;
|
||||
}
|
||||
|
||||
.selector-check {
|
||||
.gauge__ring-bg {
|
||||
position: absolute;
|
||||
top: 4rpx; right: 4rpx;
|
||||
width: 28rpx; height: 28rpx;
|
||||
inset: 0;
|
||||
border-radius: 50%;
|
||||
color: #FFFFFF;
|
||||
font-size: 18rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: 10px solid var(--bd);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* ── Gauge ── */
|
||||
.gauge__ring-progress {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.gauge {
|
||||
flex: 1;
|
||||
.gauge__center {
|
||||
position: absolute;
|
||||
inset: 20px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 48rpx 0;
|
||||
}
|
||||
|
||||
.gauge-circle {
|
||||
width: 400rpx;
|
||||
height: 400rpx;
|
||||
border-radius: 50%;
|
||||
background: #FFFFFF;
|
||||
border: 8rpx solid #E7E5E4;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-bottom: 24rpx;
|
||||
.gauge__icon-lg {
|
||||
font-size: 40px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.gauge-icon {
|
||||
font-size: 64rpx;
|
||||
margin-bottom: 16rpx;
|
||||
.gauge__hint {
|
||||
font-size: 13px;
|
||||
color: var(--tx3);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.gauge-hint {
|
||||
font-size: 26rpx;
|
||||
color: #78716C;
|
||||
}
|
||||
|
||||
.gauge-value {
|
||||
font-size: 80rpx;
|
||||
.gauge__value {
|
||||
font-family: Georgia, 'Times New Roman', serif;
|
||||
font-size: 52px;
|
||||
font-weight: 700;
|
||||
line-height: 1.1;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.gauge-loading {
|
||||
font-size: 30rpx;
|
||||
color: #78716C;
|
||||
.gauge__unit {
|
||||
font-size: 14px;
|
||||
color: var(--tx3);
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.gauge-err {
|
||||
font-size: 72rpx;
|
||||
.gauge__loading {
|
||||
font-size: 16px;
|
||||
color: var(--tx2);
|
||||
}
|
||||
|
||||
.gauge__err {
|
||||
font-size: 36px;
|
||||
color: var(--dan);
|
||||
font-weight: 700;
|
||||
color: #DC2626;
|
||||
margin-bottom: 8rpx;
|
||||
}
|
||||
|
||||
.gauge-err-text {
|
||||
font-size: 26rpx;
|
||||
color: #DC2626;
|
||||
.gauge__err-text {
|
||||
font-size: 13px;
|
||||
color: var(--tx2);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.gauge-progress-bar {
|
||||
width: 500rpx;
|
||||
height: 8rpx;
|
||||
background: #E7E5E4;
|
||||
border-radius: 4rpx;
|
||||
/* ── 进度条 ── */
|
||||
.progress-bar {
|
||||
width: 240px;
|
||||
height: 4px;
|
||||
background: var(--bd);
|
||||
border-radius: 2px;
|
||||
margin-top: 16px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.gauge-progress-fill {
|
||||
.progress-bar__fill {
|
||||
height: 100%;
|
||||
background: #C4623A;
|
||||
border-radius: 4rpx;
|
||||
transition: width 0.3s ease;
|
||||
border-radius: 2px;
|
||||
transition: width 0.3s ease-out;
|
||||
}
|
||||
|
||||
/* ── Assessment ── */
|
||||
|
||||
.assessment {
|
||||
text-align: center;
|
||||
padding: 16rpx;
|
||||
}
|
||||
|
||||
.assessment-text {
|
||||
font-size: 26rpx;
|
||||
color: #16A34A;
|
||||
}
|
||||
|
||||
/* ── Disclaimer ── */
|
||||
|
||||
/* ── 免责声明 ── */
|
||||
.disclaimer {
|
||||
text-align: center;
|
||||
padding: 16rpx 32rpx;
|
||||
padding: 0 20px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.disclaimer-text {
|
||||
font-size: 22rpx;
|
||||
color: #A8A29E;
|
||||
.disclaimer__text {
|
||||
font-size: 11px;
|
||||
color: var(--tx3);
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
/* ── Actions ── */
|
||||
|
||||
/* ── 操作按钮 ── */
|
||||
.actions {
|
||||
padding: 24rpx 0;
|
||||
padding: 0 20px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
/* ── Measure Error ── */
|
||||
|
||||
.measure-error {
|
||||
.btn {
|
||||
height: 52px;
|
||||
border-radius: 16px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
text-align: center;
|
||||
padding: 16rpx;
|
||||
transition: opacity 150ms;
|
||||
}
|
||||
|
||||
.measure-error-text {
|
||||
font-size: 26rpx;
|
||||
color: #DC2626;
|
||||
.btn:active {
|
||||
opacity: 0.85;
|
||||
}
|
||||
|
||||
.btn--primary {
|
||||
background: var(--pri);
|
||||
color: #fff;
|
||||
box-shadow: 0 4px 16px rgba(196,98,58,0.3);
|
||||
}
|
||||
|
||||
.btn--secondary {
|
||||
background: var(--card);
|
||||
color: var(--tx);
|
||||
border: 1px solid var(--bd);
|
||||
}
|
||||
|
||||
.btn--text {
|
||||
background: transparent;
|
||||
color: var(--tx3);
|
||||
height: 44px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
/* ═══ 旧版兼容样式 ═══ */
|
||||
.btn-primary {
|
||||
background: var(--pri);
|
||||
color: #fff;
|
||||
height: 52px;
|
||||
border-radius: 16px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
box-shadow: 0 4px 16px rgba(196,98,58,0.3);
|
||||
}
|
||||
.btn-primary:active { opacity: 0.85; }
|
||||
|
||||
.btn-secondary {
|
||||
background: var(--card);
|
||||
color: var(--tx);
|
||||
height: 52px;
|
||||
border-radius: 16px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
border: 1px solid var(--bd);
|
||||
}
|
||||
.btn-secondary:active { opacity: 0.85; }
|
||||
|
||||
.btn-text {
|
||||
background: transparent;
|
||||
color: var(--tx3);
|
||||
height: 44px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.btn-large { margin: 0; }
|
||||
|
||||
/* 旧版 header/selector/gauge 兼容 */
|
||||
.header { display: none; }
|
||||
.header-device { display: none; }
|
||||
.header-dot { display: none; }
|
||||
.header-name { display: none; }
|
||||
.header-battery { display: none; }
|
||||
.header-disconnect { display: none; }
|
||||
.selector-item { display: none; }
|
||||
.selector-icon { display: none; }
|
||||
.selector-label { display: none; }
|
||||
.selector-check { display: none; }
|
||||
.gauge-circle { display: none; }
|
||||
.gauge-icon { display: none; }
|
||||
.gauge-hint { display: none; }
|
||||
.gauge-value { display: none; }
|
||||
.gauge-loading { display: none; }
|
||||
.gauge-err { display: none; }
|
||||
.gauge-err-text { display: none; }
|
||||
.gauge-progress-bar { display: none; }
|
||||
.gauge-progress-fill { display: none; }
|
||||
.assessment { display: none; }
|
||||
.assessment-text { display: none; }
|
||||
.disclaimer-text { display: none; }
|
||||
.measure-error { display: none; }
|
||||
.measure-error-text { display: none; }
|
||||
|
||||
Reference in New Issue
Block a user