添加102联机记录
This commit is contained in:
@ -1601,7 +1601,7 @@ class BleHelper {
|
||||
// console.log("正在连接" + deviceId);
|
||||
uni.createBLEConnection({
|
||||
deviceId: deviceId,
|
||||
timeout: 30000,
|
||||
timeout: 15000,
|
||||
success: (info) => {
|
||||
//释放连接锁
|
||||
|
||||
|
||||
@ -218,31 +218,31 @@ export default {
|
||||
value: "1",
|
||||
label: "灯光模式",
|
||||
checked: false,
|
||||
type: ['6170', '670','102','6155','650','7305']
|
||||
type: ['6170', '670','102','6155','650','7305','6075']
|
||||
},
|
||||
{
|
||||
value: "2",
|
||||
label: "激光模式",
|
||||
checked: false,
|
||||
type: ['6170']
|
||||
type: ['6170','6075']
|
||||
},
|
||||
{
|
||||
value: "3",
|
||||
label: "开机画面",
|
||||
checked: false,
|
||||
type: ['210', '6170', '670','6155','650','7305']
|
||||
type: ['210', '6170', '670','6155','650','7305','6075']
|
||||
},
|
||||
{
|
||||
value: "4",
|
||||
label: "人员信息登记",
|
||||
checked: false,
|
||||
type: ['210', '6170', '670','6155','650','7305']
|
||||
type: ['210', '6170', '670','6155','650','7305','6075']
|
||||
},
|
||||
{
|
||||
value: "5",
|
||||
label: "发送信息",
|
||||
checked: false,
|
||||
type: ['210', '6170', '670']
|
||||
type: ['210', '6170', '670','6075']
|
||||
},
|
||||
{
|
||||
value: "6",
|
||||
@ -258,7 +258,7 @@ export default {
|
||||
value: "42",
|
||||
label: "SOS",
|
||||
checked: false,
|
||||
type: ['670','4877']
|
||||
type: ['670','4877','6075']
|
||||
},
|
||||
{
|
||||
value: "43",
|
||||
|
||||
@ -281,7 +281,36 @@ class MqttClient {
|
||||
}
|
||||
}
|
||||
|
||||
publish(topic, message,retained) {
|
||||
async publish(topic, message,retained) {
|
||||
let getLan=()=>{
|
||||
return new Promise((succ,error)=>{
|
||||
uni.getNetworkType({
|
||||
success: (res) => {
|
||||
let networkType = res.networkType;
|
||||
// 判断网络是否连接
|
||||
if (networkType === 'none') {
|
||||
console.error('无网络连接')
|
||||
succ(false);
|
||||
} else {
|
||||
succ(true);
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('获取网络状态失败:', err);
|
||||
|
||||
succ(false);
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
let flag=await getLan();
|
||||
if(!flag){
|
||||
|
||||
return false;
|
||||
}
|
||||
if (this.client && this.client.isConnected()) {
|
||||
const mqttMessage = new Paho.Message(message);
|
||||
mqttMessage.destinationName = topic;
|
||||
|
||||
Reference in New Issue
Block a user