Commit acabee6f authored by 杨培's avatar 杨培

Merge remote-tracking branch 'origin/master'

parents 0f90b990 7e1ecd3a
...@@ -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 {
......
...@@ -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 () {
......
...@@ -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;
......
...@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment