Authored by biao

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

No preview for this file type
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" > 2 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3 <svg xmlns="http://www.w3.org/2000/svg"> 3 <svg xmlns="http://www.w3.org/2000/svg">
4 <metadata> 4 <metadata>
5 -Created by FontForge 20120731 at Mon Nov 23 16:04:11 2015 5 +Created by FontForge 20120731 at Sat Dec 5 16:26:44 2015
6 By Ads 6 By Ads
7 </metadata> 7 </metadata>
8 <defs> 8 <defs>
@@ -19,7 +19,7 @@ Created by FontForge 20120731 at Mon Nov 23 16:04:11 2015 @@ -19,7 +19,7 @@ Created by FontForge 20120731 at Mon Nov 23 16:04:11 2015
19 bbox="-0.75 -224 3943 833" 19 bbox="-0.75 -224 3943 833"
20 underline-thickness="50" 20 underline-thickness="50"
21 underline-position="-100" 21 underline-position="-100"
22 - unicode-range="U+0078-E63E" 22 + unicode-range="U+0078-E63F"
23 /> 23 />
24 <missing-glyph horiz-adv-x="374" 24 <missing-glyph horiz-adv-x="374"
25 d="M34 0v682h272v-682h-272zM68 34h204v614h-204v-614z" /> 25 d="M34 0v682h272v-682h-272zM68 34h204v614h-204v-614z" />
@@ -252,5 +252,10 @@ t-3.5 -16.5t-5.5 -16.5t-7.5 -15.5t-10 -15t-11.5 -14t-13 -12.5t-14.5 -11.5t-15.5 @@ -252,5 +252,10 @@ t-3.5 -16.5t-5.5 -16.5t-7.5 -15.5t-10 -15t-11.5 -14t-13 -12.5t-14.5 -11.5t-15.5
252 l-47 -98q-3 -6 -7 -11t-10 -8t-12.5 -4t-13 0.5t-12.5 5.5q-8 3 -13.5 9t-8 13.5t-1.5 16.5t5 16l47 99q23 42 62 64.5t83 16.5q45 -7 77 -39l141 -141q29 -28 38 -65t-4 -75q-17 -43 -34 -60l-72 -73q-5 -4 -9.5 -7t-9.5 -4t-11 -1zM602 87q-4 0 -9 1.5t-8 2.5t-9 4 252 l-47 -98q-3 -6 -7 -11t-10 -8t-12.5 -4t-13 0.5t-12.5 5.5q-8 3 -13.5 9t-8 13.5t-1.5 16.5t5 16l47 99q23 42 62 64.5t83 16.5q45 -7 77 -39l141 -141q29 -28 38 -65t-4 -75q-17 -43 -34 -60l-72 -73q-5 -4 -9.5 -7t-9.5 -4t-11 -1zM602 87q-4 0 -9 1.5t-8 2.5t-9 4
253 q-77 58 -154 128q-76 77 -128 154q-9 12 -6 29.5t19 30.5q6 3 13 5t13.5 2t13 -2t11.5 -5.5t9 -8.5q15 -21 27 -36.5t27.5 -35t32 -37t32.5 -32.5q14 -12 21 -18.5t19.5 -17.5t20.5 -18t19.5 -17t20.5 -17.5t19.5 -15.5t20.5 -15q11 -7 16 -17t3 -21.5t-10 -21.5 253 q-77 58 -154 128q-76 77 -128 154q-9 12 -6 29.5t19 30.5q6 3 13 5t13.5 2t13 -2t11.5 -5.5t9 -8.5q15 -21 27 -36.5t27.5 -35t32 -37t32.5 -32.5q14 -12 21 -18.5t19.5 -17.5t20.5 -18t19.5 -17t20.5 -17.5t19.5 -15.5t20.5 -15q11 -7 16 -17t3 -21.5t-10 -21.5
254 q-6 -21 -34 -21z" /> 254 q-6 -21 -34 -21z" />
  255 + <glyph glyph-name="uniE63F" unicode="&#xe63f;" horiz-adv-x="1025"
  256 +d="M512 -66q-10 0 -24.5 -0.5t-25 -1t-24 0t-24.5 1.5l-222 -146q0 227 5 243q-164 117 -192 282q-5 30 -5 60q0 122 68.5 223t186 158.5t257.5 57.5q104 0 199 -34t163.5 -92.5t109 -140t40.5 -172.5q0 -167 -126 -290q-124 -121 -312 -144q-37 -5 -74 -5zM512 763
  257 +q-91 0 -176.5 -31.5t-148.5 -83.5t-100.5 -124.5t-37.5 -150.5q0 -95 53 -179t142 -138v-170l146 97q16 -3 35.5 -4t49 0t37.5 1q41 0 81 6.5t77 18.5t72 29.5t65 39.5t56.5 47.5t47 55t35 61t22 66t7.5 69.5q0 104 -63.5 194.5t-170.5 143t-229 52.5zM768 300
  258 +q-27 0 -45.5 18.5t-18.5 45.5t18.5 45.5t45.5 18.5t45.5 -18.5t18.5 -45.5t-18.5 -45.5t-45.5 -18.5zM512 300q-27 0 -45.5 18.5t-18.5 45.5t18.5 45.5t45.5 18.5t45.5 -18.5t18.5 -45.5t-18.5 -45.5t-45.5 -18.5zM256 300q-27 0 -45.5 18.5t-18.5 45.5t18.5 45.5t45.5 18.5
  259 +t45.5 -18.5t18.5 -45.5t-18.5 -45.5t-45.5 -18.5z" />
