getAdData.min.js 1.8 KB

1
  1. "use strict";function getBannerList(e){e=void 0!=e?e:window.location.pathname,common.ajax("/public/getAdvertList",{path:e},{success:function(e){var t=e.list,i="",a="",n="",r="",o="";t.length>0&&($("#iframe1").length>0&&$("#iframe1").attr("src",t[0].ad_url),t.forEach(function(e,t){r=e.site_type,o=e.page_type;var s=e.ad_title,c=void 0!=e.event_name?e.event_name:"",l="";l=""!=s?"onclick=\"_hmt.push(['_trackEvent', '"+s+"', 'click','"+c+"'])\"":"";var d="";1==e.url_type?d=e.ad_url:2==e.url_type&&(d=e.ad_url&&e.ad_url.indexOf("?")>-1?e.ad_url+"&digest="+common.getQuery("digest"):e.ad_url+"?digest="+common.getQuery("digest"));var p="";p=0==t?'<i class="icon icon-game"></i>':1==t?'<i class="icon icon-freeflow"></i>':'<i class="icon icon-douying"></i>',1==e.site_type?i+='<div class="swiper-slide"><a '+l+' href="'+d+'"><img src="'+e.picture_url+'" width="100%"></a></div>':2==e.site_type?a="<a "+l+' href="'+d+'" target="_blank"><img src="'+e.picture_url+'" style="width: 1.2rem"></a>':3==e.site_type&&(n+=0==t?'<a class="item"'+l+">"+p+e.advert_name+"</a>":'<a class="item"'+l+' href="'+d+'">'+p+e.advert_name+"</a>")})),$(".swiper-wrapper").html(i),$("#adFixed").html(a),$(".guanggao-pic").html(i),$("#footBar").html(n),$("#footBar").find(".item:first-child").addClass("active"),1==o&&new Swiper(".swiper-container",{autoplay:{delay:2e3},pagination:{el:".swiper-pagination"}})}})}$(function(){function e(e){e.preventDefault();var a=i.offsetHeight;if(1==e.targetTouches.length){var n=e.targetTouches[0];i.style.right="0px",i.style.top=n.pageY-a/2+"px"}n.pageY>t&&(i.style.right="0px",i.style.top=t-a-20+"px"),n.pageY<40&&(i.style.right="0px",i.style.top="40px")}var t=document.documentElement.clientHeight||document.body.clientHeight,i=document.getElementById("adFixed");i&&(i.removeEventListener("touchmove",e,!1),i.addEventListener("touchmove",function(t){e(t)},!1))});