fix: resolve multiple miniprogram bugs and extend admin console

- fix manual bind stuck at BLE scan, redirect to bind-success
- add 15s timeout and stopScan to ble-connect
- add stopScan method to ble.js
- add back-to-home button on bind-success page
- fix field name in subscribe-plans (plan -> plan_type)
- fix history.js to handle created_at field
- fix index.js to handle device name field
- add subscription route alias in request.js
- extend admin cloud function from 1 to 9 actions
- add mock mode to admin-console request.js
- remove unused discover page and legacy record function

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
这个提交包含在:
Guoguo
2026-04-24 23:28:53 +08:00
共同撰写人 Claude Opus 4.6
父节点 52cb1f72dc
当前提交 267c75718b
修改 18 个文件,包含 332 行新增169 行删除
+12 -6
查看文件
@@ -47,16 +47,22 @@ Page({
bindDevice: function (deviceId) {
var self = this
self.setData({ scanning: true, error: '' })
http.post('/api/v1/device/bind', { device_id: deviceId }).then(function (data) {
self.setData({ scanning: false })
wx.navigateTo({
url: '/pages/ble-connect/ble-connect?device_id=' + deviceId + '&bind_token=' + data.bind_token
wx.redirectTo({
url: '/pages/bind-success/bind-success?device_id=' + deviceId
})
}).catch(function (err) {
self.setData({
scanning: false,
error: err.message || '绑定失败'
})
self.setData({ scanning: false })
if (err && err.code === 2001) {
wx.showToast({ title: '已绑定设备', icon: 'none' })
setTimeout(function () {
wx.navigateBack()
}, 1500)
} else {
self.setData({ error: err.message || '绑定失败' })
}
})
},