Authored by wangqing

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

... ... @@ -838,6 +838,14 @@
},
...
],
defaultSizes: [
{
numZero: true,
name: 'X',
numStr: '0/10'
},
...
]
totalNum: 20
}
... ...
... ... @@ -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() {
... ...
... ... @@ -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">
... ...
... ... @@ -13,6 +13,7 @@
<script>
seajs.use(['js/product/list', 'js/product/product'], function (list, product) {
product.init(5);
window.onresize = function () {
setTimeout(function () {
product.init(5);
... ... @@ -28,6 +29,7 @@
<script>
seajs.use(['js/product/list', 'js/product/product'], function (list, product) {
product.init(4);
window.onresize = function () {
setTimeout(function () {
product.init(4);
... ...
... ... @@ -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">&#xe600;</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}}">&#xe613;</span>
<span>{{name}}</span>
... ... @@ -212,4 +212,4 @@
</div>
</div>
{{/if}}
</div>
\ No newline at end of file
</div>
... ...
... ... @@ -6,6 +6,7 @@
var $ = require('yoho.jquery');
require('./footer');
require('./simple-header');
require('./header');
function cookie(name) {
... ...
... ... @@ -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,
... ...
... ... @@ -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();
}
... ...
... ... @@ -143,22 +143,22 @@ exports.init = function(num) {
display: 'none'
});
});
//鼠标放在颜色列表上效果
$(document).on('hover', '.good-select-color li', function() {
var coverImg = $(this).find('img').attr('data-cover'),
$coverImg = $(this).closest('.good-item-wrapper').find('.good-detail-img').find('img');
$coverImg.attr('src', coverImg);
});
// 左侧导航
$productListNav.click(function() {
if ($(this).hasClass('active')) {
$(this).find('.sort-child-list').stop(true, true).slideUp();
} else {
$(this).find('.sort-child-list').stop(true, true).slideDown();
}
$(this).toggleClass('active');
});
};
\ No newline at end of file
};
//鼠标放在颜色列表上效果
$(document).on('hover', '.good-select-color li', function() {
var coverImg = $(this).find('img').attr('data-cover'),
$coverImg = $(this).closest('.good-item-wrapper').find('.good-detail-img').find('img');
$coverImg.attr('src', coverImg);
});
// 左侧导航
$productListNav.click(function() {
if ($(this).hasClass('active')) {
$(this).find('.sort-child-list').stop(true, true).slideUp();
} else {
$(this).find('.sort-child-list').stop(true, true).slideDown();
}
$(this).toggleClass('active');
});
\ No newline at end of file
... ...
... ... @@ -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
}
... ...
... ... @@ -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
}
... ...