From 6d2ff7a95dd474aded61334ab0e6645ef9a76f1b Mon Sep 17 00:00:00 2001 From: tpingzhang <635929049@qq.com> Date: Tue, 5 Nov 2019 16:17:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E6=94=AF=E4=BB=98=20?= =?UTF-8?q?=E4=BC=98=E5=85=88=E6=89=A3=E9=99=A4=E7=BB=91=E5=AE=9A=E5=B8=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sdk/Controller/PayH5Controller.class.php | 8 ++++++-- Application/Sdk/View/default/Spend/pay_way.html | 16 +++++++++++++++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/Application/Sdk/Controller/PayH5Controller.class.php b/Application/Sdk/Controller/PayH5Controller.class.php index dee07c74..d018b40a 100644 --- a/Application/Sdk/Controller/PayH5Controller.class.php +++ b/Application/Sdk/Controller/PayH5Controller.class.php @@ -1195,6 +1195,7 @@ ADD COLUMN `pay_url` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL AFTER // file_put_contents(dirname(__FILE__).'/1222222.txt',get_wx_pay_type()); // 绑币平台币优先处理 $this->other_price($request, $discountAmount); + $pay_amount = $request['price']; //0 官方 1威富通 2俊付通 if (get_wx_pay_type() == 0) { @@ -1333,13 +1334,16 @@ ADD COLUMN `pay_url` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL AFTER $json_data['url']='http://'.$_SERVER ['HTTP_HOST']; } } - redirect(U('spend/paycallback', array( + + echo json_encode(['code' => 200, 'url' => U('spend/paycallback', array( 'sdk_version' => $request['sdk_version'], 'paytype' => 'weixinpay', 'orderno' => $request['pay_order_number'], 'game_id' => $game_id, 'gopay' => 1 // 立即支付 - ))); + ))]); + exit; + // redirect($json_data['url']); } diff --git a/Application/Sdk/View/default/Spend/pay_way.html b/Application/Sdk/View/default/Spend/pay_way.html index 9db94d42..d7e381f2 100644 --- a/Application/Sdk/View/default/Spend/pay_way.html +++ b/Application/Sdk/View/default/Spend/pay_way.html @@ -251,7 +251,21 @@ $(function() { flag = true; $r = small_program("{:C('sqpay.wx_small')}"); if ($r) { - window.location.href = $(this).data('url'); + var url = $(this).data('url'); + + $.ajax({ + type:'post', + dataType:'json', + data:{}, + url:url, + success:function(result) { + if(result.code==200) { + window.location.href = result.url; + } + } + }); + + //window.location.href = $(this).data('url'); } });