|
@@ -145,7 +145,7 @@ Page({
|
|
that.data.intervalId = setInterval(async function () {
|
|
that.data.intervalId = setInterval(async function () {
|
|
isFirst = false;
|
|
isFirst = false;
|
|
that.compareList();
|
|
that.compareList();
|
|
- }, isFirst ? 3 * 1000 : 10 * 1000);
|
|
|
|
|
|
+ }, isFirst ? 5 * 1000 : 10 * 1000);
|
|
},
|
|
},
|
|
|
|
|
|
async compareList() {
|
|
async compareList() {
|
|
@@ -763,6 +763,31 @@ Page({
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+
|
|
|
|
+ ///是否是同一个蓝牙
|
|
|
|
+ isTheSameBlue(connectDevice) {
|
|
|
|
+ var that = this;
|
|
|
|
+ var deviceListIndex = that.data.deviceListIndex;
|
|
|
|
+ if (deviceListIndex == null) {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ var deviceList = that.data.deviceList;
|
|
|
|
+ if (deviceList.length > deviceListIndex) {
|
|
|
|
+ if (deviceList[deviceListIndex].connectType == 3) {
|
|
|
|
+ return false;
|
|
|
|
+ } else {
|
|
|
|
+ if (deviceList[deviceListIndex].deviceId == connectDevice.deviceId) {
|
|
|
|
+ return true;
|
|
|
|
+ } else {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
///断开当前的
|
|
///断开当前的
|
|
async cancelCurrent() {
|
|
async cancelCurrent() {
|
|
var that = this;
|
|
var that = this;
|
|
@@ -782,6 +807,7 @@ Page({
|
|
|
|
|
|
/// 断开蓝牙连接
|
|
/// 断开蓝牙连接
|
|
async cancelBlue(index) {
|
|
async cancelBlue(index) {
|
|
|
|
+ var that = this;
|
|
const id = that.data.deviceList[index].deviceId;
|
|
const id = that.data.deviceList[index].deviceId;
|
|
const deviceList = that.data.deviceList.filter((item, i) => {
|
|
const deviceList = that.data.deviceList.filter((item, i) => {
|
|
return id !== item.deviceId
|
|
return id !== item.deviceId
|