Skip to content

Commit 05520d2

Browse files
committed
提交发票的时候检查税号
1 parent 354642f commit 05520d2

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

www/cart/order.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -382,9 +382,13 @@ function submitInvoice() {
382382
element.focus();
383383
return false;
384384
}
385-
if ( name === 'tax_no' && element.value.length < 10 ) {
386-
element.focus();
387-
return false;
385+
if ( name === 'tax_no' ) {
386+
var taxno = element.value.replaceAll(' ', '').replaceAll('-', '');
387+
var taxPattern = /^[a-zA-Z0-9]{18}$/;
388+
if (! taxPattern.test( taxno ) ) {
389+
element.focus();
390+
return false;
391+
}
388392
}
389393
if ( name === 'tax_name' && element.value.length < 4 ) {
390394
element.focus();

0 commit comments

Comments
 (0)