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
3d49faac
Commit
3d49faac
authored
Oct 12, 2017
by
朱建香
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1012
parent
803870aa
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
42 deletions
+49
-42
dev/src/public/public.js
+2
-2
dev/src/view/device/v_index.js
+9
-8
dev/src/view/doorlockUsers/v_addUser.js
+10
-8
dev/src/view/doorlockUsers/v_index.js
+26
-22
web/lib/js/p.js
+2
-2
No files found.
dev/src/public/public.js
View file @
3d49faac
...
@@ -16,11 +16,11 @@ const iot = new UIOT({
...
@@ -16,11 +16,11 @@ const iot = new UIOT({
appId
:
''
appId
:
''
},
},
cloud
:
{
cloud
:
{
url
:
'http://
192.168.2.96:20000
'
url
:
'http://
wx.iotface.com
'
},
},
plugin
:
{
plugin
:
{
log
:
{
log
:
{
url
:
'http://
192.168.2.213:3302/lo
g'
url
:
'http://
admin.iot.u-gen.net/admin/view/debu
g'
}
}
}
}
});
});
...
...
dev/src/view/device/v_index.js
View file @
3d49faac
...
@@ -270,7 +270,7 @@ function init() {
...
@@ -270,7 +270,7 @@ function init() {
},
},
//tap 门锁用户
//tap 门锁用户
onDoorlockUserTap
(){
onDoorlockUserTap
(){
doorlockUserTap
();
doorlockUserTap
(
this
);
},
},
//tap 远程开门
//tap 远程开门
onRemoteOpendoorTap
(){
onRemoteOpendoorTap
(){
...
@@ -435,8 +435,6 @@ function setDevceInfo(self, data) {
...
@@ -435,8 +435,6 @@ function setDevceInfo(self, data) {
}
}
}
}
//tap 个人信息
//tap 个人信息
function
myInfoTap
(
self
){
function
myInfoTap
(
self
){
iot
.
navigator
.
openWindow
({
iot
.
navigator
.
openWindow
({
...
@@ -496,12 +494,15 @@ function securityAlarmTap(self){
...
@@ -496,12 +494,15 @@ function securityAlarmTap(self){
}
}
//tap 门锁用户
//tap 门锁用户
function
doorlockUserTap
(){
function
doorlockUserTap
(
self
){
// if(self.getValueDoorlockUser == 1){
// if(self.getValueDoorlockUser
()
== 1){
// iot.navigator.openWindow({
// iot.navigator.openWindow({
// url: '../doorlockUsers/',
// url: '../doorlockUsers/',
// id: 'doorlockUsers',
// id: 'doorlockUsers',
// });
// extras: {
// deviceId: self.deviceId
// }
// });
// }
// }
}
}
...
...
dev/src/view/doorlockUsers/v_addUser.js
View file @
3d49faac
...
@@ -94,10 +94,9 @@ function nameChange(self,text){
...
@@ -94,10 +94,9 @@ function nameChange(self,text){
//tap 确定
//tap 确定
function
confirmButtonTap
(
self
){
function
confirmButtonTap
(
self
){
if
(
self
.
getTextName
()
==
null
||
self
.
getTextName
().
trim
()
==
''
){
if
(
self
.
getTextName
()
==
null
||
self
.
getTextName
().
trim
()
==
''
){
self
.
setTextErrorTip
(
Vue
.
t
(
'addUser.nameCanNotEmpty'
));
self
.
setTextErrorTip
(
Vue
.
t
(
'addUser.
error.
nameCanNotEmpty'
));
}
else
{
}
else
{
uComponents
.
showLoading
(
self
);
uComponents
.
showLoading
(
self
);
}
iot
.
business
.
api
.
sendCustom
(
'lock/addUser'
,{
iot
.
business
.
api
.
sendCustom
(
'lock/addUser'
,{
data
:
{
data
:
{
device_id
:
self
.
extras
.
deviceId
device_id
:
self
.
extras
.
deviceId
...
@@ -108,9 +107,14 @@ function confirmButtonTap(self){
...
@@ -108,9 +107,14 @@ function confirmButtonTap(self){
text
:
Vue
.
t
(
'btn.confirm'
),
callback
:
function
()
{
text
:
Vue
.
t
(
'btn.confirm'
),
callback
:
function
()
{
console
.
log
(
"添加用户成功"
);
console
.
log
(
"添加用户成功"
);
//跳转到门锁用户界面
//跳转到门锁用户界面
iot
.
storage
.
setMap
(
'lock_id'
,
data
.
lock_id
,
()
=>
{
self
.
$router
.
replace
({
path
:
'/myDoorlock'
});
},
()
=>
{
error
();
});
iot
.
navigator
.
openWindow
({
iot
.
navigator
.
openWindow
({
url
:
'../doorlockUsers/addUser.
'
,
url
:
'./doorlockUser.html
'
,
id
:
'addUser'
,
id
:
'doorlockUser'
});
});
}
}
});
});
...
@@ -127,8 +131,5 @@ function confirmButtonTap(self){
...
@@ -127,8 +131,5 @@ function confirmButtonTap(self){
uComponents
.
hideLoading
(
self
);
uComponents
.
hideLoading
(
self
);
}
}
});
});
iot
.
navigator
.
openWindow
({
}
url
:
'./doorlockUser.html'
,
id
:
'doorlockUser'
});
}
}
\ No newline at end of file
dev/src/view/doorlockUsers/v_index.js
View file @
3d49faac
...
@@ -28,11 +28,10 @@ function init() {
...
@@ -28,11 +28,10 @@ function init() {
extras
:
{}
extras
:
{}
},
},
mounted
(){
mounted
(){
self
.
extras
=
iot
.
navigator
.
getExtras
();
this
.
extras
=
iot
.
navigator
.
getExtras
();
//获取用户列表
//获取用户列表
getUserList
();
getUserList
(
this
);
// this.userList = [{value: 1, role: 0, image: '../../resources/image/green_admin_icon.png', title: '我是用户', subtitle: "MM"},
//
// {value: 1, role: 1, image: '../../resources/image/green_bindhead_icon.png', title: '我是用户', subtitle: "MM"}]
},
},
methods
:{
methods
:{
getUserList
(){
getUserList
(){
...
@@ -91,6 +90,7 @@ function initComponentsConfig() {
...
@@ -91,6 +90,7 @@ function initComponentsConfig() {
//获取用户列表
//获取用户列表
function
getUserList
(
self
){
function
getUserList
(
self
){
console
.
log
(
self
.
extras
);
uComponents
.
showLoading
(
self
);
uComponents
.
showLoading
(
self
);
iot
.
business
.
device
.
getUsers
({
iot
.
business
.
device
.
getUsers
({
data
:
{
data
:
{
...
@@ -98,23 +98,27 @@ function getUserList(self){
...
@@ -98,23 +98,27 @@ function getUserList(self){
},
},
success
:
(
response
)
=>
{
success
:
(
response
)
=>
{
console
.
log
(
response
);
console
.
log
(
response
);
let
data
=
uPublic
.
checkResponseData
(
response
.
data
);
// let data = uPublic.checkResponseData(response.data);
if
(
data
){
// if(data){
let
list
=
[];
// let list = [];
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
){
// for(let i = 0; i < data.length ; i++){
list
[
i
]
=
{
// list[i] = {
value
:
data
.
userId
,
// value: data.userId,
role
:
data
.
role
,
// role: data.role,
image
:
data
.
role
==
0
?
'../../resources/image/green_admin_icon.png'
:
data
.
name
==
null
?
'../../resources/image/gray_unbindHead_icon.png'
:
'../../resources/image/green_bindhead_icon.png'
,
// image: data.role == 0 ? '../../resources/image/green_admin_icon.png' : data.name == null ? '../../resources/image/gray_unbindHead_icon.png' : '../../resources/image/green_bindhead_icon.png',
title
:
data
.
nickname
,
// title: data.nickname,
subTitle
:
data
.
name
// subTitle: data.name
}
// }
}
// }
let
list
=
[{
value
:
1
,
role
:
0
,
image
:
'../../resources/image/green_admin_icon.png'
,
title
:
'我是用户'
,
subtitle
:
"MM"
},
{
value
:
1
,
role
:
1
,
image
:
'../../resources/image/green_bindhead_icon.png'
,
title
:
'我是用户'
,
subtitle
:
"MM"
}];
self
.
setUserList
(
self
.
getUserList
().
concat
(
list
));
self
.
setUserList
(
self
.
getUserList
().
concat
(
list
));
if
(
data
.
length
>
0
){
console
.
log
(
self
.
getUserList
());
self
.
setStartId
(
data
[
data
.
length
-
1
].
id
);
// if(data.length > 0){
}
// self.setStartId(data[data.length-1].id);
}
// }
// }
},
},
error
:
(
error
)
=>
{
error
:
(
error
)
=>
{
console
.
log
(
error
);
console
.
log
(
error
);
...
@@ -150,8 +154,8 @@ function swipeRightRow(self) {
...
@@ -150,8 +154,8 @@ function swipeRightRow(self) {
// 点击组件列表 通知事件和当前点击列表下标
// 点击组件列表 通知事件和当前点击列表下标
function
onTapUserList
(
self
,
listIndex
)
{
function
onTapUserList
(
self
,
listIndex
)
{
iot
.
navigator
.
openWindow
({
iot
.
navigator
.
openWindow
({
url
:
'.
./doorlockUsers/doorlockUsers
.html'
,
url
:
'.
/doorlockUser
.html'
,
id
:
'doorlockUser
s
'
,
id
:
'doorlockUser'
,
});
});
if
(
self
.
userListIndex
!=
null
)
{
if
(
self
.
userListIndex
!=
null
)
{
self
.
userListIndex
=
null
;
self
.
userListIndex
=
null
;
...
...
web/lib/js/p.js
View file @
3d49faac
...
@@ -9519,11 +9519,11 @@ var iot = new UIOT({
...
@@ -9519,11 +9519,11 @@ var iot = new UIOT({
appId
:
''
appId
:
''
},
},
cloud
:
{
cloud
:
{
url
:
'http://
192.168.2.96:20000
'
url
:
'http://
wx.iotface.com
'
},
},
plugin
:
{
plugin
:
{
log
:
{
log
:
{
url
:
'http://
192.168.2.213:3302/lo
g'
url
:
'http://
admin.iot.u-gen.net/admin/view/debu
g'
}
}
}
}
});
});
...
...
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