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

master
Your Name 5 years ago
commit 4f5654c326

@ -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()); // file_put_contents(dirname(__FILE__).'/1222222.txt',get_wx_pay_type());
// 绑币平台币优先处理 // 绑币平台币优先处理
$this->other_price($request, $discountAmount); $this->other_price($request, $discountAmount);
$pay_amount = $request['price'];
//0 官方 1威富通 2俊付通 //0 官方 1威富通 2俊付通
if (get_wx_pay_type() == 0) { 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']; $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'], 'sdk_version' => $request['sdk_version'],
'paytype' => 'weixinpay', 'paytype' => 'weixinpay',
'orderno' => $request['pay_order_number'], 'orderno' => $request['pay_order_number'],
'game_id' => $game_id, 'game_id' => $game_id,
'gopay' => 1 // 立即支付 'gopay' => 1 // 立即支付
))); ))]);
exit;
// redirect($json_data['url']); // redirect($json_data['url']);
} }

@ -227,7 +227,8 @@ class WapPayController extends BaseController{
*/ */
public function shortcut_pay() { public function shortcut_pay() {
$sqpay = new Sqpay(); $sqpay = new Sqpay();
$param = I(); $param = I("request.");
$signContract = false; // 签约标记 $signContract = false; // 签约标记
if (!$param['user_id'] || !$param['game_id']) { if (!$param['user_id'] || !$param['game_id']) {
@ -268,7 +269,7 @@ class WapPayController extends BaseController{
'secret' => C('sqpay.key'), 'secret' => C('sqpay.key'),
)); ));
//echo "发起支付==》".time()."<br>"; //echo "发起支付==》".time()."<br>";
sleep(5); // sleep(5);
if ($rsp['responseCode'] == '88') { if ($rsp['responseCode'] == '88') {
redirect(U('Spend/pay_success',array('orderno' => $payInfo['order_id'], 'user_id'=>$param['user_id'],'game_id'=>$param['game_id'])));exit; redirect(U('Spend/pay_success',array('orderno' => $payInfo['order_id'], 'user_id'=>$param['user_id'],'game_id'=>$param['game_id'])));exit;
} else { } else {

@ -251,7 +251,21 @@ $(function() {
flag = true; flag = true;
$r = small_program("{:C('sqpay.wx_small')}"); $r = small_program("{:C('sqpay.wx_small')}");
if ($r) { 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');
} }
}); });

@ -14,6 +14,18 @@
<p>平台币充值</p> <p>平台币充值</p>
<div></div> <div></div>
</div> --> </div> -->
<div class="js_dialog" id="iosDialog" style="display: none;">
<div class="weui-mask"></div>
<div class="weui-dialog" style="width: 4rem;height: 4rem;max-width: 4rem;">
<img src="__IMG__/payerroricon.png" style="width: 1.4rem;height: 1.4rem;margin-top: .59rem;">
<p id="errormsg" style="font-size: .24rem;margin-top: .39rem;">输入错误,请重新输入</p>
<div class="btnbox" style="margin-top: .28rem;">
<div id="hidedialog" class="ptbbtn" style="width: 1.5rem;height: .5rem;line-height: .5rem;">
返回
</div>
</div>
</div>
</div>
<form action="" method="get"> <form action="" method="get">
<input type="hidden" name="user_token" value="{$user_token}"> <input type="hidden" name="user_token" value="{$user_token}">
<div class="ptbboxpad pay-form-info"> <div class="ptbboxpad pay-form-info">
@ -28,7 +40,7 @@
<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 id="money" class="weui-input paymoneyinput" type="number" value="" name="money" placeholder="充值金额需要正整数" oninput="this.value=this.value.replace(/[^0-9.]+/,'');"> <input id="money" class="weui-input paymoneyinput" type="number" value="" name="money" placeholder="充值金额需要正整数" oninput="this.value=this.value.replace(/[^0-9]+|^0/,'');">
</div> </div>
</div> </div>
<p class="paymoneyinfo"> <p class="paymoneyinfo">
@ -51,11 +63,11 @@
$(function() { $(function() {
$("#pay").click(function() { $("#pay").click(function() {
if (!$("#money").val()) { if (!$("#money").val()) {
alert('金额不能为空'); showerror("金额不能为空");
return ; return ;
} }
if (!$("#money").val() < 0) { if (!$("#money").val() <= 0) {
alert('金额有误'); showerror("金额有误");
return ; return ;
} }
var money = $("#money").val(); var money = $("#money").val();
@ -63,5 +75,13 @@
window.location.href = "/sdk.php/userH/platform_pay/account/{$account}/user_token/{$user_token}/game_id/{$game_id}/money/"+money+"?action=pay" window.location.href = "/sdk.php/userH/platform_pay/account/{$account}/user_token/{$user_token}/game_id/{$game_id}/money/"+money+"?action=pay"
}); });
}); });
function showerror(msg){
$("#errormsg").html(msg);
$("#iosDialog").show();
$("#hidedialog").off("click");
$("#hidedialog").on("click",function(){
$("#iosDialog").hide();
});
}
</script> </script>
</html> </html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Loading…
Cancel
Save