(function(){function n(){$.ajax({url:"/ajax/sharenews",data:{id:$("#bdshare").data("id")},type:"post",cache:!1})}$.ajax({url:"/ajax/addnewsclick/"+$(".article_fun .btnFav").data("id"),type:"post",cache:!1});$.ajax({url:"/ajax/newsdetailsubjectdlg",success:function(n){$(".studyinfo_article").after(n);$(".nav-menu li").click(function(){$(this).addClass("cur").siblings().removeClass("cur");var n=$(this).index();$(this).siblings(".typelist").find(".list_data:eq("+n+")").show().siblings(".list_data").hide()})}});$(".article_tag").data("subject")&&$.ajax({url:"/ajax/newsdetailguid",data:{id:$(".article_tag").data("subject")},cache:!1,success:function(n){$(".article_tag").append(n)}});$.ajax({url:"/ajax/righthotschool",data:{subjectId:$(".hotSchool").data("subject"),pos:1072},cache:!1,success:function(n){$(".hotSchool").html(n)}});$.ajax({url:"/ajax/rightrecommendcourse",data:{id:$(".recommendCourse").data("subject")},cache:!1,success:function(n){$(".recommendCourse").html(n)}});$(".article_fun .btnPraise").click(function(){var n=this;$.ajax({url:"/ajax/praisenews",data:{id:$(n).data("id")},type:"post",cache:!1,success:function(t){if(!t.success){if(t.state==1){layer.msg("请先登录");showLoginDlg();return}alert(t.msg);return}$("label",n).html(t.state);alert("点赞成功")},error:function(){alert("提交失败,请稍候再试")}})});$(".article_fun .btnFav").click(function(){var n=this;$.ajax({url:"/ajax/favnews",data:{id:$(n).data("id")},type:"post",cache:!1,success:function(t){if(!t.success){if(t.state==1){layer.msg("请先登录");showLoginDlg();return}alert(t.msg);return}$("label",n).html(t.state);alert("收藏成功")},error:function(){alert("提交失败,请稍候再试")}})});$("[class^=bds_]").click(function(){$(this).hasClass("bds_more")?setTimeout(function(){$("#bdshare_pop [class^=bds_]").click(n)},500):n()});$("body").on("click","[class^=bds_]",n);var t=new Swiper(".swiper-container",{autoplay:!0,slidesPerView:2,navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"}});$("#newsReserve").click(function(){var i=$.trim($('input[name="Name"]',$(".user_information")).val()),r=$.trim($('input[name="Mobile"]',$(".user_information")).val()),u=$.trim($('input[name="Remarks"]',$(".user_information")).val()),f=$.trim($('input[name="Profession"]',$(".user_information")).val()),n="",t;if(i||(n+="请填写学生姓名
"),r||(n+="请填写联系手机
"),n!=""){layer.msg(n);return}t=layer.load(0,{shade:!1});$.ajax({url:"/ajax/reserve",data:{Name:i,mobile:r,remarks:u,profession:f},type:"post",cache:!1,success:function(n){layer.close(t);n.success?layer.msg("提交成功"):layer.msg("提交失败")},error:function(){layer.close(t);alert("提交失败,请稍候再试")}})})})()