filesbox/web/dist/design/designstatic/home/waphome/js/module.js
2024-07-26 14:10:54 +08:00

3 lines
41 KiB
JavaScript

(function(l,h){var p=navigator.userAgent;if(!i||s)return!1;var c=l("html"),n=c.width()/10,a=parseFloat(c.css("fontSize")),r=n/a,e=n*r;t(),l(document).ready(function(){t(),setTimeout(function(){t()},300)});function t(){if(e==1)return!1;c.css("fontSize",n+"px"),l("meta[name=viewport]").attr("content","initial-scale="+r+", maximum-scale="+r+", minimum-scale="+r+", user-scalable=no")}function i(){return/(Android).*/i.test(p)}function s(){return/MiuiBrowser/gi.test(p)}})(jQuery,window),function(l,h){var p={init:function(){var c=this;c.getValue("token")&&(c.setCookie("token",c.getValue("token")),c.setCookie("openid",c.getValue("openid"))),h.location.href.indexOf("/mp/index.shtml")>-1||h.location.href.indexOf("/pages/routine/")>-1?(c.miniprogram=!0,localStorage.miniprogram=!0):(c.miniprogram=!1,localStorage.miniprogram=!1)},getValue:function(c){var n=n||window.location.href,a=n.split("?");if(a.length==1)return null;if(a.length==2){for(var s=a[1].split("&"),o={},r=0;r<s.length;r++){var e=s[r].split("=");o[e[0]]=e[1]}return o[c]?o[c]:!1}if(a.length==3){for(var s=a[1].split("&"),t=!1,o={},r=0,i=s.length;r<i;r++){var e=s[r].split("=");o[e[0]]=e[1],r+1==i&&e[0]==c&&(t=!0)}return o[c]?t?o[c]+"?"+a[2]:o[c]:!1}for(var s=a[1].split("&"),o={},r=0;r<s.length;r++){var e=s[r].split("=");o[e[0]]=e[1]}return o[c]?o[c]:!1},setCookie:function(c,n){var a=30,r=new Date;r.setTime(r.getTime()+a*24*60*60*1e3);var e=c+"="+n+";path=/;expires="+r.toGMTString();document.cookie=e}};p.init(),window.tokenjs=p}(jQuery,window),document.write('<script type="text/javascript" charset="utf-8" src="/design/designstatic/home/js/ase.min.js"></script>'),document.write('<link rel="stylesheet" href="/design/designstatic/common/css/userMobile.css">'),document.write('<link rel="stylesheet" href="/design/designstatic/home/iconfont/iconfont.css">'),document.write('<script type="text/javascript" charset="utf-8" src="https://res2.wx.qq.com/open/js/jweixin-1.6.0.js"></script>'),document.write('<link rel="stylesheet" href="/design/designstatic/design/css/select2.min.css">'),document.write('<script type="text/javascript" charset="utf-8" src="/js/ddlogin.js"></script>'),document.write('<script type="text/javascript" charset="utf-8" src="/js/wwlogin.js"></script>'),document.write('<script type="text/javascript" charset="utf-8" src="/js/wxlogin.js"></script>'),document.write('<script type="text/javascript" charset="utf-8" src="/design/designstatic/home/waphome/js/layerMobile/layer.js"></script>'),document.write('<script type="text/javascript" charset="utf-8" src="/design/designstatic/common/js/jquery.qrcode.min.js"></script>');var scriptUrl="/design/designstatic/common/js/userMobile.js";loadScriptmin(scriptUrl,function(){var l=window.user,h=window.tokenjs,p=window.player,c={loginCount:0,init:function(){if(h.getValue("errorCode")){var a=parseInt(h.getValue("errorCode")),r="";switch(a){case 602:r="\u975E\u7F51\u6821\u7528\u6237\u7981\u6B62\u767B\u5F55";break;case 606:r="\u5F53\u524D\u8D26\u53F7\u4E0D\u5B58\u5728";break;case 509:r="\u5DF2\u5F00\u542F\u8BBE\u5907\u9650\u5236\uFF0C\u60A8\u53EA\u80FD\u5728\u56FA\u5B9A\u8BBE\u5907\u4E0A\u8FDB\u884C\u767B\u5F55";break;case 601:r="\u5DF2\u7ED1\u5B9A\u5176\u4ED6\u8D26\u53F7";break;case 602:r="\u7528\u6237\u8D26\u53F7\u88AB\u9501\u5B9A";break;case 606:r="\u7528\u6237\u8D26\u53F7\u88AB\u5220\u9664";break;case 707:r="\u60A8\u5DF2\u88AB\u7981\u6B62\u767B\u5F55";break;case 709:r="\u975E\u7F51\u6821\u7528\u6237\u4E0D\u80FD\u8FDB\u5165";break}r&&(layer?layer.open({content:r,skin:"msg",time:2}):alert(r)),window.history.replaceState(null,null,"/")}var e=this;e.getLoginUser(),setTimeout(function(){e.handleBtn()},0),h.getValue("redirectUrl")&&!getCookie("token")&&l.loginLayer(function(s){s.success&&(window.location.href=h.getValue("redirectUrl"))}),h.getValue("redirect")&&!getCookie("token")&&l.loginLayer(function(s){s.success&&(window.location.href=h.getValue("redirect")+"?cwid="+h.getValue("cwid")+"&courseId="+h.getValue("courseId"))});var t=localStorage.getItem("queryusernameloginShow");if(t&&Date.parse(new Date)-JSON.parse(unescape(t)).time<1e4){var i=JSON.parse(unescape(t));i.data=="1"?l.loginLayer():i.data=="2"&&l.getPasswordLayer(),localStorage.removeItem("queryusernameloginShow")}e.bindGoBuyCar(),e.handleClickHref()},getLoginUser:function(a){var r=this;getCookie("token")?l.isLogin(function(e){e.success?(r.loginUserData=e.data,r.login(e.data,e.timeStamp),window.location.pathname=="/pages/wap/info.html"||window.location.pathname=="/pages/wap/bundle.html"||window.location.pathname=="/shop/item.html"||a&&!l.loginAfterJump&&(e.data.userTypeExact=="STUDENT",window.location.href=window.basePath?"/"+window.basePath+"#/":"/#/")):r.carryStorageLogin()}):r.carryStorageLogin()},carryStorageLogin:function(){var a=this;if(localStorage.isSaveAPWordKey&&window.CryptoJS&&window.decrypt&&a.loginCount<2){a.loginCount++;var r=decrypt(localStorage.isSaveAPWordKey),e=JSON.parse(r),t=e.a,i=e.b,s=+e.t;Date.now()-s<3600*1e3*24*10&&l.login(t,i,function(o){if(o.success)a.getLoginUser(!0);else{var d=o.message;switch(parseInt(o.code)){case 200:d="\u5BC6\u7801\u6216\u8D26\u53F7\u4E0D\u6B63\u786E\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165";break;case 400:d="\u8BE5\u7F51\u6821\u9700\u8981\u4F7F\u7528\u9501\u5C4F\u6D4F\u89C8\u5668\u767B\u5F55";break;case 403:d="\u8D26\u53F7\u7C7B\u578B\u4E0D\u6B63\u786E";break;case 503:d="\u5DF2\u88AB\u9650\u5236\u767B\u5F55";break;case 707:d="\u60A8\u5DF2\u88AB\u7981\u6B62\u767B\u5F55";break}if(o.success){var m=o.data;if(m){var u=m.errCode;u=="4012"?d="\u8D85\u8FC7\u9650\u5236\u6B21\u6570"+m.limitCount+"\u6B21\uFF0C\u8BF7"+m.denyTime/60+"\u5206\u949F\u540E\u91CD\u8BD5":d="\u5BC6\u7801\u6216\u8D26\u53F7\u4E0D\u6B63\u786E\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165"}else d="\u5BC6\u7801\u6216\u8D26\u53F7\u4E0D\u6B63\u786E\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165"}window.layer?layer.open({content:d,skin:"msg",time:2}):alert(d)}})}},login:function(a,r){for(var e=this,t=$(".module[data-type=registerLogin]"),i=(a==null?void 0:a.user)||{},s=0,o=t.length;s<o;s++){var d=t.eq(s),m='<a href="'+(window.basePath?"/"+window.basePath+"#/":"/#/")+'" style="margin-right: 5px;overflow: hidden;text-overflow:ellipsis;white-space: nowrap;max-width: 50%;text-align: right;">'+escape(i.nickname||i.name||"")+'</a> | <span style="margin-left: 5px;white-space: nowrap;" class="quitBtn">\u9000\u51FA</span>';d.find(".box").html(m)}$(".quitBtn").on("click",function(){window.player.mobileVideoShow(!1),l.loginout(function(u){u.success&&window.location.reload()})})},handleClickHref:function(){var a=this,r=$(".module[data-clickhref][data-type=group]");r.on("click",function(e){for(var t=$(e.target),i=t.parents(),s=!0,o=0,d=i.length;o<d;o++){var m=i.eq(o);if(t.attr("href")||m.attr("href")||m.attr("data-handle")){s=!1;break}}if(s){var u=$(this),b=u.attr("data-clickhref");if(b.indexOf("/aroom/#")>-1||b.indexOf("/myroom/#")>-1||b.indexOf("/pay/#")>-1){var f=window.user,w=function(x){x=="STUDENT"?b.indexOf("/pay/#")>-1?window.location.href=b.indexOf("/pay/#/")>-1?b:window.basePath?"/"+window.basePath+"#/":"/#/":window.location.href=b.indexOf("/myroom/#/")>-1?b:window.basePath?"/"+window.basePath+"#/":"/#/":window.location.href=b.indexOf("/aroom/#/")>-1?b:window.basePath?"/"+window.basePath+"#/":"/#/"},y=function(){f.loginLayer(function(x){x.success&&f.isLogin(function(g){g.success&&w(g.data.userTypeExact)})})};getCookie("token")||getCookie("stoken")?f.isLogin(function(x){x.success?w(x.data.userTypeExact):y()}):y()}else u.attr("data-clicktarget")=="_blank"?location.open=b:location.href=b}})},handleBtn:function(){for(var a=this,r=$("[data-handle=login]"),e=0,t=r.length;e<t;e++){var i=r.eq(e);a.bindLoginBtnEvent(i)}for(var s=$("[data-type=registerLogin] .loginEvent"),e=0,t=s.length;e<t;e++){var i=s.eq(e);a.bindLoginBtnEvent(i)}for(var o=$("[data-handle=register]"),e=0,t=o.length;e<t;e++){var i=o.eq(e);a.bindRegisterEvent(i)}for(var d=$("[data-type=registerLogin] .registerEvent"),e=0,t=d.length;e<t;e++){var i=d.eq(e);a.bindRegisterEvent(i)}for(var m=$("[data-handle=registerSchool]"),e=0,t=m.length;e<t;e++){var i=m.eq(e);a.bindRegisterSchoolEvent(i)}for(var u=$("[data-handle=QQlogin]"),e=0,t=u.length;e<t;e++){var i=u.eq(e);a.bindQQloginEvent(i)}for(var b=$(".module[data-handle=wechatLogin]"),e=0,t=b.length;e<t;e++){var i=b.eq(e);a.bindWechatLoginEvent(i)}for(var f=$(".module[data-handle=enwechatLogin]"),e=0,t=f.length;e<t;e++){var i=f.eq(e);a.bindenWechatLoginEvent(i)}for(var w=$(".module[data-handle=dingdingLogin]"),e=0,t=w.length;e<t;e++){var i=w.eq(e);a.binddingdingLoginEvent(i)}for(var y=$(".module[data-handle=appLogin]"),e=0,t=y.length;e<t;e++){var i=y.eq(e);a.bindappLoginEvent(i)}for(var x=$(".module[data-handle=dialogBtn]"),e=0,t=x.length;e<t;e++){var i=x.eq(e);a.binddialogEvent(i)}for(var g=$("[data-handle=weiboLogin]"),e=0,t=g.length;e<t;e++){var i=g.eq(e);a.bindWeiboLoginEvent(i)}for(var v=$("[data-handle=alipayLogin]"),e=0,t=v.length;e<t;e++){var i=v.eq(e);a.bindAlipayLoginEvent(i)}for(var I=$("[data-handle=getPasswod]"),e=0,t=I.length;e<t;e++){var i=I.eq(e);a.bindGetPasswodEvent(i)}for(var C=$("[data-handle=getUsername]"),e=0,t=C.length;e<t;e++){var i=C.eq(e),k=C.eq(e).attr("data-designId");a.bindGetUsernameEvent(i,k)}for(var T=$(".module[data-handle=exchangeCoupon]"),e=0,t=T.length;e<t;e++){var i=T.eq(e);a.bindGetExchangecouponEvent(i)}for(var L=$(".module[data-handle=goBack]"),e=0,t=L.length;e<t;e++){var i=L.eq(e);a.bindGoBack(i)}for(var P=$(".module[data-handle=QRcodeEvent]"),e=0,t=P.length;e<t;e++){var i=P.eq(e);a.BindQRcode(i)}for(var j=$(".module[data-handle=collectionCoupon]"),e=0,t=j.length;e<t;e++){var i=j.eq(e);a.BindCollectionCoupon(i)}a.addHrefClick()},addHrefClick:function(){$("a").click(function(){var a=$(this),r=a.attr("href")||"",e=a.parents(".module");r.length>0&&e.length>0&&designUploadPoint(e)})},bindLoginBtnEvent:function(a){var r=a.parents(".module[data-type=registerLogin]").attr("data-login");r&&(r=JSON.parse(r));var e=this;a.on("click",function(){designUploadPoint($(this)),window.player.mobileVideoShow(!1),window.location=location.origin+(window.basePath?"/"+window.basePath+"#/":"/#/")+"login"})},bindRegisterEvent:function(a){var r=this;a.on("click",function(){designUploadPoint($(this)),window.player.mobileVideoShow(!1),l.registerLayer(function(e){e.success&&r.getLoginUser(!0)})})},bindRegisterSchoolEvent:function(a){var r=this;a.on("click",function(){designUploadPoint($(this)),window.player.mobileVideoShow(!1),l.registerSchoolLayer()})},bindQQloginEvent:function(a){var r=this;a.on("click",function(){designUploadPoint($(this)),l.loginQQ()})},bindWechatLoginEvent:function(a){var r=this;a.on("click",function(e){designUploadPoint($(this)),l.qrcodeloginWeChat()})},bindenWechatLoginEvent:function(a){var r=this;a.on("click",function(e){designUploadPoint($(this)),l.qrcodeloginenWeChat()})},binddingdingLoginEvent:function(a){var r=this;a.on("click",function(e){designUploadPoint($(this)),l.qrcodelogindingding()})},bindappLoginEvent:function(a){var r=this;a.on("click",function(e){designUploadPoint($(this)),l.qrcodeloginapp()})},binddialogEvent:function(a){var r=this;a.on("click",function(e){designUploadPoint($(this));var t=a.attr("data-href")?JSON.parse(a.attr("data-href")):{};l.dialogBtnx(t)})},bindWeiboLoginEvent:function(a){var r=this;a.on("click",function(){designUploadPoint($(this)),l.loginWeiBo()})},bindAlipayLoginEvent:function(a){var r=this;a.on("click",function(){designUploadPoint($(this)),l.loginAlipay()})},bindGetPasswodEvent:function(a){var r=this;a.on("click",function(){designUploadPoint($(this)),window.player.mobileVideoShow(!1),l.getPasswordLayer()})},bindGetUsernameEvent:function(a,r){var e=this;a.on("click",function(){designUploadPoint($(this)),l.getUsernameLayer(r)})},bindGetExchangecouponEvent:function(a){var r=this;a.on("click",function(){designUploadPoint($(this)),l.isLogin(function(e){e.success?l.getExchangecoupon():l.loginLayer()})})},bindGoBack:function(a){a.on("click",function(){designUploadPoint($(this)),window.history.go(-1)})},BindQRcode:function(a){a.on("click",function(){designUploadPoint($(this)),l.getQRcodeLayer()})},BindCollectionCoupon:function(a){var r=this;a.on("click",function(e){designUploadPoint($(this)),window.user.useInfo?r.carryCouponEvent(a):l.loginLayer(function(){})})},carryCouponEvent:function(a,r){var e=this,t=JSON.parse(a.attr("data-href")),i=t.data.couponKeys.join(","),s=void 0;if(window.decrypt&&localStorage.encryptId){var o=window.decrypt(localStorage.encryptId).split(",");r?o.length>0&&(s=o[0]):o.length>1&&(s=o[1])}l.getDressUpCouponShareList({couponIds:i,shareId:s},function(d){d.success&&l.getCouponLayer(d.data,{couponIds:i,shareId:s})})},bindGoBuyCar:function(){var a=this;$("[data-event=goBuyCar]").on("click",function(){var r=$(this).parent().attr("data-href");a.loginUserData?a.goBuyCarEvent(r):l.loginLayer(function(e){e.success&&a.goBuyCarEvent(r)})})},goBuyCarEvent:function(a){var r=isJSON(a)?JSON.parse(a):!1;if(!r)return!1;var e=r.data,t=[{goodsId:e.vipId,price:e.price,goodsUrl:location.origin+"/pages/memberDetail.html?vipId="+e.vipId,goodsType:"7",goodsName:e.vipName,cover:e.cover,introduce:e.remark,endTime:e.deadline}];$.ajax({type:"POST",headers:{token:getCookie("token")},url:"/api/order/shoppingCart",contentType:"application/json",dataType:"json",data:JSON.stringify({goodsList:t}),async:!0,success:function(i){i.success&&(location.href="/pay/#/shopping")}})},setclueChannel:function(){var a=this,r=localStorage.appAdapt===!0||localStorage.appAdapt==="true";if(localStorage.uvcid||(localStorage.uvcid=a.getNum()+""+new Date().valueOf()),getCookie("returnreport")!="1"&&!sessionStorage.getItem("pvid")&&sessionStorage.setItem("pvid",a.getNum()+""+new Date().valueOf()),!r){var e=getCookie("Referer")?decodeURIComponent(getCookie("Referer")):document.referrer,t=window.location.origin,i=window.location.href,s=!sessionStorage.getItem("cluechannel"),o=e.indexOf(t)!=0;if(o||s){var d=a.getclueChannel(),m=a.getcluesourceType(),u=m.sourceType,b=m.sourceId,f=new Date().valueOf(),w={desc:"",refer:e.indexOf(t)!=0&&e.indexOf(window.location.host)!=8&&e.indexOf(window.location.host)!=7?encodeURIComponent(e):"",type:h.getValue("channel")||"",internalUrl:encodeURIComponent(i)},y={channel:d,sourceJson:JSON.stringify(w),sourceType:u,sourceId:b,gmtStart:f},x="",g=[""],v=h.getValue("diliater")||"",I=new Base64;I.decode&&(x=h.getValue("shareId")?parseInt(I.decode(h.getValue("shareId"))):""),window.decrypt&&(g=decrypt(v).split(",")),(x||(g.length>1?g[1]:"")||(g.length>0?g[0]:""))&&(y.shareUserId=x||(g.length>1?g[1]:"")||(g.length>0?g[0]:"")),sessionStorage.setItem("cluechannel",JSON.stringify(y)),setCookie("Referer","")}}},getNum:function(){for(var a=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],r="",e=0;e<32;e++){var t=parseInt(Math.random()*61);r+=a[t]}return r},getcluesourceType:function(){var a=this,r=h.getValue("sourceType")||window.information_sourceType||"",e=h.getValue("sourceId")||window.information_sourceId||0,t=window.location.href;return t.indexOf("shop/item.html")>=0&&(r="4",e=h.getValue("itemid")||0),(t.indexOf("designschool/form/answer.html")>=0||t.indexOf("pages/company/answer.html")>=0||t.indexOf("/portal/form.html")>=0)&&(r="5",e=h.getValue("formId")||0),location.pathname.indexOf("pubinfo")>=0&&location.pathname.indexOf("html")>=0&&(r="1",e=e),(t.indexOf("pages/info.html")>=0||t.indexOf("pages/wap/info.html")>=0)&&(r="3",e=h.getValue("cid")||0),(t.indexOf("pages/bundle.html")>=0||t.indexOf("pages/wap/bundle.html")>=0)&&(r="C",e=h.getValue("cid")||0),(t.indexOf("pages/memberDetail.html")>=0||t.indexOf("shop/vipItem.html")>=0)&&(r="D",e=h.getValue("vipId")||h.getValue("itemid")||0),(t.indexOf("pages/ware.html")>=0||t.indexOf("pages/wap/ware.html")>=0)&&(r="B",e=h.getValue("rid")||0),{sourceType:r,sourceId:e}},getclueChannel:function(){var a=this,r=navigator.userAgent.toLowerCase(),e;return window.__wxjs_environment==="miniprogram"?e=4:r.match(/MicroMessenger/i)=="micromessenger"?e=1:localStorage.appAdapt===!0||localStorage.appAdapt==="true"?e=h.getValue("channel")||5:h.getValue("channel")?e=h.getValue("channel"):/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)?e=2:e=3,e},getClientInfo:function(){var a=this;$.ajax({type:"get",url:"/api/common/getClientInfo",data:{},contentType:"application/json;charset=utf-8",dataType:"json",success:function(r){if(r.success){var e=r.data||{},t=e.ip||"";sessionStorage.setItem("sourceip",t)}},error:function(r){console.log("\u63A5\u53E3\u8BF7\u6C42\u5931\u8D25")}})}};if(window.mainHome=c,window.secondShareHtml)var n=setInterval(function(){window.secondShareHtmlSuccess&&(clearInterval(n),c.init())},20);else c.init()});function escape(l){var h=document.createElement("div"),p=document.createTextNode(l);return h.appendChild(p),h.innerHTML}function loadScriptmin(l,h,p){var c=this,n=document.createElement("script");n.type="text/javascript",n.readyState?n.onreadystatechange=function(){(n.readyState=="loaded"||n.readyState=="complete")&&(n.onreadystatechange=null,h.bind(c)(p))}:n.onload=function(){h.bind(c)(p)},n.src=l,document.body.appendChild(n)}function unit(l){return l/37.5+"rem"}(function(l,h){var p={init:function(){var n=this;l(document).ready(function(){setTimeout(function(){n.fixed()},100)}),n.serach(),n.course(),n.courseWare(),n.information(),n.canousel(),n.footerNav(),n.getAjaxRoomInfo(),n.setAnimation(),n.aHrefClick()},fixed:function(){for(var n=this,a=l(".module[data-fixed]"),r=0,e=a.length;r<e;r++){var t=a.eq(r),i=parseInt(t.css("left")),s=t.parent().width(),o=i-s/2;t.attr("data-fixed")=="fixedTop"?t.css({position:"fixed",top:unit(t.attr("data-fixedvalue")),left:"50%",marginLeft:unit(o),zIndex:999}):t.attr("data-fixed")=="fixedBottom"&&t.css({position:"fixed",top:"auto",bottom:unit(t.attr("data-fixedvalue")),left:"50%",marginLeft:unit(o),zIndex:999})}},serach:function(){var n=this;if(n.$search=l(".module[data-type=search]"),n.$search.length<1)return!1;var a="/pages/wap/elective.html";n.miniprogram&&(a="/pages/routine/elective.html");for(var r=0,e=n.$search.length;r<e;r++){var t=n.$search.eq(r);(function(i){var s=i.find(".searchBtn"),o=i.find("input");s.on("click",function(){o.val()?h.location.href=a+"?keyword="+o.val():h.location.href=a})})(t)}},course:function(){var n=this;n.$course=l(".module[data-type=course]");for(var a=0,r=n.$course.length;a<r;a++){var e=n.$course.eq(a);n.getAjaxCourse(e)}},getAjaxCourse:function(n){var a=this,r=n.attr("data-course");if(!r)return!1;var e=JSON.parse(r);e.item=n,l.ajax({type:"get",url:"/api/course/getDressCourseInfoByIds?projectid=12",data:{courseIds:e.courseIds?e.courseIds.join(","):e.courseIds,mainClassify:e.classify[0],childClassify:e.classify[1],beginNum:e.startNum,endNum:e.endNum},contentType:"application/json;charset=utf-8",dataType:"json",success:function(t){t.success&&a.renderCourse(e,t.data)},error:function(t){console.log("\u63A5\u53E3\u8BF7\u6C42\u5931\u8D25")}})},renderCourse:function(n,a){var r="",e,t=this,i=parseInt(n.sNum||0)==1,s=parseInt(n.sTeacher||0)==1,o="/pages/wap";switch(t.miniprogram&&(o="/pages/routine"),n.styleType){case"wzlb":r='<ul class="wzlb">',e=function(f){var w="";return parseInt(f.courseType)==2||parseInt(f.courseType)==4?w=o+"/bundle.html?cid="+f.courseId:w=o+"/info.html?cid="+f.courseId,'<li><a href="'+w+'"><span class="title">'+f.courseName+'</span><span class="teacher">'+f.mainTeacher+"</span></a></li>"};break;case"xtwlb":r='<ul class="xtwlb">',e=function(f){var w="";return parseInt(f.courseType)==2||parseInt(f.courseType)==4?w=o+"/bundle.html?cid="+f.courseId:w=o+"/info.html?cid="+f.courseId,'<li><a href="'+w+'"><img src="'+(window.cdnPath||"")+f.cover+'"/><span class="title">'+f.courseName+"</span>"+(s?'<span class="teacher">'+f.mainTeacher+"</span>":"")+(i?'<span class="curren">'+f.popularityCount+"</span>":"")+"</a></li>"};break;case"twlb":r='<ul class="twlb">',e=function(f){var w="";return parseInt(f.courseType)==2||parseInt(f.courseType)==4?w=o+"/bundle.html?cid="+f.courseId:w=o+"/info.html?cid="+f.courseId,'<li><a href="'+w+'"><img src="'+(window.cdnPath||"")+f.cover+'"/><span class="rser"><span class="title">'+f.courseName+'</span><span class="introduce" >'+f.introduce+"</span>"+(s?'<span class="teacher">'+f.mainTeacher+"</span>":"")+(i?'<span class="curren">'+f.popularityCount+"</span>":"")+"</span></a></li>"};break;case"ttlb":var d="";parseInt(a[0].courseType)==2||parseInt(a[0].courseType)==4?d=o+"/bundle.html?cid="+a[0].courseId:d=o+"/info.html?cid="+a[0].courseId,r='<ul class="ttlb">',r+='<li class="one"><a href="'+d+'"><img src="'+(window.cdnPath||"")+a[0].cover+'"/><span class="rser"><span class="title">'+a[0].courseName+'</span><span class="teacher">'+a[0].mainTeacher+'</span><span class="introduce" style="display:block;">'+a[0].introduce+"</span></span></a></li>",e=function(f){var w="";return parseInt(f.courseType)==2||parseInt(f.courseType)==4?w=o+"/bundle.html?cid="+f.courseId:w=o+"/info.html?cid="+f.courseId,'<li><a href="'+w+'"><span class="title">'+f.courseName+'</span><span class="teacher">'+f.mainTeacher+"</span></a></li>"};break;case"btrqlb":r='<ul class="btrqlb">',e=function(f){var w="";return parseInt(f.courseType)==2||parseInt(f.courseType)==4?w=o+"/bundle.html?cid="+f.courseId:w=o+"/info.html?cid="+f.courseId,'<li><a href="'+w+'"><span class="title">'+f.courseName+'</span><span class="introduce">'+f.introduce+"</span>"+(s?'<span class="teacher">'+f.mainTeacher+"</span>":"")+(i?'<span class="curren">'+f.popularityCount+"</span>":"")+"</a></li>"};break}for(var m=0,u=a.length;m<u;m++)if(!(n.styleType=="ttlb"&&m==0)){var b=a[m];r+=e(b)}r+="</ul>",n.item.html(r)},courseWare:function(){var n=this;n.$courseware=l(".module[data-type=courseware]");for(var a=0,r=n.$courseware.length;a<r;a++){var e=n.$courseware.eq(a);n.getAjaxCourseware(e)}},getAjaxCourseware:function(n){var a=this,r=n.attr("data-courseware");if(!r)return!1;var e=JSON.parse(r);e.item=n,l.ajax({type:"get",url:"/api/course/getCourseWareInfoByIds?projectid=12",data:{courseWareIds:e.courseWareIds?e.courseWareIds.join(","):e.courseWareIds,beginNum:e.startNum,endNum:e.endNum,isIndex:1},contentType:"application/json",dataType:"json",success:function(t){t.success&&a.renderCourseware(e,t.data)},error:function(t){console.log("\u63A5\u53E3\u8BF7\u6C42\u5931\u8D25")}})},isLiveUrl:function(n){var a=n.courseWareType+"",r=n.courseWareId,e=n.courseId,t=n.price,i="",s=!1;switch(a){case"1":s=!0;break;case"2":s=!0;break;case"3":s=!0;break;case"4":s=!0;break;case"5":s=!0;break;default:s=!1}return i=t?"/pages/wap/ware.html?cid="+e+"&rid="+r:"/pages/wap/info.html?cid="+e,i},renderCourseware:function(n,a){var r=this,e="",t=parseInt(n.sNum||0)==1,i=parseInt(n.sTeacher||0)==1,s;switch(n.styleType){case"wzlb":e='<ul class="wzlb">',s=function(u){return'<li><a href="'+r.isLiveUrl(u)+'"><span class="title">'+u.courseWareName+'</span><span class="teacher">'+u.realName+"</span></a></li>"};break;case"xtwlb":e='<ul class="xtwlb">',s=function(u){return'<li><a href="'+r.isLiveUrl(u)+'"><img src="'+(window.cdnPath||"")+u.cover+'"/><span class="title">'+u.courseWareName+"</span>"+(i?'<span class="teacher">'+u.realName+"</span>":"")+(t?'<span class="curren">'+u.popularityCount+"</span>":"")+"</a></li>"};break;case"twlb":e='<ul class="twlb">',s=function(u){return'<li><a href="'+r.isLiveUrl(u)+'"><img src="'+(window.cdnPath||"")+u.cover+'"/><span class="rser"><span class="title">'+u.courseWareName+'</span><span class="introduce">'+u.introduce+"</span>"+(i?'<span class="teacher">'+u.realName+"</span>":"")+(t?'<span class="curren">'+u.popularityCount+"</span>":"")+"</span></a></li>"};break;case"ttlb":e='<ul class="ttlb">',e+='<li class="one"><a href="'+r.isLiveUrl(a[0])+'"><img src="'+(window.cdnPath||"")+a[0].cover+'"/><span class="rser"><span class="title">'+a[0].courseWareName+'</span><span class="teacher">'+a[0].realName+'</span><span class="introduce" style="display:block;">'+a[0].introduce+"</span></span></a></li>",s=function(u){return'<li><a href="'+r.isLiveUrl(u)+'"><span class="title">'+u.courseWareName+'</span><span class="teacher">'+u.realName+"</span></a></li>"};break;case"btrqlb":e='<ul class="btrqlb">',s=function(u){return'<li><a href="'+r.isLiveUrl(u)+'"><span class="title">'+u.courseWareName+'</span><span class="introduce">'+u.introduce+"</span>"+(i?'<span class="teacher">'+u.realName+"</span>":"")+(t?'<span class="curren">'+u.popularityCount+"</span>":"")+"</a></li>"};break;default:}for(var o=0,d=a.length;o<d;o++)if(!(n.styleType=="ttlb"&&o==0)){var m=a[o];e+=s(m)}e+="</ul>",n.item.html(e)},information:function(n){var a=this;a.$article=l(".module[data-type=article]");for(var r=0,e=a.$article.length;r<e;r++){var t=a.$article.eq(r);a.getAjaxArticle(t)}},getAjaxArticle:function(n){var a=this,r=n.attr("data-article");if(!r)return!1;var e=JSON.parse(r);e.item=n,l.ajax({type:"get",url:"/api/disk/firstHomepageDetail?projectid=12",data:{InfoTypeId:e.classify[e.classify.length-1],beginNum:e.startNum,endNum:e.endNum,isAll:e.isAll,sNum:e.sNum,sTeacher:e.sTeacher},contentType:"application/json",dataType:"json",success:function(t){t.success&&a.renderArticle(e,t.data)},error:function(t){console.log("\u63A5\u53E3\u8BF7\u6C42\u5931\u8D25")}})},getTimeString:function(n){if(new Date(parseInt(n))=="Invalid Date"&&new Date(parseInt(n)*1e3)=="Invalid Date")return"--";var a=new Date(parseInt(n)),r=a.getFullYear(),e=a.getMonth()+1,t=a.getDate();return r+"-"+e+"-"+t},renderArticle:function(n,a){var r=this,e="",t,i=function(v){return r.miniprogram?"/pages/routine/information.html?aid="+v:(location.port=="81","/pubinfo/"+v+".shtml")},s=function(v){for(var I="",C=0,k=v.length;C<k;C++){var T=v[C]||v[0];I+='<img src="'+((window.cdnPath||"")+T.sourcePath)+'"/>'}return I},o=parseInt(n.sNum||0)==1,d=parseInt(n.sTitle||0)==1,m=parseInt(n.sDate||0)==1,u=function(v){return n.sTitle?'<span class="title moreTitle">'+v.title+"</span>":'<span class="title">'+v.title+'</span><span class="introduce" >'+v.introduce+"</span>"},b=function(v){return n.sDate?'<span class="teacher">'+r.getTimeString(v.gmtCreate)+"</span>":""},f=function(v){return n.sNum?'<span class="curren">'+v.viewCount+"</span>":""};switch(n.styleType){case"xtwlb":e='<ul class="xtwlb">',t=function(v){return'<li><a href="'+i(v.infoID)+'"><img src="'+(window.cdnPath||"")+v.computerSinglePicPath+'"/><span class="title">'+v.title+"</span>"+b(v)+f(v)+"</a></li>"};break;case"twlb":e='<ul class="twlb">',t=function(v){return'<li><a href="'+i(v.infoID)+'"><img src="'+(window.cdnPath||"")+v.computerSinglePicPath+'"/><span class="rser">'+u(v)+b(v)+f(v)+"</span></a></li>"};break;case"btrqlb":e='<ul class="btrqlb">',t=function(v){return'<li><a href="'+i(v.infoID)+'">'+u(v)+b(v)+f(v)+"</a></li>"};break;default:}for(var w=document.createElement("div"),y=0,x=a.length;y<x;y++){var g=a[y];g.computerPicPath=g.computerPicPath?JSON.parse(g.computerPicPath):"/design/designstatic/common/image/information/defult.jpg",g.computerSinglePicPath=g.computerPicPath?g.computerPicPath[0].sourcePath:"/design/designstatic/common/image/information/defult.jpg",w.innerHTML=g.detail,g.detail=w.innerText,e+=t(g,y)}e+="</ul>",n.item.html(e)},getAjaxRoomInfo:function(n){var a=this;l.ajax({type:"get",url:"/api/disk/home?projectid=12",dataType:"json",success:function(r){r.success&&(window.roominfo=r.data,a.roominfo=r.data,a.Render(r.data))}})},Render:function(n){var a=this;a.summary(n.introduction),a.QRcode(n.wechatQRCode),a.logo(n.logo),a.documentTitle(n),a.headerNav(),setTimeout(function(){a.showLoginModal(n.loginPopup)},200)},showLoginModal:function(n){var a=sessionStorage.getItem("loginPopup")||0;sessionStorage.setItem("loginPopup",1);var r=function(){window.user&&window.user.loginLayer(function(e){parseInt(e.code)==200&&e.success&&window.location.reload()})};!a&&n&&window.user&&window.user.isLogin(function(e){e.success||r()})},summary:function(n){var a=this;if(a.$introduce=l(".module[data-type=introduce]"),a.$introduce.length<1)return!1;for(var r=0,e=a.$introduce.length;r<e;r++){var t=a.$introduce.eq(r);t.find(".box").html(n)}},QRcode:function(n){var a=this;if(a.$qrcode=l(".module[data-type=qrcode]"),a.$qrcode.length<1)return!1;for(var r=0,e=a.$qrcode.length;r<e;r++){var t=a.$qrcode.eq(r);t.find("img").attr("src",n)}},logo:function(n){var a=this;if(a.$logo=l(".module[data-type=logo]"),a.$logo.length<1)return!1;for(var r=0,e=a.$logo.length;r<e;r++){var t=a.$logo.eq(r);t.find("img").attr("src",n)}},documentTitle:function(n){var a=this,r=l("title"),e=a.getStrCount(window.location.pathname,"/")==1&&location.href.indexOf(".shtml")>=0,t=window.location.pathname.indexOf("information/")>=0||window.location.pathname.indexOf("informationx.html")>=0||window.location.pathname.indexOf("/business")>=0||window.location.pathname.indexOf("designschool/form/answer.html")>=0||window.location.pathname.indexOf("pages/company/answer.html")>=0;if(!(t||e)){if(!r)return!1;var i;window.location.pathname.indexOf("/pages/getcoupons.html")<0&&(n.subhead?window.location.pathname=="/"?i=n.schoolName+"-"+n.subhead:i=r.text():i=n.schoolName),r.html(i),a.title=i}},getStrCount:function(n,a){for(var r=0;n.indexOf(a)!=-1;)n=n.replace(a,""),r++;return r},getValue:function(n){var a=a||window.location.href,r=a.split("?");if(r.length==1)return null;if(r.length==2){for(var o=r[1].split("&"),d={},e=0;e<o.length;e++){var t=o[e].split("=");d[t[0]]=t[1]}return d[n]?d[n]:!1}if(r.length==3){for(var o=r[1].split("&"),i=!1,d={},e=0,s=o.length;e<s;e++){var t=o[e].split("=");d[t[0]]=t[1],e+1==s&&t[0]==n&&(i=!0)}return d[n]?i?d[n]+"?"+r[2]:d[n]:!1}for(var o=r[1].split("&"),d={},e=0;e<o.length;e++){var t=o[e].split("=");d[t[0]]=t[1]}return d[n]?d[n]:!1},canousel:function(){var n=this;n.$carousel=l(".module[data-type=carousel]");for(var a=0,r=n.$carousel.length;a<r;a++){var e=n.$carousel.eq(a);n.renderCanousel(e)}},renderCanousel:function(n){var a=this,r=n[0],e=n.attr("data-mid");n.html('<div class="img_ul"></div><div class="barbox"></div>');var t=n.find(".img_ul"),i=n.attr("data-canousel");if(!i)return!1;var s=l.parseJSON(i),o=s.list,d=n.find(".barbox");s.nav&&a.renderCanouselBarbox(d,o);var m=o.length,u=parseFloat(n[0].style.width)||10,b=s.playTime*1e3,f=s.changeTime,w=s.adapt,y=0,d=n.find(".barbox"),x="";if(m==1){var g=o[0];x+='<div class="img_li" style="width: '+u+'rem;height:100%;left: 0rem;"><a '+(g.href?'href="'+g.href+'"':"")+'><div class="'+w+'" style="background-image: url('+g.path+');width:100%;height:100%;"></div></a></div>',d.hide()}else if(m==2)for(var v=0;v<4;v++){var g=o[v%2];v==3?x+='<div class="img_li" style="width: '+u+"rem;height:100%;left:"+-u+'rem;"><a '+(g.href?'href="'+g.href+'"':"")+'><div class="'+w+'" style="background-image: url('+g.path+');width:100%;height:100%;"></div></a></div>':x+='<div class="img_li" style="width: '+u+"rem;height:100%;left:"+u*v+'rem;"><a '+(g.href?'href="'+g.href+'"':"")+'><div class="'+w+'" style="background-image: url('+g.path+');width:100%;height:100%;"></div></a></div>'}else for(var v=0;v<m;v++){var g=o[v];v==m-1?x+='<div class="img_li" style="width: '+u+"rem;height:100%;left:"+-u+'rem;"><a '+(g.href?'href="'+g.href+'"':"")+'><div class="'+w+'" style="background-image: url('+g.path+');width:100%;height:100%;"></div></a></div>':x+='<div class="img_li" style="width: '+u+"rem;height:100%;left:"+u*v+'rem;"><a '+(g.href?'href="'+g.href+'"':"")+'><div class="'+w+'" style="background-image: url('+g.path+');width:100%;height:100%;"></div></a></div>'}t.html(x);var I=n.find(".img_li"),C=I.length,k=d.find("li");k.eq(y).addClass("on"),s.nav&&a.animatesCanoousel(d,y);function T(){s.nav&&a.animatesCanoousel(d,y%m),clearTimeout(a["carInter"+e]),a["carInter"+e]=setTimeout(function(){y++,t.css({transform:"translateX("+-y*u+"rem)","-webkit-transform":"translateX("+-y*u+"rem)","transition-duration":f+"s","-webkit-transition-duration":f+"s"}),k.removeClass("on"),m==2?k.eq(y%2).addClass("on"):k.eq(y%C).addClass("on"),L(y+1),T()},b)}function L(S){var O=S%C;I.eq(O).css("left",S*u+"rem")}var P=parseFloat(l("html").css("fontSize"));if(m>=2){T();var j=0,N=0;r.addEventListener("touchstart",function(S){var O=S.targetTouches[0];j=O.pageX,clearInterval(a["carInter"+e])}),r.addEventListener("touchmove",function(S){S.preventDefault();var O=S.targetTouches[0];N=(O.pageX-j)/P,t.css({transform:"translateX("+(N-y*u)+"rem)","-webkit-transform":"translateX("+(N-y*u)+"rem)","transition-duration":"0s","-webkit-transition-duration":"0s"}),N>.5&&S.preventDefault()}),r.addEventListener("touchend",function(S){clearTimeout(a["carTimeout"+e]),N*N>9&&(N<-.5?(y++,L(y+1)):N>.5&&(y--,L(y-1))),t.css({transform:"translateX("+-y*u+"rem)","-webkit-transform":"translateX("+-y*u+"rem)","transition-duration":f/2+"s","-webkit-transition-duration":f/2+"s"}),k.removeClass("on"),m==2?k.eq(y%2).addClass("on"):k.eq(y%C).addClass("on"),a["carTimeout"+e]=setTimeout(function(){T()},f*1e3/2)})}},renderCanouselBarbox:function(n,a){for(var r=this,e="",t=0,i=a.length;t<i;t++)e+='<span class="li"></span>';n.html(e)},animatesCanoousel:function(n,a){var r=n.find(".li");n.find(".on").removeClass("on"),r.eq(a).addClass("on")},footerNav:function(){var n=this;n.$footerNav=l(".module[data-type=footerNav]");for(var a=0,r=n.$footerNav.length;a<r;a++){var e=n.$footerNav.eq(a);n.renderFooterNav(e)}},isOnHref:function(n){var a=!1;return n&&(h.location.href==h.location.origin+n||h.location.pathname==n&&h.location.href.indexOf("mainClassify")<0||h.location.href.indexOf(n)>-1&&n.indexOf("mainClassify")>-1||n=="/comment/#"&&h.location.href.indexOf("/comment/#")>-1)&&(a=!0),a},renderFooterNav:function(n){var a=this,r=n.find("li"),e=n.attr("data-footernav");e&&(e=JSON.parse(e)),r.removeClass("on");for(var t=0,i=r.length;t<i;t++){var s=r.eq(t);s.find("span").removeAttr("style");var o=s.find("a"),d=o.attr("href");a.isOnHref(d)&&(s.addClass("on"),e&&e.color&&s.find("span").css("color",e.color))}},setAnimation:function(){var n=this;n.animArr=[];for(var a=l(".module"),r=0,e=a.length;r<e;r++){var t=a.eq(r),i=t.css("animationName");i!="none"&&(t.css("animationIterationCount")!="infinite"&&(t.attr("data-kui-anim",i),t.css("animationName","")),n.animArr.push(t))}},aHrefClick:function(){for(var n=l("a[href]"),a=[],r=0,e=n.length;r<e;r++){var t=n.eq(r);(t.attr("href").indexOf("/aroom/#")>-1||t.attr("href").indexOf("/myroom/#")>-1&&t.attr("href").indexOf("/nolimit")<0||t.attr("href").indexOf("/pay/#")>-1)&&(t.attr("clickUrl",t.attr("href")),t.removeAttr("href"))}l("a[clickUrl]").on("click",function(i){var s=window.user,o=l(this).attr("clickUrl"),d=function(u){u=="STUDENT"?o.indexOf("/pay/#")>-1?window.location.href=o.indexOf("/pay/#/")>-1?o:window.basePath?"/"+window.basePath+"#/":"/#/":window.location.href=o.indexOf("/myroom/#/")>-1?o:window.basePath?"/"+window.basePath+"#/":"/#/":window.location.href=o.indexOf("/aroom/#/")>-1?o:window.basePath?"/"+window.basePath+"#/":"/#/"},m=function(){window.player.mobileVideoShow(!1),s.loginLayer(function(u){u.success&&s.isLogin(function(b){b.success&&d(b.data.userTypeExact)})})};getCookie("token")||getCookie("stoken")?s.isLogin(function(u){u.success?d(u.data.userTypeExact):m()}):m()})},headerNav:function(){for(var n=this,a=l(".module[data-type=headerNav]"),r=0,e=a.length;r<e;r++)n.renderHeaderNav(a.eq(r))},renderHeaderNav:function(n){var a=this;if(!n.attr("data-headernav"))return!1;for(var r=JSON.parse(n.attr("data-headernav")),e="drawer-"+n.attr("data-mid"),t='<div id="'+e+'" class="drawer drawer-'+r.openStyle+'"><style>#'+e+" .drawer-content *{color:"+r.textColor+";}#"+e+" .drawer-content a{color:"+r.textColor+";}#"+e+" .drawer-content {background-color:"+r.moduleColor+";}#"+e+" .drawer-title, #"+e+" li{ height: "+unit(r.linesHeight)+";line-height: "+unit(r.linesHeight)+';}</style><div class="drawer-mask"></div><div class="drawer-content" ><div class="drawer-title"><img src="" /><span>'+window.roominfo.schoolName+window.roominfo.subhead+'</span></div><ul class="drawer-menu"><div class="menuheight">',i=0,s=r.list.length;i<s;i++){var o=r.list[i];o.href.url&&o.href.url.indexOf("handle-")>-1?t+='<a data-handle="'+o.href.url.split("handle-")[1]+'"><li>'+(o.before?'<img src="'+o.before+'"/>':"")+"<span>"+o.name+"</span></li></a>":t+='<a href="'+o.href.url+'"><li>'+(o.before?'<img src="'+o.before+'"/>':"")+"<span>"+o.name+"</span></li></a>"}t+="</div></ul></div></div>",l("body").append(t);var d=l("#"+e),m=d.find(".drawer-menu"),u=m.find(".menuheight").height()-m.height(),b=!1,f,w,y;d.on("touchstart",function(x){w=x.originalEvent.targetTouches[0].pageY,u>0&&(f=setInterval(function(){b=!1,w<y?m.scrollTop()==0&&(b=!0):m.scrollTop()>=u&&(b=!0)},20))}),d.on("touchend",function(x){clearInterval(f)}),d.on("touchmove",function(x){u<0?x.preventDefault():b?(y=x.originalEvent.targetTouches[0].pageY,x.preventDefault()):(y=x.originalEvent.targetTouches[0].pageY,window.event.returnValue=!0)}),d.on("click",".drawer-mask",function(x){d.removeClass("drawer-open"),window.player&&window.player.mobileVideoShow(!0)}),d.on("click","a[data-handle]",function(x){d.removeClass("drawer-open")}),n.on("click",function(x){d.addClass("drawer-open"),d.find(".drawer-title span").text(a.title),a.roominfo&&d.find(".drawer-title img").attr("src",(window.cdnPath||"")+a.roominfo.logo),window.player&&window.player.mobileVideoShow(!1)})}};if(window.secondShareHtml)var c=setInterval(function(){window.secondShareHtmlSuccess&&(clearInterval(c),p.init())},20);else p.init();h.getWapRoom=p})(jQuery,window),document.write('<script type="text/javascript" charset="utf-8" src="/design/designstatic/home/js/scrollanim.min.js"></script>'),!window.getPage&&!window.secondShareHtml&&document.write('<script type="text/javascript" charset="utf-8" src="/design/designstatic/home/waphome/js/setPage.js"></script>'),function(l,h){if(h.player)return!1;h.player={init:function(){var p=this;p.getVideoDatas()},getVideoDatas:function(){var p=this;p.playElement=l(".module[data-type=player]"),p.playerdatas=[];for(var c=0,n=p.playElement.length;c<n;c++){var a=p.playElement.eq(c),r=l.parseJSON(a.attr("data-player"));p.getCreateVideoConfig(a,r)}},getCreateVideoConfig:function(p,c){var n=this,n=this,a="player"+p.attr("data-mid");p.find(".box").attr("id",a);var r=parseInt(p.css("width")),e=parseInt(p.css("height"));n.playParams={playerId:a,playMenus:c.list,designId:c.designId,autoPlay:c.play,playIndex:0,width:r,height:e},n.getVedioUrl(),p.find("li").on("click",function(){n.playParams.playIndex=l(this).index(),n.getVedioUrl()})},getVedioUrl:function(){var p=this,c=p.playParams,n=c.playIndex,a=c.playMenus[n].videoid,r=c.playMenus[n].sourceId;l.ajax({type:"get",url:"/api/course/getCourseWareInfoByIds?projectid=12",data:{courseWareIds:a,isIndex:1},contentType:"application/json",dataType:"json",success:function(e){e.success&&p.carryVideo(c,e.data[0],r)}})},carryVideo:function(p,c,n){var a=this,r="";if(p.designId)r="/api/common/mu/getDesignFreeM3u8.m3u8?courseWareId="+c.courseWareId+"&designId="+p.designId+(n?"&sourceId="+n:"");else if(r=c.videoM3u8FileAddress,!r)return layer?layer.open({content:"\u5F53\u524D\u89C6\u9891\u4E0D\u5B58\u5728\u5931\u8D25",skin:"msg",time:2}):setTimeout(function(){layer.open({content:"\u5F53\u524D\u89C6\u9891\u4E0D\u5B58\u5728\u5931\u8D25",skin:"msg",time:2})},100),!1;var e='<video id="moduleVideoID" style="display:block;" controls="controls" poster="'+c.cover+'" width="'+p.width+'" height="'+p.height+'" x5-playsinline="" playsinline="true" webkit-playsinline="true" tabindex="-1" autoplay="true" oncontextmenu="return false" src="'+r+'"></video>',t=l("#"+p.playerId);t.html(e);var i=t.find("video").eq(0),s=!1;t.on("click",function(){var o=i[0].paused,d=i[0].ended;s&&!d&&!o?(i.css({display:"none"}),i[0].pause()):(i.css({display:"block"}),i[0].play()),s=!0})},mobileVideoShow:function(p){for(var c=l(document).find("video"),n=0,a=c.length;n<a;n++){var r=c.eq(n);p?r[0].prePause&&(r[0].play(),r.css({display:"block"}),r[0].prePause=!1):(r[0].pause(),r[0].prePause=!0,r.css({display:"none"}))}}},h.player.init()}(jQuery,window);function getCookie(l){for(var h=document.cookie,p=h.split("; "),c=0;c<p.length;c++){var n=p[c].split("=");if(n[0]==l)return n[1]}return""}function designUploadPoint(l,h){try{var p=l.data("mid")||"",c=l.data("type")||"",n=l.data("handle")||"",a=l.find("a"),r=a.attr("href")||"",e=l.clone();e.find("style").remove();var t=e.text()||"";t=t.replace(/[\r\n]/g,""),t=t.replace(/\ +/g,"");var i=window.location.hostname,s=window.location.pathname,o={id:p,type:c,text:t,handle:n,pageTo:r,hostname:i}}catch(d){console.log("designUploadPoint:",d)}}function Base64(){var l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";this.encode=function(c){var n="",a,r,e,t,i,s,o,d=0;for(c=h(c);d<c.length;)a=c.charCodeAt(d++),r=c.charCodeAt(d++),e=c.charCodeAt(d++),t=a>>2,i=(a&3)<<4|r>>4,s=(r&15)<<2|e>>6,o=e&63,isNaN(r)?s=o=64:isNaN(e)&&(o=64),n=n+l.charAt(t)+l.charAt(i)+l.charAt(s)+l.charAt(o);return n},this.decode=function(c){var n="",a,r,e,t,i,s,o,d=0;for(c=c.replace(/[^A-Za-z0-9\+\/\=]/g,"");d<c.length;)t=l.indexOf(c.charAt(d++)),i=l.indexOf(c.charAt(d++)),s=l.indexOf(c.charAt(d++)),o=l.indexOf(c.charAt(d++)),a=t<<2|i>>4,r=(i&15)<<4|s>>2,e=(s&3)<<6|o,n=n+String.fromCharCode(a),s!=64&&(n=n+String.fromCharCode(r)),o!=64&&(n=n+String.fromCharCode(e));return n=p(n),n};var h=function(c){c=c.replace(/\r\n/g,`
`);for(var n="",a=0;a<c.length;a++){var r=c.charCodeAt(a);r<128?n+=String.fromCharCode(r):r>127&&r<2048?(n+=String.fromCharCode(r>>6|192),n+=String.fromCharCode(r&63|128)):(n+=String.fromCharCode(r>>12|224),n+=String.fromCharCode(r>>6&63|128),n+=String.fromCharCode(r&63|128))}return n},p=function(c){for(var n="",a=0,r=0,e=0,t=0,i=0;a<c.length;)r=c.charCodeAt(a),r<128?(n+=String.fromCharCode(r),a++):r>191&&r<224?(t=c.charCodeAt(a+1),n+=String.fromCharCode((r&31)<<6|t&63),a+=2):(t=c.charCodeAt(a+1),i=c.charCodeAt(a+2),n+=String.fromCharCode((r&15)<<12|(t&63)<<6|i&63),a+=3);return n}}