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

<!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><%=Pagefn %>我的订单_<%=config.SiteName %></title>
	<link rel="stylesheet" href="/static/card/css/public.css" />
    <link rel="stylesheet" href="/static/card/css/userCenter.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>
	<link rel="stylesheet" href="/static/card/css/public.css" />
    <link rel="stylesheet" href="/static/card/css/userCenter.css" />
    <link rel="stylesheet" href="/static/card/css/userCenterNew.css" />
    <script type="text/javascript" src="/js/My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript">
        $(function () {
            $(".all-select i").click(function () {
                var className = $(this).attr("class");
                if (className.indexOf("icon-no-check-square") >= 0) {
                    $('.check-label i').attr('class', 'icon icon-checked-square');
                    $("input[type='checkbox'][name*='chkBox']").prop("checked", true);
                } else {
                    $('.check-label i').attr('class', 'icon icon-no-check-square');
                    $("input[type='checkbox'][name*='chkBox']").prop("checked", false);
                }
            });
            $(".simple-select i").click(function () {
                var className = $(this).attr("class");
                if (className.indexOf("icon-no-check-square") >= 0) {
                    $(this).attr('class', 'icon icon-checked-square');
                    $(this).parent().prev().prop("checked", true);
                } else {
                    $(this).attr('class', 'icon icon-no-check-square');
                    $(this).parent().prev().prop("checked", false);
                }
            });
            $(".like-option li").click(function () {
                $("#status").val($(this).attr("data"));
            });
        });
        function CheckCollectLen() {
            if ($("input[type='checkbox'][name*='chkBox']:checked").length <= 0) {
                alert("请勾选要处理的项目");
                return false;
            }
            return true;
        }
        function searchOrder() {
            var ordno = $.trim($("#orderNo").val()); 
            var status = $.trim($("#ddlStatus").val());
            var starttime = $.trim($("#startTime").val());
            var endtime = $.trim($("#endTime").val());
            var str = "?ordno=" + ordno + "&starttime=" + starttime + "&endtime=" + endtime;
            if (status !="-1") {
                str = "?ordno=" + ordno + "&starttime=" + starttime + "&endtime=" + endtime+ "&status=" + status;
            }
            window.location.href = str;
        }
    </script>
