Authored by uedxwg

update

@@ -6,14 +6,17 @@ @@ -6,14 +6,17 @@
6 var $ = require('jquery'); 6 var $ = require('jquery');
7 var $userAvatar = $('.user-avatar'), 7 var $userAvatar = $('.user-avatar'),
8 $listItem = $('.list-item'); 8 $listItem = $('.list-item');
9 -var myImage = new Image(); 9 +var myImage = new Image(),
  10 + avatar;
10 11
11 require('../product/recommend-for-you.js'); 12 require('../product/recommend-for-you.js');
12 require('../product/suspend-cart.js'); 13 require('../product/suspend-cart.js');
13 14
14 -myImage.src = $userAvatar.attr('src');  
15 -myImage.onerror = function() {  
16 - $userAvatar.attr('src', 'http://static.dev.yohobuy.com/img/me/index/user-avatar.png'); 15 +// 部分老用户没有头像,显示默认头像
  16 +avatar = $userAvatar.data('avatar');
  17 +myImage.src = avatar;
  18 +myImage.onload = function() {
  19 + $userAvatar.css('background-image', 'url(' + avatar + ')');
17 }; 20 };
18 21
19 $('.yoho-page').on('touchstart', '.list-item, .type-item', function() { 22 $('.yoho-page').on('touchstart', '.list-item, .type-item', function() {
@@ -5,9 +5,12 @@ @@ -5,9 +5,12 @@
5 */ 5 */
6 var $ = require('jquery'); 6 var $ = require('jquery');
7 var $userAvatar = $('.user-avatar'); 7 var $userAvatar = $('.user-avatar');
8 -var myImage = new Image(); 8 +var myImage = new Image(),
  9 + avatar;
9 10
10 -myImage.src = $userAvatar.attr('src');  
11 -myImage.onerror = function() {  
12 - $userAvatar.attr('src', 'http://static.dev.yohobuy.com/img/me/index/user-avatar.png'); 11 +// 部分老用户没有头像,显示默认头像
  12 +avatar = $userAvatar.data('avatar');
  13 +myImage.src = avatar;
  14 +myImage.onload = function() {
  15 + $userAvatar.css('background-image', 'url(' + avatar + ')');
13 }; 16 };
@@ -47,15 +47,6 @@ function search() { @@ -47,15 +47,6 @@ function search() {
47 slidesPerView: 'auto' 47 slidesPerView: 'auto'
48 }); 48 });
49 49
50 - //优选  
51 - // recommendSwiper = new Swiper('#swiper-recommend', {  
52 - // slidesPerView: 'auto',  
53 - // grabCursor: true,  
54 - // slideElement: 'li',  
55 - // lazyLoading: true,  
56 - // watchSlidesVisibility: true  
57 - // });  
58 -  
59 searching = false; 50 searching = false;
60 end = true; 51 end = true;
61 loading.hideLoadingMask(); 52 loading.hideLoadingMask();
@@ -12,7 +12,6 @@ var goodsSwiper; @@ -12,7 +12,6 @@ var goodsSwiper;
12 require('./desc'); 12 require('./desc');
13 require('./comments-consults'); 13 require('./comments-consults');
14 require('./like'); 14 require('./like');
15 -require('../recommend-for-you.js');  
16 15
17 lazyLoad($('img.lazy')); 16 lazyLoad($('img.lazy'));
18 17
@@ -44,6 +44,6 @@ likeHammer.on('tap', function(e) { @@ -44,6 +44,6 @@ likeHammer.on('tap', function(e) {
44 44
45 }); 45 });
46 46
47 -$('#likeBtn').on('click', function(e) {  
48 - return false;  
49 -});  
  47 +// $('#likeBtn').on('click', function(e) {
  48 +// return false;
  49 +// });
@@ -25,6 +25,8 @@ @@ -25,6 +25,8 @@
25 height: pxToRem(126px); 25 height: pxToRem(126px);
26 border-radius: 50%; 26 border-radius: 50%;
27 border: pxToRem(6px) solid #a7a8a9; 27 border: pxToRem(6px) solid #a7a8a9;
  28 + background-image: image-url("me/index/user-avatar.png");
  29 + background-size: 100%;
28 } 30 }
29 31
30 .username { 32 .username {
@@ -17,6 +17,14 @@ @@ -17,6 +17,14 @@
17 } 17 }
18 height: 80rem / $pxConvertRem; 18 height: 80rem / $pxConvertRem;
19 border-bottom: 1px solid #e0e0e0; 19 border-bottom: 1px solid #e0e0e0;
  20 +
  21 + .user-avatar {
  22 + width: 100%;
  23 + height: 100%;
  24 + background-image: image-url("me/index/user-avatar.png");
  25 + background-size: 100%;
  26 + }
  27 +
