<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <meta charset="UTF-8">
    <meta property="qc:admins" content="301275672376035363757" />
    <meta property="wb:webmaster" content="b1c2224d37e609de" />
    <title>
        <!--{$page_title}-->-<!--{$config.sitename}-->-
        <!--{$copyright_header}-->
    </title>
    <meta name="description" content="<!--{$page_description}-->">
    <meta name="keywords" content="<!--{$page_keyword}-->">
    <meta name="viewport" content="width=1226">
    <meta property="qc:admins" content="065116425576035363757" />
    <link rel="shortcut icon" href="" type="image/x-icon">
    <link rel="stylesheet" href="<!--{$skinpath}-->assets/css/base.min.css">
    <link href="<!--{$skinpath}-->assets/css/global.css" rel="stylesheet" type="text/css"  />
    <script src="<!--{$skinpath}-->assets/js/jquery-1.8.2.min.js"></script>
    <script src="<!--{$skinpath}-->assets/js/zzsc.js"></script>

    <link rel="stylesheet" type="text/css" href="<!--{$skinpath}-->assets/css/goods-detail.min.css" />
    <link rel="stylesheet" type="text/css" href="<!--{$skinpath}-->assets/jqZoom/css/jqzoom.css" />
    <script type="text/javascript" src="<!--{$skinpath}-->assets/jqZoom/js/jqzoom.pack.1.0.1.js"></script>

    <link rel="stylesheet" type="text/css" href="<!--{$skinpath}-->assets/css/cart.css">
    <script type="text/javascript" src="<!--{$skinpath}-->assets/js/layer.js"></script>
    <script type="text/javascript" src="<!--{$skinpath}-->assets/js/layui.js"></script>

    <script type="text/javascript" src="<!--{$skinpath}-->assets/js/bootstrap.min.js"></script>

</head>
<style>
    .xm-pagenavi {
        height: 30px;
        padding: 15px 0;
        text-align: center;
    }

</style>
<body>
<div class="site-topbar">
    <div class="container">
        <div class="topbar-nav">
            <a href="index.php" >首页</a><span class="sep">|</span>
        </div>
        <div class="topbar-cart" id="J_miniCartTrigger">
            <a class="cart-mini" id="J_miniCartBtn" href="./index.php?c=user&a=shopping">
                <i class="iconfont"></i>去购物车
            </a>
        </div>
        <div class="topbar-info" id="J_userInfo">
            <!--{if !empty($check)}-->

            <a class="link" href="./index.php?c=user">个人中心</a><a class="link userid" >欢迎<!--{$username}--></a>&nbsp;<span class="sep">|</span><a class="link" href="javascript:;" id="userexit" >退出</a>

            <!--{else}-->

            <a class="link" href="./index.php?c=user&a=login">登录</a><span class="sep">|</span><a class="link" href="./index.php?c=user&a=register" >注册</a>

            <!--{/if}-->


        </div>
    </div>
</div>

