diff --git a/static/js/cart/invoice-info.js b/static/js/cart/invoice-info.js index c43d0cc..e540836 100644 --- a/static/js/cart/invoice-info.js +++ b/static/js/cart/invoice-info.js @@ -16,6 +16,7 @@ var $invoiceNotice = $('.invoice-notice'), $invoiceType = $('.invoice-type'), $tel = $('.tel'), $company = $('.company'), + $telArea = $('.tel-area'), orderInfo = order.orderInfo, $chooseContLi = $('.invoice-cont').find('.icon-cb-radio').parent(); @@ -51,7 +52,7 @@ function confirmAction() { cont = $chooseCont.data('id'); if ($editFlag.val() === 'true') { - if (!myreg.test($tel.attr('data-tel'))) { + if (type === '2' && !myreg.test($tel.attr('data-tel'))) { tip.show('请输入正确手机号'); $tel.focus(); return false; @@ -118,6 +119,13 @@ $('.invoice-type span').on('touchstart', function() { } else { $(this).addClass('on').siblings().removeClass('on'); $editFlag.val('true'); + + // 纸质发票不显示手机号 + if ($(this).index() === 1) { + $telArea.slideUp(); + } else { + $telArea.slideDown(); + } } }); diff --git a/static/sass/cart/_invoice-info.css b/static/sass/cart/_invoice-info.css index 8cf0f1d..8c7a89d 100644 --- a/static/sass/cart/_invoice-info.css +++ b/static/sass/cart/_invoice-info.css @@ -12,6 +12,14 @@ color: #444; font-size: 28px; float: left; + position: relative; + + .txt-point { + position: absolute; + left: -15px; + top: 5px; + display: block; + } } .invoice-form { @@ -20,6 +28,7 @@ padding: 0 30px; box-sizing: border-box; overflow: hidden; + padding-bottom: 15px; li { width: 100%; @@ -30,11 +39,7 @@ } li:first-child { - margin-bottom: 15px; - } - - li:last-child { - margin-bottom: 10px; + margin-bottom: 5px; } .company { diff --git a/template/m.yohobuy.com/actions/cart/index/invoice-info.phtml b/template/m.yohobuy.com/actions/cart/index/invoice-info.phtml index f489b1d..0d34ce4 100644 --- a/template/m.yohobuy.com/actions/cart/index/invoice-info.phtml +++ b/template/m.yohobuy.com/actions/cart/index/invoice-info.phtml @@ -18,8 +18,8 @@ {{/invoiceTitle}} </div> </li> - <li> - <span class="title">*发票人手机:</span> + <li {{#isPaper}}style="display: none;"{{/isPaper}} class="tel-area"> + <span class="title"><i class="txt-point">*</i>发票人手机:</span> <span class="phone"> <input type="text" name="tel" data-tel="{{completeTel}}" class="tel {{#phone}}istel{{/phone}}" value="{{phone}}" placeholder="可通过手机号在发票服务平台查询"> </span> diff --git a/yohobuy/m.yohobuy.com/application/modules/Cart/controllers/Index.php b/yohobuy/m.yohobuy.com/application/modules/Cart/controllers/Index.php index 08e475e..a107158 100644 --- a/yohobuy/m.yohobuy.com/application/modules/Cart/controllers/Index.php +++ b/yohobuy/m.yohobuy.com/application/modules/Cart/controllers/Index.php @@ -384,6 +384,7 @@ class IndexController extends AbstractAction 'completeTel' => $mobile, 'isCompany' => $invoice_Top =='单位' ? false : true, 'companyName' => $invoices_title, + 'isPaper' => $invoices_type == 1 ? true : false, 'invoicesType' => array( array( 'id' => '2',