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
76db91b9
Commit
76db91b9
authored
Jan 22, 2018
by
朱建香
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#25 铃声效果优化
#26 wifi配网添加超时倒计时
parent
d9b7aa95
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
188 additions
and
41 deletions
+188
-41
dev/src/lang/zh.json
+4
-3
dev/src/public/defaultConfig.js
+4
-2
dev/src/public/public.js
+2
-2
dev/src/view/addDevice/v_scanCodeAdd.js
+6
-3
dev/src/view/addDevice/v_wifiAdd.js
+35
-1
dev/src/view/device/v_index.js
+64
-30
web/lib/less/addDevice/addDevice.less
+37
-0
web/view/addDevice/addDevice.css
+33
-0
web/view/addDevice/wifiAdd.html
+3
-0
No files found.
dev/src/lang/zh.json
View file @
76db91b9
...
...
@@ -193,9 +193,9 @@
},
"wifiAdd"
:
{
"unbindWifiTip"
:
"当前无Wi-Fi"
,
"wifiBinding"
:
"
配网中
"
,
"wifiBindSuccess"
:
"Wi-Fi连接成功,正在激活设备"
,
"deviceActivating"
:
"Wi-Fi连接成功,正在激活设备"
,
"wifiBinding"
:
"
正在连接网络...
"
,
"wifiBindSuccess"
:
"Wi-Fi连接成功,正在激活设备
...
"
,
"deviceActivating"
:
"Wi-Fi连接成功,正在激活设备
...
"
,
"deviceActivateSuccess"
:
"激活成功"
,
"deviceActivateFailure"
:
"激活失败"
,
"bindTimeout"
:
"连接超时"
,
...
...
@@ -204,6 +204,7 @@
"remindCont1"
:
"1. 请确保Wi-Fi信号良好"
,
"remindCont2"
:
"2. 本产品暂不支持5GHz无线网络"
,
"noticeTip"
:
"检测到您还未开启通知,将无法及时<br>接收安全推送"
,
"countDownText"
:
"{0}s"
,
"error"
:
{
}
...
...
dev/src/public/defaultConfig.js
View file @
76db91b9
export
default
{
"url"
:
"http://192.168.2.96:20000"
,
"model"
:
"USMARTLOCK_SECURITY_SMARTDOOR_SMART_LOCK"
"url"
:
"https://cloud.iot.u-gen.net/"
,
// "url": "http://192.168.2.96:20000",
"model"
:
"UGEN_SECURITY_SMARTDOOR_YJ2017"
}
\ No newline at end of file
dev/src/public/public.js
View file @
76db91b9
...
...
@@ -12,8 +12,8 @@ const iot = new UIOT({
lang
:
[
'zh'
,
'en'
],
vue
:
Vue
,
i18n
:
VueI18n
,
appId
:
'
1
0004'
,
appSecret
:
'
1
0004'
,
appId
:
'
2
0004'
,
appSecret
:
'
2
0004'
,
wx
:
{
appId
:
''
},
...
...
dev/src/view/addDevice/v_scanCodeAdd.js
View file @
76db91b9
...
...
@@ -39,6 +39,9 @@ function init() {
self
.
noticeTipShowFlag
=
!
iot
.
native
.
isNotifycationOpen
();
scanCodeSuccess
(
self
);
});
plus
.
key
.
addEventListener
(
'backbutton'
,
function
(){
iot
.
utils
.
closeScanBarcode
(
self
.
barcode
);
},
false
);
},
methods
:{
//tap <
...
...
@@ -73,9 +76,8 @@ function initComponentsConfig() {
//tap <
function
backTap
(
self
){
iot
.
navigator
.
back
();
console
.
log
(
self
.
barcode
);
iot
.
utils
.
closeScanBarcode
(
self
.
barcode
);
iot
.
navigator
.
aback
();
}
function
openScanCode
(
self
){
...
...
@@ -246,7 +248,8 @@ function scanCodeFailue(self){
"class"
:
'custom-process-button'
,
'text'
:
Vue
.
t
(
'addDevice.reBindDevice'
),
'callback'
:
()
=>
{
//激活失败
uComponents
.
hideProcess
(
self
);
uComponents
.
showProcess
(
self
,
0
,
Vue
.
t
(
'addDevice.loading'
));
iot
.
utils
.
closeScanBarcode
(
self
.
barcode
);
// uComponents.showProcess(self, 0, Vue.t('addDevice.loading'));
openScanCode
(
self
);
}
}]);
...
...
dev/src/view/addDevice/v_wifiAdd.js
View file @
76db91b9
...
...
@@ -24,7 +24,9 @@ function init() {
//配置组件
componentsConfig
:
initComponentsConfig
(),
noticeTipShowFlag
:
false
,
timeout
:
null
timeout
:
null
,
countDownText
:
60
,
activing
:
false
},
mounted
(){
resolve
(
this
);
...
...
@@ -148,6 +150,22 @@ function backTap(){
//tap 连接
function
connectButtonTap
(
self
){
self
.
countDownText
=
60
;
let
countDown
=
setInterval
(()
=>
{
self
.
countDownText
--
;
if
(
self
.
countDownText
<=
0
){
window
.
clearInterval
(
countDown
);
addFailue
(
self
);
// iot.business.sds.stopFindWIFI({
// success: (response) => {},
// error: (error) => {}
// });
iot
.
business
.
sds
.
stopFindDevices
({
success
:
(
response
)
=>
{},
error
:
(
error
)
=>
{}
});
}
},
1000
);
if
(
self
.
getTextWiFiName
()
==
null
||
self
.
getTextWiFiName
().
trim
()
==
''
){
self
.
setTextErrorTip
(
Vue
.
t
(
'wifiAdd.unbindWifiTip'
));
}
else
if
(
self
.
getTextPassword
()
==
null
||
self
.
getTextPassword
().
trim
()
==
''
){
...
...
@@ -218,7 +236,23 @@ function connectButtonTap(self){
if
(
window
.
iotDebug
)
{
iotDebug
.
upload
(
iot
,
'激活中'
);
}
if
(
self
.
activing
===
false
){
window
.
clearInterval
(
countDown
);
self
.
countDownText
=
60
;
countDown
=
setInterval
(()
=>
{
self
.
countDownText
--
;
if
(
self
.
countDownText
<=
0
){
window
.
clearInterval
(
countDown
);
addFailue
(
self
);
iot
.
business
.
sds
.
stopFindDevices
({
success
:
(
response
)
=>
{},
error
:
(
error
)
=>
{}
});
}
},
1000
);
uComponents
.
showProcess
(
self
,
0
,
Vue
.
t
(
'wifiAdd.deviceActivating'
));
self
.
activing
=
true
;
}
}
else
if
(
response
.
data
==
"joined success"
){
if
(
window
.
iotDebug
){
iotDebug
.
push
(
'end: 激活成功'
+
JSON
.
stringify
(
response
));
...
...
dev/src/view/device/v_index.js
View file @
76db91b9
...
...
@@ -134,7 +134,13 @@ function init() {
iot
.
navigator
.
closeAllBesidesItself
();
}
});
// ringBell(self);
// setTimeout(() => {
// ringBell(self);
// setTimeout(() =>{
// ringBell(self);
// },1000);
// },1000);
},
methods
:{
setValueRemoteOpendoor
(
value
){
...
...
@@ -853,7 +859,7 @@ function sdsDataPorcessing(self, data){
function
setBatteryPercentAndIcon
(
self
,
value
){
console
.
log
(
'setBatteryPercentAndIcon'
+
value
);
self
.
setBatteryPercent
(
value
);
let
state
=
0
;
let
state
=
5
;
if
(
value
>=
10
){
//向上取整
state
=
config
.
powerIcon
[
Math
.
ceil
(
value
/
20
)];
...
...
@@ -906,51 +912,79 @@ function setRemoteOpenDoorLoading(self, status, text, buttonText){
//响铃动画和铃声设置
function
ringBell
(
self
){
window
.
clearInterval
(
self
.
time
);
window
.
clearTimeout
(
self
.
timeout
);
let
i
=
0
;
simpleRingBell
(
self
,
i
);
self
.
setRingTime
(
config
.
ring_time
);
self
.
time
=
setInterval
(
function
(){
i
++
;
simpleRingBell
(
self
,
i
);
},
config
.
await_time
*
2
);
}
//铃声和动画循环一遍
function
simpleRingBell
(
self
,
i
){
window
.
clearTimeout
(
self
.
timeout
);
// window.clearInterval(self.time);
// window.clearTimeout(self.timeout);
// let i = 0;
// simpleRingBell(self,i);
// self.setRingTime(config.ring_time);
// self.time = setInterval(function(){
// i++;
// simpleRingBell(self,i);
// },config.await_time*2);
if
(
self
.
getDoorbellRingingFlag
()
===
false
){
self
.
setDoorbellRingingFlag
(
true
);
let
p
=
plus
.
audio
.
createPlayer
(
config
.
audioUrl
);
self
.
timeout
=
setTimeout
(()
=>
{
p
=
plus
.
audio
.
createPlayer
(
config
.
audioUrl
);
p
.
play
(
function
()
{
console
.
log
(
"Audio play success!"
);
},
function
(
e
)
{
console
.
log
(
"Audio play error: "
+
e
.
message
);
});
self
.
timeout
=
setTimeout
(
function
(){
console
.
log
(
self
.
timeout
);
self
.
timeout
=
setTimeout
(()
=>
{
console
.
log
(
"in2"
);
p
=
plus
.
audio
.
createPlayer
(
config
.
audioUrl
);
p
.
play
(
function
()
{
console
.
log
(
"Audio play success!"
);
},
function
(
e
)
{
console
.
log
(
"Audio play error: "
+
e
.
message
);
});
window
.
clearTimeout
(
self
.
timeout
);
self
.
timeout
=
setTimeout
(
function
()
{
console
.
log
(
self
.
timeout
);
self
.
timeout
=
setTimeout
(()
=>
{
self
.
setDoorbellRingingFlag
(
false
);
window
.
clearTimeout
(
self
.
timeout
);
if
(
i
>=
1
){
window
.
clearInterval
(
self
.
time
);
}
},
config
.
await_time
*
3
/
5
);
if
(
i
>=
1
){
window
.
clearInterval
(
self
.
time
);
}
},
config
.
await_time
*
2
/
5
);
if
(
i
>=
1
){
window
.
clearInterval
(
self
.
time
);
console
.
log
(
self
.
timeout
);
},
1500
);
},
2000
);
},
500
);
}
}
//铃声和动画循环一遍
//function simpleRingBell(self,i){
// window.clearTimeout(self.timeout);
// self.setDoorbellRingingFlag(true);
// let p = plus.audio.createPlayer(config.audioUrl);
// p.play( function () {
// console.log( "Audio play success!" );
// }, function ( e ) {
// console.log( "Audio play error: " + e.message );
// });
//
// self.timeout = setTimeout(function(){
// p = plus.audio.createPlayer(config.audioUrl);
// p.play( function () {
// console.log( "Audio play success!" );
// }, function ( e ) {
// console.log( "Audio play error: " + e.message );
// });
// window.clearTimeout(self.timeout);
// self.timeout = setTimeout(function(){
// self.setDoorbellRingingFlag(false);
// window.clearTimeout(self.timeout);
// if(i>=1){
// window.clearInterval(self.time);
// }
// },1500);
// if(i>=1){
// window.clearInterval(self.time);
// }
// },500);
// if(i>=1){
// window.clearInterval(self.time);
// }
//}
function
pushAction
(
self
,
msg
)
{
var
payload
=
msg
.
payload
;
if
(
typeof
payload
==
'string'
)
{
...
...
web/lib/less/addDevice/addDevice.less
View file @
76db91b9
...
...
@@ -256,15 +256,52 @@
}
}
.u-process{
.u-process-content{
.loader{
&:before{
.transform(translateZ(0) scale(0.7));
}
}
}
}
.u-process.u-process-status-0{
.u-process-content{
.loading{
position: relative;
.loading-text{
position: absolute;
left: 0;
top: 0;
font-size: 16px;
line-height: 3.750em;
width: 100%;
text-align: center;
}
}
}
}
.u-process.u-process-status-1{
.u-process-content{
top: 200px;
.loading{
.loading-text{
display: none;
}
}
}
}
.u-process.u-process-status-2{
.u-process-content{
top: 200px;
.loading{
.loading-text{
display: none;
}
}
}
}
web/view/addDevice/addDevice.css
View file @
76db91b9
...
...
@@ -1122,6 +1122,11 @@ p {
}
}
.u-process-content
.loader
:before
{
-webkit-transform
:
translateZ
(
0
)
scale
(
0.7
);
transform
:
translateZ
(
0
)
scale
(
0.7
);
}
.scanContent
{
position
:
fixed
;
top
:
1.173rem
;
...
...
@@ -1197,10 +1202,37 @@ p {
background-color
:
transparent
;
}
.u-process
.u-process-content
.loader
:before
{
-webkit-transform
:
translateZ
(
0
)
scale
(
0.7
);
transform
:
translateZ
(
0
)
scale
(
0.7
);
}
.u-process.u-process-status-0
.u-process-content
.loading
{
position
:
relative
;
}
.u-process.u-process-status-0
.u-process-content
.loading
.loading-text
{
position
:
absolute
;
left
:
0
;
top
:
0
;
font-size
:
0.427rem
;
line-height
:
3.750em
;
width
:
100%
;
text-align
:
center
;
}
.u-process.u-process-status-1
.u-process-content
{
top
:
5.333rem
;
}
.u-process.u-process-status-1
.u-process-content
.loading
.loading-text
{
display
:
none
;
}
.u-process.u-process-status-2
.u-process-content
{
top
:
5.333rem
;
}
.u-process.u-process-status-2
.u-process-content
.loading
.loading-text
{
display
:
none
;
}
\ No newline at end of file
web/view/addDevice/wifiAdd.html
View file @
76db91b9
...
...
@@ -48,7 +48,10 @@
<p class="icon"></p>
</u-comm-loading> -->
<u-process
ref=
"uprocess"
:init-param=
"componentsConfig.processLoading.initParam"
>
<div
class=
"loading"
>
<p
class=
"loader"
></p>
<p
class=
"loading-text"
>
{{ $t('wifiAdd.countDownText',[countDownText]) }}
</p>
</div>
<p
class=
"icon"
></p>
<p
class=
"noticeContent"
v-show =
"noticeTipShowFlag"
>
<span>

</span>
...
...
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