topic.min.js 1.2 KB
define(["jquery","underscore"],function(){var e={wap:!1,initialize:function(){this.bindEvents(),this.render()},bindEvents:function(){$(document).on("touchstart",".m-to-top",function(e){e.preventDefault(),$("body").animate({scrollTop:0},300)})},getParameterByName:function(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t=new RegExp("[\\?&]"+e+"=([^&#]*)"),n=t.exec(location.search);return null===n?"":decodeURIComponent(n[1].replace(/\+/g," "))},render:function(){var e=this,t=this.getParameterByName("source"),n=this.getParameterByName("banner"),r=this.getParameterByName("title"),a=this.getParameterByName("tplName"),i=this.getParameterByName("fullScreenBanner"),o=this.getParameterByName("modelCode");return""!=t&&t.length>0&&t&&"wap"==t.toLowerCase()&&(this.wap=!0),""==a&&a.length<=0&&(a="product"),""==r&&r.length<=0&&(r="活动专题"),""==o||o.length<=0?void alert("模块标示[modelCode]不能为空!"):""==n||n.length<=0?void alert("专题banner图[banner]不能为空!"):"activity"==a.toLowerCase()&&(""==i||i.length<=0)?void alert("专题全屏banner图[fullScreenBanner]不能为空!"):void require([a],function(t){t.initialize({wap:e.wap,banner:n,title:r,modelCode:o,fullScreenBanner:i})})}};return e});