Merge branch 'feature/web/search' into develop
Showing
3 changed files
with
11 additions
and
3 deletions
@@ -179,7 +179,7 @@ | @@ -179,7 +179,7 @@ | ||
179 | </div> | 179 | </div> |
180 | {{/if}} | 180 | {{/if}} |
181 | 181 | ||
182 | - <div class="size section {{#unless size}}hide{{/unless}}"> | 182 | + <div class="size section {{#unless size}}hide{{/unless}}" {{#if size}}data-load="true"{{/if}}> |
183 | <span class="title">尺码:</span> | 183 | <span class="title">尺码:</span> |
184 | 184 | ||
185 | <div class="attr-content clearfix"> | 185 | <div class="attr-content clearfix"> |
@@ -111,6 +111,7 @@ $('.sort-pre').on('click', 'li', function() { | @@ -111,6 +111,7 @@ $('.sort-pre').on('click', 'li', function() { | ||
111 | $sortSub.children(':not(.hide)').addClass('hide'); | 111 | $sortSub.children(':not(.hide)').addClass('hide'); |
112 | $sortSub.children(':eq(' + index + ')').removeClass('hide'); | 112 | $sortSub.children(':eq(' + index + ')').removeClass('hide'); |
113 | 113 | ||
114 | + if (!$sizeWrap.data('load')) { | ||
114 | if (sizeCache[id]) { | 115 | if (sizeCache[id]) { |
115 | $sizeWrap.find('.attr-content').html(sizeCache[id]); | 116 | $sizeWrap.find('.attr-content').html(sizeCache[id]); |
116 | $sizeWrap.removeClass('hide'); | 117 | $sizeWrap.removeClass('hide'); |
@@ -132,6 +133,7 @@ $('.sort-pre').on('click', 'li', function() { | @@ -132,6 +133,7 @@ $('.sort-pre').on('click', 'li', function() { | ||
132 | } | 133 | } |
133 | }); | 134 | }); |
134 | } | 135 | } |
136 | + } | ||
135 | }); | 137 | }); |
136 | 138 | ||
137 | //【品牌】 | 139 | //【品牌】 |
@@ -14,7 +14,8 @@ var $goodsContainer = $('.goods-container'), | @@ -14,7 +14,8 @@ var $goodsContainer = $('.goods-container'), | ||
14 | $goodInfoMain = $goodsContainer.find('.good-info-main'), | 14 | $goodInfoMain = $goodsContainer.find('.good-info-main'), |
15 | $goodSelectColor = $goodsContainer.find('.good-select-color'), | 15 | $goodSelectColor = $goodsContainer.find('.good-select-color'), |
16 | $productListNav = $('.product-list-nav'), | 16 | $productListNav = $('.product-list-nav'), |
17 | - productList; | 17 | + productList, |
18 | + getProductAjax; | ||
18 | 19 | ||
19 | lazyLoad($('img.lazy')); | 20 | lazyLoad($('img.lazy')); |
20 | 21 | ||
@@ -95,7 +96,12 @@ exports.init = function(num) { | @@ -95,7 +96,12 @@ exports.init = function(num) { | ||
95 | wrapperPt, //鼠标移入时弹层的上内边距 | 96 | wrapperPt, //鼠标移入时弹层的上内边距 |
96 | containerPt; //商品列表容器的上内边距 | 97 | containerPt; //商品列表容器的上内边距 |
97 | 98 | ||
98 | - $.ajax({ | 99 | + // 获取图片之前,先把获取上一张图片的ajax请求取消。 网络差的时候会出现错误 |
100 | + if (getProductAjax) { | ||
101 | + getProductAjax.abort(); | ||
102 | + } | ||
103 | + | ||
104 | + getProductAjax = $.ajax({ | ||
99 | type: 'POST', | 105 | type: 'POST', |
100 | url: '/product/list/getProductPic', | 106 | url: '/product/list/getProductPic', |
101 | dataType: 'json', | 107 | dataType: 'json', |
-
Please register or login to post a comment