From d273b75fbc0f09820419c7e34955d8880468f223 Mon Sep 17 00:00:00 2001 From: yixian Date: Fri, 2 Mar 2018 13:17:33 +0800 Subject: [PATCH] hide gst in customer's view --- src/main/ui/static/templates/alipay/v1/payment.js | 9 ++++----- src/main/ui/static/templates/bestpay/v1/app_pay_2.js | 8 +++----- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/main/ui/static/templates/alipay/v1/payment.js b/src/main/ui/static/templates/alipay/v1/payment.js index d37f6b1a1..dace0a34c 100644 --- a/src/main/ui/static/templates/alipay/v1/payment.js +++ b/src/main/ui/static/templates/alipay/v1/payment.js @@ -100,9 +100,11 @@ $(function () { dataCache.discounts = []; dataCache.tax = surchargeData.tax; dataCache.surcharge = surchargeData.surcharge; + $(window.coupons).each(function () { price = this.handleDiscount(price, dataCache.price, dataCache.discounts, dataCache.coupons); }); + dataCache.customSurcharge = new Decimal(price).sub(realPrice).toFixed(2,Decimal.ROUND_HALF_UP); dataCache.finalPrice = new Decimal(price).toFixed(2, Decimal.ROUND_FLOOR); var rate = 'CNY' == window.currency ? 1 : exchangeRate; var cnyVal = Decimal.mul(price, rate).toFixed(2, Decimal.ROUND_HALF_UP); @@ -201,11 +203,8 @@ $(function () { var bd = $('.weui_dialog_bd', dialog); var currencySymbol = window.currency == 'AUD' ? '$' : '¥'; $('

').html('Input Price 输入金额:' + currencySymbol + dataCache.price).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); + if (parseFloat(dataCache.customSurcharge) > 0) { + $('

').html('Surcharge 手续费(' + window.rateValue + '%):+' + currencySymbol + dataCache.customSurcharge).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 584cbb174..fefdcd59e 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 @@ -92,6 +92,7 @@ $(function () { $(window.coupons).each(function () { price = this.handleDiscount(price, dataCache.price, dataCache.discounts, dataCache.coupons); }); + dataCache.customSurcharge = new Decimal(price).sub(realPrice).toFixed(2,Decimal.ROUND_HALF_UP); dataCache.finalPrice = new Decimal(price).toFixed(2, Decimal.ROUND_FLOOR); var rate = 'CNY' == window.currency ? 1 : exchangeRate; var cnyVal = Decimal.mul(price, rate).toFixed(2, Decimal.ROUND_HALF_UP); @@ -190,11 +191,8 @@ $(function () { var bd = $('.weui_dialog_bd', dialog); var currencySymbol = window.currency == 'AUD' ? '$' : '¥'; $('

').html('Input Price 输入金额:' + currencySymbol + dataCache.price).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); + if (parseFloat(dataCache.customSurcharge) > 0) { + $('

').html('Surcharge 手续费(' + window.rateValue + '%):+' + currencySymbol + dataCache.customSurcharge).appendTo(bd); } $(dataCache.discounts).each(function () { $('

').html(this.title + ':-' + currencySymbol + this.amount).appendTo(bd);