|
|
@ -53,7 +53,7 @@ export default { |
|
|
|
message: '初始化成功' |
|
|
|
} |
|
|
|
} |
|
|
|
that.webViewToH5(data) |
|
|
|
that.webViewToH5Bel(data) |
|
|
|
that.startBluetoothDevicesDiscovery() |
|
|
|
}, |
|
|
|
fail(res) { |
|
|
@ -66,7 +66,7 @@ export default { |
|
|
|
message: '初始化失败' |
|
|
|
} |
|
|
|
} |
|
|
|
that.webViewToH5(data) |
|
|
|
that.webViewToH5Bel(data) |
|
|
|
setTimeout(() => { |
|
|
|
that.openBluetoothAdapter() |
|
|
|
}, 5000) |
|
|
@ -85,7 +85,7 @@ export default { |
|
|
|
message: '设备搜索中' |
|
|
|
} |
|
|
|
} |
|
|
|
that.webViewToH5(data) |
|
|
|
that.webViewToH5Bel(data) |
|
|
|
uni.startBluetoothDevicesDiscovery({ |
|
|
|
success(res) { |
|
|
|
console.log(res) |
|
|
@ -123,7 +123,7 @@ export default { |
|
|
|
message: '已连接' |
|
|
|
} |
|
|
|
} |
|
|
|
that.webViewToH5(data) |
|
|
|
that.webViewToH5Bel(data) |
|
|
|
that.belStatus() |
|
|
|
}, |
|
|
|
fail: function(err) { |
|
|
@ -136,7 +136,7 @@ export default { |
|
|
|
message: '连接失败' |
|
|
|
} |
|
|
|
} |
|
|
|
that.webViewToH5(data) |
|
|
|
that.webViewToH5Bel(data) |
|
|
|
setTimeout(() => { |
|
|
|
that.openBluetoothAdapter() |
|
|
|
}, 5000) |
|
|
@ -167,7 +167,7 @@ export default { |
|
|
|
message: '连接失败' |
|
|
|
} |
|
|
|
} |
|
|
|
that.webViewToH5(data) |
|
|
|
that.webViewToH5Bel(data) |
|
|
|
} else { |
|
|
|
var data = { |
|
|
|
command: 'belConnectFeedback', |
|
|
@ -177,7 +177,7 @@ export default { |
|
|
|
message: '已连接' |
|
|
|
} |
|
|
|
} |
|
|
|
that.webViewToH5(data) |
|
|
|
that.webViewToH5Bel(data) |
|
|
|
} |
|
|
|
}, |
|
|
|
fail(err) { |
|
|
@ -212,7 +212,7 @@ export default { |
|
|
|
message: '发送内容成功' |
|
|
|
} |
|
|
|
} |
|
|
|
that.webViewToH5(data) |
|
|
|
that.webViewToH5Bel(data) |
|
|
|
}, |
|
|
|
fail: (err) => { |
|
|
|
console.error('发送内容失败', err) |
|
|
@ -224,7 +224,7 @@ export default { |
|
|
|
message: '发送内容失败' |
|
|
|
} |
|
|
|
} |
|
|
|
that.webViewToH5(data) |
|
|
|
that.webViewToH5Bel(data) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
@ -252,7 +252,7 @@ export default { |
|
|
|
} |
|
|
|
clearInterval(that.setInterTimeBEL) |
|
|
|
uni.stopBluetoothDevicesDiscovery(); |
|
|
|
that.webViewToH5(data) |
|
|
|
that.webViewToH5Bel(data) |
|
|
|
}, |
|
|
|
fail(err) { |
|
|
|
console.log('关闭蓝牙适配器失败: ', err); |
|
|
@ -260,10 +260,10 @@ export default { |
|
|
|
}); |
|
|
|
}, |
|
|
|
// uniapp 传参给 vue页面---刘灿测试
|
|
|
|
webViewToH5(res) { |
|
|
|
webViewToH5Bel(res) { |
|
|
|
let currentWebview = this.$scope.$getAppWebview(); |
|
|
|
let wv = currentWebview.children()[0]; |
|
|
|
console.log('uniapp 传参给 vue页面'); |
|
|
|
console.log('BEL-uniapp 传参给 vue页面'); |
|
|
|
wv.evalJS(`getVueMessage(${JSON.stringify(res)})`); |
|
|
|
}, |
|
|
|
} |
|
|
|