Authored by 张丽霞

电子发票手机号格式

@@ -11,8 +11,11 @@ var $ = require('yoho.jquery'), @@ -11,8 +11,11 @@ var $ = require('yoho.jquery'),
11 $eReceiptBtn = $('.receipt-type .e-receipt'), 11 $eReceiptBtn = $('.receipt-type .e-receipt'),
12 $paperReceiptBtn = $('.receipt-type .paper-receipt'); 12 $paperReceiptBtn = $('.receipt-type .paper-receipt');
13 13
  14 +
14 var address = require('./address'), 15 var address = require('./address'),
15 - receiptTitle = "个人"; 16 + receiptTitle = "个人",
  17 + receiptMobile = $('#input-mobile').val(),
  18 + receiptMobileStar;
16 19
17 var dialog = require('../common/dialog'); 20 var dialog = require('../common/dialog');
18 21
@@ -876,15 +879,21 @@ $invoiceCheck.click(function(){ @@ -876,15 +879,21 @@ $invoiceCheck.click(function(){
876 }); 879 });
877 880
878 //电子发票 881 //电子发票
  882 +
  883 +(function receiptMobileToStarString(numb) {
  884 + receiptMobileStar = numb.substr(0, 3) + '****' + numb.substr(7);
  885 + $('#input-mobile').val(receiptMobileStar);
  886 +}(receiptMobile));
  887 +
879 function saveReceiptInfo() { 888 function saveReceiptInfo() {
880 var passInfoVerify = true, 889 var passInfoVerify = true,
881 receiptType, 890 receiptType,
882 receiptContent, 891 receiptContent,
883 - receiptMobile,  
884 verifymobile, 892 verifymobile,
885 invoiceType, 893 invoiceType,
886 receiptTypeID, 894 receiptTypeID,
887 - invoiceTypeInt; 895 + invoiceTypeInt,
  896 + finalReceiptMobile;
888 897
889 invoiceType = '个人'; 898 invoiceType = '个人';
890 899
@@ -904,12 +913,17 @@ function saveReceiptInfo() { @@ -904,12 +913,17 @@ function saveReceiptInfo() {
904 passInfoVerify = false; 913 passInfoVerify = false;
905 }; 914 };
906 }) 915 })
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 - }; 916 + finalReceiptMobile = $('#input-mobile').val();
  917 + if (finalReceiptMobile === receiptMobileStar) {
  918 + finalReceiptMobile = receiptMobile;
  919 + } else {
  920 + verifymobile = /[0-9]{11}/;
  921 + if (!verifymobile.test(finalReceiptMobile)) {
  922 + $('.invoice-phone .enpty-input').removeClass('hide');
  923 + passInfoVerify = false;
  924 + }
  925 + }
  926 +
913 if (!passInfoVerify) { 927 if (!passInfoVerify) {
914 return; 928 return;
915 } else { 929 } else {
@@ -917,6 +931,7 @@ function saveReceiptInfo() { @@ -917,6 +931,7 @@ function saveReceiptInfo() {
917 $('.invoice-phone .enpty-input').addClass('hide'); 931 $('.invoice-phone .enpty-input').addClass('hide');
918 receiptTitle = $('#input-organization-name').val(); 932 receiptTitle = $('#input-organization-name').val();
919 } 933 }
  934 +
920 } 935 }
921 936
922 receiptContent = $('input[name="content"]:checked').val(); 937 receiptContent = $('input[name="content"]:checked').val();
@@ -928,7 +943,7 @@ function saveReceiptInfo() { @@ -928,7 +943,7 @@ function saveReceiptInfo() {
928 943
929 $('.invoice-upload-type').html(invoiceTypeInt); 944 $('.invoice-upload-type').html(invoiceTypeInt);
930 $('.invoice-upload-content').html(receiptTypeID); 945 $('.invoice-upload-content').html(receiptTypeID);
931 - $('.invoice-upload-mobile').html(receiptMobile); 946 + $('.invoice-upload-mobile').html(finalReceiptMobile);
932 $('.invoice-upload-title').html(receiptTitle); 947 $('.invoice-upload-title').html(receiptTitle);
933 948
934 $receiptInfo.addClass('hide'); 949 $receiptInfo.addClass('hide');