Skip to content

Commit 5da2d2d

Browse files
committed
增加没有发票的提示信息
1 parent 05520d2 commit 5da2d2d

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

www/cart/order.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -352,12 +352,13 @@ function setPaymentAmount() {
352352
var tax = document.querySelector( 'input[name="tax"]' ).checked;
353353
var price = tax ? (lic == 'Z' ? '562' : lic == 'G' ? '918' : lic == 'C' ? '569' : '359') :
354354
(lic == 'Z' ? '512' : lic == 'G' ? '868' : lic == 'C' ? '520' : '298');
355+
var unithint = tax ? '元(包含电子发票)' : '元(不包含电子发票)';
355356

356357
document.querySelector( '.popup-weixin-payment img' ).src = 'weixin-' + price + '.jpg';
357358
document.querySelector( '.popup-alipay-payment img' ).src = 'alipay-' + price + '.jpg';
358-
document.getElementById('transfer-amount').innerHTML = price + '元';
359-
document.querySelector( '.weixin-payment-link' ).innerHTML = '微信扫码支付 ' + price + '元';
360-
document.querySelector( '.alipay-payment-link' ).innerHTML = '支付宝扫码支付 ' + price + '元'
359+
document.getElementById('transfer-amount').innerHTML = price + unithint;
360+
document.querySelector( '.weixin-payment-link' ).innerHTML = '微信扫码支付 ' + price + unithint;
361+
document.querySelector( '.alipay-payment-link' ).innerHTML = '支付宝扫码支付 ' + price + unithint;
361362
}
362363

363364
function setProductTax() {
@@ -372,6 +373,10 @@ function submitInvoice() {
372373
showMessage( '请首先提交订单,然后才能提交发票信息' );
373374
return;
374375
}
376+
if ( ! document.querySelector( 'input[name="tax"]' ).checked ) {
377+
showMessage( '该订单不包含电子发票,无法提交发票信息' );
378+
return;
379+
}
375380
var name_list = [ 'tax_no', 'tax_name', 'tax_phone', 'tax_address',
376381
'bank_account', 'bank_name', 'bank_site',
377382
'post_name', 'post_phone', 'post_code', 'post_address' ];

0 commit comments

Comments
 (0)