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
c1a1afd5
Commit
c1a1afd5
authored
Nov 09, 2017
by
朱建香
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1109
parent
141b86ab
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
115 additions
and
4 deletions
+115
-4
dev/src/view/addDevice/v_wifiAdd.js
+55
-0
dev/src/view/device/v_index.js
+2
-2
web/view/addDevice/wifiAdd.html
+1
-0
web/view/addDevice/wifiAdd.js
+55
-0
web/view/device/index.js
+2
-2
No files found.
dev/src/view/addDevice/v_wifiAdd.js
View file @
c1a1afd5
...
@@ -152,11 +152,30 @@ function connectButtonTap(self){
...
@@ -152,11 +152,30 @@ function connectButtonTap(self){
success
:
(
response
)
=>
{
success
:
(
response
)
=>
{
console
.
log
(
"findWifi"
);
console
.
log
(
"findWifi"
);
console
.
log
(
response
);
console
.
log
(
response
);
console
.
log
(
JSON
.
stringify
(
response
));
if
(
window
.
iotDebug
){
iotDebug
.
push
(
'end: findWifi'
+
JSON
.
stringify
(
response
));
}
if
(
window
.
iotDebug
)
{
iotDebug
.
upload
(
iot
);
}
if
(
response
.
data
==
'onProvisioning'
){
if
(
response
.
data
==
'onProvisioning'
){
//wifi链接中
//wifi链接中
if
(
window
.
iotDebug
){
iotDebug
.
push
(
'end: 开始配网'
);
}
if
(
window
.
iotDebug
)
{
iotDebug
.
upload
(
iot
);
}
uComponents
.
showCommLoading
(
self
);
uComponents
.
showCommLoading
(
self
);
uComponents
.
changeCommLoadingStatusAndText
(
self
,
0
,
Vue
.
t
(
'wifiAdd.wifiBinding'
));
uComponents
.
changeCommLoadingStatusAndText
(
self
,
0
,
Vue
.
t
(
'wifiAdd.wifiBinding'
));
}
else
if
(
response
.
data
==
'provisioned success'
){
}
else
if
(
response
.
data
==
'provisioned success'
){
if
(
window
.
iotDebug
){
iotDebug
.
push
(
'end: 配网成功'
);
}
if
(
window
.
iotDebug
)
{
iotDebug
.
upload
(
iot
);
}
//wifi连接成功,停止连接wifi
//wifi连接成功,停止连接wifi
uComponents
.
changeCommLoadingStatusAndText
(
self
,
0
,
Vue
.
t
(
'wifiAdd.wifiBindSuccess'
));
uComponents
.
changeCommLoadingStatusAndText
(
self
,
0
,
Vue
.
t
(
'wifiAdd.wifiBindSuccess'
));
// iot.business.sds.stopFindWifi({
// iot.business.sds.stopFindWifi({
...
@@ -167,21 +186,51 @@ function connectButtonTap(self){
...
@@ -167,21 +186,51 @@ function connectButtonTap(self){
},
},
error
:
(
error
)
=>
{
error
:
(
error
)
=>
{
console
.
log
(
error
);
console
.
log
(
error
);
if
(
window
.
iotDebug
){
iotDebug
.
push
(
'end: findWifiError'
+
JSON
.
stringify
(
error
));
}
if
(
window
.
iotDebug
)
{
iotDebug
.
upload
(
iot
);
}
}
}
});
});
let
deviceId
=
null
;
let
deviceId
=
null
;
iot
.
business
.
sds
.
findDevices
({
iot
.
business
.
sds
.
findDevices
({
success
:
(
response
)
=>
{
success
:
(
response
)
=>
{
console
.
log
(
response
);
console
.
log
(
response
);
if
(
window
.
iotDebug
){
iotDebug
.
push
(
'end: findDevices'
+
JSON
.
stringify
(
response
));
}
if
(
window
.
iotDebug
)
{
iotDebug
.
upload
(
iot
);
}
let
productId
=
iot
.
navigator
.
getExtras
().
model
;
let
productId
=
iot
.
navigator
.
getExtras
().
model
;
if
(
response
.
data
==
"onJoining"
){
if
(
response
.
data
==
"onJoining"
){
if
(
window
.
iotDebug
){
iotDebug
.
push
(
'end: 激活中'
);
}
if
(
window
.
iotDebug
)
{
iotDebug
.
upload
(
iot
);
}
uComponents
.
changeCommLoadingStatusAndText
(
self
,
0
,
Vue
.
t
(
'wifiAdd.deviceActivating'
));
uComponents
.
changeCommLoadingStatusAndText
(
self
,
0
,
Vue
.
t
(
'wifiAdd.deviceActivating'
));
}
else
if
(
response
.
data
==
"joined success"
){
}
else
if
(
response
.
data
==
"joined success"
){
if
(
window
.
iotDebug
){
iotDebug
.
push
(
'end: 激活成功'
);
}
if
(
window
.
iotDebug
)
{
iotDebug
.
upload
(
iot
);
}
let
deviceId
=
response
.
info
.
sn
;
let
deviceId
=
response
.
info
.
sn
;
unbind
(
self
,
deviceId
,
productId
);
unbind
(
self
,
deviceId
,
productId
);
// bind(self, deviceId, productId);
// bind(self, deviceId, productId);
}
else
if
(
response
.
data
==
"fail"
){
}
else
if
(
response
.
data
==
"fail"
){
//连接失败
//连接失败
if
(
window
.
iotDebug
){
iotDebug
.
push
(
'end: 激活失败'
);
}
if
(
window
.
iotDebug
)
{
iotDebug
.
upload
(
iot
);
}
uComponents
.
changeCommLoadingStatusAndText
(
self
,
2
,
Vue
.
t
(
'wifiAdd.deviceActivateFailure'
));
uComponents
.
changeCommLoadingStatusAndText
(
self
,
2
,
Vue
.
t
(
'wifiAdd.deviceActivateFailure'
));
self
.
setStatus
(
2
);
self
.
setStatus
(
2
);
uComponents
.
changeCommButtonText
(
self
,
Vue
.
t
(
'addDevice.reBindDevice'
));
uComponents
.
changeCommButtonText
(
self
,
Vue
.
t
(
'addDevice.reBindDevice'
));
...
@@ -194,6 +243,12 @@ function connectButtonTap(self){
...
@@ -194,6 +243,12 @@ function connectButtonTap(self){
},
},
error
:
(
error
)
=>
{
error
:
(
error
)
=>
{
console
.
log
(
error
);
console
.
log
(
error
);
if
(
window
.
iotDebug
){
iotDebug
.
push
(
'end: findDevicesError'
+
JSON
.
stringify
(
response
));
}
if
(
window
.
iotDebug
)
{
iotDebug
.
upload
(
iot
);
}
}
}
});
});
}
}
...
...
dev/src/view/device/v_index.js
View file @
c1a1afd5
...
@@ -781,7 +781,7 @@ function securityAlarmTap(self){
...
@@ -781,7 +781,7 @@ function securityAlarmTap(self){
//tap 门锁用户
//tap 门锁用户
function
doorlockUserTap
(
self
){
function
doorlockUserTap
(
self
){
if
(
self
.
getValueDoorlockUser
()
==
1
){
//
if(self.getValueDoorlockUser() == 1){
iot
.
navigator
.
openWindow
({
iot
.
navigator
.
openWindow
({
url
:
'../doorlockUsers/index.html'
,
url
:
'../doorlockUsers/index.html'
,
id
:
'doorlockUsers'
,
id
:
'doorlockUsers'
,
...
@@ -792,7 +792,7 @@ function doorlockUserTap(self){
...
@@ -792,7 +792,7 @@ function doorlockUserTap(self){
role
:
self
.
getRole
()
role
:
self
.
getRole
()
}
}
});
});
}
//
}
}
}
//tap 远程开门
//tap 远程开门
...
...
web/view/addDevice/wifiAdd.html
View file @
c1a1afd5
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
display
:
none
;
display
:
none
;
}
}
</style>
</style>
<script
type=
"text/javascript"
src=
"./start.js"
></script>
<script
type=
"text/javascript"
src=
"../../lib/js/p.js"
></script>
<script
type=
"text/javascript"
src=
"../../lib/js/p.js"
></script>
<script
type=
"text/javascript"
src=
"../../lib/js/UIOT.js"
></script>
<script
type=
"text/javascript"
src=
"../../lib/js/UIOT.js"
></script>
</head>
</head>
...
...
web/view/addDevice/wifiAdd.js
View file @
c1a1afd5
...
@@ -169,11 +169,30 @@ function connectButtonTap(self) {
...
@@ -169,11 +169,30 @@ function connectButtonTap(self) {
success
:
function
success
(
response
)
{
success
:
function
success
(
response
)
{
console
.
log
(
"findWifi"
);
console
.
log
(
"findWifi"
);
console
.
log
(
response
);
console
.
log
(
response
);
console
.
log
(
JSON
.
stringify
(
response
));
if
(
window
.
iotDebug
)
{
iotDebug
.
push
(
'end: findWifi'
+
JSON
.
stringify
(
response
));
}
if
(
window
.
iotDebug
)
{
iotDebug
.
upload
(
_public
.
iot
);
}
if
(
response
.
data
==
'onProvisioning'
)
{
if
(
response
.
data
==
'onProvisioning'
)
{
//wifi链接中
//wifi链接中
if
(
window
.
iotDebug
)
{
iotDebug
.
push
(
'end: 开始配网'
);
}
if
(
window
.
iotDebug
)
{
iotDebug
.
upload
(
_public
.
iot
);
}
_public
.
uComponents
.
showCommLoading
(
self
);
_public
.
uComponents
.
showCommLoading
(
self
);
_public
.
uComponents
.
changeCommLoadingStatusAndText
(
self
,
0
,
Vue
.
t
(
'wifiAdd.wifiBinding'
));
_public
.
uComponents
.
changeCommLoadingStatusAndText
(
self
,
0
,
Vue
.
t
(
'wifiAdd.wifiBinding'
));
}
else
if
(
response
.
data
==
'provisioned success'
)
{
}
else
if
(
response
.
data
==
'provisioned success'
)
{
if
(
window
.
iotDebug
)
{
iotDebug
.
push
(
'end: 配网成功'
);
}
if
(
window
.
iotDebug
)
{
iotDebug
.
upload
(
_public
.
iot
);
}
//wifi连接成功,停止连接wifi
//wifi连接成功,停止连接wifi
_public
.
uComponents
.
changeCommLoadingStatusAndText
(
self
,
0
,
Vue
.
t
(
'wifiAdd.wifiBindSuccess'
));
_public
.
uComponents
.
changeCommLoadingStatusAndText
(
self
,
0
,
Vue
.
t
(
'wifiAdd.wifiBindSuccess'
));
// iot.business.sds.stopFindWifi({
// iot.business.sds.stopFindWifi({
...
@@ -184,21 +203,51 @@ function connectButtonTap(self) {
...
@@ -184,21 +203,51 @@ function connectButtonTap(self) {
},
},
error
:
function
error
(
_error2
)
{
error
:
function
error
(
_error2
)
{
console
.
log
(
_error2
);
console
.
log
(
_error2
);
if
(
window
.
iotDebug
)
{
iotDebug
.
push
(
'end: findWifiError'
+
JSON
.
stringify
(
_error2
));
}
if
(
window
.
iotDebug
)
{
iotDebug
.
upload
(
_public
.
iot
);
}
}
}
});
});
var
deviceId
=
null
;
var
deviceId
=
null
;
_public
.
iot
.
business
.
sds
.
findDevices
({
_public
.
iot
.
business
.
sds
.
findDevices
({
success
:
function
success
(
response
)
{
success
:
function
success
(
response
)
{
console
.
log
(
response
);
console
.
log
(
response
);
if
(
window
.
iotDebug
)
{
iotDebug
.
push
(
'end: findDevices'
+
JSON
.
stringify
(
response
));
}
if
(
window
.
iotDebug
)
{
iotDebug
.
upload
(
_public
.
iot
);
}
var
productId
=
_public
.
iot
.
navigator
.
getExtras
().
model
;
var
productId
=
_public
.
iot
.
navigator
.
getExtras
().
model
;
if
(
response
.
data
==
"onJoining"
)
{
if
(
response
.
data
==
"onJoining"
)
{
if
(
window
.
iotDebug
)
{
iotDebug
.
push
(
'end: 激活中'
);
}
if
(
window
.
iotDebug
)
{
iotDebug
.
upload
(
_public
.
iot
);
}
_public
.
uComponents
.
changeCommLoadingStatusAndText
(
self
,
0
,
Vue
.
t
(
'wifiAdd.deviceActivating'
));
_public
.
uComponents
.
changeCommLoadingStatusAndText
(
self
,
0
,
Vue
.
t
(
'wifiAdd.deviceActivating'
));
}
else
if
(
response
.
data
==
"joined success"
)
{
}
else
if
(
response
.
data
==
"joined success"
)
{
if
(
window
.
iotDebug
)
{
iotDebug
.
push
(
'end: 激活成功'
);
}
if
(
window
.
iotDebug
)
{
iotDebug
.
upload
(
_public
.
iot
);
}
var
_deviceId
=
response
.
info
.
sn
;
var
_deviceId
=
response
.
info
.
sn
;
unbind
(
self
,
_deviceId
,
productId
);
unbind
(
self
,
_deviceId
,
productId
);
// bind(self, deviceId, productId);
// bind(self, deviceId, productId);
}
else
if
(
response
.
data
==
"fail"
)
{
}
else
if
(
response
.
data
==
"fail"
)
{
//连接失败
//连接失败
if
(
window
.
iotDebug
)
{
iotDebug
.
push
(
'end: 激活失败'
);
}
if
(
window
.
iotDebug
)
{
iotDebug
.
upload
(
_public
.
iot
);
}
_public
.
uComponents
.
changeCommLoadingStatusAndText
(
self
,
2
,
Vue
.
t
(
'wifiAdd.deviceActivateFailure'
));
_public
.
uComponents
.
changeCommLoadingStatusAndText
(
self
,
2
,
Vue
.
t
(
'wifiAdd.deviceActivateFailure'
));
self
.
setStatus
(
2
);
self
.
setStatus
(
2
);
_public
.
uComponents
.
changeCommButtonText
(
self
,
Vue
.
t
(
'addDevice.reBindDevice'
));
_public
.
uComponents
.
changeCommButtonText
(
self
,
Vue
.
t
(
'addDevice.reBindDevice'
));
...
@@ -211,6 +260,12 @@ function connectButtonTap(self) {
...
@@ -211,6 +260,12 @@ function connectButtonTap(self) {
},
},
error
:
function
error
(
_error4
)
{
error
:
function
error
(
_error4
)
{
console
.
log
(
_error4
);
console
.
log
(
_error4
);
if
(
window
.
iotDebug
)
{
iotDebug
.
push
(
'end: findDevicesError'
+
JSON
.
stringify
(
response
));
}
if
(
window
.
iotDebug
)
{
iotDebug
.
upload
(
_public
.
iot
);
}
}
}
});
});
}
}
...
...
web/view/device/index.js
View file @
c1a1afd5
...
@@ -24706,7 +24706,7 @@ function securityAlarmTap(self) {
...
@@ -24706,7 +24706,7 @@ function securityAlarmTap(self) {
//tap 门锁用户
//tap 门锁用户
function
doorlockUserTap
(
self
)
{
function
doorlockUserTap
(
self
)
{
if
(
self
.
getValueDoorlockUser
()
==
1
)
{
// if(self.getValueDoorlockUser() == 1)
{
_public
.
iot
.
navigator
.
openWindow
({
_public
.
iot
.
navigator
.
openWindow
({
url
:
'../doorlockUsers/index.html'
,
url
:
'../doorlockUsers/index.html'
,
id
:
'doorlockUsers'
,
id
:
'doorlockUsers'
,
...
@@ -24717,7 +24717,7 @@ function doorlockUserTap(self) {
...
@@ -24717,7 +24717,7 @@ function doorlockUserTap(self) {
role
:
self
.
getRole
()
role
:
self
.
getRole
()
}
}
});
});
}
//
}
}
}
//tap 远程开门
//tap 远程开门
...
...
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