Commit 05505326 by 朱建香

1108

parent 18a27276
......@@ -188,6 +188,13 @@
"helpCont4": "(提示:如果指纹锁已经绑定过用户,重新绑定成功后会清除之前所有绑定信息)"
},
"wifiAdd": {
"unbindWifiTip": "当前无Wi-Fi",
"wifiBinding": "配网中",
"wifiBindSuccess": "配网成功,请激活设备",
"deviceActivating": "设备激活中",
"deviceActivateSuccess":"激活成功",
"deviceActivateFailure":"激活失败",
"bindTimeout":"连接超时",
"passwordInputTip": "请输入Wi-Fi密码",
"remindTitle": "配置Wi-Fi提醒:",
"remindCont1": "1. 请确保Wi-Fi信号良好",
......
......@@ -37,7 +37,7 @@ class crypto{
let key = CryptoJS.enc.Utf8.parse(keyIv.key);
let iv = CryptoJS.enc.Utf8.parse(keyIv.iv);;
let decryptedData = CryptoJS.AES.decrypt(code, key, { iv: iv},{ mode: CryptoJS.mode.CBC, padding: CryptoJS.pad.nopadding });
return JSON.parse(decryptedData.toString(CryptoJS.enc.Utf8));
return decryptedData.toString(CryptoJS.enc.Utf8);
}
}
......
......@@ -73,7 +73,7 @@ function getDeviceList(self){
self.setDeviceList(data);
for(let i =0; i<data.length; i++){
list[i] = {
leftImage: '../../resources/image/deviceImg.png',
leftImage: data[i].icon,
title: data[i].deviceName,
subtitle: Vue.t('deviceList.model')+data[i].model,
rightIcon: '&#xe6a7;'
......
......@@ -135,10 +135,11 @@ function backTap(){
//tap 连接
function connectButtonTap(self){
console.log(self.getTextWiFiName());
// self.setTextPassword('macro_scope00');
console.log(self.getTextPassword());
if(self.getTextPassword() == null || self.getTextPassword().trim() == ''){
// console.log(self.getTextWiFiName());
// console.log(self.getTextPassword());
if(self.getTextWiFiName() == null || self.getTextWiFiName().trim() == ''){
self.setTextErrorTip(Vue.t('wifiAdd.unbindWifiTip'));
}else if(self.getTextPassword() == null || self.getTextPassword().trim() == ''){
self.setTextErrorTip(Vue.t('wifiAdd.passwordInputTip'));
}else{
iot.business.sds.findWifi({
......@@ -154,12 +155,14 @@ function connectButtonTap(self){
if(response.data == 'onProvisioning'){
//wifi链接中
uComponents.showCommLoading(self);
uComponents.changeCommLoadingStatusAndText(self, 0, Vue.t('wifiAdd.wifiBinding'));
}else if(response.data == 'provisioned success'){
//wifi连接成功,停止连接wifi
// iot.business.sds.stopFindWifi({
// success: (response) => {},
// error: (error) => {}
// });
uComponents.changeCommLoadingStatusAndText(self, 0, Vue.t('wifiAdd.wifiBindSuccess'));
// iot.business.sds.stopFindWifi({
// success: (response) => {},
// error: (error) => {}
// });
}
},
error: (error) => {
......@@ -169,32 +172,17 @@ function connectButtonTap(self){
let deviceId = null;
iot.business.sds.findDevices({
success: (response) => {
console.log("findDevices");
console.log(response);
let parameters = {};
if (response.data) {
let info = response.data.split(':[');
if(info[1]){
let query = info[1].split(',');
console.log(query);
for(let i=0; i< query.length; i++){
let pari = query[i].split(' = ');
console.log(pari);
parameters[pari[0]] = pari[1];
}
console.log(parameters.sn);
}
}
if(parameters.sn){
deviceId = parameters.sn;
}
let productId = iot.navigator.getExtras().model;
if(response.data == "joined success"){
if(response.data == "onJoining"){
uComponents.changeCommLoadingStatusAndText(self, 0, Vue.t('wifiAdd.deviceActivating'));
}else if(response.data == "joined success"){
let deviceId = response.info.sn;
unbind(self, deviceId, productId);
// bind(self, deviceId, productId);
}else if(response.data == "fail"){
//连接失败
uComponents.changeCommLoadingStatusAndText(self, 2, Vue.t('addDevice.bindFailure'));
uComponents.changeCommLoadingStatusAndText(self, 2, Vue.t('wifiAdd.deviceActivateFailure'));
self.setStatus(2);
uComponents.changeCommButtonText(self, Vue.t('addDevice.reBindDevice'));
//停止查找设备
......@@ -213,7 +201,7 @@ function connectButtonTap(self){
if(self.getStatus() == 0){
console.log("timeout");
//连接失败
uComponents.changeCommLoadingStatusAndText(self, 2, Vue.t('addDevice.bindFailure'));
uComponents.changeCommLoadingStatusAndText(self, 2, Vue.t('wifiAdd.bindTimeout'));
self.setStatus(2);
uComponents.changeCommButtonText(self, Vue.t('addDevice.reBindDevice'));
//停止查找设备
......@@ -272,14 +260,14 @@ function bind(self, deviceId, productId){
console.log(response);
let data = response.data;
if(data.success){
uComponents.changeCommLoadingStatusAndText(self, 1, Vue.t('addDevice.bindSuccess'));
uComponents.changeCommLoadingStatusAndText(self, 1, Vue.t('wifiAdd.deviceActivateSuccess'));
uComponents.changeCommButtonText(self, Vue.t('btn.confirm'));
self.setStatus(1);
}
},
error: (error) => {
console.log(error);
uComponents.changeCommLoadingStatusAndText(self, 2, Vue.t('addDevice.bindFailure'));
uComponents.changeCommLoadingStatusAndText(self, 2, Vue.t('wifiAdd.deviceActivateFailure'));
uComponents.changeCommButtonText(self, Vue.t('addDevice.reBindDevice'));
self.setStatus(2);
},
......
......@@ -62,6 +62,12 @@ function init() {
newMsg: '',
//是否第一次获取门锁信息
isFirstGetLockInfo: true,
opendoorRecordFlag: false,
securityAlarmFlag: false,
hijackAlarmFlag: false,
notifyTime: null,
alarmTime: null,
openTime: null,
//是否显示远程开门页面
remoteOpendoorShowFlag: false,
//远程开门密码
......@@ -69,7 +75,7 @@ function init() {
//远程开门错误提示
textErrorTip: null,
//当前状态
status: null
status: 0
},
mounted(){
let self = this;
......@@ -390,6 +396,101 @@ function initComponentsConfig() {
}
}
async function getRecordTime(self, data){
// let notifyTime = null;
// let alarmTime = null;
// let openTime = null;
try{
self.notifyTime = await getRecordTimeMap('notifyTime');
}
catch (error) {
console.log(error);
}
try{
self.alarmTime = await getRecordTimeMap('alarmTime');
}
catch (error) {
console.log(error);
}
try{
self.openTime = await getRecordTimeMap('openTime');
}
catch (error) {
console.log(error);
}
let newNotifyTime = moment(data.notify_time);
let newAlarmTime = moment(data.alarm_time);
let newOpenTime = moment(data.open_time);
console.log("newNotifyTime"+newNotifyTime);
console.log("newAlarmTime"+newAlarmTime);
console.log("newOpenTime"+newOpenTime);
console.log("notifyTime"+self.notifyTime);
console.log("alarmTime"+self.alarmTime);
console.log("openTime"+self.openTime);
let now = moment();
if(self.notifyTime){
self.notifyTime = moment(self.notifyTime,moment.ISO_8601);
if(newNotifyTime != null && newNotifyTime.diff(self.notifyTime, 'seconds') > 0){
self.securityAlarmFlag = true;
self.notifyTime = newNotifyTime;
}
}else{
if(newNotifyTime != null && now.diff(newNotifyTime, 'seconds') < 1){
self.securityAlarmFlag = true;
self.notifyTime = newNotifyTime;
}
}
if(self.alarmTime){
self.alarmTime = moment(self.alarmTime,moment.ISO_8601);
if(newAlarmTime != null && newAlarmTime.diff(self.alarmTime, 'seconds') > 0){
self.hijackAlarmFlag = true;
self.alarmTime = newAlarmTime.unix();
}
}else{
if(newAlarmTime != null && now.diff(newAlarmTime, 'seconds') < 1){
self.hijackAlarmFlag = true;
self.alarmTime = newAlarmTime;
}
}
if(self.openTime){
self.openTime = moment(self.openTime,moment.ISO_8601);
if(newOpenTime != null && newOpenTime.diff(self.openTime, 'seconds') > 0){
self.opendoorRecordFlag = true;
self.openTime = newOpenTime;
}
}else{
if(newOpenTime != null && now.diff(newOpenTime, 'seconds') < 1){
self.opendoorRecordFlag = true;
console.log(newOpenTime);
self.openTime = newOpenTime;
}
}
}
function setRecordTime(timeKey, time){
console.log(time);
iot.storage.setMap(timeKey, time, (res) => {
console.log(res);
}, () => {
});
}
//获取websql上的firstLogin
function getRecordTimeMap(time) {
return new Promise(function (resolve, reject) {
console.log(time);
iot.storage.getMap(time, (res) => {
if (res) {
resolve(res);
} else {
reject(res);
}
}, (err) => {
console.log(err);
});
})
}
function setValueOfSwitch(self, flag){
self.setValueOpendoorRecord(flag);
self.setValueSecurityAlarm(flag);
......@@ -427,6 +528,7 @@ function getLockInfo(self){
console.log(response);
let data = uPublic.checkResponseData(response.data);
if(data){
getRecordTime(self, data);
//判断云端是否绑定
if(data.lock_id){
setValueOfSwitch(self, 1);
......@@ -497,18 +599,20 @@ function setDevceInfo(self, data) {
//请求远程开门
// self.setRemoteOpendoorFlag(true);
self.setValueRemoteOpendoor(true);
}else if(data.notify_type.value == 2){
getLockInfo(self);
}
}
if(data.action.value == 'lock_log' && (data.lock_action.value == '1' || data.lock_action.value == '4')){
//开门或远程开门成功
getLockInfo(self);
if(data.lock_action.value == '4'){
uComponents.changeCommLoadingStatusAndText(self, 2, Vue.t('remoteOpendoor.openDoorSuccess'));
uComponents.changeCommLoadingStatusAndText(self, 1, Vue.t('remoteOpendoor.openDoorSuccess'));
uComponents.changeCommButtonText(self, Vue.t('btn.confirm'));
self.setStatus(1);
}
}
if(data.ErrorCode){
if(data.ErrorCode.value != 0){
//远程开门失败
uComponents.changeCommLoadingStatusAndText(self, 2, Vue.t('remoteOpendoor.openDoorFailure'));
uComponents.changeCommButtonText(self, Vue.t('remoteOpendoor.remoteOpendoorAgain'));
......@@ -633,6 +737,8 @@ function doorlockManageTap(self){
//tap 开门记录
function opendoorRecordTap(self){
if(self.getValueOpendoorRecord() == 1){
self.opendoorRecordFlag = false;
setRecordTime('openTime', self.openTime.toISOString());
iot.navigator.openWindow({
url: './opendoorRecord.html',
id: 'opendoorRecord',
......@@ -646,6 +752,8 @@ function opendoorRecordTap(self){
//tap 安全报警
function securityAlarmTap(self){
if(self.getValueSecurityAlarm() == 1){
self.securityAlarmFlag = false;
setRecordTime('notifyTime', self.notifyTime.toISOString());
iot.navigator.openWindow({
url: './alarmInfo.html',
id: 'alarmInfo',
......@@ -691,6 +799,8 @@ function remoteOpendoorTap(self){
//tap 劫持报警
function hijackAlarmTap(self){
if(self.getValueHijackAlarm() == 1){
self.hijackAlarmFlag = false;
setRecordTime('alarmTime', self.alarmTime.toISOString());
iot.navigator.openWindow({
url: './hijackRecord.html',
id: 'hijackRecord',
......@@ -733,7 +843,6 @@ function confirmButtonTap(self){
console.log(self.mac);
let keyIv = crypto.enkey(self.mac.replace(/:/g,''));
console.log(keyIv);
self.setTextPassword({'pwd': '123'});
let pwd = crypto.encode(self.getTextPassword(), keyIv);
console.log(pwd);
let msg = crypto.decode(pwd, keyIv);
......@@ -746,25 +855,29 @@ function confirmButtonTap(self){
'value': 'openDoor'
},
'remote_open_door': {
// 'value': pwd
'value': self.getTextPassword()
'value': pwd
}
}
},
success: (response) => {
//密码下发成功
console.log(response);
self.setStatus(0);
// uComponents.showCommLoading(self);
self.getStatus(0);
// uComponents.changeCommLoadingStatusAndText(self, 1, Vue.t('remoteOpendoor.openDoorSuccess'));
// uComponents.changeCommButtonText(self, Vue.t('btn.confirm'));
},
error: (error) => {
console.log(error);
},
complete(){
uComponents.hideLoading(self);
// uComponents.hideCommLoading(self);
}
});
}
console.log('aaaa');
setTimeout(function (){
console.log(self.getStatus());
if(self.getStatus() == 0){
console.log("timeout");
//连接失败
......@@ -779,6 +892,7 @@ function confirmButtonTap(self){
function commLoadingButtonTap(self){
if(self.getStatus() == 1){
//绑定成功
console.log("1111");
uComponents.hideCommLoading(self);
self.setRemoteOpendoorShowFlag(false);
......
{"loading":"loading...","scroll":{"clickToLoadMore":"点击加载更多","loading":"loading..."},"btn":{"confirm":"确定","guideLogin":"账号/密码登录","login":"登录","getCode":"获取验证码","register":"注册","logout":"退出系统","save":"保存","qrcode":"生成二维码","wifiAdd":"开始配置Wi-Fi","connect":"连接","bindUser":"绑定姓名","bind":"我要绑定","reBound":"请重新绑定","saveQRcode":"保存二维码到相册","unbind":"解绑","deleteUser":"删除该用户","qrcodeReset":"重新生成二维码","add":"添加","next":"下一步","iSee":"我知道了","unbindDoorlock":"解绑门锁"},"dialog":{"confirm":"确认","cancel":"取消","unbind":"解绑","delete":"删除"},"title":{"login":"登录","register":"注册","forgetPassword":"忘记密码","device":"智能指纹锁","opendoorRecord":"开门记录","alarmInfo":"报警信息","remoteOpendoor":"远程开门","hijackRecord":"劫持记录","doorlockManage":"门锁管理","editName":"修改名称","qrcode":"生成绑定二维码","addDevice":"添加设备","scanCodeAdd":"扫描绑定设备","wifiAddHelp":"配置Wi-Fi","wifiAdd":"连接Wi-Fi","bindUserHelp":"ID-姓名绑定","bindUser":"绑定用户","userList":"用户列表","doorlockUser":"门锁用户","addUser":"添加用户","inviteBind":"邀请绑定","unlockInfo":"关联开锁信息","myInfo":"个人信息","editNickname":"修改昵称","editPassword":"修改密码","addUnlockInfo":"绑定开锁信息","deviceList":"产品型号"},"guide":{"footer":"指纹改变生活"},"login":{"telInputTip":"请输入手机号","passwordInputTip":"请输入密码","register":"快速注册","forgetPassword":"忘记密码","failure":"登陆失败","error":{"telNull":"请输入手机号","passWordNull":"请输入密码"}},"register":{"telInputTip":"请输入手机号","codeInputTip":"请输入验证码","passwordInputTip":"请输入6位登录密码","error":{"telNull":"请输入手机号","codeNull":"请输入验证码","passWordNull":"请输入密码"}},"forgetPassword":{"telInputTip":"请输入手机号","codeInputTip":"请输入验证码","passwordInputTip":"请输入6位登录密码","error":{"telNull":"请输入手机号","codeNull":"请输入验证码","passWordNull":"请输入密码"}},"device":{"opendoorRecord":"开门记录","securityAlarm":"安全报警","doorlockUser":"门锁用户","remoteOpendoor":"远程开门","hijackAlarm":"劫持报警","doorlockManage":"门锁管理","followTitle":"关注服务号","followCont1":"关注 “i智信” 微信服务号可随时随地掌握设备动态<br>再也不担心错过重要通知,赶紧按下方提示试试吧","followCont2":"1.保存二维码-2.用微信从<span>相册选取扫码</span>-3.关注","laterFollow":"稍后关注","newMsgDoorlock":"门锁最新消息","doorLockRinging":"门铃响了","defaultNewMsg":"您尚未绑定门锁","noNewMsg":"门锁休息中","bindDoorlock":"绑定门锁"},"opendoorRecord":{"noRecordTip":"暂无记录","passwordOpenDoor":"密码开门","fingerprintOpenDoor":"指纹开门","ICcardOpenDoor":"IC卡开门","remoteOpenDoor":"遥控器开门","keyOpenDoor":"钥匙开门","hijackingAlarm":"劫持报警","appRemoteOpenDoor":"app远程开门"},"alarmInfo":{"noInfoTip":"暂无信息","tamperAlarm":"防撬报警","trialAlarm":"试错报警","powerAlarm":"欠电报警","fackLockAlram":"假锁报警"},"remoteOpendoor":{"loading":"远程开门中","passwordInputTip":"请输入远程开门密码","openDoorSuccess":"远程开门成功","openDoorFailure":"远程开门失败","remoteOpendoorAgain":"请尝试重试","error":{"noPasswordTip":"远程密码不能为空"}},"hijackRecord":{"noRecordTip":"暂无记录","hijackingAlarm":"劫持指纹报警"},"doorlockManage":{"name":"名称","deleteDialogTip":"<span>{0}</span>将被删除","logoutDialogTip":"确定要退出系统吗?","deleteSuccess":"删除成功","deleteFailue":"删除失败","defaultNickname":"门锁","unbindDialogTip":"<span></span>解锁门锁后,您将失去对该门锁<br>所有查看、管理等功能操作","unbindSuccess":"解绑成功","doorbellMsgPush":"门铃消息推送","alarmMsgPush":"报警消息推送","opendoorMsgPush":"开门消息推送"},"editName":{"nameInputTip":"请输入设备名称","nickNameInputTip":"请输入用户名","editNameSuccess":"修改名称成功","editNameFailue":"修改名称失败","error":{"nameCanNotBeBlank":"设备名称不能为空","nicknameCanNotBeBlank":"用户名不能为空"}},"qrcode":{"helpTitle":"注意事项:","helpCont1":"1.仅超级管理员(通过Wi-Fi配网绑定的用户为超级管理员)可以生成绑定二维码","helpCont2":"2.二维码有效时间为10分钟且只能使用一次","helpCont3":"3.用户只需要扫描该二维码即可绑定指纹锁","helpCont4":"4.绑定失败则需要重新生成二维码进行绑定"},"addDevice":{"scanCodeAdd":"扫描绑定设备","wifiAdd":"配置Wi-Fi","loading":"loading","bindSuccess":"绑定成功","bindFailure":"绑定失败","reBindDevice":"请重新绑定"},"wifiAddHelp":{"helpTitle":"配置Wi-Fi说明:","helpCont1":"1.按下指纹锁背面的按钮,进入主菜单,选择Wi-Fi设置→配置Wi-Fi,门锁进入等待配网状态","helpCont2":"2.点击页面 “开始配置Wi-Fi” 按钮,进入Wi-Fi配网画面","helpCont3":"3.输入Wi-Fi密码,点击 “l连接” 按钮,等待锁端相应,直至配网成功","helpCont4":"(提示:如果指纹锁已经绑定过用户,重新绑定成功后会清除之前所有绑定信息)"},"wifiAdd":{"passwordInputTip":"请输入Wi-Fi密码","remindTitle":"配置Wi-Fi提醒:","remindCont1":"1. 请确保Wi-Fi信号良好","remindCont2":"2. 本产品暂不支持5GHz无线网络","error":{}},"bindUserHelp":{"helpTitle":"配对姓名说明:","helpCont1":"1.在指纹锁上录入指纹、密码、卡并获得相应ID","helpCont2":"2.通过姓名绑定将该ID绑定对应用户姓名","helpCont3":"3.绑定成功后,开门记录中将会显示已绑定的用户姓名","helpCont4":"4.用户姓名信息只保存在APP端,不影响锁端设置","boundUser":"查看已绑定ID姓名"},"bindUser":{"editHeadTip":"点击编辑用户头像","nameTitle":"姓名","fingerprintIDTitle":"指纹ID","passwordIDTitle":"密码ID","ICCardIDTitle":"IC卡ID","requiredInputTip":"(必填)","optionalInputTip":"(选填)","error":{}},"userList":{"name":"昵称:","noUserTip":"暂无用户"},"commstatusLoading":{"connectSuccess":"Wi-Fi连接成功,正在绑定...","bindSuccess":"绑定成功","bindFailed":"绑定失败"},"addUser":{"nameInputTip":"请输入您想添加的用户名","addUserSuccess":"添加用户成功","addUserFailure":"添加用户失败","error":{"nameCanNotEmpty":"用户名不能为空"}},"doorlockUser":{"name":"昵称:","inviteBind":"邀请绑定","bindUnlockInfo":"关联开锁信息","opendoorRecord":"历史开门记录","unbindDialogTip":"<span></span>解绑后,您将失去对门锁所有查看功能该用户仍在用户列表中","deleteUserDialogTip":"删除后,二者不再为绑定关系,用户无法查看该门锁下的任何信息,该用户名下绑定的所有ID号仍可以显示在开门记录中","unbindSuccess":"解绑成功","unbindFailue":"解绑失败","guideStep1Tip1":"邀请绑定成功","guideStep1Tip2":"(可查看开门记录,报警记录等<br>相关门锁信息)","guideStep3Tip":"绑定后看可了解<br>该用户的开门情况","deleteSuccess":"删除成功","deleteFailure":"删除失败"},"inviteBind":{"qrcodeExpireTip":"二维码已过期,请重新生成","title":"注意事项:","cont1":"1.直接通过微信扫一扫添加门锁","cont2":"2.将此二维码保存为图片,发送给好友,好友通过长按识别二维码"},"unlockInfo":{"bindUnlockInfo":"已关联的开锁信息","noInfoTip":"目前无绑定任何信息,请添加","passwordOpenDoor":"密码","fingerprintOpenDoor":"指纹","ICcardOpenDoor":"IC卡","remoteOpenDoor":"遥控器","keyOpenDoor":"钥匙","appRemoteOpenDoor":"app远程","hijackingAlarm":"劫持指纹","setHijack":"设为劫持","setHijackTip":"确认设为劫持指纹吗?","cancelHijack":"取消劫持","cancelHijackTip":"确认取消劫持指纹吗?","cancelAssociated":"取消关联","cancelAssociatedTip":"取消关联后,开门历史记录中将不再显示关联的用户信息","cancelAssociatedSuccess":"取消关联成功","cancelAssociatedFailue":"取消关联失败","setHijackSuccess":"设为劫持指纹成功","setHijackFailue":"设为劫持指纹失败","cancelHijackSuccess":"设为劫持指纹成功","cancelHijackFailue":"设为劫持指纹失败"},"addUnlockInfo":{"opendoorMode":"选择要关联的开锁方式","fingerprint":"指纹","password":"密码","icCard":"IC卡","key":"钥匙","hijackFingerprint":"劫持指纹","opendoorRecord":"选择要关联的开锁ID","tip":"仅显示未绑定开门记录","addInfoSuccess":"添加绑定开锁信息成功","addInfoFailue":"添加绑定开锁信息失败","noRecordTip":"暂无记录","setHijackSwitch":"设为劫持指纹","guideStep1Tip":"选择需要添加关联的开门方式","guideStep3Tip":"根据开门记录中的开门时间,选择关联的<br>开门ID<span>(一个ID只能被一个用户绑定)</span>","guideStep5Tip":"使用劫持指纹开门时,会以报警形式<br>通知到该门锁名下的其他绑定用户"},"myInfo":{"editNickname":"修改昵称","editPassword":"修改密码","logoutDialogTip":"确定要退出系统吗?"},"editNickname":{"nickNameInputTip":"请输入昵称"},"editPassword":{"newPasswordInputTip":"请输入新密码","oldPasswordInputTip":"请输入旧密码","oldPasswordInputTipAgain":"请再次输入旧密码"},"request":{"error":"请求发送失败"},"deviceList":{"model":"型号:"}}
\ No newline at end of file
{"loading":"loading...","scroll":{"clickToLoadMore":"点击加载更多","loading":"loading..."},"btn":{"confirm":"确定","guideLogin":"账号/密码登录","login":"登录","getCode":"获取验证码","register":"注册","logout":"退出系统","save":"保存","qrcode":"生成二维码","wifiAdd":"开始配置Wi-Fi","connect":"连接","bindUser":"绑定姓名","bind":"我要绑定","reBound":"请重新绑定","saveQRcode":"保存二维码到相册","unbind":"解绑","deleteUser":"删除该用户","qrcodeReset":"重新生成二维码","add":"添加","next":"下一步","iSee":"我知道了","unbindDoorlock":"解绑门锁"},"dialog":{"confirm":"确认","cancel":"取消","unbind":"解绑","delete":"删除"},"title":{"login":"登录","register":"注册","forgetPassword":"忘记密码","device":"智能指纹锁","opendoorRecord":"开门记录","alarmInfo":"报警信息","remoteOpendoor":"远程开门","hijackRecord":"劫持记录","doorlockManage":"门锁管理","editName":"修改名称","qrcode":"生成绑定二维码","addDevice":"添加设备","scanCodeAdd":"扫描绑定设备","wifiAddHelp":"配置Wi-Fi","wifiAdd":"连接Wi-Fi","bindUserHelp":"ID-姓名绑定","bindUser":"绑定用户","userList":"用户列表","doorlockUser":"门锁用户","addUser":"添加用户","inviteBind":"邀请绑定","unlockInfo":"关联开锁信息","myInfo":"个人信息","editNickname":"修改昵称","editPassword":"修改密码","addUnlockInfo":"绑定开锁信息","deviceList":"产品型号"},"guide":{"footer":"指纹改变生活"},"login":{"telInputTip":"请输入手机号","passwordInputTip":"请输入密码","register":"快速注册","forgetPassword":"忘记密码","failure":"登陆失败","error":{"telNull":"请输入手机号","passWordNull":"请输入密码"}},"register":{"telInputTip":"请输入手机号","codeInputTip":"请输入验证码","passwordInputTip":"请输入6位登录密码","error":{"telNull":"请输入手机号","codeNull":"请输入验证码","passWordNull":"请输入密码"}},"forgetPassword":{"telInputTip":"请输入手机号","codeInputTip":"请输入验证码","passwordInputTip":"请输入6位登录密码","error":{"telNull":"请输入手机号","codeNull":"请输入验证码","passWordNull":"请输入密码"}},"device":{"opendoorRecord":"开门记录","securityAlarm":"安全报警","doorlockUser":"门锁用户","remoteOpendoor":"远程开门","hijackAlarm":"劫持报警","doorlockManage":"门锁管理","followTitle":"关注服务号","followCont1":"关注 “i智信” 微信服务号可随时随地掌握设备动态<br>再也不担心错过重要通知,赶紧按下方提示试试吧","followCont2":"1.保存二维码-2.用微信从<span>相册选取扫码</span>-3.关注","laterFollow":"稍后关注","newMsgDoorlock":"门锁最新消息","doorLockRinging":"门铃响了","defaultNewMsg":"您尚未绑定门锁","noNewMsg":"门锁休息中","bindDoorlock":"绑定门锁"},"opendoorRecord":{"noRecordTip":"暂无记录","passwordOpenDoor":"密码开门","fingerprintOpenDoor":"指纹开门","ICcardOpenDoor":"IC卡开门","remoteOpenDoor":"遥控器开门","keyOpenDoor":"钥匙开门","hijackingAlarm":"劫持报警","appRemoteOpenDoor":"app远程开门"},"alarmInfo":{"noInfoTip":"暂无信息","tamperAlarm":"防撬报警","trialAlarm":"试错报警","powerAlarm":"欠电报警","fackLockAlram":"假锁报警"},"remoteOpendoor":{"loading":"远程开门中","passwordInputTip":"请输入远程开门密码","openDoorSuccess":"远程开门成功","openDoorFailure":"远程开门失败","remoteOpendoorAgain":"请尝试重试","error":{"noPasswordTip":"远程密码不能为空"}},"hijackRecord":{"noRecordTip":"暂无记录","hijackingAlarm":"劫持指纹报警"},"doorlockManage":{"name":"名称","deleteDialogTip":"<span>{0}</span>将被删除","logoutDialogTip":"确定要退出系统吗?","deleteSuccess":"删除成功","deleteFailue":"删除失败","defaultNickname":"门锁","unbindDialogTip":"<span></span>解锁门锁后,您将失去对该门锁<br>所有查看、管理等功能操作","unbindSuccess":"解绑成功","doorbellMsgPush":"门铃消息推送","alarmMsgPush":"报警消息推送","opendoorMsgPush":"开门消息推送"},"editName":{"nameInputTip":"请输入设备名称","nickNameInputTip":"请输入用户名","editNameSuccess":"修改名称成功","editNameFailue":"修改名称失败","error":{"nameCanNotBeBlank":"设备名称不能为空","nicknameCanNotBeBlank":"用户名不能为空"}},"qrcode":{"helpTitle":"注意事项:","helpCont1":"1.仅超级管理员(通过Wi-Fi配网绑定的用户为超级管理员)可以生成绑定二维码","helpCont2":"2.二维码有效时间为10分钟且只能使用一次","helpCont3":"3.用户只需要扫描该二维码即可绑定指纹锁","helpCont4":"4.绑定失败则需要重新生成二维码进行绑定"},"addDevice":{"scanCodeAdd":"扫描绑定设备","wifiAdd":"配置Wi-Fi","loading":"loading","bindSuccess":"绑定成功","bindFailure":"绑定失败","reBindDevice":"请重新绑定"},"wifiAddHelp":{"helpTitle":"配置Wi-Fi说明:","helpCont1":"1.按下指纹锁背面的按钮,进入主菜单,选择Wi-Fi设置→配置Wi-Fi,门锁进入等待配网状态","helpCont2":"2.点击页面 “开始配置Wi-Fi” 按钮,进入Wi-Fi配网画面","helpCont3":"3.输入Wi-Fi密码,点击 “l连接” 按钮,等待锁端相应,直至配网成功","helpCont4":"(提示:如果指纹锁已经绑定过用户,重新绑定成功后会清除之前所有绑定信息)"},"wifiAdd":{"unbindWifiTip":"当前无Wi-Fi","wifiBinding":"配网中","wifiBindSuccess":"配网成功,请激活设备","deviceActivating":"设备激活中","deviceActivateSuccess":"激活成功","deviceActivateFailure":"激活失败","bindTimeout":"连接超时","passwordInputTip":"请输入Wi-Fi密码","remindTitle":"配置Wi-Fi提醒:","remindCont1":"1. 请确保Wi-Fi信号良好","remindCont2":"2. 本产品暂不支持5GHz无线网络","error":{}},"bindUserHelp":{"helpTitle":"配对姓名说明:","helpCont1":"1.在指纹锁上录入指纹、密码、卡并获得相应ID","helpCont2":"2.通过姓名绑定将该ID绑定对应用户姓名","helpCont3":"3.绑定成功后,开门记录中将会显示已绑定的用户姓名","helpCont4":"4.用户姓名信息只保存在APP端,不影响锁端设置","boundUser":"查看已绑定ID姓名"},"bindUser":{"editHeadTip":"点击编辑用户头像","nameTitle":"姓名","fingerprintIDTitle":"指纹ID","passwordIDTitle":"密码ID","ICCardIDTitle":"IC卡ID","requiredInputTip":"(必填)","optionalInputTip":"(选填)","error":{}},"userList":{"name":"昵称:","noUserTip":"暂无用户"},"commstatusLoading":{"connectSuccess":"Wi-Fi连接成功,正在绑定...","bindSuccess":"绑定成功","bindFailed":"绑定失败"},"addUser":{"nameInputTip":"请输入您想添加的用户名","addUserSuccess":"添加用户成功","addUserFailure":"添加用户失败","error":{"nameCanNotEmpty":"用户名不能为空"}},"doorlockUser":{"name":"昵称:","inviteBind":"邀请绑定","bindUnlockInfo":"关联开锁信息","opendoorRecord":"历史开门记录","unbindDialogTip":"<span></span>解绑后,您将失去对门锁所有查看功能该用户仍在用户列表中","deleteUserDialogTip":"删除后,二者不再为绑定关系,用户无法查看该门锁下的任何信息,该用户名下绑定的所有ID号仍可以显示在开门记录中","unbindSuccess":"解绑成功","unbindFailue":"解绑失败","guideStep1Tip1":"邀请绑定成功","guideStep1Tip2":"(可查看开门记录,报警记录等<br>相关门锁信息)","guideStep3Tip":"绑定后看可了解<br>该用户的开门情况","deleteSuccess":"删除成功","deleteFailure":"删除失败"},"inviteBind":{"qrcodeExpireTip":"二维码已过期,请重新生成","title":"注意事项:","cont1":"1.直接通过微信扫一扫添加门锁","cont2":"2.将此二维码保存为图片,发送给好友,好友通过长按识别二维码"},"unlockInfo":{"bindUnlockInfo":"已关联的开锁信息","noInfoTip":"目前无绑定任何信息,请添加","passwordOpenDoor":"密码","fingerprintOpenDoor":"指纹","ICcardOpenDoor":"IC卡","remoteOpenDoor":"遥控器","keyOpenDoor":"钥匙","appRemoteOpenDoor":"app远程","hijackingAlarm":"劫持指纹","setHijack":"设为劫持","setHijackTip":"确认设为劫持指纹吗?","cancelHijack":"取消劫持","cancelHijackTip":"确认取消劫持指纹吗?","cancelAssociated":"取消关联","cancelAssociatedTip":"取消关联后,开门历史记录中将不再显示关联的用户信息","cancelAssociatedSuccess":"取消关联成功","cancelAssociatedFailue":"取消关联失败","setHijackSuccess":"设为劫持指纹成功","setHijackFailue":"设为劫持指纹失败","cancelHijackSuccess":"设为劫持指纹成功","cancelHijackFailue":"设为劫持指纹失败"},"addUnlockInfo":{"opendoorMode":"选择要关联的开锁方式","fingerprint":"指纹","password":"密码","icCard":"IC卡","key":"钥匙","hijackFingerprint":"劫持指纹","opendoorRecord":"选择要关联的开锁ID","tip":"仅显示未绑定开门记录","addInfoSuccess":"添加绑定开锁信息成功","addInfoFailue":"添加绑定开锁信息失败","noRecordTip":"暂无记录","setHijackSwitch":"设为劫持指纹","guideStep1Tip":"选择需要添加关联的开门方式","guideStep3Tip":"根据开门记录中的开门时间,选择关联的<br>开门ID<span>(一个ID只能被一个用户绑定)</span>","guideStep5Tip":"使用劫持指纹开门时,会以报警形式<br>通知到该门锁名下的其他绑定用户"},"myInfo":{"editNickname":"修改昵称","editPassword":"修改密码","logoutDialogTip":"确定要退出系统吗?"},"editNickname":{"nickNameInputTip":"请输入昵称"},"editPassword":{"newPasswordInputTip":"请输入新密码","oldPasswordInputTip":"请输入旧密码","oldPasswordInputTipAgain":"请再次输入旧密码"},"request":{"error":"请求发送失败"},"deviceList":{"model":"型号:"}}
\ No newline at end of file
......@@ -82,7 +82,7 @@ function getDeviceList(self) {
self.setDeviceList(data);
for (var i = 0; i < data.length; i++) {
list[i] = {
leftImage: '../../resources/image/deviceImg.png',
leftImage: data[i].icon,
title: data[i].deviceName,
subtitle: Vue.t('deviceList.model') + data[i].model,
rightIcon: '&#xe6a7;'
......
......@@ -152,10 +152,11 @@ function backTap() {
//tap 连接
function connectButtonTap(self) {
console.log(self.getTextWiFiName());
// self.setTextPassword('macro_scope00');
console.log(self.getTextPassword());
if (self.getTextPassword() == null || self.getTextPassword().trim() == '') {
// console.log(self.getTextWiFiName());
// console.log(self.getTextPassword());
if (self.getTextWiFiName() == null || self.getTextWiFiName().trim() == '') {
self.setTextErrorTip(Vue.t('wifiAdd.unbindWifiTip'));
} else if (self.getTextPassword() == null || self.getTextPassword().trim() == '') {
self.setTextErrorTip(Vue.t('wifiAdd.passwordInputTip'));
} else {
_public.iot.business.sds.findWifi({
......@@ -171,8 +172,10 @@ function connectButtonTap(self) {
if (response.data == 'onProvisioning') {
//wifi链接中
_public.uComponents.showCommLoading(self);
_public.uComponents.changeCommLoadingStatusAndText(self, 0, Vue.t('wifiAdd.wifiBinding'));
} else if (response.data == 'provisioned success') {
//wifi连接成功,停止连接wifi
_public.uComponents.changeCommLoadingStatusAndText(self, 0, Vue.t('wifiAdd.wifiBindSuccess'));
// iot.business.sds.stopFindWifi({
// success: (response) => {},
// error: (error) => {}
......@@ -186,32 +189,17 @@ function connectButtonTap(self) {
var deviceId = null;
_public.iot.business.sds.findDevices({
success: function success(response) {
console.log("findDevices");
console.log(response);
var parameters = {};
if (response.data) {
var info = response.data.split(':[');
if (info[1]) {
var query = info[1].split(',');
console.log(query);
for (var i = 0; i < query.length; i++) {
var pari = query[i].split(' = ');
console.log(pari);
parameters[pari[0]] = pari[1];
}
console.log(parameters.sn);
}
}
if (parameters.sn) {
deviceId = parameters.sn;
}
var productId = _public.iot.navigator.getExtras().model;
if (response.data == "joined success") {
unbind(self, deviceId, productId);
if (response.data == "onJoining") {
_public.uComponents.changeCommLoadingStatusAndText(self, 0, Vue.t('wifiAdd.deviceActivating'));
} else if (response.data == "joined success") {
var _deviceId = response.info.sn;
unbind(self, _deviceId, productId);
// bind(self, deviceId, productId);
} else if (response.data == "fail") {
//连接失败
_public.uComponents.changeCommLoadingStatusAndText(self, 2, Vue.t('addDevice.bindFailure'));
_public.uComponents.changeCommLoadingStatusAndText(self, 2, Vue.t('wifiAdd.deviceActivateFailure'));
self.setStatus(2);
_public.uComponents.changeCommButtonText(self, Vue.t('addDevice.reBindDevice'));
//停止查找设备
......@@ -230,7 +218,7 @@ function connectButtonTap(self) {
if (self.getStatus() == 0) {
console.log("timeout");
//连接失败
_public.uComponents.changeCommLoadingStatusAndText(self, 2, Vue.t('addDevice.bindFailure'));
_public.uComponents.changeCommLoadingStatusAndText(self, 2, Vue.t('wifiAdd.bindTimeout'));
self.setStatus(2);
_public.uComponents.changeCommButtonText(self, Vue.t('addDevice.reBindDevice'));
//停止查找设备
......@@ -288,14 +276,14 @@ function bind(self, deviceId, productId) {
console.log(response);
var data = response.data;
if (data.success) {
_public.uComponents.changeCommLoadingStatusAndText(self, 1, Vue.t('addDevice.bindSuccess'));
_public.uComponents.changeCommLoadingStatusAndText(self, 1, Vue.t('wifiAdd.deviceActivateSuccess'));
_public.uComponents.changeCommButtonText(self, Vue.t('btn.confirm'));
self.setStatus(1);
}
},
error: function error(_error7) {
console.log(_error7);
_public.uComponents.changeCommLoadingStatusAndText(self, 2, Vue.t('addDevice.bindFailure'));
_public.uComponents.changeCommLoadingStatusAndText(self, 2, Vue.t('wifiAdd.deviceActivateFailure'));
_public.uComponents.changeCommButtonText(self, Vue.t('addDevice.reBindDevice'));
self.setStatus(2);
},
......
......@@ -47,11 +47,11 @@
<div class="switchGroup">
<div class="guoupRow">
<!-- 开门记录 -->
<div class="col-xs-6 opendoorRecord">
<div class="col-xs-6 opendoorRecord" v-bind:class="{newMsg: opendoorRecordFlag}">
<u-switch :value="valueOpendoorRecord" :init-param="componentsConfig.opendoorRecordSwitch.initParam" v-on:u-switch-tap="onOpendoorRecordTap"></u-switch>
</div>
<!-- 安全报警 -->
<div class="col-xs-6 securityAlarm">
<div class="col-xs-6 securityAlarm" v-bind:class="{newMsg: securityAlarmFlag}">
<u-switch :value="valueSecurityAlarm" :init-param="componentsConfig.securityAlarmSwitch.initParam" v-on:u-switch-tap="onSecurityAlarmTap"></u-switch>
</div>
</div>
......@@ -61,7 +61,7 @@
<u-switch :value="valueDoorlockUser" :init-param="componentsConfig.doorlockUserSwitch.initParam" v-on:u-switch-tap="onDoorlockUserTap"></u-switch>
</div>
<!-- 劫持报警 -->
<div class="col-xs-6 hijackAlarm">
<div class="col-xs-6 hijackAlarm" v-bind:class="{newMsg: hijackAlarmFlag}">
<u-switch :value="valueHijackAlarm" :init-param="componentsConfig.hijackAlarmSwitch.initParam" v-on:u-switch-tap="onHijackAlarmTap"></u-switch>
</div>
</div>
......
......@@ -23794,7 +23794,7 @@ var crypto = function () {
var key = _cryptoJs2.default.enc.Utf8.parse(keyIv.key);
var iv = _cryptoJs2.default.enc.Utf8.parse(keyIv.iv);;
var decryptedData = _cryptoJs2.default.AES.decrypt(code, key, { iv: iv }, { mode: _cryptoJs2.default.mode.CBC, padding: _cryptoJs2.default.pad.nopadding });
return JSON.parse(decryptedData.toString(_cryptoJs2.default.enc.Utf8));
return decryptedData.toString(_cryptoJs2.default.enc.Utf8);
}
}]);
......@@ -23902,6 +23902,12 @@ function init() {
newMsg: '',
//是否第一次获取门锁信息
isFirstGetLockInfo: true,
opendoorRecordFlag: false,
securityAlarmFlag: false,
hijackAlarmFlag: false,
notifyTime: null,
alarmTime: null,
openTime: null,
//是否显示远程开门页面
remoteOpendoorShowFlag: false,
//远程开门密码
......@@ -23909,7 +23915,7 @@ function init() {
//远程开门错误提示
textErrorTip: null,
//当前状态
status: null
status: 0
},
mounted: function mounted() {
var self = this;
......@@ -24240,6 +24246,141 @@ function initComponentsConfig() {
};
}
function getRecordTime(self, data) {
var newNotifyTime, newAlarmTime, newOpenTime, now;
return _regenerator2.default.async(function getRecordTime$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
_context.prev = 0;
_context.next = 3;
return _regenerator2.default.awrap(getRecordTimeMap('notifyTime'));
case 3:
self.notifyTime = _context.sent;
_context.next = 9;
break;
case 6:
_context.prev = 6;
_context.t0 = _context['catch'](0);
console.log(_context.t0);
case 9:
_context.prev = 9;
_context.next = 12;
return _regenerator2.default.awrap(getRecordTimeMap('alarmTime'));
case 12:
self.alarmTime = _context.sent;
_context.next = 18;
break;
case 15:
_context.prev = 15;
_context.t1 = _context['catch'](9);
console.log(_context.t1);
case 18:
_context.prev = 18;
_context.next = 21;
return _regenerator2.default.awrap(getRecordTimeMap('openTime'));
case 21:
self.openTime = _context.sent;
_context.next = 27;
break;
case 24:
_context.prev = 24;
_context.t2 = _context['catch'](18);
console.log(_context.t2);
case 27:
newNotifyTime = (0, _moment2.default)(data.notify_time);
newAlarmTime = (0, _moment2.default)(data.alarm_time);
newOpenTime = (0, _moment2.default)(data.open_time);
console.log("newNotifyTime" + newNotifyTime);
console.log("newAlarmTime" + newAlarmTime);
console.log("newOpenTime" + newOpenTime);
console.log("notifyTime" + self.notifyTime);
console.log("alarmTime" + self.alarmTime);
console.log("openTime" + self.openTime);
now = (0, _moment2.default)();
if (self.notifyTime) {
self.notifyTime = (0, _moment2.default)(self.notifyTime, _moment2.default.ISO_8601);
if (newNotifyTime != null && newNotifyTime.diff(self.notifyTime, 'seconds') > 0) {
self.securityAlarmFlag = true;
self.notifyTime = newNotifyTime;
}
} else {
if (newNotifyTime != null && now.diff(newNotifyTime, 'seconds') < 1) {
self.securityAlarmFlag = true;
self.notifyTime = newNotifyTime;
}
}
if (self.alarmTime) {
self.alarmTime = (0, _moment2.default)(self.alarmTime, _moment2.default.ISO_8601);
if (newAlarmTime != null && newAlarmTime.diff(self.alarmTime, 'seconds') > 0) {
self.hijackAlarmFlag = true;
self.alarmTime = newAlarmTime.unix();
}
} else {
if (newAlarmTime != null && now.diff(newAlarmTime, 'seconds') < 1) {
self.hijackAlarmFlag = true;
self.alarmTime = newAlarmTime;
}
}
if (self.openTime) {
self.openTime = (0, _moment2.default)(self.openTime, _moment2.default.ISO_8601);
if (newOpenTime != null && newOpenTime.diff(self.openTime, 'seconds') > 0) {
self.opendoorRecordFlag = true;
self.openTime = newOpenTime;
}
} else {
if (newOpenTime != null && now.diff(newOpenTime, 'seconds') < 1) {
self.opendoorRecordFlag = true;
console.log(newOpenTime);
self.openTime = newOpenTime;
}
}
case 40:
case 'end':
return _context.stop();
}
}
}, null, this, [[0, 6], [9, 15], [18, 24]]);
}
function setRecordTime(timeKey, time) {
console.log(time);
_public.iot.storage.setMap(timeKey, time, function (res) {
console.log(res);
}, function () {});
}
//获取websql上的firstLogin
function getRecordTimeMap(time) {
return new Promise(function (resolve, reject) {
console.log(time);
_public.iot.storage.getMap(time, function (res) {
if (res) {
resolve(res);
} else {
reject(res);
}
}, function (err) {
console.log(err);
});
});
}
function setValueOfSwitch(self, flag) {
self.setValueOpendoorRecord(flag);
self.setValueSecurityAlarm(flag);
......@@ -24277,6 +24418,7 @@ function getLockInfo(self) {
console.log(response);
var data = _public.uPublic.checkResponseData(response.data);
if (data) {
getRecordTime(self, data);
//判断云端是否绑定
if (data.lock_id) {
setValueOfSwitch(self, 1);
......@@ -24346,18 +24488,20 @@ function setDevceInfo(self, data) {
//请求远程开门
// self.setRemoteOpendoorFlag(true);
self.setValueRemoteOpendoor(true);
} else if (data.notify_type.value == 2) {
getLockInfo(self);
}
}
if (data.action.value == 'lock_log' && (data.lock_action.value == '1' || data.lock_action.value == '4')) {
//开门或远程开门成功
getLockInfo(self);
if (data.lock_action.value == '4') {
_public.uComponents.changeCommLoadingStatusAndText(self, 2, Vue.t('remoteOpendoor.openDoorSuccess'));
_public.uComponents.changeCommLoadingStatusAndText(self, 1, Vue.t('remoteOpendoor.openDoorSuccess'));
_public.uComponents.changeCommButtonText(self, Vue.t('btn.confirm'));
self.setStatus(1);
}
}
if (data.ErrorCode) {
if (data.ErrorCode.value != 0) {
//远程开门失败
_public.uComponents.changeCommLoadingStatusAndText(self, 2, Vue.t('remoteOpendoor.openDoorFailure'));
_public.uComponents.changeCommButtonText(self, Vue.t('remoteOpendoor.remoteOpendoorAgain'));
......@@ -24366,52 +24510,52 @@ function setDevceInfo(self, data) {
}
function ringBell(self) {
var i, time;
return _regenerator2.default.async(function ringBell$(_context) {
return _regenerator2.default.async(function ringBell$(_context2) {
while (1) {
switch (_context.prev = _context.next) {
switch (_context2.prev = _context2.next) {
case 0:
_context.prev = 0;
_context2.prev = 0;
i = 0;
case 2:
if (!(i < _config2.default.ring_time / (_config2.default.shake_times + _config2.default.await_time))) {
_context.next = 14;
_context2.next = 14;
break;
}
self.setDoorbellRingingFlag(true);
_context.next = 6;
_context2.next = 6;
return _regenerator2.default.awrap(sleep(1000 * _config2.default.shake_times));
case 6:
time = _context.sent;
time = _context2.sent;
self.setDoorbellRingingFlag(false);
_context.next = 10;
_context2.next = 10;
return _regenerator2.default.awrap(sleep(_config2.default.await_time));
case 10:
time = _context.sent;
time = _context2.sent;
i++;
case 12:
_context.next = 2;
_context2.next = 2;
break;
case 14:
_context.next = 19;
_context2.next = 19;
break;
case 16:
_context.prev = 16;
_context.t0 = _context['catch'](0);
_context2.prev = 16;
_context2.t0 = _context2['catch'](0);
console.log(_context.t0);
console.log(_context2.t0);
case 19:
case 'end':
return _context.stop();
return _context2.stop();
}
}
}, null, this, [[0, 16]]);
......@@ -24518,6 +24662,8 @@ function doorlockManageTap(self) {
//tap 开门记录
function opendoorRecordTap(self) {
if (self.getValueOpendoorRecord() == 1) {
self.opendoorRecordFlag = false;
setRecordTime('openTime', self.openTime.toISOString());
_public.iot.navigator.openWindow({
url: './opendoorRecord.html',
id: 'opendoorRecord',
......@@ -24531,6 +24677,8 @@ function opendoorRecordTap(self) {
//tap 安全报警
function securityAlarmTap(self) {
if (self.getValueSecurityAlarm() == 1) {
self.securityAlarmFlag = false;
setRecordTime('notifyTime', self.notifyTime.toISOString());
_public.iot.navigator.openWindow({
url: './alarmInfo.html',
id: 'alarmInfo',
......@@ -24576,6 +24724,8 @@ function remoteOpendoorTap(self) {
//tap 劫持报警
function hijackAlarmTap(self) {
if (self.getValueHijackAlarm() == 1) {
self.hijackAlarmFlag = false;
setRecordTime('alarmTime', self.alarmTime.toISOString());
_public.iot.navigator.openWindow({
url: './hijackRecord.html',
id: 'hijackRecord',
......@@ -24618,7 +24768,6 @@ function confirmButtonTap(self) {
console.log(self.mac);
var keyIv = _crypto2.default.enkey(self.mac.replace(/:/g, ''));
console.log(keyIv);
self.setTextPassword({ 'pwd': '123' });
var pwd = _crypto2.default.encode(self.getTextPassword(), keyIv);
console.log(pwd);
var msg = _crypto2.default.decode(pwd, keyIv);
......@@ -24631,25 +24780,29 @@ function confirmButtonTap(self) {
'value': 'openDoor'
},
'remote_open_door': {
// 'value': pwd
'value': self.getTextPassword()
'value': pwd
}
}
},
success: function success(response) {
//密码下发成功
console.log(response);
self.setStatus(0);
// uComponents.showCommLoading(self);
self.getStatus(0);
// uComponents.changeCommLoadingStatusAndText(self, 1, Vue.t('remoteOpendoor.openDoorSuccess'));
// uComponents.changeCommButtonText(self, Vue.t('btn.confirm'));
},
error: function error(_error5) {
console.log(_error5);
},
complete: function complete() {
_public.uComponents.hideLoading(self);
// uComponents.hideCommLoading(self);
}
});
}
console.log('aaaa');
setTimeout(function () {
console.log(self.getStatus());
if (self.getStatus() == 0) {
console.log("timeout");
//连接失败
......@@ -24664,6 +24817,7 @@ function confirmButtonTap(self) {
function commLoadingButtonTap(self) {
if (self.getStatus() == 1) {
//绑定成功
console.log("1111");
_public.uComponents.hideCommLoading(self);
self.setRemoteOpendoorShowFlag(false);
} else if (self.getStatus() == 2) {
......
......@@ -6168,7 +6168,7 @@ var crypto = function () {
var key = _cryptoJs2.default.enc.Utf8.parse(keyIv.key);
var iv = _cryptoJs2.default.enc.Utf8.parse(keyIv.iv);;
var decryptedData = _cryptoJs2.default.AES.decrypt(code, key, { iv: iv }, { mode: _cryptoJs2.default.mode.CBC, padding: _cryptoJs2.default.pad.nopadding });
return JSON.parse(decryptedData.toString(_cryptoJs2.default.enc.Utf8));
return decryptedData.toString(_cryptoJs2.default.enc.Utf8);
}
}]);
......
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