Authored by 梁志锋

update

framework @ 119c247f
1 -Subproject commit 75bbc3b075de19f239532f60c5995d06c5f814e2 1 +Subproject commit 119c247f5cf929aa1e059e40609bb16dd6b58f05
@@ -147,12 +147,14 @@ if ($('.brand-search-page').length) { @@ -147,12 +147,14 @@ if ($('.brand-search-page').length) {
147 147
148 searchBtnHammer = new Hammer($('.search-btn')[0]); 148 searchBtnHammer = new Hammer($('.search-btn')[0]);
149 searchBtnHammer.on('tap', function(e) { 149 searchBtnHammer.on('tap', function(e) {
  150 + e.preventDefault();
150 searchResult(); 151 searchResult();
151 e.srcEvent.stopPropagation(); 152 e.srcEvent.stopPropagation();
152 }); 153 });
153 154
154 clearTextHammer = new Hammer($('.clear-text')[0]); 155 clearTextHammer = new Hammer($('.clear-text')[0]);
155 clearTextHammer.on('tap', function(e) { 156 clearTextHammer.on('tap', function(e) {
  157 + e.preventDefault();
156 $('#keyword').val('').trigger('input'); 158 $('#keyword').val('').trigger('input');
157 e.srcEvent.stopPropagation(); 159 e.srcEvent.stopPropagation();
158 }); 160 });
@@ -34,6 +34,7 @@ lazyLoad($('img.lazy')); @@ -34,6 +34,7 @@ lazyLoad($('img.lazy'));
34 34
35 navHammer = new Hammer($('.nav-btn')[0]); 35 navHammer = new Hammer($('.nav-btn')[0]);
36 navHammer.on('tap', function(event) { 36 navHammer.on('tap', function(event) {
  37 + event.preventDefault();
37 $mobileWrap.addClass('menu-open'); 38 $mobileWrap.addClass('menu-open');
38 $overlay.show().css('opacity', 0.3); 39 $overlay.show().css('opacity', 0.3);
39 $sideNav.addClass('on'); 40 $sideNav.addClass('on');
@@ -67,6 +68,7 @@ function hideSideBar() { @@ -67,6 +68,7 @@ function hideSideBar() {
67 68
68 mobileWrapHammer = new Hammer($('.mobile-wrap')[0]); 69 mobileWrapHammer = new Hammer($('.mobile-wrap')[0]);
69 mobileWrapHammer.on('tap', function(e) { 70 mobileWrapHammer.on('tap', function(e) {
  71 + e.preventDefault();
70 hideSideBar(); 72 hideSideBar();
71 e.srcEvent.stopPropagation(); 73 e.srcEvent.stopPropagation();
72 return false; 74 return false;
@@ -13,7 +13,7 @@ var navHammer, @@ -13,7 +13,7 @@ var navHammer,
13 winH = $(window).height(), 13 winH = $(window).height(),
14 loadMoreH = $('#load-more').height(), 14 loadMoreH = $('#load-more').height(),
15 $goodList = $('#goods-list'), 15 $goodList = $('#goods-list'),
16 - loading = false, 16 + searching = false,
17 page = 0, 17 page = 0,
18 gender = null, 18 gender = null,
19 kidsType = $('.mobile-wrap').hasClass('kids-wrap') ? true : false, 19 kidsType = $('.mobile-wrap').hasClass('kids-wrap') ? true : false,
@@ -44,6 +44,7 @@ if (lifestyleType) { @@ -44,6 +44,7 @@ if (lifestyleType) {
44 $goods = $('.goods-list'), 44 $goods = $('.goods-list'),
45 $content; 45 $content;
46 46
  47 + e.preventDefault();
47 if ($this.hasClass('focus')) { 48 if ($this.hasClass('focus')) {
48 return; 49 return;
49 } 50 }
@@ -64,12 +65,15 @@ if (lifestyleType) { @@ -64,12 +65,15 @@ if (lifestyleType) {
64 }); 65 });
65 } 66 }
66 67
  68 +//loading.init($('.maybe-like'));
67 69
68 function search() { 70 function search() {
69 - if (loading) { 71 + if (searching) {
70 return; 72 return;
71 } 73 }
72 - loading = true; 74 + searching = true;
  75 +
  76 + //loading.showLoadingMask();
73 77
74 //num = $goodList.find('.good-info').length; 78 //num = $goodList.find('.good-info').length;
75 $.ajax({ 79 $.ajax({
@@ -80,7 +84,9 @@ function search() { @@ -80,7 +84,9 @@ function search() {
80 }, 84 },
81 success: function(data) { 85 success: function(data) {
82 if (data === ' ') { 86 if (data === ' ') {
83 - loading = false; 87 + searching = false;
  88 +
  89 + //loading.hideLoadingMask();
84 if (gender) { 90 if (gender) {
85 if (gender === '1,3') { 91 if (gender === '1,3') {
86 url = '/boys/bottomBanner'; 92 url = '/boys/bottomBanner';
@@ -116,12 +122,16 @@ function search() { @@ -116,12 +122,16 @@ function search() {
116 lazyLoad($goodList.find('.good-info:gt(' + (num - 1) + ')').find('img.lazy')); 122 lazyLoad($goodList.find('.good-info:gt(' + (num - 1) + ')').find('img.lazy'));
117 } 123 }
118 124
119 - loading = false; 125 + searching = false;
  126 +
  127 + //loading.hideLoadingMask();
120 page++; 128 page++;
121 }, 129 },
122 error: function() { 130 error: function() {
123 tip.show('网络断开连接了~'); 131 tip.show('网络断开连接了~');
124 - loading = false; 132 + searching = false;
  133 +
  134 + //loading.hideLoadingMask();
125 } 135 }
126 }); 136 });
127 } 137 }
@@ -11,8 +11,9 @@ var $ = require('jquery'), @@ -11,8 +11,9 @@ var $ = require('jquery'),
11 11
12 var swiper; 12 var swiper;
13 13
14 -var filter = require('../../plugin/filter');  
15 -var loading = require('../../plugin/loading'); 14 +var tip = require('../../plugin/tip'),
  15 + filter = require('../../plugin/filter'),
  16 + loading = require('../../plugin/loading');
16 17
17 var $goodsContainer = $('#goods-container'), 18 var $goodsContainer = $('#goods-container'),
18 $goodsChildren = $goodsContainer.children(), 19 $goodsChildren = $goodsContainer.children(),
@@ -196,7 +197,6 @@ function search(opt) { @@ -196,7 +197,6 @@ function search(opt) {
196 } 197 }
197 198
198 if (data === ' ') { 199 if (data === ' ') {
199 - searching = false;  
200 nav.end = true; 200 nav.end = true;
201 201
202 if (nav.reload) { 202 if (nav.reload) {
@@ -213,7 +213,6 @@ function search(opt) { @@ -213,7 +213,6 @@ function search(opt) {
213 //lazy good-infos who append in 213 //lazy good-infos who append in
214 lazyLoad($container.find('.good-info:gt(' + (num - 1) + ') .lazy')); 214 lazyLoad($container.find('.good-info:gt(' + (num - 1) + ') .lazy'));
215 } 215 }
216 -  
217 } 216 }
218 217
219 nav.reload = false; 218 nav.reload = false;
@@ -223,6 +222,11 @@ function search(opt) { @@ -223,6 +222,11 @@ function search(opt) {
223 loading.hideLoadingMask(); 222 loading.hideLoadingMask();
224 223
225 window.rePosFooter(); 224 window.rePosFooter();
  225 + },
  226 + error: function() {
  227 + tip.show('网络断开连接了~');
  228 + searching = false;
  229 + loading.hideLoadingMask();
226 } 230 }
227 }); 231 });
228 232
@@ -14,8 +14,9 @@ var swiper, @@ -14,8 +14,9 @@ var swiper,
14 $pgc, 14 $pgc,
15 $dgc; 15 $dgc;
16 16
17 -var filter = require('../../plugin/filter');  
18 -var loading = require('../../plugin/loading'); 17 +var tip = require('../../plugin/tip'),
  18 + filter = require('../../plugin/filter'),
  19 + loading = require('../../plugin/loading');
19 20
20 var $goodsContainer = $('#goods-container'), 21 var $goodsContainer = $('#goods-container'),
21 $goodsChildren = $goodsContainer.children(), 22 $goodsChildren = $goodsContainer.children(),
@@ -225,7 +226,6 @@ function search(opt) { @@ -225,7 +226,6 @@ function search(opt) {
225 } 226 }
226 227
227 if (data === ' ') { 228 if (data === ' ') {
228 - searching = false;  
229 nav.end = true; 229 nav.end = true;
230 if (nav.reload) { 230 if (nav.reload) {
231 $container.html(noResult); 231 $container.html(noResult);
@@ -251,6 +251,11 @@ function search(opt) { @@ -251,6 +251,11 @@ function search(opt) {
251 loading.hideLoadingMask(); 251 loading.hideLoadingMask();
252 252
253 window.rePosFooter(); 253 window.rePosFooter();
  254 + },
  255 + error: function() {
  256 + tip.show('网络断开连接了~');
  257 + searching = false;
  258 + loading.hideLoadingMask();
254 } 259 }
255 }); 260 });
256 261