<!--{include file="<!--{$mpath}-->block_header.tpl"}-->
<!--loading页开始-->
<div class="loading">
    <div class="loader">
        <div class="loader-inner pacman">
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
        </div>
    </div>
</div>
<!--loading页结束-->
<body>
<header class="mui-bar mui-bar-nav report-header box-s" id="header">
    <a href="index.php?c=user"><i class="iconfont icon-fanhui fl"></i></a>
    <p>全部订单</p>
</header>
<div id="main" class="mui-clearfix">
    <div class="order-top clearfloat">
        <ul>
            <li class="clearfloat <!--{if <!--{$status}-->==''}-->cur<!--{/if}-->"><a href="index.php?c=user&a=order_list">全部</a></li>
            <li class="clearfloat <!--{if <!--{$status}-->=='1'}-->cur<!--{/if}-->"><a href="index.php?c=user&a=order_list&status=1">待付款</a></li>
            <li class="clearfloat <!--{if <!--{$status}-->=='2'}-->cur<!--{/if}-->"><a href="index.php?c=user&a=order_list&status=2">待发货</a></li>
            <li class="clearfloat <!--{if <!--{$status}-->=='3'}-->cur<!--{/if}-->"><a href="index.php?c=user&a=order_list&status=3">待收货</a></li>
            <li class="clearfloat <!--{if <!--{$status}-->=='4'}-->cur<!--{/if}-->"><a href="index.php?c=user&a=order_list&status=4">已完成</a></li>
           <!-- <li class="clearfloat"><a href="index.php?c=user&a=order_list">待评价</a></li>-->
        </ul>
    </div>
    <!--{if empty($list)}-->
    <div class="order-list clearfloat">
        <p class="ordernum box-s">
            暂无订单

        </p>



    </div>
    <!--{else}-->
    <!--{foreach $list as $volist}-->
    <div class="order-list clearfloat">
        <p class="ordernum box-s">
            订单号&nbsp; &nbsp; <!--{$volist.ordernum}-->
            <span style="float: right;"><!--{$volist.status}--></span>
        </p>
        <!--{foreach $volist.goodslist as $v}-->
            <div class="list clearfloat fl box-s">
                <!--{if <!--{$volist.is_integral}-->=='1'}-->
                <a href="index.php?c=integral&a=detail&id=<!--{$v.goodsid}-->">
                <!--{else}-->
                <a href="index.php?c=product&a=detail&id=<!--{$v.goodsid}-->">
                <!--{/if}-->

                    <div class="tu fl clearfloat">
                        <img src="<!--{$v.goodsimg}-->"/>
                    </div>
                    <div class="middle clearfloat fl">
                        <p class="tit"><!--{$v.goodsname}--></p>
                        <p class="fu-tit">

                        </p>
                        <p class="price clearfloat">
                            <span class="xprice fl"><!--{$v.goodsprice}--></span>
                            <span class="shu">×<!--{$v.goodsnum}--></span>
                        </p>
                    </div>
                </a>
            </div>
        <!--{/foreach}-->
        <a href="javascript:void(0)" class="gopay-btn1">
            共<!--{$volist.num}-->商品共计<!--{$volist.orderprice}--> <!--{if <!--{$volist.is_integral}-->=='1'}-->
           积分
                <!--{else}-->
                元
                    <!--{/if}-->
        </a>
        <!--{if <!--{$volist.status}-->=='待付款'}-->
        <a href="javascript:void(0);" class="gopay-btn fr pay" ordernum="<!--{$volist.ordernum}-->" price="<!--{$volist.orderprice}-->">
            立即支付
        </a>
        <!--{/if}-->
        <!--{if <!--{$volist.status}-->=='待收货'}-->
        <a href="javascript:void(0);" class="gopay-btn fr confirm" ordernum="<!--{$volist.ordernum}-->" price="<!--{$volist.orderprice}-->">
            确认收货
        </a>
        <!--{/if}-->
    </div>
    <!--{/foreach}-->

    <!--{/if}-->


</div>
</body>

<script type="text/javascript" src="<!--{$mpath}-->js/jquery-1.8.3.min.js" ></script>
<script src="<!--{$mpath}-->layer_mobile/layer.js"></script>
<script src="<!--{$mpath}-->js/fastclick.js"></script>
<script src="<!--{$mpath}-->js/mui.min.js"></script>
<script type="text/javascript" src="<!--{$mpath}-->js/hmt.js" ></script>
<script type="text/javascript">
    $('.pay').click(function(e){
        var url='/source/plugin/alipay/alipayapi.php';
        var order_number=$(this).attr('ordernum');
        var order_name='商城订单';
        var oeder_price=$(this).attr('price');
        // alert(oeder_price);
        var parames = new Array();
        parames.push({ name: "WIDout_trade_no", value: order_number});
        parames.push({ name: "WIDsubject", value: order_name});
        parames.push({ name: "WIDtotal_fee", value: oeder_price});
        parames.push({ name: "WIDbody", value: order_name});
        Post(url, parames);
        return false;
    });

    $('.confirm').click(function(e){
        var order_number=$(this).attr('ordernum');
        layer.open({
            content: '是否确认收到物品？'
            ,btn: ['确定', '取消']
            ,yes: function(index){
                $.post("<!--{$urlpath}-->index.php?c=user&a=confirm", {
                    order_number:order_number,
                }, function (data) {
                    if (data.response == '1') {
                        layer.open({
                            content: data.result
                            ,skin: 'msg'
                            ,time: 2 //2秒后自动关闭
                        });
                        setTimeout( function(){
                            location.reload();
                            layer.close(index);
                        }, 1 * 1000 );//延迟5000毫米
                    } else {
                        layer.open({
                            content: data.result
                            ,skin: 'msg'
                            ,time: 2 //2秒后自动关闭
                        });
                    }
                }, "json");

            }
        });
    });
    /*
 *功能： 模拟form表单的提交
 *参数： URL 跳转地址 PARAMTERS 参数
 */
    function Post(url, parames) {
        //创建form表单
        var temp_form = document.createElement("form");
        temp_form.action = url;
        //如需打开新窗口，form的target属性要设置为'_blank'
        temp_form.target = "_blank";
        temp_form.method = "post";
        temp_form.style.display = "none";
        //添加参数
        for (var item in parames) {
            var opt = document.createElement("input");
            opt.name = parames[item].name;
            opt.value = parames[item].value;
            temp_form.appendChild(opt);
        }
        document.body.appendChild(temp_form);

        //提交数据
        temp_form.submit();
    }


</script>
</html>
