<!--
Name:用户中心-订单详情
Page:P_UserOrderDetails
-->
<div id="orderstate">
    <div class="mt">
        <div class="left">
            <strong><span class="ftx14"><%=Shop.Bussiness.Order.OrderStatus(order, CurrentLanguage.Code) %></span></strong>
        </div>
        <div class="right">
            <div class="toolbar">
                <%if(Shop.Bussiness.Order.CancelOrder(order)){ %><a href="<%=URL("P_UserOrderCancel",order.id) %>" class="btn btn-11"><s></s>{tag:取消}</a><%} %>
                <%if(order.OnlinePay_id>0 && order.IsPaid!=1 && order.IsInvalid==0){ %><a href="javascript:void(0)" onclick="window.open('<%=URL("P_Pay",order.id)%>');" class="btn btn-7"><s></s>{tag:立即付款}</a><%} %>
            </div>
        </div>
    </div>
    <%if(order.IsCompleted==0){ %>
        <div class="mm">
    <%}else{ %>
        <div class="mc">
    <%} %>
    <%foreach (DB.LebiShop.Lebi_Comment m in comments){%>
    <div>
        <span style="color: #dddddd"><%=FormatTime(m.Time_Add) %></span> <%=m.User_UserName%><%=m.Admin_UserName%>：<%=m.Content%>
    </div>
    <%} %>
    </div>
    <%if(order.IsCompleted==0){ %>
    <div class="mc">
        <input type="text" id="comment" style="width:90%" class="input" />
        <a href="javascript:void(0)" onclick="submitcomment(<%=order.id %>);" class="btn btn-11"><s></s>{tag:留言}</a>
    </div>
    <%} %>
