You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

486 lines
20 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<!-- <meta name="viewport" content="width=device-width, initial-scale=1.0">-->
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<script src="__JS__/jquery-1.11.1.min.js"></script>
<link rel="stylesheet" type="text/css" href="__CSS__/reset.css" />
<link rel="stylesheet" type="text/css" href="__CSS__/payment.css" />
<title>支付中心-4</title>
</head>
<body>
<div class="payment">
<!-- <div class="heard">
<div class="heard_box">
<a href="" style="background-image: url('__IMG__/pay_way/close.png');"></a>
支付中心
</div>
</div> -->
<div class="payment_model" style="position: fixed;width: 100%;height: 100%;top: 0;left: 0;background:rgba(38,38,38,0.4);z-index: 0;display: none"></div>
<div class="payment_window" style="display: none">
<div class="payment_window_img">
<img src="__IMG__/payment_window.png" alt="">
<div></div>
</div>
<div class="payment_window_confirm">返回</div>
<div class="payment_window_close"><img src="__IMG__/pay_way/close2.png" alt=""></div>
</div>
<div class="containner">
<div class="documents">
<div class="documents_box">
<div><span>充值账号:</span> <span>{$account}</span> </div>
<div><span>还需支付:</span><span>¥{$money}.00</span> </div>
</div>
</div>
<div class="select_pay">
<div class="select_pay_box">
<div>请选择支付方式:</div>
<div class="select_pay_info">
<img src="__IMG__/pay_way/zhifubao.png" alt="" class="slide">
<div>支付宝</div>
<img src="__IMG__/pay_way/blue_black.png" alt="" class="boult">
</div>
</div>
</div>
<div class="payment_btn" >
<div>
支付金额 <span>¥{$money}.00</span>
</div>
<div class="confirm_pay">确认支付</div>
</div>
<div class="payment_rest" style="display: none;">
<div class="payment_rest_box">
<div class="title">
<div>请选择支付方式</div>
<img src="__IMG__/pay_way/dacha.png" alt="">
</div>
<if condition="C('alipay.status') eq 1 or (C('goldpig.status') eq 1 and C('goldpig.zfb') eq 1) or (C('sqpay.status') eq 1 and C('sqpay.zfb') eq 1) or (C('heepay.status') eq 1 and C('heepay.alipay') eq 1)">
<div class="payment_rest_way way_btn" data-type="alipay" data-url="{:U('PayH5/platform_alipay_pay', array('user_token' => I('user_token'), 'api_ver' => 2, 'game_id' => $game_id, 'price' => $money))}">
<div>
<img src="__IMG__/pay_way/zhifubao.png" alt="" >
<span>支付宝</span>
</div>
<img src="__IMG__/pay_way/dagou2.png" alt="">
</div>
</if>
<if condition="$money elt C('WX_PAY_LIMIT')">
<if condition="!pay_limit('wx') and 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/platform_weixin_pay',array('price' => $money,'user_token'=>I('user_token'),'api_ver' => 2, 'game_id' => $game_id))}">
<div>
<img src="__IMG__/pay_way/weixin.png" alt="">
<span>微信</span>
</div>
<img src="__IMG__/pay_way/dagou1.png" alt="">
</div>
</if>
</if>
<if condition="C('sqpay.status') eq 1 and C('sqpay.shortcut') eq 1">
<div class="payment_rest_way way_btn" data-type="sqshorcut" data-url="{:U('Shortcut/wap_shortcut_pay', array('user_id'=>$user_id,'game_id'=>I('game_id'),'user_token'=>I('user_token'),'code'=>0,'type'=>'platform', 'price' => $money, 'api_ver' => 2))}">
<div>
<img src="__IMG__/pay_way/xianshang.png" alt="">
<span>快捷银行</span>
</div>
<img src="__IMG__/pay_way/dagou1.png" alt="">
</div>
</if>
<if condition="C('yeepay.status') eq 1 and C('yeepay.shortcut') eq 1">
</if>
<div class="payment_rest_way way_btn" data-type="shorcut" data-url="{:U('Shortcut/yee_pay', array('user_id'=>$user_id,'game_id'=>I('game_id'),'user_token'=>I('user_token'),'code'=>0,'type'=>'platform', 'price' => $money, 'api_ver' => 2))}">
<div>
<img src="__IMG__/pay_way/xianshang.png" alt="">
<span>快捷银行</span>
</div>
<img src="__IMG__/pay_way/dagou1.png" alt="">
</div>
</div>
</div>
<!-- <div class="payment_rest_btn">其他支付方式</div> -->
</div>
<!-- 未成年不许支付弹窗 -->
<div class="msgdialog" style="display: none">
<div class="forbid_model"></div>
<div class="forbid_window">
<div class="forbid_pay">
<img src="__IMG__/pay_way/forbid.png" alt="" style="margin-top: .5rem;">
<div class="tipmsg">未成年禁止支付哟</div>
</div>
<div class="forbid_confirm" style="margin: 0.45rem auto;">确认</div>
<div class="forbid_close"><img src="__IMG__/pay_way/close2.png" alt=""></div>
</div>
</div>
</div>
<input style="display: none" id="user_token" value="{$_REQUEST['user_token']}">
<input style="display: none" id="game_id" value="{$_REQUEST['game_id']}">
<!-- 横屏 -->
<div class="payment_heng">
<!-- <div class="heard">
<div class="heard_box">
<a href="" style="background-image: url('__IMG__/pay_way/close.png');"></a>
支付中心
</div>
</div> -->
<div class="payment_model" style="position: fixed;width: 100%;height: 100%;top: 0;left: 0;background:rgba(38,38,38,0.4);z-index: 0;display: none"></div>
<div class="payment_window" style="display: none">
<div class="payment_window_img">
<img src="__IMG__/payment_window.png" alt="">
<div></div>
</div>
<div class="payment_window_confirm">返回</div>
<div class="payment_window_close"><img src="__IMG__/pay_way/close2.png" alt=""></div>
</div>
<div class="containner">
<div class="documents">
<div class="documents_box">
<div><span>充值账号:</span> <span>{$account}</span> </div>
<div><span>还需支付:</span><span>¥{$money}.00</span> </div>
</div>
</div>
<div class="select_pay">
<div class="select_pay_box">
<div>请选择支付方式:</div>
<div class="select_pay_info">
<img src="__IMG__/pay_way/zhifubao.png" alt="" class="slide">
<div>支付宝</div>
<img src="__IMG__/pay_way/blue_black.png" alt="" class="boult">
</div>
</div>
</div>
<div class="payment_btn" >
<div>
支付金额 <span>¥{$money}.00</span>
</div>
<div class="confirm_pay">确认支付</div>
</div>
<div class="payment_rest" style="display: none;">
<div class="payment_rest_box">
<div class="title">
<div>请选择支付方式</div>
<img src="__IMG__/pay_way/dacha.png" alt="">
</div>
<if condition="C('alipay.status') eq 1 or (C('goldpig.status') eq 1 and C('goldpig.zfb') eq 1) or (C('sqpay.status') eq 1 and C('sqpay.zfb') eq 1) or (C('heepay.status') eq 1 and C('heepay.alipay') eq 1)">
<div class="payment_rest_way way_btn" data-type="alipay" data-url="{:U('PayH5/platform_alipay_pay', array('user_token' => I('user_token'), 'api_ver' => 2, 'game_id' => $game_id, 'price' => $money))}">
<div>
<img src="__IMG__/pay_way/zhifubao.png" alt="" >
<span>支付宝</span>
</div>
<img src="__IMG__/pay_way/dagou2.png" alt="">
</div>
</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)">
<div class="payment_rest_way way_btn" data-type="wxpay" data-url="{:U('PayH5/platform_weixin_pay',array('price' => $money,'user_token'=>I('user_token'),'api_ver' => 2, 'game_id' => $game_id))}">
<div>
<img src="__IMG__/pay_way/weixin.png" alt="">
<span>微信</span>
</div>
<img src="__IMG__/pay_way/dagou1.png" alt="">
</div>
</if>
</if>
<if condition="C('sqpay.status') eq 1 and C('sqpay.shortcut') eq 1">
<div class="payment_rest_way way_btn" data-type="sqshorcut" data-url="{:U('Shortcut/wap_shortcut_pay', array('user_id'=>$user_id,'game_id'=>I('game_id'),'user_token'=>I('user_token'),'code'=>0,'type'=>'platform', 'price' => $money, 'api_ver' => 2))}">
<div>
<img src="__IMG__/pay_way/xianshang.png" alt="">
<span>快捷银行</span>
</div>
<img src="__IMG__/pay_way/dagou1.png" alt="">
</div>
</if>
<if condition="C('yeepay.status') eq 1 and C('yeepay.shortcut') eq 1">
</if>
<div class="payment_rest_way way_btn" data-type="shorcut" data-url="{:U('Shortcut/yee_pay', array('user_id'=>$user_id,'game_id'=>I('game_id'),'user_token'=>I('user_token'),'code'=>0,'type'=>'platform', 'price' => $money, 'api_ver' => 2))}">
<div>
<img src="__IMG__/pay_way/xianshang.png" alt="">
<span>快捷银行</span>
</div>
<img src="__IMG__/pay_way/dagou1.png" alt="">
</div>
</div>
</div>
<!-- 供上下滑动延长 -->
<div style="width: 100%;height: 2rem;"></div>
<!-- 未成年不许支付弹窗 -->
<div class="msgdialog" style="display: none">
<div class="forbid_model"></div>
<div class="forbid_window">
<div class="forbid_pay">
<img src="__IMG__/pay_way/forbid.png" alt="" style="margin-top: .25rem;">
<div class="tipmsg">未成年禁止支付哟</div>
</div>
<div class="forbid_confirm" style="margin: 0.2rem auto;">确认</div>
<div class="forbid_close"><img src="__IMG__/pay_way/close2.png" alt=""></div>
</div>
</div>
</div>
</body>
</html>
<script>
// 业务逻辑js
var payway='';
var payurl='';
//初始化选择
function defaultInit(){
payway="alipay";
payurl="{:U('PayH5/platform_alipay_pay', array('user_token' => I('user_token'), 'api_ver' => 2, 'game_id' => $game_id, 'price' => $money))}";
var user_token = $('#user_token').val();
payChannelIntentionInit(user_token);
}
function payChannelIntentionInit(user_token) {
var game_id = $('#game_id').val();
$.ajax({
type:'post',
dataType:'json',
data:{
user_token:user_token,
payway:payway,
game_id:game_id
},
url:'/sdk.php/Spend/addPayChannelIntention',
success:function(result) {
if(result.code==0) {
flag=false;
$(".tipmsg").html(result.msg);
$(".msgdialog").show();
}
},
error: function(){
flag=false;
$(".tipmsg").html("接口请求错误");
$(".msgdialog").show();
}
});
}
defaultInit();
function closeWindow() {
$(".payment_window").hide();
$(".payment_model").hide();
}
function showWindow(msg) {
$(".payment_window").show();
$(".payment_model").show();
$(".payment_window_img").children().next().text(msg);
}
$(".payment_window_close").click(function() {
closeWindow();
});
$(".payment_window_confirm").click(function() {
closeWindow();
});
$(".select_pay_info").click(function(){
$(".payment_rest").show();
})
$(".payment_rest .title>img").click(function(){
$(".payment_rest").hide();
})
$(".payment_rest_way").click(function(){
$(this).children("img").attr("src","__IMG__/pay_way/dagou2.png");
$(this).siblings(".payment_rest_way").children("img").attr("src","__IMG__/pay_way/dagou1.png");
var img=$(this).children("div").children("img").attr("src");
var text = $(this).children("div").children("span").text();
//获取支付参数
if (payway == $(this).data("type")) return ;
//获取支付参数
payway = $(this).data("type");
payurl = $(this).data("url");
$(".select_pay_info").children(".slide").attr("src",img);
$(".select_pay_info").children("div").text(text);
$(".payment_rest").hide();
var user_token = $('#user_token').val();
payChannelIntentionInit(user_token);
})
//拉起支付
var flag = false;
$(".confirm_pay").on("click",function(){
if (flag) return ;
flag = true;
if(payway == "wxpay"){
wxpay();
}
if(payway == "alipay"){
alipay();
}
if(payway == "shorcut"){
shorcut();
}
if(payway == "sqshorcut"){
sqshorcut();
}
})
//微信支付
function wxpay(){
$.ajax({
type: "GET",
dataType: "json",
url: payurl,
data: {
},
success: function (r) {
flag = false;
if (r.code == 200) {
window.location.href = r.url;
} else if(r.code == 1001) {
showWindow(r.msg);
} else {
$(".tipmsg").html(r.msg);
$(".msgdialog").show();
}
}
});
}
//支付宝支付
function alipay(){
var url = payurl;
$.ajax({
type: 'post',
dataType: 'json',
data: {},
url: url,
success: function (result) {
flag = false;
if (result.code == 200) {
window.location.href = result.url;
return;
var data = result.data;
if (data.wap == 1) {
/* if () {
window.txyxsdk.sqzfbcallback();
} */
location.href = data.url;
} else {
var u = navigator.userAgent;
var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
if (isAndroid) {
window.txyxsdk.getZFBPay(data.url);
} else {
try {
window.webkit.messageHandlers.noticeAppResult.postMessage(data.url);
} catch (err) {
}
}
}
} else if(result.code == 1001) {
showWindow(result.msg);
}else {
$(".tipmsg").html(result.msg);
$(".msgdialog").show();
}
}
});
}
//快捷支付
function shorcut(){
$.ajax({
type: "GET",
dataType: "json",
url: payurl,
data: {
},
success: function (r) {
flag = false;
if (r.code == 200) {
window.location.href = r.url;
} else if(r.code == 1001) {
showWindow(r.msg);
} else {
$(".tipmsg").html(r.msg);
$(".msgdialog").show();
}
}
});
// flag = false;
// window.location.href =payurl;
}
//快捷支付
function sqshorcut(){
var url = payurl;
flag = false;
$.ajax({
type:'post',
dataType:'json',
data:{sign: 1},
url:url,
success:function(result) {
if(result.code==200) {
window.location.href = url;
} else if(result.code==1001){
flag=false;
showWindow(result.msg);
} else {
flag=false;
$(".tipmsg").html(result.msg);
$(".msgdialog").show();
}
},
error:function(){
flag=false;
$(".tipmsg").html("接口请求错误");
$(".msgdialog").show();
}
});
return false;
// flag = false;
// 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 type="text/javascript">
var evt = "onorientationchange" in window ? "orientationchange" : "resize";
window.addEventListener(evt,resize,false);
function resize(fals) {
if(window.orientation == 0 || window.orientation == 180) {
$(".payment").show();
$(".payment_heng").hide();
}else {
$(".payment").hide();
$(".payment_heng").show();
}
}
resize(true);
</script>