Merge branch 'dev' of wmtx/sdk into master

支付页面偶发问题
master
张谷诚 5 years ago committed by Gogs
commit 4982a15cc6

@ -154,7 +154,7 @@
</div> </div>
</if> </if>
<if condition="!pay_limit('wx') and $money elt C('WX_PAY_LIMIT')">
<if condition="C('wei_xin.status') eq 1 or C('weixin_gf.status') eq 1 or (C('goldpig.status') eq 1 and C('goldpig.wx') eq 1) or (C('heepay.status') eq 1) or (C('sqpay.status') eq 1 and C('sqpay.wx_small') eq 1)"> <if condition="C('wei_xin.status') eq 1 or C('weixin_gf.status') eq 1 or (C('goldpig.status') eq 1 and C('goldpig.wx') eq 1) or (C('heepay.status') eq 1) or (C('sqpay.status') eq 1 and C('sqpay.wx_small') eq 1)">
<div class="payment_rest_way way_btn" data-type="wxpay" data-url="{:U('PayH5/weixin_pay',array('user_id'=>I('user_id'),'game_id'=>I('game_id'),'user_token'=>I('user_token'),'api_ver'=>2))}"> <div class="payment_rest_way way_btn" data-type="wxpay" data-url="{:U('PayH5/weixin_pay',array('user_id'=>I('user_id'),'game_id'=>I('game_id'),'user_token'=>I('user_token'),'api_ver'=>2))}">
<div> <div>
@ -164,7 +164,7 @@
<img src="__IMG__/pay_way/dagou1.png" alt=""> <img src="__IMG__/pay_way/dagou1.png" alt="">
</div> </div>
</if> </if>
</if>
<if condition="C('sqpay.status') eq 1 and C('sqpay.shortcut') eq 1"> <if condition="C('sqpay.status') eq 1 and C('sqpay.shortcut') eq 1">
<div class="payment_rest_way way_btn" data-type="shorcut" data-url="{:U('Shortcut/wap_shortcut_pay', array('user_id'=>I('user_id'),'game_id'=>I('game_id'),'user_token'=>I('user_token'),'code'=>1,'extend'=>I('extend'),'api_ver'=>2))}"> <div class="payment_rest_way way_btn" data-type="shorcut" data-url="{:U('Shortcut/wap_shortcut_pay', array('user_id'=>I('user_id'),'game_id'=>I('game_id'),'user_token'=>I('user_token'),'code'=>1,'extend'=>I('extend'),'api_ver'=>2))}">
<div> <div>
@ -228,59 +228,75 @@
} }
} }
defaultInit();
var timefun; var timefun;
$(".select_pay_info").click(function(){
timefun = setTimeout(function(){
$(".tipmsg").html("切换支付失败");
$(".msgdialog").show();
},1000);
$(".payment_rest").show();
clearTimeout(timefun);
})
$(".payment_rest .title>img").click(function(){
$(".payment_rest").hide();
})
$(".payment_rest_way").on("click",function(){ $(function() {
$(this).children("img").attr("src","__IMG__/pay_way/dagou2.png"); defaultInit();
$(this).siblings(".payment_rest_way").children("img").attr("src","__IMG__/pay_way/dagou1.png");
let img=$(this).children("div").children("img").attr("src"); $(".select_pay_info").click(function(){
let text = $(this).children("div").children("span").text(); timefun = setTimeout(function(){
//获取支付参数 $(".tipmsg").html("切换支付失败");
payway = $(this).data("type"); $(".msgdialog").show();
payurl = $(this).data("url"); },1000);
$(".payment_rest").show();
$(".select_pay_info").children(".slide").attr("src",img); clearTimeout(timefun);
$(".select_pay_info").children("div").text(text); });
$(".payment_rest").hide(); $(".payment_rest .title>img").click(function(){
$(".payment_rest").hide();
});
}) $(".payment_rest_way").on("click",function(){
//拉起支付 $(this).children("img").attr("src","__IMG__/pay_way/dagou2.png");
var flag = false; $(this).siblings(".payment_rest_way").children("img").attr("src","__IMG__/pay_way/dagou1.png");
$(".confirm_pay").on("click",function(){ let img=$(this).children("div").children("img").attr("src");
if (flag){ let text = $(this).children("div").children("span").text();
$(".tipmsg").html("支付请求中,请勿重复提交"); //获取支付参数
$(".msgdialog").show(); payway = $(this).data("type");
return false; payurl = $(this).data("url");
};
flag = true; $(".select_pay_info").children(".slide").attr("src",img);
$(".select_pay_info").children("div").text(text);
if(payway == "wxpay"){ $(".payment_rest").hide();
wxpay();
} });
if(payway == "alipay"){ //拉起支付
alipay(); var flag = false;
} $(".confirm_pay").on("click",function(){
if(payway == "shorcut"){ if (flag){
shorcut(); $(".tipmsg").html("支付请求中,请勿重复提交");
} $(".msgdialog").show();
if(payway == "platform_pay"){ return false;
platform_pay(); };
} flag = true;
if(payway == "wxpay"){
wxpay();
}
if(payway == "alipay"){
alipay();
}
if(payway == "shorcut"){
shorcut();
}
if(payway == "platform_pay"){
platform_pay();
}
});
}) $(".payment_rest_btn").click(function(){
$(".payment_rest_btn").hide();
$(".weixin").show();
});
$(".forbid_confirm,.forbid_close").click(function(){
$(".msgdialog").hide();
});
});
//微信支付 //微信支付
function wxpay(){ function wxpay(){
$r = small_program("{:C('sqpay.wx_small')}"); $r = small_program("{:C('sqpay.wx_small')}");
@ -343,16 +359,6 @@
window.location.href = payurl; window.location.href = payurl;
} }
$(".payment_rest_btn").click(function(){
$(".payment_rest_btn").hide();
$(".weixin").show();
})
$(".forbid_confirm,.forbid_close").click(function(){
$(".msgdialog").hide();
})
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
var evt = "onorientationchange" in window ? "orientationchange" : "resize"; var evt = "onorientationchange" in window ? "orientationchange" : "resize";

Loading…
Cancel
Save