<!--{assign var="menu_id" value="cp"}-->
<!--{include file="<!--{$oetplpath}-->block_header.tpl"}-->
<script src="<!--{$wapskin}-->js/order.js"></script>
<style type="text/css">
  body{background:#f7f7f7;}
</style>
<div class="oe_ntop"> <i class="iconfont" onclick="goBack();">&#xe616;</i>
  <p>我的订单</p>
</div>
<div class="oe_orderlist">
  <div class="oe_ordertitle">
    <ul>
      <li<!--{if $sflag == '0'}--> class="current"<!--{/if}--> f="but_loadfirst_data" data-url="<!--{$oefile}-->&c=<!--{$c}-->&a=list&datatype=json&sflag=0" data-box="json_data"><span>全部</span></li>
      <li<!--{if $sflag == '1'}--> class="current"<!--{/if}--> f="but_loadfirst_data" data-url="<!--{$oefile}-->&c=<!--{$c}-->&a=list&datatype=json&sflag=1" data-box="json_data"><span>待付款</span></li>
      <li<!--{if $sflag == '2'}--> class="current"<!--{/if}--> f="but_loadfirst_data" data-url="<!--{$oefile}-->&c=<!--{$c}-->&a=list&datatype=json&sflag=2" data-box="json_data"><span>待发货</span></li>
      <li<!--{if $sflag == '3'}--> class="current"<!--{/if}--> f="but_loadfirst_data" data-url="<!--{$oefile}-->&c=<!--{$c}-->&a=list&datatype=json&sflag=3" data-box="json_data"><span>待收货</span></li>
      <li<!--{if $sflag == '10'}--> class="current"<!--{/if}--> f="but_loadfirst_data" data-url="<!--{$oefile}-->&c=<!--{$c}-->&a=list&datatype=json&sflag=10" data-box="json_data"><span>完成</span></li>
    </ul>
    <div class="clear"></div>
  </div>
  <script style="text/javascript">
  $(function(){
	$("[f='but_loadfirst_data']").bind("click", function(){
		$(".oe_ordertitle ul li").removeClass("current");
		$(this).addClass("current");
		$("#page").val("2");
		$_url = $(this).attr("data-url");
		$_box = $(this).attr("data-box");
		$("#reqs_url").val($_url);
	});
  });
  </script>


  <div>
    <div class="oe_orderlistcn" id="json_data"> 
      <!--{if empty($order)}-->
      <h6>没有找到符合条件的信息</h6>
      <!--{else}--> 
      <!--{foreach $order as $volist}-->
      <dl id="order_<!--{$volist.orderid}-->">
        <dt onclick="goUrl('<!--{$oefile}-->&c=<!--{$c}-->&a=detail&id=<!--{$volist.orderid}-->')">
          <label>
		    <i class="iconfont">&#xe60e;</i> <!--{$volist.shopname}--> <i class="iconfont jian">&#xe615;</i>
		  </label>
          <span>
			  <!--{if $volist.orderstatus == '-1'}--> 
              订单已取消
              <!--{elseif $volist.orderstatus == '1'}--> 
              待付款 
              <!--{elseif $volist.orderstatus == '2'}--> 
              <!--{if $volist.shipstatus == '1'}--> 
              已付款，待发货
              <!--{elseif $volist.shipstatus == '2'}--> 
              已发货，待收货
              <!--{elseif $volist.shipstatus == '3'}--> 
              已确认收货
              <!--{/if}--> 
              <!--{elseif $volist.orderstatus == '3'}--> 
              <!--{elseif $volist.orderstatus == '10'}--> 
              交易完成 
              <!--{/if}--> 
		  </span>
		</dt>

        <dd onclick="goUrl('<!--{$oefile}-->&c=<!--{$c}-->&a=detail&id=<!--{$volist.orderid}-->')">
          <ul>
            <!--{foreach $volist.goodslist as $val}-->
            <li>
			  <img src="<!--{$val.thumbimg}-->" />
              <div class="title">
                <h3><!--{$val.goodsname}--></h3>
                <p class="p_1"><!--{$val.goodsattr}--></p>
              </div>
              <div class="price"><b>¥<!--{doubleval($val.price)}--></b> <p><s>¥<!--{doubleval($val.marketprice)}--></s></p></div>
              <div class="num"><span>X</span> <!--{$val.nums}--></div>
            </li>
            <!--{/foreach}-->
          </ul>
          <div class="total"> 合计：<span>¥<!--{$volist.amount}--></span>(含运费：¥<!--{$volist.shipfee}-->) </div>
        </dd>

        <dd>
          <div class="button">
		    <!--{if $volist.orderstatus == "1"}-->
			<span class="span_1" f="confirm_cancel_order" data-id="<!--{$volist.orderid}-->">取消订单</span>
			<span class="span_2" f="but_payonline" data-id="<!--{$volist.orderid}-->">在线支付</span>
			<!--{elseif $volist.orderstatus == "2"}--> 
				<!--{if $volist.shipstatus=='1'}--> 
				    <!--{if $volist.endshiptime < $time}--> 
					<span class="span_1" f="confirm_cancel_order" data-id="<!--{$volist.orderid}-->">取消订单</span>
				    <!--{/if}-->
				<!--{elseif $volist.shipstatus=='2'}-->
					<span class="span_2" f="confirm_receive_order" data-id="<!--{$volist.orderid}-->">确认收货</span>
				<!--{/if}-->
			<!--{/if}-->

		  </div>
        </dd>

      </dl>
      <!--{/foreach}--> 
      <!--{/if}--> 
    </div>
  </div>

</div>


<input type="hidden" name="page" id="page" value="2" />
<input type="hidden" name="reqs_url" id="reqs_url" value="<!--{$oefile}-->&c=<!--{$c}-->&a=list&datatype=json" />
<!--{if $pagecount > 1}-->
<div class="oe_page" id="more_btn">点击加载下一页</div>
<!--{/if}-->


<input type="hidden" name="orderid" id="orderid" value="" />
<div id="varpop_shade" class="varpop-shade"></div>
<div class="confirm-layout" id="receive_box" style="display:none;">
  <h2>确定收货吗？</h2>
  <p>确定要收货吗？一旦确定不可以恢复</p>
  <div class="confirm-list">
    <div class="confirm-l" f="close_var" data-id="receive_box">取消</div>
	<div class="confirm-r" f="but_receive_order">确定</div>
	<div class="clear"></div>
  </div>
</div>

<div class="confirm-layout" id="cancel_box" style="display:none;">
  <h2>确定取消订单吗？</h2>
  <p>确定要取消该订单吗吗？<br />一旦取消不可以恢复</p>
  <div class="confirm-list">
    <div class="confirm-l" f="close_var" data-id="cancel_box">取消</div>
	<div class="confirm-r" f="but_cancel_order">确定</div>
	<div class="clear"></div>
  </div>
</div>



<script type="text/javascript">
$(function(){

	//加载下一页
	$("#more_btn").click(function(){
		$("#more_btn").html("加载中...");
		$page = $("#page").val();
		$url = $("#reqs_url").val();
		if ($url.length > 0) {
			$.ajax({
				type: "GET",
				url: $url,
				cache: false,
				data: {page:$page, r:get_rndnum(8)},
				dataType: "json",
				success: function($data) {
					$json = eval($data);
					$response = $json.response;
					$nextpage = $json.nextpage;
					$result = $json.result;
					$("#page").val($nextpage);
					if ($response == 1) {
						if ($nextpage > 0) {
							$("#more_btn").show();
						}
						else {
							$("#more_btn").hide();
						}
						//加入数据
						$("#json_data").append($result);
						$("#more_btn").html("点击加载下一页");
					}
				},
				error: function() {}
			});
		}
	});
});
</script>
</body>
</html>