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
这个提交包含在:
@@ -1,30 +1,39 @@
|
||||
<view class="page">
|
||||
<view class="page-header page-header-pink" style="padding-top: {{statusBarHeight + 24}}px;">
|
||||
<view class="nav-back" bindtap="onBack">‹ 返回</view>
|
||||
<view class="page-header-title">自动扫描</view>
|
||||
<view class="page-header-subtitle">正在识别区域...</view>
|
||||
<view class="page-header-title">区域扫描</view>
|
||||
<view class="page-header-subtitle">{{scanning ? '正在采集数据...' : '扫描完成'}}</view>
|
||||
</view>
|
||||
|
||||
<view class="page-content">
|
||||
<view class="page-title">自动扫描区域</view>
|
||||
|
||||
<view class="scan-container">
|
||||
<view class="scan-container" wx:if="{{scanning}}">
|
||||
<view class="face-outline">
|
||||
<view class="scan-line"></view>
|
||||
</view>
|
||||
<view class="scan-progress-bar">
|
||||
<view class="scan-progress-fill" style="width: {{scanProgress}}%"></view>
|
||||
</view>
|
||||
<view class="scan-status">全域LED已开启,亮度 128,等待PD数据回传...</view>
|
||||
</view>
|
||||
|
||||
<view class="scan-hint">请正确佩戴设备</view>
|
||||
<view class="scan-hint" style="font-size:24rpx;color:#999;margin-top:8rpx;">连接设备后可获取检测数据</view>
|
||||
|
||||
<view class="scan-progress" wx:if="{{scanning}}">
|
||||
正在扫描... <text class="highlight">{{regionData.length || 3}}</text> 个区域
|
||||
<view class="scan-result" wx:if="{{!scanning && pdValues.length > 0}}">
|
||||
<view class="result-title">PD 采集结果</view>
|
||||
<view class="pd-list">
|
||||
<view class="pd-item" wx:for="{{pdValues}}" wx:key="region">
|
||||
<view class="pd-region">{{item.region}}</view>
|
||||
<view class="pd-value {{item.pd > 0 ? '' : 'pd-empty'}}">{{item.pdText}}</view>
|
||||
<view class="pd-bar-bg" wx:if="{{item.pd > 0}}">
|
||||
<view class="pd-bar-fill" style="width: {{item.pd > 4095 ? 100 : item.pd / 40.95}}%"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="vbat-info" wx:if="{{vbat > 0}}">
|
||||
电池电压: {{vbat}}mV ({{battery}}%)
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="detected-tags" wx:if="{{regionData.length > 0}}">
|
||||
<text class="detected-tag" wx:for="{{regionData}}" wx:key="region">{{item.region}}</text>
|
||||
</view>
|
||||
<view class="scan-error" wx:if="{{error}}">{{error}}</view>
|
||||
|
||||
<button class="btn-primary mt-30" wx:if="{{!scanning}}" bindtap="onNext">设置参数</button>
|
||||
<button class="btn-primary mt-30" wx:if="{{!scanning}}" bindtap="onNext">下一步</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
在新工单中引用
屏蔽一个用户