<!--#include file="../conn/conn2.asp" -->
<!--#include file="../conn/function.asp" -->
<!--#include file="member_check.asp" -->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>会员中心</title>
<%
O_id=trim(Request("O_id"))
action=trim(Request("action"))
pay_type=trim(Request("pay_type"))
set wxpay = New WxPayApi
if action="bankpay" then
if pay_type="" then
call box("请选择付款方式!","back","error")
else
response.Redirect "../bank/alipayapi.asp?O_id="&O_id&"&WIDdefaultbank="&pay_type
end if
end if

sql="select * from SL_orders,SL_product where O_pid=P_id and O_id="&O_id
set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		P_title=rs("P_title")
		P_path=rs("P_path")
		O_num=rs("O_num")
		O_price=rs("O_price")
		O_shuxing=rs("O_shuxing")
		end if
		rs.close
		set rs=nothing
		if O_shuxing="" then
		O_shuxing="无"
		end if
%>
<style type="text/css">

			html {
				overflow:auto;
			}
			body {
			margin:0px;
				
				font-size:12px;
				line-height:180%;
				font-family:"微软雅黑";
				background:url(images/login_bgx.gif);
				
			}
			a img {
	border:none;
}
			a{ font-size:12px; color:#000000; text-decoration:none;}
			a:hover {color:#0066ff;text-decoration: underline}
			.input {border-top:1px solid #ABADB3;border-left:1px solid #ABADB3;border-right:1px solid #ddd;border-bottom:1px solid #ddd;height:24px;width:300px;padding:0 5px;}
			
.container{width:1100px; height:600px; position:absolute; top:50%; left:50%; margin-left:-550px; margin-top:-300px; background:#FFFFFF;box-shadow:0px 0px 20px #999999;}
.submit{ width:131px;height:34px; border:hidden; font-family:"微软雅黑";color:#FFFFFF;background-image:url(img/btn.png);cursor:hand;font-size:15px}
.submit2{ width:131px;height:34px; border:hidden; font-family:"微软雅黑";color:#FFFFFF;background-image:url(img/btn2.png);cursor:hand;font-size:15px}
.boxx{width:150px; height:25px; float:left; font-size:18px; padding:10px;background-color:#EEEEEE;border:#DDDDDD solid 1px; text-align:center;}
.box2x{width:150px; height:25px; float:left; font-size:18px; padding:10px;background-color:#EEEEEE;border-top:#DDDDDD solid 1px;border-right:#DDDDDD solid 1px;border-bottom:#DDDDDD solid 1px;text-align:center;}
.box3x{width:150px; height:25px; float:left; font-size:18px; padding:10px;background-color:#FFFFFF;border-left:#DDDDDD solid 1px;border-right:#DDDDDD solid 1px;border-top:#ff0000 solid 2px;text-align:center; }
.box4x{width:150px; height:25px; float:left; font-size:18px; padding:10px;background-color:#FFFFFF;border-right:#DDDDDD solid 1px;border-top:#ff0000 solid 2px; text-align:center;}

.boxy{background-color:#0066FF; padding:10px; margin:10px 3px 10px 3px; float:left; color:#FFFFFF; font-size:14px; width:60px;}
.box2y{background-color:#0099FF; padding:10px; margin:10px 3px 10px 3px; float:left; color:#FFFFFF; font-size:14px; width:60px;}
.bankbox{padding:5px; margin:5px; border:#CCCCCC solid 1px; width:185px; height:35px; float:left;}
</style>
<script src="../js/jquery-1.8.3.min.js"></script>
<script type="text/javascript">
function test(){
$.post("post.asp",
    {
      O_id:"<%=O_id%>",
    },
    function(data){
	if(data==1){
	document.getElementById("pay_ok").innerHTML="<a href='member_order.asp'><img src='img/pay_ok.png'></a>"
	}
    });
}
setInterval("test()",3000); //每3秒钟执行一次test()
</SCRIPT>
<script>
function showv() { 
<%if C_alipayon="true" then%>
document.getElementById("v").style.display=''; 
document.getElementById("vv").className="box4x";
<%end if%>
<%if C_wxpayon="true" then%>
document.getElementById("t").style.display='none'; 
document.getElementById("tt").className="box2x";
<%end if%>
<%if C_bankon="true" then%>
document.getElementById("x").style.display='none'; 
document.getElementById("xx").className="box2x";
<%end if%>
 }
function showt() { 
<%if C_alipayon="true" then%>
document.getElementById("v").style.display='none'; 
document.getElementById("vv").className="box2x";
<%end if%>
<%if C_wxpayon="true" then%>
document.getElementById("t").style.display=''; 
document.getElementById("tt").className="box4x";
<%end if%>
<%if C_bankon="true" then%>
document.getElementById("x").style.display='none'; 
document.getElementById("xx").className="box2x";
<%end if%>
 }
function showx() { 
<%if C_alipayon="true" then%>
document.getElementById("v").style.display='none'; 
document.getElementById("vv").className="box2x";
<%end if%>
<%if C_wxpayon="true" then%>
document.getElementById("t").style.display='none'; 
document.getElementById("tt").className="box2x";
<%end if%>
<%if C_bankon="true" then%>
document.getElementById("x").style.display=''; 
document.getElementById("xx").className="box4x";
<%end if%>
 }
</script>
</head>
<body onLoad="showv()">
<div class="container">
<!--#include file="left.asp" -->
<%
if M_name="未填写" or M_add="未填写" or M_mobile="未填写" or M_code="未填写"  then
call box("请先完善收货信息，再进行支付","member_edit.asp","error")
end if
%>
<div style="position: relative; padding:20px 20px 20px 220px;">
<div style="height:580px;overflow:auto">
<h2>付款方式</h2>
<hr>
<div style="background-color:#EEEEEE; height:47px;">

<%if C_alipayon="true" then%><a href="javascript:void(0);" onClick="showv()"><div class="box2x" id="vv"><img src="img/alipay.png"></div></a><%end if%>
<%if C_wxpayon="true" then%><a href="javascript:void(0);" onClick="showt()"><div class="box2x" id="tt"><img src="img/weixin.png"></div></a><%end if%>
<%if C_bankon="true" then%><a href="javascript:void(0);" onClick="showx()"><div class="box2x" id="xx"><img src="img/bank.png"></div></a><%end if%>
</div>
<%if C_bankon="true" then%>
<div id="x">
<div style="background:#eeeeee; border:#CCCCCC solid 1px; margin:10px 0 10px 0; padding:10px;">
<table style="line-height:180%;">
<tr><td><img src="../<%=P_path%>" height="130" style="border:#FFFFFF solid 5px; margin-right:10px;"></td><td>
商品名称：<%=P_title%><br>
属性：<%=O_shuxing%><br>
单价：<%=formatnumber(O_price,2,-1)%>元<br>
数量：<%=O_num%><br>
价格：<%=formatnumber(O_price*O_num,2,-1)%>元
</td></tr>
</table>
</div>
<form action="member_pay.asp?action=bankpay" method="post">
<table width="100%">
<input type="hidden" name="O_id" value="<%=O_id%>">
<tr><td></td><td>
<div class="bankbox"><input type="radio" value="ICBCB2C" name="pay_type" > <img src="img/bank/image001.jpg"></div> 
<div class="bankbox"><input type="radio" value="ABC" name="pay_type" > <img src="img/bank/image002.jpg"></div> 
<div class="bankbox"><input type="radio" value="CMB" name="pay_type" > <img src="img/bank/image003.jpg"></div> 
<div class="bankbox"><input type="radio" value="CCB" name="pay_type" > <img src="img/bank/image004.jpg"></div> 
<div class="bankbox"><input type="radio" value="BOCB2C" name="pay_type" > <img src="img/bank/image005.jpg"></div> 
<div class="bankbox"><input type="radio" value="COMM-DEBIT" name="pay_type" > <img src="img/bank/image006.jpg"></div> 
<div class="bankbox"><input type="radio" value="GDB" name="pay_type" > <img src="img/bank/image007.jpg"></div> 
<div class="bankbox"><input type="radio" value="CEB-DEBIT" name="pay_type" > <img src="img/bank/image008.jpg"></div> 
<div class="bankbox"><input type="radio" value="CITIC" name="pay_type" > <img src="img/bank/image009.jpg"></div> 
<div class="bankbox"><input type="radio" value="CMBC" name="pay_type" > <img src="img/bank/image010.jpg"></div> 
<div class="bankbox"><input type="radio" value="POSTGC" name="pay_type" > <img src="img/bank/image011.jpg"></div> 
<div class="bankbox"><input type="radio" value="SPABANK" name="pay_type" > <img src="img/bank/image013.jpg"></div> 
<div class="bankbox"><input type="radio" value="SPDB-DEBIT" name="pay_type" > <img src="img/bank/image014.jpg"></div> 
<div class="bankbox"><input type="radio" value="BJBANK" name="pay_type" > <img src="img/bank/image015.jpg"></div> 
<div class="bankbox"><input type="radio" value="SHRCB" name="pay_type" > <img src="img/bank/image016.jpg"></div> 
<div class="bankbox"><input type="radio" value="NBBANK" name="pay_type" > <img src="img/bank/image019.jpg"></div>
<div class="bankbox"><input type="radio" value="ICBCBTB" name="pay_type" > <img src="img/bank/image020.jpg"></div>
<div class="bankbox"><input type="radio" value="CMBBTB" name="pay_type" > <img src="img/bank/image021.jpg"></div>
<div class="bankbox"><input type="radio" value="CCBBTB" name="pay_type" > <img src="img/bank/image022.jpg"></div>
<div class="bankbox"><input type="radio" value="ABCBTB" name="pay_type" > <img src="img/bank/image023.jpg"></div>
<div class="bankbox"><input type="radio" value="SPDBB2B" name="pay_type" > <img src="img/bank/image024.jpg"></div>


</td></tr>
<tr><td></td><td><input name="Submit" type="submit" class="submit" onMouseOver="this.className='submit2'" onMouseOut="this.className='submit'"  value="付款" /></td></tr>
</table>
</form>
</div>
<%end if%>
<%if C_alipayon="true" then%>
<div id="v">
<div style="background:#eeeeee; border:#CCCCCC solid 1px; margin:10px 0 10px 0; padding:10px;">
<table style="line-height:180%;">
<tr><td><img src="../<%=P_path%>" height="130" style="border:#FFFFFF solid 5px; margin-right:10px;"></td><td>
商品名称：<%=P_title%><br>
属性：<%=O_shuxing%><br>
单价：<%=formatnumber(O_price,2,-1)%>元<br>
数量：<%=O_num%><br>
价格：<%=formatnumber(O_price*O_num,2,-1)%>元
</td></tr>
</table>

</div>
<input name="button" type="button" class="submit" onMouseOver="this.className='submit2'" onMouseOut="this.className='submit'"  value="付款" onClick="document.location.href='../alipay/alipayapi.asp?O_id=<%=O_id%>'" />
</div>
<%end if%>
<%if C_wxpayon="true" then%>
<div id="t">
<div style="background:#eeeeee; border:#CCCCCC solid 1px; margin:10px 0 10px 0; padding:10px;">
<table style="line-height:180%;">
<tr><td><img src="http://paysdk.weixin.qq.com/example/qrcode.php?data=<%=split(GetBody("http://"&Request.ServerVariables("HTTP_HOST")&C_dir&"wxpay/native.asp","body="&P_title&"&attach="&O_id&"&total_fee="&formatnumber(O_price*O_num,2,-1)),"|")(0)%>" height="140" style="padding-right:10px;"></td><td>
商品名称：<%=P_title%><br>
属性：<%=O_shuxing%><br>
单价：<%=formatnumber(O_price,2,-1)%>元<br>
数量：<%=O_num%><br>
价格：<%=formatnumber(O_price*O_num,2,-1)%>元
</td></tr>
</table>
</div>
<div id="pay_ok"><img src="img/wxpay.png"></div>
</div>
<%end if%>
<div style="font: 0px/0px sans-serif;clear: both;display: block"> </div>
</div>
</div>
</body>
</html>