Authored by 毕凯

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop

@@ -66,7 +66,7 @@ $('.freebie').on('touchend', function() { @@ -66,7 +66,7 @@ $('.freebie').on('touchend', function() {
66 66
67 $('.btn-balance').on('touchend', function() { 67 $('.btn-balance').on('touchend', function() {
68 if ($('.low-stocks').length > 0) { 68 if ($('.low-stocks').length > 0) {
69 - tip.show('请先删除库存不足商品'); 69 + tip.show('库存不足无法结算');
70 return false; 70 return false;
71 } 71 }
72 72
@@ -310,7 +310,6 @@ $yohoPage.on('touchstart', '.btn-minus', function() { @@ -310,7 +310,6 @@ $yohoPage.on('touchstart', '.btn-minus', function() {
310 310
311 promotionId, 311 promotionId,
312 isEdit = 0, 312 isEdit = 0,
313 - numInCart = $('.num-tag').html() - 0,  
314 num = parseInt($num.val(), 10); 313 num = parseInt($num.val(), 10);
315 314
316 //颜色尺码没有选择 315 //颜色尺码没有选择
@@ -322,7 +321,6 @@ $yohoPage.on('touchstart', '.btn-minus', function() { @@ -322,7 +321,6 @@ $yohoPage.on('touchstart', '.btn-minus', function() {
322 return; 321 return;
323 } 322 }
324 323
325 -  
326 //TODO status change 324 //TODO status change
327 if ($('#chose-btn-sure').html() === '已售罄') { 325 if ($('#chose-btn-sure').html() === '已售罄') {
328 return; 326 return;
@@ -364,7 +362,7 @@ $yohoPage.on('touchstart', '.btn-minus', function() { @@ -364,7 +362,7 @@ $yohoPage.on('touchstart', '.btn-minus', function() {
364 362
365 loading.hideLoadingMask(); 363 loading.hideLoadingMask();
366 if (res.code === 200) { 364 if (res.code === 200) {
367 - cartNum = numInCart + buyNumber; 365 + cartNum = res.data.goods_count;
368 if (cartNum > 99) { 366 if (cartNum > 99) {
369 cartNum = '99+'; 367 cartNum = '99+';
370 } 368 }
@@ -27,6 +27,13 @@ $('.shopping-cart-good .name').each(function() { @@ -27,6 +27,13 @@ $('.shopping-cart-good .name').each(function() {
27 this.mlellipsis(2); 27 this.mlellipsis(2);
28 }); 28 });
29 29
  30 +function GoodInfo(properties) {
  31 + this.goods_type = properties.goods_type;
  32 + this.buy_number = properties.buy_number;
  33 + this.product_sku = properties.product_sku;
  34 + this.selected = properties.selected;
  35 +}
  36 +
30 //TIP:事件委托在.cart-goods,商品列表的容器统一需要有.cart-goods 37 //TIP:事件委托在.cart-goods,商品列表的容器统一需要有.cart-goods
31 $('.cart-goods').on('touchstart', '.checkbox', function() { 38 $('.cart-goods').on('touchstart', '.checkbox', function() {
32 var $this = $(this), 39 var $this = $(this),
@@ -43,12 +50,7 @@ $('.cart-goods').on('touchstart', '.checkbox', function() { @@ -43,12 +50,7 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
43 isSelected = false; 50 isSelected = false;
44 } 51 }
45 52
46 - function GoodInfo(properties) {  
47 - this.goods_type = properties.goods_type;  
48 - this.buy_number = properties.buy_number;  
49 - this.product_sku = properties.product_sku;  
50 - this.selected = properties.selected;  
51 - } 53 +
52 54
53 goodInfo.goods_type = cartType; 55 goodInfo.goods_type = cartType;
54 goodInfo.selected = isSelected ? 'N' : 'Y'; 56 goodInfo.selected = isSelected ? 'N' : 'Y';
@@ -174,17 +176,10 @@ function didUpdateAllGoodsCheckStatus() { @@ -174,17 +176,10 @@ function didUpdateAllGoodsCheckStatus() {
174 } 176 }
175 177
176 function bottomCheckBoxHandeler(isSelected, type, handlerAfterTouch) { 178 function bottomCheckBoxHandeler(isSelected, type, handlerAfterTouch) {
177 - var goodInfo = {};  
178 - var $goods = $('.cart-content:not(.hide) .shopping-cart-good');  
179 - var $good = null;  
180 - var goodsList = [];  
181 -  
182 - function GoodInfo(properties) {  
183 - this.goods_type = properties.goods_type;  
184 - this.buy_number = properties.buy_number;  
185 - this.product_sku = properties.product_sku;  
186 - this.selected = properties.selected;  
187 - } 179 + var goodInfo = {},
  180 + $goods = $('.cart-content:not(.hide) .shopping-cart-good'),
  181 + $good = null,
  182 + goodsList = [];
188 183
189 goodInfo.goods_type = type; 184 goodInfo.goods_type = type;
190 goodInfo.selected = isSelected ? 'N' : 'Y'; 185 goodInfo.selected = isSelected ? 'N' : 'Y';