From c71e6291889412e50226a557cc5917c2e89ed59f Mon Sep 17 00:00:00 2001 From: yixian Date: Tue, 27 Feb 2018 22:20:04 +0800 Subject: [PATCH] gst support --- src/main/ui/static/templates/alipay/v1/payment.js | 13 +++++++++---- .../ui/static/templates/bestpay/v1/app_pay_2.js | 13 +++++++++---- src/main/ui/static/templates/payment/v1/payment.js | 14 ++++++++++---- 3 files changed, 28 insertions(+), 12 deletions(-) diff --git a/src/main/ui/static/templates/alipay/v1/payment.js b/src/main/ui/static/templates/alipay/v1/payment.js index ea398d435..d37f6b1a1 100644 --- a/src/main/ui/static/templates/alipay/v1/payment.js +++ b/src/main/ui/static/templates/alipay/v1/payment.js @@ -93,11 +93,13 @@ $(function () { $('#audVal').html(dataCache.price); var realPrice = dataCache.price; $('#audValReal').html(realPrice); - var poundage = updatePoundage(realPrice); + var surchargeData = calculateSurcharge(realPrice); - var price = poundage || realPrice; + var price = surchargeData.newPrice || realPrice; var priceBeforeDiscount = price; dataCache.discounts = []; + dataCache.tax = surchargeData.tax; + dataCache.surcharge = surchargeData.surcharge; $(window.coupons).each(function () { price = this.handleDiscount(price, dataCache.price, dataCache.discounts, dataCache.coupons); }); @@ -199,8 +201,11 @@ $(function () { var bd = $('.weui_dialog_bd', dialog); var currencySymbol = window.currency == 'AUD' ? '$' : '¥'; $('

').html('Input Price 输入金额:' + currencySymbol + dataCache.price).appendTo(bd); - if (dataCache.poundageValue > 0) { - $('

').html('Surcharge 手续费(' + window.rateValue + '%):+' + currencySymbol + dataCache.poundageValue).appendTo(bd); + if (parseFloat(dataCache.surcharge) > 0) { + $('

').html('Surcharge 手续费(' + window.rateValue + '%):+' + currencySymbol + dataCache.surcharge).appendTo(bd); + } + if (parseFloat(dataCache.tax) > 0) { + $('

').html('GST(10%):'+currencySymbol+dataCache.tax).appendTo(bd); } $(dataCache.discounts).each(function () { $('

').html(this.title + ':-' + currencySymbol + this.amount).appendTo(bd); diff --git a/src/main/ui/static/templates/bestpay/v1/app_pay_2.js b/src/main/ui/static/templates/bestpay/v1/app_pay_2.js index 7820a2c3d..584cbb174 100644 --- a/src/main/ui/static/templates/bestpay/v1/app_pay_2.js +++ b/src/main/ui/static/templates/bestpay/v1/app_pay_2.js @@ -82,9 +82,11 @@ $(function () { $('#audVal').html(dataCache.price); var realPrice = dataCache.price; $('#audValReal').html(realPrice); - var poundage = updatePoundage(realPrice); + var surchargeData = calculateSurcharge(realPrice); - var price = poundage || realPrice; + dataCache.tax = surchargeData.tax; + dataCache.surcharge = surchargeData.surcharge; + var price = surchargeData.newPrice || realPrice; var priceBeforeDiscount = price; dataCache.discounts = []; $(window.coupons).each(function () { @@ -188,8 +190,11 @@ $(function () { var bd = $('.weui_dialog_bd', dialog); var currencySymbol = window.currency == 'AUD' ? '$' : '¥'; $('

').html('Input Price 输入金额:' + currencySymbol + dataCache.price).appendTo(bd); - if (dataCache.poundageValue > 0) { - $('

').html('Surcharge 手续费(' + window.rateValue + '%):+' + currencySymbol + dataCache.poundageValue).appendTo(bd); + if (parseFloat(dataCache.surcharge) > 0) { + $('

').html('Surcharge 手续费(' + window.rateValue + '%):+' + currencySymbol + dataCache.surcharge).appendTo(bd); + } + if (parseFloat(dataCache.tax) > 0) { + $('

').html('GST(10%):'+currencySymbol+dataCache.tax).appendTo(bd); } $(dataCache.discounts).each(function () { $('

').html(this.title + ':-' + currencySymbol + this.amount).appendTo(bd); diff --git a/src/main/ui/static/templates/payment/v1/payment.js b/src/main/ui/static/templates/payment/v1/payment.js index 1e8259bc4..60ee79934 100644 --- a/src/main/ui/static/templates/payment/v1/payment.js +++ b/src/main/ui/static/templates/payment/v1/payment.js @@ -86,11 +86,13 @@ $(function () { $('#audVal').html(dataCache.price); var realPrice = dataCache.price; $('#audValReal').html(realPrice); - var poundage = updatePoundage(realPrice); + var surchargeData = calculateSurcharge(realPrice); - var price = poundage || realPrice; + var price = surchargeData.newPrice || realPrice; var priceBeforeDiscount = price; dataCache.discounts = []; + dataCache.tax = surchargeData.tax; + dataCache.surcharge = surchargeData.surcharge; $(window.coupons).each(function () { price = this.handleDiscount(price, dataCache.price, dataCache.discounts, dataCache.coupons); }); @@ -192,8 +194,11 @@ $(function () { var bd = $('.weui_dialog_bd', dialog); var currencySymbol = window.currency == 'CNY' ? '¥' : '$'; $('

').html('Input Price 输入金额:' + currencySymbol + dataCache.price).appendTo(bd); - if (dataCache.poundageValue > 0) { - $('

').html('Surcharge 手续费(' + window.rateValue + '%):+' + currencySymbol + dataCache.poundageValue).appendTo(bd); + if (parseFloat(dataCache.surcharge) > 0) { + $('

').html('Surcharge 手续费(' + window.rateValue + '%):+' + currencySymbol + dataCache.surcharge).appendTo(bd); + } + if (parseFloat(dataCache.tax) > 0) { + $('

').html('GST(10%):'+currencySymbol+dataCache.tax).appendTo(bd); } $(dataCache.discounts).each(function () { $('

').html(this.title + ':-' + currencySymbol + this.amount).appendTo(bd); @@ -305,6 +310,7 @@ $(function () { } }) } + checkOrderStd(); }