feat: 扫描报告页+手动选波长护理+光疗功效介绍页+诊断框架(占位阈值)

- services/diagnosis.js: 诊断流水线框架,阈值/PD映射为占位待标定,支持单波长降级
- auto-scan: 扫描完成改为出报告让用户选择护理(替代原自动开始治疗)
- 新增 scan-report/manual-treatment/light-info 三页,全部接入 i18n
- api.js: 新增 report/diagnosis-config 接口(对接后端契约)
这个提交包含在:
Guoguo
2026-07-18 20:17:09 -07:00
父节点 d8eb6677c6
当前提交 f2ee086cc8
修改 19 个文件,包含 1270 行新增30 行删除
@@ -0,0 +1,34 @@
var i18n = require('../../i18n/index')
Page({
data: {
statusBarHeight: 44,
// Ordered list of lights; strings live in i18n under lightInfo.lights[key],
// colors are presentation-only and stay in JS.
lights: [
{ key: 'red', color: '#E8503A' },
{ key: 'uv', color: '#7C4DFF' },
{ key: 'yellow', color: '#F5B841' },
{ key: 'infrared', color: '#8B2E3C' }
],
// Parallel to i18n.lightInfo.modes (matched by index).
modeColors: ['#E8503A', '#7C4DFF', '#F5B841', '#8B2E3C', '#F08AA8']
},
onLoad: function () {
var app = getApp()
this.setData({ statusBarHeight: app.globalData.statusBarHeight })
},
onShow: function () {
i18n.bind(this)
},
onBack: function () {
wx.navigateBack({
fail: function () {
wx.switchTab({ url: '/pages/profile/profile' })
}
})
}
})
@@ -0,0 +1,4 @@
{
"navigationStyle": "custom",
"navigationBarTitleText": "光疗功效介绍"
}
@@ -0,0 +1,40 @@
<view class="page">
<view class="page-header page-header-gradient" style="padding-top: {{statusBarHeight + 24}}px;">
<view class="nav-back nav-back-light" bindtap="onBack"> {{i18n.common.back}}</view>
<view class="page-header-title">{{i18n.lightInfo.navTitle}}</view>
<view class="page-header-subtitle">{{i18n.lightInfo.headerSubtitle}}</view>
</view>
<view class="page-content">
<!-- 四种光 -->
<view class="section-title">{{i18n.lightInfo.lightsSectionTitle}}</view>
<view class="light-card" wx:for="{{lights}}" wx:key="key">
<view class="light-card-top">
<view class="swatch" style="background: {{item.color}};"></view>
<view class="light-head">
<view class="light-name">{{i18n.lightInfo.lights[item.key].name}}</view>
<view class="light-wave">{{i18n.lightInfo.lights[item.key].wavelength}}</view>
</view>
</view>
<view class="light-effect" style="color: {{item.color}};">{{i18n.lightInfo.lights[item.key].effect}}</view>
<view class="light-desc">{{i18n.lightInfo.lights[item.key].desc}}</view>
<view class="light-suits">
<text class="suits-label">{{i18n.lightInfo.suitsLabel}}</text>
<text class="suits-text">{{i18n.lightInfo.lights[item.key].suits}}</text>
</view>
</view>
<!-- 护理模式 -->
<view class="section-title section-title-gap">{{i18n.lightInfo.modesSectionTitle}}</view>
<view class="mode-grid">
<view class="mode-card" wx:for="{{i18n.lightInfo.modes}}" wx:for-item="mode" wx:key="name">
<view class="mode-dot" style="background: {{modeColors[index]}};"></view>
<view class="mode-name">{{mode.name}}</view>
<view class="mode-desc">{{mode.desc}}</view>
</view>
</view>
<!-- 免责声明 -->
<view class="disclaimer">{{i18n.lightInfo.disclaimer}}</view>
</view>
</view>
@@ -0,0 +1,125 @@
.section-title {
font-size: 30rpx;
font-weight: 600;
color: #333333;
margin-bottom: 24rpx;
}
.section-title-gap {
margin-top: 44rpx;
}
/* 光卡片 */
.light-card {
background: #ffffff;
border-radius: 24rpx;
padding: 32rpx;
margin-bottom: 24rpx;
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.04);
}
.light-card-top {
display: flex;
align-items: center;
gap: 24rpx;
margin-bottom: 20rpx;
}
.swatch {
width: 72rpx;
height: 72rpx;
border-radius: 50%;
flex-shrink: 0;
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.12);
}
.light-head {
display: flex;
flex-direction: column;
gap: 6rpx;
}
.light-name {
font-size: 32rpx;
font-weight: 600;
color: #333333;
}
.light-wave {
font-size: 24rpx;
color: #999999;
}
.light-effect {
font-size: 28rpx;
font-weight: 600;
margin-bottom: 12rpx;
}
.light-desc {
font-size: 26rpx;
color: #666666;
line-height: 1.6;
margin-bottom: 16rpx;
}
.light-suits {
font-size: 24rpx;
line-height: 1.5;
padding-top: 16rpx;
border-top: 2rpx solid #f2f2f2;
}
.suits-label {
color: #999999;
margin-right: 12rpx;
}
.suits-text {
color: #555555;
}
/* 护理模式 */
.mode-grid {
display: flex;
flex-wrap: wrap;
gap: 20rpx;
}
.mode-card {
width: calc(50% - 10rpx);
box-sizing: border-box;
background: #ffffff;
border-radius: 20rpx;
padding: 28rpx 24rpx;
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.04);
}
.mode-dot {
width: 40rpx;
height: 40rpx;
border-radius: 50%;
margin-bottom: 16rpx;
}
.mode-name {
font-size: 28rpx;
font-weight: 600;
color: #333333;
margin-bottom: 8rpx;
}
.mode-desc {
font-size: 24rpx;
color: #888888;
line-height: 1.5;
}
/* 免责声明 */
.disclaimer {
margin-top: 44rpx;
font-size: 22rpx;
color: #aaaaaa;
line-height: 1.6;
text-align: center;
}