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
ea067531
Commit
ea067531
authored
Mar 15, 2018
by
朱建香
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
远程开门通知debug
parent
ffe01157
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletions
+22
-1
dev/src/public/config.js
+1
-1
dev/src/view/device/v_index.js
+21
-0
No files found.
dev/src/public/config.js
View file @
ea067531
...
@@ -36,7 +36,7 @@ export default {
...
@@ -36,7 +36,7 @@ export default {
"shake_times"
:
3
,
"shake_times"
:
3
,
//门锁晃动总时间
//门锁晃动总时间
"ring_time"
:
12000
,
"ring_time"
:
12000
,
"remote_opendoor_timeout"
:
15
000
,
"remote_opendoor_timeout"
:
30
000
,
//二维码失效时间
//二维码失效时间
"qrcode_timeout"
:
600000
,
"qrcode_timeout"
:
600000
,
"remote_timeout"
:
120
,
"remote_timeout"
:
120
,
...
...
dev/src/view/device/v_index.js
View file @
ea067531
...
@@ -134,6 +134,9 @@ function init() {
...
@@ -134,6 +134,9 @@ function init() {
boolPasswordMinlength
:
false
boolPasswordMinlength
:
false
},
},
mounted
(){
mounted
(){
if
(
window
.
iotDebug
){
iotDebug
.
push
(
'start: Debug'
);
}
//显示loading
//显示loading
uComponents
.
showLoading
(
this
);
uComponents
.
showLoading
(
this
);
//监听推送
//监听推送
...
@@ -1028,6 +1031,12 @@ function setBellRing(self, time){
...
@@ -1028,6 +1031,12 @@ function setBellRing(self, time){
function
setRemoteOpendoor
(
self
,
time
){
function
setRemoteOpendoor
(
self
,
time
){
let
now
=
moment
(
new
Date
(),
"YYYY-MM-DD hh:mm:ss"
);
let
now
=
moment
(
new
Date
(),
"YYYY-MM-DD hh:mm:ss"
);
time
=
moment
(
time
,
"YYYY-MM-DD hh:mm:ss"
);
time
=
moment
(
time
,
"YYYY-MM-DD hh:mm:ss"
);
if
(
window
.
iotDebug
){
iotDebug
.
push
(
'end: 远程开门'
+
'设备当前时间'
+
now
.
unix
()
+
'通知时间'
+
time
.
unix
());
}
if
(
window
.
iotDebug
)
{
iotDebug
.
upload
(
iot
,
'远程开门'
);
}
console
.
log
(
now
.
diff
(
time
,
'seconds'
));
console
.
log
(
now
.
diff
(
time
,
'seconds'
));
if
(
now
.
diff
(
time
,
'seconds'
)
<
config
.
pushMsg_timeout
&&
now
.
diff
(
time
,
'seconds'
)
>=
0
&&
(
self
.
getRole
()
==
0
)){
if
(
now
.
diff
(
time
,
'seconds'
)
<
config
.
pushMsg_timeout
&&
now
.
diff
(
time
,
'seconds'
)
>=
0
&&
(
self
.
getRole
()
==
0
)){
self
.
setValueRemoteOpendoor
(
true
);
self
.
setValueRemoteOpendoor
(
true
);
...
@@ -1151,10 +1160,22 @@ function notifyDataProcessing(self, payload){
...
@@ -1151,10 +1160,22 @@ function notifyDataProcessing(self, payload){
function
notificationListener
(
self
)
{
function
notificationListener
(
self
)
{
// 从系统消息中心点击消息启动应用事件
// 从系统消息中心点击消息启动应用事件
plus
.
push
.
addEventListener
(
'click'
,
function
(
msg
)
{
plus
.
push
.
addEventListener
(
'click'
,
function
(
msg
)
{
if
(
window
.
iotDebug
){
iotDebug
.
push
(
'end: 点击通知'
+
JSON
.
stringify
(
msg
));
}
if
(
window
.
iotDebug
)
{
iotDebug
.
upload
(
iot
,
'点击通知'
);
}
pushAction
(
self
,
msg
);
pushAction
(
self
,
msg
);
},
false
);
},
false
);
// 应用从推送服务器接收到推送消息事件
// 应用从推送服务器接收到推送消息事件
plus
.
push
.
addEventListener
(
'receive'
,
function
(
msg
)
{
plus
.
push
.
addEventListener
(
'receive'
,
function
(
msg
)
{
if
(
window
.
iotDebug
){
iotDebug
.
push
(
'end: 接收通知'
+
JSON
.
stringify
(
msg
));
}
if
(
window
.
iotDebug
)
{
iotDebug
.
upload
(
iot
,
'接收通知'
);
}
},
false
);
},
false
);
}
}
...
...
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