Commit 764c8c01 by 朱建香

#35

1.普通用户扫码二维码绑定成功后,再次扫描二维码
2.在新建门锁用户以后第二次进入进行绑定操作成功后,直接进行解绑操作,会出现门锁用户被删除,关系仍然存在
3.获取门锁详情页面的引导页面icon与原页面大小不一致
4.门铃之后发送报警消息,报警图标也会随之摇摆
parent a5f9fdcf
...@@ -276,7 +276,8 @@ ...@@ -276,7 +276,8 @@
"guideStep3Tip": "关联后可了解<br>该用户的开门情况", "guideStep3Tip": "关联后可了解<br>该用户的开门情况",
"deleteSuccess": "删除成功", "deleteSuccess": "删除成功",
"deleteFailure": "删除失败", "deleteFailure": "删除失败",
"defaultName": "管理员" "defaultName": "管理员",
"bindedTip": "当前用户已授权,不可重复授权"
}, },
"editName":{ "editName":{
"nameInputTip": "请输入设备名称", "nameInputTip": "请输入设备名称",
......
...@@ -251,6 +251,7 @@ function deviceBind(self, lockId, relId, auid){ ...@@ -251,6 +251,7 @@ function deviceBind(self, lockId, relId, auid){
} }
function scanCodeSuccess(self){ function scanCodeSuccess(self){
iot.navigator.closeAllBesidesItself();
self.noticeTipShowFlag = !iot.native.isNotifycationOpen(); self.noticeTipShowFlag = !iot.native.isNotifycationOpen();
if(self.noticeTipShowFlag){ if(self.noticeTipShowFlag){
uComponents.showProcess(self, 1, Vue.t('addDevice.bindSuccess'), [{ uComponents.showProcess(self, 1, Vue.t('addDevice.bindSuccess'), [{
...@@ -278,7 +279,10 @@ function scanCodeSuccess(self){ ...@@ -278,7 +279,10 @@ function scanCodeSuccess(self){
}); });
iot.navigator.openWindow({ iot.navigator.openWindow({
url: '../device/index.html', url: '../device/index.html',
id: 'device' id: 'device',
extras: {
needClose: true
}
}); });
} }
}]); }]);
...@@ -293,7 +297,10 @@ function scanCodeSuccess(self){ ...@@ -293,7 +297,10 @@ function scanCodeSuccess(self){
}); });
iot.navigator.openWindow({ iot.navigator.openWindow({
url: '../device/index.html', url: '../device/index.html',
id: 'device' id: 'device',
extras: {
needClose: true
}
}); });
} }
}]); }]);
......
...@@ -466,6 +466,7 @@ function addSuccess(self){ ...@@ -466,6 +466,7 @@ function addSuccess(self){
error: (error) => {} error: (error) => {}
}); });
window.clearInterval(self.timeout); window.clearInterval(self.timeout);
iot.navigator.closeAllBesidesItself();
self.noticeTipShowFlag = !iot.native.isNotifycationOpen(); self.noticeTipShowFlag = !iot.native.isNotifycationOpen();
if(self.noticeTipShowFlag){ if(self.noticeTipShowFlag){
uComponents.showProcess(self, 1, Vue.t('wifiAdd.deviceActivateSuccess'), [{ uComponents.showProcess(self, 1, Vue.t('wifiAdd.deviceActivateSuccess'), [{
...@@ -493,7 +494,10 @@ function addSuccess(self){ ...@@ -493,7 +494,10 @@ function addSuccess(self){
}); });
iot.navigator.openWindow({ iot.navigator.openWindow({
url: '../device/index.html', url: '../device/index.html',
id: 'device' id: 'device',
extras: {
needClose: true
}
}); });
} }
}]); }]);
...@@ -507,7 +511,10 @@ function addSuccess(self){ ...@@ -507,7 +511,10 @@ function addSuccess(self){
}); });
iot.navigator.openWindow({ iot.navigator.openWindow({
url: '../device/index.html', url: '../device/index.html',
id: 'device' id: 'device',
extras: {
needClose: true
}
}); });
} }
}]); }]);
......
...@@ -765,6 +765,9 @@ async function updateHistoryMap(self, historyRecord){ ...@@ -765,6 +765,9 @@ async function updateHistoryMap(self, historyRecord){
self.opendoorRecordFlag = !response.open.isReadFlag; self.opendoorRecordFlag = !response.open.isReadFlag;
console.log(self.securityAlarmFlag); console.log(self.securityAlarmFlag);
if(self.hijackAlarmFlag == true){ if(self.hijackAlarmFlag == true){
//停止响铃
stopDoorbellRing(self);
//当前数据是新获取的数据时,有historyRecord.alarm,再次获取时无historyRecord.alarm,此时使用缓存时间
if(historyRecord.alarm){ if(historyRecord.alarm){
//显示劫持报警 //显示劫持报警
setMsgStatus(self, true, "hijack_img", false, true, moment(historyRecord.alarm,"YYYY-MM-DD hh:mm:ss").format("HH:mm"), Vue.t('device.hijackAlarm')); setMsgStatus(self, true, "hijack_img", false, true, moment(historyRecord.alarm,"YYYY-MM-DD hh:mm:ss").format("HH:mm"), Vue.t('device.hijackAlarm'));
...@@ -773,6 +776,9 @@ async function updateHistoryMap(self, historyRecord){ ...@@ -773,6 +776,9 @@ async function updateHistoryMap(self, historyRecord){
setMsgStatus(self, true, "hijack_img", false, true, moment.unix(response.alarm.time).format("HH:mm"), Vue.t('device.hijackAlarm')); setMsgStatus(self, true, "hijack_img", false, true, moment.unix(response.alarm.time).format("HH:mm"), Vue.t('device.hijackAlarm'));
} }
}else if(self.securityAlarmFlag == true){ }else if(self.securityAlarmFlag == true){
//停止响铃
stopDoorbellRing(self);
//当前数据是新获取的数据时,有historyRecord.notify,再次获取时无historyRecord.notify,此时使用缓存时间
if(historyRecord.notify){ if(historyRecord.notify){
//显示安全报警 //显示安全报警
setMsgStatus(self, true, "securityAlarm_img", false, true, moment(historyRecord.notify,"YYYY-MM-DD hh:mm:ss").format("HH:mm"), Vue.t('device.securityAlarm')); setMsgStatus(self, true, "securityAlarm_img", false, true, moment(historyRecord.notify,"YYYY-MM-DD hh:mm:ss").format("HH:mm"), Vue.t('device.securityAlarm'));
...@@ -781,6 +787,8 @@ async function updateHistoryMap(self, historyRecord){ ...@@ -781,6 +787,8 @@ async function updateHistoryMap(self, historyRecord){
setMsgStatus(self, true, "securityAlarm_img", false, true, moment.unix(response.notify.time).format("HH:mm"), Vue.t('device.securityAlarm')); setMsgStatus(self, true, "securityAlarm_img", false, true, moment.unix(response.notify.time).format("HH:mm"), Vue.t('device.securityAlarm'));
} }
}else{ }else{
//停止响铃
stopDoorbellRing(self);
if((self.getMsgClass() == 'hijack_img') || (self.getMsgClass() == 'securityAlarm_img')){ if((self.getMsgClass() == 'hijack_img') || (self.getMsgClass() == 'securityAlarm_img')){
setMsgStatus(self, false, "default_img", false, false, '', ''); setMsgStatus(self, false, "default_img", false, false, '', '');
} }
......
...@@ -368,16 +368,27 @@ function editNameTap(self){ ...@@ -368,16 +368,27 @@ function editNameTap(self){
//tap 邀请绑定 //tap 邀请绑定
function bindButtonTap(self){ function bindButtonTap(self){
iot.navigator.openWindow({ checkUser(self, (data) => {
url: './inviteBind.html', if(data.auids){
id: 'inviteBind', uComponents.openAlert(self, Vue.t('doorlockUser.bindedTip'), {
extras: { text: Vue.t('dialog.confirm'), callback: function () {
uuid: self.extras.uuid, self.setInfo(data);
id: self.extras.id, setUserInfo(self, data);
deviceId: self.getInfo().device_id, }
lockId: self.extras.lockId });
} }else{
}); iot.navigator.openWindow({
url: './inviteBind.html',
id: 'inviteBind',
extras: {
uuid: self.extras.uuid,
id: self.extras.id,
deviceId: self.getInfo().device_id,
lockId: self.extras.lockId
}
});
}
});
} }
//tap 解绑 //tap 解绑
...@@ -505,28 +516,55 @@ function iSeeButtonTap(self){ ...@@ -505,28 +516,55 @@ function iSeeButtonTap(self){
//删除用户 //删除用户
function deleteUser(self){ function deleteUser(self){
uComponents.showLoading(self); uComponents.showLoading(self);
if(self.info.auids){ //确认该用户是否被绑定
iot.business.sds.unbindByManager({ checkUser(self, (data) => {
data: { self.setInfo(data);
uuid: self.extras.uuid, //判断该用户是否绑定
destAuid: self.info.auids if(self.info.auids){
}, iot.business.sds.unbindByManager({
success: (response) => { data: {
deleteCloudeUser(self); uuid: self.extras.uuid,
}, destAuid: self.info.auids
error: (error) => { },
console.log(error); success: (response) => {
uComponents.openAlert(self, Vue.t('doorlockUser.deleteFailure'), { deleteCloudeUser(self);
text: Vue.t('btn.confirm'), callback: function () { },
} error: (error) => {
}); console.log(error);
}, uComponents.openAlert(self, Vue.t('doorlockUser.deleteFailure'), {
complete: () => { text: Vue.t('btn.confirm'), callback: function () {
} }
}); });
}else{ },
deleteCloudeUser(self); complete: () => {
} }
});
}else{
deleteCloudeUser(self);
}
})
}
function checkUser(self, callback){
iot.business.api.sendCustom('lock/getUserInfo',{
data: {
rel_id: self.extras.id,
device_id: self.extras.lockId
},
success: (response) => {
let data = uPublic.checkResponseData(response.data);
console.log(data);
if(data){
callback(data);
}else{}
},
error: (error) => {
console.log(error);
uPublic.openRequestErrorAlert(self);
},
complete: () => {
}
});
} }
function deleteCloudeUser(self){ function deleteCloudeUser(self){
......
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