Authored by ccbikai

商品详情页面优化

@@ -157,7 +157,7 @@ const getSizeInfo = (sizeInfo) => { @@ -157,7 +157,7 @@ const getSizeInfo = (sizeInfo) => {
157 dest.sizeInfo.detail.list.push(temp); 157 dest.sizeInfo.detail.list.push(temp);
158 }); 158 });
159 } else { 159 } else {
160 - dest.sizeInfo.detail.list[0].params[0] = ''; 160 + dest.sizeInfo.detail.list[0] && (dest.sizeInfo.detail.list[0].params[0] = '');
161 } 161 }
162 } 162 }
163 163
@@ -22,8 +22,10 @@ function hiddenTips($ele) { @@ -22,8 +22,10 @@ function hiddenTips($ele) {
22 22
23 if ($ele.length > 0) { 23 if ($ele.length > 0) {
24 offsetContainer = $ele[0].getBoundingClientRect().right; 24 offsetContainer = $ele[0].getBoundingClientRect().right;
25 - offsetLastColumn = $ele.find('.swiper-slide:last-child')[0].getBoundingClientRect().right;  
26 25
  26 + if ($ele.find('.swiper-slide:last-child')[0]) {
  27 + offsetLastColumn = $ele.find('.swiper-slide:last-child')[0].getBoundingClientRect().right;
  28 + }
27 29
28 if (offsetLastColumn - offsetContainer < 0) { 30 if (offsetLastColumn - offsetContainer < 0) {
29 $ele.next('.tips').css('display', 'none'); 31 $ele.next('.tips').css('display', 'none');
@@ -119,4 +121,3 @@ function scrollHandler() { @@ -119,4 +121,3 @@ function scrollHandler() {
119 $(window).scroll(function() { 121 $(window).scroll(function() {
120 window.requestAnimationFrame(scrollHandler); 122 window.requestAnimationFrame(scrollHandler);
121 }); 123 });
122 -