<div class="site-header">
    <div class="container">
        <div class="header-logo">
            <a class="logo" id="logo" href="./index.php" title="" style="width:231px;height:61px;">
                <img src="<!--{$config.logo}-->" alt="">
            </a>
        </div>
        <div class="header-nav">
            <ul class="nav-list J_navMainList clearfix" style="width: 880px">
                <li id="J_navCategory" class="nav-category">
                    <a class="link-category" href="" style="visibility: hidden;"><span class="text">全部商品分类</span></a>
                    <div class="site-category">
                        <script type="text/javascript">
                            $(function() {
                                $('#J_categoryList>.category-item').hover(function() {
                                    $(this).addClass('category-item-active').siblings().removeClass('category-item-active');
                                }, function() {
                                    $(this).removeClass('category-item-active');
                                });
                            })
                        </script>
                        <ul id="J_categoryList" class="site-category-list clearfix">
                            <!--{assign var='productcategory' value=vo_category("type={treecat} rootid={119}")}-->
                            <!--{foreach $productcategory as $key => $value}-->
                            <li class="category-item ">
                                <a class="title" href="<!--{$value.url}-->">
                                    <!--{$value.catname}--><i class="iconfont"></i></a>
                                <div class="children clearfix children-col-3">
                                    <ul class="children-list children-list-col children-list-col-1">
                                        <!--{foreach  $value.childcatgory as $k => $v}-->
                                        <!--{if $k<=5}-->
                                        <li class="star-goods">
                                            <a class="link" href="<!--{$v.url}-->">
                                                <span class="text"><!--{$v.catname|mb_substr:0:8:'utf8'}--></span>
                                            </a>
                                            <a class="btn btn-line-primary btn-small btn-buy" href="<!--{$v.url}-->">选购</a>
                                        </li>
                                        <!--{/if}-->
                                        <!--{/foreach}-->
                                    </ul>
                                    <ul class="children-list children-list-col children-list-col-2">
                                        <!--{foreach  $value.childcatgory as $k => $v}-->
                                        <!--{if $k<=11&&$k>=6}-->
                                        <li class="star-goods">
                                            <a class="link" href="<!--{$v.url}-->">
                                                <span class="text"><!--{$v.catname|mb_substr:0:8:'utf8'}--></span>
                                            </a>
                                            <a class="btn btn-line-primary btn-small btn-buy" href="<!--{$v.url}-->">选购</a>
                                        </li>
                                        <!--{/if}-->
                                        <!--{/foreach}-->
                                    </ul>
                                    <ul class="children-list children-list-col children-list-col-3">
                                        <!--{foreach  $value.childcatgory as $k => $v}-->
                                        <!--{if $k<=17&&$k>=13}-->
                                        <li class="star-goods">
                                            <a class="link" href="<!--{$v.url}-->">
                                                <span class="text"><!--{$v.catname|mb_substr:0:8:'utf8'}--></span>
                                            </a>
                                            <a class="btn btn-line-primary btn-small btn-buy" href="<!--{$v.url}-->">选购</a>
                                        </li>
                                        <!--{/if}-->
                                        <!--{/foreach}-->
                                    </ul>
                                </div>
                            </li>

                            <!--{/foreach}-->
                        </ul>
                    </div>
                </li>
                <!--{assign var='mymenu' value=vo_category("type={sedmenu}")}-->
                <!--{foreach $mymenu as $v}-->
                <li class="nav-item">
                    <a class="link" href="<!--{$v.url}-->"><span class="text"><!--{$v.catname}--></span><span class="arrow"></span></a>
                </li>
                <!--{/foreach}-->
            </ul>
        </div>
        <div class="header-search">
            <form id="J_searchForm" class="search-form clearfix" action="index.php?c=search" method="get">
                <input type="hidden" name="c" id="searchtype" value="search">
                <label for="search" class="hide">站内搜索</label>
                <input class="search-text" type="search" id="search" name="content" autocomplete="off" placeholder="搜索产品">
                <input type="submit" class="search-btn iconfont" value="">
                <div class="search-hot-words">
                    <a href=""></a>
                    <a href=""></a>
                </div>
                <div id="J_keywordList" class="keyword-list hide">
                    <ul class="result-list"></ul>
                </div>
            </form>
        </div>
    </div>

</div>
<!-------------------------------------- 头部结束 -------------------------------------->
<link rel="stylesheet" href="<!--{$skinpath}-->assets/css/main.css">
<!-------------------------------------- 主体开始 -------------------------------------->

<link rel="stylesheet" href="<!--{$skinpath}-->assets/css/layer.css">

