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
39e8e8fc
Commit
39e8e8fc
authored
Jan 25, 2018
by
wjd
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'jianxiang' into 'debug'
Jianxiang See merge request iot-project-js/doorlock!24
parents
d3e0c0fb
df8e14b1
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
399 additions
and
242 deletions
+399
-242
dev/src/lang/en.json
+4
-1
dev/src/lang/zh.json
+4
-1
dev/src/public/config.js
+2
-1
dev/src/public/public.js
+49
-0
dev/src/view/addDevice/v_wifiAdd.js
+73
-29
dev/src/view/device/v_index.js
+12
-0
dev/src/view/doorlockManage/v_editName.js
+4
-0
dev/src/view/doorlockUsers/v_addUser.js
+4
-0
dev/src/view/doorlockUsers/v_doorlockUser.js
+92
-81
dev/src/view/doorlockUsers/v_editName.js
+5
-0
dev/src/view/doorlockUsers/v_index.js
+1
-1
dev/src/view/login/v_index.js
+26
-8
dev/src/view/myInfo/v_editNickname.js
+4
-0
web/lib/less/doorlockUsers/doorlockUser.less
+50
-46
web/view/doorlockUsers/doorlockUser.css
+59
-63
web/view/doorlockUsers/doorlockUser.html
+10
-11
No files found.
dev/src/lang/en.json
View file @
39e8e8fc
...
...
@@ -75,6 +75,7 @@
"register"
:
"快速注册"
,
"forgetPassword"
:
"忘记密码"
,
"failure"
:
"登陆失败"
,
"defaultUser"
:
"用户{0}"
,
"error"
:
{
"telNull"
:
"请输入手机号"
,
"passWordNull"
:
"请输入密码"
...
...
@@ -255,6 +256,7 @@
"name"
:
"昵称:"
,
"inviteBind"
:
"邀请绑定"
,
"bindUnlockInfo"
:
"关联开锁信息"
,
"editUsername"
:
"编辑用户昵称"
,
"opendoorRecord"
:
"历史开门记录"
,
"unbindDialogTip"
:
"<span></span>解绑后,该用户不能对门锁下的信息进行查看"
,
"deleteUserDialogTip"
:
"删除后,用户对应的开锁id取消关联,同时失去信息查看权限。"
,
...
...
@@ -332,7 +334,8 @@
"logoutDialogTip"
:
"确定要退出系统吗?"
},
"editNickname"
:
{
"nickNameInputTip"
:
"请输入昵称"
"nickNameInputTip"
:
"请输入昵称"
,
"nickNameTypeTip"
:
"请输入中文、字母和数字"
},
"editPassword"
:
{
"newPasswordInputTip"
:
"请输入新密码"
,
...
...
dev/src/lang/zh.json
View file @
39e8e8fc
...
...
@@ -75,6 +75,7 @@
"register"
:
"快速注册"
,
"forgetPassword"
:
"忘记密码"
,
"failure"
:
"登陆失败"
,
"defaultUser"
:
"用户{0}"
,
"error"
:
{
"telNull"
:
"请输入手机号"
,
"passWordNull"
:
"请输入密码"
...
...
@@ -255,6 +256,7 @@
"name"
:
"昵称:"
,
"inviteBind"
:
"邀请绑定"
,
"bindUnlockInfo"
:
"关联开锁信息"
,
"editUsername"
:
"编辑用户昵称"
,
"opendoorRecord"
:
"历史开门记录"
,
"unbindDialogTip"
:
"<span></span>解绑后,该用户不能对门锁下的信息进行查看"
,
"deleteUserDialogTip"
:
"删除后,用户对应的开锁id取消关联,同时失去信息查看权限。"
,
...
...
@@ -332,7 +334,8 @@
"logoutDialogTip"
:
"确定要退出系统吗?"
},
"editNickname"
:
{
"nickNameInputTip"
:
"请输入昵称"
"nickNameInputTip"
:
"请输入昵称"
,
"nickNameTypeTip"
:
"请输入中文、字母和数字"
},
"editPassword"
:
{
"newPasswordInputTip"
:
"请输入新密码"
,
...
...
dev/src/public/config.js
View file @
39e8e8fc
...
...
@@ -49,6 +49,6 @@ export default {
"ringBell_timeout"
:
300
,
"intervalTime"
:
3
,
"getHistoryTime"
:
10
,
"audioUrl"
:
"../../resources/audio/tipSound.mp3"
"audioUrl"
:
"../../resources/audio/tipSound.mp3"
,
// "audioUrl": "_www/resources/audio/tipSound.mp3"
}
\ No newline at end of file
dev/src/public/public.js
View file @
39e8e8fc
...
...
@@ -91,6 +91,55 @@ uPublic.checkResponseData = function (data) {
}
};
// 检查输入文字是否含有特殊字符
uPublic
.
checkString
=
function
(
text
){
var
pattern
=
new
RegExp
(
"[~!@#$%^&*()_+=|
\
?/{}<>:;'`]+"
);
if
(
!
pattern
.
test
(
text
)){
return
false
}
else
{
return
true
;
}
}
uPublic
.
getCompleteDeviceInfo
=
function
iOSbindToUgen
(
vmobj
,
inCompleteInfo
){
let
target
=
inCompleteInfo
.
model
;
let
nickname
=
target
;
let
product_id
=
target
;
let
deviceInfo
=
null
console
.
log
(
"调用SDS云获取设备列表,getSDSDevice....."
);
iot
.
business
.
device
.
getList
({
data
:
{
sds
:
true
},
success
:
(
response
)
=>
{
console
.
log
(
"sds云返回设备数据。。。↓↓"
);
console
.
log
(
response
);
response
.
data
.
map
((
item
,
index
)
=>
{
console
.
log
(
"展示sds设备..."
);
console
.
log
(
item
);
if
(
item
.
sn
==
inCompleteInfo
.
sn
)
{
console
.
log
(
"匹配到了sn一致..."
);
deviceInfo
=
{
mac
:
item
.
sn
,
device_id
:
item
.
uuid
,
nickname
:
nickname
,
product_id
:
product_id
};
}
})
},
error
:
(
err
)
=>
{
console
.
log
(
err
);
return
false
;
},
complete
:
()
=>
{
}
});
return
deviceInfo
;
}
uPublic
.
openWindow
=
function
(
params
){
console
.
log
(
"innnnn"
);
var
wv
=
plus
.
webview
.
create
(
params
.
url
,
params
.
id
,
{
styles
:
params
.
styles
||
{}
},
{
IOTData
:
params
.
extras
});
...
...
dev/src/view/addDevice/v_wifiAdd.js
View file @
39e8e8fc
...
...
@@ -159,10 +159,6 @@ function connectButtonTap(self){
if
((
self
.
countDownText
<=
0
)
&&
(
self
.
wifiAddSuccess
==
false
)){
window
.
clearInterval
(
countDown
);
addFailue
(
self
);
// iot.business.sds.stopFindWIFI({
// success: (response) => {},
// error: (error) => {}
// });
iot
.
business
.
sds
.
stopFindDevices
({
success
:
(
response
)
=>
{},
error
:
(
error
)
=>
{}
...
...
@@ -219,7 +215,8 @@ function connectButtonTap(self){
if
(
window
.
iotDebug
)
{
iotDebug
.
upload
(
iot
,
'配网失败'
);
}
uPublic
.
openRequestErrorAlert
(
self
);
self
.
wifiAddSuccess
=
true
;
addFailue
(
self
);
}
});
iot
.
business
.
sds
.
findDevices
({
...
...
@@ -232,7 +229,6 @@ function connectButtonTap(self){
if
(
window
.
iotDebug
)
{
iotDebug
.
upload
(
iot
,
'找设备'
);
}
let
productId
=
defaultConfig
.
model
;
if
(
response
.
data
==
"onJoining"
){
if
(
window
.
iotDebug
){
iotDebug
.
push
(
'end: 激活中'
+
JSON
.
stringify
(
response
));
...
...
@@ -265,28 +261,7 @@ function connectButtonTap(self){
if
(
window
.
iotDebug
)
{
iotDebug
.
upload
(
iot
,
'激活成功'
);
}
let
deviceId
=
response
.
info
.
sn
;
// unbind(self, deviceId, productId);
bind
(
self
,
deviceId
,
productId
);
iot
.
business
.
sds
.
setDeviceStatus
({
data
:
{
uuid
:
response
.
info
.
uuid
,
setParams
:
{
'action'
:
{
'value'
:
'regiserSuccess'
}
}
},
success
:
(
response
)
=>
{
//激活成功
console
.
log
(
response
);
},
error
:
(
error
)
=>
{
console
.
log
(
error
);
uPublic
.
openRequestErrorAlert
(
self
);
},
complete
(){}
});
joinedSuccess
(
self
,
response
);
}
else
if
(
response
.
data
==
"fail"
){
//连接失败
if
(
window
.
iotDebug
){
...
...
@@ -311,7 +286,8 @@ function connectButtonTap(self){
if
(
window
.
iotDebug
)
{
iotDebug
.
upload
(
iot
);
}
uPublic
.
openRequestErrorAlert
(
self
);
self
.
activeSuccess
=
true
;
addFailue
(
self
);
}
});
}
...
...
@@ -326,6 +302,73 @@ function connectButtonTap(self){
// },config.wifi_add_timeout);
}
function
joinedSuccess
(
self
,
response
){
let
deviceId
=
response
.
info
.
sn
;
let
uuid
=
null
;
let
productId
=
defaultConfig
.
model
;
if
(
response
.
info
.
uuid
){
uuid
=
response
.
info
.
uuid
;
sendDeviceStatus
(
self
,
deviceId
,
productId
,
uuid
);
}
else
{
let
target
=
response
.
info
.
model
;
let
nickname
=
target
;
let
product_id
=
target
;
iot
.
business
.
device
.
getList
({
data
:
{
sds
:
true
},
success
:
(
response
)
=>
{
console
.
log
(
"sds云返回设备数据。。。↓↓"
);
console
.
log
(
response
);
response
.
data
.
map
((
item
,
index
)
=>
{
console
.
log
(
"展示sds设备..."
);
console
.
log
(
item
);
if
(
item
.
sn
==
deviceId
)
{
console
.
log
(
"匹配到了sn一致..."
);
let
deviceInfo
=
{
mac
:
item
.
sn
,
device_id
:
item
.
uuid
,
nickname
:
nickname
,
product_id
:
product_id
};
uuid
=
deviceInfo
.
device_id
;
sendDeviceStatus
(
self
,
deviceId
,
productId
,
uuid
);
}
});
},
error
:
(
error
)
=>
{
console
.
log
(
error
);
},
complete
:
()
=>
{}
});
}
}
function
sendDeviceStatus
(
self
,
deviceId
,
productId
,
uuid
){
iot
.
business
.
sds
.
setDeviceStatus
({
data
:
{
uuid
:
uuid
,
setParams
:
{
'action'
:
{
'value'
:
'registerSuccess'
}
}
},
success
:
(
response
)
=>
{
//激活成功
bind
(
self
,
deviceId
,
productId
);
console
.
log
(
response
);
},
error
:
(
error
)
=>
{
console
.
log
(
error
);
uPublic
.
openRequestErrorAlert
(
self
);
self
.
activeSuccess
=
true
;
uComponents
.
hideProcess
(
self
);
},
complete
(){}
});
}
//云端绑定之前先解绑
function
unbind
(
self
,
deviceId
,
productId
){
console
.
log
(
deviceId
);
...
...
@@ -389,6 +432,7 @@ function bind(self, deviceId, productId){
if
(
window
.
iotDebug
)
{
iotDebug
.
upload
(
iot
,
'绑定失败'
);
}
self
.
activeSuccess
=
true
;
addFailue
(
self
);
},
complete
:
()
=>
{}
...
...
dev/src/view/device/v_index.js
View file @
39e8e8fc
...
...
@@ -479,6 +479,7 @@ function getDevices(self){
iotDebug
.
upload
(
iot
,
'获取设备信息'
);
}
uPublic
.
openRequestErrorAlert
(
self
);
uComponents
.
hideLoading
(
self
);
},
complete
:
()
=>
{}
});
...
...
@@ -863,6 +864,15 @@ async function sdsDataPorcessing(self, data){
//远程开门失败
setRemoteOpenDoorLoading
(
self
,
2
,
Vue
.
t
(
'remoteOpendoor.openDoorFailure'
),
Vue
.
t
(
'remoteOpendoor.remoteOpendoorAgain'
));
break
;
case
'6'
:
//远程开门超时
uComponents
.
openAlert
(
self
,
Vue
.
t
(
'remoteOpendoor.remoteTimeout'
),
{
text
:
Vue
.
t
(
'dialog.confirm'
),
callback
:
function
()
{
self
.
setValueRemoteOpendoor
(
false
);
self
.
setRemoteOpendoorDisabledFlag
(
true
);
}
});
break
;
}
break
;
}
...
...
@@ -1251,6 +1261,7 @@ function confirmButtonTap(self){
iotDebug
.
upload
(
iot
,
'远程开门密码下发失败'
);
}
uPublic
.
openRequestErrorAlert
(
self
);
uComponents
.
hideCommLoading
(
self
);
},
complete
(){
}
...
...
@@ -1282,6 +1293,7 @@ function confirmButtonTap(self){
error
:
(
error
)
=>
{
console
.
log
(
error
);
uPublic
.
openRequestErrorAlert
(
self
);
uComponents
.
hideCommLoading
(
self
);
}
});
}
...
...
dev/src/view/doorlockManage/v_editName.js
View file @
39e8e8fc
...
...
@@ -83,9 +83,13 @@ function initComponentsConfig() {
}
function
nameChange
(
self
,
text
){
if
(
uPublic
.
checkString
(
text
)){
self
.
setTextErrorTip
(
Vue
.
t
(
'editNickname.nickNameTypeTip'
));
}
else
{
self
.
setTextName
(
text
);
self
.
setTextErrorTip
(
''
);
console
.
log
(
'nameChange: '
+
self
.
textName
);
}
}
//tap <
...
...
dev/src/view/doorlockUsers/v_addUser.js
View file @
39e8e8fc
...
...
@@ -92,9 +92,13 @@ function backTap(){
}
function
nameChange
(
self
,
text
){
if
(
uPublic
.
checkString
(
text
)){
self
.
setTextErrorTip
(
Vue
.
t
(
'editNickname.nickNameTypeTip'
));
}
else
{
self
.
textName
=
text
;
self
.
setTextErrorTip
(
null
);
console
.
log
(
'nameChange: '
+
self
.
textName
);
}
}
//tap 确定
...
...
dev/src/view/doorlockUsers/v_doorlockUser.js
View file @
39e8e8fc
...
...
@@ -31,7 +31,8 @@ function init() {
imageSrc
:
'../../resources/image/green_unbindSuccess_icon.png'
,
textBindTip
:
Vue
.
t
(
'doorlockUser.unbindSuccess'
),
role
:
null
,
info
:
null
info
:
null
,
isFirstAddUser
:
true
},
mounted
(){
this
.
extras
=
iot
.
navigator
.
getExtras
();
...
...
@@ -42,7 +43,12 @@ function init() {
getUserInfo
(
self
);
});
getUserInfo
(
this
);
checkFirstAddUser
(
this
);
let
opener
=
plus
.
webview
.
currentWebview
().
opener
();
if
(
opener
.
id
==
'addUser'
){
self
.
isFirstAddUser
=
true
;
}
else
{
self
.
isFirstAddUser
=
false
;
}
},
methods
:{
getBindShowFlag
(){
...
...
@@ -109,12 +115,9 @@ function init() {
onBackTap
(){
backTap
();
},
onEditNameTap
(){
editNameTap
(
this
);
},
//tap 邀请绑定
onBindTap
(){
bindTap
(
this
);
onBind
Button
Tap
(){
bind
Button
Tap
(
this
);
},
//tap 解绑
onUnbindButtonTap
(){
...
...
@@ -124,6 +127,10 @@ function init() {
onBindUnlockInfoTap
(){
bindUnlockInfoTap
(
this
);
},
//tap 编辑用户昵称
onEditNameTap
(){
editNameTap
(
this
);
},
//tap 历史开门记录
onOpendoorRecordTap
(){
opendoorRecordTap
(
this
);
...
...
@@ -150,6 +157,27 @@ function init() {
//配置组件参数
function
initComponentsConfig
()
{
return
{
//绑定 button 参数
bindButton
:
{
initParam
:
{
class
:
'custom-unbind-button'
,
text
:
Vue
.
t
(
'doorlockUser.inviteBind'
)
}
},
//解绑 button 参数
unbindButton
:
{
initParam
:
{
class
:
'custom-unbind-button'
,
text
:
Vue
.
t
(
'btn.unbind'
)
}
},
//解绑 button 参数
unbindButton
:
{
initParam
:
{
class
:
'custom-unbind-button'
,
text
:
Vue
.
t
(
'btn.unbind'
)
}
},
//解绑 button 参数
unbindButton
:
{
initParam
:
{
...
...
@@ -209,22 +237,31 @@ function checkFirstAddUser(self){
//显示动画
async
function
showGuide
(
self
){
self
.
setGuideShowFlag
(
true
);
let
time
=
null
console
.
log
(
self
.
userInfo
.
role
);
if
(
self
.
userInfo
.
role
==
0
){
try
{
let
time
=
await
sleep
(
1000
);
time
=
await
sleep
(
1000
);
self
.
setGuideStep3ShowFlag
(
true
),
time
=
await
sleep
(
1000
);
self
.
setGuideStep4ShowFlag
(
true
);
}
catch
(
err
){
console
.
log
(
err
);
}
}
else
{
try
{
time
=
await
sleep
(
1000
);
self
.
setGuideStep1ShowFlag
(
true
);
time
=
await
sleep
(
1000
);
self
.
setGuideStep2ShowFlag
(
true
);
// time = await sleep(1000);
// self.setGuideStep3ShowFlag(true),
//
// time = await sleep(1000);
// self.setGuideStep4ShowFlag(true);
}
catch
(
err
){
console
.
log
(
err
);
}
}
}
async
function
nextGuide
(
self
){
...
...
@@ -261,6 +298,7 @@ function getUserInfo(self){
if
(
data
){
self
.
setInfo
(
data
);
setUserInfo
(
self
,
data
);
checkFirstAddUser
(
self
);
}
else
{}
},
...
...
@@ -310,9 +348,9 @@ function backTap(){
iot
.
navigator
.
aback
();
}
//
修改用户名
称
//
tap 编辑用户昵
称
function
editNameTap
(
self
){
if
(
!
self
.
role
){
if
(
!
self
.
role
&&
self
.
getUnbindShowFlag
()
){
iot
.
navigator
.
openWindow
({
url
:
'./editName.html'
,
id
:
'editName'
,
...
...
@@ -327,7 +365,7 @@ function editNameTap(self){
}
//tap 邀请绑定
function
bindTap
(
self
){
function
bind
Button
Tap
(
self
){
iot
.
navigator
.
openWindow
({
url
:
'./inviteBind.html'
,
id
:
'inviteBind'
,
...
...
@@ -345,14 +383,13 @@ function unbindButtonTap(self){
uComponents
.
openConfirm
(
self
,
Vue
.
t
(
'doorlockUser.unbindDialogTip'
),
{
text
:
Vue
.
t
(
'dialog.cancel'
),
callback
:
function
()
{}},
{
text
:
Vue
.
t
(
'dialog.unbind'
),
callback
:
function
()
{
// alert(self.extras.account);
// iot.business.sds.unbindByManager({
// data: {
// uuid: self.extras.uuid,
// destAuid: self.extras.account
// },
// success: (response) => {
//// alert(JSON.stringify(response));
iot
.
business
.
sds
.
unbindByManager
({
data
:
{
uuid
:
self
.
extras
.
uuid
,
destAuid
:
self
.
info
.
auids
},
success
:
(
response
)
=>
{
console
.
log
(
response
);
iot
.
business
.
api
.
sendCustom
(
'lock/unbindUser'
,{
data
:
{
user_id
:
self
.
getInfo
().
user_id
,
...
...
@@ -361,18 +398,11 @@ function unbindButtonTap(self){
},
success
:
(
response
)
=>
{
console
.
log
(
response
);
// alert(JSON.stringify(response));
self
.
setStateShowFlag
(
true
);
getUserInfo
(
self
);
},
error
:
(
error
)
=>
{
console
.
log
(
error
);
// if(window.iotDebug){
// iotDebug.push('end: 解绑失败'+JSON.stringify(error));
// }
// if (window.iotDebug) {
// iotDebug.upload(iot,'解绑失败');
// }
uPublic
.
openRequestErrorAlert
(
self
);
self
.
setImageSrc
(
'../../resources/image/green_unbindFail_icon.png'
);
self
.
setTextBindTip
(
Vue
.
t
(
'doorlockUser.unbindFailue'
));
...
...
@@ -382,24 +412,17 @@ function unbindButtonTap(self){
uComponents
.
hideLoading
(
self
);
}
});
// },
// error: (error) => {
// console.log(error);
// alert(error);
//// if(window.iotDebug){
//// iotDebug.push('end: sds解绑普通用户失败'+JSON.stringify(error));
//// }
//// if (window.iotDebug) {
//// iotDebug.upload(iot,'sds解绑普通用户失败');
//// }
// uPublic.openRequestErrorAlert(self);
// self.setImageSrc('../../resources/image/green_unbindFail_icon.png');
// self.setTextBindTip(Vue.t('doorlockUser.unbindFailue'));
// self.setStateShowFlag(true);
// },
// complete: () => {
// }
// });
},
error
:
(
error
)
=>
{
console
.
log
(
error
);
uPublic
.
openRequestErrorAlert
(
self
);
self
.
setImageSrc
(
'../../resources/image/green_unbindFail_icon.png'
);
self
.
setTextBindTip
(
Vue
.
t
(
'doorlockUser.unbindFailue'
));
self
.
setStateShowFlag
(
true
);
},
complete
:
()
=>
{
}
});
}}
);
}
...
...
@@ -428,6 +451,7 @@ function bindUnlockInfoTap(self){
//tap 历史开门记录
function
opendoorRecordTap
(
self
){
if
(
self
.
getUnbindShowFlag
()){
iot
.
navigator
.
openWindow
({
url
:
'../device/opendoorRecord.html'
,
id
:
'opendoorRecord'
,
...
...
@@ -436,6 +460,7 @@ function opendoorRecordTap(self){
deviceId
:
self
.
getInfo
().
device_id
}
});
}
}
//tap 删除该用户
...
...
@@ -465,13 +490,12 @@ function iSeeButtonTap(self){
//删除用户
function
deleteUser
(
self
){
uComponents
.
showLoading
(
self
);
// iot.business.sds.unbindByManager({
// data: {
// uuid: self.extras.uuid,
// destAuid: self.extras.account
// },
// success: (response) => {
//// alert(JSON.stringify(response));
iot
.
business
.
sds
.
unbindByManager
({
data
:
{
uuid
:
self
.
extras
.
uuid
,
destAuid
:
self
.
info
.
auids
},
success
:
(
response
)
=>
{
iot
.
business
.
api
.
sendCustom
(
'lock/delLockUser'
,{
data
:
{
rel_id
:
self
.
extras
.
id
,
...
...
@@ -491,12 +515,6 @@ function deleteUser(self){
},
error
:
(
error
)
=>
{
console
.
log
(
error
);
// if(window.iotDebug){
// iotDebug.push('end: 删除用户失败'+JSON.stringify(error));
// }
// if (window.iotDebug) {
// iotDebug.upload(iot,'删除用户失败');
// }
uComponents
.
openAlert
(
self
,
Vue
.
t
(
'doorlockUser.deleteFailure'
),
{
text
:
Vue
.
t
(
'btn.confirm'
),
callback
:
function
()
{
}
...
...
@@ -506,22 +524,15 @@ function deleteUser(self){
uComponents
.
hideLoading
(
self
);
}
});
// },
// error: (error) => {
// console.log(error);
// alert(error);
//// if(window.iotDebug){
//// iotDebug.push('end: sds解绑普通用户失败'+JSON.stringify(error));
//// }
//// if (window.iotDebug) {
//// iotDebug.upload(iot,'sds解绑普通用户失败');
//// }
// uPublic.openRequestErrorAlert(self);
// self.setImageSrc('../../resources/image/green_unbindFail_icon.png');
// self.setTextBindTip(Vue.t('doorlockUser.unbindFailue'));
// self.setStateShowFlag(true);
// },
// complete: () => {
// }
// });
},
error
:
(
error
)
=>
{
console
.
log
(
error
);
uPublic
.
openRequestErrorAlert
(
self
);
self
.
setImageSrc
(
'../../resources/image/green_unbindFail_icon.png'
);
self
.
setTextBindTip
(
Vue
.
t
(
'doorlockUser.unbindFailue'
));
self
.
setStateShowFlag
(
true
);
},
complete
:
()
=>
{
}
});
}
dev/src/view/doorlockUsers/v_editName.js
View file @
39e8e8fc
...
...
@@ -149,7 +149,11 @@ function saveTap(self){
}
function
nameChange
(
self
,
text
){
if
(
uPublic
.
checkString
(
text
)){
self
.
setTextErrorTip
(
Vue
.
t
(
'editNickname.nickNameTypeTip'
));
}
else
{
self
.
textName
=
text
;
self
.
setTextErrorTip
(
null
);
console
.
log
(
'nameChange: '
+
self
.
textName
);
}
}
\ No newline at end of file
dev/src/view/doorlockUsers/v_index.js
View file @
39e8e8fc
...
...
@@ -223,7 +223,7 @@ function onTapUserList(self, listIndex) {
extras
:
{
id
:
self
.
getUserListData
()[
listIndex
].
id
,
uuid
:
self
.
extras
.
uuid
,
account
:
self
.
getUserListData
()[
listIndex
].
account
,
//
account: self.getUserListData()[listIndex].account,
lockId
:
self
.
extras
.
lockId
,
role
:
self
.
extras
.
role
}
...
...
dev/src/view/login/v_index.js
View file @
39e8e8fc
...
...
@@ -174,13 +174,29 @@ function cloudsLogin(self, id){
if
(
window
.
iotDebug
)
{
iotDebug
.
upload
(
iot
,
'登陆流程时间'
);
}
console
.
log
(
response
);
var
data
=
uPublic
.
checkResponseData
(
response
.
data
);
var
infoArray
=
[];
if
(
data
){
infoArray
.
push
([
'utoken'
,
data
.
utoken
]);
infoArray
.
push
([
'userinfo'
,
data
]);
iot
.
business
.
websql
.
setMaps
(
infoArray
,
()
=>
{
//更新tocken userinfo
iot
.
business
.
user
.
handleLoginSuccess
({
success
:
(
response
)
=>
{
if
(
response
&&
data
.
nickname
==
''
||
data
.
nickname
==
null
||
data
.
nickname
.
trim
()
==
''
){
iot
.
business
.
user
.
setInfo
({
data
:
{
nickname
:
Vue
.
t
(
'login.defaultUser'
,[
data
.
username
.
substr
(
10
,
3
)]),
head
:
''
},
success
:
(
response
)
=>
{
console
.
log
(
response
);
},
error
:
(
error
)
=>
{
console
.
log
(
error
);
uPublic
.
openRequestErrorAlert
(
self
);
},
complete
:
()
=>
{
uComponents
.
hideLoading
(
self
);
}
});
}
iot
.
navigator
.
openWindow
({
url
:
'../device/index.html'
,
id
:
'device'
,
...
...
@@ -191,10 +207,12 @@ function cloudsLogin(self, id){
needClose
:
true
}
});
},
(
error
)
=>
{
console
.
log
(
error
);
});
plus
.
navigator
.
closeSplashscreen
();
},
error
:
(
error
)
=>
{
console
.
log
(
error
);
}
},
response
);
}
},
error
:
(
error
)
=>
{
...
...
dev/src/view/myInfo/v_editNickname.js
View file @
39e8e8fc
...
...
@@ -119,6 +119,10 @@ function backTap(){
}
function
nicknameChange
(
self
,
text
){
if
(
uPublic
.
checkString
(
text
)){
self
.
textErrorTip
=
Vue
.
t
(
'editNickname.nickNameTypeTip'
);
}
else
{
self
.
textNickName
=
text
;
self
.
textErrorTip
=
''
;
}
}
web/lib/less/doorlockUsers/doorlockUser.less
View file @
39e8e8fc
...
...
@@ -71,15 +71,14 @@
.userInfo-title{
font-size: @USERINFOLINK-TITLE-FONTSIZE;
.text_oneRow_ellipsis();
margin-bottom: 5px;
position: relative;
padding-right:
65
px;
padding-right:
104
px;
// > icon
&:after{
content: '\e6a7';
.transformV_center(right,35px);
.iconfont(@USERINFOLINK-ICON-FONTSIZE);
}
//
&:after{
//
content: '\e6a7';
//
.transformV_center(right,35px);
//
.iconfont(@USERINFOLINK-ICON-FONTSIZE);
//
}
}
.userInfo-subtitle{
position: relative;
...
...
@@ -104,26 +103,16 @@
display: inline-block;
color: @USERINFOLINK-INVITEBIND-COLOR;
font-size: @USERINFOLINK-INVITEBIND-FONTSIZE;
.transform(scale(0.7));
padding: 0 22px 2px;
margin-left: -15px;
&:after{
content: '';
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 1px;/*no*/
.blue_gradient_border();
}
}
//解绑
.custom-unbind-button{
position: absolute;
top: -4px;
margin-left: 6px;
top: 50%;
bottom: auto;
right: 35px;
.button(72px);
.transform(scale(0.7));
.transform(
translateY(-50%)
scale(0.7));
padding: 5px 0;
display: inline-block;
}
...
...
@@ -138,6 +127,10 @@
}
}
}
.disabled{
color: #ccc;
}
}
//邀请绑定
...
...
@@ -219,51 +212,62 @@
left: 0;
width: 100%;
.guideStep1Cont{
padding:
13px 0 13
px 42px;
padding:
25px 0 25
px 42px;
position: relative;
p{
&:nth-child(1){
.userInfo-title{
font-size: @USERINFOLINK-TITLE-FONTSIZE;
.text_oneRow_ellipsis();
margin-bottom: 5px;
position: relative;
padding-right: 65px;
// > icon
&:after{
content: '\e6a7';
.transformV_center(right,35px);
.iconfont(@USERINFOLINK-ICON-FONTSIZE);
padding-right: 104px;
}
//管理员头像
.userInfo-image{
width: 27px;
height: 27px;
margin-right: 14px;
}
&:nth-child(2){
//绑定/未绑定 头像
.userInfo-subimage{
width: 20px;
height: 20px;
margin-right: 9px;
}
.userInfo-subtitle{
position: relative;
}
//绑定/未绑定 头像
img
{
.userInfo-subimage
{
width: 20px;
height: 20px;
margin-right: 13px;
margin-right: 9px;
}
//昵称
.userInfo-name{
display: inline-block;
vertical-align: middle;
max-width: 145px;
.text_oneRow_ellipsis();
}
//邀请绑定
span
{
.userInfo-toBind
{
position: absolute;
bottom: 0;
display: inline-block;
color: @USERINFOLINK-INVITEBIND-COLOR;
font-size: @USERINFOLINK-INVITEBIND-FONTSIZE;
.transform(scale(0.7));
padding: 0 22px 2px;
margin-left: -15px;
&:after{
content: '';
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 1px;/*no*/
.blue_gradient_border();
}
}
//解绑
.custom-unbind-button{
position: absolute;
top: 50%;
bottom: auto;
right: 35px;
.button(72px);
.transform(translateY(-50%) scale(0.7));
padding: 5px 0;
display: inline-block;
}
//虚线框
&:after{
...
...
web/view/doorlockUsers/doorlockUser.css
View file @
39e8e8fc
...
...
@@ -705,22 +705,8 @@ p {
overflow
:
hidden
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
margin-bottom
:
0.133rem
;
position
:
relative
;
padding-right
:
1.733rem
;
}
.userInfoLink
li
.userInfo
.userInfo-title
:after
{
content
:
'\e6a7'
;
position
:
absolute
;
top
:
50%
;
right
:
0.933rem
;
-webkit-transform
:
translateY
(
-50%
);
transform
:
translateY
(
-50%
);
font-family
:
iconfont
;
font-size
:
0.667rem
;
-webkit-font-smoothing
:
antialiased
;
line-height
:
1
;
padding-right
:
2.773rem
;
}
.userInfoLink
li
.userInfo
.userInfo-subtitle
{
...
...
@@ -748,35 +734,22 @@ p {
display
:
inline-block
;
color
:
#00ffff
;
font-size
:
0.427rem
;
-webkit-transform
:
scale
(
0.7
);
transform
:
scale
(
0.7
);
padding
:
0
0.587rem
0.053rem
;
margin-left
:
-0.4rem
;
}
.userInfoLink
li
.userInfo
.userInfo-toBind
:after
{
content
:
''
;
position
:
absolute
;
bottom
:
0
;
left
:
0
;
right
:
0
;
height
:
1px
;
background
:
-webkit-linear-gradient
(
left
,
#242635
,
#00ffff
,
#242635
);
background
:
linear-gradient
(
to
right
,
#242635
,
#00ffff
,
#242635
);
}
.userInfoLink
li
.userInfo
.custom-unbind-button
{
position
:
absolute
;
top
:
-0.107rem
;
margin-left
:
0.16rem
;
top
:
50%
;
bottom
:
auto
;
right
:
0.933rem
;
width
:
1.92rem
;
border-radius
:
0.133rem
;
background-color
:
transparent
;
border
:
1px
solid
;
color
:
#00ffff
;
font-size
:
0.427rem
;
-webkit-transform
:
scale
(
0.7
);
transform
:
scale
(
0.7
);
-webkit-transform
:
translateY
(
-50%
)
scale
(
0.7
);
transform
:
translateY
(
-50%
)
scale
(
0.7
);
padding
:
0.133rem
0
;
display
:
inline-block
;
}
...
...
@@ -800,6 +773,10 @@ p {
background-color
:
#50515d
;
}
.userInfoLink
.disabled
{
color
:
#ccc
;
}
.inviteBind
{
margin
:
1.093rem
1.12rem
0
;
}
...
...
@@ -940,64 +917,83 @@ p {
}
.guide-dialog
.guideStep1
.guideStep1Cont
{
padding
:
0.
347rem
0
0.34
7rem
1.12rem
;
padding
:
0.
667rem
0
0.66
7rem
1.12rem
;
position
:
relative
;
}
.guide-dialog
.guideStep1
.guideStep1Cont
p
:nth-child
(
1
)
{
.guide-dialog
.guideStep1
.guideStep1Cont
.userInfo-title
{
font-size
:
0.427rem
;
overflow
:
hidden
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
margin-bottom
:
0.133rem
;
position
:
relative
;
padding-right
:
1.73
3rem
;
padding-right
:
2.77
3rem
;
}
.guide-dialog
.guideStep1
.guideStep1Cont
p
:nth-child
(
1
)
:after
{
content
:
'\e6a7'
;
position
:
absolute
;
top
:
50%
;
right
:
0.933rem
;
-webkit-transform
:
translateY
(
-50%
);
transform
:
translateY
(
-50%
);
font-family
:
iconfont
;
font-size
:
0.667rem
;
-webkit-font-smoothing
:
antialiased
;
line-height
:
1
;
.guide-dialog
.guideStep1
.guideStep1Cont
.userInfo-image
{
width
:
0.72rem
;
height
:
0.72rem
;
margin-right
:
0.373rem
;
}
.guide-dialog
.guideStep1
.guideStep1Cont
.userInfo-subimage
{
width
:
0.533rem
;
height
:
0.533rem
;
margin-right
:
0.24rem
;
}
.guide-dialog
.guideStep1
.guideStep1Cont
p
:nth-child
(
2
)
{
.guide-dialog
.guideStep1
.guideStep1Cont
.userInfo-subtitle
{
position
:
relative
;
}
.guide-dialog
.guideStep1
.guideStep1Cont
p
img
{
.guide-dialog
.guideStep1
.guideStep1Cont
.userInfo-subimage
{
width
:
0.533rem
;
height
:
0.533rem
;
margin-right
:
0.347rem
;
margin-right
:
0.24rem
;
}
.guide-dialog
.guideStep1
.guideStep1Cont
.userInfo-name
{
display
:
inline-block
;
vertical-align
:
middle
;
max-width
:
3.867rem
;
overflow
:
hidden
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
}
.guide-dialog
.guideStep1
.guideStep1Cont
p
span
{
.guide-dialog
.guideStep1
.guideStep1Cont
.userInfo-toBind
{
position
:
absolute
;
bottom
:
0
;
display
:
inline-block
;
color
:
#00ffff
;
font-size
:
0.427rem
;
-webkit-transform
:
scale
(
0.7
);
transform
:
scale
(
0.7
);
padding
:
0
0.587rem
0.053rem
;
margin-left
:
-0.4rem
;
}
.guide-dialog
.guideStep1
.guideStep1Cont
p
span
:after
{
content
:
''
;
.guide-dialog
.guideStep1
.guideStep1Cont
.custom-unbind-button
{
position
:
absolute
;
bottom
:
0
;
left
:
0
;
right
:
0
;
height
:
1px
;
background
:
-webkit-linear-gradient
(
left
,
#242635
,
#00ffff
,
#242635
);
background
:
linear-gradient
(
to
right
,
#242635
,
#00ffff
,
#242635
);
top
:
50%
;
bottom
:
auto
;
right
:
0.933rem
;
width
:
1.92rem
;
border-radius
:
0.133rem
;
background-color
:
transparent
;
border
:
1px
solid
;
color
:
#00ffff
;
font-size
:
0.427rem
;
-webkit-transform
:
translateY
(
-50%
)
scale
(
0.7
);
transform
:
translateY
(
-50%
)
scale
(
0.7
);
padding
:
0.133rem
0
;
display
:
inline-block
;
}
.guide-dialog
.guideStep1
.guideStep1Cont
.custom-unbind-button
:active
{
background-color
:
#153D4C
;
}
.guide-dialog
.guideStep1
.guideStep1Cont
.custom-unbind-button.disabled
{
background-color
:
transparent
;
color
:
#999
;
}
.guide-dialog
.guideStep1
.guideStep1Cont
:after
{
...
...
web/view/doorlockUsers/doorlockUser.html
View file @
39e8e8fc
...
...
@@ -29,20 +29,16 @@
<ul
class=
"userInfoLink"
>
<li
class=
"userInfo"
>
<img
class=
"userInfo-image"
v-if=
"userInfo.image && userInfo.role == 0"
v-bind:src=
"userInfo.image"
>
<div>
<v-touch
tag=
"p"
class=
"userInfo-title"
v-bind:class=
"{'userInfo-title-disabled': role}"
v-on:tap=
"onEditNameTap"
>
{{ userInfo.title == (null || '') ? $t('doorlockUser.defaultName') : userInfo.title}}
</v-touch>
<p
class=
"userInfo-subtitle"
>
<img
class=
"userInfo-subimage"
v-if=
"userInfo.image && userInfo.role != 0"
v-bind:src=
"userInfo.image"
>
<!--<span class="userInfo-name" v-if="userInfo.subtitle">{{ userInfo.subtitle }}</span>--
>
<v-touch
tag=
"span"
class=
"userInfo-toBind"
v-show=
"bindShowFlag && !role"
v-on:tap=
"onBindTap"
>
{{ $t('doorlockUser.inviteBind') }}
</v-touch
>
<span
class=
"userInfo-title"
>
{{ userInfo.title == (null || '') ? $t('doorlockUser.defaultName') : userInfo.title}}
</span
>
<u-button
:init-param=
"componentsConfig.bindButton.initParam"
class=
"userInfo-toBind"
v-on:u-button-tap=
"onBindButtonTap"
v-show=
"bindShowFlag && !role"
></u-button
>
<u-button
:init-param=
"componentsConfig.unbindButton.initParam"
v-on:u-button-tap=
"onUnbindButtonTap"
v-show=
"(unbindShowFlag && !role && userInfo.role != 0)"
></u-button>
</p>
</div>
</li>
<v-touch
tag=
"li"
v-on:tap=
"onBindUnlockInfoTap"
>
{{ $t('doorlockUser.bindUnlockInfo') }}
</v-touch>
<v-touch
tag=
"li"
v-on:tap=
"onOpendoorRecordTap"
>
{{ $t('doorlockUser.opendoorRecord') }}
</v-touch>
<v-touch
tag=
"li"
v-bind:class=
"[{disabled: isFirstAddUser}]"
v-on:tap=
"onEditNameTap"
>
{{ $t('doorlockUser.editUsername') }}
</v-touch>
<v-touch
tag=
"li"
v-bind:class=
"[{disabled: isFirstAddUser}]"
v-on:tap=
"onOpendoorRecordTap"
>
{{ $t('doorlockUser.opendoorRecord') }}
</v-touch>
</ul>
<u-button
:init-param=
"componentsConfig.deleteUserButton.initParam"
v-on:u-button-tap=
"onDeleteUserButtonTap"
v-show=
"!role && userInfo.role != 0"
></u-button>
<u-button
:
disabled=
"isFirstAddUser"
:
init-param=
"componentsConfig.deleteUserButton.initParam"
v-on:u-button-tap=
"onDeleteUserButtonTap"
v-show=
"!role && userInfo.role != 0"
></u-button>
</div>
<transition
name=
"fade"
>
<v-touch
tag=
"div"
class=
"unbindState-dialog"
v-show=
"stateShowFlag"
v-on:tap=
"onUnbindStateDialogTap"
>
...
...
@@ -56,8 +52,11 @@
<transition
name=
"fade"
>
<div
class=
"guideStep1"
v-show=
"guideStep1ShowFlag"
>
<div
class=
"guideStep1Cont"
>
<p>
我是个用户
</p>
<p><img
src=
"../../resources/image/gray_unbindHead_icon.png"
>
{{ $t('doorlockUser.name') }}
<span>
{{ $t('doorlockUser.inviteBind') }}
</span></p>
<img
class=
"userInfo-image"
v-if=
"userInfo.image && userInfo.role == 0"
v-bind:src=
"userInfo.image"
>
<img
class=
"userInfo-subimage"
v-if=
"userInfo.image && userInfo.role != 0"
v-bind:src=
"userInfo.image"
>
<span
class=
"userInfo-title"
>
{{ userInfo.title == (null || '') ? $t('doorlockUser.defaultName') : userInfo.title}}
</span>
<u-button
:init-param=
"componentsConfig.bindButton.initParam"
class=
"userInfo-toBind"
v-on:u-button-tap=
"onBindButtonTap"
v-show=
"bindShowFlag && !role"
></u-button>
<u-button
:init-param=
"componentsConfig.unbindButton.initParam"
v-on:u-button-tap=
"onUnbindButtonTap"
v-show=
"(unbindShowFlag && !role && userInfo.role != 0)"
></u-button>
</div>
<div
class=
"guideStep1Tip"
>
<p>
{{ $t('doorlockUser.guideStep1Tip1') }}
</p>
...
...
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