Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zuiketang
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
zuiketang
Commits
acabee6f
Commit
acabee6f
authored
Oct 09, 2016
by
杨培
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
0f90b990
7e1ecd3a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
72 additions
and
4 deletions
+72
-4
UserCenterController.php
src/frontend/controllers/UserCenterController.php
+4
-3
info.js
src/frontend/web/js/user-center/info.js
+3
-0
style.css
ui/html/css/style.css
+42
-0
my-基本信息.html
ui/html/my-基本信息.html
+23
-1
No files found.
src/frontend/controllers/UserCenterController.php
View file @
acabee6f
...
@@ -103,8 +103,6 @@ class UserCenterController extends Controller
...
@@ -103,8 +103,6 @@ class UserCenterController extends Controller
}
}
/**
/**
* 保存用户信息
* 保存用户信息
* @throws \yii\web\ForbiddenHttpException
* @throws \yii\web\ForbiddenHttpException
...
@@ -122,7 +120,10 @@ class UserCenterController extends Controller
...
@@ -122,7 +120,10 @@ class UserCenterController extends Controller
$status
=
FALSE
;
$status
=
FALSE
;
$msg
=
'昵称超过长度限制'
;
$msg
=
'昵称超过长度限制'
;
}
else
{
}
else
{
$user
=
Yii
::
$app
->
user
->
identity
;
$user
->
avatar
=
$avatar
;
$user
->
username
=
$username
;
$user
->
save
();
}
}
Utils
::
ajaxResponse
(
$status
,
$msg
);
Utils
::
ajaxResponse
(
$status
,
$msg
);
}
else
{
}
else
{
...
...
src/frontend/web/js/user-center/info.js
View file @
acabee6f
...
@@ -61,6 +61,7 @@ require.ensure('../libs/plupload/plupload.full.min.js', function () {
...
@@ -61,6 +61,7 @@ require.ensure('../libs/plupload/plupload.full.min.js', function () {
// }
// }
// 查看简单反馈
// 查看简单反馈
var
res
=
JSON
.
parse
(
info
.
response
);
var
res
=
JSON
.
parse
(
info
.
response
);
var
url
=
__QINIU_URL__
+
res
.
key
;
$
(
'#avatar-uploader'
).
attr
(
'src'
,
url
);
$
(
'#avatar-uploader'
).
attr
(
'src'
,
url
);
$
(
'#avatar'
).
val
(
res
.
key
);
$
(
'#avatar'
).
val
(
res
.
key
);
},
},
...
@@ -102,6 +103,8 @@ $("#save").click(function () {
...
@@ -102,6 +103,8 @@ $("#save").click(function () {
success
:
function
(
reponse
)
{
success
:
function
(
reponse
)
{
if
(
!
reponse
.
status
===
true
)
{
if
(
!
reponse
.
status
===
true
)
{
layer
.
alert
(
reponse
.
message
||
'系统错误'
,
{
icon
:
2
,
title
:
"提示"
})
layer
.
alert
(
reponse
.
message
||
'系统错误'
,
{
icon
:
2
,
title
:
"提示"
})
}
else
{
layer
.
alert
(
'保存成功'
,
{
icon
:
1
,
title
:
"提示"
})
}
}
}
}
}).
error
(
function
()
{
}).
error
(
function
()
{
...
...
ui/html/css/style.css
View file @
acabee6f
...
@@ -18,6 +18,9 @@ html {
...
@@ -18,6 +18,9 @@ html {
.m-t-20
{
.m-t-20
{
margin-top
:
20px
;
margin-top
:
20px
;
}
}
.m-b-20
{
margin-bottom
:
20px
;
}
.d-i-b
{
.d-i-b
{
display
:
inline-block
;
display
:
inline-block
;
}
}
...
@@ -388,11 +391,13 @@ html {
...
@@ -388,11 +391,13 @@ html {
background-color
:
#fff
;
background-color
:
#fff
;
}
}
.add-box-main
{
.add-box-main
{
position
:
relative
;
padding
:
20px
40px
;
padding
:
20px
40px
;
text-align
:
center
;
text-align
:
center
;
}
}
.add-box-main
.tit
{
.add-box-main
.tit
{
text-align
:
left
;
text-align
:
left
;
font-size
:
16px
;
}
}
.upload-avatar
{
.upload-avatar
{
position
:
relative
;
position
:
relative
;
...
@@ -427,9 +432,46 @@ html {
...
@@ -427,9 +432,46 @@ html {
cursor
:
pointer
;
cursor
:
pointer
;
}
}
.upload-avatar
img
{
.upload-avatar
img
{
position
:
absolute
;
left
:
0
;
top
:
0
;
height
:
100px
;
height
:
100px
;
width
:
100px
;
width
:
100px
;
border-radius
:
100%
;
border-radius
:
100%
;
z-index
:
2
;
}
.upload-avatar
span
.loading-tip
{
position
:
absolute
;
display
:
inline-block
;
width
:
100px
;
height
:
100px
;
text-align
:
center
;
line-height
:
100px
;
color
:
#fff
;
top
:
0
;
left
:
0
;
border-radius
:
100%
;
background-color
:
rgba
(
0
,
0
,
0
,
.5
);
z-index
:
3
;
}
.edit-info
{
position
:
absolute
;
display
:
inline-block
;
width
:
50px
;
height
:
50px
;
border-radius
:
100%
;
text-align
:
center
;
line-height
:
52px
;
font-size
:
18px
;
text-decoration
:
none
;
right
:
20px
;
top
:
20px
;
background-color
:
#f3f3f3
;
}
.edit-info
:hover
{
background-color
:
#3f7de4
;
color
:
#fff
;
text-decoration
:
none
;
}
}
.type-name
{
.type-name
{
font-size
:
14px
;
font-size
:
14px
;
...
...
ui/html/my-基本信息.html
View file @
acabee6f
...
@@ -39,7 +39,9 @@
...
@@ -39,7 +39,9 @@
<div
class=
"tp-main"
>
<div
class=
"tp-main"
>
<div
class=
"container"
>
<div
class=
"container"
>
<div
class=
"add-box"
>
<div
class=
"add-box hide"
>
<div
class=
"add-box-main"
>
<div
class=
"add-box-main"
>
<div
class=
"tit"
>
基本信息
</div>
<div
class=
"tit"
>
基本信息
</div>
...
@@ -59,6 +61,26 @@
...
@@ -59,6 +61,26 @@
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"add-box"
>
<div
class=
"add-box-main"
>
<div
class=
"tit"
>
基本信息
</div>
<div
class=
"upload-avatar"
>
<span
class=
"loading-tip"
>
上传中
</span>
<img
src=
"img/avatar2.jpg"
>
</div>
<div
class=
"type-name m-b-20"
>
元彪
</div>
<a
href=
"#"
class=
"edit-info"
><i
class=
"icon-mode_edit"
></i></a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
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