1
0
forked from dyf/APP

优化蓝牙搜索页面的动画闪烁感,优化从设备页面去匹配蓝牙时给出目标设备的提示

This commit is contained in:
liub
2025-10-13 10:57:03 +08:00
parent e3a2624509
commit 8689781e17
7 changed files with 233 additions and 171 deletions

View File

@ -86,7 +86,8 @@
"appkey_ios" : "065c43f02c7b627a74ad7dd23b16bb4f", "appkey_ios" : "065c43f02c7b627a74ad7dd23b16bb4f",
"appkey_android" : "d7d852dbda2b95f6f796fb9a711a9fee" "appkey_android" : "d7d852dbda2b95f6f796fb9a711a9fee"
} }
} },
"push" : {}
}, },
"icons" : { "icons" : {
"android" : { "android" : {

View File

@ -303,12 +303,12 @@
eventChannel.on('detailData', function(data) { eventChannel.on('detailData', function(data) {
console.log("收到父页面的参数:" + JSON.stringify(data)); // console.log("收到父页面的参数:" + JSON.stringify(data));
var device = data.data; var device = data.data;
these.device = device; these.device = device;
let f = ble.data.LinkedList.find((v) => { let f = ble.data.LinkedList.find((v) => {
if (v.macAddress == device.deviceMac) { if (v.macAddress == device.deviceMac) {
console.log("找到设备了", v); // console.log("找到设备了", v);
these.formData.deviceId = v.deviceId; these.formData.deviceId = v.deviceId;
return true; return true;
} }
@ -591,7 +591,7 @@
buttonBgColor: "#E03434", buttonBgColor: "#E03434",
buttonText: '去连接', buttonText: '去连接',
okCallback: function() { okCallback: function() {
console.log("1111");
uni.navigateTo({ uni.navigateTo({
url: "/pages/common/addBLE/addEquip", url: "/pages/common/addBLE/addEquip",
events: { events: {
@ -1157,7 +1157,7 @@
if (this.Status.Pop.clickEvt == 'SendUsr') { if (this.Status.Pop.clickEvt == 'SendUsr') {
} }
console.log("1111");
this.Status.Pop.showPop = false; this.Status.Pop.showPop = false;
if (this.Status.Pop.okCallback) { if (this.Status.Pop.okCallback) {
@ -1246,14 +1246,14 @@
these.setBleFormData(); these.setBleFormData();
// let json = { let json = {
// deviceId: these.device.id, deviceId: these.device.id,
// name: these.formData.company, name: these.formData.name,
// position: these.formData.name, position: these.formData.job,
// unitName: these.formData.job, unitName: these.formData.company,
// code: these.formData.id code: these.formData.id
// }; };
// usrApi.sendUsr(json) usrApi.sendUsr(json)
return; return;
} }

View File

@ -157,7 +157,7 @@
} }
}) })
let inteval = setInterval(this.initDevice, 5000); let inteval = setInterval(this.initDevice, 10000);
}, },
methods: { methods: {
@ -182,7 +182,7 @@
} }
}).then(res => { }).then(res => {
// console.log("获取设备信息", res); console.log("获取设备信息", res);
if (res && res.code == 200) { if (res && res.code == 200) {
let data = res.data; let data = res.data;
this.serverDevice=data; this.serverDevice=data;

View File

@ -51,6 +51,7 @@
<view class="list searchList"> <view class="list searchList">
<view class="item" v-on:click="Link(item,index)" v-for="item, index in EquipMents" <view class="item" v-on:click="Link(item,index)" v-for="item, index in EquipMents"
v-show="!item['linkStatu']"> v-show="!item['linkStatu']">
<view class="before" v-if="item.isTarget"></view>
<view class="leftImg "> <view class="leftImg ">
<image src="/static/images/BLEAdd/bluetooth.png" class="titleIco" mode="heightFix"> <image src="/static/images/BLEAdd/bluetooth.png" class="titleIco" mode="heightFix">
</image> </image>
@ -60,7 +61,8 @@
<text>{{item.name?item.name:'Unnamed'}}</text> <text>{{item.name?item.name:'Unnamed'}}</text>
</view> </view>
<view class="id" >
<view class="id">
<text>信号强度:{{110+item.RSSI>100?100:110+item.RSSI}}%</text> <text>信号强度:{{110+item.RSSI>100?100:110+item.RSSI}}%</text>
</view> </view>
</view> </view>
@ -162,39 +164,55 @@
ble.removeDeviceFound(pagePath); ble.removeDeviceFound(pagePath);
ble.removeReceiveCallback(pagePath); ble.removeReceiveCallback(pagePath);
}, },
onLoad() { onLoad(option) {
let search = option.search;
these = this; these = this;
ble = bleTool.getBleTool(); eventChannel = this.getOpenerEventChannel();
//已连接过但删除了设备 // this.EquipMents = [{
// let delArr = ble.data.deletedEqs.map(v => { // "RSSI": -55,
// return { // "advertisData": "",
// "deviceId": v.deviceId, // "advertisServiceUUIDs": [
// "name": v.name, // "0000FFE0-0000-1000-8000-00805F9B34FB"
// "RSSI": -99, // ],
// "localName": v.name, // "deviceId": "EBDA4E6F-3A28-FF65-A845-AE8CC7B78375",
// "name": "HBY670-BF74EA",
// "linkStatu": false
// },
// {
// "RSSI": -61,
// "advertisData": "",
// "advertisServiceUUIDs": [
// "0000FFE0-0000-1000-8000-00805F9B34FB"
// ],
// "deviceId": "469FB381-B47E-1E40-8073-EF50B5704AAB",
// "name": "EF4651",
// "linkStatu": false,
// "isTarget": true
// },
// {
// "RSSI": -69,
// "advertisData": "",
// "advertisServiceUUIDs": [
// "0000FFE0-0000-1000-8000-00805F9B34FB"
// ],
// "deviceId": "4F0DAC91-4391-CB07-905E-72D7F03EFCD3",
// "name": "4877-BF743D",
// "linkStatu": false
// } // }
// }); // ];
// //已连接过但没绑定过的设备
// let noDev = ble.data.LinkedList.filter(v => {
// return !(v.device && v.device.id); let StartSubsrib = () => {
// }).map(v => { these.EquipMents=[];
// return { ble = bleTool.getBleTool();
// "deviceId": v.deviceId,
// "name": v.name,
// "RSSI": -99,
// "localName": v.name,
// }
// });
// delArr = delArr.concat(noDev);
// console.log("可能搜不到的设备=", delArr);
this.EquipMents = []; //delArr;
ble.addDeviceFound((arr) => { ble.addDeviceFound((arr) => {
arr = arr.devices; arr = arr.devices;
for (var i = 0; i < arr.length; i++) { for (var i = 0; i < arr.length; i++) {
arr[i].linkStatu = false; arr[i].linkStatu = false;
@ -204,8 +222,9 @@
let f = these.EquipMents.find((v, index) => { let f = these.EquipMents.find((v, index) => {
if (v.deviceId == arr[i].deviceId) { if (v.deviceId == arr[i].deviceId) {
// v.RSSI=arr[i].RSSI;//同一设备上报更新信号强度
these.$set(these.EquipMents[index], 'RSSI', arr[i].RSSI); these.$set(these.EquipMents[index], 'RSSI', arr[i].RSSI);
return true; return true;
} }
return false; return false;
@ -213,15 +232,21 @@
if (!f) { if (!f) {
console.log("发现新设备,", arr[i]); console.log("发现新设备,", arr[i]);
arr[i].name=arr[i].name.replace('JQZM-','');
these.EquipMents.push(arr[i]);
} else {
if (these.device && these.device.bluetoothName) {
if (these.device.bluetoothName === arr[i].name || arr[i].name.indexOf(these
.device.bluetoothName) > -1 || these.device.bluetoothName.indexOf(arr[
i].name) > -1) {
arr[i].isTarget = true;
} }
} }
// console.log("equip=", these.EquipMents) arr[i].name = arr[i].name.replace('JQZM-', '');
these.EquipMents.push(arr[i]);
}
}
console.log("EquipMents=", these.EquipMents)
}, pagePath); }, pagePath);
// console.log("addEquip")
ble.addReceiveCallback((receivData, f, path, arr) => { ble.addReceiveCallback((receivData, f, path, arr) => {
if (f.macAddress && these.device) { if (f.macAddress && these.device) {
clearInterval(this.Status.intval); clearInterval(this.Status.intval);
@ -239,45 +264,49 @@
}, pagePath); }, pagePath);
eventChannel = this.getOpenerEventChannel();
}
if (search) {
StartSubsrib();
}
eventChannel.on('detailData', function(rec) { eventChannel.on('detailData', function(rec) {
console.log("接收到父页面的参数:", rec); console.log("接收到父页面的参数:", rec);
these.device = rec.data; these.device = rec.data;
StartSubsrib();
these.refreshBleList();
}); });
}, },
onShow: function() { onShow: function() {
this.refreshBleList();
// this.EquipMents = [];
// this.PairEquip = [];
ble && ble.StartSearch().then(res => {
console.log("开始搜索成功", res);
}).catch((ex) => {
console.log("开始搜索出现异常", ex);
if (ex.code == 10001) {
these.showOpenSetting();
}
});
}, },
methods: { methods: {
refreshBleList() { refreshBleList() {
if (!ble) { if (!ble) {
return; return;
} }
console.log("111111");
ble.StopSearch().then(res => { ble.StopSearch().then(res => {
console.log("停止搜索成功"); // console.log("停止搜索成功");
this.EquipMents = []; this.EquipMents = [];
ble.StartSearch().then(result => { ble.StartSearch().then(result => {
console.log("开始搜索成功"); // console.log("开始搜索成功");
}).catch(err => { }).catch(err => {
console.log("err=", err); console.error("开始搜索失败,err=", err);
if(err.code===10001){
these.showOpenSetting();
}else{
uni.showModal({
title:'提示',
content:'出现异常:'+err.msg
});
}
}); });
}).catch(ex => { }).catch(ex => {
console.log("ex=", ex); console.error("ex=", ex);
}); });
}, },
isItemLink: function(item, index) { isItemLink: function(item, index) {
@ -339,7 +368,6 @@
updateLoading(these, { updateLoading(these, {
text: "设备Mac地址错误,请重选设备连接" text: "设备Mac地址错误,请重选设备连接"
}); });
setTimeout(() => { setTimeout(() => {
hideLoading(these); hideLoading(these);
}, 1000) }, 1000)
@ -465,6 +493,7 @@
} }
execLink().then((res) => { execLink().then((res) => {
console.log("res=", res);
linkCallback(res); linkCallback(res);
}).catch(ex => { }).catch(ex => {
console.log("ex=", ex) console.log("ex=", ex)
@ -575,7 +604,8 @@
animation: expand 4s infinite ease-out; animation: expand 4s infinite ease-out;
display: inline-block; display: inline-block;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
border:1rpx solid #bbe6003d; border: 1rpx solid #bbe6003d;
animation: expand 5s infinite ease-in-out;
} }
.circle:nth-child(2) { .circle:nth-child(2) {
@ -591,16 +621,17 @@
width: 0; width: 0;
height: 0; height: 0;
opacity: 0.8; opacity: 0.8;
} }
80% {
100% {
width: 18.75rem; width: 18.75rem;
height: 18.75rem; height: 18.75rem;
opacity: 0.2; opacity: 0.2;
}
100% {
width: 0.5rem;
height: 0.5rem;
opacity: 0.5;
} }
} }
@ -659,7 +690,9 @@
flex-wrap: nowrap; flex-wrap: nowrap;
justify-content: flex-start; justify-content: flex-start;
align-items: center; align-items: center;
margin-top: 10rpx; margin-top: 20rpx;
position: relative;
overflow: hidden;
} }
.list .item .leftImg { .list .item .leftImg {
@ -680,6 +713,33 @@
} }
.list .item .before {
position: absolute;
bottom: 0px;
right: 0px;
content: "";
width: 0;
height: 0;
border-right: 30rpx solid #bbe600d4;
border-top: 30rpx solid transparent;
animation-delay: 1s;
animation: fade 1.5s infinite ease-in-out;
}
@keyframes fade {
0% {
opacity: 0.3;
}
50% {
opacity: 1;
}
100% {
opacity: 0.3;
}
}
.list .item .rightIco { .list .item .rightIco {
width: 40rpx; width: 40rpx;
height: 100%; height: 100%;
@ -695,7 +755,7 @@
.list .item .leftImg .titleIco { .list .item .leftImg .titleIco {
width: 100%; width: 100%;
height: 100%; height: 100%;
filter:invert(100%); filter: invert(100%);
} }
.list .item .name { .list .item .name {

View File

@ -416,7 +416,7 @@
break; break;
case 'bluetooth': case 'bluetooth':
uni.navigateTo({ uni.navigateTo({
url: "/pages/common/addBLE/addEquip" url: "/pages/common/addBLE/addEquip?search=all"
}) })
break; break;
} }

View File

@ -65,7 +65,7 @@
deviceMac: '', deviceMac: '',
communicationMode: '0', //0是4g,1是蓝牙 communicationMode: '0', //0是4g,1是蓝牙
}) })
console.log(this.deviceId, 'deerer ere'); console.log(this.deviceId, res);
if (res.code == 200) { if (res.code == 200) {
this.isConnectNo = false this.isConnectNo = false

View File

@ -31,7 +31,7 @@ class BleHelper {
linkedDevices = uni.getStorageSync(key); linkedDevices = uni.getStorageSync(key);
} }
if (linkedDevices && linkedDevices.length && linkedDevices.length > 0) { if (linkedDevices && linkedDevices.length && linkedDevices.length > 0) {
console.log("111111", linkedDevices); // console.log("111111", linkedDevices);
linkedDevices = linkedDevices.filter((v) => { linkedDevices = linkedDevices.filter((v) => {
v.Linked = false; v.Linked = false;
v.notifyState = false; v.notifyState = false;
@ -138,9 +138,9 @@ class BleHelper {
for (var i = 0; i < this.data.LinkedList.length; i++) { for (var i = 0; i < this.data.LinkedList.length; i++) {
let item = this.data.LinkedList[i]; let item = this.data.LinkedList[i];
if (bleId) { if (bleId && item.device) {
if (item.device.id == bleId) { if (item.device.id == bleId) {
console.log("找到要删除的设备", item); // console.log("找到要删除的设备", item);
this.data.LinkedList.splice(i, 1); this.data.LinkedList.splice(i, 1);
this.disconnectDevice(item.deviceId); this.disconnectDevice(item.deviceId);
flag = true; flag = true;
@ -152,7 +152,7 @@ class BleHelper {
} else { } else {
if (deviceId && item.deviceId == deviceId) { if (deviceId && item.deviceId == deviceId) {
console.log("找到要删除的设备1,", item) // console.log("找到要删除的设备1,", item)
this.data.LinkedList.splice(i, 1); this.data.LinkedList.splice(i, 1);
this.disconnectDevice(item.deviceId); this.disconnectDevice(item.deviceId);
flag = true; flag = true;
@ -201,7 +201,7 @@ class BleHelper {
this.updateCache(); this.updateCache();
} }
} else { } else {
console.log("蓝牙未连接过任何设备"); // console.log("蓝牙未连接过任何设备");
this.updateCache(); this.updateCache();
} }
} }
@ -407,7 +407,7 @@ class BleHelper {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (this.data.available) { if (this.data.available) {
console.log("蓝牙模块是可用状态"); // console.log("蓝牙模块是可用状态");
resolve({ resolve({
available: this.data.available, available: this.data.available,
discovering: this.data.discovering discovering: this.data.discovering
@ -415,7 +415,7 @@ class BleHelper {
return; return;
} }
if (!this.data.isOpenBlue) { if (!this.data.isOpenBlue) {
console.log("蓝牙模块未打开"); console.error("蓝牙模块未打开");
resolve({ resolve({
available: false, available: false,
discovering: false discovering: false
@ -424,13 +424,13 @@ class BleHelper {
} }
uni.getBluetoothAdapterState({ uni.getBluetoothAdapterState({
success: (info) => { success: (info) => {
console.log("蓝牙状态获取成功,", info) // console.log("蓝牙状态获取成功,", info)
this.data.available = info.available; this.data.available = info.available;
this.data.discovering = info.discovering; this.data.discovering = info.discovering;
resolve(info); resolve(info);
}, },
fail: (ex1) => { fail: (ex1) => {
console.log("蓝牙状态获取失败", ex1); console.error("蓝牙状态获取失败", ex1);
let res1 = { let res1 = {
available: false, available: false,
discovering: false discovering: false
@ -446,14 +446,14 @@ class BleHelper {
var init = () => { var init = () => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (this.data.isOpenBlue) { if (this.data.isOpenBlue) {
console.log("蓝牙状态已可用,提前返回"); // console.log("蓝牙状态已可用,提前返回");
resolve(false); resolve(false);
return; return;
} }
uni.openBluetoothAdapter({ uni.openBluetoothAdapter({
success: (args) => { success: (args) => {
console.log("蓝牙初始化成功:" + JSON.stringify(args)); // console.log("蓝牙初始化成功:" + JSON.stringify(args));
this.data.isOpenBlue = true; this.data.isOpenBlue = true;
this.data.available = true; this.data.available = true;
resolve(true); resolve(true);
@ -471,7 +471,7 @@ class BleHelper {
} }
uni.onBluetoothAdapterStateChange((state) => { uni.onBluetoothAdapterStateChange((state) => {
// console.log('蓝牙状态发生变化:' + JSON.stringify(state)); console.log('蓝牙状态发生变化:' + JSON.stringify(state));
if (this.data.available !== state.available) { if (this.data.available !== state.available) {
this.data.available = state.available; this.data.available = state.available;
this.data.discovering = state.discovering; this.data.discovering = state.discovering;
@ -678,7 +678,7 @@ class BleHelper {
}, },
fail: (ex2) => { fail: (ex2) => {
console.log("蓝牙模块启动失败", ex2); console.error("蓝牙模块启动失败", ex2);
reject(this.getError(ex2)); reject(this.getError(ex2));
} }
}); });
@ -692,7 +692,7 @@ class BleHelper {
} }
this.CheckBlue().then((res) => { this.CheckBlue().then((res) => {
console.log("res=", res) // console.log("res=", res)
return init(); return init();
}).then(resolve).catch((ex) => { }).then(resolve).catch((ex) => {
console.error("异常:", ex); console.error("异常:", ex);
@ -716,10 +716,11 @@ class BleHelper {
uni.closeBluetoothAdapter({ uni.closeBluetoothAdapter({
success: () => { success: () => {
console.log("蓝牙模块已关闭"); // console.log("蓝牙模块已关闭");
this.data.isOpenBlue = false; this.data.isOpenBlue = false;
}, },
fail: (ex) => { fail: (ex) => {
console.error('无法关闭蓝牙模块:',ex);
ex = this.getError(ex); ex = this.getError(ex);
////console.log(msg); ////console.log(msg);
}, },
@ -755,7 +756,7 @@ class BleHelper {
}, },
fail: (err) => { fail: (err) => {
console.log(`搜索蓝牙设备失败:`, err); console.error(`搜索蓝牙设备失败:`, err);
reject(this.getError(err)); reject(this.getError(err));
} }
@ -797,11 +798,11 @@ class BleHelper {
let p1= new Promise((resolve, reject) => { let p1= new Promise((resolve, reject) => {
uni.stopBluetoothDevicesDiscovery({ uni.stopBluetoothDevicesDiscovery({
success: (res) => { success: (res) => {
console.log("停止搜索蓝牙设备成功"); // console.log("停止搜索蓝牙设备成功");
resolve(); resolve();
}, },
fail: (ex) => { fail: (ex) => {
console.log("无法停止蓝牙搜索"); console.error("无法停止蓝牙搜索");
reject(this.getError(ex)); reject(this.getError(ex));
} }
@ -856,7 +857,7 @@ class BleHelper {
//订阅消息 //订阅消息
subScribe(deviceId, state) { subScribe(deviceId, state) {
console.log("开始订阅消息", state); // console.log("开始订阅消息", state);
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
setTimeout(() => { setTimeout(() => {
@ -898,9 +899,9 @@ class BleHelper {
state: state, state: state,
success: (res) => { success: (res) => {
if (state) { if (state) {
console.log("订阅消息成功", res); // console.log("订阅消息成功", res);
} else { } else {
console.log("取消订阅成功", res); // console.log("取消订阅成功", res);
} }
this.data.LinkedList.find((v) => { this.data.LinkedList.find((v) => {
@ -960,8 +961,8 @@ class BleHelper {
} }
} }
} else { } else {
console.log("c=", c); // console.log("c=", c);
console.log("serv=", serv); // console.log("serv=", serv);
reject({ reject({
code: 403, code: 403,
msg: "出现错误,找不到任何通知特征" msg: "出现错误,找不到任何通知特征"
@ -991,7 +992,7 @@ class BleHelper {
// console.log("finally") // console.log("finally")
}); });
} else { } else {
console.log("没有特征需要订阅"); console.error("没有特征需要订阅");
resolve(); resolve();
} }
@ -1016,7 +1017,7 @@ class BleHelper {
deviceId: id, deviceId: id,
success: (res) => { success: (res) => {
if (res.services && res.services.length > 0) { if (res.services && res.services.length > 0) {
console.log("获取到服务:" + JSON.stringify(res)); // console.log("获取到服务:" + JSON.stringify(res));
this.data.LinkedList.find((v) => { this.data.LinkedList.find((v) => {
if (v.deviceId == id) { if (v.deviceId == id) {
@ -1041,7 +1042,7 @@ class BleHelper {
}); });
if (se) { if (se) {
console.log("合作供应商的", s) // console.log("合作供应商的", s)
this.data.LinkedList.find((v) => { this.data.LinkedList.find((v) => {
if (v.deviceId == id) { if (v.deviceId == id) {
v.writeServiceId = s.serviceId; v.writeServiceId = s.serviceId;
@ -1060,7 +1061,7 @@ class BleHelper {
} else { } else {
console.log("预设的蓝牙服务和特征中找不到"); console.error("预设的蓝牙服务和特征中找不到");
for (var i = 0; i < res.services.length; i++) { for (var i = 0; i < res.services.length; i++) {
let service = res.services[i]; let service = res.services[i];
promises.push(this.getFeatrus(id, service.uuid, promises.push(this.getFeatrus(id, service.uuid,
@ -1070,7 +1071,7 @@ class BleHelper {
if (promises.length == 0) { if (promises.length == 0) {
console.log("未找到主服务"); console.error("未找到主服务");
reject({ reject({
msg: "未找到主服务", msg: "未找到主服务",
code: -1 code: -1
@ -1089,8 +1090,8 @@ class BleHelper {
}) })
.then((res) => { .then((res) => {
console.log('设备连接成功,初始化完成', this.data // console.log('设备连接成功,初始化完成', this.data
.LinkedList); // .LinkedList);
resolve(); resolve();
}) })
@ -1138,7 +1139,7 @@ class BleHelper {
serviceId: serviceId, serviceId: serviceId,
success: (res) => { success: (res) => {
console.log("获取到特征:" + JSON.stringify(res)); // console.log("获取到特征:" + JSON.stringify(res));
// res.characteristics.forEach((v) => { // res.characteristics.forEach((v) => {
// v.serviceId = serviceId; // v.serviceId = serviceId;
// }); // });
@ -1277,12 +1278,12 @@ class BleHelper {
return; return;
} }
console.log("正在连接" + deviceId); // console.log("正在连接" + deviceId);
uni.createBLEConnection({ uni.createBLEConnection({
deviceId: deviceId, deviceId: deviceId,
timeout: 30000, timeout: 30000,
success: (info) => { success: (info) => {
console.log("新连接成功", this.data.LinkedList); // console.log("新连接成功", this.data.LinkedList);
this.getLinkBlue().then((arr) => { this.getLinkBlue().then((arr) => {
let cr = arr.devices.find(c => { let cr = arr.devices.find(c => {
if (c.deviceId == deviceId) { if (c.deviceId == deviceId) {
@ -1299,8 +1300,8 @@ class BleHelper {
} }
this.updateCache(); this.updateCache();
console.log("LinkedList=", this.data // console.log("LinkedList=", this.data
.LinkedList); // .LinkedList);
// 处理 MTU 设置 // 处理 MTU 设置
if (plus.os.name === 'Android') { if (plus.os.name === 'Android') {
@ -1312,7 +1313,7 @@ class BleHelper {
resolve(true); resolve(true);
}, },
fail: () => { fail: () => {
console.log("mtu设置失败"); console.error("mtu设置失败");
resolve( resolve(
true true
); // MTU设置失败不影响连接成功 ); // MTU设置失败不影响连接成功
@ -1327,7 +1328,7 @@ class BleHelper {
}, },
fail: (ex) => { fail: (ex) => {
ex = this.getError(ex); ex = this.getError(ex);
console.log("蓝牙" + deviceId + "连接失败" + JSON.stringify(ex)); console.error("蓝牙" + deviceId + "连接失败" + JSON.stringify(ex));
// 连接超时后自动重试 // 连接超时后自动重试
if (ex.code === 10012 && retryCount < maxRetries) { if (ex.code === 10012 && retryCount < maxRetries) {
@ -1517,7 +1518,7 @@ class BleHelper {
}, },
fail: (ex) => { fail: (ex) => {
ex = this.getError(ex); ex = this.getError(ex);
console.log("发送数据失败", ex); console.error("发送数据失败", ex);
err(ex); err(ex);
} }