var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?9c6d95f3ddccd37bf2ff3e2d8158824a"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); $(".loginstaCss").hover(function(){ $(".login_ul").stop().slideDown(); },function(){ $(".login_ul").stop().slideUp(); }); var thisurl = "/raise/catalogue"; function SiteSearch() { let seachHis = $("#keywords").val(); if (seachHis == '') { layer.msg('请输入你需要搜索的内容!', { offset: '300px' }) return false; } location.href="http://www.110net.cn/ijtvs" + "?keywords=" + seachHis + ""; }; //键盘事件 $("#keywords").keypress(function(e) { var keyCode = e.keyCode ? e.keyCode : e.which ? e.which : e.charCode; if (keyCode == 13) { SiteSearch(); } }); $(".search-logo").click(function() { SiteSearch(); }); $('.head-search input').focus(function () { $(this).css('width','165px') }).blur(function () { $(this).css('width','65px') }); //用户信息上的获取 var state = getQueryString('state'); //如果状态为1,就是是从第三方登录进来的 if(state != undefined && state == 1){ addCookie("login",true,{expires:3600}); getUser(); $("#user_pic").hide(); $(".loginstaCss").show(); var userPic=getCookie('userPic'); var userVIP=getCookie('userVIP'); var userExpire=getCookie('userExpire'); //$("#login_img").attr("src",userPic+"?tm="+Math.random()); //如果是vip的话,就是有图标,还会有到期时间 if(userVIP=="true"){ $(".vip_ico").css("display","block"); $(".login_first").css("display","block"); $("#expire_time").html(userExpire); } else{ $(".vip_ico").css("display","none"); $(".login_first").css("display","none"); } /*通过cookie获取是否为vip和那个到期时间*/ loginState1(); $("#clearlogin").click(function(){ logout(); }); function loginState1(){ if(getCookie('login')== null){ $("#userLogin").show(); $(".loginstaCss").hide(); }else{ $("#userLogin").hide(); $(".loginstaCss").show(); var userPic=getCookie('userPic'); $("#login_img").attr("src",userPic+"?tm="+Math.random()); } } } //如果不存在state的时候 else{ loginState1(); $("#clearlogin").click(function(){ //清除cookie logout(); }); function loginState1(){ if(getCookie('login')== null){ $("#userLogin").show(); $(".loginstaCss").hide(); }else{ $("#userLogin").hide(); $(".loginstaCss").show(); var userPic=getCookie('userPic'); var userName=getCookie('userName'); var userVIP=getCookie('userVIP'); var userExpire=getCookie('userExpire'); $("#login_img").attr("src",userPic+"?tm="+Math.random()); $('.user_name').text(userName); //如果是vip的话,就是有图标,还会有到期时间 if(userVIP=="true"){ $(".vip_ico").css("display","block"); $(".login_first").css("display","block"); $("#expire_time").html(userExpire); } else{ $(".vip_ico").css("display","none"); $(".login_first").css("display","none"); } /*通过cookie获取是否为vip和那个到期时间*/ } } function logout() { $.ajax({ type:"POST", url:$.host+"/logout", dataType: "json", crossDomain: true == !(document.all), success: function(data) { if(data.code === '0'){ removeCookie('login'); removeCookie('userPic'); loginState1(); window.location.href="http://www.110net.cn/sbjtf/vtfs"; }else { layer.msg(data.msg) } } }) } } function listChannel() { $.ajax({ type: "GET", url: $.host + "/base/getChannelList", dataType: "json", data:{ "gender" :localStorage.raiseSex?localStorage.raiseSex:0}, crossDomain: true == !(document.all), success: function (data) { if (data.code === '0') { let columnData = data.data, str = '', pathName = window.location.pathname; localStorage.setItem('columnData',JSON.stringify(columnData)); $.each(columnData,function (i,item) { let childrenHtml = ''; if(pathName === '/raise' || pathName === '/' || pathName === '/raise/'){ childrenHtml +='
'; columnData[i].children.forEach(item=>{ childrenHtml +=`
`; if(item.channelType == 1){ childrenHtml +=`${item.name}`; }else { childrenHtml +=`${item.name}`; } childrenHtml +=`
`; }); childrenHtml +='
${item.name}${childrenHtml}` }else if(item.name == '国际趋势'){ str+=`
  • ${item.name}${childrenHtml}
  • ` }else if(item.channelType == 1){ if(item.id == '104'){ str+=`
  • ${item.name}${childrenHtml}
  • ` }else{ str+=`
  • ${item.name}${childrenHtml}
  • ` } }else { str+=`
  • ${item.name}${childrenHtml}
  • ` } }); $('.column-list').html(str); let barcolumn = $("#"+getParam('childId')); barcolumn.addClass('cur'); headChannel(); if(getParam('channelId')){ let setMuie = $("#channelId_"+getParam('channelId').split('_')[2]); $.each($('.column-list li'),function () { if($(this).attr('id') == 'channelId_'+getParam('channelId').split('_')[2]){ setMuie.addClass('active').siblings().removeClass('active'); }else { $(this).removeClass('active'); } }); $(".column-list li").hover(function() { $(this).children(".children-container").stop().slideDown(); }, function() { $(this).children(".children-container").stop().slideUp(); }); } } } }); } function headChannel(){ $.each($('.head-channel li'),function (item) { let id = $(this).attr('id'); if(localStorage.raiseSex == id){ $('.head-channel').find('#'+id).addClass('active').siblings().removeClass('active'); } }); } $(document).ready(function () { listChannel(); })