Authored by 梁志锋

Merge branch 'fix/issue' into 'develop'

结算时如有库存不足的商品,显示库存不足商品种类数量

See merge request !79
@@ -26,6 +26,8 @@ var navHammer, @@ -26,6 +26,8 @@ var navHammer,
26 26
27 var isRefreshByDelete = window.cookie('_yoho-cart-refreshByDelete') === 'true' ? true : false; 27 var isRefreshByDelete = window.cookie('_yoho-cart-refreshByDelete') === 'true' ? true : false;
28 28
  29 +var lowStockCount = 0;
  30 +
29 31
30 loading.showLoadingMask(); 32 loading.showLoadingMask();
31 33
@@ -93,8 +95,8 @@ function shouldLowStocks() { @@ -93,8 +95,8 @@ function shouldLowStocks() {
93 95
94 $lowStocks.each(function(idx, item) { 96 $lowStocks.each(function(idx, item) {
95 if ($(item).parent().parent().parent().siblings('.checkbox').hasClass('icon-cb-checked')) { 97 if ($(item).parent().parent().parent().siblings('.checkbox').hasClass('icon-cb-checked')) {
  98 + lowStockCount += 1;
96 result = true; 99 result = true;
97 - return false;  
98 } 100 }
99 }); 101 });
100 102
@@ -185,8 +187,9 @@ if ($('.freebie').length > 0) { @@ -185,8 +187,9 @@ if ($('.freebie').length > 0) {
185 } 187 }
186 188
187 $('.btn-balance').on('touchend', function() { 189 $('.btn-balance').on('touchend', function() {
  190 + lowStockCount = 0;
188 if (shouldLowStocks()) { 191 if (shouldLowStocks()) {
189 - tip.show('所选商品中含有库存不足的商品'); 192 + tip.show('所选商品中有' + lowStockCount + '种库存不足的商品');
190 return false; 193 return false;
191 } 194 }
192 195