...
|
...
|
@@ -45,6 +45,7 @@ var winH = $(window).height(), |
|
|
noResult = '<p class="no-result">未找到相关搜索结果</p>';
|
|
|
|
|
|
require('../common');
|
|
|
|
|
|
// 默认筛选条件
|
|
|
var defaultOpt = require('../common/query-param');
|
|
|
|
...
|
...
|
@@ -53,7 +54,7 @@ var defaultOpt = require('../common/query-param'); |
|
|
var param = location.search;
|
|
|
var isApp = param.indexOf('app_version') > -1 || param.indexOf('appVersion') > -1;
|
|
|
|
|
|
//不阻塞字体文件加载
|
|
|
// 不阻塞字体文件加载
|
|
|
setTimeout(function() {
|
|
|
if (isApp) {
|
|
|
$.ajax({
|
...
|
...
|
@@ -97,7 +98,7 @@ var defaultOpt = require('../common/query-param'); |
|
|
skns: $('.popularity-title').data('skns'),
|
|
|
},
|
|
|
success: function(data) {
|
|
|
$('.product-warp>.goods-container').html(data)
|
|
|
$('.product-warp>.goods-container').html(data);
|
|
|
},
|
|
|
error: function() {
|
|
|
tip.show('网络断开连接了~');
|
...
|
...
|
@@ -128,8 +129,8 @@ var defaultOpt = require('../common/query-param'); |
|
|
});
|
|
|
}
|
|
|
});
|
|
|
}, 0)
|
|
|
|
|
|
}, 0);
|
|
|
|
|
|
}());
|
|
|
|
|
|
|
...
|
...
|
@@ -237,6 +238,7 @@ function getPageGoods(info) { |
|
|
|
|
|
navType = info.data.type;
|
|
|
nav = navInfo[navType];
|
|
|
|
|
|
// 不需要重新加载并且数据请求结束
|
|
|
if (nav.end && toTop) {
|
|
|
toTop = false;
|
...
|
...
|
@@ -296,6 +298,7 @@ function newData(callback) { |
|
|
callback && $.isFunction(callback) && callback();
|
|
|
};
|
|
|
var result = getPageGoods(req);
|
|
|
|
|
|
if (!result) {
|
|
|
callback && callback();
|
|
|
}
|
...
|
...
|
@@ -324,6 +327,7 @@ function hotData(callback) { |
|
|
callback && $.isFunction(callback) && callback();
|
|
|
};
|
|
|
var result = getPageGoods(req);
|
|
|
|
|
|
if (!result) {
|
|
|
callback && callback();
|
|
|
}
|
...
|
...
|
@@ -340,8 +344,9 @@ function tabChange(dom, index) { |
|
|
// 首页导航
|
|
|
(function(nav, posNav, main) {
|
|
|
var scrollToNav1 = function() {
|
|
|
window.scrollTo(0, $('#nav').offset().top + 5)
|
|
|
}
|
|
|
window.scrollTo(0, $('#nav').offset().top + 5);
|
|
|
};
|
|
|
|
|
|
$(nav + ' li, ' + posNav + ' li').not('li.all-goods').on('touchstart', function() {
|
|
|
var index = $(this).index(),
|
|
|
activeTab = $(this).attr('tab');
|
...
|
...
|
@@ -384,7 +389,9 @@ function scrollHandler() { |
|
|
nav2OffsetTop = $('#list-nav').length ? $('#list-nav').offset().top : 0;
|
|
|
|
|
|
var tra;
|
|
|
//分页加载店铺商品列表
|
|
|
|
|
|
// 分页加载店铺商品列表
|
|
|
|
|
|
if (sTop > scH - winH * 2 && viewType === 1) {
|
|
|
if ($pre !== undefined) {
|
|
|
search({
|
...
|
...
|
@@ -397,7 +404,7 @@ function scrollHandler() { |
|
|
}
|
|
|
}
|
|
|
|
|
|
//分页加载“上新”和“人气”商品数据
|
|
|
// 分页加载“上新”和“人气”商品数据
|
|
|
if (sTop + winH * 2 > scH) {
|
|
|
switch (viewType) {
|
|
|
case 2:
|
...
|
...
|
@@ -427,7 +434,7 @@ function scrollHandler() { |
|
|
document.addEventListener('touchmove', function(e) {
|
|
|
// sub classify不阻止默认事件
|
|
|
if ($(e.target).closest('.sub-classify').length === 0) {
|
|
|
//e.preventDefault();
|
|
|
// e.preventDefault();
|
|
|
}
|
|
|
if ($('.filter-mask').length && !$('.filter-mask').hasClass('hide')) {
|
|
|
e.preventDefault();
|
...
|
...
|
@@ -453,7 +460,7 @@ $(window).ready(function() { |
|
|
scH = $('#scroller').outerHeight();
|
|
|
}, 500);
|
|
|
|
|
|
$(document).scroll(scrollHandler)
|
|
|
$(document).scroll(scrollHandler);
|
|
|
lazyLoad($('img.lazy'));
|
|
|
});
|
|
|
|
...
|
...
|
@@ -723,18 +730,19 @@ $newList.on('touchstart', 'li', function(e) { |
|
|
}
|
|
|
$pre = $('.first-li-more');
|
|
|
var nav = navInfo[navType];
|
|
|
|
|
|
if (nav.reload) {
|
|
|
search({
|
|
|
type: 'shop_id',
|
|
|
id: shopId,
|
|
|
brand: brand,
|
|
|
appVersion: appVersion,
|
|
|
url: '/product/search/search',
|
|
|
nextPage: false
|
|
|
}, function() {
|
|
|
});
|
|
|
type: 'shop_id',
|
|
|
id: shopId,
|
|
|
brand: brand,
|
|
|
appVersion: appVersion,
|
|
|
url: '/product/search/search',
|
|
|
nextPage: false
|
|
|
}, function() {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
$(document).on('touchstart', function(e) {
|
...
|
...
|
@@ -745,7 +753,7 @@ $(document).on('touchstart', function(e) { |
|
|
}
|
|
|
});
|
|
|
function subNavScrollTo() {
|
|
|
window.scrollTo(0, $('#list-nav').offset().top + 5)
|
|
|
window.scrollTo(0, $('#list-nav').offset().top + 5);
|
|
|
}
|
|
|
$subNav.on('touchend touchcancel', function(e) {
|
|
|
var $this = $(e.target).closest('li'),
|
...
|
...
|
@@ -775,6 +783,7 @@ $subNav.on('touchend touchcancel', function(e) { |
|
|
subNavScrollTo();
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
// 最新li 列表
|
|
|
$newList.addClass('hide');
|
|
|
|
...
|
...
|
@@ -815,7 +824,7 @@ $subNav.on('touchend touchcancel', function(e) { |
|
|
} else if ($this.hasClass('default')) {
|
|
|
cname = '.default';
|
|
|
navType = 'default';
|
|
|
}
|
|
|
}
|
|
|
|
|
|
nav = navInfo[navType];
|
|
|
|
...
|
...
|
@@ -924,7 +933,7 @@ $nav2.on('touchstart', 'li', function(e) { |
|
|
|
|
|
$('.shop-foot-wrapper .buriedpoint').click(function() {
|
|
|
var subGroup = $(this).find('.sub-group');
|
|
|
|
|
|
|
|
|
if (subGroup.hasClass('hide')) {
|
|
|
subGroup.removeClass('hide');
|
|
|
} else {
|
...
|
...
|
|