- Phase 1 (waiting_fit): after sending control=0x01, wait for fitting=1 - Phase 2 (collecting): once fitting=1 AND run_state=1, start PD accumulation - Phase 3 (done): run_state 1→0, calculate averages, auto-send treatment - Check start-collecting in BOTH fitting and run_state handlers - fitting=0 + run_state 1→0 = fitting failure, prompt retry - Timeout 3 minutes (was 30s), auto-start treatment on completion
44 行
1.8 KiB
Plaintext
44 行
1.8 KiB
Plaintext
<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">{{phase === 'ready' ? '准备就绪' : phase === 'waiting_fit' ? '等待佩戴贴合...' : phase === 'collecting' ? '采集数据中 (' + frameCount + '帧)...' : '检测完成,正在启动...'}}</view>
|
||
</view>
|
||
|
||
<view class="page-content">
|
||
<!-- 待开始 -->
|
||
<view wx:if="{{phase === 'ready'}}">
|
||
<view class="scan-hint">设备已佩戴,点击下方按钮开始智能检测</view>
|
||
<view class="scan-hint sub-hint">检测过程约需 2 分钟,请保持设备贴合</view>
|
||
<button class="btn-primary mt-30" bindtap="onStartScan">开始检测</button>
|
||
</view>
|
||
|
||
<!-- 等待贴合 -->
|
||
<view wx:if="{{phase === 'waiting_fit'}}">
|
||
<view class="scan-container">
|
||
<view class="face-outline">
|
||
<view class="scan-line"></view>
|
||
</view>
|
||
</view>
|
||
<view class="scan-status">正在检测面膜贴合状态,请确保设备正确佩戴...</view>
|
||
</view>
|
||
|
||
<!-- 采集中 -->
|
||
<view wx:if="{{phase === 'collecting'}}">
|
||
<view class="scan-container">
|
||
<view class="face-outline">
|
||
<view class="scan-line"></view>
|
||
</view>
|
||
</view>
|
||
<view class="scan-status">已贴合,正在采集光谱数据... 已收到 {{frameCount}} 帧</view>
|
||
</view>
|
||
|
||
<!-- 完成,自动跳转 -->
|
||
<view wx:if="{{phase === 'done'}}">
|
||
<view class="scan-status">检测完成(共 {{frameCount}} 帧),正在启动治疗...</view>
|
||
</view>
|
||
|
||
<view class="scan-error" wx:if="{{error}}">{{error}}</view>
|
||
</view>
|
||
</view>
|