e3f5518a3a2bded0837d99ccd1018843.php 17.0 KB
<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:43:"themes/simpleboot3/user/yuyue/my_yuyue.html";i:1534568986;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="yes" name="apple-touch-fullscreen">
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,maximum-scale=1, minimum-scale=1, user-scalable=no">
    <title>我的预约</title>
    <link rel="stylesheet" href="/static/css/common.css">
    <link rel="stylesheet" href="/static/css/style.css">
</head>
<body style="background-color: #f6f6f6">
<div class="box">
    <div class="yuyueTop">
        <div class="head_left">
            <img src="<?php echo $p_info['headimgurl']; ?>">
            <b class="uesr_name"><?php echo $p_info['user_nickname']; ?></b>
        </div>
        <div class="study_right">
            <b class="study_num"><?php echo $yyxs; ?></b>
            <i>已用学时</i>
        </div>
    </div>
    <div class="yuyueMenu">
        <ul>
            <li class="yuyue_cur">
                <b>全部</b>
            </li>
            <li><b>待学车</b></li>
            <li><b>待点评</b></li>
            <li><b>已点评</b></li>
        </ul>
    </div>
    <div class="yuyue_box">
        <!--全部-->
        <div class="yuyue-content">

            <?php if(empty($data) || (($data instanceof \think\Collection || $data instanceof \think\Paginator ) && $data->isEmpty())): ?>
                <div class="no_yuyue">
                    <img src="/static/image/no_yuyue.png">
                </div>
                <div class="btn_yuyue" onclick=location.href="<?php echo url('user/yuyue/index'); ?>">
                    <img src="/static/image/btn_yuyue.png">
                </div>
                <?php else: if(is_array($data) || $data instanceof \think\Collection || $data instanceof \think\Paginator): $i = 0; $__LIST__ = $data;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
                    <div class="yuyueList" >
                        <div class="yList_top">
                            <b><?php echo yuyue_status_name($vo['status']); ?></b>
                            <i><?php echo date_to_date($vo['yuyue_day']); ?></i>
                        </div>
                        <div class="yList_info">
                            <img src="<?php echo $vo['headimgurl']; ?>" class="yu_user_head"/>
                            <div class="yu_user_info">
                                <b class="user_name"><?php echo $vo['user_nickname']; ?></b>
                                <i class="user_fun"><?php echo $gname; ?></i>
                            </div>
                            <div class="yu_date">
                                <b class="yu_week"><?php echo $vo['yuyue_week']; ?></b>
                                <i class="yu_times"><?php echo $vo['yuyue_begin']; ?>:00 - <?php echo $vo['yuyue_end']; ?>:00</i>
                            </div>
                        </div>
                        <?php switch($vo['status']): case "0": ?>
                                <div class="yuyue_btn">
                                    <b class="click_yuyue" data-id="<?php echo $vo['id']; ?>">取消预约</b>
                                </div>
                            <?php break; case "1": ?>
                                <div class="yuyue_btn">
                                    <b class="click_yuyue" data-id="<?php echo $vo['id']; ?>">取消预约</b>
                                </div>
                            <?php break; case "2": ?>
                                <div class="yuyue_btn" onclick=location.href="<?php echo url('user/comment/index',array('id'=>$vo['teach_id'],'yuyue_id'=>$vo['id'])); ?>">
                                    <b class="click_yuyue">去评价</b>
                                </div>
                            <?php break; case "3": ?>
                                <div class="yuyue_btn" onclick=location.href="<?php echo url('user/comment/show_stu',array('yuyue_id'=>$vo['id'])); ?>">
                                    <b class="click_yuyue">查看评价</b>
                                </div>
                            <?php break; default: endswitch; ?>


                    </div>
                <?php endforeach; endif; else: echo "" ;endif; endif; ?>
        </div>
        <!--待学车-->
        <div class="yuyue-content hide">
            <?php if(empty($data) || (($data instanceof \think\Collection || $data instanceof \think\Paginator ) && $data->isEmpty())): ?>
                <div class="no_yuyue">
                    <img src="/static/image/no_yuyue.png">
                </div>
                <div class="btn_yuyue">
                    <img src="/static/image/btn_yuyue.png">
                </div>
                <?php else: if(is_array($dxdata) || $dxdata instanceof \think\Collection || $dxdata instanceof \think\Paginator): $i = 0; $__LIST__ = $dxdata;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
                    <div class="yuyueList">
                        <div class="yList_top">
                            <b><?php echo yuyue_status_name($vo['status']); ?></b>
                            <i><?php echo date("Y-m-d",$vo['create_time']); ?></i>
                        </div>
                        <div class="yList_info">
                            <img src="<?php echo $vo['headimgurl']; ?>" class="yu_user_head"/>
                            <div class="yu_user_info">
                                <b class="user_name"><?php echo $vo['user_nickname']; ?></b>
                                <i class="user_fun"><?php echo $gname; ?></i>
                            </div>
                            <div class="yu_date">
                                <b class="yu_week"><?php echo $vo['yuyue_week']; ?></b>
                                <i class="yu_times"><?php echo $vo['yuyue_begin']; ?>:00 - <?php echo $vo['yuyue_end']; ?>:00</i>
                            </div>
                        </div>
                        <div class="yuyue_btn">
                            <b class="click_yuyue">取消预约</b>
                        </div>
                    </div>
                <?php endforeach; endif; else: echo "" ;endif; endif; ?>
        </div>
        <!--待点评-->
        <div class="yuyue-content hide">
            <?php if(empty($data) || (($data instanceof \think\Collection || $data instanceof \think\Paginator ) && $data->isEmpty())): ?>
                <div class="no_yuyue">
                    <img src="/static/image/no_yuyue.png">
                </div>
                <div class="btn_yuyue">
                    <img src="/static/image/btn_yuyue.png">
                </div>
                <?php else: if(is_array($dpdata) || $dpdata instanceof \think\Collection || $dpdata instanceof \think\Paginator): $i = 0; $__LIST__ = $dpdata;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
                    <div class="yuyueList">
                        <div class="yList_top">
                            <b><?php echo yuyue_status_name($vo['status']); ?></b>
                            <i><?php echo date("Y-m-d",$vo['create_time']); ?></i>
                        </div>
                        <div class="yList_info">
                            <img src="<?php echo $vo['headimgurl']; ?>" class="yu_user_head"/>
                            <div class="yu_user_info">
                                <b class="user_name"><?php echo $vo['user_nickname']; ?></b>
                                <i class="user_fun"><?php echo $gname; ?></i>
                            </div>
                            <div class="yu_date">
                                <b class="yu_week"><?php echo $vo['yuyue_week']; ?></b>
                                <i class="yu_times"><?php echo $vo['yuyue_begin']; ?>:00 - <?php echo $vo['yuyue_end']; ?>:00</i>
                            </div>
                        </div>
                        <div class="yuyue_btn" onclick=location.href="<?php echo url('user/comment/index',array('id'=>$vo['teach_id'],'yuyue_id'=>$vo['id'])); ?>">
                            <b class="click_yuyue">去评价</b>
                        </div>
                    </div>
                <?php endforeach; endif; else: echo "" ;endif; endif; ?>
        </div>
        <!--已点评-->
        <div class="yuyue-content hide">
            <?php if(empty($data) || (($data instanceof \think\Collection || $data instanceof \think\Paginator ) && $data->isEmpty())): ?>
                <div class="no_yuyue">
                    <img src="/static/image/no_yuyue.png">
                </div>
                <div class="btn_yuyue">
                    <img src="/static/image/btn_yuyue.png">
                </div>
                <?php else: if(is_array($ypdata) || $ypdata instanceof \think\Collection || $ypdata instanceof \think\Paginator): $i = 0; $__LIST__ = $ypdata;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
                    <div class="yuyueList">
                        <div class="yList_top">
                            <b><?php echo yuyue_status_name($vo['status']); ?></b>
                            <i><?php echo date("Y-m-d",$vo['create_time']); ?></i>
                        </div>
                        <div class="yList_info">
                            <img src="<?php echo $vo['headimgurl']; ?>" class="yu_user_head"/>
                            <div class="yu_user_info">
                                <b class="user_name"><?php echo $vo['user_nickname']; ?></b>
                                <i class="user_fun"><?php echo $gname; ?></i>
                            </div>
                            <div class="yu_date">
                                <b class="yu_week"><?php echo $vo['yuyue_week']; ?></b>
                                <i class="yu_times"><?php echo $vo['yuyue_begin']; ?>:00 - <?php echo $vo['yuyue_end']; ?>:00</i>
                            </div>
                        </div>
                        <div class="yuyue_btn" onclick=location.href="<?php echo url('user/comment/show_stu',array('yuyue_id'=>$vo['id'])); ?>">
                            <b class="click_yuyue">查看评价</b>
                        </div>
                    </div>
                <?php endforeach; endif; else: echo "" ;endif; endif; ?>
        </div>
    </div>
