Commit 803870aa by 朱建香

1012

parent d8d8d909
......@@ -408,12 +408,12 @@ function getLockInfo(self){
//设置设备信息
function setDevceInfo(self, data) {
console.log("监听到了");
data = {
"battery": {"value": "32"},
"lock_action": {"value": "0"},
"notify_type": {"value": "4"},
"time": {"value": "122324433221"}
}
// data = {
// "battery": {"value": "32"},
// "lock_action": {"value": "0"},
// "notify_type": {"value": "4"},
// "time": {"value": "122324433221"}
// }
console.log(data);
self.setBatteryPercent(data.battery.value);
self.setBatteryState(config.powerIcon[Math.round(data.battery.value/20)]);
......@@ -422,14 +422,16 @@ function setDevceInfo(self, data) {
console.log("有最新的开门记录");
getLockInfo(self);
}
if(data.notify_type.value == 3){
self.setDoorbellRingingFlag(true);
setTimeout(() => {
self.setDoorbellRingingFlag(false);
self.setRingingTime(moment(data.time.value, "YY-MM-DD-hh-mm-ss").format("HH:mm"));
},3000);
}else if(data.notify_type.value == 4){
self.setRemoteOpendoorFlag(true);
if(data.hasOwnProperty('notify_type')){
if(data.notify_type.value == 3){
self.setDoorbellRingingFlag(true);
setTimeout(() => {
self.setDoorbellRingingFlag(false);
self.setRingingTime(moment(data.time.value, "YY-MM-DD-hh-mm-ss").format("HH:mm"));
},3000);
}else if(data.notify_type.value == 4){
self.setRemoteOpendoorFlag(true);
}
}
}
......@@ -518,7 +520,7 @@ function remoteOpendoorTap(self){
//tap 劫持报警
function hijackAlarmTap(self){
if(self.setValueHijackAlarm() == 1){
if(self.getValueHijackAlarm() == 1){
iot.navigator.openWindow({
url: './hijackRecord.html',
id: 'hijackRecord',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment