Authored by Lynnic

Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into develop

... ... @@ -6,14 +6,17 @@
var $ = require('jquery');
var $userAvatar = $('.user-avatar'),
$listItem = $('.list-item');
var myImage = new Image();
var myImage = new Image(),
avatar;
require('../product/recommend-for-you.js');
require('../product/suspend-cart.js');
myImage.src = $userAvatar.attr('src');
myImage.onerror = function() {
$userAvatar.attr('src', 'http://static.dev.yohobuy.com/img/me/index/user-avatar.png');
// 部分老用户没有头像,显示默认头像
avatar = $userAvatar.data('avatar');
myImage.src = avatar;
myImage.onload = function() {
$userAvatar.css('background-image', 'url(' + avatar + ')');
};
$('.yoho-page').on('touchstart', '.list-item, .type-item', function() {
... ...
... ... @@ -5,9 +5,12 @@
*/
var $ = require('jquery');
var $userAvatar = $('.user-avatar');
var myImage = new Image();
var myImage = new Image(),
avatar;
myImage.src = $userAvatar.attr('src');
myImage.onerror = function() {
$userAvatar.attr('src', 'http://static.dev.yohobuy.com/img/me/index/user-avatar.png');
// 部分老用户没有头像,显示默认头像
avatar = $userAvatar.data('avatar');
myImage.src = avatar;
myImage.onload = function() {
$userAvatar.css('background-image', 'url(' + avatar + ')');
};
... ...
... ... @@ -25,6 +25,8 @@
height: pxToRem(126px);
border-radius: 50%;
border: pxToRem(6px) solid #a7a8a9;
background-image: image-url("me/index/user-avatar.png");
background-size: 100%;
}
.username {
... ...
... ... @@ -17,6 +17,14 @@
}
height: 80rem / $pxConvertRem;
border-bottom: 1px solid #e0e0e0;
.user-avatar {
width: 100%;
height: 100%;
background-image: image-url("me/index/user-avatar.png");
background-size: 100%;
}
span{
&:first-of-type{
color: #444;
... ...
... ... @@ -45,20 +45,17 @@
line-height: 1;
span {
display: block;
display: inline-block;
// chrome 最小支持12px, 设计图是 10px ,用CSS3变换
@include transform(scale(0.875));
}
.sale-price {
color: #d9134f;
margin-left: pxToRem(-10px);
margin-right: pxToRem(8px);
}
.old-price {
position: absolute;
top: 0;
right: pxToRem(-4px);
color: #b0b0b0;
text-decoration: line-through;
}
... ...
... ... @@ -3,7 +3,7 @@
<div class="my-header">
{{#isLogin}}
<a class="user-info" href="/home/mydetails">
<img class="user-avatar" src="{{head_ico}}">
<span class="user-avatar" data-avatar="{{head_ico}}"></span>
<span class="username">{{profile_name}}</span>
{{#vip_info}}
<span class="vip-icon vip-{{next_level}}"></span>
... ...
{{> layout/header}}
<div class="personal-details">
<ul>
<li><span>头像</span><span><i class="head-portrait"><img class="user-avatar" src="{{ head_ico }}"></i></span></li>
<li><span>头像</span><span><i class="head-portrait"><span class="user-avatar" data-avatar="{{ head_ico }}"></span></i></span></li>
<li><span>昵称</span><span>{{ username }}</span></li>
<li><span>性别</span><span>{{ gender }}</span></li>
<li><span>生日</span><span>{{ birthday }}</span></li>
... ...