Authored by ccbikai

头像加载失败改成默认头像

... ... @@ -3,5 +3,10 @@
* @author: bikai<kai.bi@yoho.cn>
* @date: 2015/11/12
*/
var $ = require('jquery');
require('../product/recommend-for-you.js');
$('.user-avatar').on('error', function() {
$(this).attr('src', 'http://static.dev.yohobuy.com/img/me/index/user-avatar.png');
});
\ No newline at end of file
... ...
/**
* 个人信息
* @author: bikai<kai.bi@yoho.cn>
* @date: 2015/11/19
*/
var $ = require('jquery');
$('.user-avatar').on('error', function() {
$(this).attr('src', 'http://static.dev.yohobuy.com/img/me/index/user-avatar.png');
});
\ No newline at end of file
... ...
{{> layout/header}}
<div class="personal-details">
<ul>
<li><span>头像</span><span><i class="head-portrait"><img src="{{ head_ico }}"></i></span></li>
<li><span>头像</span><span><i class="head-portrait"><img class="user-avatar" src="{{ head_ico }}"></i></span></li>
<li><span>昵称</span><span>{{ username }}</span></li>
<li><span>性别</span><span>{{ gender }}</span></li>
<li><span>生日</span><span>{{ birthday }}</span></li>
... ...
... ... @@ -248,3 +248,8 @@
seajs.use('js/me/my-guang');
</script>
{{/if}}
{{#if personalDetailsPage}}
<script>
seajs.use('js/me/personal-details');
</script>
{{/if}}
\ No newline at end of file
... ...
... ... @@ -127,6 +127,7 @@ class HomeController extends AbstractAction
// $uid = $this->getUid();
$uid = 967016;
$data = \Index\UserModel::getUserProfileData($uid);
$data['personalDetailsPage'] = true;
$data['pageFooter'] = true;
$this->_view->display('personal-details', $data);
}
... ...