蓝牙模块添加在web平台默认成功方便调试功能,4877功能完成

This commit is contained in:
liub
2025-10-27 10:52:17 +08:00
parent d37ccfeabc
commit 61ed91695f
13 changed files with 575 additions and 318 deletions

View File

@ -357,7 +357,7 @@
these.formData.img = device.devicePic;
these.formData.id = device.id;
these.formData.deviceId = f.deviceId;
these.formData.bleStatu=false;
these.formData.bleStatu = false;
ble.LinkBlue(f.deviceId, f.writeServiceId, f.wirteCharactId, f.notifyCharactId).then(res => {
these.formData.bleStatu = true;
});
@ -515,11 +515,14 @@
return f;
},
bleValueNotify: function(receive, device, path,recArr) {
bleValueNotify: function(receive, device, path, recArr) {
if (receive.deviceId !== this.formData.deviceId) {
return;
}
if (this.Status.pageHide) {
return;
}
let json = recei.ReceiveData(receive, device, path,recArr);
let json = recei.ReceiveData(receive, device, path, recArr);
if (!json) {
return;
}
@ -572,6 +575,7 @@
borderColor: "#e034344d",
buttonBgColor: "#E03434",
buttonText: '去连接',
buttonTextColor: '#232323de',
okCallback: function() {
// console.log("1111");
uni.navigateTo({
@ -1028,39 +1032,52 @@
this.Status.Pop.showPop = false;
},
showPop: function(option) {
hideLoading(this);
let defaultCfg = {
showHeader: false,
headerTxt: "",
showHeader: false,
showCancel: false,
borderColor: '#BBE600',
buttonBgColor: '#BBE600',
okCallback: null,
cancelCallback: null,
let def = {
showPop: true, //是否显示弹窗
popType: 'custom',
bgColor: '#383934bd',
borderColor: '#BBE600',
textColor: '#ffffffde',
buttonBgColor: '#BBE600',
buttonTextColor: '#232323DE',
iconUrl: '',
message: '',
buttonText: '确定',
clickEvt: ''
};
if (!option) {
clickEvt: '',
visiblePrompt: false,
promptTitle: '',
modelValue: '',
visibleClose: false,
okCallback: null,
showSlot: false,
buttonCancelText: '',
showCancel: false,
}
}
let keys = Object.keys(option);
for (var i = 0; i < keys.length; i++) {
let key = keys[i];
this.Status.Pop[key] = option[key];
}
keys = Object.keys(defaultCfg);
for (var i = 0; i < keys.length; i++) {
let keys = Object.keys(def);
for (let i = 0; i < keys.length; i++) {
let key = keys[i];
if (key in option) {
continue;
}
this.Status.Pop[key] = defaultCfg[key];
this.Status.Pop[key] = def[key];
}
if (option) {
keys = Object.keys(option);
for (let i = 0; i < keys.length; i++) {
let key = keys[i];
this.Status.Pop[key] = option[key];
}
}
this.Status.Pop.showPop = true;
if (!option.borderColor) {
option.borderColor = '#BBE600';
option.buttonBgColor = '#BBE600';
}
these.Status.Pop.showPop = true;
},
sendUsr() {
let f = this.getDevice();