Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
DoorLock
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
felix
DoorLock
Commits
05505326
Commit
05505326
authored
Nov 08, 2017
by
朱建香
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1108
parent
18a27276
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
171 additions
and
74 deletions
+171
-74
dev/src/lang/zh.json
+7
-0
dev/src/public/crypto.js
+1
-1
dev/src/view/addDevice/v_deviceList.js
+1
-1
dev/src/view/addDevice/v_wifiAdd.js
+19
-31
dev/src/view/device/v_index.js
+122
-8
web/resources/lang/zh.json
+0
-0
web/view/addDevice/deviceList.js
+1
-1
web/view/addDevice/wifiAdd.js
+16
-28
web/view/device/index.html
+3
-3
web/view/device/index.js
+0
-0
web/view/device/remoteOpendoor.js
+1
-1
No files found.
dev/src/lang/zh.json
View file @
05505326
...
...
@@ -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信号良好"
,
...
...
dev/src/public/crypto.js
View file @
05505326
...
...
@@ -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
);
}
}
...
...
dev/src/view/addDevice/v_deviceList.js
View file @
05505326
...
...
@@ -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
:
''
...
...
dev/src/view/addDevice/v_wifiAdd.js
View file @
05505326
...
...
@@ -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.bind
Failure'
));
uComponents
.
changeCommLoadingStatusAndText
(
self
,
2
,
Vue
.
t
(
'
wifiAdd.deviceActivate
Failure'
));
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.bind
Success'
));
uComponents
.
changeCommLoadingStatusAndText
(
self
,
1
,
Vue
.
t
(
'
wifiAdd.deviceActivate
Success'
));
uComponents
.
changeCommButtonText
(
self
,
Vue
.
t
(
'btn.confirm'
));
self
.
setStatus
(
1
);
}
},
error
:
(
error
)
=>
{
console
.
log
(
error
);
uComponents
.
changeCommLoadingStatusAndText
(
self
,
2
,
Vue
.
t
(
'
addDevice.bind
Failure'
));
uComponents
.
changeCommLoadingStatusAndText
(
self
,
2
,
Vue
.
t
(
'
wifiAdd.deviceActivate
Failure'
));
uComponents
.
changeCommButtonText
(
self
,
Vue
.
t
(
'addDevice.reBindDevice'
));
self
.
setStatus
(
2
);
},
...
...
dev/src/view/device/v_index.js
View file @
05505326
...
...
@@ -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
.
hide
Loading
(
self
);
// uComponents.hideComm
Loading(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
);
...
...
web/resources/lang/zh.json
View file @
05505326
This diff is collapsed.
Click to expand it.
web/view/addDevice/deviceList.js
View file @
05505326
...
...
@@ -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
:
''
...
...
web/view/addDevice/wifiAdd.js
View file @
05505326
...
...
@@ -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.bind
Failure'
));
_public
.
uComponents
.
changeCommLoadingStatusAndText
(
self
,
2
,
Vue
.
t
(
'
wifiAdd.deviceActivate
Failure'
));
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.bind
Success'
));
_public
.
uComponents
.
changeCommLoadingStatusAndText
(
self
,
1
,
Vue
.
t
(
'
wifiAdd.deviceActivate
Success'
));
_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.bind
Failure'
));
_public
.
uComponents
.
changeCommLoadingStatusAndText
(
self
,
2
,
Vue
.
t
(
'
wifiAdd.deviceActivate
Failure'
));
_public
.
uComponents
.
changeCommButtonText
(
self
,
Vue
.
t
(
'addDevice.reBindDevice'
));
self
.
setStatus
(
2
);
},
...
...
web/view/device/index.html
View file @
05505326
...
...
@@ -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>
...
...
web/view/device/index.js
View file @
05505326
This diff is collapsed.
Click to expand it.
web/view/device/remoteOpendoor.js
View file @
05505326
...
...
@@ -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
);
}
}]);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment