文件
jw-beauty/miniprogram/pages/auto-scan/auto-scan.wxml
T
Guoguo 515153f134 feat: auto-scan 3-phase state machine with proper PD collection timing
- 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
2026-06-29 05:36:12 -07:00

44 行
1.8 KiB
Plaintext
原始文件 Blame 文件历史

此文件含有模棱两可的 Unicode 字符
此文件含有可能会与其他字符混淆的 Unicode 字符。 如果您是想特意这样的,可以安全地忽略该警告。 使用 Escape 按钮显示他们。
<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>