festival() function festival(){ if(!isfrontenv()){ return } var url = "/commentviewcount/ajax/holidaypendant"; var res = ''; $.ajax({ type:"get", url:url, data:{}, async:false, success: function(data){ console.log(data); res = json.parse(data.holidaypendant) } }); // 是否开启飘窗 if(res && res.isopen == true) { require(['/public/cjgj/restival.js'],function(c){ var ntime = new date().gettime(); var qxurl = location.href.replace(location.origin,'') res.nowtime = ntime if(res.location==1 && qxurl != '/'){ return } var cantime = (res.showtime && res.showtime.length==2 && res.nowtime>=res.showtime[0] && res.nowtime<=res.showtime[1]) || !res.showtime || res.showtime.length==0 if(res.isopen && cantime){ c.init(res) } }) } }