From c2999ac9a1048e9f593f9f50f31430b16e66faad Mon Sep 17 00:00:00 2001 From: dalong306 <304592994@qq.com> Date: Thu, 23 Sep 2021 20:01:38 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=A6=E5=8D=95=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/ui/static/images/alipay_aps_big.svg | 24 ++++++++ .../templates/billCode/js/mobile_payment.js | 57 ++++++++++++++++++- .../templates/billCode/js/pc_payment.js | 28 ++++++++- .../ui/static/templates/skip_wxbrowser.css | 9 +++ 4 files changed, 115 insertions(+), 3 deletions(-) create mode 100644 src/main/ui/static/images/alipay_aps_big.svg diff --git a/src/main/ui/static/images/alipay_aps_big.svg b/src/main/ui/static/images/alipay_aps_big.svg new file mode 100644 index 000000000..a3fb65da3 --- /dev/null +++ b/src/main/ui/static/images/alipay_aps_big.svg @@ -0,0 +1,24 @@ + + + A+Partner-200X80-竖版 + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/ui/static/templates/billCode/js/mobile_payment.js b/src/main/ui/static/templates/billCode/js/mobile_payment.js index 7a61910a8..8c63fdec4 100644 --- a/src/main/ui/static/templates/billCode/js/mobile_payment.js +++ b/src/main/ui/static/templates/billCode/js/mobile_payment.js @@ -9,9 +9,18 @@ $(document).ready(function () { if(window.openmobilefun == 'wechat'|| window.openmobilefun == 'other'){ paymentFun = 'Wechat' - }else{ + } + else if(window.openmobilefun == 'alipayaps'|| window.openmobilefun == 'alipayaps_cn'){ + paymentFun = 'AlipayAps' + $(".select_wechat").empty(); + $(".select_alipay_aps").append(selectPaymentHTML); + $(".select_alipay").empty(); + $(".select_bank").empty(); + } + else{ paymentFun = 'Alipay' $(".select_wechat").empty(); + $(".select_alipay_aps").empty(); $(".select_alipay").append(selectPaymentHTML); $(".select_bank").empty(); } @@ -35,6 +44,8 @@ $(document).ready(function () { paymentFun = 'Wechat' $(".select_wechat").append(selectPaymentHTML); $(".select_alipay").empty(); + $(".select_alipay_aps").empty(); + $(".select_bank").empty(); } }) @@ -42,15 +53,28 @@ $(document).ready(function () { if(paymentFun != 'Alipay'){ paymentFun = 'Alipay' $(".select_wechat").empty(); + $(".select_alipay_aps").empty(); + $(".select_alipay").append(selectPaymentHTML); $(".select_bank").empty(); } }) + $("#select_alipay_aps").click(function(){ + if(paymentFun != 'AlipayAps'){ + paymentFun = 'AlipayAps' + $(".select_wechat").empty(); + $(".select_alipay").empty(); + $(".select_alipay_aps").append(selectPaymentHTML); + $(".select_bank").empty(); + } + }) $("#select_bank").click(function(){ if(paymentFun != 'Bank'){ paymentFun = 'Bank' $(".select_wechat").empty(); $(".select_alipay").empty(); + $(".select_alipay_aps").empty(); + $(".select_bank").append(selectPaymentHTML); } }) @@ -81,6 +105,13 @@ $(document).ready(function () { redirectH5Payment(res.partner_order_id,res.client_moniker) } } + if(paymentFun == 'AlipayAps'){ + if(window.openmobilefun == 'alipayaps'){ + callPayment(res); + }else{ + redirectH5PaymentForAps(res.partner_order_id,res.client_moniker) + } + } if(paymentFun == 'Alipay'){ if(window.openmobilefun == 'alipay'){ callPayment(res); @@ -108,6 +139,9 @@ $(document).ready(function () { function redirectH5Payment(orderId,clientMoniker){ window.location.href='/api/v1.0/share_code/business/bills/'+clientMoniker+'/orders/'+orderId+'/pay'; } + function redirectH5PaymentForAps(orderId,clientMoniker){ + window.location.href='/api/v1.0/share_code/business/bills/'+clientMoniker+'/orders/'+orderId+'/alipayaps_pay'; + } function getShareLink(){ var paymentLink = '' @@ -127,6 +161,13 @@ $(document).ready(function () { paymentLink = '/api/v1.0/share_code/business/bills/'+window.billInfo.bill_code_id+'/alipay/mobile/redirectApp?priorityChannel=Alipay'; } } + if(paymentFun == 'AlipayAps'){ + if(window.openmobilefun == 'alipayaps'|| window.openmobilefun == 'alipayaps_cn'){ + paymentLink = '/api/v1.0/share_code/business/bills/'+window.billInfo.bill_code_id+'/alipay_aps/mobile'; + }else{ + paymentLink = '/api/v1.0/share_code/business/bills/'+window.billInfo.bill_code_id+'/alipay_aps/mobile/redirectApp?priorityChannel=AlipayAps'; + } + } if(paymentFun == 'Bank'){ paymentLink = '/api/v1.0/share_code/business/bills/'+window.billInfo.bill_code_id+'/cbbank/mobile?partner_moniker='+window.clientmoniker; } @@ -147,6 +188,14 @@ $(document).ready(function () { } } + if(paymentFun == 'AlipayAps'){ + if(window.openmobilefun == 'alipayaps'|| window.openmobilefun == 'alipayaps_cn'){ + paymentLink = '/api/v1.0/share_code/bills/payment/orders/'+window.billInfo.bill_code_id+'/alipay_aps/share_link' + }else{ + paymentLink = '/api/v1.0/share_code/bills/payment/'+window.billInfo.bill_code_id+'/alipay_aps/mobile/redirectApp?priorityChannel=AlipayAps'; + + } + } if(paymentFun == 'Bank'){ paymentLink = '/api/v1.0/share_code/bills/payment/orders/'+window.billInfo.bill_code_id+'/cbbank/share_link?partner_moniker='+window.clientmoniker; } @@ -187,7 +236,11 @@ $(document).ready(function () { function callPayment(paydata) { try { if(typeof paydata.trade_no == 'undefined'){ - window.location.href = paydata.mweb_url + if(paydata.mweb_url!=null){ + window.location.href = paydata.mweb_url + }else{ + window.location.href = paydata.web_url + } }else { AlipayJSBridge.call('tradePay', { tradeNO: paydata.trade_no diff --git a/src/main/ui/static/templates/billCode/js/pc_payment.js b/src/main/ui/static/templates/billCode/js/pc_payment.js index e69cdfa9f..feda74b2f 100644 --- a/src/main/ui/static/templates/billCode/js/pc_payment.js +++ b/src/main/ui/static/templates/billCode/js/pc_payment.js @@ -19,6 +19,9 @@ $(document).ready(function () { }else if(window.clientInfo.enable_cb_bankpay){ var paymentFun = 'Bank'; showQRcode(); + }else if(window.clientInfo.enable_alipayaps){ + var paymentFun = 'AlipayAps'; + showQRcode(); } startCheckOrder(); @@ -43,6 +46,8 @@ $(document).ready(function () { $("#select_wechat").removeClass("no-select-pay-fun").addClass("select-pay-fun"); $("#select_alipay").removeClass("select-pay-fun").addClass("no-select-pay-fun"); $("#select_bank").removeClass("select-pay-fun").addClass("no-select-pay-fun"); + $("#select_alipay_aps").removeClass("select-pay-fun").addClass("no-select-pay-fun"); + showQRcode(); } }) @@ -52,6 +57,18 @@ $(document).ready(function () { $("#select_wechat").removeClass("select-pay-fun").addClass("no-select-pay-fun"); $("#select_alipay").removeClass("no-select-pay-fun").addClass("select-pay-fun"); $("#select_bank").removeClass("select-pay-fun").addClass("no-select-pay-fun"); + $("#select_alipay_aps").removeClass("select-pay-fun").addClass("no-select-pay-fun"); + showQRcode(); + } + }) + $("#select_alipay_aps").click(function(){ + if(paymentFun != 'AlipayAps'){ + paymentFun = 'AlipayAps' + $("#select_wechat").removeClass("select-pay-fun").addClass("no-select-pay-fun"); + $("#select_alipay").removeClass("select-pay-fun").addClass("no-select-pay-fun"); + $("#select_bank").removeClass("select-pay-fun").addClass("no-select-pay-fun"); + $("#select_alipay_aps").removeClass("no-select-pay-fun").addClass("select-pay-fun"); + showQRcode(); } }) @@ -61,6 +78,7 @@ $(document).ready(function () { $("#select_wechat").removeClass("select-pay-fun").addClass("no-select-pay-fun"); $("#select_alipay").removeClass("select-pay-fun").addClass("no-select-pay-fun"); $("#select_bank").removeClass("no-select-pay-fun").addClass("select-pay-fun"); + $("#select_alipay_aps").removeClass("select-pay-fun").addClass("no-select-pay-fun"); showQRcode(); } }) @@ -85,7 +103,15 @@ $(document).ready(function () { "

请使用" + channelName + "客户端扫码支付

" + ""; $('#qrImg').append(selectPaymentHTML) - } else if (paymentFun == 'Bank') { + } + else if (paymentFun == 'AlipayAps') { + $('#qrImg').empty(); + document.getElementById("qrImg").style.display = 'block'; + var selectPaymentHTML = + "

请使用" + channelName + "客户端扫码支付

" + + ""; + $('#qrImg').append(selectPaymentHTML) + }else if (paymentFun == 'Bank') { $('#qrImg').empty(); document.getElementById("qrImg").style.display = 'block'; if( hasPayment){ diff --git a/src/main/ui/static/templates/skip_wxbrowser.css b/src/main/ui/static/templates/skip_wxbrowser.css index e91cd1866..e9a832f30 100644 --- a/src/main/ui/static/templates/skip_wxbrowser.css +++ b/src/main/ui/static/templates/skip_wxbrowser.css @@ -59,6 +59,15 @@ body { background-size: contain; } +.result-alipayaps-logo { + width: 80px; + height: 80px; + margin: auto; + background-image: url(/static/images/alipay_aps_big.svg); + background-repeat: no-repeat; + background-size: contain; +} + .result-royalpay-logo { width: 70px; height: 98px;