master
tpingzhang 5 years ago
parent ff44173bf3
commit 909f8dc0b8

File diff suppressed because it is too large Load Diff

@ -234,6 +234,8 @@ class SpendController extends Controller {
} }
/* /*
* ALTER TABLE `tab_deposit`
ADD COLUMN `pay_url` varchar(255) NOT NULL DEFAULT '' AFTER `check_sign`;
* 支付中转页 * 支付中转页
*/ */
public function paycallback() { public function paycallback() {
@ -242,6 +244,7 @@ class SpendController extends Controller {
$pay_where = substr($orderno, 0, 2); $pay_where = substr($orderno, 0, 2);
$Scheme = file_get_contents("./Application/Sdk/Scheme/" . $_GET ['game_id'] . ".txt"); $Scheme = file_get_contents("./Application/Sdk/Scheme/" . $_GET ['game_id'] . ".txt");
$map ['pay_order_number'] = $orderno; $map ['pay_order_number'] = $orderno;
$type = I('request.type', 0); // 1 直接唤起支付
switch ($pay_where) { switch ($pay_where) {
case 'SP' : case 'SP' :
$result = M('Spend', 'tab_')->field ("pay_status")->where ($map)->find(); $result = M('Spend', 'tab_')->field ("pay_status")->where ($map)->find();
@ -257,10 +260,21 @@ class SpendController extends Controller {
break; break;
} }
// 微信 支付宝 快捷 // 微信 支付宝 快捷
if ($result['pay_way'] == C('PAY_WAY.WEIXIN') || $result['pay_way'] == C('PAY_WAY.WEIXIN_APP') || $result['pay_way'] == C('PAY_WAY.SQ_SMALL_PROGRAM')) if ($pay_where == "SP") {
$gopayUrl = "/sdk.php/Apple/apple_weixin_pay/user_id/{$result['user_id']}/game_id/{$result['game_id']}/user_token/{$userToken}"; if ($result['pay_way'] == C('PAY_WAY.WEIXIN') || $result['pay_way'] == C('PAY_WAY.WEIXIN_APP') || $result['pay_way'] == C('PAY_WAY.SQ_SMALL_PROGRAM'))
if ($result['pay_way'] == C('PAY_WAY.ALIPAY') || $result['pay_way'] == C('PAY_WAY.SQ_ALIPAY')) $gopayUrl = "/sdk.php/Apple/apple_weixin_pay/user_id/{$result['user_id']}/game_id/{$result['game_id']}/user_token/{$userToken}";
$gopayUrl = "/sdk.php/Apple/apple_alipay_pay/user_id/{$result['user_id']}/game_id/{$result['game_id']}/user_token/{$userToken}"; if ($result['pay_way'] == C('PAY_WAY.ALIPAY') || $result['pay_way'] == C('PAY_WAY.SQ_ALIPAY'))
$gopayUrl = "/sdk.php/Apple/apple_alipay_pay/user_id/{$result['user_id']}/game_id/{$result['game_id']}/user_token/{$userToken}";
}
if ($pay_where == "PF") {
if ($result['pay_way'] == C('PAY_WAY.WEIXIN') || $result['pay_way'] == C('PAY_WAY.WEIXIN_APP') || $result['pay_way'] == C('PAY_WAY.SQ_SMALL_PROGRAM'))
$gopayUrl = "/sdk.php/PayH5/platform_weixin_pay/pay_order_number/{$result['pay_order_number']}/game_id/{$result['game_id']}/user_token/{$userToken}";
if ($result['pay_way'] == C('PAY_WAY.ALIPAY') || $result['pay_way'] == C('PAY_WAY.SQ_ALIPAY'))
$gopayUrl = "/sdk.php/PayH5/platform__alipay_pay/pay_order_number/{$result['pay_order_number']}/game_id/{$result['game_id']}/user_token/{$userToken}";
}
$this->assign("type", $type);
$this->assign ('pay_url', $result['pay_url']);
$this->assign("device", $result['sdk_version']?:0); $this->assign("device", $result['sdk_version']?:0);
$this->assign ('Scheme', $Scheme); $this->assign ('Scheme', $Scheme);
$this->assign ('gopay_url', $gopayUrl); $this->assign ('gopay_url', $gopayUrl);

@ -10,10 +10,12 @@
</head> </head>
<body> <body>
<div class="callback-box"> <div class="callback-box">
<input type="hidden" name="pay_order_number" class="orderno" value="{:I('pay_order_number')}"> <input type="hidden" name="pay_order_number" class="orderno" value="{$pay_order_number}">
<input type="hidden" name="Scheme" class="Scheme" value="{$Scheme}"> <input type="hidden" name="Scheme" class="Scheme" value="{$Scheme}">
<input type="hidden" name="device" class="device" value="{$device}"> <input type="hidden" name="device" class="device" value="{$device}">
<div class="close"> <input type="hidden" name="at_once" class="at_once" value="{$at_once}">
<div class="close" onclick="javascript:history.go(-1);">
<a href="javascript:"> <a href="javascript:">
<img src="__IMG__/callback/close.png"> <img src="__IMG__/callback/close.png">
</a> </a>
@ -27,12 +29,12 @@
</div> </div>
</div> </div>
<div class="btn1"> <div class="btn1">
<a href="{$gopayUrl}" style="background:url('__IMG__/callback/btn1.png') no-repeat center center/100% 100%;"> <a href="{$pay_url}" style="background:url('__IMG__/callback/btn1.png') no-repeat center center/100% 100%;">
继续支付 继续支付
</a> </a>
</div> </div>
<div class="btn2"> <div class="btn2">
<a id="payed" href="javascript:" style="background:url('__IMG__/callback/btn2.png') no-repeat center center/100% 100%;"> <a id="payed" data-order="{$pay_order_number}" href="javascript:" style="background:url('__IMG__/callback/btn2.png') no-repeat center center/100% 100%;">
已完成付款 已完成付款
</a> </a>
</div> </div>
@ -42,11 +44,14 @@
</body> </body>
<script src="__JS__/jquery.min.js"></script> <script src="__JS__/jquery.min.js"></script>
<script> <script>
$(function() { $(function() {
$("#payed").click(function() { $("#payed").click(function() {
var orderno=$('.orderno').val();
var device=$('.device').val();
if (1) { if (1) {
var orderno=$('.orderno').val();
var device=$('.device').val();
if (!device) { if (!device) {
var u = navigator.userAgent; var u = navigator.userAgent;
var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端 var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
@ -63,6 +68,14 @@ $(function() {
} }
} }
}); });
setTimeout(function () { if ($('.at_once').val() == 1) {
window.location.href = "{$pay_url}";
} }, 1);
}); });
</script> </script>
</html> </html>

@ -41,7 +41,7 @@
微信支付 微信支付
</p> </p>
</a> </a>
<a href="{:U('PayH5/platform_alipay_pay', array('price' => $moeny, 'user_token' => I('user_token')))}" class="weui-grid js_grid"> <a href="{:U('PayH5/platform_alipay_pay', array('price' => $money, 'user_token' => I('user_token')))}" class="weui-grid js_grid">
<div class="weui-grid__icon"> <div class="weui-grid__icon">
<img src="__IMG__/alipay.png" alt=""> <img src="__IMG__/alipay.png" alt="">
</div> </div>

@ -22,13 +22,13 @@
<div class="weui-cell borderitem formitem"> <div class="weui-cell borderitem formitem">
<div class="weui-cell__hd"><label class="weui-label">充值账号</label></div> <div class="weui-cell__hd"><label class="weui-label">充值账号</label></div>
<div class="weui-cell__bd"> <div class="weui-cell__bd">
<input class="weui-input" type="text" readonly value="{$account}" name="account" placeholder="请输入qq号"> <input class="weui-input" type="text" readonly value="{$account}" name="account">
</div> </div>
</div> </div>
<div class="weui-cell formitem"> <div class="weui-cell formitem">
<div class="weui-cell__hd"><label class="weui-label">充值金额</label></div> <div class="weui-cell__hd"><label class="weui-label">充值金额</label></div>
<div class="weui-cell__bd"> <div class="weui-cell__bd">
<input class="weui-input paymoneyinput" type="number" value="" name="money" placeholder="充值金额需正整数"> <input class="weui-input paymoneyinput" type="text" value="" name="money" placeholder="充值金额需正整数">
</div> </div>
</div> </div>
<p class="paymoneyinfo"> <p class="paymoneyinfo">

Loading…
Cancel
Save