<div class="page-main user-main">
    <div class="container">
        <!--{if !empty($check)}-->
        <div class="row">
            <div class="span4">
                <div class="uc-box uc-sub-box">
                    <div class="uc-nav-box">
                        <div class="box-hd">
                            <h3 class="title">个人中心</h3>
                        </div>
                        <div class="box-bd">
                            <ul class="uc-nav-list J_navList">
                                <li><a class="J_noRandom" href="index.php?c=user">我的个人中心</a></li>
                                <li><a class="J_noRandom" href="./index.php?c=user&a=user_info">个人信息</a></li>
                                <li><a class="J_noRandom" href="./index.php?c=user&a=profit">我的收益</a></li>
                                <li><a class="J_noRandom" href="index.php?c=user&a=share">我的推广</a></li>
                                <li><a class="J_noRandom" href="./index.php?c=user&a=user_address">收货地址</a></li>
                                <li><a class="J_noRandom" href="./index.php?c=user&a=user_edit">修改密码</a></li>
                            </ul>
                        </div>
                    </div>
                    <div class="uc-nav-box">
                        <div class="box-hd">
                            <h3 class="title">订单中心</h3>
                        </div>
                        <div class="box-bd">
                            <ul class="uc-nav-list J_navList">

                                <li  class="active"><a class="J_noRandom" href="./index.php?c=user&a=order_list">我的订单</a></li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
            <div class="span16">
                <div class="uc-box uc-main-box">
                    <div class="uc-content-box order-list-box">
                        <div class="box-hd">
                            <h1 class="title">我的订单</h1>
                            <div class="more clearfix">
                                <ul class="filter-list J_orderType">
                                    <li <!--{if <!--{$status}-->==''}-->class="first active"<!--{/if}--> ><a href="index.php?c=user&a=order_list" data-type="0" data-stat-id="80be41c93ffc8141" onclick="_msq.push(['trackEvent', '5cc76a9bce8347f4-80be41c93ffc8141', '//static.mi.com/order/#type=0', 'pcpid', '']);">全部有效订单</a></li>
                                    <li <!--{if <!--{$status}-->=='1'}-->class="active"<!--{/if}-->><a id="J_unpaidTab" href="index.php?c=user&a=order_list&status=1">待支付</a></li>
                                    <li <!--{if <!--{$status}-->=='3'}-->class="active"<!--{/if}-->><a id="J_sendTab" href="index.php?c=user&a=order_list&status=3" >待收货</a></li>
                                </ul>
                            </div>
                        </div>
                        <input type="hidden" id="yueprice" value="<!--{$mbrdata.balance}-->"/>
                        <div class="box-bd">
                            <div id="J_orderList">
                                <!--{if empty($list)}-->
                                <p class="empty">当前没有交易订单。</p>
                                <!--{else}-->
                                <!--{foreach $list as $volist}-->
                                <ul class="order-list">
                                    <li class="uc-order-item uc-order-item-pay">
                                        <div class="order-detail">
                                            <div class="order-summary">
                                                <div class="order-status"> <!--{$volist.status}-->
                                                </div>
                                            </div>
                                            <table class="order-detail-table">
                                                <thead>
                                                <tr>
                                                    <th class="col-main">
                                                        <p class="caption-info"><!--{$volist.time|date_format:"%Y-%m-%d %H:%M:%S"}--><span class="sep">|</span><!--{$volist.linkman}--><span class="sep">|</span>订单号： <a href="#"><!--{$volist.ordernum}-->
                                                    </th>
                                                    <th class="col-sub">
                                                        <!--{if <!--{$volist.is_integral}-->=='1'}-->
                                                        <p class="caption-price">花费积分：<span class="num"><!--{$volist.orderprice}--></span></p>
                                                            <!--{else}-->
                                                            <p class="caption-price">应付金额：<span class="num"><!--{$volist.orderprice}--></span>元</p>
                                                                <!--{/if}-->

                                                    </th>
                                                </tr>
                                                </thead>
                                                <tbody>
                                                <tr>
                                                    <td class="order-items">
                                                        <ul class="goods-list">
                                                            <!--{foreach $volist.goodslist as $v}-->
                                                            <li>
                                                                <div class="figure figure-thumb">
                                                                    <a href="#" target="_blank">
                                                                        <img src="<!--{$v.goodsimg}-->" width="80" height="80" alt="<!--{$v.goodsname}-->">
                                                                    </a>
                                                                </div>
                                                                <p class="name">
                                                                    <a target="_blank" href="#"><!--{$v.goodsname}-->
                                                                    </a>
                                                                </p>
                                                                <p class="price">  <!--{$v.goodsprice}-->  <!--{if <!--{$volist.is_integral}-->=='1'}-->
