670分享功能
This commit is contained in:
@ -53,6 +53,14 @@
|
|||||||
<view v-bind:class="getWarnStyle(5)" class="net netfive"></view>
|
<view v-bind:class="getWarnStyle(5)" class="net netfive"></view>
|
||||||
</view>
|
</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">
|
<view class="optTitle">
|
||||||
档位
|
档位
|
||||||
@ -683,15 +691,7 @@
|
|||||||
buttonText: "确定",
|
buttonText: "确定",
|
||||||
clickEvt: "staticWarn"
|
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,112 @@
|
|||||||
|
|
||||||
setTimeout(task, 0);
|
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();
|
||||||
|
}
|
||||||
|
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) {
|
sosSetting: function(type) {
|
||||||
if (this.formData.SOS == type) {
|
if (this.formData.SOS == type) {
|
||||||
type = "close";
|
type = "close";
|
||||||
@ -876,7 +982,8 @@
|
|||||||
dataView.setUint8(1, 0x06); // 帧类型
|
dataView.setUint8(1, 0x06); // 帧类型
|
||||||
dataView.setUint8(5, 0x70); // 数据
|
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);
|
console.log("蓝牙发送报警成功", type);
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -892,7 +999,35 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (type !== 'sg') {
|
||||||
SendCmd();
|
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);
|
setTimeout(task, 0);
|
||||||
@ -1551,6 +1686,7 @@
|
|||||||
showPop: function(option) {
|
showPop: function(option) {
|
||||||
hideLoading(this);
|
hideLoading(this);
|
||||||
let defaultCfg = {
|
let defaultCfg = {
|
||||||
|
showHeader: false,
|
||||||
showCancel: false,
|
showCancel: false,
|
||||||
borderColor: '#BBE600',
|
borderColor: '#BBE600',
|
||||||
buttonBgColor: '#BBE600',
|
buttonBgColor: '#BBE600',
|
||||||
|
Reference in New Issue
Block a user