diff --git a/docs/data-structure.md b/docs/data-structure.md index ac1910d..1afb664 100644 --- a/docs/data-structure.md +++ b/docs/data-structure.md @@ -838,6 +838,14 @@ }, ... ], + defaultSizes: [ + { + numZero: true, + name: 'X', + numStr: '0/10' + }, + ... + ] totalNum: 20 } diff --git a/static/js/cart/chose-panel.js b/static/js/cart/chose-panel.js index cb0539f..bd9089c 100644 --- a/static/js/cart/chose-panel.js +++ b/static/js/cart/chose-panel.js @@ -18,7 +18,6 @@ var $chosePanel = $('#chose-panel'), $chosed, $imgsThumb, $leftNum, - $leftNumHtml, leftNum, confirming, curColorIndex, @@ -32,7 +31,6 @@ var $chosePanel = $('#chose-panel'), queryString, $yohoPage = $('.yoho-page'); - //初始化购物车面板显示 function init() { hasChooseColor = false; @@ -43,8 +41,6 @@ function init() { $allChoseItems = $('.chose-items'); $sizeRowList = $('.size-list ul'); $leftNum = $('#left-num'); - $leftNumHtml = - $sizeRowList.eq(0).toggleClass('hide'); } function checkColorSizeNum() { diff --git a/template/m.yohobuy.com/partials/cart/chose-panel.phtml b/template/m.yohobuy.com/partials/cart/chose-panel.phtml index 36aaff5..d231b24 100644 --- a/template/m.yohobuy.com/partials/cart/chose-panel.phtml +++ b/template/m.yohobuy.com/partials/cart/chose-panel.phtml @@ -34,16 +34,22 @@ <div class="size-list block-list"> <span>尺码</span> {{# sizes}} - - <ul class="size-row clearfix hide"> - {{# size}} - <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}}"> - {{name}} - </li> - {{/ size}} - </ul> - + <ul class="size-row clearfix hide"> + {{# size}} + <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}}"> + {{name}} + </li> + {{/ size}} + </ul> {{/ sizes}} + + {{#if defaultSizes}} + <ul class="size-row clearfix default-size"> + {{#each defaultSizes}} + <li class="block {{#if numZero}}zero-stock{{/if}}" data-numstr="{{numStr}}">{{name}}</li> + {{/each}} + </ul> + {{/if}} </div> <p> <div class="num"> diff --git a/template/www.yohobuy.com/partials/product/filter-box.phtml b/template/www.yohobuy.com/partials/product/filter-box.phtml index 70d27ac..cdaa61c 100644 --- a/template/www.yohobuy.com/partials/product/filter-box.phtml +++ b/template/www.yohobuy.com/partials/product/filter-box.phtml @@ -26,7 +26,7 @@ <div class="attr-content clearfix"> {{#each channel}} - <a class="attr" href="{{href}}"> + <a class="attr {{#if checked}}checked{{/if}}" href="{{href}}"> {{name}} </a> {{/each}} @@ -42,7 +42,7 @@ <ul class="sort-pre clearfix"> {{#each sort}} <li> - <span class="attr"> + <span class="attr {{#if checked}}checked{{/if}}"> {{name}} </span> </li> @@ -53,7 +53,7 @@ {{#each sort}} <ul class="sort-sub clearfix hide"> {{#each sub}} - <li class="attr"> + <li class="attr {{#if checked}}checked{{/if}}"> <a href="{{href}}">{{name}}</a> </li> {{/each}} @@ -71,7 +71,7 @@ <div class="attr-content"> <ul class="default clearfix"> {{# default}} - <li class="attr"> + <li class="attr {{#if checked}}checked{{/if}}"> <a href="{{href}}" title="{{name}}">{{name}}</a> </li> {{/ default}} @@ -82,7 +82,7 @@ <em>更多</em> <i class="iconfont"></i> </span> - + <span id="brand-multi" class="multi-select">多选 +</span> </div> @@ -128,7 +128,7 @@ <div class="attr-content clearfix"> {{# price}} - <a class="attr" href="{{href}}">¥{{name}}</a> + <a class="attr {{#if checked}}checked{{/if}}" href="{{href}}">¥{{name}}</a> {{/ price}} <div class="ud-price-range"> @@ -146,10 +146,10 @@ {{#if color}} <div class="color section"> <span class="title">颜色:</span> - + <div class="attr-content clearfix"> {{# color}} - <a class="attr" href="{{href}}"> + <a class="attr {{#if checked}}checked{{/if}}" href="{{href}}"> <i class="color-block" style="background: {{rgb}}"></i> {{name}} </a> @@ -164,7 +164,7 @@ <div class="attr-content clearfix"> {{# size}} - <a class="attr" href="{{href}}">{{name}}</a> + <a class="attr {{#if checked}}checked{{/if}}" href="{{href}}">{{name}}</a> {{/ size}} </div> </div> @@ -194,7 +194,7 @@ {{/if}} <ul class="clearfix check-container"> {{#each sub}} - <li class="attr"> + <li class="attr {{#if checked}}checked{{/if}}"> <a href="{{href}}"> <span class="iconfont checkbox" data-id="{{id}}"></span> <span>{{name}}</span> @@ -212,4 +212,4 @@ </div> </div> {{/if}} -</div> \ No newline at end of file +</div> diff --git a/web-static/js/common.js b/web-static/js/common.js index 3ecd27e..6d96c9f 100644 --- a/web-static/js/common.js +++ b/web-static/js/common.js @@ -6,6 +6,7 @@ var $ = require('yoho.jquery'); require('./footer'); +require('./simple-header'); require('./header'); function cookie(name) { diff --git a/web-static/js/common/new-arrivls.js b/web-static/js/common/new-arrivls.js index c213754..e107b6f 100644 --- a/web-static/js/common/new-arrivls.js +++ b/web-static/js/common/new-arrivls.js @@ -95,14 +95,19 @@ module.exports = function(data) { var load = new InfiniteLoad({ offset: { height: function() { - return parseFloat($container.offset().top) + parseFloat($container.height()); + return parseFloat($container.offset().top) + parseFloat($container.height()) - 200; } } }); var options; var url = data.url; + var firstCount = data.firstCount; + var pageCount = data.pageCount; delete data.url; + delete data.firstCount; + delete data.pageCount; + load.on('after', function(p) { @@ -111,6 +116,8 @@ module.exports = function(data) { pageIndex: p.index }); + data.pageCount = (data.pageIndex === 1) ? firstCount : pageCount; + options = { type: 'POST', url: url, diff --git a/web-static/js/home/home.js b/web-static/js/home/home.js index be8ec96..5c1ae28 100644 --- a/web-static/js/home/home.js +++ b/web-static/js/home/home.js @@ -24,7 +24,13 @@ if ($.inArray(homePage, ['boys','girls','kids','lifestyle']) > -1) { require('../common/new-arrivls')({ type: homePage, url: '/common/getNewArrival', - pageCount: homePage === 'boys' ? '15' : '20' + firstCount: homePage === ('boys' || 'lifestyle') ? '25' : '20', + pageCount: homePage === ('boys' || 'lifestyle') ? '15' : '12' + }); + window.setCookie('_Channel', homePage, { + domain: '.yohobuy.com', + path: '/', + expires: 365 }); } @@ -54,3 +60,4 @@ if (homePage === 'boys') { $('.img-slider-wrapper').slider2(); } + diff --git a/web-static/sass/product/_filter-box.scss b/web-static/sass/product/_filter-box.scss index 35d1b21..003f049 100644 --- a/web-static/sass/product/_filter-box.scss +++ b/web-static/sass/product/_filter-box.scss @@ -12,7 +12,7 @@ } } - .title { + .title { float: left; width: 90px; line-height: 30px; @@ -44,6 +44,14 @@ margin-left: 0; } + &.checked { + color: #e01; + + a { + color: #e01; + } + } + -moz-user-select: none; } @@ -287,4 +295,4 @@ .multi .checkbox { display: inline; } -} \ No newline at end of file +} diff --git a/yohobuy/www.yohobuy.com/application/modules/Product/controllers/Index1.php b/yohobuy/www.yohobuy.com/application/modules/Product/controllers/Index1.php index 37510aa..049a3bf 100644 --- a/yohobuy/www.yohobuy.com/application/modules/Product/controllers/Index1.php +++ b/yohobuy/www.yohobuy.com/application/modules/Product/controllers/Index1.php @@ -44,7 +44,8 @@ class Index1Controller extends AbstractAction 'channel' => array( array( 'href' => '/?gender=1,3', - 'name' => 'BOYS' + 'name' => 'BOYS', + 'checked' => true ), array( 'href' => '/?gender=2,3', @@ -63,10 +64,12 @@ class Index1Controller extends AbstractAction array( 'id' => '1', 'name' => '上衣', + 'checked' => true, 'sub' => array( array( 'href' => '', - 'name' => 'T恤' + 'name' => 'T恤', + 'checked' => true ), array( 'href' => '', @@ -95,7 +98,8 @@ class Index1Controller extends AbstractAction 'default' => array( array( 'href' => '', - 'name' => 'CLOT' + 'name' => 'CLOT', + 'checked' => true ), array( 'href' => '', @@ -133,7 +137,8 @@ class Index1Controller extends AbstractAction 'brandIndex' => array( array( 'index' => 'all', - 'name' => '全部' + 'name' => '全部', + 'checked' => true ), array( 'index' => '0-9', @@ -185,7 +190,8 @@ class Index1Controller extends AbstractAction 'price' => array( array( 'href' => '', - 'name' => '0-239' + 'name' => '0-239', + 'checked' => true ), array( 'href' => '', @@ -196,7 +202,8 @@ class Index1Controller extends AbstractAction array( 'href' => '', 'name' => '黑色', - 'rgb' => '#000' + 'rgb' => '#000', + 'checked' => true ), array( 'href' => '', @@ -207,7 +214,8 @@ class Index1Controller extends AbstractAction 'size' => array( array( 'href' => '', - 'name' => 'S' + 'name' => 'S', + 'checked' => true ), array( 'href' => '', @@ -223,7 +231,8 @@ class Index1Controller extends AbstractAction array( 'id' => '1', 'href' => '', - 'name' => '街头' + 'name' => '街头', + 'checked' => true ), array( 'id' => '2', @@ -239,7 +248,8 @@ class Index1Controller extends AbstractAction array( 'id' => '1', 'href' => '', - 'name' => '春天' + 'name' => '春天', + 'checked' => true ), array( 'id' => '2', @@ -1544,4 +1554,4 @@ class Index1Controller extends AbstractAction $this->echoJson($data); } -} \ No newline at end of file +}