670分享功能

This commit is contained in:
liub
2025-08-28 14:46:04 +08:00
parent 9846fe2315
commit 8460aa1be2

View File

@ -53,6 +53,14 @@
<view v-bind:class="getWarnStyle(5)" class="net netfive"></view>
</view>
</view>
<view class="warnnig" v-bind:class="(formData.qzwarn && Status.staticWarn.time)?'':'displayNone'"
@click="CloseWarn(true)">
<view>设备强制闪烁报警中</view>
<view class="netContent">
{{Status.staticWarn.time}}s
</view>
</view>
<view class="optTitle">
档位
@ -621,7 +629,7 @@
receiveData.modeCurr = staticLevelText;
receiveData.lightCurr = lightingLevelText;
receiveData.xuhang = json.sta_PowerTime + "分钟";
receiveData.battary = json.sta_PowerPercent + "%";
receiveData.battary = json.sta_PowerPercent ;
receiveData.warnLevel = warn;
receiveData.staticWarn = staticWarn;
@ -683,15 +691,7 @@
buttonText: "确定",
clickEvt: "staticWarn"
});
// this.Status.staticWarn.time=5;
// this.Status.staticWarn.inteval=setInterval(()=>{
// if(this.Status.staticWarn.time===0){
// clearInterval(this.Status.staticWarn.inteval);
// this.formData.staticWarn=false;
// return;
// }
// this.Status.staticWarn.time=this.Status.staticWarn.time-1;
// },1000)
}
@ -799,6 +799,113 @@
setTimeout(task, 0);
},
CloseWarn: function(ispop) {
let closeEvt=()=>{
{
these.Status.Pop.showPop = false;
these.formData.qzwarn = false;
clearInterval(these.Status.staticWarn.inteval);
let closeSOS=()=>{
let json = {
ins_SOSGrade: [0]
};
this.sendMQ(json).then((res) => {
console.log("4g发送成功");
}).catch((ex) => {
console.log("ex=",ex);
these.showPop({
message: "通信异常,请检查手机或设备网络",
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
});
}).finally(() => {
hideLoading(these);
these.setBleFormData();
});
}
let closeWarn=()=>{
let json = {
ins_ShakeBit: [0]
};
this.sendMQ(json).then((res) => {
console.log("4g发送成功");
}).catch((ex) => {
console.log("ex=",ex);
these.showPop({
message: "通信异常,请检查手机或设备网络",
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
});
}).finally(() => {
hideLoading(these);
these.setBleFormData();
});
}
let f = this.getDevice();
let buffer = null;
if (f) {
// 发送数据
buffer = new ArrayBuffer(6);
let dataView = new DataView(buffer);
dataView.setUint8(0, 0x55); // 帧头
dataView.setUint8(1, 0x06); // 帧类型
dataView.setUint8(2, 0x01); // 包序号
dataView.setUint8(3, 0x00); // 数据长度
dataView.setUint8(4, 0x01); // 数据长度
dataView.setUint8(5, 0x71); // 数据
ble.sendData(f.deviceId, buffer, f.writeServiceId, f.wirteCharactId, 10).then(
() => {
console.log("关闭强制报警成功")
dataView.setUint8(0, 0x55); // 帧头
dataView.setUint8(1, 0x05); // 帧类型
dataView.setUint8(2, 0x01); // 包序号
dataView.setUint8(3, 0x00); // 数据长度
dataView.setUint8(4, 0x01); // 数据长度
dataView.setUint8(5, 0x68);
ble.sendData(f.deviceId, buffer, f.writeServiceId, f.wirteCharactId, 10).then(()=>{
console.log("成功");
});
}).catch(ex => {
closeSOS();
closeWarn();
});
} else {
closeSOS();
closeWarn();
}
}
}
if(!ispop){
closeEvt();
return;
}
this.showPop({
showHeader: true,
headerTxt: "强制报警",
message: '持续报警时间' + this.Status.staticWarn.time,
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
buttonText:"解除报警",
okCallback: closeEvt
});
},
sosSetting: function(type) {
if (this.formData.SOS == type) {
type = "close";
@ -876,7 +983,8 @@
dataView.setUint8(1, 0x06); // 帧类型
dataView.setUint8(5, 0x70); // 数据
}
ble.sendData(f.deviceId, buffer, f.writeServiceId, f.wirteCharactId, 10).then(()=>{
ble.sendData(f.deviceId, buffer, f.writeServiceId, f.wirteCharactId,
10).then(() => {
console.log("蓝牙发送报警成功", type);
})
@ -892,7 +1000,35 @@
}
}
if (type !== 'sg') {
SendCmd();
} else {
this.showPop({
message: '确定开启声光报警模式?',
iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png",
borderColor: "#e034344d",
buttonBgColor: "#E03434",
okCallback: function() {
these.formData.qzwarn = true;
these.Status.staticWarn.time = 5;
these.Status.staticWarn.inteval = setInterval(() => {
if (these.Status.staticWarn.time === 0) {
clearInterval(these.Status.staticWarn.inteval);
these.formData.qzwarn = false;
these.CloseWarn(false);
return;
}
these.Status.staticWarn.time = these.Status.staticWarn
.time - 1;
}, 1000)
SendCmd();
}
});
}
}
setTimeout(task, 0);
@ -1551,6 +1687,9 @@
showPop: function(option) {
hideLoading(this);
let defaultCfg = {
showHeader: false,
headerTxt: "",
showHeader: false,
showCancel: false,
borderColor: '#BBE600',
buttonBgColor: '#BBE600',