Commit 803870aa by 朱建香

1012

parent d8d8d909
...@@ -408,12 +408,12 @@ function getLockInfo(self){ ...@@ -408,12 +408,12 @@ function getLockInfo(self){
//设置设备信息 //设置设备信息
function setDevceInfo(self, data) { function setDevceInfo(self, data) {
console.log("监听到了"); console.log("监听到了");
data = { // data = {
"battery": {"value": "32"}, // "battery": {"value": "32"},
"lock_action": {"value": "0"}, // "lock_action": {"value": "0"},
"notify_type": {"value": "4"}, // "notify_type": {"value": "4"},
"time": {"value": "122324433221"} // "time": {"value": "122324433221"}
} // }
console.log(data); console.log(data);
self.setBatteryPercent(data.battery.value); self.setBatteryPercent(data.battery.value);
self.setBatteryState(config.powerIcon[Math.round(data.battery.value/20)]); self.setBatteryState(config.powerIcon[Math.round(data.battery.value/20)]);
...@@ -422,14 +422,16 @@ function setDevceInfo(self, data) { ...@@ -422,14 +422,16 @@ function setDevceInfo(self, data) {
console.log("有最新的开门记录"); console.log("有最新的开门记录");
getLockInfo(self); getLockInfo(self);
} }
if(data.notify_type.value == 3){ if(data.hasOwnProperty('notify_type')){
self.setDoorbellRingingFlag(true); if(data.notify_type.value == 3){
setTimeout(() => { self.setDoorbellRingingFlag(true);
self.setDoorbellRingingFlag(false); setTimeout(() => {
self.setRingingTime(moment(data.time.value, "YY-MM-DD-hh-mm-ss").format("HH:mm")); self.setDoorbellRingingFlag(false);
},3000); self.setRingingTime(moment(data.time.value, "YY-MM-DD-hh-mm-ss").format("HH:mm"));
}else if(data.notify_type.value == 4){ },3000);
self.setRemoteOpendoorFlag(true); }else if(data.notify_type.value == 4){
self.setRemoteOpendoorFlag(true);
}
} }
} }
...@@ -518,7 +520,7 @@ function remoteOpendoorTap(self){ ...@@ -518,7 +520,7 @@ function remoteOpendoorTap(self){
//tap 劫持报警 //tap 劫持报警
function hijackAlarmTap(self){ function hijackAlarmTap(self){
if(self.setValueHijackAlarm() == 1){ if(self.getValueHijackAlarm() == 1){
iot.navigator.openWindow({ iot.navigator.openWindow({
url: './hijackRecord.html', url: './hijackRecord.html',
id: 'hijackRecord', 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