<!--{include file="<!--{$oetplpath}-->widget_header.tpl"}-->
<div class="oe_content_layout"> 
  <!--{include file="<!--{$oetplpath}-->widget_menu.tpl"}-->
  <div class="oe_cont_rt">
    <div class="oe_content_widget">
      <h3 class="oe_f_title"> <i></i>订单管理 <span>（管理购物订单）</span> </h3>
	  <form method="post" action="<!--{$oefile}-->&c=order" id="search_form">
	  <div class="oe_mer_search" style="line-height:35px;">
		订单状态：
		<select name="sorderstatus" id="sorderstatus">
		  <option value="0">=全部状态=</option>
		  <option value="1"<!--{if $sorderstatus == "1"}--> selected<!--{/if}-->>买家待付款</option>
		  <option value="2"<!--{if $sorderstatus == "2"}--> selected<!--{/if}-->>买已付款，卖家待发货</option>
		  <option value="3"<!--{if $sorderstatus == "3"}--> selected<!--{/if}-->>卖家已发货</option>
		  <option value="10"<!--{if $sorderstatus == "10"}--> selected<!--{/if}-->>交易完成</option>
		  <option value="-1"<!--{if $sorderstatus == "-1"}--> selected<!--{/if}-->>订单已取消</option>
		</select>
		&nbsp;&nbsp;
	    订单编号：
		<input type="text" name="sordersn" id="sordersn"  class="input-150" value="<!--{$sordersn}-->" />
		&nbsp;&nbsp;
		买家昵称：
		<input type="text" name="susername" id="susername"  class="input-150" value="<!--{$susername}-->" />
		&nbsp;&nbsp;
		<br />
		创单时间：
		<input type="text" name="sdate" id="sdate" readonly="only" value="<!--{$sdate}-->" style="width:120px" />
		<script type="text/javascript">
		$(function(){
		  laydate({
			  elem: "#sdate",
			  format: "YYYY-MM-DD",
			  istime: true,
			  choose: function(datas){}
		  });
		});
		</script> 
		到
		<input type="text" name="edate" id="edate" readonly="only" value="<!--{$edate}-->" style="width:120px" />
		<script type="text/javascript">
		$(function(){
		  laydate({
			  elem: "#edate",
			  format: "YYYY-MM-DD",
			  istime: true,
			  choose: function(datas){}
		  });
		});
		</script> 
		<span class="_search_btn" id="btn_ser">搜索</span>
	  </div>
	  <script type="text/javascript">
	  $(function(){
		$("#btn_ser").bind("click", function(){
			$("#search_form").submit();
		});
	  });
	  </script>
	  </form>

      <div class="oe_tab_list">
        <ul>
          <li<!--{if $sorderstatus == "0"}--> class="current"<!--{/if}-->><a href="<!--{$oefile}-->&c=<!--{$c}-->&<!--{$urlitem}-->">所有订单</a>
          </li>
          <li<!--{if $sorderstatus == "1"}--> class="current"<!--{/if}-->><a href="<!--{$oefile}-->&c=<!--{$c}-->&sorderstatus=1&<!--{$urlitem}-->">待付款</a>
          </li>
          <li<!--{if $sorderstatus == "2"}--> class="current"<!--{/if}-->><a href="<!--{$oefile}-->&c=<!--{$c}-->&sorderstatus=2&<!--{$urlitem}-->">待发货</a>
          </li>
          <li<!--{if $sorderstatus == "3"}--> class="current"<!--{/if}-->><a href="<!--{$oefile}-->&c=<!--{$c}-->&sorderstatus=3&<!--{$urlitem}-->">已发货</a>
          </li>
          <li<!--{if $sorderstatus == "10"}--> class="current"<!--{/if}-->><a href="<!--{$oefile}-->&c=<!--{$c}-->&sorderstatus=10&<!--{$urlitem}-->">已完成</a>
          </li>
          <li<!--{if $sorderstatus == "-1"}--> class="current"<!--{/if}-->><a href="<!--{$oefile}-->&c=<!--{$c}-->&sorderstatus=-1&<!--{$urlitem}-->">已取消</a>
          </li>
        </ul>
      </div>
      <div class="oe_order_listtitle">
	    <span class="s_1">商品</span>
		<span class="s_2">单价(元)</span>
		<span class="s_3">数量</span>
		<span class="s_4">售后</span>
		<span class="s_5">订单金额(元)</span>
		<span class="s_5">交易状态</span>
		<span class="s_7">操作</span>
	  </div>

      <!--{if empty($orderlist) }-->
      <div class="oe_order_tips">没有找到符合条件的信息</div>
      <!--{else}--> 
      <!--{foreach $orderlist as $volist}-->
      <div class="order_table">
        <table border="0" cellspacing="0" cellpadding="0" class="<!--{if $volist.orderstatus != '10' && $volist.shipstatus != '3' && $volist.orderstatus != '-1'}-->current<!--{/if}-->">
          <tr>
            <td colspan="4" class="oe_order_navtitle">
			  <h3>
			    <span class="order_num">
				  <b><!--{$volist.addtime|date_format:'Y-m-d'}--></b>
				  订单号： <!--{$volist.ordersn}--> 
				</span>
				<span class="order_shopname">
				  买家昵称：<!--{$volist.username}-->
				</span>

				<!--{if $volist.orderstatus == "2" && $volist.shipstatus == "1"}-->
				<span class="order_time">
				  发货倒计时：
				  <i id="ship_countdown_<!--{$volist.orderid}-->"></i>
				  <script type="text/javascript">
				  $(function(){
					countDownTime("<!--{$volist.endshiptime}-->", "ship_countdown_<!--{$volist.orderid}-->");
				  });
				  </script>
				  <!--{if $volist.delayships < intval($config.order_seller_delayships)}-->
				  <i>&nbsp;&nbsp;&nbsp;<a href="javascript:;" f='oneconfirm' data-url="<!--{$oefile}-->&c=<!--{$c}-->&a=delay&id=<!--{$volist.orderid}-->&<!--{$comeurl}-->" data-text="确定要延时发货时间吗？">延迟发货时间</a></i>
				  <!--{/if}-->
				</span>
				<!--{/if}-->

				<!--{if $volist.orderstatus == "-1"}-->
				<span class="oeder_delete" title="删除订单" f='oneconfirm' data-url="<!--{$oefile}-->&c=<!--{$c}-->&a=delete&id=<!--{$volist.orderid}-->&<!--{$comeurl}-->" data-text="确定要删除该订单吗？"></span>
				<!--{/if}-->
			  </h3>
			</td>
          </tr>
          <tr>
            <td valign="top" class="td1">
			  <!--{foreach $volist.goodslist as $val}-->
              <dl class="order_product">
                <dt><img src="<!--{$val.thumbimg}-->" /></dt>
                <dd class="oe_dd1">
                  <h4><a href="<!--{$urlpath}-->index.php?c=goods&a=detail&id=<!--{$val.goodsid}-->" target="_blank"><!--{$val.goodsname}-->(<!--{$val.goodsattr}-->)</a></h4>
                </dd>
                <dd class="oe_dd2"><s>¥<!--{$val.marketprice}--></s> ¥<!--{$val.price}--></dd>
                <dd class="oe_dd3"><!--{$val.nums}--></dd>
                <dd class="oe_dd4"></dd>
              </dl>
              <!--{/foreach}-->
			</td>
            <td valign="top" class="td5"><b>¥<!--{$volist.amount}--></b><span> (含运费：¥<!--{$volist.shipfee}-->)</span></td>
            <td valign="top" class="td6">
			  <!--{if $volist.orderstatus == '-1'}-->
			  <span>订单已取消</span>
			  <!--{elseif $volist.orderstatus == '1'}-->
			  <span>买家待付款</span>
			  <!--{elseif $volist.orderstatus == '2'}-->
			    <!--{if $volist.shipstatus == '1'}-->
				<span>已付款，待发货</span>
				<!--{elseif $volist.shipstatus == '2'}-->
				<span>已发货，待收货</span>
				<!--{elseif $volist.shipstatus == '3'}-->
				<span>买家已收货</span>
				<!--{/if}-->
			  <!--{elseif $volist.orderstatus == '3'}-->
			  <!--{elseif $volist.orderstatus == '10'}-->
			  <span>交易完成</span>
			  <!--{/if}-->
			  <!--{if $volist.orderstatus != '-1'}-->
              <span><a href="<!--{$oefile}-->&c=<!--{$c}-->&a=orderinfo&id=<!--{$volist.orderid}-->&<!--{$comeurl}-->">订单详情</a></span>
			  <!--{/if}-->
			</td>
            <td valign="top" class="td7">
			  
			  <!--{if $volist.orderstatus == "1"}-->
			  等待买家付款<br />
			  <span class="oe_buy" f='oneconfirm' data-url="<!--{$oefile}-->&c=<!--{$c}-->&a=cancel&id=<!--{$volist.orderid}-->&<!--{$comeurl}-->" data-text="确定要取消该订单吗？一旦取消不可恢复！">取消订单</span>
			  <!--{elseif $volist.orderstatus == "2"}-->
				<!--{if $volist.shipstatus == "1"}-->
				买家已付款，待发货<br />
				<span class="oe_buy" style="background:blue;" f="but_ship_pop" data-id="<!--{$volist.orderid}-->">立即发货</span>
				<span class="oe_buy" f='oneconfirm' data-url="<!--{$oefile}-->&c=<!--{$c}-->&a=cancel&id=<!--{$volist.orderid}-->&<!--{$comeurl}-->" data-text="确定要取消该订单吗？一旦取消不可恢复！">取消订单</span>
				<!--{elseif $volist.shipstatus == "2"}-->
				已发货，等待买家收货
				<!--{elseif $volist.shipstatus == "3"}-->
				买家已收货
				<!--{/if}-->
			  <!--{elseif $volist.orderstatus == "10"}-->
			  <font color="green">交易完成</font>
			  <!--{elseif $volist.orderstatus == "-1"}-->
			  <font color="red">订单已取消</font>
			  <!--{/if}-->
			</td>
          </tr>
        </table>
      </div>
      <!--{/foreach}--> 
      <!--{/if}-->
      
      <div class="oe_page_layout"> 
        <!--{$showpage}--> 
      </div>
    </div>
    <!--//oe_content_widget End--> 
  </div>
  <div class="clear"></div>
  <!--//oe_cont_rt Enc--> 
</div>
<script type="text/javascript">
$(function(){
	//弹窗发货
	$("[f='but_ship_pop']").click(function(){
		$width = 500;
		$height = 450;
		$_id = $(this).attr("data-id");
		$url = "<!--{$oefile}-->&c=<!--{$c}-->&a=ordership&id="+$_id;
		oePopDialog("var_pop_ship", "订单发货", $url, "ajax", $width, $height);
	});
});
</script> 
<!--{include file="<!--{$oetplpath}-->widget_footer.tpl"}-->
</body>
</html>