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