255 </font> 260 </font>
256 </defs></svg> 261 </defs></svg>
No preview for this file type
No preview for this file type
@@ -114,7 +114,7 @@ $page.on('touchstart', '.del-icon', function() { @@ -114,7 +114,7 @@ $page.on('touchstart', '.del-icon', function() {
114 }); 114 });
115 setTimeout(function() { 115 setTimeout(function() {
116 window.history.go(0); 116 window.history.go(0);
117 - }, 1000); 117 + }, 2500);
118 } 118 }
119 }, 119 },
120 complete: function() { 120 complete: function() {
@@ -18,13 +18,14 @@ var introUrl = $('#introUrl').val(), @@ -18,13 +18,14 @@ var introUrl = $('#introUrl').val(),
18 var sizeSwiper, 18 var sizeSwiper,
19 refSwiper; 19 refSwiper;
20 20
21 -require('../recommend-for-you.js');  
22 -  
23 //判断是否要显示向左滑动提示 21 //判断是否要显示向左滑动提示
24 function hiddenTips($ele) { 22 function hiddenTips($ele) {
  23 + var offsetContainer,
  24 + offsetLastColumn;
  25 +
25 if ($ele.length > 0) { 26 if ($ele.length > 0) {
26 - var offsetContainer = $ele[0].getBoundingClientRect().right;  
27 - var offsetLastColumn = $ele.find('.swiper-slide:last-child')[0].getBoundingClientRect().right; 27 + offsetContainer = $ele[0].getBoundingClientRect().right;
  28 + offsetLastColumn = $ele.find('.swiper-slide:last-child')[0].getBoundingClientRect().right;
28 29
29 30
30 if (offsetLastColumn - offsetContainer < 0) { 31 if (offsetLastColumn - offsetContainer < 0) {
@@ -17,6 +17,7 @@ var goodsDiscountEl = document.getElementById('goodsDiscount'), @@ -17,6 +17,7 @@ var goodsDiscountEl = document.getElementById('goodsDiscount'),
17 17
18 require('./desc'); 18 require('./desc');
19 require('./comments-consults'); 19 require('./comments-consults');
  20 +require('../recommend-for-you-product-desc');
20 21
21 //add extra marign-bottom for footer to show the yoho copyright 22 //add extra marign-bottom for footer to show the yoho copyright
22 function showFooter() { 23 function showFooter() {
1 -/**  
2 - * 商品详情 --滚动页面加载  
3 - * @author: Lynnic  
4 - * @date: 2015/11/25  
5 - */  
6 -  
7 -// var $ = require('jquery'),  
8 -// loading = require('../../plugin/loading'),  
9 -// tip = require('../../plugin/tip');  
10 -  
11 -// var loadMoreUrl = $('#loadMoreUrl').val(),  
12 -// $commentsDiv = $('#goods-comments'),  
13 -// $consultsDiv = $('#goods-consults'),  
14 -// winH = $(window).height(),  
15 -// searching = false,  
16 -// end = false;  
17 -  
18 -// var jsonObj;  
19 -  
20 -// //插入评论列表底部  
21 -// function insertCommentsDiv(json) {  
22 -// var html = '';  
23 -// var i;  
24 -  
25 -  
26 -// for (i = 0; i < json.length; i++) {  
27 -// html += '<div class="comment-item">';  
28 -// html += '<span class="user-name">' + json[i].userName + '</span>';  
29 -// html += '<span class="goods-spec">' + json[i].desc + '</span>';  
30 -// html += '<span class="goods-spec">' + json[i].content + '</span>';  
31 -// html += '<span class="goods-spec">' + json[i].time + '</span>';  
32 -// }  
33 -// $commentsDiv.append(html);  
34 -// }  
35 -  
36 -// //插入咨询列表底部  
37 -// function insertConsultsDiv(json) {  
38 -// var html = '';  
39 -// var i;  
40 -  
41 -  
42 -// for (i = 0; i < json.length; i++) {  
43 -// html += '<div class="consult-item"> ';  
44 -// html += '<div class="question"> ';  
45 -// html += '<span class="iconfont">&#xe639;</span> ';  
46 -// html += '<p> ';  
47 -// html += json[i].question + '<br> ';  
48 -// html += '<span class="time">' + json[i].time + '</span> ';  
49 -// html += '</p> ';  
50 -// html += '</div> ';  
51 -  
52 -// html += '<div class="answer"> ';  
53 -// html += '<span class="iconfont">&#xe63c;</span> ';  
54 -// html += '<p>' + json[i].answer + '</p> ';  
55 -// html += '</div> ';  
56 -// html += '</div> ';  
57 -// }  
58 -// $consultsDiv.append(html);  
59 -// }  
60 -  
61 -// function search() {  
62 -// if (searching || end) {  
63 -// return;  
64 -// }  
65 -// searching = true;  
66 -  
67 -// loading.showLoadingMask();  
68 -  
69 -// $.ajax({  
70 -// type: 'GET',  
71 -// url: loadMoreUrl,  
72 -// success: function(data) {  
73 -// if (data.length > 0) {  
74 -// jsonObj = JSON.parse(data);  
75 -// if ($commentsDiv.length > 0) {  
76 -// insertCommentsDiv(jsonObj);  
77 -// } else if ($consultsDiv.length > 0) {  
78 -// insertConsultsDiv(jsonObj);  
79 -// }  
80 -// }  
81 -// searching = false;  
82 -// end = true;  
83 -// loading.hideLoadingMask();  
84 -// },  
85 -// error: function() {  
86 -// tip.show('网络断开连接了~');  
87 -// searching = false;  
88 -// loading.hideLoadingMask();  
89 -// }  
90 -// });  
91 -// }  
92 -  
93 -  
94 -// function scrollHandler() {  
95 -// if (!end || $(window).scrollTop() + winH >= $(document).height() - 50) {  
96 -// search();  
97 -// }  
98 -// }  
99 -  
100 -// //srcoll to load more  
101 -// $(window).scroll(function() {  
102 -// window.requestAnimationFrame(scrollHandler);  
103 -// });  
@@ -8,6 +8,6 @@ require('./newsale/newarrival'); @@ -8,6 +8,6 @@ require('./newsale/newarrival');
8 require('./newsale/discount'); 8 require('./newsale/discount');
9 require('./list'); 9 require('./list');
10 require('./detail/detail'); 10 require('./detail/detail');
11 -require('./detail/loadmore');  
12 require('./detail/consultform'); 11 require('./detail/consultform');
13 -require('./newsale/hot-rank');  
  12 +require('./newsale/hot-rank');
  13 +
1 var $ = require('jquery'), 1 var $ = require('jquery'),
2 - Hammer = require('yoho.hammer'),  
3 Swiper = require('yoho.iswiper'), 2 Swiper = require('yoho.iswiper'),
4 lazyLoad = require('yoho.lazyload'), 3 lazyLoad = require('yoho.lazyload'),
5 loading = require('../../plugin/loading'); 4 loading = require('../../plugin/loading');
6 5
7 var page = 1, 6 var page = 1,
8 winH, 7 winH,
9 - hotnav,  
10 listTop, 8 listTop,
11 navSwiper, 9 navSwiper,
12 notab = 0, 10 notab = 0,
@@ -15,42 +13,6 @@ var page = 1, @@ -15,42 +13,6 @@ var page = 1,
15 hotrankNav, 13 hotrankNav,
16 noResult = '<p class="no-result">未找到相关搜索结果</p>'; 14 noResult = '<p class="no-result">未找到相关搜索结果</p>';
17 15
18 -// var renderRank = {  
19 -// errMsg: '<p class="no-result">未找到相关搜索结果</p>',  
20 -// navSelector: '.goods-nav',  
21 -// rankSelector: '#hotRank',  
22 -// navHTML: null,  
23 -// data: null,  
24 -// inited: 0,  
25 -// setData: function(data) {  
26 -// this.data = data;  
27 -// },  
28 -// showDataEmptyMsg: function() {  
29 -// $(this.rankSelector).append(this.errMsg);  
30 -// },  
31 -// isDataEmpty: function() {  
32 -// if (this.data.indexOf('>') === -1) {  
33 -// return true;  
34 -// } else {  
35 -// return false;  
36 -// }  
37 -// },  
38 -// appendData: function() {  
39 -// if (!this.inited) {  
40 -// this.inited = 1;  
41 -// }  
42 -// $(this.rankSelector).append(this.data);  
43 -// },  
44 -// render: function(data) {  
45 -// this.setData(data);  
46 -// if (!this.isDataEmpty()) {  
47 -// this.appendData();  
48 -// } else {  
49 -// this.showDataEmptyMsg();  
50 -// }  
51 -// }  
52 -  
53 -// };  
54 16
55 function hotrank(page, sort, tabId, notab) { 17 function hotrank(page, sort, tabId, notab) {
56 loading.showLoadingMask(); 18 loading.showLoadingMask();
@@ -64,27 +26,6 @@ function hotrank(page, sort, tabId, notab) { @@ -64,27 +26,6 @@ function hotrank(page, sort, tabId, notab) {
64 notab: notab 26 notab: notab
65 }, 27 },
66 success: function(data) { 28 success: function(data) {
67 -  
68 - // if (page === 1) {  
69 - // $('.no-result').remove();  
70 - // $('.rank-main').remove();  
71 - // }  
72 -  
73 - // if (notab === 1) {  
74 - // if (data === ' ' && $('.rank-main').length < 1) {  
75 - // var hotrankNav = $('.goods-nav').prop("outerHTML");  
76 -  
77 - // $('#hotRank').html(hotrankNav + noResult);  
78 - // } else {  
79 - // $('#hotRank').append(data);  
80 - // }  
81 - // } else {  
82 - // if (data === ' ') {  
83 - // $('#hotRank').html(noResult);  
84 - // } else {  
85 - // $('#hotRank').append(data);  
86 - // }  
87 - // }  
88 if (data === ' ') { 29 if (data === ' ') {
89 if ($('.rank-main').length < 1 && $('.goods-nav').length < 1) { 30 if ($('.rank-main').length < 1 && $('.goods-nav').length < 1) {
90 $('#hotRank').html(noResult); 31 $('#hotRank').html(noResult);
@@ -100,11 +41,6 @@ function hotrank(page, sort, tabId, notab) { @@ -100,11 +41,6 @@ function hotrank(page, sort, tabId, notab) {
100 $('.rank-main').remove(); 41 $('.rank-main').remove();
101 $('#hotRank').append(data); 42 $('#hotRank').append(data);
102 } 43 }
103 -  
104 - // renderRank.render(data);  
105 -  
106 -  
107 -  
108 lazyLoad($('img.lazy')); 44 lazyLoad($('img.lazy'));
109 $('.rank-main ul li:gt(2)').find('.item-content i').removeClass('top'); 45 $('.rank-main ul li:gt(2)').find('.item-content i').removeClass('top');
110 winH = $(window).height(); 46 winH = $(window).height();
@@ -136,28 +72,35 @@ function scrollHandler() { @@ -136,28 +72,35 @@ function scrollHandler() {
136 hotrank(page, sort, id, notab); 72 hotrank(page, sort, id, notab);
137 } 73 }
138 74
139 -//srcoll to load more  
140 $(window).scroll(function() { 75 $(window).scroll(function() {
141 window.requestAnimationFrame(scrollHandler); 76 window.requestAnimationFrame(scrollHandler);
142 }); 77 });
143 78
144 hotrank(page, sort, id, notab); 79 hotrank(page, sort, id, notab);
145 -hotnav = new Hammer(document.getElementById('hotRank'));  
146 -hotnav.on('tap', function(e) { 80 +$('#hotRank').on('touchend touchcancel', function(e) {
147 var ev = ev || window.event; 81 var ev = ev || window.event;
148 var target = ev.target || ev.srcElement; 82 var target = ev.target || ev.srcElement;
149 83
150 if (target.nodeName.toLowerCase() === 'span') { 84 if (target.nodeName.toLowerCase() === 'span') {
151 - $('.s-goods-nav .nav-item').removeClass('active');  
152 target.parentNode.className = 'active ' + target.parentNode.className; 85 target.parentNode.className = 'active ' + target.parentNode.className;
153 id = target.getAttribute('data-id') ? target.getAttribute('data-id') : ''; 86 id = target.getAttribute('data-id') ? target.getAttribute('data-id') : '';
154 sort = target.getAttribute('data-sort') ? target.getAttribute('data-sort') : ''; 87 sort = target.getAttribute('data-sort') ? target.getAttribute('data-sort') : '';
155 page = 1; 88 page = 1;
156 -  
157 - // notab = renderRank.inited;  
158 notab = 1; 89 notab = 1;
159 -  
160 -  
161 hotrank(page, sort, id, notab); 90 hotrank(page, sort, id, notab);
162 } 91 }
163 }); 92 });
  93 +$('#hotRank').bind('contextmenu', function(e) {
  94 + return false;
  95 +});
  96 +$('#hotRank').on('touchstart', function(e) {
  97 + var ev = ev || window.event;
  98 + var target = ev.target || ev.srcElement;
  99 +
  100 + if (target.nodeName.toLowerCase() === 'span') {
  101 + target.parentNode.className = 'active ' + target.parentNode.className;
  102 + }
  103 +}).on('touchend touchcancel', function() {
  104 + $('.s-goods-nav .nav-item').removeClass('active');
  105 +});
  106 +
  1 +/**
  2 + * 为您优选
  3 + * @author: liangzhifeng<zhifeng.liang@yoho.cn>
  4 + * @date: 2015/11/16
  5 + */
  6 +
  7 +
  8 +var Swiper = require('yoho.iswiper'),
  9 + $ = require('jquery');
  10 +
  11 +var recommendSwiper,
  12 + $recommendForYou = $('.recommend-for-you'),
  13 + preferenceUrl = $('#preferenceUrl').val();
  14 +
  15 +if (preferenceUrl) {
  16 + $.get(preferenceUrl).then(function(html) {
  17 + $recommendForYou.html(html).show();
  18 + if ($('#swiper-recommend').length) {
  19 + recommendSwiper = new Swiper('#swiper-recommend', {
  20 + slidesPerView: 'auto',
  21 + grabCursor: true,
  22 + slideElement: 'a',
  23 + lazyLoading: true,
  24 + watchSlidesVisibility: true
  25 + });
  26 + }
  27 + }).fail(function() {
  28 + $recommendForYou.hide();
  29 + });
  30 +}
@@ -131,13 +131,14 @@ @@ -131,13 +131,14 @@
131 overflow: hidden; 131 overflow: hidden;
132 132
133 li { 133 li {
134 - margin: 0 0 0 (50rem / $pxConvertRem); 134 + margin: 0 (10rem / $pxConvertRem);
  135 + padding:0 (15rem / $pxConvertRem);
135 width: auto; 136 width: auto;
136 - height: 95%; 137 + height: 100%;
137 color: #999; 138 color: #999;
138 &.active{ 139 &.active{
139 color: #000; 140 color: #000;
140 - border-bottom:2px solid #000; 141 + background-color:#e0e0e0;
141 } 142 }
142 a { 143 a {
143 padding: 0; 144 padding: 0;
@@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
12 {{# is_discount}} 12 {{# is_discount}}
13 <p class="good-tag sale-tag">SALE</p> 13 <p class="good-tag sale-tag">SALE</p>
14 {{/ is_discount}} 14 {{/ is_discount}}
15 - {{# is_yohoood}} 15 + {{# is_yohood}}
16 <div class="good-tag yohood-tag">新品节</div> 16 <div class="good-tag yohood-tag">新品节</div>
17 {{/ is_yohoood}} 17 {{/ is_yohoood}}
18 {{# is_limited}} 18 {{# is_limited}}
@@ -136,6 +136,9 @@ @@ -136,6 +136,9 @@
136 {{#if id}} 136 {{#if id}}
137 <input id="productId" type="hidden" value="{{id}}"> 137 <input id="productId" type="hidden" value="{{id}}">
138 {{/if}} 138 {{/if}}
139 - 139 + {{#if preferenceUrl}}
  140 + <input id="preferenceUrl" type="hidden" value="{{preferenceUrl}}">
  141 + {{/if}}
  142 +
140 </div> 143 </div>
141 {{> layout/footer}} 144 {{> layout/footer}}
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 <ul class="swiper-wrapper clearfix"> 3 <ul class="swiper-wrapper clearfix">
4 {{# tabs}} 4 {{# tabs}}
5 {{# title}} 5 {{# title}}
6 - <li class="swiper-slide nav-item {{#if @first}} active{{/if}}"> 6 + <li class="swiper-slide nav-item">
7 <span data-sort="{{ params}}" data-id="{{ id}}" >{{ name}}</span> 7 <span data-sort="{{ params}}" data-id="{{ id}}" >{{ name}}</span>
8 </li> 8 </li>
9 {{/ title}} 9 {{/ title}}
@@ -44,7 +44,7 @@ @@ -44,7 +44,7 @@
44 </div> 44 </div>
45 45
46 <div class="answer"> 46 <div class="answer">
47 - <span class="iconfont">&#xe63d;</span> 47 + <span class="iconfont">&#xe63f;</span>
48 <p>{{answer}}</p> 48 <p>{{answer}}</p>
49 </div> 49 </div>
50 {{/ consults}} 50 {{/ consults}}
@@ -56,7 +56,7 @@ @@ -56,7 +56,7 @@
56 </div> 56 </div>
57 {{else}} 57 {{else}}
58 <div class="consult-content-main content-main no-item"> 58 <div class="consult-content-main content-main no-item">
59 - <span class="iconfont">&#xe63d;</span>暂无咨询 59 + <span class="iconfont">&#xe63f;</span>暂无咨询
60 </div> 60 </div>
61 <div class="consult-content-footer"> 61 <div class="consult-content-footer">
62 <a href="{{link}}"> 62 <a href="{{link}}">
@@ -46,7 +46,8 @@ class HomeController extends AbstractAction @@ -46,7 +46,8 @@ class HomeController extends AbstractAction
46 $data = array( 46 $data = array(
47 'myIndexPage' => true, 47 'myIndexPage' => true,
48 'showDownloadApp' => true, 48 'showDownloadApp' => true,
49 - 'pageFooter' => true 49 + 'pageFooter' => true,
  50 + 'cartUrl' => Helpers::url('/cart/index/index', null),
50 ); 51 );
51 $uid = $this->getUid(true); 52 $uid = $this->getUid(true);
52 if ($uid) { 53 if ($uid) {