Authored by 郝肖肖

Merge branch 'feature/meal' into release/5.6

@@ -361,18 +361,13 @@ function parseProductInfo(productInfo, defaultInfo) { @@ -361,18 +361,13 @@ function parseProductInfo(productInfo, defaultInfo) {
361 }; 361 };
362 } 362 }
363 363
364 -function updateCartItem(newSku, oldSku) { 364 +function updateCartItem(swapData) {
365 365
366 return $.ajax({ 366 return $.ajax({
367 type: 'POST', 367 type: 'POST',
368 url: '/cart/cart/updateProduct', 368 url: '/cart/cart/updateProduct',
369 data: { 369 data: {
370 - swapData: JSON.stringify([{  
371 - buy_number: '1',  
372 - selected: 'Y',  
373 - new_product_sku: newSku,  
374 - old_product_sku: oldSku  
375 - }]) 370 + swapData: JSON.stringify([swapData])
376 } 371 }
377 }).then(function(d) { 372 }).then(function(d) {
378 if (d.code === 200) { 373 if (d.code === 200) {
@@ -75,11 +75,14 @@ ColorPanelAction = { @@ -75,11 +75,14 @@ ColorPanelAction = {
75 var $item = $this.closest('li[data-role="pitem"]'); 75 var $item = $this.closest('li[data-role="pitem"]');
76 76
77 // var pid = $item.data('pid'); 77 // var pid = $item.data('pid');
  78 + var swapData = {};
78 var oldSku = $item.data('id'); 79 var oldSku = $item.data('id');
79 var $size = $this.closest('.goods-choose-box').find('.choose-size .dt.active'); 80 var $size = $this.closest('.goods-choose-box').find('.choose-size .dt.active');
80 var newSku = $size.data('sku'); 81 var newSku = $size.data('sku');
81 var newSkn = $this.closest('.goods-info').data('skn'); 82 var newSkn = $this.closest('.goods-info').data('skn');
82 var promotionId = $item.data('promotionid'); 83 var promotionId = $item.data('promotionid');
  84 + var poolId = $item.data('pool-id');
  85 + var batchNo = $item.data('batch-no');
83 86
84 // 没有重新选择颜色-尺码,则不用重新请求显示 87 // 没有重新选择颜色-尺码,则不用重新请求显示
85 if (!oldSku || !newSku || oldSku === newSku) { 88 if (!oldSku || !newSku || oldSku === newSku) {
@@ -91,7 +94,23 @@ ColorPanelAction = { @@ -91,7 +94,23 @@ ColorPanelAction = {
91 if ($item.data('isgift') || $item.data('ispricegift')) { 94 if ($item.data('isgift') || $item.data('ispricegift')) {
92 return capi.updateCartGiftItem(promotionId, newSkn, newSku); 95 return capi.updateCartGiftItem(promotionId, newSkn, newSku);
93 } 96 }
94 - capi.updateCartItem(newSku, oldSku); 97 +
  98 + swapData = {
  99 + buy_number: '1',
  100 + selected: 'Y',
  101 + new_product_sku: newSku,
  102 + old_product_sku: oldSku
  103 + }
  104 +
  105 + // 套餐编辑尺码
  106 + if (poolId) {
  107 + $.extend(swapData, {
  108 + activity_id: poolId,
  109 + batch_no: batchNo
  110 + });
  111 + }
  112 +
  113 + capi.updateCartItem(swapData);
95 }, 114 },
96 _hideColorSizePanel: function($item) { 115 _hideColorSizePanel: function($item) {
97 $item.find('.goods-choose-box').hide(); 116 $item.find('.goods-choose-box').hide();