710600d10dc3ceabe547e2fcd1b433c1.php 3.0 KB
<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:45:"themes/simpleboot3/user/comment/ping_stu.html";i:1533059587;}*/ ?>
<!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">
    <style>
        .box {
            overflow: hidden;
        }

        .ping_area {
            width: 9.4133333333rem;
            margin: 0 auto;
            background-color: #fff;
            margin-top: .267rem;
            height: auto;
        }

        .ping_area #wordtext {
            height: 3.46rem;
            resize: none;
            font-size: .4rem;
        }
    </style>
</head>
<body style="background-color: #f6f6f6">
<div class="box">
    <div class="ping_area">
        <textarea id="wordtext" placeholder="请输入该学员的学车情况"></textarea>
        <em id="wordage">0/500字</em>
    </div>
    <div class="btn_ping">
        <img src="/static/image/btn_ping.png"/>
    </div>
</div>
<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/layer/layer.js"></script>
<script>
    (function (win, $) {
        var limitNum = 0;
        var pattern =  limitNum + '/500字';
        $('#wordage').html(pattern);
        $('#wordtext').keyup(
            function(){
                var remain = $(this).val().length;
                if(remain > 500){
                    pattern = "字数超过500个限制!";
                }else{
                    pattern =  remain + '/500字';

                }
                $('#wordage').html(pattern);
            }
        );
        $('.btn_ping').click(function () {
            var str_len = $('#wordtext').val().length;
            if (str_len ==0) {
                layer.msg('评价不能为空!')
            } else {
                $.ajax({
                    url: "<?php echo url('pingjia_by_coach_do'); ?>",
                    data: {
                        uid: <?php echo $uid; ?>,
                        yuyue_id: <?php echo $yuyue_id; ?>,
                        comment: $('#wordtext').val()
                    },
                    success: function (res) {
                        console.log(res);
                        if (res.code == '1') {
                            layer.msg(res.msg);
                            window.location.href="/user/profile/percenter";
                        }
                    }
                });
            }
        });
    })(window, jQuery)
</script>
</body>
</html>