20 span{ 28 span{
21 &:first-of-type{ 29 &:first-of-type{
22 color: #444; 30 color: #444;
@@ -39,6 +39,7 @@ @@ -39,6 +39,7 @@
39 } 39 }
40 40
41 .goods-consults-page { 41 .goods-consults-page {
  42 + background-color: #f0f0f0;
42 .goto-consult { 43 .goto-consult {
43 padding: 0 pxToRem(28px); 44 padding: 0 pxToRem(28px);
44 height: pxToRem(120px); 45 height: pxToRem(120px);
@@ -60,6 +61,7 @@ @@ -60,6 +61,7 @@
60 } 61 }
61 .goods-consults { 62 .goods-consults {
62 .consult-item { 63 .consult-item {
  64 + margin-top: pxToRem(30px);
63 padding: pxToRem(20px) pxToRem(28px); 65 padding: pxToRem(20px) pxToRem(28px);
64 background-color: #fff; 66 background-color: #fff;
65 .question { 67 .question {
@@ -99,10 +101,10 @@ @@ -99,10 +101,10 @@
99 } 101 }
100 } 102 }
101 } 103 }
102 - .gap-block {  
103 - min-height: 30rem/$pxConvertRem;  
104 - background-color: #f0f0f0;  
105 - } 104 + // .gap-block {
  105 + // min-height: 30rem/$pxConvertRem;
  106 + // background-color: #f0f0f0;
  107 + // }
106 } 108 }
107 109
108 .consult-form-page { 110 .consult-form-page {
@@ -235,35 +235,37 @@ $basicBtnC:#eb0313; @@ -235,35 +235,37 @@ $basicBtnC:#eb0313;
235 padding-right: pxToRem(28px); 235 padding-right: pxToRem(28px);
236 min-height: pxToRem(88px); 236 min-height: pxToRem(88px);
237 background-color: #fff; 237 background-color: #fff;
  238 + font-size: pxToRem(22px);
  239 + color: #999999;
  240 + border-bottom: 1px solid $borderC;
238 .icons-item { 241 .icons-item {
239 float: left; 242 float: left;
240 width: 33.3%; 243 width: 33.3%;
241 height: pxToRem(88px); 244 height: pxToRem(88px);
  245 + margin: 0;
242 span { 246 span {
  247 + vertical-align: middle;
243 display: inline-block; 248 display: inline-block;
244 line-height: pxToRem(88px); 249 line-height: pxToRem(88px);
245 } 250 }
246 - .vip-img {  
247 - padding-right: pxToRem(22px);  
248 - .img { 251 + .vip-img {
249 width: pxToRem(53px); 252 width: pxToRem(53px);
250 height: pxToRem(32px); 253 height: pxToRem(32px);
251 - }  
252 - &:nth-child(3n-3) .img {  
253 - background: image-url('product/silver.png') no-repeat;  
254 - }  
255 - &:nth-child(3n-2) .img {  
256 - background: image-url('product/golden.png') no-repeat;  
257 - }  
258 - &:nth-child(3n-1) .img {  
259 - background: image-url('product/platinum.png') no-repeat;  
260 - } 254 + }
  255 + &:nth-child(3) .vip-img{
  256 + background: image-url('product/silver.png') no-repeat;
  257 + }
  258 + &:nth-child(2) .vip-img{
  259 + background: image-url('product/golden.png') no-repeat;
  260 + }
  261 + &:nth-child(1) .vip-img{
  262 + background: image-url('product/platinum.png') no-repeat;
261 } 263 }
262 &:first-child { 264 &:first-child {
263 - float: left; 265 + text-align: left;
264 } 266 }
265 &:last-child { 267 &:last-child {
266 - float: right; 268 + text-align: right;
267 } 269 }
268 } 270 }
269 } 271 }
@@ -45,20 +45,17 @@ @@ -45,20 +45,17 @@
45 line-height: 1; 45 line-height: 1;
46 46
47 span { 47 span {
48 - display: block; 48 + display: inline-block;
49 // chrome 最小支持12px, 设计图是 10px ,用CSS3变换 49 // chrome 最小支持12px, 设计图是 10px ,用CSS3变换
50 @include transform(scale(0.875)); 50 @include transform(scale(0.875));
51 } 51 }
52 52
53 .sale-price { 53 .sale-price {
54 color: #d9134f; 54 color: #d9134f;
55 - margin-left: pxToRem(-10px); 55 + margin-right: pxToRem(8px);
56 } 56 }
57 57
58 .old-price { 58 .old-price {
59 - position: absolute;  
60 - top: 0;  
61 - right: pxToRem(-4px);  
62 color: #b0b0b0; 59 color: #b0b0b0;
63 text-decoration: line-through; 60 text-decoration: line-through;
64 } 61 }
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 <div class="my-header"> 3 <div class="my-header">
4 {{#isLogin}} 4 {{#isLogin}}
5 <a class="user-info" href="/home/mydetails"> 5 <a class="user-info" href="/home/mydetails">
6 - <img class="user-avatar" src="{{head_ico}}"> 6 + <span class="user-avatar" data-avatar="{{head_ico}}"></span>
7 <span class="username">{{profile_name}}</span> 7 <span class="username">{{profile_name}}</span>
8 {{#vip_info}} 8 {{#vip_info}}
9 <span class="vip-icon vip-{{next_level}}"></span> 9 <span class="vip-icon vip-{{next_level}}"></span>
1 {{> layout/header}} 1 {{> layout/header}}
2 <div class="goods-comments-page yoho-page"> 2 <div class="goods-comments-page yoho-page">
3 {{#comments}} 3 {{#comments}}
4 - <div class="goods-comments"> 4 + <div class="goods-comments" id="goods-comments">
5 {{#list}} 5 {{#list}}
6 <div class="comment-item"> 6 <div class="comment-item">
7 <span class="user-name"> 7 <span class="user-name">
@@ -20,7 +20,10 @@ @@ -20,7 +20,10 @@
20 {{/list}} 20 {{/list}}
21 </div> 21 </div>
22 {{/comments}} 22 {{/comments}}
23 - 23 +
  24 + {{#if loadmore}}
  25 + <input id="loadMoreUrl" type="hidden" value={{loadMoreUrl}}>
  26 + {{/if}}
24 </div> 27 </div>
25 28
26 {{> layout/footer}} 29 {{> layout/footer}}
@@ -3,12 +3,11 @@ @@ -3,12 +3,11 @@
3 <div class="goto-consult"> 3 <div class="goto-consult">
4 <i class="iconfont consult-logo">&#xe639;</i> 4 <i class="iconfont consult-logo">&#xe639;</i>
5 <span>我要咨询</span> 5 <span>我要咨询</span>
6 - <a href="/product/detail/consultform" class="iconfont enter-consult-page">&#xe604;</a> 6 + <a href="/consultform" class="iconfont enter-consult-page">&#xe604;</a>
7 </div> 7 </div>
8 {{# consults}} 8 {{# consults}}
9 - <div class="goods-consults"> 9 + <div class="goods-consults" id="goods-consults">
10 {{#list}} 10 {{#list}}
11 - <div class="gap-block"></div>  
12 <div class="consult-item"> 11 <div class="consult-item">
13 <div class="question"> 12 <div class="question">
14 <span class="iconfont">&#xe639;</span> 13 <span class="iconfont">&#xe639;</span>
@@ -27,5 +26,9 @@ @@ -27,5 +26,9 @@
27 {{/list}} 26 {{/list}}
28 </div> 27 </div>
29 {{/ consults}} 28 {{/ consults}}
  29 +
  30 + {{#if loadmore}}
  31 + <input id="loadMoreUrl" type="hidden" value={{loadMoreUrl}}>
  32 + {{/if}}
30 </div> 33 </div>
31 {{> layout/footer}} 34 {{> layout/footer}}
@@ -52,20 +52,20 @@ @@ -52,20 +52,20 @@
52 {{/ periodOfMarket}} 52 {{/ periodOfMarket}}
53 </div> 53 </div>
54 54
55 - <!-- {{# vipLevel}} 55 + {{# vipLevel}}
56 <ul class="vip-level clearfix"> 56 <ul class="vip-level clearfix">
57 {{# list}} 57 {{# list}}
58 <li class="icons-item"> 58 <li class="icons-item">
59 - <span class="vip-img">  
60 - <div class="img" alt="" style="background-size:cover;"></div> 59 + <span class="vip-img" style="background-size:cover;">
  60 + <!-- <div class="img" alt="" style="background-size:cover;"></div> -->
61 </span> 61 </span>
62 <span class="vip-price">{{text}}</span> 62 <span class="vip-price">{{text}}</span>
63 </li> 63 </li>
64 {{/ list}} 64 {{/ list}}
65 </ul> 65 </ul>
66 - {{/vipLevel}} --> 66 + {{/vipLevel}}
67 67
68 - {{# vipLevel}} 68 + <!-- {{# vipLevel}}
69 <div class="vipLevel"> 69 <div class="vipLevel">
70 {{# list}} 70 {{# list}}
71 <span class="vip-img"> 71 <span class="vip-img">
@@ -74,7 +74,7 @@ @@ -74,7 +74,7 @@
74 <span class="vip-price">{{text}}</span> 74 <span class="vip-price">{{text}}</span>
75 {{/ list}} 75 {{/ list}}
76 </div> 76 </div>
77 - {{/ vipLevel}} 77 + {{/ vipLevel}} -->
78 78
79 {{# goodsDiscount}} 79 {{# goodsDiscount}}
80 <div class="goodsDiscount"> 80 <div class="goodsDiscount">
@@ -132,7 +132,7 @@ @@ -132,7 +132,7 @@
132 <a href="javascript:;" class="sold-out">已售罄</a> 132 <a href="javascript:;" class="sold-out">已售罄</a>
133 {{/if}} 133 {{/if}}
134 134
135 - <a href="#" id="likeBtn" class="favorite iconfont {{#isCollect}}liked{{/isCollect}}">&#xe605;</a> 135 + <a href="javascript:;" id="likeBtn" class="favorite iconfont {{#isCollect}}liked{{/isCollect}}">&#xe605;</a>
136 </div> 136 </div>
137 {{/cartInfo}} 137 {{/cartInfo}}
138 138