积分                                                                <!--{else}-->
元                                                                <!--{/if}-->  × <!--{$v.goodsnum}-->  </p>
                                                            </li>
                                                            <!--{/foreach}-->
                                                        </ul>

                                                    </td>

                                                    <td class="order-actions">
                                                        <!--{if <!--{$volist.status}-->=='待付款'}-->
                                                        <div  style="margin-right: 53%; margin-top: 5%;">
                                                            <select id="select<!--{$volist.id}-->">
                                                                <option value="zhifubao">支付宝支付</option>
                                                                <option value="yue">余额支付</option>
                                                            </select>
                                                        </div>

                                                        <div  style="margin-top: -10%;">
                                                        <a class="btn btn-small btn-primary pay" href="javascript:void(0);" id="<!--{$volist.id}-->" ordernum="<!--{$volist.ordernum}-->" price="<!--{$volist.orderprice}-->">立即支付</a>

                                                        <!--{/if}-->
                                                        <a class="btn btn-small btn-line-gray" href="index.php?c=user&a=order_detail&order_number=<!--{$volist.ordernum}-->">订单详情</a>
                                                        </div>
                                                    </td>
                                                </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                    </li>
                                </ul>
                                <!--{/foreach}-->
                                <!--{/if}-->
                            </div>
                            <div id="J_orderListPages">
                                <div class="xm-pagenavi">
                                    <!--{$showpage}-->
                                   </div>

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--{else}-->
        <a class="btn btn-primary" href="./index.php?c=user&a=login">去登录</a>
        <!--{/if}-->
    </div>
</div>


<script>
    layui.use('upload', function(){
        var $ = layui.jquery,
            upload = layui.upload;


        $('.pay').click(function(e){
            var id=$(this).attr('id');
            var xuan = $('#select'+id).val();
            var zhifubao =$('#zhifubao').hasClass('shopcar-checkd');
            var yue =$('#yue').hasClass('shopcar-checkd');
            var url='/source/plugin/alipay/alipayapi.php';
            var order_number=$(this).attr('ordernum');
            var order_name='商城订单';
            $.post("<!--{$urlpath}-->index.php?c=user&a=order_detail", {
                    order_number:order_number,type:1
             }, function (data) {
                    if (data.response == '1') {
                       var oeder_price=data.data.orderprice;                      
                        var type=0;
                        if(xuan=='zhifubao'){
                            // 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;
                        }
                        if(xuan=='yue'){
                            type=2;
                            var balance = $('#yueprice').val();
                            //  alert(oeder_price)
                            if(eval(balance)<eval(oeder_price)){
                                alert('余额不足');
                                return  false;
                            }
                            $.post("<!--{$urlpath}-->index.php?c=product&a=yue_pay", {
                                order_number:order_number,oeder_price:oeder_price
                            }, function (data) {
                                if (data.response == '1') {
                                // layer.open({
                                    //    content: data.result
                                    //   ,skin: 'msg'
                                    // ,time: 10 //2秒后自动关闭
                                // });
                                    alert(data.result);
                                    setTimeout( function(){
                                        //return false;
                                    // window.location.href = 'index.php?c=user&a=order_pay_wan&order_number'+order_number;
                                        window.location.href = 'index.php?c=user&a=order_list';
                                    }, 1 * 1000 );//延迟5000毫米
                                } else {
                                    layer.open({
                                        content: data.result
                                        ,skin: 'msg'
                                        ,time: 2 //2秒后自动关闭
                                    });
                                }
                            }, "json");
                        }
                        if(type==0){
                            alert('请选择支付方式');
                            return  false;
                        }

                    } else {
                        layer.open({
                            content: data.result
                            ,skin: 'msg'
                            ,time: 2 //2秒后自动关闭
                        });
                    }
            }, "json");

        });
        /*
     *功能： 模拟form表单的提交
     *参数： URL 跳转地址 PARAMTERS 参数
     */
        function Post(URL, PARAMTERS) {
            //创建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 PARAMTERS) {
                var opt = document.createElement("input");
                opt.name = PARAMTERS[item].name;
                opt.value = PARAMTERS[item].value;
                temp_form.appendChild(opt);
            }
            document.body.appendChild(temp_form);
            //提交数据
            temp_form.submit();
        }

        // 查看订单详情
        $("[name=userordxq]").bind("click",function () {

        })


    });
</script>

<!-------------------------------------- 主体结束 -------------------------------------->
<!-------------------------------------- 尾部开始 -------------------------------------->

<!--{include file="<!--{$tplpath}-->botton.tpl"}-->
<!-------------------------------------- 尾部结束 -------------------------------------->

