personal-details.page.js 501 Bytes
/**
 * Created by PhpStorm.
 * User: Targaryen
 * Date: 2016/8/22
 * Time: 18:05
 */
/**
 * 个人信息
 * @author: bikai<kai.bi@yoho.cn>
 * @date: 2015/11/19
 */
let $ = require('yoho-jquery');
let $userAvatar = $('.user-avatar');
let myImage = new Image(),
    avatar;

require('common');

// 部分老用户没有头像,显示默认头像
avatar = $userAvatar.data('avatar');
myImage.src = avatar;
myImage.onload = function() {
    $userAvatar.css('background-image', 'url(' + avatar + ')');
};