Authored by 郝肖肖

经典店铺默认、最新

... ... @@ -119,11 +119,14 @@
<div class="discount-area first" id="navlist2">
<ul id="list-nav" class="home-sub-nav list-nav pos-list clearfix">
<li class="default active buriedpoint first-li-more" data-bp-id="shop_listnav_default_1">
<li class="default active buriedpoint" data-bp-id="shop_listnav_default_1">
<a href="javascript:void(0);">
<span class="nav-txt">默认</span>
<span class="iconfont up cur hide">&#xe615;</span>
<span class="iconfont down cur">&#xe616;</span>
</a>
</li>
<li class="new buriedpoint" data-bp-id="shop_listnav_new_1">
<a href="javascript:void(0);">
<span class="nav-txt">最新</span>
</a>
</li>
<li class="price buriedpoint" data-bp-id="shop_listnav_price_1">
... ... @@ -151,12 +154,6 @@
</a>
</li>
</ul>
<div class='new-list classics hide'>
<ul>
<li class='active default' data-bp-id='shop_listnav_default_1'>默认</li>
<li class='new' data-bp-id='shop_listnav_new_1'>最新</li>
</ul>
</div>
</div>
<div class="discount-area first">
... ... @@ -189,11 +186,14 @@
</ul>
<ul id="pos-list" class="home-sub-nav pos-list hide">
<li class="default active buriedpoint first-li-more" data-bp-id="shop_listnav_default_1">
<li class="default active buriedpoint" data-bp-id="shop_listnav_default_1">
<a href="javascript:void(0);">
<span class="nav-txt">默认</span>
<span class="iconfont up cur hide">&#xe615;</span>
<span class="iconfont down cur">&#xe616;</span>
</a>
</li>
<li class="new buriedpoint" data-bp-id="shop_listnav_new_1">
<a href="javascript:void(0);">
<span class="nav-txt">最新</span>
</a>
</li>
<li class="price buriedpoint" data-bp-id="shop_poslist_price_1">
... ...
... ... @@ -151,7 +151,7 @@ var $listNav = $('#list-nav'),
default: {
order: 0,
reload: true,
page: 1,
page: 0,
end: false
},
hot: {
... ... @@ -187,11 +187,6 @@ var viewType = 1, // 1-首页,2-上新,3-人气
listModValue = 4 - listCount % 4,
listIndex;
// $('.main-wrap').css({
// position: 'static'
// });
// 焦点效果
if ($('.banner-swiper').find('li').size() > 1) {
bannerSwiper = new Swiper('.banner-swiper', {
... ... @@ -445,22 +440,6 @@ function scrollHandler(e) {
}
}
document.addEventListener('touchmove', function(e) {
// sub classify不阻止默认事件
if ($(e.target).closest('.sub-classify').length === 0) {
// e.preventDefault();
}
if ($('.filter-mask').length && !$('.filter-mask').hasClass('hide')) {
// e.preventDefault();
// e.stopPropagation();
}
}, false);
/* if (!isIphone) {
return;
}*/
// window ready 后重新refresh iscroll
$(window).ready(function() {
// myScroll && myScroll.refresh();
... ... @@ -683,20 +662,9 @@ function search(opt, callback) {
$listNav.bind('contextmenu', function(e) {
return false;
});
function newListHide() {
var $firstLi = $listNav.find('li.first-li-more');
if ($newList.hasClass('hide')) {
$firstLi.find('span.up').addClass('hide');
$firstLi.find('span.down').removeClass('hide');
} else {
$firstLi.find('span.down').addClass('hide');
$firstLi.find('span.up').removeClass('hide');
}
}
$newList.on('touchstart', 'li', function(e) {
var navType, bpIdData = $(this).attr('data-bp-id') || '',
$firstLiDom = $subNav.find('li.first-li-more'),
cls = '';
e.preventDefault();
... ... @@ -711,14 +679,7 @@ $newList.on('touchstart', 'li', function(e) {
cls = 'sale';
}
$newList.addClass('hide');
$('#pos-list').addClass('hide');
$firstLiDom.find('.nav-txt').text($(this).text());
$firstLiDom.attr('data-bp-id', bpIdData).addClass('active').siblings().removeClass('active');
$subNav.find('.first-li-more').removeClass('new default sale').addClass(cls);
$(document).trigger('shouldSendBpData', [bpIdData]);
newListHide();
// 切换container显示
$goodsContainer.children('.container:not(.hide)').addClass('hide');
... ... @@ -746,7 +707,7 @@ $newList.on('touchstart', 'li', function(e) {
default:
break;
}
$pre = $('.first-li-more');
var nav = navInfo[navType];
if (nav.reload) {
... ... @@ -765,13 +726,6 @@ $newList.on('touchstart', 'li', function(e) {
});
$(document).on('touchstart', function(e) {
if (!$newList.hasClass('hide') &&
$(e.target).closest('.new-list, li.first-li-more').length <= 0) {
$newList.addClass('hide');
newListHide();
}
});
function subNavScrollTo() {
setTimeout(function() {
window.scrollTo(0, $('#list-nav').offset().top + 5);
... ... @@ -791,24 +745,7 @@ $subNav.on('touchend touchcancel', function(e) {
if (typeof $this === 'undefined' || $this.length === 0) {
return;
}
if ($this.hasClass('first-li-more')) {
filter.hideFilter();
$newList.toggleClass('hide');
if ($('#pos-list').hasClass('hide')) {
$newList.removeClass('classics');
} else {
$newList.addClass('classics');
}
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('sale')) {
$newList.find('li.sale').addClass('active').siblings().removeClass('active');
}
newListHide();
} else {
// 最新li 列表
$newList.addClass('hide');
... ... @@ -918,19 +855,10 @@ $subNav.on('touchend touchcancel', function(e) {
}, reloadCb);
}
}
}
if ($('#list-nav').offset().top > $(document).scrollTop() && $('.filter-mask').hasClass('hide')) {
if ($this.hasClass('first-li-more') && !$('#pos-list').hasClass('hide')) {
if ($('.new-list').hasClass('hide')) {
$('.new-list').removeClass('full-height');
$('#pos-list').addClass('hide');
} else {
$('.new-list').addClass('full-height');
}
} else {
$('#pos-list').addClass('hide');
}
} else {
$('.new-list').removeClass('full-height');
}
... ... @@ -942,7 +870,6 @@ $listNav.on('touchstart', 'li', function(e) {
$(this).addClass('bytouch');
}).on('touchend touchcancel', function() {
$listNav.find('li').removeClass('bytouch');
});
$nav2.on('touchstart', 'li', function(e) {
... ...
... ... @@ -41,14 +41,14 @@
font-size: 14PX;
line-height: 14PX;
}
}
&:first-child {
li:first-child {
.text {
border-left: none;
}
}
}
}
.shop-foot-wrapper {
position: fixed;
... ... @@ -363,7 +363,6 @@
.goods-container {
position: relative;
min-height: 440px;
/* padding-left: 15px; */
padding-top: 20px;
border-bottom: 1px solid #e0e0e0;
}
... ... @@ -383,19 +382,6 @@
-webkit-transform: scale(0.8);
font-weight: bold;
}
.default:after,
.newest:after,
.new:after,
.price:after,
.discount:after {
height: 28px;
content: "";
border-left: 1px solid #e0e0e0;
position: absolute;
top: 25px;
left: 163px;
}
}
.discount-area {
... ... @@ -411,7 +397,7 @@
height: 40PX;
float: left;
line-height: 40PX;
width: 24.8%;
width: 20%;
text-align: center;
border-sizing: border-box;
position: relative;
... ... @@ -420,33 +406,12 @@
padding-top: 0;
font-size: 14PX;
}
&.default:after,
&.newest:after,
&.new:after,
&.price:after,
&.discount:after {
height: 28px;
content: "";
border-left: 1px solid #e0e0e0;
position: absolute;
top: 25px;
left: 163px;
}
}
.active .cur {
color: #444;
}
.list-nav .icon .up {
top: -14PX;
}
.list-nav .icon .down {
top: -7PX;
}
.goods-container {
padding-top: 30px;
padding-bottom: 100px;
... ... @@ -567,7 +532,7 @@
height: 40PX;
float: left;
line-height: 40PX;
width: 24.8%;
width: 20%;
text-align: center;
border-sizing: border-box;
... ... @@ -580,8 +545,11 @@
box-sizing: border-box;
text-align: center;
width: 100%;
height: 100%;
color: #b0b0b0;
border-left: 1px solid #e0e0e0;
height: 14PX;
line-height: 14PX;
margin-top: 14PX;
}
}
... ... @@ -613,14 +581,6 @@
}
}
.pos-list .icon .up {
top: -14PX;
}
.pos-list .icon .down {
top: -7PX;
}
.category-list-top-board {
border-top: 1px solid #e0e0e0;
}
... ...