$.support.cors = true; (function () { function UrlParam(options, callback) { var tpopUrl = " http://show.g.mediav.com", tpopType = options.type, tpopOf = options.of, tpopOfImpct = options.impct, tpopNewf = options.newf, tpopShowid = options.showid, tpopUid = options.uid, tpopReqtimes = options.reqtimes, tck=getQuery("tck") if (document.location.protocol == "http:") { tpopUrl = 'http://show.g.mediav.com/s?type=' + tpopType + '&of=' + tpopOf + '&newf=' + tpopNewf + '&showid=' + tpopShowid + '&uid=' + tpopUid + '&reqtimes=' + tpopReqtimes + '&impct=' + tpopOfImpct; } else { tpopUrl = 'https://show-g.mediav.com/s?type=' + tpopType + '&of=' + tpopOf + '&newf=' + tpopNewf + '&scheme=https' + '&showid=' + tpopShowid + '&uid=' + tpopUid + '&reqtimes=' + tpopReqtimes + '&impct=' + tpopOfImpct; }; if(conf.tck_submit==1){ tck ?tpopUrl+='&tck='+tck:"" } if(conf.ref){ tpopUrl+="&refurl="+encodeURIComponent(document.referrer) } $.ajax({ url: tpopUrl, type: 'get', dataType: 'jsonp', jsonp: 'jsonp', success: function (data) { callback && callback(data.ads); } }); }; // 点击替换 var Macro = { start: "__EVENT_TIME_START__", end: "__EVENT_TIME_END__", x: "__OFFSET_X__", y: "__OFFSET_Y__" }, _clktk, _curl, start_time, end_time, sec360=false, page=1; var url_scroll = function (arr) { $.each(arr, function (index, val) { $('body').append(''); }); }; $("body").on("mousedown", ".content_med", function (e) { var _y = parseInt(e.pageY - $(this).offset().top), _x = parseInt(e.pageX - $(this).offset().left); topClktk1($(this), _x, _y) }).on("click", ".content_med", function (e) { topClktk2($(this)); var str = $(this).attr('data-clktk'); if (str) { var arr = str.split(','); $.each(arr, function (index, val) { $('body').append(''); }); }; if(conf.envU){ $.getJSON("//ad.kuaizip.com/advertise/userclick",{ time:new Date().getTime(), localUrl:$.base64.encode("kZip.com"+location.pathname), project:$.base64.encode("tpop"+"_"+conf.proType), position:$.base64.encode($(this).attr("position")), qid:$.base64.encode(getQuery("qid")), env:$.base64.encode(getQuery("env")), uid:$.base64.encode(getQuery("uid")) }).done(function(data) {}); }else { $.getJSON("//ad.kuaizip.com/advertise/userclick",{ time:new Date().getTime(), localUrl:$.base64.encode("kZip.com"+location.pathname), project:$.base64.encode("tpop"+"_"+conf.proType), position:$.base64.encode($(this).attr("position")) }).done(function(data) {}); } }); $(".content").on('click',".clickSSp",function(){ $.getJSON("//ad.kuaizip.com/advertise/userclick",{ time:new Date().getTime(), localUrl:$.base64.encode("kZip.com"+location.pathname), project:$.base64.encode("tpop"+"_"+conf.proType), position:$.base64.encode($(this).attr("position")) }).done(function(data) {}); }) function creatScript(smua,position) { var _b = document.createElement("div") var _s = document.createElement("script"); _s.setAttribute("type","text/javascript"); _s.setAttribute("smua",smua); _s.src = "//www.nkscdn.com/smu0/o.js"; _b.appendChild(_s) _b.setAttribute("position",position); _b.setAttribute("class","baiduP"); return _b } function topClktk1(el, x, y) { start_time = Math.round(new Date()); _clktk = el.data('oldclktk'); _curl = el.data("oldcurl"); if (_clktk.indexOf(Macro["start"]) > -1) { _clktk = _clktk.replace(Macro["start"], start_time); }; if (_clktk.indexOf(Macro["x"]) > -1) { _clktk = _clktk.replace(Macro["x"], x); }; if (_clktk.indexOf(Macro["y"]) > -1) { _clktk = _clktk.replace(Macro["y"], y); }; if (_curl.indexOf(Macro["start"]) > -1) { _curl = _curl.replace(Macro["start"], start_time); }; if (_curl.indexOf(Macro["x"]) > -1) { _curl = _curl.replace(Macro["x"], x); }; if (_curl.indexOf(Macro["y"]) > -1) { _curl = _curl.replace(Macro["y"], y); }; el.attr('data-clktk', _clktk); el.attr('href', _curl); }; function topClktk2(el, x, y) { end_time = Math.round(new Date()); _curl = el.attr("href"); if (_clktk.indexOf(Macro["end"]) > -1) { _clktk = _clktk.replace(Macro["end"], end_time); }; if (_curl.indexOf(Macro["end"]) > -1) { _curl = _curl.replace(Macro["end"], end_time); }; el.attr('data-clktk', _clktk); el.attr('href', _curl); }; var imptkArr=[],count=0,row="",flesh=false,imptkNum=2,blaceNum=1; function render360(){ UrlParam({ of: 4, newf: 1, type: 1, showid: conf.showId, uid: (+new Date()) + Math.random().toString(10).substring(2, 6), reqtimes: page, impct: conf.impct }, function (data) { // if(conf.firstShow){ firstShow(conf.showId) // } page++; if(conf.twiceSubData){ if(sec360 && !data){ secDataUp(conf.showId,"error") } if(sec360 && data) { secDataUp(conf.showId, "success") } } if(!data){ if(sec360){ renderBaidu(); return; } sec360 = true; render360(); return; } for(var i = 0;i

'+data[i].title.substring(0,22)+'

广告
'); }else{ $(".small").eq(count*2).before(creatScript(conf.baidu_smua,'tpop_company_bottom_'+(count*3+1))).removeClass("bd"); $(".media").eq(0).removeClass("media"); } count++ ; } }); } var _numC = 0; renderNews(); $(".content").on("mouseenter",".list",function(){ $(this).find(".tips").removeClass("hide"); }).on("mouseleave",".list",function(){ $(this).find(".tips").addClass("hide"); }) function renderNews(){ $.ajax({ url:"//news.7654.com/api/tpop_news_recommend/tpop1/"+conf.qid+"/"+row, dataType:"json", success:function(data){ flesh = true; var _data = data.data,_html=""; row = data.last_row; if(data.code ==1){ $.each(_data,function(i,item){ _numC=_numC+1; _html+='

'+item.title.substring(0,25)+'

'+item.title+'

新闻
' }); $(".nano-content").append(_html); render360(); $(".nano").nanoScroller(); $(".nano").on("update", function(event, values){ if( $(".content .big").eq(imptkNum) && $(".content .big").eq(imptkNum).length>0 && $(".content .big").eq(imptkNum)[0].getBoundingClientRect().top<535){ imptkArr[0] && url_scroll(imptkArr[0]); imptkArr = imptkArr.slice(1); imptkNum++; } if($(".small").eq(blaceNum*10-4)[0] && $(".small").eq(blaceNum*10-4)[0].getBoundingClientRect().top<200 && flesh){ blaceNum++; flesh = false; renderNews(); } }); } }, }); } function renderBaidu() { for(var i = 0;i -1); if (isLinux) return "Linux"; if (isWin) { var isWin2K = sUserAgent.indexOf("Windows NT 5.0") > -1 || sUserAgent.indexOf("Windows 2000") > -1; if (isWin2K) return "Win2000"; var isWinXP = sUserAgent.indexOf("Windows NT 5.1") > -1 || sUserAgent.indexOf("Windows XP") > -1; if (isWinXP) return "WinXP"; var isWin2003 = sUserAgent.indexOf("Windows NT 5.2") > -1 || sUserAgent.indexOf("Windows 2003") > -1; if (isWin2003) return "Win2003"; var isWinVista = sUserAgent.indexOf("Windows NT 6.0") > -1 || sUserAgent.indexOf("Windows Vista") > -1; if (isWinVista) return "WinVista"; var isWin7 = sUserAgent.indexOf("Windows NT 6.1") > -1 || sUserAgent.indexOf("Windows 7") > -1; if (isWin7) return "Win7"; var isWin10 = sUserAgent.indexOf("Windows NT 10") > -1 || sUserAgent.indexOf("Windows 10") > -1; if (isWin10) return "Win10"; } return "other"; } function getBrowser() { var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串 var isOpera = userAgent.indexOf("Opera") > -1; //判断是否Opera浏览器 var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1 && !isOpera; //判断是否IE浏览器 var isEdge = userAgent.indexOf("Edge") > -1; //判断是否IE的Edge浏览器 var isFF = userAgent.indexOf("Firefox") > -1; //判断是否Firefox浏览器 var isSafari = userAgent.indexOf("Safari") > -1 && userAgent.indexOf("Chrome") == -1; //判断是否Safari浏览器 var isChrome = userAgent.indexOf("Chrome") > -1 && userAgent.indexOf("Safari") > -1; //判断Chrome浏览器 if (isIE) { var reIE = new RegExp("MSIE (\\d+\\.\\d+);"); reIE.test(userAgent); var fIEVersion = parseFloat(RegExp["$1"]); if (fIEVersion == 7) { return "IE7"; } else if (fIEVersion == 8) { return "IE8"; } else if (fIEVersion == 9) { return "IE9"; } else if (fIEVersion == 10) { return "IE10"; } else if (fIEVersion == 11) { return "IE11"; } else { return "0"; }//IE版本过低 return "IE"; } if (isOpera) { return "Opera"; } if (isEdge) { return "Edge"; } if (isFF) { return "FF"; } if (isSafari) { return "Safari"; } if (isChrome) { return "Chrome"; } } $(".content").on("click",".small",function(){ $.getJSON("//ad.kuaizip.com/advertise/userclick",{ time:new Date().getTime(), localUrl:$.base64.encode("kZip.com"+location.pathname), project:$.base64.encode("tpop"+"_"+conf.proType), type:$.base64.encode("hoteastday"), position:$.base64.encode($(this).data("news")), act:$.base64.encode("click") }).done(function(data) {}); }) })();