<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="order.aspx.cs" Inherits="TW.UI.order" %>


<!DOCTYPE html>
<html>
<head lang="en">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9">
<script type="text/javascript" src="/static/card/js/configweb.js"></script>
	<title>提交订单_<%=config.SiteName %></title>
	<link rel="stylesheet" href="/static/card/css/public.css">
    <link rel="stylesheet" href="/static/card/css/trade.css"> 
    <script type="text/javascript" src="/static/card/js/jquery-1.11.3.js"></script>
    <script type="text/javascript" src="/static/card/js/tools.js"></script>
    
<script type="text/javascript">
    var feeProp = <%=feeProp %>;
    var goodsid = <%=goodsid %>;
    var price = <%=price %>;
    $(function(){
        $("#goodsNum").bind("input propertychange", function () {
            var goodsNum = $("#goodsNum").val();
            if (isNaN(goodsNum) || goodsNum < 1) {
                goodsNum = 1;
            }
            limitnum(goodsNum,<%=goodsid %>);
        });
    });
    function chksub(){       
        if ($("#goodsNum").val()<=0) {
            alert("数量必须大于0");
            $("#goodsNum").focus();
            return false;
        }
        <%if(isRegionServerMFill){ %>
        if ($.trim($("#region").val())=="") {
            alert("大区不能为空");
            $("#region").focus();
            return false;
        }
        if ($.trim($("#gameserver").val())=="") {
            alert("服务器不能为空");
            $("#gameserver").focus();
            return false;
        }
        <%} %>
        if ($("#gameAccount").length>0 && $.trim($("#gameAccount").val()) =="") {
            alert("帐号不能为空");
            $("#gameAccount").focus();
            return false;
        }
        if ($("#checkGameAccount").length>0 && $.trim($("#checkGameAccount").val()) =="") {
            alert("确认帐号不能为空");
            $("#checkGameAccount").focus();
            return false;
        }
        if ($("#gameAccount").length>0 && 
            $.trim($("#gameAccount").val()) != $.trim($("#checkGameAccount").val())
            ) {
            alert("确认帐号输入不一致");
            $("#checkGameAccount").focus();
            return false;
        }
        
        if ($("#email").length>0 && $.trim($("#email").val()) =="") {
            alert("收货邮箱不能为空");
            $("#email").focus();
            return false;
        }
        if ($("#checkEmail").length>0 && $.trim($("#checkEmail").val()) =="") {
            alert("确认收货邮箱不能为空");
            $("#checkEmail").focus();
            return false;
        }
        if ($("#email").length>0 && 
            $.trim($("#email").val()) != $.trim($("#checkEmail").val())
            ) {
            alert("确认收货邮箱输入不一致");
            $("#checkEmail").focus();
            return false;
        }
        
        if ($("#orderPwd").length>0) {
            if ($.trim($("#orderPwd").val()) == "") {
                alert("提取密码不能为空");
                $("#orderPwd").focus();
                return false;
            }
            if ($.trim($("#orderPwd").val()).length < 6) {
                alert("提取密码不能小于6位");
                $("#orderPwd").focus();
                return false;
            }
        }
    }
    function goodsSub() {
        var goodsNum = $("#goodsNum").val();
        if (isNaN(goodsNum) || goodsNum<1) {
            goodsNum = 1;
        }
        goodsNum = parseInt(goodsNum);
        if (goodsNum>1) {
            goodsNum = goodsNum - 1;
        }
        $("#goodsNum").val(goodsNum);
        amtnumcalcul();
    }
    function goodsAdd() {
        var goodsNum = $("#goodsNum").val();
        if (isNaN(goodsNum) || goodsNum < 1) {
            goodsNum = 1;
        }
        goodsNum = parseInt(goodsNum);
        goodsNum = goodsNum + 1;
        limitnum(goodsNum,<%=goodsid %>);
    }
    function limitnum(goodsNum,id){
        $.ajax({
            type:"post",
            dataType:"json",
            url: "/ajax/ajax.aspx?act=limitnum&gdsid="+id,
            success:function(data){
                if (data.flag) {
                    if (goodsNum>data.num) {
                        alert("最大数量不能超过"+data.num);
                        goodsNum=data.num;
                    }
                }
                $("#goodsNum").val(goodsNum);
                amtnumcalcul();
            },
            error: function (e) {
                alert(e.responseText);
            }
        });
    }
    function amtnumcalcul(){
        var num = $("#goodsNum").val();
        var amt = Math.round((num*price)*100)/100;
        var fee = Math.round(((feeProp/100)*amt)*100)/100;
        var totalamt = amt+fee;
        $("#goodsAmountDivId").html("￥"+amt);
        $("#showTotal").html(num);
        $("#showAmount").html("￥"+totalamt);
        if (fee>0) {
            $("#smlfee").html("(包含服务费:"+fee+"元)");
            $("#serviceChargeSpan").html("￥"+fee);
        }
        $("#payAmount").html("￥"+totalamt);
    }
