diff --git a/components/global-loading/global-loading.vue b/components/global-loading/global-loading.vue
index 0848bec..2a73aab 100644
--- a/components/global-loading/global-loading.vue
+++ b/components/global-loading/global-loading.vue
@@ -100,6 +100,7 @@
if (options.dotColors) {
this.colorIndex = 0
}
+ this.visible = true;
},
// 阻止触摸移动事件
diff --git a/manifest.json b/manifest.json
index 9058167..e142c32 100644
--- a/manifest.json
+++ b/manifest.json
@@ -24,7 +24,8 @@
"Geolocation" : {},
"Maps" : {},
"Record" : {},
- "VideoPlayer" : {}
+ "VideoPlayer" : {},
+ "Push" : {}
},
/* 应用发布信息 */
"distribute" : {
diff --git a/pages/102/HBY102.vue b/pages/102/HBY102.vue
index c11daab..6b0816d 100644
--- a/pages/102/HBY102.vue
+++ b/pages/102/HBY102.vue
@@ -48,8 +48,9 @@
闯入报警!
-
+
{{getWarDevice(formData.sta_sosadd)}}
+
@@ -171,10 +172,9 @@
hideLoading,
updateLoading
} from '@/utils/loading.js'
- import {
- request,
+ import request, {
baseURL
- } from '../../utils/request';
+ } from '@/utils/request.js'
import Common from '@/utils/Common.js'
const pagePath = "/pages/102/HBY102";
@@ -432,6 +432,7 @@
},
methods: {
+
actionSett(item, index) {
if (item.group == 'sta_LedType') {
this.sosSetting(item, index);
@@ -736,20 +737,7 @@
urls: [img]
})
},
- getWarDevice(macStr){//获取正在报警的设备名
- let f = this.groupDevices.find(v => {
- return v.deviceMac === macStr;
- });
- if (f) {
- return f.deviceName;
- }
-
- if(macStr == this.device.deviceMac) {
- return this.device.deviceName;
- }
-
- return '';
- },
+
bleValueNotify(receive, device, path, recArr) { //订阅消息
if (receive.deviceId !== this.formData.deviceId) {
return;
@@ -770,14 +758,21 @@
this.formData[key] = json[key];
}
});
+
let msg = [];
if (this.formData.sta_PowerPercent <= 20) {
msg.push("设备电量低");
}
-
+ if (json.sta_sosadd_off == this.formData.sta_sosadd) {
+ this.formData.sta_sosadd = "";
+ let name=this.getWarDevice(json.sta_sosadd_off);
+ msg.push('"' + name + '"取消报警');
+ }
if (this.formData.sta_sosadd !== "") {
+ console.log("查询设备中");
this.searchDevice(this.formData.sta_sosadd).catch(ex => {}).then(dev => {
+ console.log("dev=", dev);
if (dev) {
msg.push('"' + dev.deviceName + '"闯入报警中');
} else {
@@ -798,9 +793,9 @@
// this.formData.sta_IntrusTime=instrusionTime;
// }, 1000);
} else {
- clearInterval(instrusionTime);
- instrusionTime = 0;
- this.formData.sta_IntrusTime = 0;
+ // clearInterval(instrusionTime);
+ // instrusionTime = 0;
+ // this.formData.sta_IntrusTime = 0;
}
if (msg.length > 0) {
this.showMsg(msg.join(','));
@@ -808,6 +803,26 @@
},
+
+ getWarDevice(macStr) {
+ if (macStr) {
+
+ if (!macStr.includes(':')) {
+ macStr = macStr.replace(/(.{2})/g, '$1:').slice(0, -1)
+ }
+
+ let f = this.groupDevices.find(v => {
+ return v.deviceMac === macStr;
+ });
+
+ if (f) {
+ return f.deviceName;
+ }
+ }
+
+ return "";
+ },
+
searchDevice(macStr) {
return new Promise((resolve, reject) => {
if (macStr.includes(':')) {
@@ -819,45 +834,59 @@
let f = this.groupDevices.find(v => {
return v.deviceMac === macStr;
});
+ console.log("111111111");
if (f) {
+ console.log("找到设备", f);
resolve(f);
return;
}
-
+ console.log("111111111");
if (macStr == this.device.deviceMac) {
+ console.log("当前设备", this.device);
resolve(this.device);
return;
}
+ console.log("111111111");
+ try {
- request({
- url: '/app/device/getDeviceInfoByDeviceMac',
- method: 'GET',
- data: {
- deviceMac: these.device.macAddress
- }
- }).then(res => {
- console.log("获取设备信息", res);
- if (res && res.code == 200) {
- console.log("res=", res);
- let data = res.data;
- if (data) {
- this.groupDevices.push({
- deviceMac: data.deviceMac,
- deviceName: data.deviceName
- })
- resolve(data);
- return;
+ request({
+ url: '/app/device/getDeviceInfoByDeviceMac',
+ method: 'GET',
+ data: {
+ deviceMac: macStr
}
- }
+ }).then(res => {
+ console.log("获取设备信息", res);
+ if (res && res.code == 200) {
+ console.log("res=", res);
+ let data = res.data;
+ if (data) {
+ this.groupDevices.push({
+ deviceMac: data.deviceMac,
+ deviceName: data.deviceName
+ })
+ resolve(data);
+ return;
+ }
+ } else {
+ console.log("222222222");
+ }
+
+ resolve(null);
+
+ }).catch(ex => {
+ console.error("查询设备出现异常:", ex);
+ resolve(null);
+
+ }).finally(com => {
+ console.log("complete")
+ });
+ } catch (err) {
+ console.error("err=", err);
resolve(null);
-
- }).catch(ex => {
-
- resolve(null);
-
- });
+ }
});
},
diff --git a/pages/6155/deviceDetail.vue b/pages/6155/deviceDetail.vue
index 20b608c..d07fd03 100644
--- a/pages/6155/deviceDetail.vue
+++ b/pages/6155/deviceDetail.vue
@@ -175,7 +175,7 @@
baseURL
} from '@/utils/request.js';
- var pagePath = "/pages/6155/HBY6155";
+ var pagePath = "/pages/6155/deviceDetail";
var ble = null;
var these = null;
@@ -575,7 +575,7 @@
keys.forEach((key) => {
if (key in these.formData) {
// 确保响应式更新
- console.log(`更新字段 ${key}: ${these.formData[key]} -> ${json[key]}`);
+ // console.log(`更新字段 ${key}: ${these.formData[key]} -> ${json[key]}`);
these.$set(these.formData, key, json[key]);
} else {
console.log(`字段 ${key} 不在 formData 中,跳过更新`);
@@ -584,7 +584,7 @@
// 强制触发视图更新,确保电量显示同步
these.$forceUpdate();
- console.log("更新后的电量:", these.formData.battary);
+ // console.log("更新后的电量:", these.formData.battary);
if (this.formData.battary <= 20) {
this.showPop({
@@ -911,7 +911,7 @@
"clientid": clientid
},
formData: {
- code: 2,
+ code: 1,
width: width,
height: height
},
@@ -942,6 +942,8 @@
resolve(res.data);
return;
+ }else{
+ console.log("res.data=",res.data);
}
}
@@ -1087,7 +1089,7 @@
dataView.setUint8(packetSize - 1, 0xFF);
}
let inteval = parseInt(this.inteval ? this.inteval : 80);
- console.log(inteval, 'intevalinteval');
+ // console.log(inteval, 'intevalinteval');
ble.sendData(f.deviceId, buffer, f.writeServiceId, f
.wirteCharactId).then(() => {
if (ReSendNo) {
diff --git a/pages/BlueTooth/ModeSetting/HBY6155.vue b/pages/BlueTooth/ModeSetting/HBY6155.vue
deleted file mode 100644
index 3ff9f9a..0000000
--- a/pages/BlueTooth/ModeSetting/HBY6155.vue
+++ /dev/null
@@ -1,1947 +0,0 @@
-
-
-
-
- 蓝牙设备列表
-
-
- 蓝牙状态: {{ bluetoothStatus }}
-
-
-
-
-
- {{ searchTips }}
-
-
-
-
- {{ device.name || '未知设备' }}
-
- 已连接
-
-
-
-
-
-
- 6155控制器
-
-
- 已连接: {{ targetDeviceName }}
-
-
-
- 发送间隔:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 固件版本:{{gujianVer}}
- Mac地址:{{MacAdd}}
-
-
-
-
-
- 设备重启
-
-
-
-
- 恢复出厂设置
-
-
-
-
-
-
-
-
-
- 选择灯光模式
-
-
-
- 关闭
-
-
-
- 弱光
-
-
-
- 工作光
-
-
-
- 强光
-
-
-
-
- 爆闪
-
-
-
-
-
-
-
- 选择灯光模式
-
-
-
- 关闭
-
-
-
- 弱光
-
-
-
- 工作光
-
-
-
- 强光
-
-
-
-
- 爆闪
-
-
-
-
-
-
-
-
- 亮度调节
- {{ brightness }}%
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 点击"导入图片"选择开机画面
-
-
- 框选区域: 160×80像素
- 缩放: {{ scale.toFixed(2) }}x
-
-
-
-
-
-
-
- 正在发送: {{ progress }}% ({{ currentPacket }}/{{ totalPackets }})
-
-
-
-
-
-
-
-
- 第{{ index + 1 }}行:
-
-
-
-
-
-
-
-
-
-
- 正在发送: {{ textProgress }}% ({{ currentTextPacket }}/{{ totalTextPackets }})
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/pages/BlueTooth/ModeSetting/HBY6155V1.vue b/pages/BlueTooth/ModeSetting/HBY6155V1.vue
deleted file mode 100644
index 06aa86a..0000000
--- a/pages/BlueTooth/ModeSetting/HBY6155V1.vue
+++ /dev/null
@@ -1,1925 +0,0 @@
-
-
-
-
- 蓝牙设备列表
-
-
- 蓝牙状态: {{ bluetoothStatus }}
-
-
-
-
-
- {{ searchTips }}
-
-
-
-
- {{ device.name || '未知设备' }}
-
- 已连接
-
-
-
-
-
-
- 6155控制器
-
-
- 已连接: {{ targetDeviceName }}
-
-
-
-
- 数据更新时间:{{receiveData.date}}
- Mac地址:{{receiveData.macAddress}}
- 主灯模式:{{receiveData.mainMode}}
- 副灯模式:{{receiveData.fuMode}}
- 电池电量:{{receiveData.batteryCnt}}
- 充电状态:{{receiveData.batteryStatu}}
- 续航时间:{{receiveData.time}}
-
-
-
-
-
- 发送间隔:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 固件版本:{{gujianVer}}
- Mac地址:{{MacAdd}}
-
-
-
-
-
- 设备重启
-
-
-
-
- 恢复出厂设置
-
-
-
-
-
-
-
-
-
- 选择灯光模式
-
-
-
- 关闭
-
-
-
- 弱光
-
-
-
- 工作光
-
-
-
- 强光
-
-
-
-
- 爆闪
-
-
-
-
-
-
-
- 选择灯光模式
-
-
-
- 关闭
-
-
-
- 弱光
-
-
-
- 工作光
-
-
-
- 强光
-
-
-
-
- 爆闪
-
-
-
-
-
-
-
-
- 亮度调节
- {{ brightness }}%
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 点击"导入图片"选择开机画面
-
-
- 框选区域: 160×80像素
- 缩放: {{ scale.toFixed(2) }}x
-
-
-
-
-
-
-
- 正在发送: {{ progress }}% ({{ currentPacket }}/{{ totalPackets }})
-
-
-
-
-
-
-
-
- 第{{ index + 1 }}行:
-
-
-
-
-
-
-
-
-
-
- 正在发送: {{ textProgress }}% ({{ currentTextPacket }}/{{ totalTextPackets }})
-
-
-
-
-
-
-
-
-
-
-
- {{item['date']}}:{{item['remark']}}
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/pages/BlueTooth/ModeSetting/HBY650.vue b/pages/BlueTooth/ModeSetting/HBY650.vue
deleted file mode 100644
index 07ebe45..0000000
--- a/pages/BlueTooth/ModeSetting/HBY650.vue
+++ /dev/null
@@ -1,1892 +0,0 @@
-
-
-
-
- 蓝牙设备列表
-
-
- 蓝牙状态: {{ bluetoothStatus }}
-
-
-
-
-
- {{ searchTips }}
-
-
-
-
- {{ device.name || '未知设备' }}
-
- 已连接
-
-
-
-
-
-
- 蓝牙设备控制器
-
-
- 已连接: {{ targetDeviceName }}
-
-
-
- 数据更新时间:{{receiveData.date}}
- Mac地址:{{receiveData.macAddress}}
- 静电探测档位:{{receiveData.staticLevel}}
- 剩余照明时间:{{receiveData.lightingTime}}
- 照明档位:{{receiveData.lightingLevel}}
- 电池电量:{{receiveData.batteryLevel}}
- 预警级别:{{receiveData.warnLevel}}
-
-
-
-
- 发送间隔:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 选择静电探测档位
-
-
- 💡
- 高档模式
-
-
- 🔅
- 中档模式
-
-
- 💥
- 低档模式
-
-
-
-
-
-
-
-
- 照明模式
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 点击"导入图片"选择开机画面
-
-
- 框选区域: 160×80像素
- 缩放: {{ scale.toFixed(2) }}x
-
-
-
-
-
-
-
- 正在发送: {{ progress }}% ({{ currentPacket }}/{{ totalPackets }})
-
-
-
-
-
-
-
-
-
- 第{{ index + 1 }}行:
-
-
-
-
-
-
-
-
-
-
- 正在发送: {{ textProgress }}% ({{ currentTextPacket }}/{{ totalTextPackets }})
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/pages/BlueTooth/ModeSetting/HBY650_1.vue b/pages/BlueTooth/ModeSetting/HBY650_1.vue
deleted file mode 100644
index 8338463..0000000
--- a/pages/BlueTooth/ModeSetting/HBY650_1.vue
+++ /dev/null
@@ -1,1899 +0,0 @@
-
-
-
-
- 蓝牙设备列表
-
-
- 蓝牙状态: {{ bluetoothStatus }}
-
-
-
-
-
- {{ searchTips }}
-
-
-
-
- {{ device.name || '未知设备' }}
-
- 已连接
-
-
-
-
-
-
- 蓝牙设备控制器
-
-
- 已连接: {{ targetDeviceName }}
-
-
-
- 数据更新时间:{{receiveData.date}}
- Mac地址:{{receiveData.macAddress}}
- 静电探测档位:{{receiveData.staticLevel}}
- 剩余照明时间:{{receiveData.lightingTime}}
- 照明档位:{{receiveData.lightingLevel}}
- 电池电量:{{receiveData.batteryLevel}}
- 预警级别:{{receiveData.warnLevel}}
-
-
-
-
- 发送间隔:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 选择静电探测档位
-
-
- 💡
- 高档模式
-
-
- 🔅
- 中档模式
-
-
- 💥
- 低档模式
-
-
-
-
-
-
-
-
- 照明模式
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 点击"导入图片"选择开机画面
-
-
- 框选区域: 160×80像素
- 缩放: {{ scale.toFixed(2) }}x
-
-
-
-
-
-
-
- 正在发送: {{ progress }}% ({{ currentPacket }}/{{ totalPackets }})
-
-
-
-
-
-
-
-
- 第{{ index + 1 }}行:
-
-
-
-
-
-
-
-
-
-
- 正在发送: {{ textProgress }}% ({{ currentTextPacket }}/{{ totalTextPackets }})
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/pages/BlueTooth/ModeSetting/HBY670V1.vue b/pages/BlueTooth/ModeSetting/HBY670V1.vue
deleted file mode 100644
index c457ae4..0000000
--- a/pages/BlueTooth/ModeSetting/HBY670V1.vue
+++ /dev/null
@@ -1,2837 +0,0 @@
-
-
-
-
- 蓝牙设备列表
-
-
- 蓝牙状态: {{ bluetoothStatus }}
-
-
-
-
-
- {{ searchTips }}
-
-
-
-
- {{ device.name || '未知设备' }}
-
- 已连接
-
-
-
-
-
-
-
-
-
- 已连接: {{ targetDeviceName }}
-
-
-
- 当前模式: {{ netMode=='ble'?'蓝牙模式':netMode=='mqtt'?'MQ模式':'Http模式' }}
-
-
-
- 数据更新时间:{{receiveData.date}}
- Mac:{{receiveData.macAddress}}
- IMEI:{{receiveData.IMEI}}
- 经度:{{receiveData.Lon}}
- 纬度:{{receiveData.Lat}}
-
- 静电探测档位:{{receiveData.staticLevel}}
- 照明档位:{{receiveData.lightingLevel}}
- 剩余照明时间:{{receiveData.lightingTime}}
- 电池电量:{{receiveData.batteryLevel}}
- 预警级别:{{receiveData.warnLevel}}
- 静止报警状态:{{receiveData.staticWarn}}
- 4G信号强度:{{receiveData.fourGStrenth}}
- SOS模式:{{receiveData.SOS}}
-
-
- 重发包序号:{{reSendNumber}}
-
-
-
-
-
- 正在发送: {{ progress }}% ({{ currentPacket }}/{{ totalPackets }})
-
-
- 发送间隔:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 选择静电探测档位
-
-
-
- 高档模式
-
-
-
- 中档模式
-
-
-
- 低档模式
-
-
-
- 关闭
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 照明模式
-
-
-
-
-
-
-
-
- 选择模式
-
-
-
- 红蓝模式
-
-
-
- 爆闪模式
-
-
-
- 关闭SOS
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 点击"导入图片"选择开机画面
-
-
-
-
-
-
-
-
-
-
-
-
- 第{{ index + 1 }}行:
-
-
-
-
-
-
-
-
-
-
-
- 正在发送: {{ textProgress }}% ({{ currentTextPacket }}/{{ totalTextPackets }})
-
-
-
-
-
-
- 第{{ index + 1 }}行:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/pages/BlueTooth/ModeSetting/ModeSetting.vue b/pages/BlueTooth/ModeSetting/ModeSetting.vue
deleted file mode 100644
index c464993..0000000
--- a/pages/BlueTooth/ModeSetting/ModeSetting.vue
+++ /dev/null
@@ -1,1499 +0,0 @@
-
-
-
-
- 蓝牙设备列表
-
-
- 蓝牙状态: {{ bluetoothStatus }}
-
-
-
-
-
- {{ searchTips }}
-
-
-
-
- {{ device.name || '未知设备' }}
-
- 已连接
-
-
-
-
-
-
- 蓝牙灯光控制器
-
-
- 已连接: {{ targetDeviceName }}
-
-
-
- 发送间隔:
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 选择灯光模式
-
-
- 💡
- 强光模式
-
-
- 🔅
- 弱光模式
-
-
- 💥
- 爆闪模式
-
-
-
-
-
-
-
-
- 亮度调节
- {{ brightness }}%
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 点击"导入图片"选择开机画面
-
-
- 框选区域: 160×80像素
- 缩放: {{ scale.toFixed(2) }}x
-
-
-
-
-
-
-
- 正在发送: {{ progress }}% ({{ currentPacket }}/{{ totalPackets }})
-
-
-
-
-
-
-
- 第{{ index + 1 }}行:
-
-
-
-
-
-
-
-
-
-
- 正在发送: {{ textProgress }}% ({{ currentTextPacket }}/{{ totalTextPackets }})
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/pages/BlueTooth/ModeSetting/VideoSend.vue b/pages/BlueTooth/ModeSetting/VideoSend.vue
deleted file mode 100644
index 3ea69bb..0000000
--- a/pages/BlueTooth/ModeSetting/VideoSend.vue
+++ /dev/null
@@ -1,472 +0,0 @@
-
-
-
-
-
-
-
-
- 发送间隔
-
-
-
-
-
-
-
-
-
-
-
-
-
- 正在发送: {{ progress }}% ({{ currentPacket }}/{{ totalPackets }})
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/pages/BlueTooth/ModeSetting/VideoSend_1.vue b/pages/BlueTooth/ModeSetting/VideoSend_1.vue
deleted file mode 100644
index 1c1eadb..0000000
--- a/pages/BlueTooth/ModeSetting/VideoSend_1.vue
+++ /dev/null
@@ -1,517 +0,0 @@
-
-
-
-
-
-
-
- 并发包数量
-
-
-
- 发送间隔
-
-
-
-
-
-
-
-
-
-
-
-
-
- 正在发送: {{ progress }}% ({{ currentPacket }}/{{ totalPackets }})
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/pages/BlueTooth/ModeSetting/VideoSend_670.vue b/pages/BlueTooth/ModeSetting/VideoSend_670.vue
deleted file mode 100644
index 1e8bc89..0000000
--- a/pages/BlueTooth/ModeSetting/VideoSend_670.vue
+++ /dev/null
@@ -1,537 +0,0 @@
-
-
-
-
-
-
- 选择的视频:{{videoPath}}
-
-
- 重发包序号:{{reSendNumber}}
-
-
- 发送间隔
-
-
-
-
-
-
-
-
-
-
-
-
-
- 正在发送: {{ progress }}% ({{ currentPacket }}/{{ totalPackets }})
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/pages/BlueTooth/ModeSetting/index.vue b/pages/BlueTooth/ModeSetting/index.vue
deleted file mode 100644
index d0edfba..0000000
--- a/pages/BlueTooth/ModeSetting/index.vue
+++ /dev/null
@@ -1,115 +0,0 @@
-
-
-
- {{item.url}}
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/pages/BlueTooth/ModeSetting/update.vue b/pages/BlueTooth/ModeSetting/update.vue
deleted file mode 100644
index e814728..0000000
--- a/pages/BlueTooth/ModeSetting/update.vue
+++ /dev/null
@@ -1,273 +0,0 @@
-
-
-
-
- 正在更新 {{ progress }}%
-
-
-
-
-
-
-
-
- 发现新版本 v{{ newVersion }}
- {{ updateInfo.desc || '有新的功能和优化,建议立即更新' }}
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/pages/common/addBLE/addEquip.vue b/pages/common/addBLE/addEquip.vue
index d30efab..f91c2be 100644
--- a/pages/common/addBLE/addEquip.vue
+++ b/pages/common/addBLE/addEquip.vue
@@ -51,9 +51,13 @@
搜索设备
刷新
+
+
+
+ v-show="item.name.indexOf(search)>-1">
@@ -148,6 +152,7 @@
}
},
+ search:'',//筛选
PairEquip: [], //已配对设备
EquipMents: [], //搜索出来的设备
device: null,
@@ -171,6 +176,7 @@
}
},
onLoad(option) {
+ debugger;
let search = option.search;
these = this;
eventChannel = this.getOpenerEventChannel();
@@ -256,61 +262,7 @@
}, pagePath);
- // --- Start: Logic for Pairing Mode Only ---
- if (these.device) {
- console.log("进入配对模式,启用连接恢复和验证逻辑。");
- //蓝牙连接已恢复的回调
- ble.addRecoveryCallback(res => {
- if (these.Status.isPageHidden) {
- return;
- }
- // hideLoading(these);
- these.EquipMents.find(function(v, ind) {
- if (v.deviceId == res.deviceId) {
- these.PairEquip.push(v);
- return true;
- }
- return false;
- });
- if (these.device) {
- clearInterval(this.Status.intval);
- showLoading(these, {
- text: '蓝牙连接已恢复,正在验证设备'
- });
-
- setTimeout(() => {
- these.DeviceVerdict(res.deviceId);
- }, 0);
- } else {
- hideLoading(these);
- }
-
-
- }, pagePath);
-
- //收到设备的消息回调
- ble.addReceiveCallback((receivData, f, path, arr) => {
- if (these.Status.isPageHidden) {
- return;
- }
- if (f.macAddress && these.device) {
- clearInterval(this.Status.intval);
- this.Status.intval = null;
- this.Status.time = null;
-
- showLoading(these, {
- text: '正在验证设备'
- });
-
- setTimeout(() => {
- these.DeviceVerdict(f.deviceId);
- }, 0);
- }
-
-
- }, pagePath);
- }
- // --- End: Logic for Pairing Mode Only ---
+
//搜索到新设备的回调 (Always active)
ble.addDeviceFound((arr) => {
@@ -356,13 +308,76 @@
}
}, pagePath);
}
+
+ let startValidDevice=()=>{
+ if (these.device) {
+ console.log("进入配对模式,启用连接恢复和验证逻辑。");
+ //蓝牙连接已恢复的回调
+ ble.addRecoveryCallback(res => {
+ if (these.Status.isPageHidden) {
+ return;
+ }
+ // hideLoading(these);
+ these.EquipMents.find(function(v, ind) {
+ if (v.deviceId == res.deviceId) {
+ these.PairEquip.push(v);
+ return true;
+ }
+ return false;
+ });
+ if (these.device) {
+ clearInterval(this.Status.intval);
+ showLoading(these, {
+ text: '蓝牙连接已恢复,正在验证设备'
+ });
+
+ setTimeout(() => {
+ these.DeviceVerdict(res.deviceId);
+ }, 0);
+ } else {
+ hideLoading(these);
+ }
+
+
+ }, pagePath);
+
+ //收到设备的消息回调
+ ble.addReceiveCallback((receivData, f, path, arr) => {
+ console.log("000000");
+ if (these.Status.isPageHidden) {
+ return;
+ }
+ console.log("1111111");
+ if (f.macAddress && these.device) {
+ console.log("222222");
+ clearInterval(this.Status.intval);
+ this.Status.intval = null;
+ this.Status.time = null;
+
+ showLoading(these, {
+ text: '正在验证设备'
+ });
+
+ setTimeout(() => {
+ these.DeviceVerdict(f.deviceId);
+ }, 0);
+ }
+
+
+ }, pagePath);
+ }
+ }
StartSubsrib();
eventChannel.on('detailData', function(rec) {
console.log("接收到父页面的参数:", rec);
these.device = rec.data;
-
+ if(rec.data.bluetoothName){
+ these.search=rec.data.bluetoothName.replace('JQZM-','');
+ }
+
+ startValidDevice();
these.refreshBleList();
});
@@ -800,10 +815,10 @@
padding: 30rpx;
box-sizing: border-box;
width: 100%;
- height: calc(100% - 300rpx);
+ height: calc(100% - 240rpx);
overflow-y: scroll;
position: absolute;
- top: 300rpx;
+ top: 240rpx;
left: 0rpx;
}
@@ -825,16 +840,17 @@
align-content: center;
align-items: center;
justify-content: space-between;
- margin-bottom: 20rpx;
+ margin-bottom:30rpx;
}
.list {
min-height: 120rpx;
+
}
.searchList {
width: 100%;
- height: calc(100% - 186rpx);
+ height: calc(100% - 260rpx);
overflow-y: scroll;
}
@@ -1005,4 +1021,12 @@
filter: none !important;
-webkit-filter: none !important;
}
+
+ .uni-mt-5 {
+ background-color: #000000;
+ }
+
+ .uni-easyinput__content {
+ background-color: #121212 !important;
+ }
\ No newline at end of file
diff --git a/static/images/common/BJQ4877.png b/static/images/common/BJQ4877.png
index dff8be2..a8db8a6 100644
Binary files a/static/images/common/BJQ4877.png and b/static/images/common/BJQ4877.png differ
diff --git a/utils/BleHelper.js b/utils/BleHelper.js
index cd65153..a03532b 100644
--- a/utils/BleHelper.js
+++ b/utils/BleHelper.js
@@ -74,9 +74,9 @@ class BleHelper {
stateRecoveryCallback: [], //蓝牙适配器恢复可用事件
stateBreakCallback: [] //蓝牙适配器不可用事件
}
- // this.addReceiveCallback((a, b, c) => {
- // recei.ReceiveData(a, b, c);
- // }, "BleReceiveData");
+ this.addReceiveCallback((receive, f, path, recArr) => {
+ recei.ReceiveData(receive, f, path, recArr);
+ }, "BleReceiveData");
this.dic = {
errRemarks: [{
key: '10000',
@@ -639,7 +639,7 @@ class BleHelper {
console.log("111111111")
uni.onBluetoothDeviceFound((res) => {
- // console.log("发现新设备:" + JSON.stringify(res,'name'));
+ //console.log("发现新设备:" + JSON.stringify(res,'name'));
let arr = [];
for (var i = 0; i < res.devices.length; i++) {
let item = res.devices[i];
@@ -653,7 +653,7 @@ class BleHelper {
});
if (f) {
- // console.log("发现目标设备:", item);
+ // console.log("发现目标设备:", item);
arr.push(item);
}
@@ -678,12 +678,14 @@ class BleHelper {
});
}
+ }else{
+ console.error("无人订阅发现设备的回调");
}
});
uni.onBLECharacteristicValueChange((receive) => {
//订阅消息
- console.log("收到订阅消息", receive);
+ // console.log("收到订阅消息", receive);
let f = this.data.LinkedList.find((v) => {
return v.deviceId == receive.deviceId;
})
@@ -838,10 +840,10 @@ class BleHelper {
}
})
} else {
- console.log("无人订阅消息");
+ console.error("无人订阅消息");
}
} else {
- console.log("无人订阅receivDataCallback,不处理数据");
+ console.error("无人订阅receivDataCallback,不处理数据");
}
} catch (ex) {
console.error("处理订阅消息失败,ex=", ex);
diff --git a/utils/BleReceive.js b/utils/BleReceive.js
index 36aaea6..45ef6f7 100644
--- a/utils/BleReceive.js
+++ b/utils/BleReceive.js
@@ -46,20 +46,20 @@ class BleReceive {
let handler = null;
let keys = Object.keys(this.HandlerMap);
let devKey = f.device.detailPageUrl ? f.device.detailPageUrl.replace(/\//g, '').toLowerCase() : '';
- console.log("查找handler - detailPageUrl:", f.device.detailPageUrl, "转换后:", devKey);
+ // console.log("查找handler - detailPageUrl:", f.device.detailPageUrl, "转换后:", devKey);
for (let index = 0; index < keys.length; index++) {
let devKey = f.device.detailPageUrl ? f.device.detailPageUrl.replace(/\//g, "").toLowerCase() : '';
let key = keys[index].replace(/\//g, '').toLowerCase();
if (key == devKey) {
handler = this.HandlerMap[keys[index]];
- console.log("找到匹配的handler:", keys[index]);
+ // console.log("找到匹配的handler:", keys[index]);
break;
}
}
if (handler) {
let data = handler(receive, f, path, recArr);
- console.log("设备"+f.device.deviceName+"收到消息,handler返回的数据:", data);
+ // console.log("设备"+f.device.deviceName+"收到消息,数据:", data);
return data;
} else {
console.error("已收到消息,但无指定处理程序, deviceUrl:", f.device.detailPageUrl, "可用handlers:", keys);
@@ -162,7 +162,7 @@ class BleReceive {
if (iswarn) {
uni.showModal({
- content: "环境存在漏电电源",
+ content: "'"+f.device.deviceName+"'环境存在漏电电源",
title: "警告",
success(res) {
if (res.confirm) {
@@ -330,7 +330,7 @@ class BleReceive {
if (this.formData.staticWarn) { //有静止报警
uni.showModal({
title: "警告",
- content: "设备静止报警中",
+ content: "设备'"+f.device.deviceName+"'静止报警中",
showCancel: false
});
}
@@ -420,19 +420,23 @@ class BleReceive {
let name = "";
switch (type) {
case 0x02:
- name = '弱光';
+ // name = '弱光';
+ name=1;
break;
case 0x04:
name = '工作光';
break;
case 0x01:
- name = '强光';
+ // name = '强光';
+ name=0;
break;
case 0x03:
- name = '爆闪';
+ // name = '爆闪';
+ name=2;
break;
case 0x00:
- name = '关闭';
+ // name = '关闭';
+ name=3;
break;
}
return name;
@@ -472,8 +476,7 @@ class BleReceive {
formData.statu = warn;
formData.xuhang = lightingTime;
- console.log("7305解析结果 - 电量:", batteryLevel, "续航:", lightingTime, "完整数据:", formData);
-
+
let recCnt = recArr.find(v => {
return v.key.replace(/\//g, "").toLowerCase() === f.device.detailPageUrl.replace(/\//g, '').toLowerCase();
@@ -484,10 +487,10 @@ class BleReceive {
if (!recCnt) {
if (batteryLevel <= 20) {
// 会弹出两个框,暂且注释掉这段代码
- // uni.showModal({
- // content: "设备电量低",
- // title: "提示"
- // });
+ uni.showModal({
+ content: "设备'"+f.device.deviceName+"'电量低",
+ title: "提示"
+ });
}
}
@@ -518,7 +521,7 @@ class BleReceive {
if (receiveData.sta_PowerPercent<=20) {
uni.showModal({
title: "提示",
- content: "设备电量低",
+ content: "设备'"+f.device.deviceName+"'电量低",
showCancel: false
});
}
@@ -547,7 +550,7 @@ class BleReceive {
if (receiveData.sta_battery<=20) {
uni.showModal({
title: "提示",
- content: "设备电量低",
+ content: "设备'"+f.device.deviceName+"'电量低",
showCancel: false
});
}
@@ -577,7 +580,7 @@ class BleReceive {
if (receiveData.sta_PowerPercent<=20) {
uni.showModal({
title: "提示",
- content: "设备电量低",
+ content: "设备'"+f.device.deviceName+"'电量低",
showCancel: false
});
}
diff --git a/utils/request.js b/utils/request.js
index a25cc90..6faf71e 100644
--- a/utils/request.js
+++ b/utils/request.js
@@ -1,5 +1,5 @@
import config from '../config/index.js';
-export const env = 'production'; //production development //开发of线上 改这里就行
+export const env = 'development'; //production development //开发of线上 改这里就行
const BASE = config[env];
const request = (options) => {
console.log("options" + JSON.stringify(options), BASE.BASE_URL)