feat: implement MVP Phase 1 — full-area scan with ADC data collection

- Send scan command: all 5 regions LED on, brightness 128
- Listen for ADC notify (17 bytes) instead of broken queryStatus
- Parse and display PD1-PD7 values with visual bars
- Show VBAT/battery info
- Store scan PD data in globalData for Phase 3 smart adjustment
- 8s timeout fallback, stop LED on page unload
这个提交包含在:
Guoguo
2026-06-10 08:16:17 -07:00
父节点 c9799a5fc1
当前提交 0ffa67da65
修改 3 个文件,包含 185 行新增101 行删除
+96 -42
查看文件
@@ -1,13 +1,13 @@
.scan-container {
position: relative;
width: 320rpx;
height: 400rpx;
margin: 40rpx auto;
display: flex;
flex-direction: column;
align-items: center;
padding: 20rpx 0;
}
.face-outline {
width: 100%;
height: 100%;
width: 320rpx;
height: 400rpx;
border: 6rpx solid #e5e5e5;
border-radius: 50% 50% 45% 45%;
position: relative;
@@ -29,49 +29,103 @@
100% { top: calc(100% - 6rpx); opacity: 0.5; }
}
.scan-hint {
text-align: center;
font-size: 26rpx;
color: #666666;
margin-bottom: 24rpx;
.scan-progress-bar {
width: 80%;
height: 8rpx;
background: #f0f0f0;
border-radius: 4rpx;
margin-top: 30rpx;
overflow: hidden;
}
.scan-progress {
text-align: center;
background: #f0f9ff;
padding: 16rpx 28rpx;
border-radius: 24rpx;
font-size: 26rpx;
color: #006699;
width: fit-content;
margin: 0 auto;
.scan-progress-fill {
height: 100%;
background: linear-gradient(90deg, #E6508C, #DCB982);
border-radius: 4rpx;
transition: width 0.3s;
}
.highlight {
color: #E6508C;
font-weight: 600;
}
.detected-tags {
text-align: center;
margin-top: 24rpx;
}
.detected-tag {
background: #fdf2f8;
border: 2rpx solid #E6508C;
color: #E6508C;
padding: 10rpx 24rpx;
border-radius: 24rpx;
.scan-status {
font-size: 24rpx;
display: inline-block;
margin: 6rpx;
animation: tagPulse 1s ease-in-out;
color: #999;
margin-top: 16rpx;
text-align: center;
}
@keyframes tagPulse {
0%, 100% { transform: scale(1); }
50% { transform: scale(1.05); }
.scan-result {
background: #fff;
border-radius: 20rpx;
padding: 24rpx;
margin-top: 20rpx;
}
.result-title {
font-size: 28rpx;
font-weight: 600;
color: #333;
margin-bottom: 20rpx;
}
.pd-list {
display: flex;
flex-direction: column;
gap: 16rpx;
}
.pd-item {
display: flex;
align-items: center;
gap: 16rpx;
}
.pd-region {
font-size: 26rpx;
color: #666;
width: 160rpx;
flex-shrink: 0;
}
.pd-value {
font-size: 28rpx;
font-weight: 600;
color: #E6508C;
width: 100rpx;
flex-shrink: 0;
text-align: right;
}
.pd-empty {
color: #ccc;
font-weight: normal;
}
.pd-bar-bg {
flex: 1;
height: 16rpx;
background: #f5f5f5;
border-radius: 8rpx;
overflow: hidden;
}
.pd-bar-fill {
height: 100%;
background: linear-gradient(90deg, #E6508C, #DCB982);
border-radius: 8rpx;
min-width: 4rpx;
}
.vbat-info {
margin-top: 20rpx;
font-size: 24rpx;
color: #999;
text-align: center;
}
.scan-error {
text-align: center;
color: #ff4d4f;
font-size: 26rpx;
margin-top: 20rpx;
}
.btn-primary::after {