...
|
...
|
@@ -16,12 +16,13 @@ let $invoiceNotice = $('.invoice-notice'), |
|
|
$tel = $('.tel'),
|
|
|
$company = $('.company'),
|
|
|
$copyTel = $('.copy-tel');
|
|
|
let $confirmBtn = $('.confirm-btn');
|
|
|
let $buyerTaxNumber = $('#buyerTaxNumber');
|
|
|
|
|
|
let eInvoiceType = $('#eInvoices').data('id');
|
|
|
let orderInfo = order.orderInfo;
|
|
|
let linkUrl = document.referrer;
|
|
|
let isModifyTel = false;
|
|
|
let myreg = /^(((13[0-9]{1})|(14[0-9]{1})|(15[0-9]{1})|(17[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
|
|
|
let C_ID = window._ChannelVary[window.cookie('_Channel')] || 1;
|
|
|
|
|
|
require('common');
|
...
|
...
|
@@ -39,6 +40,46 @@ function goToBack() { |
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 切换确认按钮激活状态
|
|
|
*/
|
|
|
function switchBtnStatus() {
|
|
|
if ($('.invoice-top').find('.on').text() === '单位') {
|
|
|
if ($buyerTaxNumber.val() && $company.val() && $tel.val()) {
|
|
|
$confirmBtn.addClass('active');
|
|
|
} else {
|
|
|
$confirmBtn.removeClass('active');
|
|
|
}
|
|
|
} else {
|
|
|
if ($company.val() && $tel.attr('data-tel')) {
|
|
|
$confirmBtn.addClass('active');
|
|
|
} else {
|
|
|
$confirmBtn.removeClass('active');
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 发票抬头输入监听
|
|
|
*/
|
|
|
$company.bind('input', function() {
|
|
|
switchBtnStatus();
|
|
|
});
|
|
|
|
|
|
/**
|
|
|
* 手机号输入监听
|
|
|
*/
|
|
|
$tel.bind('input', function() {
|
|
|
switchBtnStatus();
|
|
|
});
|
|
|
|
|
|
/**
|
|
|
* 税号输入监听
|
|
|
*/
|
|
|
$buyerTaxNumber.bind('input', function() {
|
|
|
switchBtnStatus();
|
|
|
});
|
|
|
|
|
|
// 单选效果
|
|
|
function chooseAction(pDom, dom) {
|
|
|
if (dom.hasClass('icon-cb-radio')) {
|
...
|
...
|
@@ -55,16 +96,12 @@ function chooseAction(pDom, dom) { |
|
|
// 确认表单事件
|
|
|
function confirmAction() {
|
|
|
let title = $('.invoice-top').find('.on').text(),
|
|
|
buyerTaxNumber = $('#buyerTaxNumber').val(),
|
|
|
buyerTaxNumber = $buyerTaxNumber.val(),
|
|
|
tel = $tel.attr('data-tel'),
|
|
|
company = $company.val();
|
|
|
|
|
|
if ($editFlag.val() === 'true') {
|
|
|
if (!myreg.test($tel.attr('data-tel'))) {
|
|
|
tip.show('请输入正确手机号');
|
|
|
$tel.focus();
|
|
|
return false;
|
|
|
} else if (title === '单位' && company.length === 0) {
|
|
|
if (title === '单位' && company.length === 0) {
|
|
|
tip.show('请填写发票抬头');
|
|
|
$company.focus();
|
|
|
return false;
|
...
|
...
|
@@ -122,6 +159,7 @@ $('.invoice-top span, .invoice-cont li').not('.invoice-cont .cont-title').on('to |
|
|
if ($(this).text() === '个人') {
|
|
|
$taxNumber.slideUp();
|
|
|
}
|
|
|
switchBtnStatus();
|
|
|
});
|
|
|
|
|
|
// 发票须知
|
...
|
...
|
|