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
6e40dbb7
Commit
6e40dbb7
authored
Sep 30, 2017
by
朱建香
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
0930
parent
72c6d16d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
110 additions
and
57 deletions
+110
-57
dev/src/view/device/v_index.js
+8
-3
dev/src/view/myInfo/v_editNickname.js
+45
-5
dev/src/view/myInfo/v_index.js
+29
-4
web/lib/less/myInfo/myInfo.less
+16
-15
web/view/myInfo/index.html
+6
-6
web/view/myInfo/myInfo.css
+6
-24
No files found.
dev/src/view/device/v_index.js
View file @
6e40dbb7
...
...
@@ -50,6 +50,7 @@ function init() {
mounted
(){
let
self
=
this
;
iot
.
navigator
.
closeAllBesidesItself
();
//获取设备信息
iot
.
business
.
sds
.
getDevicesByUser
({
success
:
(
response
)
=>
{
let
data
=
uPublic
.
checkResponseData
(
response
.
data
);
...
...
@@ -118,6 +119,7 @@ function init() {
let
time
=
new
Date
();
this
.
ringingTime
=
moment
(
time
).
format
(
"HH:mm"
);
// getNewOpenDoorRecord(this);
},
methods
:{
...
...
@@ -189,7 +191,7 @@ function init() {
},
//tap 个人信息
onMyInfoTap
(){
myInfoTap
();
myInfoTap
(
this
);
},
//tap 门锁管理
onDoorlockManageTap
(){
...
...
@@ -347,10 +349,13 @@ function getNewOpenDoorRecord(self){
}
//tap 个人信息
function
myInfoTap
(){
function
myInfoTap
(
self
){
iot
.
navigator
.
openWindow
({
url
:
'../myInfo/'
,
id
:
'myInfo'
id
:
'myInfo'
,
extras
:
{
nickname
:
self
.
nickname
}
});
}
...
...
dev/src/view/myInfo/v_editNickname.js
View file @
6e40dbb7
...
...
@@ -16,18 +16,27 @@ function init() {
const
app
=
new
Vue
({
data
:{
//配置组件
textNickName
:
null
,
textErrorTip
:
'请输入昵称'
,
textNickName
:
iot
.
navigator
.
getExtras
().
nickname
,
textErrorTip
:
null
,
componentsConfig
:
initComponentsConfig
()
},
mounted
(){
},
methods
:{
getTextNickName
(){
return
this
.
textNickName
;
},
setTextNickName
(
text
){
this
.
textNickName
=
this
;
},
onSaveTap
(){
saveTap
();
saveTap
(
this
);
},
onBackTap
(){
backTap
();
},
onNicknameChange
(
text
){
nicknameChange
(
this
,
text
);
}
}
}).
$mount
(
'#app'
);
...
...
@@ -62,12 +71,43 @@ function initComponentsConfig() {
}
}
//保存昵称
function
saveTap
(){
function
saveTap
(
self
){
if
(
self
.
textNickName
==
null
||
self
.
textNickName
.
trim
()
==
''
){
self
.
textErrorTip
=
Vue
.
t
(
'editNickname.nickNameInputTip'
);
}
else
{
uComponents
.
showLoading
(
self
);
iot
.
business
.
user
.
setInfo
({
data
:
{
nickname
:
self
.
textNickName
,
head
:
''
,
info
:
{}
},
success
:
(
response
)
=>
{
if
(
response
.
data
=
'success'
){
iot
.
navigator
.
fire
(
plus
.
webview
.
currentWebview
().
opener
(),
'returnPage'
,{
// name: 'zhu'
});
iot
.
navigator
.
back
();
}
},
error
:
(
error
)
=>
{
console
.
log
(
error
);
},
complete
:
()
=>
{
uComponents
.
hideLoading
(
self
);
}
});
}
}
//返回上一页
function
backTap
(){
iot
.
navigator
.
back
();
}
function
nicknameChange
(
self
,
text
){
self
.
textNickName
=
text
;
self
.
textErrorTip
=
''
;
}
dev/src/view/myInfo/v_index.js
View file @
6e40dbb7
...
...
@@ -16,15 +16,21 @@ function init() {
const
app
=
new
Vue
({
data
:{
//配置组件
nick
N
ame
:
'bank'
,
nick
n
ame
:
'bank'
,
componentsConfig
:
initComponentsConfig
()
},
mounted
(){
let
self
=
this
;
getInfo
(
this
);
window
.
addEventListener
(
'returnPage'
,
function
(
event
){
console
.
log
(
"in"
);
getInfo
(
self
);
});
},
methods
:{
//tap 修改昵称
onEditNicknameTap
(){
editNicknameTap
();
editNicknameTap
(
this
);
},
//tap 修改密码
onEditPasswordTap
(){
...
...
@@ -49,10 +55,13 @@ function initComponentsConfig() {
}
//tap 修改昵称
function
editNicknameTap
(){
function
editNicknameTap
(
self
){
iot
.
navigator
.
openWindow
({
url
:
'../myInfo/editNickname.html'
,
id
:
'editNickname'
id
:
'editNickname'
,
extras
:
{
nickname
:
self
.
nickname
}
});
}
...
...
@@ -67,3 +76,19 @@ function editPasswordTap(){
function
backTap
(){
iot
.
navigator
.
back
();
}
function
getInfo
(
self
){
iot
.
business
.
user
.
getInfo
({
success
:
(
response
)
=>
{
let
data
=
uPublic
.
checkResponseData
(
response
.
data
);
if
(
data
){
console
.
log
(
data
);
self
.
nickname
=
data
.
nickname
;
}
else
{
}
},
error
:
(
error
)
=>
{},
complete
:
()
=>
{}
});
}
web/lib/less/myInfo/myInfo.less
View file @
6e40dbb7
...
...
@@ -46,30 +46,31 @@
}
span{
//去掉span
// &:first-child{
// font-size: 16px;
// line-height: 1;
// .flex();
// }
&:first-child{
font-size: 16px;
line-height: 1;
.flex();
}
&:nth-child(2){
font-size: 12px;
line-height: 1;
float: right;
float: right;
font-family: iconfont;
font-size: @TEXT-COMPONENT-ICON-FONTSIZE;
-webkit-font-smoothing: antialiased;
.transform(rotate(180deg));
}
&:last-child{
display: block;
//
.iconfont(@TEXT-COMPONENT-ICON-FONTSIZE);
.transform(rotate(180deg));
font-size: 12px;
float: right;
}
}
}
.editPassword{
span{
&:nth-child(2){
display: block;
//
.iconfont(@TEXT-COMPONENT-ICON-FONTSIZE)
;
font-family: iconfont;
font-size: @TEXT-COMPONENT-ICON-FONTSIZE;
-webkit-font-smoothing: antialiased
;
}
}
}
...
...
web/view/myInfo/index.html
View file @
6e40dbb7
...
...
@@ -25,14 +25,14 @@
</div>
<ul
class=
"editMyInfo"
>
<v-touch
tag=
"li"
class=
"editNickname"
v-on:tap=
"onEditNicknameTap"
>
<span
>
{{ $t('myInfo.editNickname') }}
</span>
<span>
{{ nickName }}
</span>
<span>

</span>
{{ $t('myInfo.editNickname') }}
<span>

</span>
<span>
{{ nickname }}
</span>
</v-touch>
<v-touch
tag=
"li"
class=
"editPassword"
v-on:tap=
"onEditPasswordTap"
>
<span>
{{ $t('myInfo.editPassword') }}
</span>
<span>

</span>
<span>

</span>
{{ $t('myInfo.editPassword') }}
<span>

</span>
<span>

</span>
</v-touch>
</ul>
<u-loading
ref=
"uloading"
:init-param=
"componentsConfig.loading.initParam"
></u-loading>
...
...
web/view/myInfo/myInfo.css
View file @
6e40dbb7
...
...
@@ -573,13 +573,7 @@ p {
width
:
100%
;
height
:
1.467rem
;
position
:
relative
;
line-height
:
1
;
display
:
-webkit-box
;
display
:
-webkit-flex
;
display
:
flex
;
-webkit-box-align
:
center
;
-webkit-align-items
:
center
;
align-items
:
center
;
line-height
:
1.467rem
;
padding
:
0
1.147rem
;
}
...
...
@@ -596,35 +590,23 @@ p {
}
.editMyInfo
li
span
:first-child
{
font-size
:
0.427rem
;
line-height
:
1
;
flex
:
1
;
}
.editMyInfo
li
span
:nth-child
(
2
)
{
font-size
:
0.32rem
;
line-height
:
1
;
float
:
right
;
}
.editMyInfo
li
span
:last-child
{
display
:
block
;
font-family
:
iconfont
;
font-size
:
0.533rem
;
-webkit-font-smoothing
:
antialiased
;
line-height
:
1
;
-webkit-transform
:
rotate
(
180deg
);
transform
:
rotate
(
180deg
);
}
.editMyInfo
li
span
:last-child
{
font-size
:
0.32rem
;
float
:
right
;
}
.editMyInfo
.editPassword
span
:nth-child
(
2
)
{
display
:
block
;
font-family
:
iconfont
;
font-size
:
0.533rem
;
-webkit-font-smoothing
:
antialiased
;
line-height
:
1
;
-webkit-transform
:
rotate
(
180deg
);
transform
:
rotate
(
180deg
);
}
.errorTip
{
...
...
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