Authored by wangqing

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

@@ -838,6 +838,14 @@ @@ -838,6 +838,14 @@
838 }, 838 },
839 ... 839 ...
840 ], 840 ],
  841 + defaultSizes: [
  842 + {
  843 + numZero: true,
  844 + name: 'X',
  845 + numStr: '0/10'
  846 + },
  847 + ...
  848 + ]
841 849
842 totalNum: 20 850 totalNum: 20
843 } 851 }
@@ -18,7 +18,6 @@ var $chosePanel = $('#chose-panel'), @@ -18,7 +18,6 @@ var $chosePanel = $('#chose-panel'),
18 $chosed, 18 $chosed,
19 $imgsThumb, 19 $imgsThumb,
20 $leftNum, 20 $leftNum,
21 - $leftNumHtml,  
22 leftNum, 21 leftNum,
23 confirming, 22 confirming,
24 curColorIndex, 23 curColorIndex,
@@ -32,7 +31,6 @@ var $chosePanel = $('#chose-panel'), @@ -32,7 +31,6 @@ var $chosePanel = $('#chose-panel'),
32 queryString, 31 queryString,
33 $yohoPage = $('.yoho-page'); 32 $yohoPage = $('.yoho-page');
34 33
35 -  
36 //初始化购物车面板显示 34 //初始化购物车面板显示
37 function init() { 35 function init() {
38 hasChooseColor = false; 36 hasChooseColor = false;
@@ -43,8 +41,6 @@ function init() { @@ -43,8 +41,6 @@ function init() {
43 $allChoseItems = $('.chose-items'); 41 $allChoseItems = $('.chose-items');
44 $sizeRowList = $('.size-list ul'); 42 $sizeRowList = $('.size-list ul');
45 $leftNum = $('#left-num'); 43 $leftNum = $('#left-num');
46 - $leftNumHtml =  
47 - $sizeRowList.eq(0).toggleClass('hide');  
48 } 44 }
49 45
50 function checkColorSizeNum() { 46 function checkColorSizeNum() {
@@ -34,16 +34,22 @@ @@ -34,16 +34,22 @@
34 <div class="size-list block-list"> 34 <div class="size-list block-list">
35 <span>尺码</span> 35 <span>尺码</span>
36 {{# sizes}} 36 {{# sizes}}
37 -  
38 - <ul class="size-row clearfix hide">  
39 - {{# size}}  
40 - <li class="block {{#if chosed}}chosed{{/if}} {{#unless sizeNum}}zero-stock{{/unless}}" data-id="{{id}}" data-colorid="{{colorId}}" data-num="{{sizeNum}}" data-numstr="{{colorNumStr}}" data-skuid="{{skuId}}" data-goodid="{{goodsId}}">  
41 - {{name}}  
42 - </li>  
43 - {{/ size}}  
44 - </ul>  
45 - 37 + <ul class="size-row clearfix hide">
  38 + {{# size}}
  39 + <li class="block {{#if chosed}}chosed{{/if}} {{#unless sizeNum}}zero-stock{{/unless}}" data-id="{{id}}" data-colorid="{{colorId}}" data-num="{{sizeNum}}" data-numstr="{{colorNumStr}}" data-skuid="{{skuId}}" data-goodid="{{goodsId}}">
  40 + {{name}}
  41 + </li>
  42 + {{/ size}}
  43 + </ul>
46 {{/ sizes}} 44 {{/ sizes}}
  45 +
  46 + {{#if defaultSizes}}
  47 + <ul class="size-row clearfix default-size">
  48 + {{#each defaultSizes}}
  49 + <li class="block {{#if numZero}}zero-stock{{/if}}" data-numstr="{{numStr}}">{{name}}</li>
  50 + {{/each}}
  51 + </ul>
  52 + {{/if}}
47 </div> 53 </div>
48 <p> 54 <p>
49 <div class="num"> 55 <div class="num">
@@ -13,6 +13,7 @@ @@ -13,6 +13,7 @@
13 <script> 13 <script>
14 seajs.use(['js/product/list', 'js/product/product'], function (list, product) { 14 seajs.use(['js/product/list', 'js/product/product'], function (list, product) {
15 15
  16 + product.init(5);
16 window.onresize = function () { 17 window.onresize = function () {
17 setTimeout(function () { 18 setTimeout(function () {
18 product.init(5); 19 product.init(5);
@@ -28,6 +29,7 @@ @@ -28,6 +29,7 @@
28 <script> 29 <script>
29 seajs.use(['js/product/list', 'js/product/product'], function (list, product) { 30 seajs.use(['js/product/list', 'js/product/product'], function (list, product) {
30 31
  32 + product.init(4);
31 window.onresize = function () { 33 window.onresize = function () {
32 setTimeout(function () { 34 setTimeout(function () {
33 product.init(4); 35 product.init(4);
@@ -26,7 +26,7 @@ @@ -26,7 +26,7 @@
26 26
27 <div class="attr-content clearfix"> 27 <div class="attr-content clearfix">
28 {{#each channel}} 28 {{#each channel}}
29 - <a class="attr" href="{{href}}"> 29 + <a class="attr {{#if checked}}checked{{/if}}" href="{{href}}">
30 {{name}} 30 {{name}}
31 </a> 31 </a>
32 {{/each}} 32 {{/each}}
@@ -42,7 +42,7 @@ @@ -42,7 +42,7 @@
42 <ul class="sort-pre clearfix"> 42 <ul class="sort-pre clearfix">
43 {{#each sort}} 43 {{#each sort}}
44 <li> 44 <li>
45 - <span class="attr"> 45 + <span class="attr {{#if checked}}checked{{/if}}">
46 {{name}} 46 {{name}}
47 </span> 47 </span>
48 </li> 48 </li>
@@ -53,7 +53,7 @@ @@ -53,7 +53,7 @@
53 {{#each sort}} 53 {{#each sort}}
54 <ul class="sort-sub clearfix hide"> 54 <ul class="sort-sub clearfix hide">
55 {{#each sub}} 55 {{#each sub}}
56 - <li class="attr"> 56 + <li class="attr {{#if checked}}checked{{/if}}">
57 <a href="{{href}}">{{name}}</a> 57 <a href="{{href}}">{{name}}</a>
58 </li> 58 </li>
59 {{/each}} 59 {{/each}}
@@ -71,7 +71,7 @@ @@ -71,7 +71,7 @@
71 <div class="attr-content"> 71 <div class="attr-content">
72 <ul class="default clearfix"> 72 <ul class="default clearfix">
73 {{# default}} 73 {{# default}}
74 - <li class="attr"> 74 + <li class="attr {{#if checked}}checked{{/if}}">
75 <a href="{{href}}" title="{{name}}">{{name}}</a> 75 <a href="{{href}}" title="{{name}}">{{name}}</a>
76 </li> 76 </li>
77 {{/ default}} 77 {{/ default}}
@@ -82,7 +82,7 @@ @@ -82,7 +82,7 @@
82 <em>更多</em> 82 <em>更多</em>
83 <i class="iconfont">&#xe600;</i> 83 <i class="iconfont">&#xe600;</i>
84 </span> 84 </span>
85 - 85 +
86 <span id="brand-multi" class="multi-select">多选 +</span> 86 <span id="brand-multi" class="multi-select">多选 +</span>
87 </div> 87 </div>
88 88
@@ -128,7 +128,7 @@ @@ -128,7 +128,7 @@
128 128
129 <div class="attr-content clearfix"> 129 <div class="attr-content clearfix">
130 {{# price}} 130 {{# price}}
131 - <a class="attr" href="{{href}}">¥{{name}}</a> 131 + <a class="attr {{#if checked}}checked{{/if}}" href="{{href}}">¥{{name}}</a>
132 {{/ price}} 132 {{/ price}}
133 133
134 <div class="ud-price-range"> 134 <div class="ud-price-range">
@@ -146,10 +146,10 @@ @@ -146,10 +146,10 @@
146 {{#if color}} 146 {{#if color}}
147 <div class="color section"> 147 <div class="color section">
148 <span class="title">颜色:</span> 148 <span class="title">颜色:</span>
149 - 149 +
150 <div class="attr-content clearfix"> 150 <div class="attr-content clearfix">
151 {{# color}} 151 {{# color}}
152 - <a class="attr" href="{{href}}"> 152 + <a class="attr {{#if checked}}checked{{/if}}" href="{{href}}">
153 <i class="color-block" style="background: {{rgb}}"></i> 153 <i class="color-block" style="background: {{rgb}}"></i>
154 {{name}} 154 {{name}}
155 </a> 155 </a>
@@ -164,7 +164,7 @@ @@ -164,7 +164,7 @@
164 164
165 <div class="attr-content clearfix"> 165 <div class="attr-content clearfix">
166 {{# size}} 166 {{# size}}
167 - <a class="attr" href="{{href}}">{{name}}</a> 167 + <a class="attr {{#if checked}}checked{{/if}}" href="{{href}}">{{name}}</a>
168 {{/ size}} 168 {{/ size}}
169 </div> 169 </div>
170 </div> 170 </div>
@@ -194,7 +194,7 @@ @@ -194,7 +194,7 @@
194 {{/if}} 194 {{/if}}
195 <ul class="clearfix check-container"> 195 <ul class="clearfix check-container">
196 {{#each sub}} 196 {{#each sub}}
197 - <li class="attr"> 197 + <li class="attr {{#if checked}}checked{{/if}}">
198 <a href="{{href}}"> 198 <a href="{{href}}">
199 <span class="iconfont checkbox" data-id="{{id}}">&#xe613;</span> 199 <span class="iconfont checkbox" data-id="{{id}}">&#xe613;</span>
200 <span>{{name}}</span> 200 <span>{{name}}</span>
@@ -212,4 +212,4 @@ @@ -212,4 +212,4 @@
212 </div> 212 </div>
213 </div> 213 </div>
214 {{/if}} 214 {{/if}}
215 -</div>  
  215 +</div>
@@ -6,6 +6,7 @@ @@ -6,6 +6,7 @@
6 var $ = require('yoho.jquery'); 6 var $ = require('yoho.jquery');
7 7
8 require('./footer'); 8 require('./footer');
  9 +require('./simple-header');
9 require('./header'); 10 require('./header');
10 11
11 function cookie(name) { 12 function cookie(name) {
@@ -95,14 +95,19 @@ module.exports = function(data) { @@ -95,14 +95,19 @@ module.exports = function(data) {
95 var load = new InfiniteLoad({ 95 var load = new InfiniteLoad({
96 offset: { 96 offset: {
97 height: function() { 97 height: function() {
98 - return parseFloat($container.offset().top) + parseFloat($container.height()); 98 + return parseFloat($container.offset().top) + parseFloat($container.height()) - 200;
99 } 99 }
100 } 100 }
101 }); 101 });
102 var options; 102 var options;
103 var url = data.url; 103 var url = data.url;
  104 + var firstCount = data.firstCount;
  105 + var pageCount = data.pageCount;
104 106
105 delete data.url; 107 delete data.url;
  108 + delete data.firstCount;
  109 + delete data.pageCount;
  110 +
106 111
107 112
108 load.on('after', function(p) { 113 load.on('after', function(p) {
@@ -111,6 +116,8 @@ module.exports = function(data) { @@ -111,6 +116,8 @@ module.exports = function(data) {
111 pageIndex: p.index 116 pageIndex: p.index
112 }); 117 });
113 118
  119 + data.pageCount = (data.pageIndex === 1) ? firstCount : pageCount;
  120 +
114 options = { 121 options = {
115 type: 'POST', 122 type: 'POST',
116 url: url, 123 url: url,
@@ -24,7 +24,13 @@ if ($.inArray(homePage, ['boys','girls','kids','lifestyle']) > -1) { @@ -24,7 +24,13 @@ if ($.inArray(homePage, ['boys','girls','kids','lifestyle']) > -1) {
24 require('../common/new-arrivls')({ 24 require('../common/new-arrivls')({
25 type: homePage, 25 type: homePage,
26 url: '/common/getNewArrival', 26 url: '/common/getNewArrival',
27 - pageCount: homePage === 'boys' ? '15' : '20' 27 + firstCount: homePage === ('boys' || 'lifestyle') ? '25' : '20',
  28 + pageCount: homePage === ('boys' || 'lifestyle') ? '15' : '12'
  29 + });
  30 + window.setCookie('_Channel', homePage, {
  31 + domain: '.yohobuy.com',
  32 + path: '/',
  33 + expires: 365
28 }); 34 });
29 } 35 }
30 36
@@ -54,3 +60,4 @@ if (homePage === 'boys') { @@ -54,3 +60,4 @@ if (homePage === 'boys') {
54 $('.img-slider-wrapper').slider2(); 60 $('.img-slider-wrapper').slider2();
55 } 61 }
56 62
  63 +
@@ -143,22 +143,22 @@ exports.init = function(num) { @@ -143,22 +143,22 @@ exports.init = function(num) {
143 display: 'none' 143 display: 'none'
144 }); 144 });
145 }); 145 });
146 -  
147 - //鼠标放在颜色列表上效果  
148 - $(document).on('hover', '.good-select-color li', function() {  
149 - var coverImg = $(this).find('img').attr('data-cover'),  
150 - $coverImg = $(this).closest('.good-item-wrapper').find('.good-detail-img').find('img');  
151 -  
152 - $coverImg.attr('src', coverImg);  
153 - });  
154 -  
155 - // 左侧导航  
156 - $productListNav.click(function() {  
157 - if ($(this).hasClass('active')) {  
158 - $(this).find('.sort-child-list').stop(true, true).slideUp();  
159 - } else {  
160 - $(this).find('.sort-child-list').stop(true, true).slideDown();  
161 - }  
162 - $(this).toggleClass('active');  
163 - });  
164 -};  
  146 +};
  147 +
  148 +//鼠标放在颜色列表上效果
  149 +$(document).on('hover', '.good-select-color li', function() {
  150 + var coverImg = $(this).find('img').attr('data-cover'),
  151 + $coverImg = $(this).closest('.good-item-wrapper').find('.good-detail-img').find('img');
  152 +
  153 + $coverImg.attr('src', coverImg);
  154 +});
  155 +
  156 +// 左侧导航
  157 +$productListNav.click(function() {
  158 + if ($(this).hasClass('active')) {
  159 + $(this).find('.sort-child-list').stop(true, true).slideUp();
  160 + } else {
  161 + $(this).find('.sort-child-list').stop(true, true).slideDown();
  162 + }
  163 + $(this).toggleClass('active');
  164 +});
@@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
12 } 12 }
13 } 13 }
14 14
15 - .title { 15 + .title {
16 float: left; 16 float: left;
17 width: 90px; 17 width: 90px;
18 line-height: 30px; 18 line-height: 30px;
@@ -44,6 +44,14 @@ @@ -44,6 +44,14 @@
44 margin-left: 0; 44 margin-left: 0;
45 } 45 }
46 46
  47 + &.checked {
  48 + color: #e01;
  49 +
  50 + a {
  51 + color: #e01;
  52 + }
  53 + }
  54 +
47 -moz-user-select: none; 55 -moz-user-select: none;
48 } 56 }
49 57
@@ -287,4 +295,4 @@ @@ -287,4 +295,4 @@
287 .multi .checkbox { 295 .multi .checkbox {
288 display: inline; 296 display: inline;
289 } 297 }
290 -}  
  298 +}
@@ -44,7 +44,8 @@ class Index1Controller extends AbstractAction @@ -44,7 +44,8 @@ class Index1Controller extends AbstractAction
44 'channel' => array( 44 'channel' => array(
45 array( 45 array(
46 'href' => '/?gender=1,3', 46 'href' => '/?gender=1,3',
47 - 'name' => 'BOYS' 47 + 'name' => 'BOYS',
  48 + 'checked' => true
48 ), 49 ),
49 array( 50 array(
50 'href' => '/?gender=2,3', 51 'href' => '/?gender=2,3',
@@ -63,10 +64,12 @@ class Index1Controller extends AbstractAction @@ -63,10 +64,12 @@ class Index1Controller extends AbstractAction
63 array( 64 array(
64 'id' => '1', 65 'id' => '1',
65 'name' => '上衣', 66 'name' => '上衣',
  67 + 'checked' => true,
66 'sub' => array( 68 'sub' => array(
67 array( 69 array(
68 'href' => '', 70 'href' => '',
69 - 'name' => 'T恤' 71 + 'name' => 'T恤',
  72 + 'checked' => true
70 ), 73 ),
71 array( 74 array(
72 'href' => '', 75 'href' => '',
@@ -95,7 +98,8 @@ class Index1Controller extends AbstractAction @@ -95,7 +98,8 @@ class Index1Controller extends AbstractAction
95 'default' => array( 98 'default' => array(
96 array( 99 array(
97 'href' => '', 100 'href' => '',
98 - 'name' => 'CLOT' 101 + 'name' => 'CLOT',
  102 + 'checked' => true
99 ), 103 ),
100 array( 104 array(
101 'href' => '', 105 'href' => '',
@@ -133,7 +137,8 @@ class Index1Controller extends AbstractAction @@ -133,7 +137,8 @@ class Index1Controller extends AbstractAction
133 'brandIndex' => array( 137 'brandIndex' => array(
134 array( 138 array(
135 'index' => 'all', 139 'index' => 'all',
136 - 'name' => '全部' 140 + 'name' => '全部',
  141 + 'checked' => true
137 ), 142 ),
138 array( 143 array(
139 'index' => '0-9', 144 'index' => '0-9',
@@ -185,7 +190,8 @@ class Index1Controller extends AbstractAction @@ -185,7 +190,8 @@ class Index1Controller extends AbstractAction
185 'price' => array( 190 'price' => array(
186 array( 191 array(
187 'href' => '', 192 'href' => '',
188 - 'name' => '0-239' 193 + 'name' => '0-239',
  194 + 'checked' => true
189 ), 195 ),
190 array( 196 array(
191 'href' => '', 197 'href' => '',
@@ -196,7 +202,8 @@ class Index1Controller extends AbstractAction @@ -196,7 +202,8 @@ class Index1Controller extends AbstractAction
196 array( 202 array(
197 'href' => '', 203 'href' => '',
198 'name' => '黑色', 204 'name' => '黑色',
199 - 'rgb' => '#000' 205 + 'rgb' => '#000',
  206 + 'checked' => true
200 ), 207 ),
201 array( 208 array(
202 'href' => '', 209 'href' => '',
@@ -207,7 +214,8 @@ class Index1Controller extends AbstractAction @@ -207,7 +214,8 @@ class Index1Controller extends AbstractAction
207 'size' => array( 214 'size' => array(
208 array( 215 array(
209 'href' => '', 216 'href' => '',
210 - 'name' => 'S' 217 + 'name' => 'S',
  218 + 'checked' => true
211 ), 219 ),
212 array( 220 array(
213 'href' => '', 221 'href' => '',
@@ -223,7 +231,8 @@ class Index1Controller extends AbstractAction @@ -223,7 +231,8 @@ class Index1Controller extends AbstractAction
223 array( 231 array(
224 'id' => '1', 232 'id' => '1',
225 'href' => '', 233 'href' => '',
226 - 'name' => '街头' 234 + 'name' => '街头',
  235 + 'checked' => true
227 ), 236 ),
228 array( 237 array(
229 'id' => '2', 238 'id' => '2',
@@ -239,7 +248,8 @@ class Index1Controller extends AbstractAction @@ -239,7 +248,8 @@ class Index1Controller extends AbstractAction
239 array( 248 array(
240 'id' => '1', 249 'id' => '1',
241 'href' => '', 250 'href' => '',
242 - 'name' => '春天' 251 + 'name' => '春天',
  252 + 'checked' => true
243 ), 253 ),
244 array( 254 array(
245 'id' => '2', 255 'id' => '2',
@@ -1544,4 +1554,4 @@ class Index1Controller extends AbstractAction @@ -1544,4 +1554,4 @@ class Index1Controller extends AbstractAction
1544 1554
1545 $this->echoJson($data); 1555 $this->echoJson($data);
1546 } 1556 }
1547 -}  
  1557 +}