//首页执行 if(window.pageObj && window.pageObj.isHomePage==1){ gray() } festival() function gray(){ $require(['cmsAjax'],function(c){ let url = window.location.origin + "/ndesigner/api/gray" c.cmsAjax.postJson(url).then(function(res){ if(res.code == 200){ $("html")[0].style="filter:progid:DXImageTransform.Microsoft.Basiclmage\(grayscale=1\);-webkit-filter\:grayscale\(100%\)\;" } }) }) } function festival(){ if(!isFrontEnv()){ return } $require(['cmsAjax'],function(c){ let url = "/fwebapi/cms/lowcode/festivalPendant/getSettings" c.cmsAjax.get(url).then(function(resp){ if(resp.data && resp.data.code == 200 && resp.data.settings){ let res = resp.data.settings if(res.location==1 && window.pageObj && window.pageObj.isHomePage!=1){ return } let 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){ $require(['/npublic/commonjs/restival.js'],function(r){ r.init(res) }) } } }) }) }