<!--{include file="<!--{$oetplpath}-->widget_header.tpl"}-->
<div class="oemarry_main"> 
  <!--{include file="<!--{$oetplpath}-->widget_menu.tpl"}-->
  <div class="oem_uright">
    <div class="oem_uright_topmenu"> 当前位置：<a href="<!--{$oefile}-->">会员中心</a> &gt;&gt; 订单管理 </div>
    <div class="oe_widget_center">
      <h3 class="oe_order_title"> <span <!--{if $sorderstatus == "0"}--> class="current"<!--{/if}-->><a href="<!--{$oefile}-->&c=<!--{$c}-->&<!--{$urlitem}-->&sorderstatus=0">所有订单<em>(<!--{$alls}-->)</em></a> <i></i></span> <span<!--{if $sorderstatus == "1"}--> class="current"<!--{/if}-->><a href="<!--{$oefile}-->&c=<!--{$c}-->&<!--{$urlitem}-->&sorderstatus=1">待付款<em>(<!--{$payment}-->)</em></a><i></i></span> <span<!--{if $sorderstatus == "2"}--> class="current"<!--{/if}-->><a href="<!--{$oefile}-->&c=<!--{$c}-->&<!--{$urlitem}-->&sorderstatus=2">待发货<em>(<!--{$shipped}-->)</em></a><i></i></span> <span<!--{if $sorderstatus == "3"}--> class="current"<!--{/if}-->><a href="<!--{$oefile}-->&c=<!--{$c}-->&<!--{$urlitem}-->&sorderstatus=3">待收货<em>(<!--{$receipt}-->)</em></a><i></i></span> <span<!--{if $sorderstatus == "10"}--> class="current"<!--{/if}-->><a href="<!--{$oefile}-->&c=<!--{$c}-->&<!--{$urlitem}-->&sorderstatus=10">已完成<em>(<!--{$complete}-->)</em></a> </span> </h3>
      <div class="oe_order_search">
        <form method="post" action="<!--{$oefile}-->&c=order" name="myform" id="myform">
          <div class="oe_order_searchcn">
            <dl class="select">
              <dt>订单类型：</dt>
              <dd> <span>
                <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>
                </span> </dd>
            </dl>
            <dl class="inputtext">
              <dt>订单编号：</dt>
              <dd>
                <input type="text" name="sordersn" id="sordersn" value="<!--{$sordersn}-->" />
              </dd>
            </dl>
            <dl class="tow">
              <dt>下单时间：</dt>
              <dd>
                <input type="text" name="sdate" id="sdate" readonly="only" value="<!--{$sdate}-->" />
                <script>
                  $(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}-->" />
                <script>
                  $(function(){
                    laydate({
                      elem: '#edate',
                      format: 'YYYY-MM-DD',
                      istime: true,
                      choose: function(datas){}
                    });
                  });
                </script> 
              </dd>
            </dl>
            <dl class="inputtext">
              <dt>店铺名：</dt>
              <dd>
                <input type="text" name="sshopname" id="sshopname" value="<!--{$sshopname}-->" />
              </dd>
            </dl>
            <div class="clear"></div>
            <div class="oe_search_orderbutton"> <span onclick="$('#myform').submit();">搜索订单</span> </div>
          </div>
        </form>
      </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="firsttable <!--{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"> <a href="<!--{$urlpath}-->index.php?c=shop&a=detail&id=<!--{$volist.shopid}-->"> <!--{$volist.shopname}--> </a></span> 
                <!--{if $volist.orderstatus == "1"}--> 
                <!--{assign var="pay_end_time" value=($volist.addtime+(intval($config.order_buyer_pay)*24*60*60))}--> 
                <span class="order_time"> 付款倒计时： <i id="pay_countdown_<!--{$volist.orderid}-->"></i>
                <script type="text/javascript">
                $(function(){
                countDownTime("<!--{$pay_end_time}-->", "pay_countdown_<!--{$volist.orderid}-->");
                });
                </script> 
                </span> 
                <!--{/if}--> 
                
                <!--{if $volist.orderstatus == "2" && $volist.shipstatus == "2"}--> 
                <!--{assign var="confirm_receive_time" value=($volist.shiptime+(intval($config.order_buyer_confirm_receive)*24*60*60))}--> 
                <span class="order_time"> 确认收货倒计时： <i id="confirm_countdown_<!--{$volist.orderid}-->"></i> 
                <script type="text/javascript">
                $(function(){
                countDownTime("<!--{$confirm_receive_time}-->", "confirm_countdown_<!--{$volist.orderid}-->");
                });
                </script> 
                </span> 
                <!--{/if}--> 
                
                <!--{if $volist.orderstatus == '-1' || $volist.orderstatus == '10'}--> 
                <span class="oeder_delete" f='onedel' data-url="<!--{$oefile}-->&c=<!--{$c}-->&a=delete&id=<!--{$volist.orderid}-->&<!--{$comeurl}-->" title="删除订单"></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}-->"><!--{$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>
              </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=order&a=orderinfo&id=<!--{$volist.orderid}-->">订单详情</a></span> 
              <!--{/if}--></td>
            <td valign="top" class="td7"><!--{if $volist.orderstatus == "1"}--> 
              <span class="oe_buy" style="background:green;margin-bottom:2px;"> <a style="color: #fff;" href="<!--{$oefile}-->&c=<!--{$c}-->&a=pay&id=<!--{$volist.orderid}-->&<!--{$comeurl}-->">在线支付</a> </span> 
              <span class="oe_close" style="margin-bottom:2px;" f='oneconfirm' data-text="确定要取消订单吗？" data-url="<!--{$oefile}-->&c=<!--{$c}-->&a=cancel&id=<!--{$volist.orderid}-->&<!--{$comeurl}-->">取消订单</span>
              <!--{elseif $volist.orderstatus == "2"}--> 
              <!--{if $volist.shipstatus=='1'}--> 
              
              等待卖家发货 
              <!--{if $volist.endshiptime < $time}--> 
              <span class="oe_close" f='oneconfirm' data-text="确定要取消订单吗？订单金额退回您帐户。" data-url="<!--{$oefile}-->&c=<!--{$c}-->&a=cancel&id=<!--{$volist.orderid}-->&<!--{$comeurl}-->">取消订单</span> 
              <!--{/if}--> 
              
              <!--{elseif $volist.shipstatus=='2'}--> 
              <span class="oe_buy" style="background:blue;" f='oneconfirm' data-text="确定要收货吗？一旦操作不可恢复。" data-url="<!--{$oefile}-->&c=<!--{$c}-->&a=confirmreceipt&id=<!--{$volist.orderid}-->&<!--{$comeurl}-->">确认收货</span> 
              <!--{/if}--> 
              <!--{elseif $volist.orderstatus == "10"}--> 
              <font color="green">交易完成</font><br />
              
              <!--{if $volist.buycomment=='1' }--> 
              <a href="<!--{$oefile}-->&c=comment&a=reply&id=<!--{$volist.orderid}-->&<!--{$comeurl}-->">追加评价</a> 
              <!--{else}--> 
              <a href="<!--{$oefile}-->&c=comment&id=<!--{$volist.orderid}-->&<!--{$comeurl}-->">评价商品</a> 
              <!--{/if}--> 
              <!--{elseif $volist.orderstatus == "-1"}--> 
              <font color="red">订单已取消</font> 
              <!--{/if}--></td>
          </tr>
        </table>
      </div>
      <!--{/foreach}--> 
      <!--{/if}-->
      <div class="oe_page_layout"> 
        <!--{$showpage}--> 
      </div>
    </div>
    <!--//oe_widget_center End--> 
    
  </div>
  <!--//oem_uright End-->
  <div class="clear"></div>
</div>
<script type="text/javascript">
$(function(){
	setTimeout(function(){
		setOrderStatus();
	}, 5000);
});
//自动
function setOrderStatus() {
	$.ajax({
		type: "POST",
		url: _ROOT_PATH + "index.php?m=user",
		cache: false,
		data: {c:"order", a:"auto", r:get_rndnum(8)},
		dataType: "json",
		success: function($data) {
			$json = eval($data);
			$response = $json.response;
			$result = $json.result;
			if ($response == "1") {
				setTimeout(function(){
					setOrderStatus();
				}, 60000);
			}
			else {
			}
		},
		error: function() {
		}
	});
}
</script> 
<!--{include file="<!--{$oetplpath}-->widget_footer.tpl"}-->
</body></html>