Authored by zhangxiaoru

默认 人气筛选

... ... @@ -33,7 +33,8 @@ window.$ = $;
let $input = $('#search-input').find('input[name="query"]'),
$clear = $('#search-input .clear-input'),
$buriedpoint = $('.buriedpoint'),
$search = $('#search');
$search = $('#search'),
$dropList = $('.drop-list');
let shopId, sort, brand, outlets, app_type, age_level, msort, misort, coin, app_version, students, couponId, searchFrom;
let size, color, style, standard, gender, price, p_d, oldquery, query, limited, specialoffer, specialsale_id, promotion;
... ... @@ -46,7 +47,6 @@ require('common');
// 首屏加载标志
let firstScreen = $('.default-goods').children().size() > 0;
let isRecYas = window.queryString.needSuggestion === 'Y' || $('.word-content').length ? 'Y' : 'N'; // 是否是关键词
let $listNav = $('#list-nav'),
... ... @@ -426,6 +426,7 @@ function search(opt) {
return;
}
// 首屏有数据 滑动加载从第二页开始
if (page === 1 && navType === 'default' && firstScreen) {
page = 2;
}
... ... @@ -606,7 +607,7 @@ function search(opt) {
if (data === '' || (data.list && data.list.length <= 0)) {
nav.end = true;
if (nav.reload) {
if (nav.reload && !firstScreen) {
if (data.total === 0) {
$container.html(noResultHbs());
}
... ... @@ -906,7 +907,7 @@ $listNav.bind('contextmenu', function() {
return false;
});
$('.drop-list').on('touchend', 'li', function(e) {
$dropList.on('touchend', 'li', function(e) {
let navType,
nav,
bpIdData = $(this).attr('data-bp-id') || '',
... ... @@ -922,7 +923,7 @@ $('.drop-list').on('touchend', 'li', function(e) {
}
if ($(this).hasClass('active')) {
$('.drop-list').addClass('hide');
$dropList.addClass('hide');
return;
}
... ... @@ -972,7 +973,11 @@ $('.drop-list').on('touchend', 'li', function(e) {
search({filtering: true});
}
$('.drop-list').addClass('hide');
if (!$('.filter-mask').hasClass('hide')) {
filter.hideFilter();
}
$dropList.addClass('hide');
});
$listNav.on('touchend touchcancel', function(e) {
... ... @@ -983,11 +988,15 @@ $listNav.on('touchend touchcancel', function(e) {
let bpIdData = $(this).find('.buriedpoint').attr('data-bp-id') || '';
if ($this.hasClass('first-li-more')) {
$('.drop-list').toggleClass('hide');
$dropList.toggleClass('hide');
$this.addClass('active').siblings().removeClass('active');
return true;
} else if (!$('.drop-list').hasClass('hide')) {
$dropList.addClass('hide');
} else {
$dropList.find('li').removeClass('active');
}
if ($this.hasClass('filter')) {
... ...