Authored by yyq

Merge branch 'feature/shoppingCart' into release/5.4.1

@@ -76,9 +76,7 @@ const getOrderComputeAsync = (uid, cartType, paymentType, deliveryWay, other) => @@ -76,9 +76,7 @@ const getOrderComputeAsync = (uid, cartType, paymentType, deliveryWay, other) =>
76 Object.assign(param, { 76 Object.assign(param, {
77 coupon_code: other.couponCode 77 coupon_code: other.couponCode
78 }); 78 });
79 - }  
80 -  
81 - if (other.promotionCode) { 79 + } else if (other.promotionCode) {
82 Object.assign(param, { 80 Object.assign(param, {
83 promotion_code: other.promotionCode 81 promotion_code: other.promotionCode
84 }); 82 });
@@ -157,6 +155,10 @@ const orderSubmitAsync = (uid, cartType, addressId, deliveryTime, deliveryWay, p @@ -157,6 +155,10 @@ const orderSubmitAsync = (uid, cartType, addressId, deliveryTime, deliveryWay, p
157 Object.assign(param, { 155 Object.assign(param, {
158 coupon_code: other.couponCode 156 coupon_code: other.couponCode
159 }); 157 });
  158 + } else if (other.promotionCode) {
  159 + Object.assign(param, {
  160 + promotion_code: other.promotionCode
  161 + });
160 } 162 }
161 163
162 if (other.continueBuy) { 164 if (other.continueBuy) {
@@ -81,6 +81,8 @@ function compute(coin, cb) { @@ -81,6 +81,8 @@ function compute(coin, cb) {
81 // 优惠券 81 // 优惠券
82 if (order.couponCode) { 82 if (order.couponCode) {
83 reqData.couponCode = order.couponCode; 83 reqData.couponCode = order.couponCode;
  84 + } else if (order.promotionCode) {
  85 + reqData.promotionCode = order.promotionCode;
84 } 86 }
85 87
86 // 红包 88 // 红包
@@ -493,7 +495,7 @@ coupon = { @@ -493,7 +495,7 @@ coupon = {
493 couponId = $this.siblings('.coupon-code').val(); 495 couponId = $this.siblings('.coupon-code').val();
494 496
495 if (couponId) { 497 if (couponId) {
496 - order.couponCode = couponId; 498 + order.promotionCode = couponId;
497 499
498 // 重新计算订单价格 500 // 重新计算订单价格
499 compute(0, function() { 501 compute(0, function() {
@@ -529,6 +531,10 @@ coupon = { @@ -529,6 +531,10 @@ coupon = {
529 }); 531 });
530 }, 532 },
531 cancelTicketUse: function() { 533 cancelTicketUse: function() {
  534 + if (order.promotionCode) {
  535 + delete order.promotionCode;
  536 + }
  537 +
532 if (order.couponCode) { 538 if (order.couponCode) {
533 this.$ticketUseTip.addClass('hide'); 539 this.$ticketUseTip.addClass('hide');
534 this.$radios.filter('.on').removeClass('on'); 540 this.$radios.filter('.on').removeClass('on');
@@ -543,6 +549,10 @@ coupon = { @@ -543,6 +549,10 @@ coupon = {
543 549
544 if (order.couponCode) { 550 if (order.couponCode) {
545 delete order.couponCode; 551 delete order.couponCode;
  552 + }
  553 +
  554 + if (order.promotionCode) {
  555 + delete order.promotionCode;
546 compute(); // 重新计算订单价格 556 compute(); // 重新计算订单价格
547 } 557 }
548 }, 558 },