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
be878c42
Commit
be878c42
authored
Oct 24, 2017
by
朱建香
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1024
parent
3604e554
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
202 additions
and
198 deletions
+202
-198
dev/src/view/device/v_index.js
+2
-2
dev/src/view/login/v_index.js
+103
-103
web/view/device/index.js
+2
-2
web/view/login/index.js
+95
-91
No files found.
dev/src/view/device/v_index.js
View file @
be878c42
...
@@ -378,15 +378,15 @@ function getLockInfo(self){
...
@@ -378,15 +378,15 @@ function getLockInfo(self){
// self.setBatteryState(config.powerIcon[Math.round(data.battery/20)]);
// self.setBatteryState(config.powerIcon[Math.round(data.battery/20)]);
//判断云端是否绑定
//判断云端是否绑定
if
(
data
.
lock_id
){
if
(
data
.
lock_id
){
setValueOfSwitch
(
self
,
1
);
self
.
setLockId
(
data
.
lock_id
);
self
.
setLockId
(
data
.
lock_id
);
self
.
setRole
(
data
.
role
);
self
.
setRole
(
data
.
role
);
getDeviceStatus
(
self
);
console
.
log
(
data
.
info
);
console
.
log
(
data
.
info
);
if
(
data
.
info
){
if
(
data
.
info
){
self
.
newMsg
=
moment
(
data
.
info
[
0
].
time
).
format
(
"YY.MM.DD HH:mm"
)
+
data
.
info
[
0
].
nickname
+
Vue
.
t
(
'opendoorRecord.'
+
config
.
openDoorMode
[
data
.
info
[
0
].
mode
]
+
''
);
self
.
newMsg
=
moment
(
data
.
info
[
0
].
time
).
format
(
"YY.MM.DD HH:mm"
)
+
data
.
info
[
0
].
nickname
+
Vue
.
t
(
'opendoorRecord.'
+
config
.
openDoorMode
[
data
.
info
[
0
].
mode
]
+
''
);
uComponents
.
changeMarqueeText
(
self
,
self
.
newMsg
);
uComponents
.
changeMarqueeText
(
self
,
self
.
newMsg
);
setValueOfSwitch
(
self
,
1
);
if
(
self
.
isFirstGetLockInfo
){
if
(
self
.
isFirstGetLockInfo
){
getDeviceStatus
(
self
);
self
.
setIsFirstGetLockInfo
(
false
);
self
.
setIsFirstGetLockInfo
(
false
);
}
}
}
else
{
}
else
{
...
...
dev/src/view/login/v_index.js
View file @
be878c42
...
@@ -104,101 +104,14 @@ function loginButtonTap(self){
...
@@ -104,101 +104,14 @@ function loginButtonTap(self){
}
}
//云端登陆
//云端登陆
function
cloudsLogin
(
self
,
id
){
iot
.
business
.
user
.
autoLogin
({
success
:
(
response
)
=>
{
console
.
log
(
"autoLogin"
);
console
.
log
(
response
);
let
data
=
uPublic
.
checkResponseData
(
response
.
data
);
if
(
data
){
uComponents
.
hideLoading
(
self
);
iot
.
navigator
.
openWindow
({
url
:
'../device/index.html'
,
id
:
'device'
});
}
else
{
}
},
error
:
(
error
)
=>
{
console
.
log
(
error
);
iot
.
business
.
user
.
login
({
data
:
{
username
:
id
,
pwd
:
id
,
},
success
:
(
response
)
=>
{
console
.
log
(
"login"
);
console
.
log
(
response
);
let
data
=
uPublic
.
checkResponseData
(
response
.
data
);
if
(
data
){
uComponents
.
hideLoading
(
self
);
iot
.
navigator
.
openWindow
({
url
:
'../device/index.html'
,
id
:
'device'
});
}
else
{
}
},
error
:
(
error
)
=>
{
console
.
log
(
error
);
//不存在此用户
// if(code == 10002){
//用户注册
iot
.
business
.
user
.
reg
({
data
:
{
username
:
id
,
pwd
:
id
,
vcode
:
id
},
success
:
(
response
)
=>
{
console
.
log
(
"regist"
);
console
.
log
(
response
);
//注册成功
let
data
=
uPublic
.
checkResponseData
(
response
.
data
);
if
(
data
){
uComponents
.
hideLoading
(
self
);
iot
.
navigator
.
openWindow
({
url
:
'../device/index.html'
,
id
:
'device'
});
}
else
{
}
},
error
:
(
error
)
=>
{
console
.
log
(
error
);
//注册失败
uComponents
.
openAlert
(
self
,
Vue
.
t
(
'login.failure'
),
{
text
:
Vue
.
t
(
'dialog.confirm'
),
callback
:
function
()
{
plus
.
webview
.
currentWebview
().
reload
();
}
});
},
complete
:
()
=>
{}
});
// }
//请求失败
uPublic
.
openRequestErrorAlert
(
self
);
},
complete
:
()
=>
{}
});
},
complete
:
()
=>
{}
});
//
}
//function cloudsLogin(self, id){
//function cloudsLogin(self, id){
// uComponents.showLoading(self);
// iot.business.user.autoLogin({
// iot.business.user.simpleLogin({
// success: (response) => {
// data: {
// console.log("autoLogin");
// username: id
// console.log(response);
// },
// let data = uPublic.checkResponseData(response.data);
// success: (response) => {
// let data = uPublic.checkResponseData(response.data);
// if(data){
// if(data){
// uComponents.hideLoading(self);
// iot.navigator.openWindow({
// iot.navigator.openWindow({
// url: '../device/index.html',
// url: '../device/index.html',
// id: 'device'
// id: 'device'
...
@@ -206,13 +119,100 @@ function cloudsLogin(self, id){
...
@@ -206,13 +119,100 @@ function cloudsLogin(self, id){
// }else{
// }else{
//
//
// }
// }
// },
// },
// error: (error) => {
// error: (error) => {
// console.log(error);
// console.log(error);
// uPublic.openRequestErrorAlert(self);
// iot.business.user.login({
// },
// data: {
// complete: () => {
// username: id,
// uComponents.hideLoading(self);
// pwd: id,
// }
// },
// success: (response) => {
// console.log("login");
// console.log(response);
// let data = uPublic.checkResponseData(response.data);
// if(data){
// uComponents.hideLoading(self);
// iot.navigator.openWindow({
// url: '../device/index.html',
// id: 'device'
// });
// }else{
//
// }
// },
// error: (error) => {
// console.log(error);
// //不存在此用户
//// if(code == 10002){
// //用户注册
// iot.business.user.reg({
// data: {
// username: id,
// pwd: id,
// vcode: id
// },
// success: (response) => {
// console.log("regist");
// console.log(response);
// //注册成功
// let data = uPublic.checkResponseData(response.data);
// if(data){
// uComponents.hideLoading(self);
// iot.navigator.openWindow({
// url: '../device/index.html',
// id: 'device'
// });
// }else{
//
// }
// },
// error: (error) => {
// console.log(error);
// //注册失败
// uComponents.openAlert(self, Vue.t('login.failure'), {
// text: Vue.t('dialog.confirm'), callback: function () {
// plus.webview.currentWebview().reload();
// }
// });
// },
// complete: () => {}
// });
//// }
// //请求失败
// uPublic.openRequestErrorAlert(self);
// },
// complete: () => {}
// });
// },
// complete: () => {}
// });
// });
//}
////
\ No newline at end of file
//}
function
cloudsLogin
(
self
,
id
){
uComponents
.
showLoading
(
self
);
iot
.
business
.
user
.
simpleLogin
({
data
:
{
username
:
id
},
success
:
(
response
)
=>
{
let
data
=
uPublic
.
checkResponseData
(
response
.
data
);
if
(
data
){
iot
.
navigator
.
openWindow
({
url
:
'../device/index.html'
,
id
:
'device'
});
}
else
{
}
},
error
:
(
error
)
=>
{
console
.
log
(
error
);
uPublic
.
openRequestErrorAlert
(
self
);
},
complete
:
()
=>
{
uComponents
.
hideLoading
(
self
);
}
});
}
\ No newline at end of file
web/view/device/index.js
View file @
be878c42
...
@@ -16276,15 +16276,15 @@ function getLockInfo(self) {
...
@@ -16276,15 +16276,15 @@ function getLockInfo(self) {
// self.setBatteryState(config.powerIcon[Math.round(data.battery/20)]);
// self.setBatteryState(config.powerIcon[Math.round(data.battery/20)]);
//判断云端是否绑定
//判断云端是否绑定
if
(
data
.
lock_id
)
{
if
(
data
.
lock_id
)
{
setValueOfSwitch
(
self
,
1
);
self
.
setLockId
(
data
.
lock_id
);
self
.
setLockId
(
data
.
lock_id
);
self
.
setRole
(
data
.
role
);
self
.
setRole
(
data
.
role
);
getDeviceStatus
(
self
);
console
.
log
(
data
.
info
);
console
.
log
(
data
.
info
);
if
(
data
.
info
)
{
if
(
data
.
info
)
{
self
.
newMsg
=
(
0
,
_moment2
.
default
)(
data
.
info
[
0
].
time
).
format
(
"YY.MM.DD HH:mm"
)
+
data
.
info
[
0
].
nickname
+
Vue
.
t
(
'opendoorRecord.'
+
_config2
.
default
.
openDoorMode
[
data
.
info
[
0
].
mode
]
+
''
);
self
.
newMsg
=
(
0
,
_moment2
.
default
)(
data
.
info
[
0
].
time
).
format
(
"YY.MM.DD HH:mm"
)
+
data
.
info
[
0
].
nickname
+
Vue
.
t
(
'opendoorRecord.'
+
_config2
.
default
.
openDoorMode
[
data
.
info
[
0
].
mode
]
+
''
);
_public
.
uComponents
.
changeMarqueeText
(
self
,
self
.
newMsg
);
_public
.
uComponents
.
changeMarqueeText
(
self
,
self
.
newMsg
);
setValueOfSwitch
(
self
,
1
);
if
(
self
.
isFirstGetLockInfo
)
{
if
(
self
.
isFirstGetLockInfo
)
{
getDeviceStatus
(
self
);
self
.
setIsFirstGetLockInfo
(
false
);
self
.
setIsFirstGetLockInfo
(
false
);
}
}
}
else
{
}
else
{
...
...
web/view/login/index.js
View file @
be878c42
...
@@ -110,14 +110,101 @@ function loginButtonTap(self) {
...
@@ -110,14 +110,101 @@ function loginButtonTap(self) {
}
}
//云端登陆
//云端登陆
//function cloudsLogin(self, id){
// iot.business.user.autoLogin({
// success: (response) => {
// console.log("autoLogin");
// console.log(response);
// let data = uPublic.checkResponseData(response.data);
// if(data){
// uComponents.hideLoading(self);
// iot.navigator.openWindow({
// url: '../device/index.html',
// id: 'device'
// });
// }else{
//
// }
// },
// error: (error) => {
// console.log(error);
// iot.business.user.login({
// data: {
// username: id,
// pwd: id,
// },
// success: (response) => {
// console.log("login");
// console.log(response);
// let data = uPublic.checkResponseData(response.data);
// if(data){
// uComponents.hideLoading(self);
// iot.navigator.openWindow({
// url: '../device/index.html',
// id: 'device'
// });
// }else{
//
// }
// },
// error: (error) => {
// console.log(error);
// //不存在此用户
//// if(code == 10002){
// //用户注册
// iot.business.user.reg({
// data: {
// username: id,
// pwd: id,
// vcode: id
// },
// success: (response) => {
// console.log("regist");
// console.log(response);
// //注册成功
// let data = uPublic.checkResponseData(response.data);
// if(data){
// uComponents.hideLoading(self);
// iot.navigator.openWindow({
// url: '../device/index.html',
// id: 'device'
// });
// }else{
//
// }
// },
// error: (error) => {
// console.log(error);
// //注册失败
// uComponents.openAlert(self, Vue.t('login.failure'), {
// text: Vue.t('dialog.confirm'), callback: function () {
// plus.webview.currentWebview().reload();
// }
// });
// },
// complete: () => {}
// });
//// }
// //请求失败
// uPublic.openRequestErrorAlert(self);
// },
// complete: () => {}
// });
// },
// complete: () => {}
// });
////
//}
function
cloudsLogin
(
self
,
id
)
{
function
cloudsLogin
(
self
,
id
)
{
_public
.
iot
.
business
.
user
.
autoLogin
({
_public
.
uComponents
.
showLoading
(
self
);
_public
.
iot
.
business
.
user
.
simpleLogin
({
data
:
{
username
:
id
},
success
:
function
success
(
response
)
{
success
:
function
success
(
response
)
{
console
.
log
(
"autoLogin"
);
console
.
log
(
response
);
var
data
=
_public
.
uPublic
.
checkResponseData
(
response
.
data
);
var
data
=
_public
.
uPublic
.
checkResponseData
(
response
.
data
);
if
(
data
)
{
if
(
data
)
{
_public
.
uComponents
.
hideLoading
(
self
);
_public
.
iot
.
navigator
.
openWindow
({
_public
.
iot
.
navigator
.
openWindow
({
url
:
'../device/index.html'
,
url
:
'../device/index.html'
,
id
:
'device'
id
:
'device'
...
@@ -126,96 +213,13 @@ function cloudsLogin(self, id) {
...
@@ -126,96 +213,13 @@ function cloudsLogin(self, id) {
},
},
error
:
function
error
(
_error3
)
{
error
:
function
error
(
_error3
)
{
console
.
log
(
_error3
);
console
.
log
(
_error3
);
_public
.
iot
.
business
.
user
.
login
({
_public
.
uPublic
.
openRequestErrorAlert
(
self
);
data
:
{
username
:
id
,
pwd
:
id
},
success
:
function
success
(
response
)
{
console
.
log
(
"login"
);
console
.
log
(
response
);
var
data
=
_public
.
uPublic
.
checkResponseData
(
response
.
data
);
if
(
data
)
{
_public
.
uComponents
.
hideLoading
(
self
);
_public
.
iot
.
navigator
.
openWindow
({
url
:
'../device/index.html'
,
id
:
'device'
});
}
else
{}
},
error
:
function
error
(
_error4
)
{
console
.
log
(
_error4
);
//不存在此用户
// if(code == 10002){
//用户注册
_public
.
iot
.
business
.
user
.
reg
({
data
:
{
username
:
id
,
pwd
:
id
,
vcode
:
id
},
success
:
function
success
(
response
)
{
console
.
log
(
"regist"
);
console
.
log
(
response
);
//注册成功
var
data
=
_public
.
uPublic
.
checkResponseData
(
response
.
data
);
if
(
data
)
{
_public
.
uComponents
.
hideLoading
(
self
);
_public
.
iot
.
navigator
.
openWindow
({
url
:
'../device/index.html'
,
id
:
'device'
});
}
else
{}
},
error
:
function
error
(
_error5
)
{
console
.
log
(
_error5
);
//注册失败
_public
.
uComponents
.
openAlert
(
self
,
Vue
.
t
(
'login.failure'
),
{
text
:
Vue
.
t
(
'dialog.confirm'
),
callback
:
function
callback
()
{
plus
.
webview
.
currentWebview
().
reload
();
}
});
},
complete
:
function
complete
()
{}
});
// }
//请求失败
_public
.
uPublic
.
openRequestErrorAlert
(
self
);
},
complete
:
function
complete
()
{}
});
},
},
complete
:
function
complete
()
{}
complete
:
function
complete
()
{
_public
.
uComponents
.
hideLoading
(
self
);
}
});
});
//
}
}
//function cloudsLogin(self, id){
// uComponents.showLoading(self);
// iot.business.user.simpleLogin({
// data: {
// username: id
// },
// success: (response) => {
// let data = uPublic.checkResponseData(response.data);
// if(data){
// iot.navigator.openWindow({
// url: '../device/index.html',
// id: 'device'
// });
// }else{
//
// }
// },
// error: (error) => {
// console.log(error);
// uPublic.openRequestErrorAlert(self);
// },
// complete: () => {
// uComponents.hideLoading(self);
// }
// });
//}
/* WEBPACK VAR INJECTION */
}.
call
(
exports
,
__webpack_require__
(
1
)[
"default"
]))
/* WEBPACK VAR INJECTION */
}.
call
(
exports
,
__webpack_require__
(
1
)[
"default"
]))
/***/
}),
/***/
}),
...
...
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