1
0
forked from dyf/APP

添加102联机记录

This commit is contained in:
liub
2026-03-05 10:06:37 +08:00
parent aa87a1a78f
commit c1c7d4491b
43 changed files with 4732 additions and 745 deletions

View File

@ -1601,7 +1601,7 @@ class BleHelper {
// console.log("正在连接" + deviceId);
uni.createBLEConnection({
deviceId: deviceId,
timeout: 30000,
timeout: 15000,
success: (info) => {
//释放连接锁

View File

@ -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",

View File

@ -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;