</div>
<%foreach (DB.LebiShop.Lebi_Transport_Order t in transport_orders){%>
<%if (t != null){ %>
<div id="ordertrack" class="clearfix">
    <div class="mt"><strong>{tag:订单追踪}</strong></div>
    <div class="mc tabcon">
        <table width="100%" cellspacing="0" cellpadding="0">
            <tbody id="tbody_track">
                <tr>
                    <th style="text-align: left; height: 30px;">
                        <%=t.Transport_Name %> {tag:运单号}：<%=t.Code %> {tag:状态}：<%=TypeName(t.Type_id_TransportOrderStatus) %>
                        <%if(t.Type_id_TransportOrderStatus!=223 && t.Type_id_TransportOrderStatus!=224){ %>
                        <a href="javascript:void(0)" onclick="Received(<%=order.id%>,<%=t.id %>);" class="btn btn-11"><s></s>{tag:确认收货}</a>
                        <%} %>
                    </th>
                </tr>
                <%
                    Shop.Model.KuaiDi100 log = Shop.Bussiness.EX_Area.GetKuaiDi100(t);
                    if (log.message == "ok")
                    {
                        foreach (Shop.Model.KuaiDi100.KuaiDi100data d in log.data)
                        { %>
                <tr>
                    <td><%=d.context%> <em><%=d.time%></em></td>
                </tr>
                <%}
                    }
                    else
                    { %>
                    <tr>
                    <td style="text-align:center">
                    <%if(t.HtmlLog.IndexOf("http://")==0){ %>
                    <iframe name="kuaidi100" src="<%=t.HtmlLog %>" width="300" height="200" marginwidth="0" marginheight="0" frameborder="0"></iframe>
                    <%} %>
                    </td></tr>
                    <%} %>
            </tbody>
        </table>
    </div>
</div>
<%} %>
<%} %>
<div id="orderinfo" class="clearfix">
    <div class="mt"><strong>{tag:订单信息}</strong></div>
    <div class="mc">
        <dl class="fore clearfix">
            <dd>
                <ul>
                    <li>{tag:订购时间}：<%=FormatTime(order.Time_Add) %></li>
                </ul>
            </dd>
        </dl>
        <dl>
            <dt>{tag:收货人信息}</dt>
            <dd>
                <ul>
                    <li>{tag:收货人}：<%=order.T_Name %></li>
                    <li>{tag:地址}：<%=Shop.Bussiness.EX_Area.GetAreaName(order.T_Area_id)%> <%=order.T_Address %></li>
                    <li>{tag:固定电话}：<%=order.T_Phone %></li>
                    <li>{tag:手机号码}：<%=order.T_MobilePhone %></li>
                    <li>{tag:电子邮件}：<%=order.T_Email %></li>
                </ul>
            </dd>
        </dl>
        <dl>
            <dt>{tag:支付及配送方式}</dt>
            <dd>
                <ul>
                    <li>{tag:支付方式}：
                    <%if (order.OnlinePay_id > 0){%>
                        <%=Lang(order.OnlinePay)%>
                    <%}else{%>
                        <%=Lang(order.Pay) %>
                    <%}%></li>
                    <%if (order.OnlinePay_id == 0){%>
                    <li class="tips"><%=Lang(pay.Description)%></li>
                    <%}%>
                    <li>{tag:配送方式}：<%=order.Transport_Name %></li>
                </ul>
            </dd>
        </dl>
        <%if (SYS.BillFlag == "1"){ %>
        <dl>
            <dt>{tag:发票信息}</dt>
            <dd>
                <ul>
                    <li>{tag:发票类型}：<%=Lang(order.BillType_Name) %></li>
                    <%foreach (DB.LebiShop.Lebi_Bill b in bills){%>
                    <%if(b.Type_id_BillType==151){ %>
                    <li>{tag:发票内容}：<%=b.Content%></li>
                    <li>{tag:发票抬头}：<%=b.Title%></li>
                    <%}else{ %>
                    <li>{tag:单位名称}：<%=b.Company_Name%></li>
                    <li>{tag:纳税人识别号}：<%=b.Company_Code%></li>
                    <li>{tag:注册地址}：<%=b.Company_Address%></li>
                    <li>{tag:注册电话}：<%=b.Company_Phone%></li>
                    <li>{tag:开户银行}：<%=b.Company_Bank%></li>
                    <li>{tag:银行帐户}：<%=b.Company_Bank_User%></li>
                    <%} %>
                    <%} %>
                </ul>
            </dd>
        </dl>
       <%} %>
        <dl>
            <dt>{tag:订单清单}</dt>
            <dd class="p-list">
                <table width="100%" cellspacing="0" cellpadding="0">
                    <tbody>
                        <%foreach (DB.LebiShop.Lebi_Order_Product o_p in order_products){%>
                        <tr>
                            <td style="width:50px" valign="top" rowspan="2"><a href="<%=URL("P_Product",o_p.Product_id) %>"><img src="<%=Image(o_p.ImageOriginal,50,50) %>" style="width:50px;height:50px;" /></a></td>
                            <td style="text-align:left" valign="top">
                            <%if(o_p.Type_id_OrderProductType==252){Response.Write("["+Tag("赠品")+"]");} %><a href="<%=URL("P_Product",o_p.Product_id) %>"><%=Lang(o_p.Product_Name) %></a><br />
                            <%if (o_p.ProPerty134!=""){ %><%=o_p.ProPerty134%><%} %>
                            <%=Shop.Bussiness.EX_Product.ProPertyNameStr(Shop.Bussiness.EX_Product.GetProduct(o_p.Product_id), CurrentLanguage.Code)%></td>
                            <td style="width:60px" valign="top">
                            <%
                                if(o_p.Type_id_OrderProductType==255)
                                    Response.Write(Tag("积分")+":"+o_p.Point_Buy_one);
                                else if(o_p.Type_id_OrderProductType==252)
                                    Response.Write(FormatMoney(0));
                                else
                                    Response.Write(FormatMoney(o_p.Price));
                            %>
                            </td>
                        </tr>
                        <tr>
                            <td style="text-align:left">×<%=o_p.Count%> <%if ((order.IsShipped == 1||order.IsShipped_All == 1) && o_p.Count_Shipped<o_p.Count){ %><em>({tag:发货数量}：<%=o_p.Count_Shipped%>)</em><%} %></td>
                            <td>
                                <%if(order.IsReceived==1 && SYS.IsClosetuihuo=="0"){ %>
                                <a href="<%=URL("P_UserReturnApply",o_p.Order_id)%>">{tag:退货}</a><br />
                                <%} %>
                                <a href="javascript:void(0);" onclick="AddOftenBuy(<%=o_p.Product_id %>,<%=o_p.Count %>,'<%=o_p.ProPerty134 %>')">{tag:常购清单}</a>
                            </td>
                        </tr>
                        <%} %>
                    </tbody>
                </table>
            </dd>
        </dl>
    </div>
    <div class="total">
        <ul>
            <li><strong>{tag:商品总额}：</strong><%=FormatMoney(order.Money_Product) %></li>
            <%if(order.Money_Transport!=0){ %><li><strong>+ {tag:运费}：</strong><%=FormatMoney(order.Money_Transport) %></li><%} %>
            <%if(order.Money_Bill>0){ %><li><strong>+ {tag:发票税金}：</strong><%=FormatMoney(order.Money_Bill) %></li><%} %>
            <%if(order.Money_Tax>0){ %><li><strong>+ {tag:税金}：</strong><%=FormatMoney(order.Money_Tax) %></li><%} %>
            <%if(order.Money_Property>0){ %><li><strong>+ {tag:其它费用}：</strong><%=FormatMoney(order.Money_Property) %></li><%} %>
            <%if(order.Money_UseCard311>0 || order.Money_UseCard312>0){ %>
                <li><strong>- {tag:卡券支付}：</strong><%=FormatMoney(order.Money_UseCard312+order.Money_UseCard311) %></li>
            <%} %>
            <%if(order.Money_Cut>0){ %><li><strong>- {tag:优惠}：</strong><%=FormatMoney(order.Money_Cut) %></li><%} %>
            <%if (order.Money_UserCut > 0){ %><li><strong>- {tag:使用余额}：</strong><%=FormatMoney(order.Money_UserCut)%></li><%} %>
        </ul>
        <span class="clear"></span>
        <div class="extra">
            {tag:应付金额}：<span class="red"><b><%=FormatMoney(order.Money_Pay)%></b></span></div>
    </div>
</div>
<script type="text/javascript">
    function Received(id,tid) {
        if (!confirm("{tag:请确认操作？}"))
            return false;
        var url = path+"/ajax/ajax_order.aspx?__Action=Received&id=" + id+"&tid="+tid;
        RequestAjax(url, "", function () { MsgBox(1, "{tag:操作成功}", "?") });
    }
    function submitcomment(order_id) {
        var comment = $("#comment").val();
        if (comment == "") {
            MsgBox(2, "{tag:请填写留言内容}", "");
            return false;
        }
        var postData = { "comment": comment, "order_id": order_id };
        var url = path+"/ajax/ajax_order.aspx?__Action=OrderComment_Edit";
        RequestAjax(url, postData, function () { MsgBox(1, "{tag:操作成功}", "?") });
    }
</script>