|
@@ -29,8 +29,8 @@ export default {
|
|
|
characteristicId: Cid,
|
|
|
value: buffer,
|
|
|
success: function (res) {
|
|
|
- console.log('开启脑电数据包成功')
|
|
|
- console.log(res)
|
|
|
+ // console.log('开启脑电数据包成功')
|
|
|
+ // console.log(res)
|
|
|
},
|
|
|
fail: function (err) {
|
|
|
console.log('开启脑电数据包失败')
|
|
@@ -65,9 +65,9 @@ export default {
|
|
|
characteristicId: Cid,
|
|
|
value: buffer,
|
|
|
success: function (res) {
|
|
|
- console.log('开启教具脑控成功')
|
|
|
+ // console.log('开启教具脑控成功')
|
|
|
// that.sendOpen()
|
|
|
- console.log(res)
|
|
|
+ // console.log(res)
|
|
|
},
|
|
|
fail: function (err) {
|
|
|
console.log('开启教具脑控失败')
|
|
@@ -474,26 +474,20 @@ export default {
|
|
|
//监听玩具得状态
|
|
|
watching_toy($this, deviceId, serviceId, Cid, Toast) {
|
|
|
Toast.loading({
|
|
|
- duration: 0,
|
|
|
forbidClick: false,
|
|
|
message: "正在创建连接"
|
|
|
})
|
|
|
let that = this
|
|
|
let $count = 0
|
|
|
- setTimeout(() => {
|
|
|
- Toast.clear()
|
|
|
- }, 5000)
|
|
|
//关闭核销选项窗口
|
|
|
// $this.pay_window = false
|
|
|
wx.onBLECharacteristicValueChange((characteristic) => {
|
|
|
try {
|
|
|
let hexStr = that.ab2hex(characteristic.value)
|
|
|
- console.log("收到" + hexStr);
|
|
|
//连接玩具
|
|
|
let $flag = that.connect_toy(hexStr, deviceId, serviceId, Cid, Toast)
|
|
|
//连接不上设备
|
|
|
if ($flag) {
|
|
|
- Toast.clear()
|
|
|
//连接成功 打开核销窗口
|
|
|
// $this.pay_window = true
|
|
|
$this.change_toy_connect_status(2)
|
|
@@ -506,7 +500,6 @@ export default {
|
|
|
} else {
|
|
|
$count++
|
|
|
if ($count == 10) {
|
|
|
- Toast.clear()
|
|
|
$this.change_toy_connect_status(3)
|
|
|
wx.offBLECharacteristicValueChange()
|
|
|
that.watchingDevice($this)
|