Authored by 梁志锋

购物车尺码颜色选择

@@ -92,9 +92,10 @@ function resetColorZeroStock($siblingBlock) { @@ -92,9 +92,10 @@ function resetColorZeroStock($siblingBlock) {
92 92
93 if (!hasChooseSize) { 93 if (!hasChooseSize) {
94 $siblingBlock.find('ul>li').each(function() { 94 $siblingBlock.find('ul>li').each(function() {
95 - $(this).removeClass('zero-stock');  
96 if (0 === $(this).data('num')) { 95 if (0 === $(this).data('num')) {
97 $(this).addClass('zero-stock'); 96 $(this).addClass('zero-stock');
  97 + } else {
  98 + $(this).removeClass('zero-stock');
98 } 99 }
99 }); 100 });
100 101
@@ -103,6 +104,8 @@ function resetColorZeroStock($siblingBlock) { @@ -103,6 +104,8 @@ function resetColorZeroStock($siblingBlock) {
103 for (i = 0; i < numArray.length; i++) { 104 for (i = 0; i < numArray.length; i++) {
104 if ('0' === numArray[i]) { 105 if ('0' === numArray[i]) {
105 $siblingBlock.find('.block').eq(i).addClass('zero-stock'); 106 $siblingBlock.find('.block').eq(i).addClass('zero-stock');
  107 + } else {
  108 + $siblingBlock.find('.block').eq(i).removeClass('zero-stock');
106 } 109 }
107 } 110 }
108 } 111 }