</script>
<body>
<form id="form1" runat=server>
<style type="text/css">
	*{padding: 0;margin:0;}
	#msg-bg{
      	background-color: rgba(0, 0, 0, 0.5) !important;  
      	background-color: #000;
	    filter: alpha(opacity=50);    
	    -moz-opacity:0.5;    
	    -khtml-opacity: 0.5;    
	    opacity: 0.5;   
	    width: 100%;
	    height: 100%;
	    position: fixed;
	    z-index: 99;

	}
	#msg-fp {
		position: fixed;
		z-index: 999;
		top: 50%;
		left: 50%;
		height: 320px;
		width: 650px;
		margin-top: -160px;
		margin-left: -325px;
		border:2px solid #ea4444;
		border-radius: 10px;
		background: url(/static/card/css/files/msg.png) no-repeat 27px -10px #fff;	
	}
	#msg-fp .fptips-title{
		height: 60px;
		line-height: 60px;
		color: #f38c06;
		padding-left: 150px;
	}
	#msg-fp .fptips-text,#msg-fp .fptips-c{
		padding-left: 120px;
	}
	#msg-fp .fptips-list{
		margin-left: 60px;
		border-radius: 10px;
		border:1px solid #f38c06;
		list-style: none;
		padding: 10px 15px 0px;
		width: 545px;
		margin-top: 20px;
	}
	#msg-fp .fptips-list li{
		font-size: 13px;
		height: 40px;
		line-height: 40px;
		color: #ea4444;
		border-bottom: 1px solid #ccc;
		margin-top: 1px;
	}
	#msg-fp .fp-more{
		color: #0066cc;
		text-decoration: none;
	}
	#msg-fp .fptips-c{
		font-size: 14px;
		height: 30px;
		line-height: 30px;
	}
	#msg-fp .fp-agree{
		text-align: center;
		height: 50px;
		line-height: 50px;
	}
	#msg-fp .agree-btn{
		display: block;
		height: 30px;
		line-height: 30px;
		width: 160px;		
		border-radius: 5px;
		margin: 0 auto;
		text-decoration: none;
		font-size: 13px;

		color: #fff;		
	}
	#msg-fp .agree-no{
		background-color: #8c8c8c;
		cursor: default;
	}
	#msg-fp .agree{
		background-color: #ea4444;
		cursor: pointer;
	}
</style>
<div id="msg-bg"></div>
<div id="msg-fp">
	<h2 class="fptips-title">
		<%=config.SiteName %>防骗提醒！
	</h2>
	<p class="fptips-text">
		由于近期诈骗案件频发，<%=config.SiteName %>提醒您注意以下3种诈骗方式:
	</p>
	<ul class="fptips-list">
		<li>1.骗子以购买点卡换取游戏币或装备为借口，让您提供点卡卡号和卡密。</li>
		<li>2.假客服提出商品出售要缴纳押金，保证金，激活费，信用点等。</li>
		<li>3.兼职、刷信誉、做任务返利等常用其他骗术。</li>
	</ul>
	<p class="fptips-c">
		如您有疑问，请立即前往首页右侧中间验证客服真假，谨防受骗！<a href="<%=config.MrCheatUrl %>" class="fp-more">查看更多骗术&gt;&gt;</a>
	</p>
	<div class="fp-agree">
		<a href="javascript:void(0)" class="agree-btn agree-no" id="agreeBtn">我已阅读以上信息(3)</a>
	</div>
