feat: init project with miniprogram, cloud functions and admin console
这个提交包含在:
@@ -0,0 +1,39 @@
|
||||
var ble = require('../../services/ble')
|
||||
|
||||
Page({
|
||||
data: {
|
||||
checking: false,
|
||||
result: null,
|
||||
error: ''
|
||||
},
|
||||
|
||||
onShow: function () {
|
||||
this.checkWearing()
|
||||
},
|
||||
|
||||
checkWearing: function () {
|
||||
var self = this
|
||||
self.setData({ checking: true, result: null, error: '' })
|
||||
|
||||
ble.on('status', function (status) {
|
||||
self.setData({ checking: false })
|
||||
if (status.bind_status === 1) {
|
||||
self.setData({ result: 'ok' })
|
||||
} else {
|
||||
self.setData({ result: 'fail', error: '请确认设备已正确佩戴' })
|
||||
}
|
||||
})
|
||||
|
||||
ble.queryStatus().catch(function (err) {
|
||||
self.setData({ checking: false, result: 'fail', error: err.error_msg || '查询失败' })
|
||||
})
|
||||
},
|
||||
|
||||
onNext: function () {
|
||||
wx.navigateTo({ url: '/pages/treatment-setup/treatment-setup' })
|
||||
},
|
||||
|
||||
onRetry: function () {
|
||||
this.checkWearing()
|
||||
}
|
||||
})
|
||||
在新工单中引用
屏蔽一个用户