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,6 +422,7 @@ function setDevceInfo(self, data) { ...@@ -422,6 +422,7 @@ function setDevceInfo(self, data) {
console.log("有最新的开门记录"); console.log("有最新的开门记录");
getLockInfo(self); getLockInfo(self);
} }
if(data.hasOwnProperty('notify_type')){
if(data.notify_type.value == 3){ if(data.notify_type.value == 3){
self.setDoorbellRingingFlag(true); self.setDoorbellRingingFlag(true);
setTimeout(() => { setTimeout(() => {
...@@ -431,6 +432,7 @@ function setDevceInfo(self, data) { ...@@ -431,6 +432,7 @@ function setDevceInfo(self, data) {
}else if(data.notify_type.value == 4){ }else if(data.notify_type.value == 4){
self.setRemoteOpendoorFlag(true); 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