get_one.html 7.1 KB
<!DOCTYPE html>
<html lang="en">

<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport"/>
    <meta http-equiv="X-UA-Compatible" content="ie=edge"/>
    <title>学考无忧</title>
    <link rel="stylesheet" href="__TMPL__/public/assets/css/reset.css"/>
    <link rel="stylesheet" href="__TMPL__/public/assets/css/base.css"/>
    <style>
        .pay_banner {
            width: 100%;
            height: 1.3rem;
            background-size: cover;
            background-image: url("__TMPL__/public/assets/images/54.png");
        }

        .order_address {
            padding: 0.28rem 0 0.42rem;
            box-sizing: border-box;
            background-repeat: no-repeat;
            background-image: url("__TMPL__/public/assets/images/32.png");
            background-position: bottom;
            background-size: 100% 0.06rem;
        }
    </style>
</head>

<body>
<div class="Dpayment">
    <!-- 顶部 -->
    <div class="order_top">
        <a href="javascript:history.back();">
            <img src="__TMPL__/public/assets/images/left.png" alt=""/>
        </a>
        <p>我的订单</p>
    </div>
    <!-- 顶部banner -->
    <div class="pay_banner">
        <div class="pay_bannerLeft">
            <div class="pay_bannerImg">
                    <img src="__TMPL__/public/assets/images/53.png" alt=""/>
            </div>
            <p>
                <if condition="$data.state eq 4">
                    待付款
                    <elseif condition="$data.state eq 2"/>
                    待发货
                    <elseif condition="$data.state eq 5"/>
                    已发货
                    <elseif condition="$data.state eq 3"/>
                    已完成
                </if>
            </p>
        </div>
        <if condition="$data.state eq 4">
            <div class="pay_bannerRight">
                <p class="timespan"></p>
                <p>订单自动关闭</p>
            </div>
        </if>

    </div>
    <!-- 地址  -->
    <div class="order_address">
        <!-- 有地址 -->
        <a href="">
            <div class="order_addressYes">
                <div class="or_addressYesImg1">
                    <img src="__TMPL__/public/assets/images/38.png" alt=""/>
                </div>
                <div class="or_addressYesTxt1">
                    <div class="or_addressYesTxt2">
                        <div class="or_addressName">{$data.address.name}</div>
                        <p class="or_addressPhone">{$data.phone}</p>
                    </div>
                    <p class="or_address_detailed">
                        {$data.address.region}{$data.address.detailed}
                    </p>
                </div>
                <div class="or_addressYesImg2">
                    <img src="__TMPL__/public/assets/images/29.png" alt=""/>
                </div>
            </div>
        </a>
    </div>
    <!-- 订单信息 -->
    <div class="order_news">
        <h1 class="order_newsTit">订单信息</h1>
        <ul class="order_newsUl">
            <foreach name="$data.indent_goods" item="i_g">
                <li>
                    <div class="order_newsImg">
                        <img src="{:cmf_get_image_url($i_g['thumbnail'])}" alt=""/>
                    </div>
                    <div class="order_newsCon">
                        <div class="order_newsTxt1 txt-cut">
                            {$i_g.book_name}
                        </div>
                        <div class="order_newsTxt2">×<span>{$i_g.number}</span></div>
                        <div class="order_newsTxt3">
                            <p class="de_topTxt1_1"><span>{$i_g.price}</span></p>
                            <p class="de_topTxt1_2"><span>{$i_g.pricing}</span></p>
                        </div>
                    </div>
                </li>
                <php>$sum[] = $i_g['price']*$i_g['number'];</php>
            </foreach>
        </ul>
    </div>
    <!-- 支付方式/配送方式 -->
    <div class="order_Etc">
        <div class="order_Etc1 ypayTxt">
            <p>订单编号:</p>
            <p>{$data.order_number}</p>
        </div>
        <div class="order_Etc1 ypayTxt">
            <p>下单时间:</p>
            <p>{:date('Y-m-d H:i:s',$data.create_time)}</p>
        </div>
        <div class="order_Etc1 ypayTxt">
            <p>配送方式:</p>
            <if condition="$data.is_courier eq 1">
                <p>统一配送</p>
                <elseif condition="$data.is_courier eq 2"/>
                <p>快递({$data.money-array_sum($sum)}元)</p>
            </if>
        </div>
    </div>
    <!-- 实付金额: -->
    <div class="ypay_price">
        <p class="ypay_price1">实付金额:</p>
        <p class="de_topTxt1_1"><span>{$data.money}</span></p>
    </div>
    <!-- 底部 -->

    <div class="pay_bottom">
        <div class="pay_bottom2">
            <if condition="$data.state eq 5">
                <a href="{:url('logistics/index',array('indent_id'=>$data['id']))}">
                    <div class="pay_bottom2_1">物流信息</div>
                </a>
                <elseif condition="$data.state eq 5 || $data.state eq 3 || $data.state eq 2"/>
                <div class="pay_bottom2_2">售后咨询</div>
                <elseif condition="$data.state eq 4"/>
                <div class="myorder_bottom2_1 cancel_order" data-id="{$data.id}">取消订单</div>
                <a href="{:url('portal/pay/index',array('id'=>$data['id']))}">
                    <div class="myorder_bottom2_2">去支付</div>
                </a>
            </if>
        </div>
    </div>
</div>
<script src="__TMPL__/public/assets/js/base.js"></script>
<script src="__TMPL__/public/assets/js/jquery.js"></script>
</body>
<script>
    $(function () {
        $('.cancel_order').click(function () {
            var indent_id = $(this).attr('data-id');
            $.ajax({
                url: "{:url('portal/order/cancel_order')}",
                type: "POST",
                data: {'id': indent_id},
                success: function (data) {
                    if(data.code==1){
                        alert('取消成功!')
                        window.location.href = "{:url('portal/order/get_all')}";
                    }else{
                        alert('出错啦,请稍后再试!')
                    }
                },
                error: function (data) {
                    alert('与服务器断开连接');
                }
            })
        })
    })

</script>
<script>
    var starttime = new Date("2019/6/9");
    setInterval(function() {
        var nowtime = new Date();
        var time = nowtime - starttime;
        var hour = parseInt(time / 1000 / 60 / 60 % 24);
        var minute = parseInt(time / 1000 / 60 % 60);
        var seconds = parseInt(time / 1000 % 60);
        $('.timespan').html(hour + "时" + minute + "分" + seconds + "秒后");
        console.log(hour);
        console.log(minute);
        console.log(seconds)
    }, 1000);
</script>
</html>