Authored by 郭成尧

order-ensure-handle

@@ -101,6 +101,8 @@ exports.cartPay = (params) => { @@ -101,6 +101,8 @@ exports.cartPay = (params) => {
101 paymentProcess.tranformPayment(pay.data, params.orderInfo, params.cartType, skuList, orderCompute), 101 paymentProcess.tranformPayment(pay.data, params.orderInfo, params.cartType, skuList, orderCompute),
102 { 102 {
103 coupon: paymentProcess.coupon(validCouponCount, params.orderInfo, orderCompute), 103 coupon: paymentProcess.coupon(validCouponCount, params.orderInfo, orderCompute),
  104 + },
  105 + {
104 giftCards: paymentProcess.handleGiftCards({ 106 giftCards: paymentProcess.handleGiftCards({
105 validGiftCardCount: validGiftCardCount, 107 validGiftCardCount: validGiftCardCount,
106 orderInfo: params.orderInfo, 108 orderInfo: params.orderInfo,
@@ -133,8 +133,8 @@ @@ -133,8 +133,8 @@
133 <a href="{{choseGiftCard}}"> 133 <a href="{{choseGiftCard}}">
134 <span class="title">礼品卡</span> 134 <span class="title">礼品卡</span>
135 {{# giftCards}} 135 {{# giftCards}}
136 - <span class="count">{{#if selectedAmount}}已选{{selectedAmount}}{{^}}{{count}}张可用{{/if}}</span>  
137 - <span class="coupon-info pull-right{{#isEqualOr info '无可用'}} no-can-use{{/isEqualOr}}"> 136 + <span class="count">{{#if selectCount}}已选{{selectCount}}{{^}}{{count}}张可用{{/if}}</span>
  137 + <span class="coupon-info pull-right{{#isEqualOr info '未使用'}} no-can-use{{/isEqualOr}}">
138 {{info}}<i class="iconfont">&#xe614;</i> 138 {{info}}<i class="iconfont">&#xe614;</i>
139 </span> 139 </span>
140 {{/giftCards}} 140 {{/giftCards}}
@@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
23 </div> 23 </div>
24 <div class="content-li clearfix"> 24 <div class="content-li clearfix">
25 <div class="left-label pull-left">有效期</div> 25 <div class="left-label pull-left">有效期</div>
26 - <div class="pull-left">{{dateStr}}{{#if willExpireDesc}} <span class="tip">(即将过期)</span>{{/if}}</div> 26 + <div class="pull-left">{{dateStr}}{{#if willExpire}} <span class="tip">(即将过期)</span>{{/if}}</div>
27 </div> 27 </div>
28 </div> 28 </div>
29 <div class="checkbox pull-right"> 29 <div class="checkbox pull-right">
@@ -375,7 +375,19 @@ function coupon(count, orderInfo, orderComputeData) { @@ -375,7 +375,19 @@ function coupon(count, orderInfo, orderComputeData) {
375 * 处理礼品卡数据 375 * 处理礼品卡数据
376 */ 376 */
377 function handleGiftCards(params) { 377 function handleGiftCards(params) {
378 - return params; 378 + let info = '未使用'; // TODO
  379 +
  380 + let amount = _.get(params, 'orderCompute.gift_card.amount', 0);
  381 +
  382 + if (amount) {
  383 + info = `可以抵用¥${amount.toFixed(2)}`;
  384 + }
  385 + return {
  386 + count: params.validGiftCardCount,
  387 + amount: amount,
  388 + selectCount: _.get(params, 'orderCompute.gift_card.count', 0),
  389 + info: info
  390 + };
379 } 391 }
380 392
381 /** 393 /**