Merge branch 'feature/invoice' into release/4.7
Showing
17 changed files
with
518 additions
and
43 deletions
@@ -359,8 +359,10 @@ class CartData | @@ -359,8 +359,10 @@ class CartData | ||
359 | * @param string $cartType 购物车类型 | 359 | * @param string $cartType 购物车类型 |
360 | * @param int $deliveryTime 寄送时间ID | 360 | * @param int $deliveryTime 寄送时间ID |
361 | * @param int $deliveryWay 寄送方式ID | 361 | * @param int $deliveryWay 寄送方式ID |
362 | - * @param string $invoiceTitle 发票说明 | ||
363 | - * @param int $invoiceId 发票类型ID | 362 | + * @param int $invoiceType 发票类型 1:纸质,2:电子 |
363 | + * @param string $invoiceTitle 发票抬头 | ||
364 | + * @param int $invoiceContent 发票内容 | ||
365 | + * @param string $receiverMobile 发票接收人电话 | ||
364 | * @param int $paymentId 支付方式ID | 366 | * @param int $paymentId 支付方式ID |
365 | * @param int $paymentType 支付类型ID | 367 | * @param int $paymentType 支付类型ID |
366 | * @param string $remark 留言 | 368 | * @param string $remark 留言 |
@@ -374,7 +376,7 @@ class CartData | @@ -374,7 +376,7 @@ class CartData | ||
374 | * @param int $redEnvelopes 红包 | 376 | * @param int $redEnvelopes 红包 |
375 | * @return array 接口返回的数据 | 377 | * @return array 接口返回的数据 |
376 | */ | 378 | */ |
377 | - public static function orderSub($uid, $addressId, $cartType, $deliveryTime, $deliveryWay, $invoiceTitle, $invoiceId, | 379 | + public static function orderSub($uid, $addressId, $cartType, $deliveryTime, $deliveryWay, $invoiceType, $invoiceTitle, $invoiceContent, $receiverMobile, |
378 | $paymentId, $paymentType, $remark,$couponCode,$promotionCode, $yohoCoin, $isPreContact, $isPrintPrice, $unionKey,$userAgent, $redEnvelopes) | 380 | $paymentId, $paymentType, $remark,$couponCode,$promotionCode, $yohoCoin, $isPreContact, $isPrintPrice, $unionKey,$userAgent, $redEnvelopes) |
379 | { | 381 | { |
380 | $param = Yohobuy::param(); | 382 | $param = Yohobuy::param(); |
@@ -387,11 +389,18 @@ class CartData | @@ -387,11 +389,18 @@ class CartData | ||
387 | $param['delivery_time'] = $deliveryTime; | 389 | $param['delivery_time'] = $deliveryTime; |
388 | $param['delivery_way'] = $deliveryWay; | 390 | $param['delivery_way'] = $deliveryWay; |
389 | $param['uid'] = $uid; | 391 | $param['uid'] = $uid; |
392 | + | ||
393 | + if (!empty($invoiceType)) { | ||
394 | + $param['invoices_type'] = $invoiceType; | ||
395 | + } | ||
390 | if (!empty($invoiceTitle)) { | 396 | if (!empty($invoiceTitle)) { |
391 | $param['invoices_title'] = $invoiceTitle; | 397 | $param['invoices_title'] = $invoiceTitle; |
392 | } | 398 | } |
393 | - if (!empty($invoiceId)) { | ||
394 | - $param['invoices_type_id'] = $invoiceId; | 399 | + if (!empty($invoiceContent)) { |
400 | + $param['invoice_content'] = $invoiceContent; | ||
401 | + } | ||
402 | + if (!empty($receiverMobile)) { | ||
403 | + $param['receiverMobile'] = $receiverMobile; | ||
395 | } | 404 | } |
396 | if (!empty($redEnvelopes)) { | 405 | if (!empty($redEnvelopes)) { |
397 | $param['use_red_envelopes'] = $redEnvelopes; | 406 | $param['use_red_envelopes'] = $redEnvelopes; |
@@ -420,7 +429,6 @@ class CartData | @@ -420,7 +429,6 @@ class CartData | ||
420 | } | 429 | } |
421 | $param['remark'] = $remark; | 430 | $param['remark'] = $remark; |
422 | $param['client_secret'] = Sign::getSign($param); | 431 | $param['client_secret'] = Sign::getSign($param); |
423 | - | ||
424 | return Yohobuy::get(Yohobuy::API_URL, $param, false, false, 10, $userAgent); | 432 | return Yohobuy::get(Yohobuy::API_URL, $param, false, false, 10, $userAgent); |
425 | } | 433 | } |
426 | 434 | ||
@@ -522,5 +530,5 @@ class CartData | @@ -522,5 +530,5 @@ class CartData | ||
522 | $param['payment'] = $payment; | 530 | $param['payment'] = $payment; |
523 | $param['client_secret'] = Sign::getSign($param); | 531 | $param['client_secret'] = Sign::getSign($param); |
524 | return Yohobuy::get(Yohobuy::API_URL, $param); | 532 | return Yohobuy::get(Yohobuy::API_URL, $param); |
525 | - } | 533 | + } |
526 | } | 534 | } |
@@ -278,24 +278,28 @@ | @@ -278,24 +278,28 @@ | ||
278 | </tbody> | 278 | </tbody> |
279 | </table> | 279 | </table> |
280 | <!--YOHO--> | 280 | <!--YOHO--> |
281 | + | ||
282 | + <div class="section-play"> | ||
283 | + <div class="section-head">发票信息</div> | ||
284 | + <div class="play-pan"> | ||
285 | + <input class="invoice mes" name="invoice" type="radio" id=""/>发票开具 | ||
286 | + <div class="invoice-content hide"> | ||
287 | + <div class="invoice-type mes">电子发票</div> | ||
288 | + <div class="invoice-partment mes">个人</div> | ||
289 | + <div class="invoice-kind mes">服装</div> | ||
290 | + <button class="revise mes">修改 | ||
291 | + </div> | ||
292 | + <div class='invoice-upload hide'> | ||
293 | + <div class="invoice-upload-type"></div> | ||
294 | + <div class="invoice-upload-content"></div> | ||
295 | + <div class="invoice-upload-mobile"></div> | ||
296 | + <div class="invoice-upload-title"></div> | ||
297 | + </div> | ||
298 | + </div> | ||
299 | + </div> | ||
300 | + | ||
281 | <div class="play-content clearfix"> | 301 | <div class="play-content clearfix"> |
282 | <div class="play-left"> | 302 | <div class="play-left"> |
283 | - <dl class="play-piao-pan pan"> | ||
284 | - <dt>索要发票</dt> | ||
285 | - <dd> | ||
286 | - <div class="play-pan"> | ||
287 | - <ul> | ||
288 | - <li><label>发票抬头 :</label><input type="text" class="textbox" id="piaodesc" /></li> | ||
289 | - <li><label>发票类型 :</label> <select class="dropdown" id="piaotype"> | ||
290 | - <option value="0">请选择</option> | ||
291 | - {{#each piaoTypes}} | ||
292 | - <option value="{{id}}">{{name}}</option> | ||
293 | - {{/each}} | ||
294 | - </select> </li> | ||
295 | - </ul> | ||
296 | - </div> | ||
297 | - </dd> | ||
298 | - </dl> | ||
299 | <dl class="play-remark-pan pan"> | 303 | <dl class="play-remark-pan pan"> |
300 | <dt>添加备注信息</dt> | 304 | <dt>添加备注信息</dt> |
301 | <dd> | 305 | <dd> |
@@ -391,7 +395,70 @@ | @@ -391,7 +395,70 @@ | ||
391 | </div> | 395 | </div> |
392 | </div> | 396 | </div> |
393 | </div> | 397 | </div> |
398 | + | ||
399 | + <div class="receipt-info hide"> | ||
400 | + <div class="receipt-mask"> | ||
401 | + </div> | ||
402 | + | ||
403 | + <div class="receipt-info-container"> | ||
404 | + <div class="receipt-title">发票信息 | ||
405 | + </div> | ||
406 | + | ||
407 | + <div class="receipt-type receipt-margin"> | ||
408 | + <span class="e-receipt receipt-type-selected">电子发票</span> | ||
409 | + <span class="paper-receipt">纸质发票</span> | ||
410 | + </div> | ||
411 | + | ||
412 | + <div class="receipt-container receipt-margin"> | ||
413 | + <div class="e-receipt-desc"> | ||
414 | + </div> | ||
415 | + | ||
416 | + <div class="invoice-list invoice-title invoice-title-personal-hight"> | ||
417 | + <span class="invoice-star">*</span> | ||
418 | + <span class="invoice-list-type">发票抬头</span> | ||
419 | + <div class="invoice-line first-line"> | ||
420 | + <input checked="true" type="radio" value="1" name="title" /> | ||
421 | + <label>个人</label> | ||
422 | + <input type="radio" value="2" name="title" /> | ||
423 | + <label>单位</label> | ||
424 | + </div> | ||
425 | + <div class="invoice-line second-line input-line hide"> | ||
426 | + <input id="input-organization-name" type="text" placeholder="请填写单位名称" maxlength="30"/> | ||
427 | + <i class="enpty-input iconfont hide"> 请填写发票抬头</i> | ||
428 | + </div> | ||
429 | + </div> | ||
430 | + | ||
431 | + <div class="invoice-list invoice-content"> | ||
432 | + <span class="invoice-star">*</span> | ||
433 | + <span class="invoice-list-type">发票内容</span> | ||
434 | + <div class="invoice-line first-line"> | ||
435 | + {{# piaoTypes}} | ||
436 | + <div class="blind"> | ||
437 | + <input {{#if @first}}checked="true"{{/if}} type="radio" value="{{name}}" name="content" data-receiptID="{{id}}"/> | ||
438 | + <label>{{name}}</label> | ||
439 | + </div> | ||
440 | + {{/ piaoTypes}} | ||
441 | + </div> | ||
442 | + </div> | ||
443 | + | ||
444 | + <div class="invoice-list invoice-phone hide"> | ||
445 | + <span class="invoice-star">*</span> | ||
446 | + <span class="invoice-list-type">收票人手机</span> | ||
447 | + <div class="invoice-line first-line input-line"> | ||
448 | + <input id="input-mobile" value="{{receiverMobile}}" type="text" maxlength="11"/> | ||
449 | + <i class="enpty-input iconfont hide"> 请填写手机号码</i> | ||
450 | + </div> | ||
451 | + </div> | ||
452 | + </div> | ||
453 | + | ||
454 | + <div class="receipt-footer"> | ||
455 | + <div class="save-receipt highlight curser-button">保存发票信息</div> | ||
456 | + <div class="cancel-receipt normal curser-button">取消</div> | ||
457 | + </div> | ||
458 | + </div> | ||
459 | + </div> | ||
394 | {{/ orderEnsure}} | 460 | {{/ orderEnsure}} |
395 | <div class="loading"><span></span>请稍后...</div> | 461 | <div class="loading"><span></span>请稍后...</div> |
462 | + | ||
396 | </div> | 463 | </div> |
397 | {{> layout/footer}} | 464 | {{> layout/footer}} |
@@ -97,6 +97,25 @@ | @@ -97,6 +97,25 @@ | ||
97 | </div> | 97 | </div> |
98 | {{/ orderInfo}} | 98 | {{/ orderInfo}} |
99 | 99 | ||
100 | + <div class="pay-mode"> | ||
101 | + <p class="sub-title"> | ||
102 | + <span class="icon"></span> | ||
103 | + 发票信息 | ||
104 | + </p> | ||
105 | + <div class="content"> | ||
106 | + {{#if invoiceMode}} | ||
107 | + <div class="invoice-type"><p>发票类型:{{invoiceType}}</p> | ||
108 | + {{#if pdfUrl}}<a class="invoice-button" href="{{pdfUrl}}">电子发票下载</a> | ||
109 | + {{/if}} | ||
110 | + </div> | ||
111 | + <p>发票抬头:{{title}}</p> | ||
112 | + <p>发票内容:{{contentValue}}</p> | ||
113 | + {{^}} | ||
114 | + <p>暂不需要发票 | ||
115 | + {{/if}} | ||
116 | + </div> | ||
117 | + </div> | ||
118 | + | ||
100 | <div class="order-remark"> | 119 | <div class="order-remark"> |
101 | <p class="sub-title"> | 120 | <p class="sub-title"> |
102 | <span class="icon"></span> | 121 | <span class="icon"></span> |
web-static/img/order/invoice-desc.png
0 → 100644

8.68 KB
web-static/img/order/invoice-star.png
0 → 100644

1.13 KB
@@ -26,7 +26,8 @@ var $addressManage = $('.address-manage'), | @@ -26,7 +26,8 @@ var $addressManage = $('.address-manage'), | ||
26 | $useNewAddress = $('.use-new-address'), | 26 | $useNewAddress = $('.use-new-address'), |
27 | $existAddressList = $('.exist-address-list'), | 27 | $existAddressList = $('.exist-address-list'), |
28 | $loading = $('.loading'), | 28 | $loading = $('.loading'), |
29 | - $orderEditMain = $('#order-edit-main'); | 29 | + $orderEditMain = $('#order-edit-main'), |
30 | + $invoiceCheck = $('.invoice'); | ||
30 | 31 | ||
31 | var cartType = $addressManage.attr('cart-type'); | 32 | var cartType = $addressManage.attr('cart-type'); |
32 | 33 | ||
@@ -761,8 +762,10 @@ $('.to-play input.submit').click(function() { | @@ -761,8 +762,10 @@ $('.to-play input.submit').click(function() { | ||
761 | var addressId = $('.exist-address-list input[name="address"]:checked').closest('li').attr('data-id'), | 762 | var addressId = $('.exist-address-list input[name="address"]:checked').closest('li').attr('data-id'), |
762 | deliveryTimeId = $('.pay-time-modify input[name="pay-time-radio"]:checked').val(), | 763 | deliveryTimeId = $('.pay-time-modify input[name="pay-time-radio"]:checked').val(), |
763 | deliveryWayId = $('.select-express input[name="carriagegroup"]:checked').val(), | 764 | deliveryWayId = $('.select-express input[name="carriagegroup"]:checked').val(), |
764 | - invoiceTitle = $('#piaodesc').val(), | ||
765 | - invoiceId = $('#piaotype').val(), | 765 | + invoiceType, |
766 | + invoiceContent, | ||
767 | + receiverMobile, | ||
768 | + invoiceTitle, | ||
766 | paymentType = $('.pay-time-modify input[name="pay-type"]:checked').val(), | 769 | paymentType = $('.pay-time-modify input[name="pay-type"]:checked').val(), |
767 | paymentId = $('.pay-time-modify input[name="pay-type"]:checked').data('pay'), | 770 | paymentId = $('.pay-time-modify input[name="pay-type"]:checked').data('pay'), |
768 | remark = $('#notedesc').val(), | 771 | remark = $('#notedesc').val(), |
@@ -774,6 +777,13 @@ $('.to-play input.submit').click(function() { | @@ -774,6 +777,13 @@ $('.to-play input.submit').click(function() { | ||
774 | codeVal = $juangroupInput.val(), | 777 | codeVal = $juangroupInput.val(), |
775 | juanCode = !!codeVal ? codeVal : $juangroupInput.closest('li').find('#juancode').val(); | 778 | juanCode = !!codeVal ? codeVal : $juangroupInput.closest('li').find('#juancode').val(); |
776 | 779 | ||
780 | + if ($invoiceCheck.hasClass('active')) { | ||
781 | + invoiceType = $('.invoice-upload-type').html(); | ||
782 | + invoiceContent = $('.invoice-upload-content').html(); | ||
783 | + receiverMobile = $('.invoice-upload-mobile').html(); | ||
784 | + invoiceTitle = $('.invoice-upload-title').html(); | ||
785 | + } | ||
786 | + | ||
777 | $loading.show(); | 787 | $loading.show(); |
778 | 788 | ||
779 | if (!!$this.attr('disabled')) { | 789 | if (!!$this.attr('disabled')) { |
@@ -791,8 +801,10 @@ $('.to-play input.submit').click(function() { | @@ -791,8 +801,10 @@ $('.to-play input.submit').click(function() { | ||
791 | cartType: cartType, | 801 | cartType: cartType, |
792 | deliveryTimeId: deliveryTimeId, | 802 | deliveryTimeId: deliveryTimeId, |
793 | deliveryWayId: deliveryWayId, | 803 | deliveryWayId: deliveryWayId, |
804 | + invoiceType: invoiceType, | ||
805 | + invoiceContent: invoiceContent, | ||
806 | + receiverMobile: receiverMobile, | ||
794 | invoiceTitle: invoiceTitle, | 807 | invoiceTitle: invoiceTitle, |
795 | - invoiceId: invoiceId, | ||
796 | paymentId: paymentId, | 808 | paymentId: paymentId, |
797 | paymentType: paymentType, | 809 | paymentType: paymentType, |
798 | remark: remark, | 810 | remark: remark, |
@@ -3,16 +3,23 @@ | @@ -3,16 +3,23 @@ | ||
3 | * @time: 2015/12/21 | 3 | * @time: 2015/12/21 |
4 | */ | 4 | */ |
5 | 5 | ||
6 | -var $ = require('yoho.jquery'); | 6 | +var $ = require('yoho.jquery'), |
7 | + $invoiceCheck = $('.invoice'), | ||
8 | + $receiptInfo = $('.receipt-info'), | ||
9 | + $receiptInfoSaveBtn = $('.receipt-info .save-receipt'), | ||
10 | + $receiptInfoCancelBtn = $('.receipt-info .cancel-receipt'), | ||
11 | + $eReceiptBtn = $('.receipt-type .e-receipt'), | ||
12 | + $paperReceiptBtn = $('.receipt-type .paper-receipt'); | ||
7 | 13 | ||
8 | -var address = require('./address'); | 14 | +var address = require('./address'), |
15 | + receiptTitle = "个人"; | ||
9 | 16 | ||
10 | var dialog = require('../common/dialog'); | 17 | var dialog = require('../common/dialog'); |
11 | 18 | ||
12 | var accMul = function(arg1, arg2) { | 19 | var accMul = function(arg1, arg2) { |
13 | var m = 0, | 20 | var m = 0, |
14 | - s1 = arg1.toString(), | ||
15 | - s2 = arg2.toString(); | 21 | + s1 = arg1.toString(), |
22 | + s2 = arg2.toString(); | ||
16 | 23 | ||
17 | try { | 24 | try { |
18 | m += s1.split('.')[1].length; | 25 | m += s1.split('.')[1].length; |
@@ -852,3 +859,123 @@ $('.bag').find('ul').each(function() { | @@ -852,3 +859,123 @@ $('.bag').find('ul').each(function() { | ||
852 | $next.hide(); | 859 | $next.hide(); |
853 | } | 860 | } |
854 | }); | 861 | }); |
862 | + | ||
863 | +$invoiceCheck.click(function(){ | ||
864 | + | ||
865 | + if ($invoiceCheck.hasClass('active')) { | ||
866 | + $invoiceCheck.removeAttr('checked'); | ||
867 | + $invoiceCheck.removeClass('active'); | ||
868 | + } | ||
869 | + | ||
870 | + if ($invoiceCheck.attr('checked')) { | ||
871 | + $invoiceCheck.addClass('active'); | ||
872 | + if ($('.invoice-content').hasClass('hide')) { | ||
873 | + $receiptInfo.removeClass('hide'); | ||
874 | + } | ||
875 | + } | ||
876 | +}); | ||
877 | + | ||
878 | +//电子发票 | ||
879 | +function saveReceiptInfo() { | ||
880 | + var passInfoVerify = true, | ||
881 | + receiptType, | ||
882 | + receiptContent, | ||
883 | + receiptMobile, | ||
884 | + verifymobile, | ||
885 | + invoiceType, | ||
886 | + receiptTypeID, | ||
887 | + invoiceTypeInt; | ||
888 | + | ||
889 | + invoiceType = '个人'; | ||
890 | + | ||
891 | + if ($eReceiptBtn.hasClass('receipt-type-selected')) { | ||
892 | + receiptType = "电子发票"; | ||
893 | + invoiceTypeInt = '2'; | ||
894 | + } else { | ||
895 | + receiptType = "纸质发票"; | ||
896 | + invoiceTypeInt = '1'; | ||
897 | + } | ||
898 | + | ||
899 | + if (receiptTitle !== "个人") { | ||
900 | + invoiceType = '单位'; | ||
901 | + $('.input-line').each(function(){ | ||
902 | + if ($(this).find('input').val() === '') { | ||
903 | + $(this).find('.enpty-input').removeClass('hide'); | ||
904 | + passInfoVerify = false; | ||
905 | + }; | ||
906 | + }) | ||
907 | + receiptMobile = $('#input-mobile').val(); | ||
908 | + verifymobile = /[*0-9]{11}/; | ||
909 | + if (!verifymobile.test(receiptMobile)) { | ||
910 | + $('.invoice-phone .enpty-input').removeClass('hide'); | ||
911 | + passInfoVerify = false; | ||
912 | + }; | ||
913 | + if (!passInfoVerify) { | ||
914 | + return; | ||
915 | + } else { | ||
916 | + $('.invoice-title .enpty-input').addClass('hide'); | ||
917 | + $('.invoice-phone .enpty-input').addClass('hide'); | ||
918 | + receiptTitle = $('#input-organization-name').val(); | ||
919 | + } | ||
920 | + } | ||
921 | + | ||
922 | + receiptContent = $('input[name="content"]:checked').val(); | ||
923 | + receiptTypeID = $('input[name="content"]:checked').data('receiptid'); | ||
924 | + | ||
925 | + $('.invoice-type').html(receiptType); | ||
926 | + $('.invoice-partment').html(invoiceType); | ||
927 | + $('.invoice-kind').html(receiptContent); | ||
928 | + | ||
929 | + $('.invoice-upload-type').html(invoiceTypeInt); | ||
930 | + $('.invoice-upload-content').html(receiptTypeID); | ||
931 | + $('.invoice-upload-mobile').html(receiptMobile); | ||
932 | + $('.invoice-upload-title').html(receiptTitle); | ||
933 | + | ||
934 | + $receiptInfo.addClass('hide'); | ||
935 | + $('.invoice-content').removeClass('hide'); | ||
936 | +} | ||
937 | +$receiptInfoSaveBtn.click(function(){ | ||
938 | + saveReceiptInfo(); | ||
939 | +}); | ||
940 | + | ||
941 | +$receiptInfoCancelBtn.click(function(){ | ||
942 | + $receiptInfo.addClass('hide'); | ||
943 | + | ||
944 | + if ($('.invoice-content').hasClass('hide')) { | ||
945 | + $invoiceCheck.removeAttr('checked'); | ||
946 | + $invoiceCheck.removeClass('active'); | ||
947 | + } else { | ||
948 | + | ||
949 | + } | ||
950 | +}); | ||
951 | + | ||
952 | +$('.revise').click(function(){ | ||
953 | + $receiptInfo.removeClass('hide'); | ||
954 | +}); | ||
955 | + | ||
956 | +$eReceiptBtn.click(function(){ | ||
957 | + $eReceiptBtn.addClass('receipt-type-selected'); | ||
958 | + $paperReceiptBtn.removeClass('receipt-type-selected'); | ||
959 | + $('.e-receipt-desc').removeClass('hide'); | ||
960 | +}); | ||
961 | + | ||
962 | +$paperReceiptBtn.click(function(){ | ||
963 | + $paperReceiptBtn.addClass('receipt-type-selected'); | ||
964 | + $eReceiptBtn.removeClass('receipt-type-selected'); | ||
965 | + $('.e-receipt-desc').addClass('hide'); | ||
966 | +}); | ||
967 | + | ||
968 | +$('.invoice-title').change(function(){ | ||
969 | + var selectType = $('input[name="title"]:checked').val(); | ||
970 | + if (selectType === "1") { | ||
971 | + receiptTitle = "个人"; | ||
972 | + $('.invoice-title').addClass('invoice-title-personal-hight'); | ||
973 | + $('.invoice-title .input-line').addClass('hide'); | ||
974 | + $('.invoice-phone').addClass('hide'); | ||
975 | + } else { | ||
976 | + receiptTitle = "单位"; | ||
977 | + $('.invoice-title').removeClass('invoice-title-personal-hight'); | ||
978 | + $('.invoice-title .input-line').removeClass('hide'); | ||
979 | + $('.invoice-phone').removeClass('hide'); | ||
980 | + } | ||
981 | +}) |
@@ -2,6 +2,9 @@ | @@ -2,6 +2,9 @@ | ||
2 | .none{ | 2 | .none{ |
3 | display: none; | 3 | display: none; |
4 | } | 4 | } |
5 | + .curser-button { | ||
6 | + cursor: pointer; | ||
7 | + } | ||
5 | .gift{ | 8 | .gift{ |
6 | position: relative; | 9 | position: relative; |
7 | width: 988px; | 10 | width: 988px; |
@@ -122,7 +125,7 @@ | @@ -122,7 +125,7 @@ | ||
122 | line-height: 18px; | 125 | line-height: 18px; |
123 | padding: 4px 5px 4px 10px; | 126 | padding: 4px 5px 4px 10px; |
124 | color: #666; | 127 | color: #666; |
125 | - background: resolve(/cart/cartnew_tipsbox.png) no-repeat; | 128 | + background: resolve(/cart/cartnew_tipsbox.png) no-repeat; |
126 | position: relative; | 129 | position: relative; |
127 | float: left; | 130 | float: left; |
128 | 131 | ||
@@ -130,7 +133,7 @@ | @@ -130,7 +133,7 @@ | ||
130 | width: 17px; | 133 | width: 17px; |
131 | height: 17px; | 134 | height: 17px; |
132 | padding: 0px; | 135 | padding: 0px; |
133 | - background: url(/cart/i_close_f.png) no-repeat; | 136 | + background: url(/cart/i_close_f.png) no-repeat; |
134 | float: right; | 137 | float: right; |
135 | cursor: pointer; | 138 | cursor: pointer; |
136 | } | 139 | } |
@@ -176,7 +179,7 @@ | @@ -176,7 +179,7 @@ | ||
176 | 179 | ||
177 | color: #c21250; | 180 | color: #c21250; |
178 | display: block; | 181 | display: block; |
179 | - } | 182 | + } |
180 | .giftInfo{ | 183 | .giftInfo{ |
181 | margin-left: 30px; | 184 | margin-left: 30px; |
182 | } | 185 | } |
@@ -317,10 +320,10 @@ | @@ -317,10 +320,10 @@ | ||
317 | font-size: 10px; | 320 | font-size: 10px; |
318 | } | 321 | } |
319 | .minus{ | 322 | .minus{ |
320 | - background: url(/cart/ico_minus.png); | 323 | + background: url(/cart/ico_minus.png); |
321 | } | 324 | } |
322 | .plus{ | 325 | .plus{ |
323 | - background: url(/cart/ico_plus.png); | 326 | + background: url(/cart/ico_plus.png); |
324 | } | 327 | } |
325 | } | 328 | } |
326 | .cart-add-btn{ | 329 | .cart-add-btn{ |
@@ -347,7 +350,7 @@ | @@ -347,7 +350,7 @@ | ||
347 | position: relative; | 350 | position: relative; |
348 | border: 1px solid #dcdcdc; | 351 | border: 1px solid #dcdcdc; |
349 | background: #ebebeb; | 352 | background: #ebebeb; |
350 | - border-radius: 3px; | 353 | + border-radius: 3px; |
351 | } | 354 | } |
352 | .cart-del-btn,.cart-remove-btn { | 355 | .cart-del-btn,.cart-remove-btn { |
353 | height: 22px; | 356 | height: 22px; |
@@ -143,6 +143,22 @@ | @@ -143,6 +143,22 @@ | ||
143 | .trace-order th { | 143 | .trace-order th { |
144 | line-height: 18px; | 144 | line-height: 18px; |
145 | } | 145 | } |
146 | + | ||
147 | + .invoice-type { | ||
148 | + display: inline-block; | ||
149 | + p { | ||
150 | + display: inline-block; | ||
151 | + } | ||
152 | + } | ||
153 | + | ||
154 | + .invoice-button { | ||
155 | + display: inline-block; | ||
156 | + margin-left: 20px; | ||
157 | + color: #d93549; | ||
158 | + border:1px solid #444444; | ||
159 | + padding: 5px; | ||
160 | + } | ||
161 | + | ||
146 | .differentOrder{ | 162 | .differentOrder{ |
147 | position: relative; | 163 | position: relative; |
148 | width: 100%; | 164 | width: 100%; |
@@ -603,6 +603,180 @@ | @@ -603,6 +603,180 @@ | ||
603 | } | 603 | } |
604 | } | 604 | } |
605 | } | 605 | } |
606 | + | ||
607 | + .receipt-info { | ||
608 | + position: fixed; | ||
609 | + top: 0; | ||
610 | + left: 0; | ||
611 | + width: 100%; | ||
612 | + height: 100%!important; | ||
613 | + | ||
614 | + .receipt-mask { | ||
615 | + | ||
616 | + width: 100%; | ||
617 | + height: 100%; | ||
618 | + overflow: hidden; | ||
619 | + background-color: #000; | ||
620 | + opacity: 0.4; | ||
621 | + z-index: 1000; | ||
622 | + } | ||
623 | + | ||
624 | + .receipt-info-container { | ||
625 | + position: fixed; | ||
626 | + top: 5%; | ||
627 | + left: 0; | ||
628 | + right: 0; | ||
629 | + width: 700px; | ||
630 | + height: auto; | ||
631 | + margin-left: auto; | ||
632 | + margin-right: auto; | ||
633 | + background-color: #fff; | ||
634 | + border: 3px solid #444; | ||
635 | + } | ||
636 | + | ||
637 | + .receipt-title { | ||
638 | + margin: 42px 55px 0; | ||
639 | + text-align: left; | ||
640 | + font-size: 16px; | ||
641 | + padding-bottom: 20px; | ||
642 | + border-bottom: 3px solid #888; | ||
643 | + } | ||
644 | + | ||
645 | + .receipt-type { | ||
646 | + margin: 17px 0; | ||
647 | + | ||
648 | + span { | ||
649 | + margin-right: 17px; | ||
650 | + padding: 5px 15px; | ||
651 | + font-size: 14px; | ||
652 | + border: 1px solid #e0e0e0; | ||
653 | + color: #505050; | ||
654 | + } | ||
655 | + | ||
656 | + .receipt-type-selected { | ||
657 | + border: 1px solid #d0021b; | ||
658 | + color: #d0021b; | ||
659 | + } | ||
660 | + } | ||
661 | + | ||
662 | + .e-receipt-desc { | ||
663 | + background: url(/order/invoice-desc.png); | ||
664 | + width: 100%; | ||
665 | + height: 108px; | ||
666 | + } | ||
667 | + .receipt-margin { | ||
668 | + margin-left: 55px; | ||
669 | + margin-right: 55px; | ||
670 | + } | ||
671 | + | ||
672 | + .invoice-list { | ||
673 | + position: relative; | ||
674 | + margin-top: 17px; | ||
675 | + height: 90px; | ||
676 | + | ||
677 | + .invoice-star { | ||
678 | + position: absolute; | ||
679 | + top: 0; | ||
680 | + left: 0; | ||
681 | + margin-top: 5px; | ||
682 | + width: 12px; | ||
683 | + height: 20px; | ||
684 | + line-height: 20px; | ||
685 | + font-size: 20px; | ||
686 | + color: #d0021b; | ||
687 | + text-align: center; | ||
688 | + } | ||
689 | + .invoice-list-type { | ||
690 | + position: absolute; | ||
691 | + top: 0; | ||
692 | + left: 15px; | ||
693 | + width: 80px; | ||
694 | + height: 20px; | ||
695 | + line-height: 20px; | ||
696 | + font-size: 14px | ||
697 | + } | ||
698 | + | ||
699 | + .invoice-line { | ||
700 | + position: absolute; | ||
701 | + left: 120px; | ||
702 | + width: 500px; | ||
703 | + height: 30px; | ||
704 | + } | ||
705 | + | ||
706 | + .first-line { | ||
707 | + top: 0; | ||
708 | + } | ||
709 | + | ||
710 | + .second-line { | ||
711 | + top: 30px; | ||
712 | + } | ||
713 | + | ||
714 | + .input-line { | ||
715 | + height: 40px; | ||
716 | + | ||
717 | + input { | ||
718 | + width: 200px; | ||
719 | + height: 30px; | ||
720 | + font-size: 14px; | ||
721 | + } | ||
722 | + } | ||
723 | + | ||
724 | + .invoice-line label { | ||
725 | + width: 90px; | ||
726 | + display: inline-block; | ||
727 | + } | ||
728 | + | ||
729 | + .invoice-line i { | ||
730 | + margin-left: 20px; | ||
731 | + } | ||
732 | + } | ||
733 | + | ||
734 | + .invoice-title-personal-hight { | ||
735 | + height: 30px; | ||
736 | + } | ||
737 | + | ||
738 | + .invoice-phone { | ||
739 | + height: 40px; | ||
740 | + } | ||
741 | + | ||
742 | + .invoice-title_group{ | ||
743 | + height: 90px; | ||
744 | + } | ||
745 | + | ||
746 | + .blind { | ||
747 | + display: inline-block; | ||
748 | + margin-top: 5px; | ||
749 | + margin-bottom: 5px; | ||
750 | + } | ||
751 | + | ||
752 | + .receipt-footer { | ||
753 | + margin-left: 160px; | ||
754 | + | ||
755 | + div { | ||
756 | + display: inline-block; | ||
757 | + width: 140px; | ||
758 | + height: 40px; | ||
759 | + line-height: 40px; | ||
760 | + text-align: center; | ||
761 | + margin: 30px 20px 35px 20px; | ||
762 | + } | ||
763 | + | ||
764 | + .highlight { | ||
765 | + border: 1px solid #3a3a3a; | ||
766 | + background: #3a3a3a; | ||
767 | + color: #fff; | ||
768 | + | ||
769 | + } | ||
770 | + .normal { | ||
771 | + border: 1px solid #b0b0b0; | ||
772 | + background: #fff; | ||
773 | + color: #444; | ||
774 | + } | ||
775 | + } | ||
776 | + .enpty-input { | ||
777 | + color: #d3132a; | ||
778 | + } | ||
779 | + } | ||
606 | } | 780 | } |
607 | .freebie-tag{ | 781 | .freebie-tag{ |
608 | background:#9c3; | 782 | background:#9c3; |
@@ -87,6 +87,33 @@ | @@ -87,6 +87,33 @@ | ||
87 | } | 87 | } |
88 | } | 88 | } |
89 | 89 | ||
90 | + .section-play { | ||
91 | + margin: 20px auto; | ||
92 | + border: 1px solid #ccc; | ||
93 | + | ||
94 | + .section-head { | ||
95 | + line-height: 40px; | ||
96 | + background: #eaeaea;; | ||
97 | + font-size: 14px; | ||
98 | + padding-left: 20px; | ||
99 | + font-weight: 500; | ||
100 | + } | ||
101 | + .play-pan { | ||
102 | + padding-left: 20px; | ||
103 | + line-height: 60px; | ||
104 | + font-size: 10px; | ||
105 | + display: inline-block; | ||
106 | + } | ||
107 | + | ||
108 | + .invoice-content { | ||
109 | + display: inline-block; | ||
110 | + } | ||
111 | + .mes { | ||
112 | + display: inline-block; | ||
113 | + margin: 10px; | ||
114 | + } | ||
115 | + } | ||
116 | + | ||
90 | .play-content { | 117 | .play-content { |
91 | padding: 10px; | 118 | padding: 10px; |
92 | 119 |
@@ -224,6 +224,16 @@ class OrderModel | @@ -224,6 +224,16 @@ class OrderModel | ||
224 | } | 224 | } |
225 | $detail['orderBalance'][] = array('promotion' => '实际应支付', 'account' => $orderDetail['amount']); | 225 | $detail['orderBalance'][] = array('promotion' => '实际应支付', 'account' => $orderDetail['amount']); |
226 | } | 226 | } |
227 | + //发票 | ||
228 | + if (isset($orderDetail['invoice']) && $orderDetail['invoice']) { | ||
229 | + $detail['invoiceMode'] = true; | ||
230 | + $detail['invoiceType'] = $orderDetail['invoice']['type']; | ||
231 | + $detail['pdfUrl'] = $orderDetail['invoice']['pdfUrl']; | ||
232 | + $detail['title'] = $orderDetail['invoice']['title']; | ||
233 | + $detail['contentValue'] = $orderDetail['invoice']['contentValue']; | ||
234 | + $detail['showInvoice'] = $orderDetail['invoice']['showInvoice']; | ||
235 | + } | ||
236 | + | ||
227 | $detail['yoho_give_coin'] = $orderDetail['yoho_give_coin']; | 237 | $detail['yoho_give_coin'] = $orderDetail['yoho_give_coin']; |
228 | $detail['yohoCoinUrl'] = Helpers::url('/help', array('category_id' => 87)); //什么是yoho币介绍 | 238 | $detail['yohoCoinUrl'] = Helpers::url('/help', array('category_id' => 87)); //什么是yoho币介绍 |
229 | $detail['remark'] = $orderDetail['remark']; | 239 | $detail['remark'] = $orderDetail['remark']; |
@@ -579,6 +579,9 @@ class CartModel | @@ -579,6 +579,9 @@ class CartModel | ||
579 | do { | 579 | do { |
580 | /* 调接口订单确认接口 */ | 580 | /* 调接口订单确认接口 */ |
581 | $pay = CartData::cartPay($uid, $cartType); | 581 | $pay = CartData::cartPay($uid, $cartType); |
582 | + //获取用户手机号码用于发票接收人 | ||
583 | + $userInfo = UserData::getUserInfo($uid); | ||
584 | + | ||
582 | if (!$pay || empty($pay['data']['goods_list'])) { | 585 | if (!$pay || empty($pay['data']['goods_list'])) { |
583 | break; | 586 | break; |
584 | } | 587 | } |
@@ -703,6 +706,7 @@ class CartModel | @@ -703,6 +706,7 @@ class CartModel | ||
703 | $build['name'] = $value['invoices_type_name']; | 706 | $build['name'] = $value['invoices_type_name']; |
704 | $result['piaoTypes'][] = $build; | 707 | $result['piaoTypes'][] = $build; |
705 | } | 708 | } |
709 | + $result['receiverMobile'] = isset($userInfo['data']['mobile']) && $userInfo['data']['mobile'] ? $userInfo['data']['mobile'] : ''; | ||
706 | } | 710 | } |
707 | 711 | ||
708 | /* 需购买的商品 */ | 712 | /* 需购买的商品 */ |
@@ -895,7 +899,7 @@ class CartModel | @@ -895,7 +899,7 @@ class CartModel | ||
895 | * @param int $redEnvelopes 红包 | 899 | * @param int $redEnvelopes 红包 |
896 | * @return array 接口返回的数据 | 900 | * @return array 接口返回的数据 |
897 | */ | 901 | */ |
898 | - public static function orderSub($uid, $addressId, $cartType, $deliveryTimeId, $deliveryWayId, $invoiceTitle, $invoiceId, $paymentId, $paymentType, $remark, $couponCode,$promotionCode, $yohoCoin, $isPreContact, $isPrintPrice, $redEnvelopes) | 902 | + public static function orderSub($uid, $addressId, $cartType, $deliveryTimeId, $deliveryWayId, $invoiceType, $invoiceTitle, $invoiceContent, $receiverMobile, $paymentId, $paymentType, $remark, $couponCode,$promotionCode, $yohoCoin, $isPreContact, $isPrintPrice, $redEnvelopes) |
899 | { | 903 | { |
900 | $result = array('code' => 400, 'message' => self::ERROR_400_MESSAGE); | 904 | $result = array('code' => 400, 'message' => self::ERROR_400_MESSAGE); |
901 | 905 | ||
@@ -936,7 +940,7 @@ class CartModel | @@ -936,7 +940,7 @@ class CartModel | ||
936 | $userAgent = isset($unionInfo['client_id']) ? 'YOHO!Buy/3.8.2.259(Model/PC;Channel/' . $unionInfo['client_id'] . ';uid/' . $uid . ')' : null; | 940 | $userAgent = isset($unionInfo['client_id']) ? 'YOHO!Buy/3.8.2.259(Model/PC;Channel/' . $unionInfo['client_id'] . ';uid/' . $uid . ')' : null; |
937 | } | 941 | } |
938 | 942 | ||
939 | - $orderSubRes = CartData::orderSub($uid, $addressId, $cartType, $deliveryTimeId, $deliveryWayId, $invoiceTitle, $invoiceId, $paymentId, $paymentType, $remark, $couponCode,$promotionCode,$yohoCoin, $isPreContact, $isPrintPrice,$unionKey,$userAgent, $redEnvelopes); | 943 | + $orderSubRes = CartData::orderSub($uid, $addressId, $cartType, $deliveryTimeId, $deliveryWayId, $invoiceType, $invoiceTitle, $invoiceContent, $receiverMobile, $paymentId, $paymentType, $remark, $couponCode,$promotionCode,$yohoCoin, $isPreContact, $isPrintPrice,$unionKey,$userAgent, $redEnvelopes); |
940 | if ($orderSubRes && isset($orderSubRes['code'])) { | 944 | if ($orderSubRes && isset($orderSubRes['code'])) { |
941 | $result = $orderSubRes; | 945 | $result = $orderSubRes; |
942 | } | 946 | } |
@@ -439,8 +439,11 @@ class IndexController extends WebAction | @@ -439,8 +439,11 @@ class IndexController extends WebAction | ||
439 | $cartType = $this->post('cartType', 'ordinary'); // 默认普通购物车 | 439 | $cartType = $this->post('cartType', 'ordinary'); // 默认普通购物车 |
440 | $deliveryTimeId = $this->post('deliveryTimeId', 1); // 默认只工作日配送 | 440 | $deliveryTimeId = $this->post('deliveryTimeId', 1); // 默认只工作日配送 |
441 | $deliveryWayId = $this->post('deliveryWayId', 1); // 默认普通快递 | 441 | $deliveryWayId = $this->post('deliveryWayId', 1); // 默认普通快递 |
442 | - $invoiceTitle = $this->post('invoiceTitle', null); // 发票抬头 | ||
443 | - $invoiceId = $this->post('invoiceId', null); // 发票类型 | 442 | + $invoiceType = $this->post('invoiceType', null); // 发票类型:纸质 1 ,电子 2 |
443 | + $invoiceTitle = $this->post('invoiceTitle', '个人'); // 发票抬头 | ||
444 | + $invoiceContent = $this->post('invoiceContent', null); // 发票内容 | ||
445 | + $receiverMobile = $this->post('receiverMobile', null); // 接收人电话 | ||
446 | + | ||
444 | $paymentId = $this->post('paymentId', 15); // 支付ID | 447 | $paymentId = $this->post('paymentId', 15); // 支付ID |
445 | $paymentType = $this->post('paymentType', 1); // 默认在线支付 | 448 | $paymentType = $this->post('paymentType', 1); // 默认在线支付 |
446 | $remark = $this->post('remark', ''); // 备注信息 | 449 | $remark = $this->post('remark', ''); // 备注信息 |
@@ -450,9 +453,8 @@ class IndexController extends WebAction | @@ -450,9 +453,8 @@ class IndexController extends WebAction | ||
450 | $isPreContact = $this->post('isPreContact', false); // 送货前是否联系 | 453 | $isPreContact = $this->post('isPreContact', false); // 送货前是否联系 |
451 | $isPrintPrice = $this->post('isPrintPrice', true); // 是否打印价格 | 454 | $isPrintPrice = $this->post('isPrintPrice', true); // 是否打印价格 |
452 | $redEnvelopes = $this->post('redEnvelopes', null); | 455 | $redEnvelopes = $this->post('redEnvelopes', null); |
453 | - | ||
454 | // 调用下单接口 | 456 | // 调用下单接口 |
455 | - $result = CartModel::orderSub($uid, $addressId, $cartType, $deliveryTimeId, $deliveryWayId, $invoiceTitle, $invoiceId, | 457 | + $result = CartModel::orderSub($uid, $addressId, $cartType, $deliveryTimeId, $deliveryWayId, $invoiceType, $invoiceTitle, $invoiceContent, $receiverMobile, |
456 | $paymentId, $paymentType, $remark, $couponCode, $promotionCode, $yohoCoin, $isPreContact, $isPrintPrice, $redEnvelopes); | 458 | $paymentId, $paymentType, $remark, $couponCode, $promotionCode, $yohoCoin, $isPreContact, $isPrintPrice, $redEnvelopes); |
457 | // 判断是否下单成功 | 459 | // 判断是否下单成功 |
458 | if (empty($result['data']['order_code'])) { | 460 | if (empty($result['data']['order_code'])) { |
@@ -112,6 +112,12 @@ class OrdersController extends WebAction | @@ -112,6 +112,12 @@ class OrdersController extends WebAction | ||
112 | 'orderBalance' => isset($detail['orderBalance']) ? $detail['orderBalance'] : array(), | 112 | 'orderBalance' => isset($detail['orderBalance']) ? $detail['orderBalance'] : array(), |
113 | 'operation' => $detail['operation'], | 113 | 'operation' => $detail['operation'], |
114 | 'totalYoho' => $detail['yoho_give_coin'], | 114 | 'totalYoho' => $detail['yoho_give_coin'], |
115 | + //发票信息 | ||
116 | + 'invoiceMode' => $detail['invoiceMode'], | ||
117 | + 'invoiceType' => $detail['invoiceType'] === 2 ? '电子发票' : '纸质发票', | ||
118 | + 'pdfUrl' => $detail['showInvoice'] && $detail['pdfUrl'] ? $detail['pdfUrl'] : '', | ||
119 | + 'title' => $detail['title'], | ||
120 | + 'contentValue' => $detail['contentValue'] ? $detail['contentValue'] : '个人', | ||
115 | ); | 121 | ); |
116 | if (isset($detail['noramlPayMode'])) { | 122 | if (isset($detail['noramlPayMode'])) { |
117 | $data['orderInfo'] = $detail['orderInfo']; | 123 | $data['orderInfo'] = $detail['orderInfo']; |
-
Please register or login to post a comment