Authored by Rock Zhang

修改结算页面发票以及支付方式的一些逻辑

@@ -634,6 +634,13 @@ class Helpers @@ -634,6 +634,13 @@ class Helpers
634 $oneGoods['marketPrice'] = self::transPrice($single['market_price']); 634 $oneGoods['marketPrice'] = self::transPrice($single['market_price']);
635 $oneGoods['count'] = $single['storage_number']; 635 $oneGoods['count'] = $single['storage_number'];
636 636
  637 + //gift=>是否赠品,advanceBuy=>是否加价购,soldOut=>失效商品;
  638 + if ($single['goods_type'] == 'gift' && !isset($single['isAdvanceBuy'])) {
  639 + $oneGoods['isGift'] = true;
  640 + } elseif ($single['goods_type'] == 'price_gift') {
  641 + $oneGoods['isAdvanceBuy'] = true;
  642 + }
  643 +
637 $gift['goods'][] = $oneGoods; 644 $gift['goods'][] = $oneGoods;
638 } 645 }
639 646
@@ -140,8 +140,8 @@ function submitOrder() { @@ -140,8 +140,8 @@ function submitOrder() {
140 cartType: queryString.cartType || queryString.carttype || 'ordinary', 140 cartType: queryString.cartType || queryString.carttype || 'ordinary',
141 deliveryId: orderInfo('deliveryId'), 141 deliveryId: orderInfo('deliveryId'),
142 deliveryTimeId: orderInfo('deliveryTimeId'), 142 deliveryTimeId: orderInfo('deliveryTimeId'),
143 - invoiceText: invoiceText,  
144 - invoiceType: $invoice.find('.invoice-type').val() || orderInfo('invoiceType'), 143 + invoiceText: orderInfo('invoice') ? invoiceText : null,
  144 + invoiceType: orderInfo('invoice') ? ($invoice.find('.invoice-type').val() || orderInfo('invoiceType')) : null,
145 msg: msg, 145 msg: msg,
146 paymentTypeId: orderInfo('paymentTypeId'), 146 paymentTypeId: orderInfo('paymentTypeId'),
147 paymentType: orderInfo('paymentType'), //支付方式 147 paymentType: orderInfo('paymentType'), //支付方式
@@ -112,6 +112,7 @@ @@ -112,6 +112,7 @@
112 112
113 <ul class="pay-mode"> 113 <ul class="pay-mode">
114 {{# paymentWay}} 114 {{# paymentWay}}
  115 + {{#if isSupport}}
115 <li class="{{#if recommend}}default{{/if}}" data-pay-type="{{paymentType}}" data-pay-id="{{id}}"> 116 <li class="{{#if recommend}}default{{/if}}" data-pay-type="{{paymentType}}" data-pay-id="{{id}}">
116 <span class="iconfont"> 117 <span class="iconfont">
117 {{#if recommend}} 118 {{#if recommend}}
@@ -122,6 +123,7 @@ @@ -122,6 +123,7 @@
122 </span> 123 </span>
123 {{name}} 124 {{name}}
124 </li> 125 </li>
  126 + {{/if}}
125 {{/ paymentWay}} 127 {{/ paymentWay}}
126 </ul> 128 </ul>
127 {{/ orderEnsure}} 129 {{/ orderEnsure}}
@@ -436,6 +436,7 @@ class CartModel @@ -436,6 +436,7 @@ class CartModel
436 $onePay['id'] = $pay['payment_id']; 436 $onePay['id'] = $pay['payment_id'];
437 $onePay['paymentType'] = $pay['payment_type']; 437 $onePay['paymentType'] = $pay['payment_type'];
438 $onePay['name'] = $pay['payment_type_name']; 438 $onePay['name'] = $pay['payment_type_name'];
  439 + $onePay['isSupport'] = $pay['is_support'] === 'Y';
439 // $onePay['default'] = ($pay['default'] === 'Y'); 440 // $onePay['default'] = ($pay['default'] === 'Y');
440 if ($onePay['paymentType'] == 1) { 441 if ($onePay['paymentType'] == 1) {
441 $onePay['recommend'] = true; 442 $onePay['recommend'] = true;
@@ -453,24 +454,6 @@ class CartModel @@ -453,24 +454,6 @@ class CartModel
453 $result['cartPayData'] = isset($orderCompute['promotion_formula_list']) ? $orderCompute['promotion_formula_list'] : $payReturn['shopping_cart_data']['promotion_formula_list']; 454 $result['cartPayData'] = isset($orderCompute['promotion_formula_list']) ? $orderCompute['promotion_formula_list'] : $payReturn['shopping_cart_data']['promotion_formula_list'];
454 $price = isset($orderCompute['last_order_amount']) ? $orderCompute['last_order_amount'] : $payReturn['shopping_cart_data']['last_order_amount']; 455 $price = isset($orderCompute['last_order_amount']) ? $orderCompute['last_order_amount'] : $payReturn['shopping_cart_data']['last_order_amount'];
455 $result['price'] = Helpers::transPrice($price); 456 $result['price'] = Helpers::transPrice($price);
456 -  
457 - /*$sumPrice = isset($orderCompute['order_amount']) ? $orderCompute['order_amount'] : $payReturn['shopping_cart_data']['order_amount'];  
458 -  
459 - $freight = '¥0';  
460 - if (isset($orderCompute['promotion_formula_list'][1]['promotion_amount'])) {  
461 - $freight = $orderCompute['promotion_formula_list'][1]['promotion_amount'];  
462 - } elseif(isset($payReturn['shopping_cart_data']['promotion_formula_list'][1]['promotion_amount'])) {  
463 - $freight = $payReturn['shopping_cart_data']['promotion_formula_list'][1]['promotion_amount'];  
464 - }  
465 -  
466 - $couponPrice = isset($orderCompute['coupon_amount']) ? $orderCompute['coupon_amount'] : false;  
467 - $salePrice = isset($orderCompute['discount_amount']) ? $orderCompute['discount_amount'] : $payReturn['shopping_cart_data']['discount_amount'];  
468 - $price = isset($orderCompute['last_order_amount']) ? $orderCompute['last_order_amount'] : $payReturn['shopping_cart_data']['last_order_amount'];  
469 - $result['sumPrice'] = Helpers::transPrice($sumPrice);  
470 - $result['salePrice'] = Helpers::transPrice($salePrice);  
471 - $result['price'] = Helpers::transPrice($price);  
472 - $result['freight'] = $freight;  
473 - $result['couponPrice'] = $couponPrice;*/  
474 } 457 }
475 458
476 // 发票有关数据 459 // 发票有关数据