From 923886f47581ef15076da85bcb8df33f4459ed86 Mon Sep 17 00:00:00 2001 From: tpingzhang <635929049@qq.com> Date: Wed, 20 Nov 2019 10:47:36 +0800 Subject: [PATCH] =?UTF-8?q?ios=E3=80=81=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sdk/View/default/Spend/paycallback.html | 33 ++++++++++++------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/Application/Sdk/View/default/Spend/paycallback.html b/Application/Sdk/View/default/Spend/paycallback.html index af2202d0..9dd1a4b6 100644 --- a/Application/Sdk/View/default/Spend/paycallback.html +++ b/Application/Sdk/View/default/Spend/paycallback.html @@ -92,8 +92,6 @@ function paycallback() { $(function() { $(window).load( function(){ - var u = navigator.userAgent; - $("#testn").html(u); if ($(".gopay").val() == 1) { if ($(".aliapp").val() == 1) { var url = $(".gopay_url").val(); @@ -148,34 +146,47 @@ $(function() { success: function(r) { var u = navigator.userAgent; var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端 - + var isSafari = u.indexOf('Safari') > -1 || u.indexOf('safari') > -1; //android终端 if (r.type == "deposit") { if (r.payStatus == '1') { // 提示支付成功 $("#paytype").html("支付成功"); if (!isAndroid) { - try { - // window.location.href = Scheme+"://1"; - // window.location.href = Scheme+"://1"; + if (isSafari) { + window.location.href = Scheme+"://1"; + } else { + $("#toast").show(); + setTimeout(function(){ + window.location.href = r.url; + },2000) + } + /* try { window.webkit.messageHandlers.exchangeResult.postMessage(1); - // window.location.href = r.url; } catch(err) { window.location.href = Scheme+"://1"; - // window.location.href = Scheme+"://1"; - } + } */ } } else { // 提示支付失败 $("#paytype").html("支付失败"); if (!isAndroid) { - try { + if (isSafari) { + window.location.href = Scheme+"://0"; + } else { + $("#toast").show(); + setTimeout(function(){ + window.location.href = r.url; + },2000) + } + + /* try { window.webkit.messageHandlers.exchangeResult.postMessage(0); // window.location.href = r.url; } catch(err) { window.location.href = Scheme+"://0"; - } + } */ } }