feat(i18n): 剩余15页全量接入中英(登录/注册/扫码/绑定/佩戴/扫描/治疗/订阅/帮助等)
- 3 个并行 agent 各管 5 页,互不重叠命名空间 - 全 App 18 页均 i18n.bind,22 命名空间/400 键中英对齐 - 动态文案(时长/天数/价格/区域)JS 内 i18n.t 计算;区域标签复用 common.regions
这个提交包含在:
@@ -1,5 +1,6 @@
|
||||
var ble = require('../../services/ble')
|
||||
var http = require('../../utils/request')
|
||||
var i18n = require('../../i18n/index')
|
||||
var app = getApp()
|
||||
var SCAN_TIMEOUT = 15000
|
||||
|
||||
@@ -12,6 +13,10 @@ Page({
|
||||
error: '',
|
||||
},
|
||||
|
||||
onShow: function () {
|
||||
i18n.bind(this)
|
||||
},
|
||||
|
||||
onBack: function () {
|
||||
wx.navigateBack({
|
||||
fail: function () {
|
||||
@@ -48,7 +53,7 @@ Page({
|
||||
|
||||
self._scanTimer = setTimeout(function () {
|
||||
ble.stopScan()
|
||||
self.setData({ state: 'error', error: '搜索超时,请确认设备已开机并在附近' })
|
||||
self.setData({ state: 'error', error: i18n.t('bleConnect.scanTimeout') })
|
||||
}, SCAN_TIMEOUT)
|
||||
|
||||
ble.startScan({
|
||||
@@ -64,7 +69,7 @@ Page({
|
||||
},
|
||||
onError: function (err) {
|
||||
clearTimeout(self._scanTimer)
|
||||
self.setData({ state: 'error', error: err.msg || '连接失败' })
|
||||
self.setData({ state: 'error', error: err.msg || i18n.t('bleConnect.failed') })
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -83,16 +88,16 @@ Page({
|
||||
url: '/pages/bind-success/bind-success?device_id=' + self.data.deviceId
|
||||
})
|
||||
}).catch(function (err) {
|
||||
self.setData({ state: 'error', error: err.message || '后台确认绑定失败' })
|
||||
self.setData({ state: 'error', error: err.message || i18n.t('bleConnect.confirmFailed') })
|
||||
})
|
||||
} else {
|
||||
self.setData({ state: 'error', error: '设备绑定失败' })
|
||||
self.setData({ state: 'error', error: i18n.t('bleConnect.bindFailed') })
|
||||
}
|
||||
}
|
||||
ble.on('bind_result', this._onBindResult)
|
||||
|
||||
ble.bindDevice(userId, self.data.bindToken).catch(function (err) {
|
||||
self.setData({ state: 'error', error: err.error_msg || '绑定命令失败' })
|
||||
self.setData({ state: 'error', error: err.error_msg || i18n.t('bleConnect.bindCmdFailed') })
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
@@ -1,31 +1,31 @@
|
||||
<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">{{state === 'scanning' ? '正在搜索设备...' : state === 'connecting' ? '正在连接设备...' : state === 'binding' ? '正在绑定...' : '连接失败'}}</view>
|
||||
<view class="nav-back" bindtap="onBack">‹ {{i18n.common.back}}</view>
|
||||
<view class="page-header-title">{{i18n.bleConnect.title}}</view>
|
||||
<view class="page-header-subtitle">{{state === 'scanning' ? i18n.bleConnect.searchingSub : state === 'connecting' ? i18n.bleConnect.connectingSub : state === 'binding' ? i18n.bleConnect.bindingSub : i18n.bleConnect.failedSub}}</view>
|
||||
</view>
|
||||
|
||||
<view class="page-content">
|
||||
<view class="info-tip">
|
||||
<text>📡</text>
|
||||
<text>请确保手机蓝牙已开启</text>
|
||||
<text>{{i18n.bleConnect.bluetoothTip}}</text>
|
||||
</view>
|
||||
|
||||
<view class="search-card" wx:if="{{state === 'scanning' || state === 'connecting'}}">
|
||||
<view class="search-icon pulsing">⏳</view>
|
||||
<view class="search-text">搜索中...</view>
|
||||
<view class="search-text">{{i18n.bleConnect.searching}}</view>
|
||||
</view>
|
||||
|
||||
<view class="found-card" wx:if="{{state === 'binding'}}">
|
||||
<view class="found-icon">💆</view>
|
||||
<view class="found-name">LumiFlow-{{deviceId}}</view>
|
||||
<text class="status-badge status-badge-green">正在配对...</text>
|
||||
<text class="status-badge status-badge-green">{{i18n.bleConnect.pairing}}</text>
|
||||
</view>
|
||||
|
||||
<view class="found-card" wx:if="{{state === 'error'}}">
|
||||
<view class="search-icon">⚠️</view>
|
||||
<view class="found-name">{{error || '连接失败'}}</view>
|
||||
<button class="retry-btn" bindtap="onRetry">重试</button>
|
||||
<view class="found-name">{{error || i18n.bleConnect.failed}}</view>
|
||||
<button class="retry-btn" bindtap="onRetry">{{i18n.common.retry}}</button>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
在新工单中引用
屏蔽一个用户