Commit 764c8c01 by 朱建香

#35

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