</head>
<body>
<form id="form1" runat=server>
<TW:Header ID="Header1" runat="server" />
<div class="content">
    <div class="container">
        <TW:UserHeader ID="UserHeader1" runat="server" />
        <div class="user-content clearfix">
            <TW:UserLeft ID="UserLeft1" runat="server" MenuId=3 SelLi=1 />

            
            <div class="user-right pull-left">
                
                <div class="order-list clearfix">
                    <div class="cons-wrap clearfix">
                        <div class="cons-item">
                            <label class="cons-label">订单编号：</label>
                            <input class="input-text" type="text" name="orderNo" id="orderNo" value="<%=ordno %>"/>
                        </div>
                        <div class="cons-item">
                            <label class="cons-label">交易状态：</label>
                            <asp:DropDownList ID="ddlStatus" runat="server" CssClass="like-select">
                                <asp:ListItem Selected="True" Value="-1">请选择状态</asp:ListItem>
                                <asp:ListItem Value="0">未支付</asp:ListItem>
                                <asp:ListItem Value="1">订单关闭</asp:ListItem>
                                <asp:ListItem Value="2">已支付</asp:ListItem>
                                <asp:ListItem Value="3">已发货</asp:ListItem>
                                <asp:ListItem Value="4">交易完成</asp:ListItem>
                                <asp:ListItem Value="5">已退货</asp:ListItem>
                            </asp:DropDownList>
                        </div>
                    </div>
                    <div class="cons-wrap clearfix">
                        <div class="cons-item">
                            <label class="cons-label">创建时间：</label>
                            <input name="startTime" type="text" value="<%=starttime %>" class="input-text wid150 Wdate" onfocus="WdatePicker({readOnly:true,dateFmt:'yyyy-MM-dd HH:mm'})" id="startTime" />
                            -
                            <input name="endTime" type="text" value="<%=endtime %>" class="input-text wid150 Wdate" onfocus="WdatePicker({readOnly:true,dateFmt:'yyyy-MM-dd HH:mm'})" id="endTime" />
                        </div>
                        <div class="cons-item">
                            <button type="button" class="vice-btn" onclick="searchOrder();">搜 索</button>
                        </div>
                    </div>
                    <div class="order-table">
                        <div class="table-head clearfix">
                            <div class="check-label all-select">全选 <i class="icon icon-no-check-square"></i></div>
                            <div class="head-label">
                                <ul>
                                    <li class="pic">商品信息</li>
                                    <li class="price">单价（元）</li>
                                    <li class="num">数量</li>
                                    <li class="amount">实付款（元）</li>
                                    <li class="state">交易状态</li>
                                    <li class="opera">操作</li>
                                </ul>
                            </div>
                        </div>
                        <div id="orderList" class="list-content">
                            <asp:Repeater ID="Repeater1" runat="server" 
                                onitemcommand="Repeater1_ItemCommand" 
                                onitemdatabound="Repeater1_ItemDataBound">
                            <ItemTemplate>
                            <asp:HiddenField ID="hidItemId" Value='<%#Eval("OrderNumber") %>' runat="server" />
                            <div class="table-item clearfix">
                                <asp:CheckBox ID="chkBox" runat="server" CssClass="disnone" />
                                <div class="check-label simple-select"><i class="icon icon-no-check-square" value="10588" candel="false"></i></div>
                                <div class="item-label">
                                    <div class="item-head">
                                        订单编号：<%#Eval("OrderNumber")%>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                        创建时间：<%#Convert.ToDateTime(Eval("AddTime")).ToString("yyyy-MM-dd HH:mm:ssss")%></div>
                                    <ul>
                                        <li class="pic">
                                            <asp:Image ID="imgThumb" runat="server" />
                                            <a target="_blank" href="/goodsview.aspx?id=<%#Eval("GoodsId")%>"><%#Eval("GoodsTitle")%></a>
                                        </li>
                                        <li class="price">￥<%#Eval("Price")%></li>
                                        <li class="num"><%#Eval("Num")%></li>
                                        <li class="amount">￥<%#Convert.ToDecimal(Eval("Amount")) + Convert.ToDecimal(Eval("Fee"))%></li>
                                        <li class="state">
                                            <%#GetOrderStatus(Eval("Status"))%>
                                            <button class="vice-btn" type="button" onclick="window.open('orderview.aspx?ordno=<%#Eval("OrderNumber")%>')">订单详情</button>
                                        </li>
                                        <li class="opera">
                                            <asp:HyperLink ID="hltopay" runat="server" CssClass="vice-btn abtn" Target="_blank" Visible="False">去付款</asp:HyperLink>
                                            <a href="/goodsview.aspx?id=<%#Eval("GoodsId")%>" class="vice-btn abtn" target="_blank">再次购买</a>
                                            <asp:LinkButton ID="lbdel" CssClass="vice-btn abtn" runat="server" CommandName="del" OnClientClick="return confirm('确定删除?')" Visible="False">删除</asp:LinkButton>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                            
                            </ItemTemplate>
                            </asp:Repeater>
                        </div>

                        <div class="table-bottom clearfix">
                            <div class="check-label all-select">全选 <i class="icon icon-no-check-square"></i></div>
                            <div class="bottom-label">
                            <asp:Button ID="btnDelBatch" runat="server" CssClass="vice-btn padw1h6" Text="删除所选" 
                                    OnClientClick="return (CheckCollectLen()&&confirm('确定删除?'));" 
                                    onclick="btnDelBatch_Click" />
                            </div>
                        </div>
                        <div class="text-right" id="order-div">
                            <link rel="stylesheet" type="text/css" href="/images/page.css">
                            <%=pager %>
                        </div>
                    </div>
                </div>
                
            </div>
        </div>
    </div>
</div>
<TW:Footer ID="Footer1" runat="server" />
</form>
</body>
</html>