Authored by 梁志锋

update

framework @ 119c247f
Subproject commit 75bbc3b075de19f239532f60c5995d06c5f814e2
Subproject commit 119c247f5cf929aa1e059e40609bb16dd6b58f05
... ...
... ... @@ -147,12 +147,14 @@ if ($('.brand-search-page').length) {
searchBtnHammer = new Hammer($('.search-btn')[0]);
searchBtnHammer.on('tap', function(e) {
e.preventDefault();
searchResult();
e.srcEvent.stopPropagation();
});
clearTextHammer = new Hammer($('.clear-text')[0]);
clearTextHammer.on('tap', function(e) {
e.preventDefault();
$('#keyword').val('').trigger('input');
e.srcEvent.stopPropagation();
});
... ...
... ... @@ -34,6 +34,7 @@ lazyLoad($('img.lazy'));
navHammer = new Hammer($('.nav-btn')[0]);
navHammer.on('tap', function(event) {
event.preventDefault();
$mobileWrap.addClass('menu-open');
$overlay.show().css('opacity', 0.3);
$sideNav.addClass('on');
... ... @@ -67,6 +68,7 @@ function hideSideBar() {
mobileWrapHammer = new Hammer($('.mobile-wrap')[0]);
mobileWrapHammer.on('tap', function(e) {
e.preventDefault();
hideSideBar();
e.srcEvent.stopPropagation();
return false;
... ...
... ... @@ -13,7 +13,7 @@ var navHammer,
winH = $(window).height(),
loadMoreH = $('#load-more').height(),
$goodList = $('#goods-list'),
loading = false,
searching = false,
page = 0,
gender = null,
kidsType = $('.mobile-wrap').hasClass('kids-wrap') ? true : false,
... ... @@ -44,6 +44,7 @@ if (lifestyleType) {
$goods = $('.goods-list'),
$content;
e.preventDefault();
if ($this.hasClass('focus')) {
return;
}
... ... @@ -64,12 +65,15 @@ if (lifestyleType) {
});
}
//loading.init($('.maybe-like'));
function search() {
if (loading) {
if (searching) {
return;
}
loading = true;
searching = true;
//loading.showLoadingMask();
//num = $goodList.find('.good-info').length;
$.ajax({
... ... @@ -80,7 +84,9 @@ function search() {
},
success: function(data) {
if (data === ' ') {
loading = false;
searching = false;
//loading.hideLoadingMask();
if (gender) {
if (gender === '1,3') {
url = '/boys/bottomBanner';
... ... @@ -116,12 +122,16 @@ function search() {
lazyLoad($goodList.find('.good-info:gt(' + (num - 1) + ')').find('img.lazy'));
}
loading = false;
searching = false;
//loading.hideLoadingMask();
page++;
},
error: function() {
tip.show('网络断开连接了~');
loading = false;
searching = false;
//loading.hideLoadingMask();
}
});
}
... ...
... ... @@ -11,8 +11,9 @@ var $ = require('jquery'),
var swiper;
var filter = require('../../plugin/filter');
var loading = require('../../plugin/loading');
var tip = require('../../plugin/tip'),
filter = require('../../plugin/filter'),
loading = require('../../plugin/loading');
var $goodsContainer = $('#goods-container'),
$goodsChildren = $goodsContainer.children(),
... ... @@ -196,7 +197,6 @@ function search(opt) {
}
if (data === ' ') {
searching = false;
nav.end = true;
if (nav.reload) {
... ... @@ -213,7 +213,6 @@ function search(opt) {
//lazy good-infos who append in
lazyLoad($container.find('.good-info:gt(' + (num - 1) + ') .lazy'));
}
}
nav.reload = false;
... ... @@ -223,6 +222,11 @@ function search(opt) {
loading.hideLoadingMask();
window.rePosFooter();
},
error: function() {
tip.show('网络断开连接了~');
searching = false;
loading.hideLoadingMask();
}
});
... ...
... ... @@ -14,8 +14,9 @@ var swiper,
$pgc,
$dgc;
var filter = require('../../plugin/filter');
var loading = require('../../plugin/loading');
var tip = require('../../plugin/tip'),
filter = require('../../plugin/filter'),
loading = require('../../plugin/loading');
var $goodsContainer = $('#goods-container'),
$goodsChildren = $goodsContainer.children(),
... ... @@ -225,7 +226,6 @@ function search(opt) {
}
if (data === ' ') {
searching = false;
nav.end = true;
if (nav.reload) {
$container.html(noResult);
... ... @@ -251,6 +251,11 @@ function search(opt) {
loading.hideLoadingMask();
window.rePosFooter();
},
error: function() {
tip.show('网络断开连接了~');
searching = false;
loading.hideLoadingMask();
}
});
... ...