...
|
...
|
@@ -27,7 +27,7 @@ var tip = require('../../plugin/tip'), |
|
|
var $subNav = $('.home-sub-nav'),
|
|
|
$collect = $('#collect'),
|
|
|
$goodsContainer = $('#goods-container'),
|
|
|
$ngc = $goodsContainer.children('.new-goods'),
|
|
|
$ngc = $goodsContainer.children('.newest-goods'),
|
|
|
$defaultgc = $goodsContainer.children('.default-goods'),
|
|
|
$sgc = $goodsContainer.children('.sale-goods'),
|
|
|
$pgc = $goodsContainer.children('.price-goods'),
|
...
|
...
|
@@ -91,7 +91,7 @@ var $listNav = $('#list-nav'), |
|
|
// 导航数据信息
|
|
|
navInfo = {
|
|
|
new: {
|
|
|
order: 0,
|
|
|
order: 1,
|
|
|
reload: true,
|
|
|
page: 1,
|
|
|
end: false
|
...
|
...
|
@@ -111,7 +111,13 @@ var $listNav = $('#list-nav'), |
|
|
discount: {
|
|
|
order: 1,
|
|
|
reload: true,
|
|
|
page: 1,
|
|
|
page: 0,
|
|
|
end: false
|
|
|
},
|
|
|
newest: {
|
|
|
order: 0,
|
|
|
reload: true,
|
|
|
page: 0,
|
|
|
end: false
|
|
|
},
|
|
|
default: {
|
...
|
...
|
@@ -629,8 +635,8 @@ function search(opt) { |
|
|
}
|
|
|
|
|
|
// 导航类别
|
|
|
if ($pre.hasClass('new')) {
|
|
|
navType = 'new';
|
|
|
if ($pre.hasClass('newest')) {
|
|
|
navType = 'newest';
|
|
|
} else if ($pre.hasClass('price')) {
|
|
|
navType = 'price';
|
|
|
} else if ($pre.hasClass('discount')) {
|
...
|
...
|
@@ -682,7 +688,7 @@ function search(opt) { |
|
|
num;
|
|
|
|
|
|
switch (navType) {
|
|
|
case 'new':
|
|
|
case 'newest':
|
|
|
$container = $ngc;
|
|
|
break;
|
|
|
case 'price':
|
...
|
...
|
@@ -763,8 +769,8 @@ $newList.on('touchstart', 'li', function(e) { |
|
|
$firstLiDom = $('ul.pos-list').find('li.first-li-more');
|
|
|
|
|
|
e.preventDefault();
|
|
|
if ($(this).hasClass('new')) {
|
|
|
navType = 'new';
|
|
|
if ($(this).hasClass('newest')) {
|
|
|
navType = 'newest';
|
|
|
} else if ($(this).hasClass('default')) {
|
|
|
navType = 'default';
|
|
|
} else if ($(this).hasClass('sale')) {
|
...
|
...
|
@@ -774,7 +780,7 @@ $newList.on('touchstart', 'li', function(e) { |
|
|
$newList.addClass('hide');
|
|
|
$firstLiDom.find('.spanTest').text($(this).text());
|
|
|
$firstLiDom.attr('data-bp-id', bpIdData).addClass('active').siblings().removeClass('active');
|
|
|
$subNav.find('.first-li-more').removeClass('new default sale').addClass(navType);
|
|
|
$subNav.find('.first-li-more').removeClass('newest default sale').addClass(navType);
|
|
|
|
|
|
$(document).trigger('shouldSendBpData', [bpIdData]);
|
|
|
newListHide();
|
...
|
...
|
@@ -783,7 +789,7 @@ $newList.on('touchstart', 'li', function(e) { |
|
|
$goodsContainer.children('.container:not(.hide)').addClass('hide');
|
|
|
|
|
|
switch (navType) {
|
|
|
case 'new':
|
|
|
case 'newest':
|
|
|
$ngc.removeClass('hide');
|
|
|
break;
|
|
|
|
...
|
...
|
@@ -839,8 +845,8 @@ $subNav.on('touchend touchcancel', function(e) { |
|
|
$newList.toggleClass('hide');
|
|
|
if ($this.hasClass('default')) {
|
|
|
$newList.find('li.default').addClass('active').siblings().removeClass('active');
|
|
|
} else if ($this.hasClass('new')) {
|
|
|
$newList.find('li.new').addClass('active').siblings().removeClass('active');
|
|
|
} else if ($this.hasClass('newest')) {
|
|
|
$newList.find('li.newest').addClass('active').siblings().removeClass('active');
|
|
|
} else if ($this.hasClass('sale')) {
|
|
|
$newList.find('li.sale').addClass('active').siblings().removeClass('active');
|
|
|
}
|
...
|
...
|
@@ -886,9 +892,9 @@ $subNav.on('touchend touchcancel', function(e) { |
|
|
|
|
|
filter.hideFilter();// 隐藏面板
|
|
|
|
|
|
if ($this.hasClass('new')) {
|
|
|
cname = '.new';
|
|
|
navType = 'new';
|
|
|
if ($this.hasClass('newest')) {
|
|
|
cname = '.newest';
|
|
|
navType = 'newest';
|
|
|
} else if ($this.hasClass('price')) {
|
|
|
cname = '.price';
|
|
|
navType = 'price';
|
...
|
...
|
@@ -925,8 +931,8 @@ $subNav.on('touchend touchcancel', function(e) { |
|
|
$goodsContainer.children('.container:not(.hide)').addClass('hide');
|
|
|
|
|
|
switch (navType) {
|
|
|
case 'new':
|
|
|
$ngc.removeClass('hide');
|
|
|
case 'newest':
|
|
|
$ngc.removeClass('newest');
|
|
|
break;
|
|
|
|
|
|
case 'price':
|
...
|
...
|
@@ -962,7 +968,7 @@ $subNav.on('touchend touchcancel', function(e) { |
|
|
$goodsContainer.children('.container:not(.hide)').addClass('hide');
|
|
|
|
|
|
switch (navType) {
|
|
|
case 'new':
|
|
|
case 'newest':
|
|
|
$ngc.removeClass('hide');
|
|
|
break;
|
|
|
|
...
|
...
|
|