146182eb7173fc40bae1f2fa6e984c00.php
6.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:44:"themes/simpleboot3/user/comment/go_ping.html";i:1534870966;}*/ ?>
<!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>
.choose_ping li{
box-sizing: border-box;
}
</style>
</head>
<body style="background-color: #f6f6f6">
<div class="box">
<div class="choose_ping_box">
<div class="choose_ping" data-type="1">
<ul>
<li>
<img src="/static/image/hao_on.png" />
<b>好评</b>
</li>
<li>
<img src="/static/image/cha_off.png" />
<b>差评</b>
</li>
</ul>
</div>
</div>
<div class="ping_content">
<div class="ping_title" data-id="<?php echo $teach_id; ?>">
<img src="/static/image/ping_icon.png"/>
<b>教练评价</b>
</div>
<div class="pingList hao_cur">
<?php if(is_array($ctag1) || $ctag1 instanceof \think\Collection || $ctag1 instanceof \think\Paginator): $i = 0; $__LIST__ = $ctag1;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
<span data-id="<?php echo $vo['id']; ?>"><?php echo $vo['name']; ?></span>
<?php endforeach; endif; else: echo "" ;endif; ?>
</div>
<div class="pingList cha_cur">
<?php if(is_array($ctag2) || $ctag2 instanceof \think\Collection || $ctag2 instanceof \think\Paginator): $i = 0; $__LIST__ = $ctag2;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
<span data-id="<?php echo $vo['id']; ?>"><?php echo $vo['name']; ?></span>
<?php endforeach; endif; else: echo "" ;endif; ?>
</div>
<div class="ping_area">
<textarea id="wordtext" placeholder="没有找到合适的标签?点这里发表意见吧~"></textarea>
<em id="wordage">0/500字</em>
</div>
</div>
<div class="btn_tijiao">
<img src="/static/image/btn_tijiao.png"/>
</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>
<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 type="text/javascript" src="/static/js/layer/layer.js"></script>
<script>
$(function(){
var $div_li=$('.choose_ping li');
$div_li.click(function(){
var index= $div_li.index(this);
if(index==0){
$(this).children('img').attr("src","/static/image/hao_on.png").parent().siblings()
.children('img').attr("src","/static/image/cha_off.png");
$('.hao_cur').show();
$('.cha_cur').hide();
$(this).parent().parent().attr("data-type","1");
}else{
$(this).children('img').attr("src","/static/image/cha_on.png").parent().siblings()
.children('img').attr("src","/static/image/hao_off.png");
$('.hao_cur').hide();
$('.cha_cur').show();
$(this).parent().parent().attr("data-type","2");
}
});
$('.hao_cur span').click(function(){
if(!$(this).hasClass('ping_active')){
$(this).addClass('ping_active');
}else{
$(this).removeClass('ping_active');
}
});
$('.cha_cur span').click(function(){
if(!$(this).hasClass('ping_active')){
$(this).addClass('ping_active');
}else{
$(this).removeClass('ping_active');
}
});
$('.btn_tijiao').click(function(){
var pingTxt=$('#wordtext').val();
var data_type=$('.choose_ping').attr("data-type");
var pingTab=$('.pingList .ping_active');
var data_id = '';
for(var i=0;i<pingTab.length;i++){
data_id+=pingTab[i].getAttribute("data-id")+',';
}
if(data_id==""&&pingTxt==""){
layer.msg("评价不能为空")
}else{
$.ajax({
url:"<?php echo url('/user/comment/comment_do_by_stu'); ?>",
type:"post",
data:{
teach_id:<?php echo $teach_id; ?>,
comment:pingTxt,
comment_tag:data_id,
yuyue_id:<?php echo $yuyue_id; ?>,
type:data_type
},success:function(res){
console.log(res);
tankuang();
},error:function(err){
console.log(err);
}
})
}
});
$('.btn_qr').click(function(){
window.location.href="<?php echo url('user/comment/show_stu',array('yuyue_id'=>$yuyue_id)); ?>";
});
});
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 + '/300字';
}
$('#wordage').html(pattern);
}
);
</script>
</body>
</html>