Merge branch 'dev' of 47.111.118.107:/srv/git/sdk into dev

master
chenzhi 5 years ago
commit 85e74a5854

@ -1290,7 +1290,13 @@ ADD COLUMN `pay_url` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL AFTER
$json_data['url']='http://'.$_SERVER ['HTTP_HOST']; $json_data['url']='http://'.$_SERVER ['HTTP_HOST'];
} }
} }
redirect($json_data['url']); redirect(U('spend/paycallback', array(
'paytype' => 'weixinpay',
'orderno' => $request['pay_order_number'],
'game_id' => $game_id,
'gopay' => 1 // 立即支付
)));
// redirect($json_data['url']);
} }

@ -248,7 +248,9 @@ ADD COLUMN `pay_url` varchar(255) NOT NULL DEFAULT '' AFTER `check_sign`;
$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 直接唤起支付 $paytype = I('request.paytype', 0); // 支付方式 weixin alipay
$gopay = I('request.gopay');
switch ($pay_where) { switch ($pay_where) {
case 'SP' : case 'SP' :
$result = M('Spend', 'tab_')->field ("*")->where ($map)->find(); $result = M('Spend', 'tab_')->field ("*")->where ($map)->find();
@ -287,10 +289,11 @@ ADD COLUMN `pay_url` varchar(255) NOT NULL DEFAULT '' AFTER `check_sign`;
// pp($gopayUrl); // pp($gopayUrl);
$this->assign("orderno", $orderno); $this->assign("orderno", $orderno);
$this->assign("type", $type); $this->assign("paytype", $paytype);
$this->assign ('pay_url', $result['pay_url']); $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', $gopay);
$this->assign ('gopay_url', $gopayUrl); $this->assign ('gopay_url', $gopayUrl);
$this->assign ('paystatus', $result ['pay_status']); $this->assign ('paystatus', $result ['pay_status']);

@ -14,6 +14,9 @@
<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}">
<input type="hidden" name="at_once" class="at_once" value="{$at_once}"> <input type="hidden" name="at_once" class="at_once" value="{$at_once}">
<input type="hidden" name="gopay_url" class="gopay_url" value="{$gopay_url}">
<input type="hidden" name="gopay" class="gopay" value="{$gopay}">
<!-- <div class="close" onclick="javascript:history.go(-1);"> <!-- <div class="close" onclick="javascript:history.go(-1);">
<a href="javascript:"> <a href="javascript:">
@ -29,9 +32,19 @@
</div> </div>
</div> </div>
<div class="btn1"> <div class="btn1">
<eq name="paytype" value="weixinpay">
{$gopay_url}
<a href="{$gopay_url}" style="background:url('__IMG__/callback/btn1.png') no-repeat center center/100% 100%;"> <a href="{$gopay_url}" style="background:url('__IMG__/callback/btn1.png') no-repeat center center/100% 100%;">
继续支付</a>
</eq>
<eq name="paytype" value="alipay">
<a id="alipay" href="{$gopay_url}" style="background:url('__IMG__/callback/btn1.png') no-repeat center center/100% 100%;">
继续支付 继续支付
</a> </a>
</eq>
</div> </div>
<div class="btn2"> <div class="btn2">
<a id="payed" data-order="{$pay_order_number}" 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%;">
@ -46,6 +59,11 @@
<script> <script>
$(function() { $(function() {
$(window).load( function(){
if ($(".gopay").val() == 1) {
window.location.hef = $(".gopay_url").val();
}
});
$("#payed").click(function() { $("#payed").click(function() {
var orderno=$('.orderno').val(); var orderno=$('.orderno').val();
@ -103,11 +121,46 @@ $(function() {
}); });
/* setTimeout(function () { if ($('.at_once').val() == 1) { $('#alipay').on('click',function() {
var that = $(this),url = $.trim(that.attr('data-url'));
if(that.hasClass('disabledbtn')){return false;}
that.addClass('disabled');
$.ajax({
type:'post',
dataType:'json',
data:{},
url:url,
success:function(result) {
if(result.code==200) {
var data = result.data;
if(data.wap==1) {
window.location.href = "{$pay_url}"; location.href = data.url;
} }, 1); */
} else if (data.wap==1) {
window.webkit.messageHandlers.noticeAppResult.postMessage(data.url);
}
else {
if ($('#sdk_version').val() == 1)
window.txyxsdk.getZFBPay(data.url);
else
window.webkit.messageHandlers.noticeAppResult.postMessage(data.url);
}
} else {
layer.open({
content: result.msg
,skin: 'msg'
,time: 2 //2秒后自动关闭
});
}
},error:function() {
that.removeClass('disabledbtn');
}
});
return false;
});
}); });
</script> </script>

Loading…
Cancel
Save