作者 lianghiu

多次点击BUG修改

... ... @@ -103,36 +103,39 @@
$(this).removeClass('ping_active');
}
});
var click_num = 0;
$('.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:"{:url('/user/comment/comment_do_by_stu')}",
type:"post",
data:{
teach_id:{$teach_id},
comment:pingTxt,
comment_tag:data_id,
yuyue_id:{$yuyue_id},
type:data_type
if(click_num == 0){
click_num++;
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:"{:url('/user/comment/comment_do_by_stu')}",
type:"post",
data:{
teach_id:{$teach_id},
comment:pingTxt,
comment_tag:data_id,
yuyue_id:{$yuyue_id},
type:data_type
},success:function(res){
console.log(res);
tankuang();
},error:function(err){
console.log(err);
}
})
},success:function(res){
tankuang();
click_num = 0;
},error:function(err){
console.log(err);
}
})
}
}
});
$('.btn_qr').click(function(){
window.location.href="{:url('user/comment/show_stu',array('yuyue_id'=>$yuyue_id))}";
... ...