Authored by Rock Zhang

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

@@ -41,7 +41,7 @@ @@ -41,7 +41,7 @@
41 41
42 <section class="block"> 42 <section class="block">
43 <ul class="sale-invoice"> 43 <ul class="sale-invoice">
44 - {{# coupon}} 44 + {{#if coupon}}
45 <li class="coupon"> 45 <li class="coupon">
46 <a href="/shoppingCart/selectCoupon"> 46 <a href="/shoppingCart/selectCoupon">
47 <!-- <a href="{{url}}"> --> 47 <!-- <a href="{{url}}"> -->
@@ -65,7 +65,7 @@ @@ -65,7 +65,7 @@
65 {{/if}} 65 {{/if}}
66 </a> 66 </a>
67 </li> 67 </li>
68 - {{/ coupon}} 68 + {{/if}}
69 69
70 {{# yohoCoin}} 70 {{# yohoCoin}}
71 <li class="coin" data-yoho-coin="{{.}}"> 71 <li class="coin" data-yoho-coin="{{.}}">
@@ -79,16 +79,16 @@ @@ -79,16 +79,16 @@
79 {{/ yohoCoin}} 79 {{/ yohoCoin}}
80 80
81 {{#if invoice}} 81 {{#if invoice}}
82 - <li class="invoice"> 82 + <li class="invoice {{#if needInvoice}}focus{{/if}}">
83 <span class="title">发票</span> 83 <span class="title">发票</span>
84 - <span class="iconfont checkbox icon-checkbox"></span> 84 + <span class="iconfont checkbox {{#if needInvoice}}icon-cb-checked{{else}}icon-checkbox{{/if}}"></span>
85 <form id="invoice"> 85 <form id="invoice">
86 - <input type="text" name="invoice-title" value="" placeholder="发票抬头"> 86 + <input type="text" name="invoice-title" value="{{invoiceText}}" placeholder="发票抬头">
87 <label> 87 <label>
88 发票类型 88 发票类型
89 <select class="invoice-type" name="invoice-type"> 89 <select class="invoice-type" name="invoice-type">
90 {{# invoice}} 90 {{# invoice}}
91 - <option value="{{id}}">{{name}}</option> 91 + <option value="{{id}}" {{#if isSelected}}selected{{/if}}>{{name}}</option>
92 {{/ invoice}} 92 {{/ invoice}}
93 </select> 93 </select>
94 </label> 94 </label>
@@ -98,7 +98,7 @@ @@ -98,7 +98,7 @@
98 </ul> 98 </ul>
99 99
100 <form id="msg" action="" method="post"> 100 <form id="msg" action="" method="post">
101 - <input type="text" name="msg" value="" placeholder="留言"> 101 + <input type="text" name="msg" value="{{msg}}" placeholder="留言">
102 </form> 102 </form>
103 </section> 103 </section>
104 104
@@ -449,13 +449,21 @@ class CartModel @@ -449,13 +449,21 @@ class CartModel
449 $one = array(); 449 $one = array();
450 $one['id'] = $inv['invoices_type_id']; 450 $one['id'] = $inv['invoices_type_id'];
451 $one['name'] = $inv['invoices_type_name']; 451 $one['name'] = $inv['invoices_type_name'];
  452 + $one['id'] == $orderInfo['invoiceType'] && $one['isSelected'] = true;
452 453
453 $result['invoice'][] = $one; 454 $result['invoice'][] = $one;
454 } 455 }
  456 +
  457 + // 发票信息需要记录
  458 + $result['needInvoice'] = $orderInfo['invoice'];
  459 + $result['invoiceText'] = $orderInfo['invoiceText'];
455 } 460 }
456 461
  462 + // 留言
  463 + $result['msg'] = $orderInfo['msg'];
  464 +
457 // 优惠券数据 465 // 优惠券数据
458 - $coupons = array('notUsed' => true); 466 + $coupons = array();
459 !empty($orderCompute['coupon_amount']) && $coupons['value'] = $orderInfo['couponValue']; 467 !empty($orderCompute['coupon_amount']) && $coupons['value'] = $orderInfo['couponValue'];
460 $coupons += self::getCouponList($uid, 0, 1, true); 468 $coupons += self::getCouponList($uid, 0, 1, true);
461 $result['coupon'] = $coupons; 469 $result['coupon'] = $coupons;