Authored by 郭成尧

noPrintPrice-page

@@ -150,6 +150,15 @@ @@ -150,6 +150,15 @@
150 <form id="msg" action="" method="post"> 150 <form id="msg" action="" method="post">
151 <input type="text" name="msg" value="{{msg}}" maxlength="40" placeholder="留言"> 151 <input type="text" name="msg" value="{{msg}}" maxlength="40" placeholder="留言">
152 </form> 152 </form>
  153 + <ul class="sale-invoice">
  154 + <li class="no-print-price">
  155 + <span class="title">不打印价格</span>
  156 + <span class="desc">送朋友可不打印价格哦</span>
  157 + <span class="check">
  158 + <i class="iconfont checkbox {{#if noPrintPrice}}icon-cb-radio{{else}}icon-radio{{/if}}"></i>
  159 + </span>
  160 + </li>
  161 + </ul>
153 </section> 162 </section>
154 <section class="price-cal block"> 163 <section class="price-cal block">
155 <ul class="total"> 164 <ul class="total">
@@ -31,7 +31,9 @@ let $invoice = $('.invoice'), @@ -31,7 +31,9 @@ let $invoice = $('.invoice'),
31 buyNumber = $('#buyNumber').val(), 31 buyNumber = $('#buyNumber').val(),
32 headerTop = $('#yoho-header').outerHeight(), 32 headerTop = $('#yoho-header').outerHeight(),
33 isYohoCoinClick = $coinLi.data('yoho-coin-click') * 1, // 判断有货币是否可以单击 33 isYohoCoinClick = $coinLi.data('yoho-coin-click') * 1, // 判断有货币是否可以单击
34 - addressTop = $('.address-wrap').outerHeight(); 34 + addressTop = $('.address-wrap').outerHeight(),
  35 + $message = $('#msg'),
  36 + $noPrintPrice = $('.no-print-price');
35 37
36 let orderCont = cookie.get('order-info') && JSON.parse(cookie.get('order-info')); 38 let orderCont = cookie.get('order-info') && JSON.parse(cookie.get('order-info'));
37 let invoiceCont = { 39 let invoiceCont = {
@@ -417,6 +419,17 @@ $invoice.on('touchend', '.checkbox', function(e) { @@ -417,6 +419,17 @@ $invoice.on('touchend', '.checkbox', function(e) {
417 e.stopPropagation(); 419 e.stopPropagation();
418 }); 420 });
419 421
  422 +/**
  423 + * 是否打印价格
  424 + */
  425 +$noPrintPrice.on('touchend', '.checkbox', function(e) {
  426 + let $this = $(this);
  427 +
  428 + orderInfo('isPrintPrice', $this.hasClass('icon-cb-radio'));
  429 + e.preventDefault();
  430 + e.stopPropagation();
  431 +});
  432 +
420 $invoice.find('[name="invoice-title"]').on('blur', function() { 433 $invoice.find('[name="invoice-title"]').on('blur', function() {
421 orderInfo('invoiceText', $(this).val()); 434 orderInfo('invoiceText', $(this).val());
422 }).end().find('.invoice-type').on('change', function() { 435 }).end().find('.invoice-type').on('change', function() {
@@ -554,6 +567,13 @@ $ticketsMobile.blur(function() { @@ -554,6 +567,13 @@ $ticketsMobile.blur(function() {
554 // 初始化发票信息内容 567 // 初始化发票信息内容
555 invoiceInit(); 568 invoiceInit();
556 569
  570 +// 留言点击滚动屏幕
  571 +$message.on('click', function() {
  572 + $('html,body').animate({
  573 + scrollTop: $message.offset().top
  574 + }, 500);
  575 +});
  576 +
557 $(window).scroll(function() { 577 $(window).scroll(function() {
558 578
559 if ($(this).scrollTop() >= (headerTop + addressTop)) { 579 if ($(this).scrollTop() >= (headerTop + addressTop)) {
@@ -303,6 +303,35 @@ @@ -303,6 +303,35 @@
303 } 303 }
304 } 304 }
305 305
  306 + .no-print-price {
  307 + .title {
  308 + font-size: 34px;
  309 + color: #444;
  310 + }
  311 +
  312 + .desc {
  313 + color: #999;
  314 + }
  315 +
  316 + .check {
  317 + float: right;
  318 + color: #999;
  319 +
  320 + .checkbox {
  321 + margin-left: 5px;
  322 + color: #000;
  323 + }
  324 +
  325 + &.used {
  326 + color: #f00;
  327 + }
  328 +
  329 + em {
  330 + color: #f00;
  331 + }
  332 + }
  333 + }
  334 +
306 .address-bottom { 335 .address-bottom {
307 display: none; 336 display: none;
308 position: fixed; 337 position: fixed;
@@ -619,6 +648,7 @@ @@ -619,6 +648,7 @@
619 648
620 #msg { 649 #msg {
621 padding-top: 20px; 650 padding-top: 20px;
  651 + margin-bottom: 20px;
622 652
623 input { 653 input {
624 margin: 0; 654 margin: 0;