</div>
<script type="text/javascript">
<%if(fstenter){ %>
var timeSec = 3;
var fpSec = document.getElementById("fpSec"), agreeBtn = document.getElementById('agreeBtn');
var t = setInterval(function () {
    timeSec--;
    if (timeSec <= 0) {
        agreeBtn.innerHTML = "我已阅读以上信息";
        agreeBtn.className = "agree-btn agree";
        agreeBtn.onclick = function () {
            document.getElementById('msg-fp').style.display = "none";
            document.getElementById('msg-bg').style.display = "none";
        };
        clearInterval(t);
    } else {
        agreeBtn.innerHTML = "我已阅读以上信息(" + timeSec + ")"; 
    }
}, 1000);
<%}else{ %>
            document.getElementById('msg-fp').style.display = "none";
            document.getElementById('msg-bg').style.display = "none";
<%} %>
</script>

<TW:Header ID="Header1" runat="server" />

<div class="content">
    <div class="container clearfix">
        <div class="order-wrap">
            <div class="process">
            <img alt="" src="/static/card/css/files/trade-01.png"></div>
            <div class="tip-wrap">
                <h4>充值提醒</h4>
                <asp:Literal ID="litBuyCZTX" runat="server"></asp:Literal>
            </div>
            <div class="goods-wrap">
                <div class="head">
                    填写核对订单信息
                </div>
                <div class="content-wrap">
                    <ul class="table-head">
                        <li class="name">商品名称</li>
                        <li class="value">面值</li>
                        <li class="price">售价</li>
                        <li class="num">数量</li>
                        <li class="amount">总计</li>
                    </ul>
                    <ul class="table-body">
                       
	                       	 <li>
	                            <div class="name">
                                    <asp:Image ID="imgGds" runat="server" />
                                    <asp:Literal ID="litGdsTit" runat="server"></asp:Literal>
	                            </div>
	                            <div class="value">￥<asp:Literal ID="litParVal" runat="server"></asp:Literal></div>
	                            <div class="price">￥<asp:Literal ID="litPrice" runat="server"></asp:Literal></div>
	                            <div class="num">
	                                <a href="javascript:goodsSub('1');" class="operation-btn minus-btn"></a>
	                                <input type="text" class="input-text value-text" id="goodsNum" name="goodsNum" value="<%=goodsNum %>">
	                                <input type="hidden" id="goodsid" name="goodsid" value="<%=goodsid %>">
	                                <a href="javascript:goodsAdd('1');" class="operation-btn add-btn"></a>
	                            </div>
	                            <div class="amount" id="goodsAmountDivId">￥<asp:Literal ID="litAmount" runat="server"></asp:Literal></div>
	                        </li>
                       
                    </ul>
                </div>
                <div class="table-bottom">
                    共计<span id="showTotal"><%=goodsNum %></span>件商品&nbsp;
                    合计：
                    <span id="showAmount">
                        ￥<asp:Literal ID="litTotalAmt" runat="server"></asp:Literal>
                    </span>
                    <span id="smlfee" style="font-size: 12px;"><asp:Literal ID="litFee" runat="server"></asp:Literal></span>
                    
                </div>
            </div>
            <div class="buyer-wrap">
                <div class="title">填写收货信息</div>
                <ul class="form-wrap">
                    <asp:PlaceHolder ID="phCZZH" runat="server" Visible="False">
                    <li class="clearfix">
                        <div class="label">充值账号：</div>
                        <div class="inp">
                            <input type="text" class="input-text" name="gameAccount" id="gameAccount" value="">
                        </div>
                        <div class="tip" id="gameAccount_tip"> </div>
                    </li>
                    <li class="clearfix">
                        <div class="label">确认充值账号：</div>
                        <div class="inp">
                            <input type="text" class="input-text" name="checkGameAccount" id="checkGameAccount" onpaste="return false">
                        </div>
                        <div class="tip" id="checkGameAccount_tip"> </div>
                    </li>
                    </asp:PlaceHolder>
                    <asp:PlaceHolder ID="phDQFWQ" runat="server" Visible="False">
	                <li class="clearfix">
	                    <div class="label">大区：</div>
                        <div class="inp">
                            <input type="text" class="input-text" name="region" id="region" onpaste="return false">
                        </div>
	                    <div class="tip" id="area_tip"> </div>
	                </li>    
                    <li class="clearfix">
	                    <div class="label">服务器：</div>
                        <div class="inp">
                            <input type="text" class="input-text" name="gameserver" id="gameserver" onpaste="return false">
                        </div>
	                    <div class="tip" id="server_tip"> </div>
	                </li>
                    </asp:PlaceHolder>
                    <asp:PlaceHolder ID="phGetEmail" runat="server" Visible="False">
                    <li class="clearfix">
                        <div class="label">收货邮箱：</div>
                        <div class="inp">
                            <input type="text" id="email" name="email" class="input-text">
                            <ul class="emaillist">
					        
					      </ul>
                        </div>
                        <div class="tip" id="email_tip">请填写用于收货的正确邮箱地址 ，信息将通过邮箱发送给您！</div>
                    </li>
                    <li class="clearfix">
                        <div class="label">确认收货邮箱：</div>
                        <div class="inp">
                            <input type="text" id="checkEmail" name="checkEmail" class="input-text" autoComplete="off" onpaste="return false">
                        </div>
                        <div class="tip" id="checkEmail_tip">请再次填写您的收货邮箱！</div>
                    </li>
                    <li class="clearfix">
                       	请您仔细核对收件邮箱地址，如果因邮箱地址错误导致收货异常或者错发给他人，本网站概不负责！
                    </li>
                    </asp:PlaceHolder>
                </ul>
            </div>
            <asp:Panel ID="plSearchPass" runat="server" class="search-wrap" Visible="False">
               	<div class="title">填写查询信息</div>
                <ul class="form-wrap">
                    <li class="clearfix">
                        <div class="label">提取密码：</div>
                        <div class="inp">
                            <input type="password" class="input-text" id="orderPwd" name="orderPwd" value="" maxlength="15">
                        </div>
                        <div class="tip" id="orderPwd_tip"> 
                        	用户查询订单卡密时需提供此密码，请牢记！
                        </div>
                    </li>
                </ul>
            </asp:Panel>
            
            <div class="total-wrap">
                <asp:Literal ID="litFeeBigShow" runat="server"></asp:Literal>
                <p>应付总额：<span class="amount" id="payAmount">￥<asp:Literal ID="litTotalAmtBigShow" runat="server"></asp:Literal></span></p>
                <asp:Button ID="btnDeal" runat="server" Text="去结算" CssClass="default-btn" onclick="btnDeal_Click" onclientclick="return chksub();" />
            </div>
        </div>
    </div>
</div>

<TW:Footer ID="Footer1" runat="server" />

<script type="text/javascript">
    $(function () {
        var mailList = new Array('@163.com', '@126.com', '@qq.com', '@gmail.com', '@live.com', '@sohu.com', '@sina.com', '@sina.cn', '@vip.sina.com', '@hotmail.com', '@139.com', '@wo.com.cn', '@189.cn', '@21cn.com');
        $("#email").bind("keyup", function () {
            var val = $(this).val();
            if (val == '' || val.indexOf("@") > -1) {
                $(".emaillist").hide();
                return false;
            }
            $('.emaillist').empty();
            for (var i = 0; i < mailList.length; i++) {
                var emailText = $(this).val();
                $('.emaillist').append('<li>' + emailText + mailList[i] + '</li>');
            }
            $('.emaillist').show();
            $('.emaillist li').click(function () {
                $('#email').val($(this).text());
                $('.emaillist').hide();
            })
        })
    })
</script>

</form>
</body>
</html>

