deal.html 7.7 KB
<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <include file="public@head_common"/>
    <link rel="stylesheet" type="text/css" href="__TMPL__/public/mobile/css/weui.css" />
    <link rel="stylesheet" type="text/css" href="__TMPL__/public/mobile/css/myweui.css" />
    <link rel="stylesheet" type="text/css" href="__TMPL__/public/mobile/css/augly.css" />
    <link rel="stylesheet" type="text/css" href="__TMPL__/public/mobile/css/write/deal_list.css" />
    <title>已提交订单</title>
    <style type="text/css">

    </style>
</head>

<body>
<div class="header">
    <div class="return">
        <span class="back_href">
            <i class="iconfont icon-jiantou-copy"></i>返回
        </span>
    </div>
    已提交订单
</div>
<div class="test_num"></div>
<div class="header_place"></div>

<div class="tab_tit">
    <p class="tab_item write_order">填写电子订单</p>
    <p class="tab_item active">查看已提交订单</p>
</div>

<div class="choose_time">
    <i class="iconfont icon-rili"></i>选择提交时间
</div>

<div class="deal_list">
    <volist name="orderList" id="vo">
        <div class="list_style" data-href="{:url('detail',['id'=>$sort_id,'order_id'=>$vo['id']])}">
            <div class="style_one">
                <p class="style_text">
                    订单类型:<span class="font_weight">{$vo.sort_name}</span>
                </p>
                <eq name="vo.status" value="0">
                    <p class="order_state">未支付</p>
                </eq>
                <eq name="vo.status" value="1">
                    <p class="no_pay">已支付</p>
                </eq>
            </div>
            <p class="order_num">订单编号:{$vo.order_sn}</p>
            <p class="order_data" id="change_time">提交时间:{:date('Y-m-d',$vo['create_time'])}</p>
            <p class="order_data">订单确认码:{$vo.number}</p>
            <p class="order_data">联系电话:{$vo.mobile}</p>

            <eq name="vo.status" value="0">
                <div class="change_btn" data-href="{:url('edit',['id'=>$sort_id,'order_id'=>$vo['id']])}">修改</div>
            </eq>
        </div>
    </volist>
</div>

<!--<div class="list_style">-->
    <!--<div class="style_one">-->
        <!--<p class="style_text">-->
            <!--订单类型:<span class="font_weight">新规</span>-->
        <!--</p>-->
        <!--<p class="no_pay">未支付</p>-->
    <!--</div>-->
    <!--<p class="order_num">订单编号:1822 3766 4456 8888</p>-->
    <!--<p class="order_data">提交时间:2018-04-10</p>-->
<!--</div>-->

<div class="bottom_icon">
    <img src="__TMPL__/public/mobile/images/biglogo@2x.png" class="bottom_img" />
    <p class="bottom_text">{$site_info.site_name}</p>
</div>
<script src="__TMPL__/public/mobile/js/jquery-2.1.0.js" type="text/javascript" charset="utf-8"></script>
<script src="__TMPL__/public/mobile/js/weui.js" type="text/javascript" charset="utf-8"></script>
<script src="__TMPL__/public/mobile/js/myweui.js" type="text/javascript" charset="utf-8"></script>
<script src="__TMPL__/public/mobile/js/swiper-4.3.5.min.js" type="text/javascript" charset="utf-8"></script>
<script src="__TMPL__/public/mobile/js/common.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
    $('.choose_time').click(function(){
        weui.datePicker({
            start: 2000,
            end: 2030,
            defaultValue: [2015, 6, 9],
            onChange: function(result) {
                console.log(result);
            },
            onConfirm: function(result) {
                var birthday = result[0].label + result[1].label + result[2].label;
                $('.choose_time').html(`<i class="iconfont icon-rili"></i>${birthday}`);
                var date = result[0].value + '-' + result[1].value + '-' + result[2].value;
                var data = {
                    date: date,
                    sort_id: "{$sort_id}"
                };
                list(data);
            },
            id: 'datePicker'
        });
    });
    $('body').on('click','.weui-picker__action',function() {
        if($(this).data('action') == 'cancel') {
            $('.choose_time').html(`<i class="iconfont icon-rili"></i>选择提交时间`);
            list({
                date: '',
                sort_id: "{$sort_id}"
            });
        }
    });
    $('.deal_list').on('click','.change_btn',function(event){
        event.stopPropagation();
        location.href = $(this).data('href');
    });
    $('.deal_list').on('click','.list_style',function(){
        event.stopPropagation();
        location.href = $(this).data('href');
    });
    $('.tab_tit').on('click','.write_order',function(){
        location.href = "{$orderUrl}";
    });
    // ajax数据渲染
    function list(data) {
        $.ajax({
            url: "{:url('choosetime_detail')}",
            type: "POST",
            data: data,
            dataType: "JSON",
            success: function (res) {
                console.log(res);
                if (res.code == 1) {
                    if(res.data.length == 0) {
                        $('.deal_list').html('');
                    } else {
                        html = '';
                        $(res.data).each(function(index,element){
                            var status = `<p class="order_state">未支付</p>`;
                            var change = `<div class="change_btn" data-href="${element.edit_url}">修改</div>`;
                            if(element.status == 1) {
                                status = `<p class="no_pay">已支付</p>`;
                                change = '';
                            }
                            html += `<div class="list_style" data-href="${element.detail_url}">
                                                <div class="style_one">
                                                    <p class="style_text">
                                                        订单类型:<span class="font_weight">${element.sort_name}</span>
                                                    </p>
                                                    ${status}
                                                </div>
                                                <p class="order_num">订单编号:${element.order_sn}</p>
                                                <p class="order_data" id="change_time">提交时间:${element.create_time}</p>
                                                <p class="order_data">订单确认码:${element.number}</p>
                                                <p class="order_data">联系电话:${element.mobile}</p>
                                                ${change}
                                            </div>`;
                        });
                        $('.deal_list').html(html);
                    }
                } else {
                    _error(res.msg);
                }
            },
            error: function(XHR,errorMsg,errorType) {
                _error(errorMsg);
            },
            complete: function(XHR,TS) {

            }
        });
    }
    // 弹窗提示
    var popup_switch = true;
    function _error(test) {
        if(popup_switch) {
            popup_switch = false;
            $('.test_num').html(test);
            $('.test_num').removeClass('Augly-fadeout');
            $('.test_num').addClass('Augly-fadein');
            $('.test_num').show();
            setTimeout(function() {
                $('.test_num').removeClass('Augly-fadein');
                $('.test_num').addClass('Augly-fadeout');
                popup_switch = true
            }, 1500)
        } else {
            popup_switch = true
        }
    }
</script>
</body>

</html>