feat(i18n): 剩余15页全量接入中英(登录/注册/扫码/绑定/佩戴/扫描/治疗/订阅/帮助等)
- 3 个并行 agent 各管 5 页,互不重叠命名空间 - 全 App 18 页均 i18n.bind,22 命名空间/400 键中英对齐 - 动态文案(时长/天数/价格/区域)JS 内 i18n.t 计算;区域标签复用 common.regions
这个提交包含在:
@@ -1,6 +1,7 @@
|
||||
var ble = require('../../services/ble')
|
||||
var api = require('../../utils/api')
|
||||
var diagnosis = require('../../services/diagnosis')
|
||||
var i18n = require('../../i18n/index')
|
||||
var SCAN_TIMEOUT = 180000
|
||||
|
||||
Page({
|
||||
@@ -31,6 +32,10 @@ Page({
|
||||
})
|
||||
},
|
||||
|
||||
onShow: function () {
|
||||
i18n.bind(this)
|
||||
},
|
||||
|
||||
_cleanup: function () {
|
||||
if (this._timeoutTimer) { clearTimeout(this._timeoutTimer); this._timeoutTimer = null }
|
||||
if (this._onAdc) { ble.off('adc', this._onAdc); this._onAdc = null }
|
||||
@@ -42,7 +47,7 @@ Page({
|
||||
var self = this
|
||||
|
||||
if (!ble.isConnected()) {
|
||||
self.setData({ error: '设备未连接' })
|
||||
self.setData({ error: i18n.t('common.deviceNotConnected') })
|
||||
return
|
||||
}
|
||||
|
||||
@@ -90,7 +95,7 @@ Page({
|
||||
console.log('[SCAN] 未贴合,检测失败')
|
||||
self._completed = true
|
||||
self._cleanup()
|
||||
self.setData({ phase: 'ready', error: '面膜未佩戴好,请重新佩戴后再试' })
|
||||
self.setData({ phase: 'ready', error: i18n.t('autoScan.notWorn') })
|
||||
return
|
||||
}
|
||||
|
||||
@@ -129,7 +134,7 @@ Page({
|
||||
}).catch(function (err) {
|
||||
console.error('[SCAN] 检测命令发送失败:', err)
|
||||
self._cleanup()
|
||||
self.setData({ phase: 'ready', error: '检测命令发送失败' })
|
||||
self.setData({ phase: 'ready', error: i18n.t('autoScan.cmdFailed') })
|
||||
})
|
||||
|
||||
self._timeoutTimer = setTimeout(function () {
|
||||
@@ -140,7 +145,7 @@ Page({
|
||||
} else {
|
||||
self._completed = true
|
||||
self._cleanup()
|
||||
self.setData({ phase: 'ready', error: '检测超时,未收到数据,请重试' })
|
||||
self.setData({ phase: 'ready', error: i18n.t('autoScan.timeout') })
|
||||
}
|
||||
}, SCAN_TIMEOUT)
|
||||
},
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
<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 class="nav-back" bindtap="onBack">‹ {{i18n.common.back}}</view>
|
||||
<view class="page-header-title">{{i18n.autoScan.title}}</view>
|
||||
<view class="page-header-subtitle">{{phase === 'ready' ? i18n.autoScan.subReady : phase === 'waiting_fit' ? i18n.autoScan.subWaiting : phase === 'collecting' ? i18n.autoScan.subCollectingPre + frameCount + i18n.autoScan.subCollectingPost : i18n.autoScan.subDone}}</view>
|
||||
</view>
|
||||
|
||||
<view class="page-content">
|
||||
<!-- 待开始 -->
|
||||
<view wx:if="{{phase === 'ready'}}">
|
||||
<view class="scan-hint">设备已佩戴,点击下方按钮开始智能检测</view>
|
||||
<button class="btn-primary mt-30" bindtap="onStartScan">开始检测</button>
|
||||
<view class="scan-hint">{{i18n.autoScan.readyHint}}</view>
|
||||
<button class="btn-primary mt-30" bindtap="onStartScan">{{i18n.autoScan.startBtn}}</button>
|
||||
</view>
|
||||
|
||||
<!-- 等待贴合 -->
|
||||
@@ -19,7 +19,7 @@
|
||||
<view class="scan-line"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="scan-status">正在检测面膜贴合状态,请确保设备正确佩戴...</view>
|
||||
<view class="scan-status">{{i18n.autoScan.waitingStatus}}</view>
|
||||
</view>
|
||||
|
||||
<!-- 采集中 -->
|
||||
@@ -29,12 +29,12 @@
|
||||
<view class="scan-line"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="scan-status">已贴合,正在采集光谱数据... 已收到 {{frameCount}} 帧</view>
|
||||
<view class="scan-status">{{i18n.autoScan.collectingStatusPre}}{{frameCount}}{{i18n.autoScan.collectingStatusPost}}</view>
|
||||
</view>
|
||||
|
||||
<!-- 完成,自动跳转 -->
|
||||
<view wx:if="{{phase === 'done'}}">
|
||||
<view class="scan-status">检测完成(共 {{frameCount}} 帧),正在启动治疗...</view>
|
||||
<view class="scan-status">{{i18n.autoScan.doneStatusPre}}{{frameCount}}{{i18n.autoScan.doneStatusPost}}</view>
|
||||
</view>
|
||||
|
||||
<view class="scan-error" wx:if="{{error}}">{{error}}</view>
|
||||
|
||||
在新工单中引用
屏蔽一个用户