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
e84390ee
Commit
e84390ee
authored
Jan 11, 2018
by
wjd
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'zjx' into 'test/96'
Zjx See merge request iot-project-js/doorlock!13
parents
8b366b1d
c15aa5e7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
295 additions
and
163 deletions
+295
-163
dev/src/lang/en.json
+17
-10
dev/src/lang/zh.json
+4
-4
dev/src/public/config.js
+5
-5
dev/src/view/addDevice/v_scanCodeAdd.js
+126
-47
dev/src/view/addDevice/v_wifiAdd.js
+19
-64
dev/src/view/device/v_alarmInfo.js
+3
-0
dev/src/view/device/v_hijackRecord.js
+3
-0
dev/src/view/device/v_index.js
+47
-21
dev/src/view/device/v_notify.js
+6
-2
dev/src/view/device/v_opendoorRecord.js
+3
-0
dev/src/view/doorlockManage/v_index.js
+28
-10
web/lib/less/doorlockManage/doorlockManage.less
+9
-0
web/resources/lang/zh.json
+0
-0
web/view/addDevice/scanCodeAdd.html
+8
-0
web/view/doorlockManage/doorlockManage.css
+17
-0
No files found.
dev/src/lang/en.json
View file @
e84390ee
...
@@ -115,7 +115,8 @@
...
@@ -115,7 +115,8 @@
"doorLockRinging"
:
"门铃响了"
,
"doorLockRinging"
:
"门铃响了"
,
"defaultNewMsg"
:
"您尚未绑定门锁"
,
"defaultNewMsg"
:
"您尚未绑定门锁"
,
"noNewMsg"
:
"门锁休息中"
,
"noNewMsg"
:
"门锁休息中"
,
"bindDoorlock"
:
"绑定门锁"
"bindDoorlock"
:
"绑定门锁"
,
"use"
:
"使用"
},
},
"opendoorRecord"
:{
"opendoorRecord"
:{
"noRecordTip"
:
"暂无记录"
,
"noRecordTip"
:
"暂无记录"
,
...
@@ -153,12 +154,11 @@
...
@@ -153,12 +154,11 @@
"logoutDialogTip"
:
"确定要退出系统吗?"
,
"logoutDialogTip"
:
"确定要退出系统吗?"
,
"defaultNickname"
:
"门锁"
,
"defaultNickname"
:
"门锁"
,
"isClearRecord"
:
"清除所有信息"
,
"isClearRecord"
:
"清除所有信息"
,
"unbindSuccess"
:
"解绑成功"
,
"doorbellMsgPush"
:
"门铃消息推送"
,
"doorbellMsgPush"
:
"门铃消息推送"
,
"alarmMsgPush"
:
"报警消息推送"
,
"alarmMsgPush"
:
"报警消息推送"
,
"opendoorMsgPush"
:
"开门消息推送"
,
"opendoorMsgPush"
:
"开门消息推送"
,
"unbindDialogTip"
:
"确认解除绑定"
,
"unbindDialogTip"
:
"确认解除绑定"
,
"unbindSuccess"
:
"解绑成功"
,
"unbindSuccess"
:
"
<span></span>
解绑成功"
,
"unbindFailue"
:
"解绑失败"
"unbindFailue"
:
"解绑失败"
},
},
"editName"
:{
"editName"
:{
...
@@ -184,11 +184,11 @@
...
@@ -184,11 +184,11 @@
"bindFailure"
:
"绑定失败"
,
"bindFailure"
:
"绑定失败"
,
"reBindDevice"
:
"请重新绑定"
"reBindDevice"
:
"请重新绑定"
},
},
"wifiAddHelp"
:
{
"wifiAddHelp"
:
{
"helpTitle"
:
"配置WIFI说明:"
,
"helpTitle"
:
"配置WIFI说明:"
,
"helpCont1"
:
"
1.
确认设备端进入配网模式(详情操作请见产品说明书)"
,
"helpCont1"
:
"确认设备端进入配网模式(详情操作请见产品说明书)"
,
"helpCont2"
:
"
2.
点击页面下方“开始配置Wi-Fi”按钮,进入WiFi配网页面"
,
"helpCont2"
:
"点击页面下方“开始配置Wi-Fi”按钮,进入WiFi配网页面"
,
"helpCont3"
:
"
3.
输入Wi-Fi密码,点击“连接”,等待锁端响应,至配网成功。"
,
"helpCont3"
:
"输入Wi-Fi密码,点击“连接”,等待锁端响应,至配网成功。"
,
"helpCont4"
:
"(提示:如果指纹锁已经绑定过用户,重新绑定成功后会清除之前所有绑定信息)"
"helpCont4"
:
"(提示:如果指纹锁已经绑定过用户,重新绑定成功后会清除之前所有绑定信息)"
},
},
"wifiAdd"
:
{
"wifiAdd"
:
{
...
@@ -277,9 +277,9 @@
...
@@ -277,9 +277,9 @@
"inviteBind"
:{
"inviteBind"
:{
"qrcodeExpireTip"
:
"二维码已过期,请重新生成"
,
"qrcodeExpireTip"
:
"二维码已过期,请重新生成"
,
"title"
:
"绑定方法:"
,
"title"
:
"绑定方法:"
,
"cont1"
:
"
1.
受邀用户登录“U智锁”APP"
,
"cont1"
:
"受邀用户登录“U智锁”APP"
,
"cont2"
:
"
2.
选择“扫描绑定设备”"
,
"cont2"
:
"选择“扫描绑定设备”"
,
"cont3"
:
"
3.
扫描上方二维码完成绑定"
,
"cont3"
:
"扫描上方二维码完成绑定"
,
"tip"
:
"注: 二维码有效时间为10分钟,过期请重新生成"
"tip"
:
"注: 二维码有效时间为10分钟,过期请重新生成"
},
},
"unlockInfo"
:{
"unlockInfo"
:{
...
@@ -376,5 +376,11 @@
...
@@ -376,5 +376,11 @@
"step3content"
:
"操作步骤:启动本APP后打开多任务页面(清理后台应用的页面),将本APP加入白名单。"
,
"step3content"
:
"操作步骤:启动本APP后打开多任务页面(清理后台应用的页面),将本APP加入白名单。"
,
"endSetting"
:
"保存设置并开启应用"
,
"endSetting"
:
"保存设置并开启应用"
,
"toIndex"
:
"进入首页"
"toIndex"
:
"进入首页"
},
"newFeature"
:{
"newVersion"
:
"您有新的版本更新"
,
"tip"
:
"版本更新"
,
"update"
:
"更新"
,
"miss"
:
"暂不更新"
}
}
}
}
\ No newline at end of file
dev/src/lang/zh.json
View file @
e84390ee
...
@@ -115,7 +115,8 @@
...
@@ -115,7 +115,8 @@
"doorLockRinging"
:
"门铃响了"
,
"doorLockRinging"
:
"门铃响了"
,
"defaultNewMsg"
:
"您尚未绑定门锁"
,
"defaultNewMsg"
:
"您尚未绑定门锁"
,
"noNewMsg"
:
"门锁休息中"
,
"noNewMsg"
:
"门锁休息中"
,
"bindDoorlock"
:
"绑定门锁"
"bindDoorlock"
:
"绑定门锁"
,
"use"
:
"使用"
},
},
"opendoorRecord"
:{
"opendoorRecord"
:{
"noRecordTip"
:
"暂无记录"
,
"noRecordTip"
:
"暂无记录"
,
...
@@ -153,12 +154,11 @@
...
@@ -153,12 +154,11 @@
"logoutDialogTip"
:
"确定要退出系统吗?"
,
"logoutDialogTip"
:
"确定要退出系统吗?"
,
"defaultNickname"
:
"门锁"
,
"defaultNickname"
:
"门锁"
,
"isClearRecord"
:
"清除所有信息"
,
"isClearRecord"
:
"清除所有信息"
,
"unbindSuccess"
:
"解绑成功"
,
"doorbellMsgPush"
:
"门铃消息推送"
,
"doorbellMsgPush"
:
"门铃消息推送"
,
"alarmMsgPush"
:
"报警消息推送"
,
"alarmMsgPush"
:
"报警消息推送"
,
"opendoorMsgPush"
:
"开门消息推送"
,
"opendoorMsgPush"
:
"开门消息推送"
,
"unbindDialogTip"
:
"确认解除绑定"
,
"unbindDialogTip"
:
"确认解除绑定"
,
"unbindSuccess"
:
"解绑成功"
,
"unbindSuccess"
:
"
<span></span>
解绑成功"
,
"unbindFailue"
:
"解绑失败"
"unbindFailue"
:
"解绑失败"
},
},
"editName"
:{
"editName"
:{
...
@@ -184,7 +184,7 @@
...
@@ -184,7 +184,7 @@
"bindFailure"
:
"绑定失败"
,
"bindFailure"
:
"绑定失败"
,
"reBindDevice"
:
"请重新绑定"
"reBindDevice"
:
"请重新绑定"
},
},
"wifiAddHelp"
:
{
"wifiAddHelp"
:
{
"helpTitle"
:
"配置WIFI说明:"
,
"helpTitle"
:
"配置WIFI说明:"
,
"helpCont1"
:
"确认设备端进入配网模式(详情操作请见产品说明书)"
,
"helpCont1"
:
"确认设备端进入配网模式(详情操作请见产品说明书)"
,
"helpCont2"
:
"点击页面下方“开始配置Wi-Fi”按钮,进入WiFi配网页面"
,
"helpCont2"
:
"点击页面下方“开始配置Wi-Fi”按钮,进入WiFi配网页面"
,
...
...
dev/src/public/config.js
View file @
e84390ee
...
@@ -26,17 +26,17 @@ export default {
...
@@ -26,17 +26,17 @@ export default {
},
},
"model"
:
"UGEN_SECURITY_SMARTDOOR_YJ2017"
,
"model"
:
"UGEN_SECURITY_SMARTDOOR_YJ2017"
,
"GET_MSG_INTERVAL"
:
5000
,
"GET_MSG_INTERVAL"
:
5000
,
"wifi_add_timeout"
:
30
0000
,
"wifi_add_timeout"
:
15
0000
,
//门铃晃动间隔时间
//门铃晃动间隔时间
"await_time"
:
5
000
,
"await_time"
:
3
000
,
//门铃晃动次数
//门铃晃动次数
"shake_times"
:
5
,
"shake_times"
:
3
,
//门锁晃动总时间
//门锁晃动总时间
"ring_time"
:
30
000
,
"ring_time"
:
12
000
,
"remote_opendoor_timeout"
:
30000
,
"remote_opendoor_timeout"
:
30000
,
//二维码失效时间
//二维码失效时间
"qrcode_timeout"
:
600000
,
"qrcode_timeout"
:
600000
,
"remote_timeout"
:
30
0
,
"remote_timeout"
:
12
0
,
"input"
:{
"input"
:{
"maxlength"
:
16
"maxlength"
:
16
},
},
...
...
dev/src/view/addDevice/v_scanCodeAdd.js
View file @
e84390ee
...
@@ -13,13 +13,14 @@ iot.ready(init);
...
@@ -13,13 +13,14 @@ iot.ready(init);
function
init
()
{
function
init
()
{
console
.
log
(
"init"
+
new
Date
().
getTime
());
console
.
log
(
"init"
+
new
Date
().
getTime
());
//通用 dialog、loading组件
//通用 dialog、loading组件
uPublic
.
componentsInit
([
'u-dialog'
,
'u-loading'
]);
uPublic
.
componentsInit
([
'u-dialog'
,
'u-loading'
,
'u-process'
]);
// uPublic.closeSlideBack();
// uPublic.closeSlideBack();
const
app
=
new
Vue
({
const
app
=
new
Vue
({
data
:{
data
:{
//配置组件
//配置组件
componentsConfig
:
initComponentsConfig
(),
componentsConfig
:
initComponentsConfig
(),
barcode
:
null
barcode
:
null
,
noticeTipShowFlag
:
false
},
},
mounted
(){
mounted
(){
let
self
=
this
;
let
self
=
this
;
...
@@ -34,6 +35,10 @@ function init() {
...
@@ -34,6 +35,10 @@ function init() {
}
else
{
}
else
{
openScanCode
(
self
);
openScanCode
(
self
);
}
}
window
.
addEventListener
(
'returnPage'
,()
=>
{
self
.
noticeTipShowFlag
=
!
iot
.
native
.
isNotifycationOpen
();
scanCodeSuccess
(
self
);
});
},
},
methods
:{
methods
:{
//tap <
//tap <
...
@@ -56,7 +61,13 @@ function initComponentsConfig() {
...
@@ -56,7 +61,13 @@ function initComponentsConfig() {
initParam
:
{
initParam
:
{
class
:
'custom-loading'
class
:
'custom-loading'
}
}
}
},
processLoading
:
{
initParam
:
{
class
:
'custom-process'
,
status
:
0
}
}
}
}
}
}
...
@@ -82,39 +93,45 @@ function openScanCode(self){
...
@@ -82,39 +93,45 @@ function openScanCode(self){
console
.
log
(
response
);
console
.
log
(
response
);
let
data
=
uPublic
.
checkResponseData
(
response
.
data
);
let
data
=
uPublic
.
checkResponseData
(
response
.
data
);
if
(
data
){
if
(
data
){
console
.
log
(
data
.
result
.
indexOf
(
'qrKey'
));
//扫描成功
//扫描成功
let
result
=
JSON
.
parse
(
data
.
result
);
if
(
data
.
result
.
indexOf
(
'qrKey'
)
!=
-
1
){
let
qrKey
=
result
.
qrKey
;
uComponents
.
showProcess
(
self
,
0
,
Vue
.
t
(
'addDevice.loading'
));
let
lockId
=
result
.
lockId
;
let
result
=
JSON
.
parse
(
data
.
result
);
let
relId
=
result
.
relId
;
console
.
log
(
result
);
//绑定设备
console
.
log
(
result
.
hasOwnProperty
(
'qrKey'
));
iot
.
business
.
sds
.
scanqr
({
data
:
{
let
qrKey
=
result
.
qrKey
;
qrKey
:
qrKey
let
lockId
=
result
.
lockId
;
},
let
relId
=
result
.
relId
;
success
:
(
response
)
=>
{
//绑定设备
console
.
log
(
response
);
iot
.
business
.
sds
.
scanqr
({
let
data
=
uPublic
.
checkResponseData
(
response
.
data
);
data
:
{
if
(
data
){
qrKey
:
qrKey
//云端绑定
},
deviceBind
(
self
,
lockId
,
relId
);
success
:
(
response
)
=>
{
}
else
{}
console
.
log
(
response
);
},
let
data
=
uPublic
.
checkResponseData
(
response
.
data
);
error
:
(
error
)
=>
{
if
(
data
){
//绑定失败
//云端绑定
console
.
log
(
error
);
deviceBind
(
self
,
lockId
,
relId
);
// if(window.iotDebug){
}
else
{}
// iotDebug.push('end: 绑定失败'+JSON.stringify(error));
},
// }
error
:
(
error
)
=>
{
// if (window.iotDebug) {
//绑定失败
// iotDebug.upload(iot,'绑定失败');
console
.
log
(
error
);
// }
// if(window.iotDebug){
uComponents
.
openAlert
(
self
,
Vue
.
t
(
'addDevice.bindFailure'
),
{
// iotDebug.push('end: 绑定失败'+JSON.stringify(error));
text
:
Vue
.
t
(
'dialog.confirm'
),
callback
:
function
()
{
// }
}
// if (window.iotDebug) {
});
// iotDebug.upload(iot,'绑定失败');
}
// }
});
scanCodeFailue
(
self
);
}
});
}
else
{
scanCodeFailue
(
self
);
}
}
else
{}
}
else
{}
},
},
error
:
(
error
)
=>
{
error
:
(
error
)
=>
{
...
@@ -126,7 +143,7 @@ function openScanCode(self){
...
@@ -126,7 +143,7 @@ function openScanCode(self){
// if (window.iotDebug) {
// if (window.iotDebug) {
// iotDebug.upload(iot,'扫描失败');
// iotDebug.upload(iot,'扫描失败');
// }
// }
uPublic
.
openRequestErrorAlert
(
self
);
scanCodeFailue
(
self
);
}
}
});
});
}
}
...
@@ -143,17 +160,18 @@ function deviceBind(self, lockId, relId){
...
@@ -143,17 +160,18 @@ function deviceBind(self, lockId, relId){
console
.
log
(
response
);
console
.
log
(
response
);
let
data
=
response
.
data
;
let
data
=
response
.
data
;
if
(
data
.
success
){
if
(
data
.
success
){
uComponents
.
openAlert
(
self
,
Vue
.
t
(
'addDevice.bindSuccess'
),
{
scanCodeSuccess
(
self
);
text
:
Vue
.
t
(
'dialog.confirm'
),
callback
:
function
()
{
// uComponents.openAlert(self, Vue.t('addDevice.bindSuccess'), {
iot
.
navigator
.
fire
(
plus
.
webview
.
getWebviewById
(
'device'
),
'returnPage'
,{
// text: Vue.t('dialog.confirm'), callback: function () {
needClose
:
true
// iot.navigator.fire(plus.webview.getWebviewById('device'),'returnPage',{
});
// needClose: true
iot
.
navigator
.
openWindow
({
// });
url
:
'../device/index.html'
,
// iot.navigator.openWindow({
id
:
'device'
// url: '../device/index.html',
});
// id: 'device'
}
// });
});
// }
// });
}
}
},
},
error
:
(
error
)
=>
{
error
:
(
error
)
=>
{
...
@@ -172,3 +190,64 @@ function deviceBind(self, lockId, relId){
...
@@ -172,3 +190,64 @@ function deviceBind(self, lockId, relId){
complete
:
()
=>
{}
complete
:
()
=>
{}
});
});
}
}
function
scanCodeSuccess
(
self
){
self
.
noticeTipShowFlag
=
!
iot
.
native
.
isNotifycationOpen
();
if
(
self
.
noticeTipShowFlag
){
uComponents
.
showProcess
(
self
,
1
,
Vue
.
t
(
'addDevice.bindSuccess'
),
[{
"class"
:
'custom-process-button'
,
'text'
:
Vue
.
t
(
'btn.openNotify'
),
'callback'
:
()
=>
{
//开启推送通知
if
(
plus
.
os
.
name
==
'Android'
){
// alert("打开通知页面");
iot
.
navigator
.
openWindow
({
url
:
'../device/notify.html'
,
id
:
'notify'
,
styles
:
{
popGesture
:
'none'
}
});
}
else
{
iot
.
native
.
toNotifycationSetting
();
}
}
},{
"class"
:
'custom-process-button custom-process-cancelButton'
,
'text'
:
Vue
.
t
(
'btn.ignore'
),
'callback'
:
()
=>
{
//暂不开启
uComponents
.
hideProcess
(
self
);
iot
.
navigator
.
fire
(
plus
.
webview
.
getWebviewById
(
'device'
),
'returnPage'
,{
needClose
:
true
});
iot
.
navigator
.
openWindow
({
url
:
'../device/index.html'
,
id
:
'device'
});
}
}]);
}
else
{
console
.
log
(
"通知开启了"
);
uComponents
.
showProcess
(
self
,
1
,
Vue
.
t
(
'addDevice.bindSuccess'
),
[{
"class"
:
'custom-process-button'
,
'text'
:
Vue
.
t
(
'btn.startNow'
),
'callback'
:
()
=>
{
//立即体验
uComponents
.
hideProcess
(
self
);
iot
.
navigator
.
fire
(
plus
.
webview
.
getWebviewById
(
'device'
),
'returnPage'
,{
needClose
:
true
});
iot
.
navigator
.
openWindow
({
url
:
'../device/index.html'
,
id
:
'device'
});
}
}]);
}
}
function
scanCodeFailue
(
self
){
uComponents
.
showProcess
(
self
,
2
,
Vue
.
t
(
'addDevice.bindFailure'
),
[{
"class"
:
'custom-process-button'
,
'text'
:
Vue
.
t
(
'addDevice.reBindDevice'
),
'callback'
:
()
=>
{
//激活失败
uComponents
.
hideProcess
(
self
);
uComponents
.
showProcess
(
self
,
0
,
Vue
.
t
(
'addDevice.loading'
));
openScanCode
(
self
);
}
}]);
}
dev/src/view/addDevice/v_wifiAdd.js
View file @
e84390ee
...
@@ -23,11 +23,16 @@ function init() {
...
@@ -23,11 +23,16 @@ function init() {
textErrorTip
:
null
,
textErrorTip
:
null
,
//配置组件
//配置组件
componentsConfig
:
initComponentsConfig
(),
componentsConfig
:
initComponentsConfig
(),
status
:
0
,
noticeTipShowFlag
:
false
,
noticeTipShowFlag
:
false
timeout
:
null
},
},
mounted
(){
mounted
(){
resolve
(
this
);
resolve
(
this
);
let
self
=
this
;
window
.
addEventListener
(
'returnPage'
,()
=>
{
self
.
noticeTipShowFlag
=
!
iot
.
native
.
isNotifycationOpen
();
addSuccess
(
self
);
});
},
},
methods
:{
methods
:{
getTextWiFiName
(){
getTextWiFiName
(){
...
@@ -48,12 +53,6 @@ function init() {
...
@@ -48,12 +53,6 @@ function init() {
setTextErrorTip
(
tip
){
setTextErrorTip
(
tip
){
this
.
textErrorTip
=
tip
;
this
.
textErrorTip
=
tip
;
},
},
getStatus
(){
return
this
.
status
;
},
setStatus
(
status
){
this
.
status
=
status
;
},
onPasswordChange
(
text
){
onPasswordChange
(
text
){
passwordChange
(
this
,
text
);
passwordChange
(
this
,
text
);
},
},
...
@@ -154,7 +153,6 @@ function connectButtonTap(self){
...
@@ -154,7 +153,6 @@ function connectButtonTap(self){
}
else
if
(
self
.
getTextPassword
()
==
null
||
self
.
getTextPassword
().
trim
()
==
''
){
}
else
if
(
self
.
getTextPassword
()
==
null
||
self
.
getTextPassword
().
trim
()
==
''
){
self
.
setTextErrorTip
(
Vue
.
t
(
'wifiAdd.passwordInputTip'
));
self
.
setTextErrorTip
(
Vue
.
t
(
'wifiAdd.passwordInputTip'
));
}
else
{
}
else
{
// uComponents.showCommLoading(self);
uComponents
.
showProcess
(
self
,
0
,
Vue
.
t
(
'addDevice.loading'
));
uComponents
.
showProcess
(
self
,
0
,
Vue
.
t
(
'addDevice.loading'
));
iot
.
business
.
sds
.
findWifi
({
iot
.
business
.
sds
.
findWifi
({
data
:
{
data
:
{
...
@@ -180,7 +178,6 @@ function connectButtonTap(self){
...
@@ -180,7 +178,6 @@ function connectButtonTap(self){
if
(
window
.
iotDebug
)
{
if
(
window
.
iotDebug
)
{
iotDebug
.
upload
(
iot
,
'配网中'
);
iotDebug
.
upload
(
iot
,
'配网中'
);
}
}
// uComponents.changeCommLoadingStatusAndText(self, 0, Vue.t('wifiAdd.wifiBinding'));
uComponents
.
showProcess
(
self
,
0
,
Vue
.
t
(
'wifiAdd.wifiBinding'
));
uComponents
.
showProcess
(
self
,
0
,
Vue
.
t
(
'wifiAdd.wifiBinding'
));
}
else
if
(
response
.
data
==
'provisioned success'
){
}
else
if
(
response
.
data
==
'provisioned success'
){
if
(
window
.
iotDebug
){
if
(
window
.
iotDebug
){
...
@@ -190,7 +187,6 @@ function connectButtonTap(self){
...
@@ -190,7 +187,6 @@ function connectButtonTap(self){
iotDebug
.
upload
(
iot
,
'配网成功'
);
iotDebug
.
upload
(
iot
,
'配网成功'
);
}
}
//wifi连接成功,停止连接wifi
//wifi连接成功,停止连接wifi
// uComponents.changeCommLoadingStatusAndText(self, 0, Vue.t('wifiAdd.wifiBindSuccess'));
uComponents
.
showProcess
(
self
,
0
,
Vue
.
t
(
'wifiAdd.wifiBindSuccess'
));
uComponents
.
showProcess
(
self
,
0
,
Vue
.
t
(
'wifiAdd.wifiBindSuccess'
));
}
}
},
},
...
@@ -222,7 +218,6 @@ function connectButtonTap(self){
...
@@ -222,7 +218,6 @@ function connectButtonTap(self){
if
(
window
.
iotDebug
)
{
if
(
window
.
iotDebug
)
{
iotDebug
.
upload
(
iot
,
'激活中'
);
iotDebug
.
upload
(
iot
,
'激活中'
);
}
}
// uComponents.changeCommLoadingStatusAndText(self, 0, Vue.t('wifiAdd.deviceActivating'));
uComponents
.
showProcess
(
self
,
0
,
Vue
.
t
(
'wifiAdd.deviceActivating'
));
uComponents
.
showProcess
(
self
,
0
,
Vue
.
t
(
'wifiAdd.deviceActivating'
));
}
else
if
(
response
.
data
==
"joined success"
){
}
else
if
(
response
.
data
==
"joined success"
){
if
(
window
.
iotDebug
){
if
(
window
.
iotDebug
){
...
@@ -241,10 +236,7 @@ function connectButtonTap(self){
...
@@ -241,10 +236,7 @@ function connectButtonTap(self){
if
(
window
.
iotDebug
)
{
if
(
window
.
iotDebug
)
{
iotDebug
.
upload
(
iot
,
'激活失败'
);
iotDebug
.
upload
(
iot
,
'激活失败'
);
}
}
// uComponents.changeCommLoadingStatusAndText(self, 2, Vue.t('wifiAdd.deviceActivateFailure'));
addFailue
(
self
);
addFailue
(
self
);
self
.
setStatus
(
2
);
// uComponents.changeCommButtonText(self, Vue.t('addDevice.reBindDevice'));
//停止查找设备
//停止查找设备
iot
.
business
.
sds
.
stopFindDevices
({
iot
.
business
.
sds
.
stopFindDevices
({
success
:
(
response
)
=>
{},
success
:
(
response
)
=>
{},
...
@@ -264,20 +256,14 @@ function connectButtonTap(self){
...
@@ -264,20 +256,14 @@ function connectButtonTap(self){
}
}
});
});
}
}
setTimeout
(
function
(){
self
.
timeout
=
setTimeout
(
function
(){
if
(
self
.
getStatus
()
==
0
){
console
.
log
(
"timeout"
);
console
.
log
(
"timeout"
);
window
.
clearTimeout
(
self
.
timeout
);
//连接失败
addFailue
(
self
);
// uComponents.changeCommLoadingStatusAndText(self, 2, Vue.t('wifiAdd.bindTimeout'));
iot
.
business
.
sds
.
stopFindDevices
({
self
.
setStatus
(
2
);
success
:
(
response
)
=>
{},
// uComponents.changeCommButtonText(self, Vue.t('addDevice.reBindDevice'));
error
:
(
error
)
=>
{}
addFailue
(
self
);
});
//停止查找设备
iot
.
business
.
sds
.
stopFindDevices
({
success
:
(
response
)
=>
{},
error
:
(
error
)
=>
{}
});
}
},
config
.
wifi_add_timeout
);
},
config
.
wifi_add_timeout
);
}
}
...
@@ -306,10 +292,7 @@ function unbind(self, deviceId, productId){
...
@@ -306,10 +292,7 @@ function unbind(self, deviceId, productId){
if
(
window
.
iotDebug
)
{
if
(
window
.
iotDebug
)
{
iotDebug
.
upload
(
iot
,
'解绑失败'
);
iotDebug
.
upload
(
iot
,
'解绑失败'
);
}
}
// uComponents.changeCommLoadingStatusAndText(self, 2, Vue.t('wifiAdd.deviceActivateFailure'));
// uComponents.changeCommButtonText(self, Vue.t('addDevice.reBindDevice'));
addFailue
(
self
);
addFailue
(
self
);
self
.
setStatus
(
2
);
},
},
complete
:
()
=>
{
complete
:
()
=>
{
}
}
...
@@ -329,9 +312,6 @@ function bind(self, deviceId, productId){
...
@@ -329,9 +312,6 @@ function bind(self, deviceId, productId){
console
.
log
(
response
);
console
.
log
(
response
);
let
data
=
response
.
data
;
let
data
=
response
.
data
;
if
(
data
.
success
){
if
(
data
.
success
){
// uComponents.changeCommLoadingStatusAndText(self, 1, Vue.t('wifiAdd.deviceActivateSuccess'));
// uComponents.changeCommButtonText(self, Vue.t('btn.confirm'));
self
.
setStatus
(
1
);
addSuccess
(
self
);
addSuccess
(
self
);
}
}
if
(
window
.
iotDebug
){
if
(
window
.
iotDebug
){
...
@@ -349,10 +329,7 @@ function bind(self, deviceId, productId){
...
@@ -349,10 +329,7 @@ function bind(self, deviceId, productId){
if
(
window
.
iotDebug
)
{
if
(
window
.
iotDebug
)
{
iotDebug
.
upload
(
iot
,
'绑定失败'
);
iotDebug
.
upload
(
iot
,
'绑定失败'
);
}
}
// uComponents.changeCommLoadingStatusAndText(self, 2, Vue.t('wifiAdd.deviceActivateFailure'));
// uComponents.changeCommButtonText(self, Vue.t('addDevice.reBindDevice'));、
addFailue
(
self
);
addFailue
(
self
);
self
.
setStatus
(
2
);
},
},
complete
:
()
=>
{}
complete
:
()
=>
{}
});
});
...
@@ -363,15 +340,13 @@ function addFailue(self){
...
@@ -363,15 +340,13 @@ function addFailue(self){
"class"
:
'custom-process-button'
,
'text'
:
Vue
.
t
(
'addDevice.reBindDevice'
),
'callback'
:
()
=>
{
"class"
:
'custom-process-button'
,
'text'
:
Vue
.
t
(
'addDevice.reBindDevice'
),
'callback'
:
()
=>
{
//激活失败
//激活失败
uComponents
.
hideProcess
(
self
);
uComponents
.
hideProcess
(
self
);
self
.
setStatus
(
0
);
uComponents
.
changeCommLoadingStatusAndText
(
self
,
0
,
Vue
.
t
(
'addDevice.loading'
));
}
}
}]);
}]);
}
}
function
addSuccess
(
self
){
function
addSuccess
(
self
){
if
(
!
iot
.
native
.
isNotifycationOpen
()){
self
.
noticeTipShowFlag
=
!
iot
.
native
.
isNotifycationOpen
();
self
.
noticeTipShowFlag
=
true
;
if
(
self
.
noticeTipShowFlag
){
uComponents
.
showProcess
(
self
,
1
,
Vue
.
t
(
'wifiAdd.deviceActivateSuccess'
),
[{
uComponents
.
showProcess
(
self
,
1
,
Vue
.
t
(
'wifiAdd.deviceActivateSuccess'
),
[{
"class"
:
'custom-process-button'
,
'text'
:
Vue
.
t
(
'btn.openNotify'
),
'callback'
:
()
=>
{
"class"
:
'custom-process-button'
,
'text'
:
Vue
.
t
(
'btn.openNotify'
),
'callback'
:
()
=>
{
//开启推送通知
//开启推送通知
...
@@ -416,24 +391,4 @@ function addSuccess(self){
...
@@ -416,24 +391,4 @@ function addSuccess(self){
}
}
}]);
}]);
}
}
}
}
\ No newline at end of file
//tap loading button
//function commLoadingButtonTap(self) {
// if(self.getStatus() == 1){
// //绑定成功
// uComponents.hideCommLoading(self);
// iot.navigator.fire(plus.webview.getWebviewById('device'),'returnPage',{
// needClose: true
// });
// iot.navigator.openWindow({
// url: '../device/index.html',
// id: 'device'
// });
// }else if(self.getStatus() == 2){
// //绑定失败
// uComponents.hideCommLoading(self);
// self.setStatus(0);
// uComponents.changeCommLoadingStatusAndText(self, 0, Vue.t('addDevice.loading'));
// }
//}
\ No newline at end of file
dev/src/view/device/v_alarmInfo.js
View file @
e84390ee
...
@@ -30,6 +30,9 @@ function init() {
...
@@ -30,6 +30,9 @@ function init() {
uComponents
.
showLoading
(
this
);
uComponents
.
showLoading
(
this
);
this
.
noticeTipShowFlag
=
!
iot
.
native
.
isNotifycationOpen
();
this
.
noticeTipShowFlag
=
!
iot
.
native
.
isNotifycationOpen
();
resolve
(
this
);
resolve
(
this
);
window
.
addEventListener
(
'returnPage'
,()
=>
{
this
.
noticeTipShowFlag
=
!
iot
.
native
.
isNotifycationOpen
();
});
},
},
methods
:{
methods
:{
getList
(){
getList
(){
...
...
dev/src/view/device/v_hijackRecord.js
View file @
e84390ee
...
@@ -32,6 +32,9 @@ function init() {
...
@@ -32,6 +32,9 @@ function init() {
uComponents
.
showLoading
(
this
);
uComponents
.
showLoading
(
this
);
this
.
noticeTipShowFlag
=
!
iot
.
native
.
isNotifycationOpen
();
this
.
noticeTipShowFlag
=
!
iot
.
native
.
isNotifycationOpen
();
resolve
(
this
);
resolve
(
this
);
window
.
addEventListener
(
'returnPage'
,()
=>
{
this
.
noticeTipShowFlag
=
!
iot
.
native
.
isNotifycationOpen
();
});
},
},
methods
:{
methods
:{
getList
(){
getList
(){
...
...
dev/src/view/device/v_index.js
View file @
e84390ee
...
@@ -548,30 +548,34 @@ function getLockInfoSuccess(self, data){
...
@@ -548,30 +548,34 @@ function getLockInfoSuccess(self, data){
let
historyRecord
=
data
.
info
.
history
;
let
historyRecord
=
data
.
info
.
history
;
updateHistoryMap
(
self
,
historyRecord
);
updateHistoryMap
(
self
,
historyRecord
);
//拼接首页滚动的三条记录
//拼接首页滚动的三条记录
let
record
=
data
.
info
.
history
.
open
;
getTreenRecord
(
self
,
data
.
info
.
history
.
open
)
;
if
(
record
&&
record
.
length
)
{
}
else
{
self
.
newMsg
=
[]
;
uComponents
.
changeMarqueeText
(
self
,
[
Vue
.
t
(
'device.defaultNewMsg'
)])
;
for
(
let
i
=
0
;
i
<
record
.
length
;
i
++
){
self
.
activeFlag
=
false
;
let
msg
=
''
;
}
if
(
record
[
i
].
nickname
==
null
){
}
msg
=
' ID:'
+
record
[
i
].
openId
;
}
else
{
//拼接首页滚动的三条记录
msg
=
record
[
i
].
nickname
;
function
getTreenRecord
(
self
,
record
){
}
if
(
record
&&
record
.
length
){
self
.
newMsg
.
push
(
moment
(
record
[
i
].
time
).
format
(
"YY.MM.DD HH:mm"
)
+
msg
+
Vue
.
t
(
'opendoorRecord.'
+
config
.
openDoorMode
[
record
[
i
].
mode
]
+
''
))
;
self
.
newMsg
=
[]
;
}
for
(
let
i
=
0
;
i
<
record
.
length
;
i
++
){
uComponents
.
changeMarqueeText
(
self
,
self
.
newMsg
)
;
let
msg
=
''
;
if
(
self
.
newMsg
.
length
>=
2
){
if
(
record
[
i
].
nickname
==
null
){
self
.
activeFlag
=
true
;
msg
=
' ID:'
+
record
[
i
].
openId
;
}
else
{
}
else
{
self
.
activeFlag
=
fals
e
;
msg
=
record
[
i
].
nicknam
e
;
}
}
self
.
newMsg
.
push
(
moment
(
record
[
i
].
time
).
format
(
"YY.MM.DD HH:mm"
)
+
' '
+
msg
+
Vue
.
t
(
'device.use'
)
+
Vue
.
t
(
'opendoorRecord.'
+
config
.
openDoorMode
[
record
[
i
].
mode
]
+
''
));
}
uComponents
.
changeMarqueeText
(
self
,
self
.
newMsg
);
if
(
self
.
newMsg
.
length
>=
2
){
self
.
activeFlag
=
true
;
}
else
{
}
else
{
uComponents
.
changeMarqueeText
(
self
,
[
Vue
.
t
(
'device.noNewMsg'
)]);
self
.
activeFlag
=
false
;
self
.
activeFlag
=
false
;
}
}
}
else
{
}
else
{
uComponents
.
changeMarqueeText
(
self
,
[
Vue
.
t
(
'device.
default
NewMsg'
)]);
uComponents
.
changeMarqueeText
(
self
,
[
Vue
.
t
(
'device.
no
NewMsg'
)]);
self
.
activeFlag
=
false
;
self
.
activeFlag
=
false
;
}
}
}
}
...
@@ -633,6 +637,28 @@ async function updateHistoryMap(self, historyRecord){
...
@@ -633,6 +637,28 @@ async function updateHistoryMap(self, historyRecord){
if
(
openHistory
.
length
&&
oldHistory
.
open
.
time
<
moment
(
openHistory
[
0
].
time
).
unix
()
&&
now
-
moment
(
openHistory
[
0
].
time
).
unix
()
<
3600
){
if
(
openHistory
.
length
&&
oldHistory
.
open
.
time
<
moment
(
openHistory
[
0
].
time
).
unix
()
&&
now
-
moment
(
openHistory
[
0
].
time
).
unix
()
<
3600
){
newHistory
.
open
.
time
=
moment
(
openHistory
[
0
].
time
).
unix
();
newHistory
.
open
.
time
=
moment
(
openHistory
[
0
].
time
).
unix
();
newHistory
.
open
.
isReadFlag
=
false
;
newHistory
.
open
.
isReadFlag
=
false
;
let
record
=
openHistory
;
if
(
record
&&
record
.
length
){
for
(
let
i
=
0
;
i
<
record
.
length
;
i
++
){
let
msg
=
''
;
if
(
record
[
i
].
nickname
==
null
){
msg
=
' ID:'
+
record
[
i
].
openId
;
}
else
{
msg
=
record
[
i
].
nickname
;
}
self
.
newMsg
.
shift
();
self
.
newMsg
.
push
(
moment
(
record
[
i
].
time
).
format
(
"YY.MM.DD HH:mm"
)
+
' '
+
msg
+
Vue
.
t
(
'device.use'
)
+
Vue
.
t
(
'opendoorRecord.'
+
config
.
openDoorMode
[
record
[
i
].
mode
]
+
''
));
}
uComponents
.
changeMarqueeText
(
self
,
self
.
newMsg
);
if
(
self
.
newMsg
.
length
>=
2
){
self
.
activeFlag
=
true
;
}
else
{
self
.
activeFlag
=
false
;
}
}
else
{
uComponents
.
changeMarqueeText
(
self
,
[
Vue
.
t
(
'device.noNewMsg'
)]);
self
.
activeFlag
=
false
;
}
}
}
let
historyType
=
[
'alarm'
,
'notify'
];
let
historyType
=
[
'alarm'
,
'notify'
];
...
@@ -912,15 +938,15 @@ function simpleRingBell(self,i){
...
@@ -912,15 +938,15 @@ function simpleRingBell(self,i){
self
.
timeout
=
setTimeout
(
function
(){
self
.
timeout
=
setTimeout
(
function
(){
self
.
setDoorbellRingingFlag
(
false
);
self
.
setDoorbellRingingFlag
(
false
);
window
.
clearTimeout
(
self
.
timeout
);
window
.
clearTimeout
(
self
.
timeout
);
if
(
i
>
2
){
if
(
i
>
=
1
){
window
.
clearInterval
(
self
.
time
);
window
.
clearInterval
(
self
.
time
);
}
}
},
config
.
await_time
*
3
/
5
);
},
config
.
await_time
*
3
/
5
);
if
(
i
>
2
){
if
(
i
>
=
1
){
window
.
clearInterval
(
self
.
time
);
window
.
clearInterval
(
self
.
time
);
}
}
},
config
.
await_time
*
2
/
5
);
},
config
.
await_time
*
2
/
5
);
if
(
i
>
2
){
if
(
i
>
=
1
){
window
.
clearInterval
(
self
.
time
);
window
.
clearInterval
(
self
.
time
);
}
}
}
}
...
...
dev/src/view/device/v_notify.js
View file @
e84390ee
...
@@ -83,8 +83,12 @@ function init() {
...
@@ -83,8 +83,12 @@ function init() {
}
}
}
}
//重写mui.back
mui
.
back
=
function
(){
iot
.
navigator
.
fire
(
plus
.
webview
.
currentWebview
().
opener
(),
'returnPage'
,{});
console
.
log
(
"fire"
);
iot
.
navigator
.
back
();
}
dev/src/view/device/v_opendoorRecord.js
View file @
e84390ee
...
@@ -31,6 +31,9 @@ function init() {
...
@@ -31,6 +31,9 @@ function init() {
uComponents
.
showLoading
(
this
);
uComponents
.
showLoading
(
this
);
this
.
noticeTipShowFlag
=
!
iot
.
native
.
isNotifycationOpen
();
this
.
noticeTipShowFlag
=
!
iot
.
native
.
isNotifycationOpen
();
resolve
(
this
);
resolve
(
this
);
window
.
addEventListener
(
'returnPage'
,()
=>
{
this
.
noticeTipShowFlag
=
!
iot
.
native
.
isNotifycationOpen
();
});
},
},
methods
:{
methods
:{
getList
(){
getList
(){
...
...
dev/src/view/doorlockManage/v_index.js
View file @
e84390ee
...
@@ -43,6 +43,14 @@ function init() {
...
@@ -43,6 +43,14 @@ function init() {
unbindShowDialog
:
false
unbindShowDialog
:
false
},
},
mounted
(){
mounted
(){
// uComponents.openAlert(this, Vue.t('doorlockManage.unbindSuccess'), {
// text: Vue.t('dialog.confirm'), callback: function () {
// iot.navigator.openWindow({
// url: '../device/index.html',
// id: 'device'
// });
// }
// });
this
.
extras
=
iot
.
navigator
.
getExtras
();
this
.
extras
=
iot
.
navigator
.
getExtras
();
console
.
log
(
this
.
extras
);
console
.
log
(
this
.
extras
);
this
.
role
=
this
.
extras
.
lockInfo
.
role
;
this
.
role
=
this
.
extras
.
lockInfo
.
role
;
...
@@ -55,6 +63,7 @@ function init() {
...
@@ -55,6 +63,7 @@ function init() {
getDoorlockInfo
(
self
);
getDoorlockInfo
(
self
);
});
});
},
},
methods
:{
methods
:{
getStateShowFlag
(){
getStateShowFlag
(){
...
@@ -289,9 +298,17 @@ function unbind(self){
...
@@ -289,9 +298,17 @@ function unbind(self){
console
.
log
(
error
);
console
.
log
(
error
);
uPublic
.
openRequestErrorAlert
(
self
);
uPublic
.
openRequestErrorAlert
(
self
);
});
});
self
.
setStateShowFlag
(
true
);
// self.setStateShowFlag(true);
self
.
setShowMsg
(
Vue
.
t
(
'doorlockManage.unbindSuccess'
));
// self.setShowMsg(Vue.t('doorlockManage.unbindSuccess'));
self
.
setUnbindSucceess
(
true
);
// self.setUnbindSucceess(true);
uComponents
.
openAlert
(
self
,
Vue
.
t
(
'doorlockManage.unbindSuccess'
),
{
text
:
Vue
.
t
(
'dialog.confirm'
),
callback
:
function
()
{
iot
.
navigator
.
openWindow
({
url
:
'../device/index.html'
,
id
:
'device'
});
}
});
iot
.
navigator
.
fire
(
plus
.
webview
.
currentWebview
().
opener
(),
'returnPage'
,{});
iot
.
navigator
.
fire
(
plus
.
webview
.
currentWebview
().
opener
(),
'returnPage'
,{});
},
},
error
:
(
error
)
=>
{
error
:
(
error
)
=>
{
...
@@ -372,11 +389,12 @@ function cancelTap(self){
...
@@ -372,11 +389,12 @@ function cancelTap(self){
//tap 绑定成功弹框提示-->回到首页
//tap 绑定成功弹框提示-->回到首页
function
unbindStateDialogTap
(
self
){
function
unbindStateDialogTap
(
self
){
self
.
setStateShowFlag
(
false
);
// self.setStateShowFlag(false);
if
(
self
.
getUnbindSucceess
){
// if(self.getUnbindSucceess){
iot
.
navigator
.
openWindow
({
// iot.navigator.openWindow({
url
:
'../device/index.html'
,
// url: '../device/index.html',
id
:
'device'
// id: 'device'
});
// });
}
// }
}
}
web/lib/less/doorlockManage/doorlockManage.less
View file @
e84390ee
...
@@ -288,3 +288,12 @@
...
@@ -288,3 +288,12 @@
.unbindState-dialog();
.unbindState-dialog();
.custom-dialog{
.u-dialog-box{
.u-dialog-content{
span{
.bgImgSize(51px,51px,"green_unbindSuccess_icon.png",center,cover);
}
}
}
}
web/resources/lang/zh.json
View file @
e84390ee
This diff is collapsed.
Click to expand it.
web/view/addDevice/scanCodeAdd.html
View file @
e84390ee
...
@@ -27,6 +27,14 @@
...
@@ -27,6 +27,14 @@
</div>
</div>
<div
class=
"scanContent"
id=
"bcid"
>
<div
class=
"scanContent"
id=
"bcid"
>
</div>
</div>
<u-process
ref=
"uprocess"
:init-param=
"componentsConfig.processLoading.initParam"
>
<p
class=
"loader"
></p>
<p
class=
"icon"
></p>
<p
class=
"noticeContent"
v-show =
"noticeTipShowFlag"
>
<span>

</span>
<span
v-html=
"$t('wifiAdd.noticeTip')"
></span>
</p>
</u-process>
<u-dialog
ref=
"udialog"
:init-param=
"componentsConfig.dialog.initParam"
></u-dialog>
<u-dialog
ref=
"udialog"
:init-param=
"componentsConfig.dialog.initParam"
></u-dialog>
<u-loading
ref=
"uloading"
:init-param=
"componentsConfig.loading.initParam"
></u-loading>
<u-loading
ref=
"uloading"
:init-param=
"componentsConfig.loading.initParam"
></u-loading>
</div>
</div>
...
...
web/view/doorlockManage/doorlockManage.css
View file @
e84390ee
...
@@ -379,6 +379,14 @@ p {
...
@@ -379,6 +379,14 @@ p {
display
:
none
;
display
:
none
;
}
}
.u-dialog-box
.u-dialog-content
span
{
width
:
1.36rem
;
height
:
1.36rem
;
background
:
url("../../resources/image/green_unbindSuccess_icon.png")
no-repeat
center
;
-webkit-background-size
:
cover
;
background-size
:
cover
;
}
.header
{
.header
{
position
:
fixed
;
position
:
fixed
;
top
:
0
;
top
:
0
;
...
@@ -1060,4 +1068,12 @@ p {
...
@@ -1060,4 +1068,12 @@ p {
width
:
1.733rem
;
width
:
1.733rem
;
height
:
1.733rem
;
height
:
1.733rem
;
margin-bottom
:
0.373rem
;
margin-bottom
:
0.373rem
;
}
.custom-dialog
.u-dialog-box
.u-dialog-content
span
{
width
:
1.36rem
;
height
:
1.36rem
;
background
:
url("../../resources/image/green_unbindSuccess_icon.png")
no-repeat
center
;
-webkit-background-size
:
cover
;
background-size
:
cover
;
}
}
\ No newline at end of file
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