</div>
<!--弹跳框-->
<div class="full_bg"></div>
<div class="yu_tan">
    <div class="yu_tan_box">
        <img src="/static/image/tan_car1.png" class="tan_car"/>
        <h1 class="tan_text">是否确认取消预约?</h1>
        <h2 class="btn_qr">确认</h2>
    </div>
    <div class="cancel"></div>
</div>
<!--ceshi-->
<input type="hidden" value="60" class="yu_time"/>
<script type="text/javascript" src="/static/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="/static/js/common.js"></script>
<script type="text/javascript" src="/static/js/study_car.js"></script>
<script>
    $(function(){
        $('.yList_top').each(function(){
           var colorHtml=$(this).children('b').html();
           if(colorHtml=="待学车"){
               $(this).children('b').css("color","#53a6fa");
           }
        });
        $('.click_yuyue').click(function(){
            var id=$(this).attr("data-id");
            var cancel_fa=$(this).parent().parent();
            var con_text=$(this).html().trim();
            if(con_text=="取消预约"){
                var yu_day=$(this).parent().prev().prev().find('i').text();
                var yu_times=$(this).parent().prev().find('.yu_times').text().split('-')[0];
                var yuTime=new Date(yu_day+' '+yu_times).getTime();
                var two_hour = 12*3600*1000;
                var date=new Date().getTime();
                if(yuTime-date>=two_hour){
                    tankuang();
                    $('.btn_qr').click(function(){
                        $("html").css("overflow","auto");
                        $("body").css("overflow","auto");
                        $(".full_bg").hide();
                        $(".yu_tan").hide();
                        $.ajax({
                            url:"<?php echo url('redo'); ?>",
                            type:"post",
                            data:{
                                id:id
                            },success:function (res) {
                                if(res.code==1){
                                    cancel_fa.remove();
                                }
                            }
                        })
                    });
                }else{
                    $('.tan_car').attr("src","/static/image/tan_car2.png");
                    $('.tan_car').css({"width":"4.97rem","height":"2.88rem"});
                    $('.tan_text').html("抱歉,已过取消预约时间无法取消");
                    tankuang();
                    $('.btn_qr').click(function() {
                        $("html").css("overflow", "auto");
                        $("body").css("overflow", "auto");
                        $(".full_bg").hide();
                        $(".yu_tan").hide();
                    });
                }
            }
        });
    });
    $(function(){
        function get(url/*后台的地址*/,obj/*后台需要的数据*/){
            var promise = new Promise(function(resolve, reject){
                $.ajax({
                    url:url,
                    data:obj,
                    success:function(res){
                        resolve(res);
                    },
                    failure:function(err){
                        reject(err);
                    }
                })
            });//等一下发嗯
            return promise;
        }
        var $div_li =$(".yuyueMenu ul li");
        $div_li.click(function(){
            $(this).addClass("yuyue_cur")
                .siblings().removeClass("yuyue_cur");
            var index =  $div_li.index(this);
            $("div.yuyue_box > div").eq(index).show().siblings().hide();
            /*get('http://127.0.0.1:8000',{
                type:1,
                time:'2017-09-08'
            }).then(function (value) {
                console.log(value);
                var list = [
                    {time:'2018-06-21',teach_name:'张教练',car_type:'自动挡',date:'周四',range_time:'08:00 - 12:00'},
                    {time:'2018-06-21',teach_name:'张教练',car_type:'自动挡',date:'周四',range_time:'08:00 - 12:00'},
                    {time:'2018-06-21',teach_name:'张教练',car_type:'自动挡',date:'周四',range_time:'08:00 - 12:00'},
                    {time:'2018-06-21',teach_name:'张教练',car_type:'自动挡',date:'周四',range_time:'08:00 - 12:00'},
                    {time:'2018-06-21',teach_name:'张教练',car_type:'自动挡',date:'周四',range_time:'08:00 - 12:00'},
                ];
                var str = '';
                for(var i=0;i<list.length;i++){
                    str +=  '<div class="yuyueList">\n' +
                        '                <div class="yList_top">\n' +
                        '                    <b>待学车</b>\n' +
                        '                    <i>'+i.time+'</i>\n' +
                        '                </div>\n' +
                        '                <div class="yList_info">\n' +
                        '                    <img src="image/head.png" class="yu_user_head"/>\n' +
                        '                    <div class="yu_user_info">\n' +
                        '                        <b class="user_name">'+i.name+'</b>\n' +
                        '                        <i class="user_fun">'+i.car_type+'</i>\n' +
                        '                    </div>\n' +
                        '                    <div class="yu_date">\n' +
                        '                        <b class="yu_week">'+i.date+'</b>\n' +
                        '                        <i class="yu_times">'+i.range_time+'</i>\n' +
                        '                    </div>\n' +
                        '                </div>\n' +
                        '                <div class="yuyue_btn">\n' +
                        '                    <b class="click_yuyue">取消预约</b>\n' +
                        '                </div>\n' +
                        '            </div>\n'+
                        '</div>';
                }
                $('.yuyue_box').html(str);
            }).catch(function (err) {
                //这个是失败的回调
                console.log(err);
            });*/
        });
    });
</script>
</body>
</html>