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
朱建香
DoorLock
Commits
4c01643a
Commit
4c01643a
authored
Nov 20, 2017
by
朱建香
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1120
parent
21da8e70
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
28 deletions
+44
-28
dev/src/view/device/v_index.js
+12
-4
dev/src/view/doorlockManage/v_index.js
+10
-10
web/view/device/index.js
+12
-4
web/view/doorlockManage/index.js
+10
-10
No files found.
dev/src/view/device/v_index.js
View file @
4c01643a
...
...
@@ -71,6 +71,7 @@ function init() {
lockId
:
null
,
//获取用户的身份
role
:
null
,
lockInfo
:
{},
//最新消息
newMsg
:
[],
//是否第一次获取门锁信息
...
...
@@ -211,6 +212,12 @@ function init() {
setRole
(
bool
){
this
.
role
=
bool
;
},
getLockInfo
(){
return
this
.
lockInfo
;
},
setLockInfo
(
info
){
this
.
lockInfo
=
info
;
},
getRemoteOpendoorShowFlag
(){
return
this
.
remoteOpendoorShowFlag
;
},
...
...
@@ -615,6 +622,7 @@ function getLockInfo(self){
//判断云端是否绑定
if
(
data
.
lock_id
){
setValueOfSwitch
(
self
,
false
);
self
.
setLockInfo
(
data
);
self
.
setLockId
(
data
.
lock_id
);
self
.
setRole
(
data
.
role
);
if
(
self
.
isFirstGetLockInfo
){
...
...
@@ -818,10 +826,9 @@ function notificationListener(self) {
},
false
);
// 应用从推送服务器接收到推送消息事件
plus
.
push
.
addEventListener
(
'receive'
,
function
(
msg
)
{
console
.
log
(
"收到了receive"
);
alert
(
"收到了receive"
);
pushAction
(
self
,
msg
);
alert
(
"receive"
+
JSON
.
stringify
(
msg
));
// plus.push.createMessage(msg.content, msg.payload);
},
false
);
}
...
...
@@ -874,8 +881,9 @@ function doorlockManageTap(self){
extras
:
{
deviceId
:
self
.
deviceId
,
uuid
:
self
.
getUuid
(),
role
:
self
.
getRole
(),
lockId
:
self
.
getLockId
()
// role: self.getRole(),
// lockId: self.getLockId(),
lockInfo
:
self
.
getLockInfo
()
}
});
}
...
...
dev/src/view/doorlockManage/v_index.js
View file @
4c01643a
...
...
@@ -32,11 +32,11 @@ function init() {
extras
:
{},
unbindSucceess
:
false
,
//门铃消息推送
valueDoorbell
:
true
,
valueDoorbell
:
iot
.
navigator
.
getExtras
().
lockInfo
.
options
[
0
]
,
//报警消息推送
valueAlarm
:
true
,
valueAlarm
:
iot
.
navigator
.
getExtras
().
lockInfo
.
options
[
1
]
,
//开发消息推送
valueOpendoor
:
true
,
valueOpendoor
:
iot
.
navigator
.
getExtras
().
lockInfo
.
options
[
2
]
,
role
:
null
,
valueIsClear
:
true
,
unbindShowDialog
:
false
...
...
@@ -44,14 +44,14 @@ function init() {
mounted
(){
this
.
extras
=
iot
.
navigator
.
getExtras
();
console
.
log
(
this
.
extras
);
this
.
role
=
this
.
extras
.
role
;
this
.
role
=
this
.
extras
.
lockInfo
.
role
;
//获取门锁
getDoorlockInfo
(
this
);
//
getDoorlockInfo(this);
//监听returnPage返回事件,重新获取最新数据
let
self
=
this
;
window
.
addEventListener
(
'returnPage'
,
function
(
event
){
console
.
log
(
"returnPage"
);
getDoorlockInfo
(
self
);
//
getDoorlockInfo(self);
});
},
...
...
@@ -202,7 +202,7 @@ function getDoorlockInfo(self){
let
productId
=
config
.
model
;
iot
.
business
.
device
.
getInfo
({
data
:
{
device_id
:
self
.
extras
.
lockId
device_id
:
self
.
extras
.
lockI
nfo
.
lock_i
d
},
success
:
(
response
)
=>
{
console
.
log
(
response
);
...
...
@@ -275,7 +275,7 @@ function editNameTap(self){
url
:
'./editName.html'
,
id
:
'editName'
,
extras
:
{
lockId
:
self
.
extras
.
lockId
,
lockId
:
self
.
extras
.
lockI
nfo
.
lock_i
d
,
nickname
:
self
.
getTextNickname
()
}
});
...
...
@@ -323,7 +323,7 @@ function unbind(self){
iot
.
business
.
api
.
sendCustom
(
'lock/unbind'
,{
data
:
{
device_sn
:
self
.
extras
.
deviceId
,
device_id
:
self
.
extras
.
lockId
,
device_id
:
self
.
extras
.
lockI
nfo
.
lock_i
d
,
needDelInfo
:
self
.
getValueIsClear
()
},
success
:
(
response
)
=>
{
...
...
@@ -393,7 +393,7 @@ function setOption(self){
iot
.
business
.
api
.
sendCustom
(
'lock/setPushOption'
,
{
data
:
{
device_id
:
self
.
extras
.
lockId
,
device_id
:
self
.
extras
.
lockI
nfo
.
lock_i
d
,
opt_ring
:
self
.
getValueDoorbell
(),
opt_alarm
:
self
.
getValueAlarm
(),
opt_open
:
self
.
getValueOpendoor
()
...
...
web/view/device/index.js
View file @
4c01643a
...
...
@@ -23911,6 +23911,7 @@ function init() {
lockId
:
null
,
//获取用户的身份
role
:
null
,
lockInfo
:
{},
//最新消息
newMsg
:
[],
//是否第一次获取门锁信息
...
...
@@ -24052,6 +24053,12 @@ function init() {
setRole
:
function
setRole
(
bool
)
{
this
.
role
=
bool
;
},
getLockInfo
:
function
getLockInfo
()
{
return
this
.
lockInfo
;
},
setLockInfo
:
function
setLockInfo
(
info
)
{
this
.
lockInfo
=
info
;
},
getRemoteOpendoorShowFlag
:
function
getRemoteOpendoorShowFlag
()
{
return
this
.
remoteOpendoorShowFlag
;
},
...
...
@@ -24507,6 +24514,7 @@ function getLockInfo(self) {
//判断云端是否绑定
if
(
data
.
lock_id
)
{
setValueOfSwitch
(
self
,
false
);
self
.
setLockInfo
(
data
);
self
.
setLockId
(
data
.
lock_id
);
self
.
setRole
(
data
.
role
);
if
(
self
.
isFirstGetLockInfo
)
{
...
...
@@ -24747,10 +24755,9 @@ function notificationListener(self) {
},
false
);
// 应用从推送服务器接收到推送消息事件
plus
.
push
.
addEventListener
(
'receive'
,
function
(
msg
)
{
console
.
log
(
"收到了receive"
);
alert
(
"收到了receive"
);
pushAction
(
self
,
msg
);
alert
(
"receive"
+
JSON
.
stringify
(
msg
));
// plus.push.createMessage(msg.content, msg.payload);
},
false
);
}
...
...
@@ -24799,8 +24806,9 @@ function doorlockManageTap(self) {
extras
:
{
deviceId
:
self
.
deviceId
,
uuid
:
self
.
getUuid
(),
role
:
self
.
getRole
(),
lockId
:
self
.
getLockId
()
// role: self.getRole(),
// lockId: self.getLockId(),
lockInfo
:
self
.
getLockInfo
()
}
});
}
...
...
web/view/doorlockManage/index.js
View file @
4c01643a
...
...
@@ -45,11 +45,11 @@ function init() {
extras
:
{},
unbindSucceess
:
false
,
//门铃消息推送
valueDoorbell
:
true
,
valueDoorbell
:
_public
.
iot
.
navigator
.
getExtras
().
lockInfo
.
options
[
0
]
,
//报警消息推送
valueAlarm
:
true
,
valueAlarm
:
_public
.
iot
.
navigator
.
getExtras
().
lockInfo
.
options
[
1
]
,
//开发消息推送
valueOpendoor
:
true
,
valueOpendoor
:
_public
.
iot
.
navigator
.
getExtras
().
lockInfo
.
options
[
2
]
,
role
:
null
,
valueIsClear
:
true
,
unbindShowDialog
:
false
...
...
@@ -57,14 +57,14 @@ function init() {
mounted
:
function
mounted
()
{
this
.
extras
=
_public
.
iot
.
navigator
.
getExtras
();
console
.
log
(
this
.
extras
);
this
.
role
=
this
.
extras
.
role
;
this
.
role
=
this
.
extras
.
lockInfo
.
role
;
//获取门锁
getDoorlockInfo
(
this
);
//
getDoorlockInfo(this);
//监听returnPage返回事件,重新获取最新数据
var
self
=
this
;
window
.
addEventListener
(
'returnPage'
,
function
(
event
)
{
console
.
log
(
"returnPage"
);
getDoorlockInfo
(
self
);
//
getDoorlockInfo(self);
});
},
...
...
@@ -219,7 +219,7 @@ function getDoorlockInfo(self) {
var
productId
=
_config2
.
default
.
model
;
_public
.
iot
.
business
.
device
.
getInfo
({
data
:
{
device_id
:
self
.
extras
.
lockId
device_id
:
self
.
extras
.
lockI
nfo
.
lock_i
d
},
success
:
function
success
(
response
)
{
console
.
log
(
response
);
...
...
@@ -292,7 +292,7 @@ function editNameTap(self) {
url
:
'./editName.html'
,
id
:
'editName'
,
extras
:
{
lockId
:
self
.
extras
.
lockId
,
lockId
:
self
.
extras
.
lockI
nfo
.
lock_i
d
,
nickname
:
self
.
getTextNickname
()
}
});
...
...
@@ -340,7 +340,7 @@ function unbind(self) {
_public
.
iot
.
business
.
api
.
sendCustom
(
'lock/unbind'
,
{
data
:
{
device_sn
:
self
.
extras
.
deviceId
,
device_id
:
self
.
extras
.
lockId
,
device_id
:
self
.
extras
.
lockI
nfo
.
lock_i
d
,
needDelInfo
:
self
.
getValueIsClear
()
},
success
:
function
success
(
response
)
{
...
...
@@ -409,7 +409,7 @@ function setOption(self) {
_public
.
uComponents
.
showLoading
(
self
);
_public
.
iot
.
business
.
api
.
sendCustom
(
'lock/setPushOption'
,
{
data
:
{
device_id
:
self
.
extras
.
lockId
,
device_id
:
self
.
extras
.
lockI
nfo
.
lock_i
d
,
opt_ring
:
self
.
getValueDoorbell
(),
opt_alarm
:
self
.
getValueAlarm
(),
opt_open
:
self
.
getValueOpendoor
()
...
...
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