Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop
Showing
1 changed file
with
10 additions
and
0 deletions
@@ -29,6 +29,7 @@ var $chosePanel = $('#chose-panel'), | @@ -29,6 +29,7 @@ var $chosePanel = $('#chose-panel'), | ||
29 | cbFn, | 29 | cbFn, |
30 | $allChoseItems, | 30 | $allChoseItems, |
31 | queryString, | 31 | queryString, |
32 | + $soonSoldOut = $('.soonSoldOut-tag'), | ||
32 | $yohoPage = $('.yoho-page'); | 33 | $yohoPage = $('.yoho-page'); |
33 | 34 | ||
34 | //初始化购物车面板显示 | 35 | //初始化购物车面板显示 |
@@ -210,7 +211,12 @@ $yohoPage.on('touchstart', '.color-list .block', function() { | @@ -210,7 +211,12 @@ $yohoPage.on('touchstart', '.color-list .block', function() { | ||
210 | 211 | ||
211 | //如果当前有尺码被选中,且数量等于0,则颜色块添加数量为0的样式 | 212 | //如果当前有尺码被选中,且数量等于0,则颜色块添加数量为0的样式 |
212 | if (curGoodNum > 0) { | 213 | if (curGoodNum > 0) { |
214 | + if ($soonSoldOut.length > 0) { | ||
215 | + $allChoseItems.find('.num .left-num').html('即将售罄'); | ||
216 | + } else { | ||
213 | $allChoseItems.find('.num .left-num').html('剩余' + curGoodNum + '件'); | 217 | $allChoseItems.find('.num .left-num').html('剩余' + curGoodNum + '件'); |
218 | + } | ||
219 | + | ||
214 | $leftNum.val(curGoodNum); | 220 | $leftNum.val(curGoodNum); |
215 | } else { | 221 | } else { |
216 | $allChoseItems.find('.num .left-num').html(''); | 222 | $allChoseItems.find('.num .left-num').html(''); |
@@ -263,7 +269,11 @@ $yohoPage.on('touchstart', '.color-list .block', function() { | @@ -263,7 +269,11 @@ $yohoPage.on('touchstart', '.color-list .block', function() { | ||
263 | 269 | ||
264 | // 如果当前有尺码被选中,且数量等于0, 否则显示剩余件数 | 270 | // 如果当前有尺码被选中,且数量等于0, 否则显示剩余件数 |
265 | if (curGoodNum > 0 && hasChooseColor) { | 271 | if (curGoodNum > 0 && hasChooseColor) { |
272 | + if ($soonSoldOut.length > 0) { | ||
273 | + $allChoseItems.find('.num .left-num').html('即将售罄'); | ||
274 | + } else { | ||
266 | $allChoseItems.find('.num .left-num').html('剩余' + curGoodNum + '件'); | 275 | $allChoseItems.find('.num .left-num').html('剩余' + curGoodNum + '件'); |
276 | + } | ||
267 | $('#left-num').val(curGoodNum); | 277 | $('#left-num').val(curGoodNum); |
268 | } else { | 278 | } else { |
269 | $allChoseItems.find('.num .left-num').html(''); | 279 | $allChoseItems.find('.num .left-num').html(''); |
-
Please register or login to post a comment