Showing
1 changed file
with
4 additions
and
12 deletions
@@ -117,7 +117,6 @@ $('.yoho-page').on('touchstart', '.chose-panel', function(e) { | @@ -117,7 +117,6 @@ $('.yoho-page').on('touchstart', '.chose-panel', function(e) { | ||
117 | $('.num-tag').html(numInCart + buyNumber); | 117 | $('.num-tag').html(numInCart + buyNumber); |
118 | $('.num-tag').removeClass('hide'); | 118 | $('.num-tag').removeClass('hide'); |
119 | confirming = false; | 119 | confirming = false; |
120 | - tip.show('选择成功'); | ||
121 | remove(); | 120 | remove(); |
122 | } | 121 | } |
123 | }).fail(function() { | 122 | }).fail(function() { |
@@ -148,21 +147,14 @@ $('.yoho-page').on('touchstart', '.chose-panel', function(e) { | @@ -148,21 +147,14 @@ $('.yoho-page').on('touchstart', '.chose-panel', function(e) { | ||
148 | } | 147 | } |
149 | 148 | ||
150 | if ($chosed.length === 0) { | 149 | if ($chosed.length === 0) { |
151 | - $colorList.each(function() { | 150 | + $this.closest('ul>li').each(function() { |
152 | $(this).removeClass('zero-stock'); | 151 | $(this).removeClass('zero-stock'); |
153 | if (0 === $(this).data('num') - 0) { | 152 | if (0 === $(this).data('num') - 0) { |
154 | $(this).addClass('zero-stock'); | 153 | $(this).addClass('zero-stock'); |
155 | } | 154 | } |
156 | }); | 155 | }); |
157 | 156 | ||
158 | - $sizeList.each(function() { | ||
159 | - colorIndex = $(this).data('colorid'); | ||
160 | - if (colorIndex === firstColorId) { | ||
161 | - $(this).removeClass('hide'); | ||
162 | - } | ||
163 | - }); | ||
164 | - | ||
165 | - $sizeList.not('.hide').each(function() { | 157 | + $siblingBlock.find('ul>li').each(function() { |
166 | $(this).removeClass('zero-stock'); | 158 | $(this).removeClass('zero-stock'); |
167 | if (0 === $(this).data('num') - 0) { | 159 | if (0 === $(this).data('num') - 0) { |
168 | $(this).addClass('zero-stock'); | 160 | $(this).addClass('zero-stock'); |
@@ -186,7 +178,7 @@ $('.yoho-page').on('touchstart', '.chose-panel', function(e) { | @@ -186,7 +178,7 @@ $('.yoho-page').on('touchstart', '.chose-panel', function(e) { | ||
186 | $siblingBlock.find('.block').removeClass('zero-stock'); | 178 | $siblingBlock.find('.block').removeClass('zero-stock'); |
187 | for (i = 0; i < numArray.length; i++) { | 179 | for (i = 0; i < numArray.length; i++) { |
188 | if (0 === numArray[i] - 0) { | 180 | if (0 === numArray[i] - 0) { |
189 | - $siblingBlock.find('.block').not('.hide').eq(i).addClass('zero-stock'); | 181 | + $siblingBlock.find('.block').eq(i).addClass('zero-stock'); |
190 | } | 182 | } |
191 | } | 183 | } |
192 | } else if ($chosed.length === 1 && !$this.hasClass('chosed')) { | 184 | } else if ($chosed.length === 1 && !$this.hasClass('chosed')) { |
@@ -207,7 +199,7 @@ $('.yoho-page').on('touchstart', '.chose-panel', function(e) { | @@ -207,7 +199,7 @@ $('.yoho-page').on('touchstart', '.chose-panel', function(e) { | ||
207 | $siblingBlock.find('.block').eq(i).addClass('zero-stock'); | 199 | $siblingBlock.find('.block').eq(i).addClass('zero-stock'); |
208 | } | 200 | } |
209 | } | 201 | } |
210 | - numArray = ($siblingBlock.find('.chosed').data('numstr') + '').split('/'); | 202 | + numArray = $siblingBlock.find('.chosed').data('numstr').split('/'); |
211 | $that.find('.num .left-num').html('剩余' + numArray[index] + '件'); | 203 | $that.find('.num .left-num').html('剩余' + numArray[index] + '件'); |
212 | if (2 === $chosed.closest('.zero-stock').length) { | 204 | if (2 === $chosed.closest('.zero-stock').length) { |
213 | $('#chose-btn-sure').css('background-color', '#c0c0c0'); | 205 | $('#chose-btn-sure').css('background-color', '#c0c0c0'); |
-
Please register or login to post a comment