filesbox/web/dist/design/mobile/js/module.big.js
2024-07-26 14:10:54 +08:00

2 lines
35 KiB
JavaScript

(function(l,g){var h=navigator.userAgent;if(!i||s)return!1;var f=l("html"),r=f.width()/10,a=parseFloat(f.css("fontSize")),n=r/a,e=r*n;t(),l(document).ready(function(){t(),setTimeout(function(){t()},300)});function t(){if(e==1)return!1;f.css("fontSize",r+"px"),l("meta[name=viewport]").attr("content","initial-scale="+n+", maximum-scale="+n+", minimum-scale="+n+", user-scalable=no")}function i(){return/(Android).*/i.test(h)}function s(){return/MiuiBrowser/ig.test(h)}})(jQuery,window),function(l,g){var h={init:function(){var f=this;f.getValue("token")&&(f.setCookie("token",f.getValue("token")),f.setCookie("openid",f.getValue("openid"))),g.location.href.indexOf("/mp/index.shtml")>-1||g.location.href.indexOf("/pages/routine/")>-1?(f.miniprogram=!0,localStorage.miniprogram=!0):(f.miniprogram=!1,localStorage.miniprogram=!1)},getValue:function(f){var r=r||window.location.href,a=r.split("?");if(a.length==1)return null;if(a.length==2){for(var s=a[1].split("&"),o={},n=0;n<s.length;n++){var e=s[n].split("=");o[e[0]]=e[1]}return o[f]?o[f]:!1}if(a.length==3){for(var s=a[1].split("&"),t=!1,o={},n=0,i=s.length;n<i;n++){var e=s[n].split("=");o[e[0]]=e[1],n+1==i&&e[0]==f&&(t=!0)}return o[f]?t?o[f]+"?"+a[2]:o[f]:!1}for(var s=a[1].split("&"),o={},n=0;n<s.length;n++){var e=s[n].split("=");o[e[0]]=e[1]}return o[f]?o[f]:!1},setCookie:function(f,r){var a=f+"="+r+";path=/";document.cookie=a}};h.init(),window.tokenjs=h}(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="//res.wx.qq.com/open/js/jweixin-1.6.0.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,g=window.tokenjs,h=window.player,f={init:function(){if(g.getValue("errorCode")){var a=parseInt(g.getValue("errorCode")),n="";switch(a){case 602:n="\u975E\u7F51\u6821\u7528\u6237\u7981\u6B62\u767B\u5F55";break;case 606:n="\u5F53\u524D\u8D26\u53F7\u4E0D\u5B58\u5728";break;case 509:n="\u5DF2\u5F00\u542F\u8BBE\u5907\u9650\u5236\uFF0C\u60A8\u53EA\u80FD\u5728\u56FA\u5B9A\u8BBE\u5907\u4E0A\u8FDB\u884C\u767B\u5F55";break;case 601:n="\u5DF2\u7ED1\u5B9A\u5176\u4ED6\u8D26\u53F7";break;case 602:n="\u7528\u6237\u8D26\u53F7\u88AB\u9501\u5B9A";break;case 606:n="\u7528\u6237\u8D26\u53F7\u88AB\u5220\u9664";break;case 707:n="\u60A8\u5DF2\u88AB\u7981\u6B62\u767B\u5F55";break}n&&(layer?layer.open({content:n,skin:"msg",time:2}):alert(n)),window.history.replaceState(null,null,"/")}var e=this;e.getLoginUser(),setTimeout(function(){e.handleBtn()},0),g.getValue("redirectUrl")&&!getCookie("token")&&l.loginLayer(function(s){s.success&&(window.location.href=g.getValue("redirectUrl"))}),g.getValue("redirect")&&!getCookie("token")&&l.loginLayer(function(s){s.success&&(window.location.href=g.getValue("redirect")+"?cwid="+g.getValue("cwid")+"&courseId="+g.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()},getLoginUser:function(a){var n=this;getCookie("token")?l.isLogin(function(e){e.success?(n.loginUserData=e.data,n.login(e.data,e.timeStamp),a&&!l.loginAfterJump&&(e.data.userTypeExact=="STUDENT",window.location.href=window.basePath?"/"+window.basePath+"#/":"/#/")):n.carryStorageLogin()}):n.carryStorageLogin()},carryStorageLogin:function(){var a=this;if(localStorage.isSaveAPWordKey&&window.decrypt){var n=decrypt(localStorage.isSaveAPWordKey),e=JSON.parse(n),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 v=o.message;switch(parseInt(o.code)){case 200:v="\u5BC6\u7801\u6216\u8D26\u53F7\u4E0D\u6B63\u786E\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165";break;case 400:v="\u8BE5\u7F51\u6821\u9700\u8981\u4F7F\u7528\u9501\u5C4F\u6D4F\u89C8\u5668\u767B\u5F55";break;case 403:v="\u8D26\u53F7\u7C7B\u578B\u4E0D\u6B63\u786E";break;case 503:v="\u5DF2\u88AB\u9650\u5236\u767B\u5F55";break;case 707:v="\u60A8\u5DF2\u88AB\u7981\u6B62\u767B\u5F55";break}if(o.success){var p=o.data;if(p){var c=p.errCode;c=="4012"?v="\u8D85\u8FC7\u9650\u5236\u6B21\u6570"+p.limitCount+"\u6B21\uFF0C\u8BF7"+p.denyTime/60+"\u5206\u949F\u540E\u91CD\u8BD5":v="\u5BC6\u7801\u6216\u8D26\u53F7\u4E0D\u6B63\u786E\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165"}else v="\u5BC6\u7801\u6216\u8D26\u53F7\u4E0D\u6B63\u786E\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165"}window.layer?layer.msg(v,{icon:1}):alert(v)}})}},login:function(a,n){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 v=t.eq(s),p='<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>';v.find(".box").html(p)}$(".quitBtn").on("click",function(){window.player.mobileVideoShow(!1),l.loginout(function(c){c.success&&window.location.reload()})})},handleBtn:function(){for(var a=this,n=$("[data-handle=login]"),e=0,t=n.length;e<t;e++){var i=n.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 v=$("[data-type=registerLogin] .registerEvent"),e=0,t=v.length;e<t;e++){var i=v.eq(e);a.bindRegisterEvent(i)}for(var p=$("[data-handle=registerSchool]"),e=0,t=p.length;e<t;e++){var i=p.eq(e);a.bindRegisterSchoolEvent(i)}for(var c=$("[data-handle=QQlogin]"),e=0,t=c.length;e<t;e++){var i=c.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 u=$(".module[data-handle=enwechatLogin]"),e=0,t=u.length;e<t;e++){var i=u.eq(e);a.bindenWechatLoginEvent(i)}for(var d=$(".module[data-handle=dingdingLogin]"),e=0,t=d.length;e<t;e++){var i=d.eq(e);a.binddingdingLoginEvent(i)}for(var m=$(".module[data-handle=appLogin]"),e=0,t=m.length;e<t;e++){var i=m.eq(e);a.bindappLoginEvent(i)}for(var w=$(".module[data-handle=dialogBtn]"),e=0,t=w.length;e<t;e++){var i=w.eq(e);a.binddialogEvent(i)}for(var y=$("[data-handle=weiboLogin]"),e=0,t=y.length;e<t;e++){var i=y.eq(e);a.bindWeiboLoginEvent(i)}for(var k=$("[data-handle=alipayLogin]"),e=0,t=k.length;e<t;e++){var i=k.eq(e);a.bindAlipayLoginEvent(i)}for(var N=$("[data-handle=getPasswod]"),e=0,t=N.length;e<t;e++){var i=N.eq(e);a.bindGetPasswodEvent(i)}for(var S=$("[data-handle=getUsername]"),e=0,t=S.length;e<t;e++){var i=S.eq(e),I=S.eq(e).attr("data-designId");a.bindGetUsernameEvent(i,I)}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 q=$(".module[data-handle=collectionCoupon]"),e=0,t=q.length;e<t;e++){var i=q.eq(e);a.BindCollectionCoupon(i)}a.addHrefClick()},addHrefClick:function(){$("a").click(function(){var a=$(this),n=a.attr("href")||"",e=a.parents(".module");n.length>0&&e.length>0&&designUploadPoint(e)})},bindLoginBtnEvent:function(a){var n=a.parents(".module[data-type=registerLogin]").attr("data-login");n&&(n=JSON.parse(n));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 n=this;a.on("click",function(){designUploadPoint($(this)),window.player.mobileVideoShow(!1),l.registerLayer(function(e){e.success&&n.getLoginUser(!0)})})},bindRegisterSchoolEvent:function(a){var n=this;a.on("click",function(){designUploadPoint($(this)),window.player.mobileVideoShow(!1),l.registerSchoolLayer()})},bindQQloginEvent:function(a){var n=this;a.on("click",function(){designUploadPoint($(this)),l.loginQQ()})},bindWechatLoginEvent:function(a){var n=this;a.on("click",function(e){designUploadPoint($(this)),l.qrcodeloginWeChat()})},bindenWechatLoginEvent:function(a){var n=this;a.on("click",function(e){designUploadPoint($(this)),l.qrcodeloginenWeChat()})},binddingdingLoginEvent:function(a){var n=this;a.on("click",function(e){designUploadPoint($(this)),l.qrcodelogindingding()})},bindappLoginEvent:function(a){var n=this;a.on("click",function(e){designUploadPoint($(this)),l.qrcodeloginapp()})},binddialogEvent:function(a){var n=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 n=this;a.on("click",function(){designUploadPoint($(this)),l.loginWeiBo()})},bindAlipayLoginEvent:function(a){var n=this;a.on("click",function(){designUploadPoint($(this)),l.loginAlipay()})},bindGetPasswodEvent:function(a){var n=this;a.on("click",function(){designUploadPoint($(this)),window.player.mobileVideoShow(!1),l.getPasswordLayer()})},bindGetUsernameEvent:function(a,n){var e=this;a.on("click",function(){designUploadPoint($(this)),l.getUsernameLayer(n)})},bindGetExchangecouponEvent:function(a){var n=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 n=this;a.on("click",function(e){designUploadPoint($(this)),window.user.useInfo?n.carryCouponEvent(a):l.loginLayer(function(){})})},carryCouponEvent:function(a,n){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(",");n?o.length>0&&(s=o[0]):o.length>1&&(s=o[1])}l.getDressUpCouponShareList({couponIds:i,shareId:s},function(v){v.success&&l.getCouponLayer(v.data,{couponIds:i,shareId:s})})},bindGoBuyCar:function(){var a=this;$("[data-event=goBuyCar]").on("click",function(){var n=$(this).parent().attr("data-href");a.loginUserData?a.goBuyCarEvent(n):l.loginLayer(function(e){e.success&&a.goBuyCarEvent(n)})})},goBuyCarEvent:function(a){var n=this,e=isJSON(a)?JSON.parse(a):!1;if(!e)return!1;var t=e.data,i="",s=[""],o=n.getValue("diliater")||"";window.base64&&(i=n.getValue("shareId")?base64.decode(n.getValue("shareId")):""),window.decrypt&&(s=decrypt(o).split(","));var v=[{goodsId:t.vipId,price:t.price,goodsUrl:location.origin+"/pages/memberDetail.html?vipId="+t.vipId,goodsType:"7",goodsName:t.vipName,cover:t.cover,introduce:t.remark,endTime:t.deadline}];$.ajax({type:"POST",headers:{token:getCookie("token")},url:"/api/order/shoppingCart",contentType:"application/json",dataType:"json",data:JSON.stringify({goodsList:v,clientType:n.getclueChannel(),shareUserId:i||(s.length>1?s[1]:""),pvid:sessionStorage.pvid,uvcid:localStorage.uvcid}),async:!0,success:function(p){p.success&&(location.href="/pay/#/shopping")}})},getclueChannel:function(){var a=this,n=navigator.userAgent.toLowerCase(),e;if(window.__wxjs_environment==="miniprogram")e=4;else if(n.match(/MicroMessenger/i)=="micromessenger"){var t={win:!1,mac:!1},i=navigator.platform;t.win=i.indexOf("Win")==0,t.mac=i.indexOf("Mac")==0,t.win||t.mac?e=9:e=1}else localStorage.appAdapt===!0||localStorage.appAdapt==="true"?e=a.getValue("channel")||5:a.getValue("channel")?e=a.getValue("channel"):/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)?e=2:e=3;return e}};if(window.mainHome=f,window.secondShareHtml)var r=setInterval(function(){window.secondShareHtmlSuccess&&(clearInterval(r),f.init())},20);else f.init()});function escape(l){var g=document.createElement("div"),h=document.createTextNode(l);return g.appendChild(h),g.innerHTML}function loadScriptmin(l,g,h){var f=this,r=document.createElement("script");r.type="text/javascript",r.readyState?r.onreadystatechange=function(){(r.readyState=="loaded"||r.readyState=="complete")&&(r.onreadystatechange=null,g.bind(f)(h))}:r.onload=function(){g.bind(f)(h)},r.src=l,document.body.appendChild(r)}function unit(l){return l/37.5+"rem"}(function(l,g){var h={init:function(){var r=this;l(document).ready(function(){setTimeout(function(){r.fixed()},100)}),r.serach(),r.course(),r.courseWare(),r.information(),r.getAjaxRoomInfo(),r.canousel(),r.footerNav(),r.setAnimation(),r.headerNav(),r.aHrefClick()},fixed:function(){for(var r=this,a=l(".module[data-fixed]"),n=0,e=a.length;n<e;n++){var t=a.eq(n),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 r=this;if(r.$search=l(".module[data-type=search]"),r.$search.length<1)return!1;var a="/pages/wap/elective.html";r.miniprogram&&(a="/pages/routine/elective.html");for(var n=0,e=r.$search.length;n<e;n++){var t=r.$search.eq(n);(function(i){var s=i.find(".searchBtn"),o=i.find("input");s.on("click",function(){o.val()?g.location.href=a+"?keyword="+o.val():g.location.href=a})})(t)}},course:function(){var r=this;r.$course=l(".module[data-type=course]");for(var a=0,n=r.$course.length;a<n;a++){var e=r.$course.eq(a);r.getAjaxCourse(e)}},getAjaxCourse:function(r){var a=this,n=r.attr("data-course");if(!n)return!1;var e=JSON.parse(n);e.item=r,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(r,a){var n="",e,t=this,i=parseInt(r.sNum||0)==1,s=parseInt(r.sTeacher||0)==1,o="/pages/wap";switch(t.miniprogram&&(o="/pages/routine"),r.styleType){case"wzlb":n='<ul class="wzlb">',e=function(u){var d="";return parseInt(u.courseType)==2||parseInt(u.courseType)==4?d=o+"/bundle.html?cid="+u.courseId:d=o+"/info.html?cid="+u.courseId,'<li><a href="'+d+'"><span class="title">'+u.courseName+'</span><span class="teacher">'+u.mainTeacher+"</span></a></li>"};break;case"xtwlb":n='<ul class="xtwlb">',e=function(u){var d="";return parseInt(u.courseType)==2||parseInt(u.courseType)==4?d=o+"/bundle.html?cid="+u.courseId:d=o+"/info.html?cid="+u.courseId,'<li><a href="'+d+'"><img src="'+(window.cdnPath||"")+u.cover+'"/><span class="title">'+u.courseName+"</span>"+(s?'<span class="teacher">'+u.mainTeacher+"</span>":"")+(i?'<span class="curren">'+u.popularityCount+"</span>":"")+"</a></li>"};break;case"twlb":n='<ul class="twlb">',e=function(u){var d="";return parseInt(u.courseType)==2||parseInt(u.courseType)==4?d=o+"/bundle.html?cid="+u.courseId:d=o+"/info.html?cid="+u.courseId,'<li><a href="'+d+'"><img src="'+(window.cdnPath||"")+u.cover+'"/><span class="rser"><span class="title">'+u.courseName+'</span><span class="introduce" >'+u.introduce+"</span>"+(s?'<span class="teacher">'+u.mainTeacher+"</span>":"")+(i?'<span class="curren">'+u.popularityCount+"</span>":"")+"</span></a></li>"};break;case"ttlb":var v="";parseInt(a[0].courseType)==2||parseInt(a[0].courseType)==4?v=o+"/bundle.html?cid="+a[0].courseId:v=o+"/info.html?cid="+a[0].courseId,n='<ul class="ttlb">',n+='<li class="one"><a href="'+v+'"><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(u){var d="";return parseInt(u.courseType)==2||parseInt(u.courseType)==4?d=o+"/bundle.html?cid="+u.courseId:d=o+"/info.html?cid="+u.courseId,'<li><a href="'+d+'"><span class="title">'+u.courseName+'</span><span class="teacher">'+u.mainTeacher+"</span></a></li>"};break;case"btrqlb":n='<ul class="btrqlb">',e=function(u){var d="";return parseInt(u.courseType)==2||parseInt(u.courseType)==4?d=o+"/bundle.html?cid="+u.courseId:d=o+"/info.html?cid="+u.courseId,'<li><a href="'+d+'"><span class="title">'+u.courseName+'</span><span class="introduce">'+u.introduce+"</span>"+(s?'<span class="teacher">'+u.mainTeacher+"</span>":"")+(i?'<span class="curren">'+u.popularityCount+"</span>":"")+"</a></li>"};break}for(var p=0,c=a.length;p<c;p++)if(!(r.styleType=="ttlb"&&p==0)){var b=a[p];n+=e(b)}n+="</ul>",r.item.html(n)},courseWare:function(){var r=this;r.$courseware=l(".module[data-type=courseware]");for(var a=0,n=r.$courseware.length;a<n;a++){var e=r.$courseware.eq(a);r.getAjaxCourseware(e)}},getAjaxCourseware:function(r){var a=this,n=r.attr("data-courseware");if(!n)return!1;var e=JSON.parse(n);e.item=r,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(r){var a=r.courseWareType+"",n=r.courseWareId,e=r.courseId,t=r.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="+n:"/pages/wap/info.html?cid="+e,i},renderCourseware:function(r,a){var n=this,e="",t=parseInt(r.sNum||0)==1,i=parseInt(r.sTeacher||0)==1,s;switch(r.styleType){case"wzlb":e='<ul class="wzlb">',s=function(c){return'<li><a href="'+n.isLiveUrl(c)+'"><span class="title">'+c.courseWareName+'</span><span class="teacher">'+c.realName+"</span></a></li>"};break;case"xtwlb":e='<ul class="xtwlb">',s=function(c){return'<li><a href="'+n.isLiveUrl(c)+'"><img src="'+(window.cdnPath||"")+c.cover+'"/><span class="title">'+c.courseWareName+"</span>"+(i?'<span class="teacher">'+c.realName+"</span>":"")+(t?'<span class="curren">'+c.popularityCount+"</span>":"")+"</a></li>"};break;case"twlb":e='<ul class="twlb">',s=function(c){return'<li><a href="'+n.isLiveUrl(c)+'"><img src="'+(window.cdnPath||"")+c.cover+'"/><span class="rser"><span class="title">'+c.courseWareName+'</span><span class="introduce">'+c.introduce+"</span>"+(i?'<span class="teacher">'+c.realName+"</span>":"")+(t?'<span class="curren">'+c.popularityCount+"</span>":"")+"</span></a></li>"};break;case"ttlb":e='<ul class="ttlb">',e+='<li class="one"><a href="'+n.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(c){return'<li><a href="'+n.isLiveUrl(c)+'"><span class="title">'+c.courseWareName+'</span><span class="teacher">'+c.realName+"</span></a></li>"};break;case"btrqlb":e='<ul class="btrqlb">',s=function(c){return'<li><a href="'+n.isLiveUrl(c)+'"><span class="title">'+c.courseWareName+'</span><span class="introduce">'+c.introduce+"</span>"+(i?'<span class="teacher">'+c.realName+"</span>":"")+(t?'<span class="curren">'+c.popularityCount+"</span>":"")+"</a></li>"};break;default:}for(var o=0,v=a.length;o<v;o++)if(!(r.styleType=="ttlb"&&o==0)){var p=a[o];e+=s(p)}e+="</ul>",r.item.html(e)},information:function(r){var a=this;a.$article=l(".module[data-type=article]");for(var n=0,e=a.$article.length;n<e;n++){var t=a.$article.eq(n);a.getAjaxArticle(t)}},getAjaxArticle:function(r){var a=this,n=r.attr("data-article");if(!n)return!1;var e=JSON.parse(n);e.item=r,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(r){if(new Date(parseInt(r))=="Invalid Date"&&new Date(parseInt(r)*1e3)=="Invalid Date")return"--";var a=new Date(parseInt(r)),n=a.getFullYear(),e=a.getMonth()+1,t=a.getDate();return n+"-"+e+"-"+t},renderArticle:function(r,a){var n=this,e="",t,i=function(d){return n.miniprogram?"/pages/routine/information.html?aid="+d:(location.port=="81","/pubinfo/"+d+".shtml")},s=parseInt(r.sNum||0)==1,o=parseInt(r.sTeacher||0)==1,v=function(d){for(var m="",w=0,y=d.length;w<y;w++){var k=d[w]||d[0];m+='<img src="'+((window.cdnPath||"")+k.sourcePath)+'"/>'}return m};switch(r.styleType){case"wzlb":e='<ul class="wzlb">',t=function(d){return'<li><a href="'+i(d.infoID)+'"><span class="title">'+d.title+'</span><span class="teacher">'+n.getTimeString(d.gmtCreate)+"</span></a></li>"};break;case"xtwlb":e='<ul class="xtwlb">',t=function(d){return'<li><a href="'+i(d.infoID)+'"><img src="'+(window.cdnPath||"")+d.computerSinglePicPath+'"/><span class="title">'+d.title+"</span>"+(o?'<span class="teacher">'+n.getTimeString(d.gmtCreate)+"</span>":"")+(s?'<span class="curren">'+d.viewCount+"</span>":"")+"</a></li>"};break;case"twlb":e='<ul class="twlb">',t=function(d){return'<li><a href="'+i(d.infoID)+'"><img src="'+(window.cdnPath||"")+d.computerSinglePicPath+'"/><span class="rser"><span class="title">'+d.title+'</span><span class="introduce">'+d.introduce+"</span>"+(o?'<span class="teacher">'+n.getTimeString(d.gmtCreate)+"</span>":"")+(s?'<span class="curren">'+d.viewCount+"</span>":"")+"</span></a></li>"};break;case"ttlb":e='<ul class="ttlb">',t=function(d,m){return'<li class="one"><a href="'+i(d.infoID)+'"><span class="title">'+d.title+'</span><span class="introduce">'+v(u.computerPicPath)+"</span>"+(o?'<span class="teacher">'+n.getTimeString(d.gmtCreate)+"</span>":"")+(s?'<span class="curren">'+d.viewCount+"</span>":"")+"</a></li>"};break;case"btrqlb":e='<ul class="btrqlb">',t=function(d){return'<li><a href="'+i(d.infoID)+'"><span class="title">'+d.title+'</span><span class="introduce">'+d.introduce+"</span>"+(o?'<span class="teacher">'+n.getTimeString(d.gmtCreate)+"</span>":"")+(s?'<span class="curren">'+d.viewCount+"</span>":"")+"</a></li>"};break;default:}for(var p=document.createElement("div"),c=0,b=a.length;c<b;c++){var u=a[c];u.computerPicPath=u.computerPicPath?JSON.parse(u.computerPicPath):"/design/designstatic/common/image/information/defult.jpg",u.computerSinglePicPath=u.computerPicPath?u.computerPicPath[0].sourcePath:"/design/designstatic/common/image/information/defult.jpg",p.innerHTML=u.detail,u.detail=p.innerText,e+=t(u,c)}e+="</ul>",r.item.html(e)},getAjaxRoomInfo:function(){var r=this;l.ajax({type:"get",url:"/api/disk/home?projectid=12",dataType:"json",success:function(a){a.success&&(window.roominfo=a.data,r.roominfo=a.data,r.Render(a.data))}})},Render:function(r){var a=this;a.summary(r.introduction),a.QRcode(r.wechatQRCode),a.logo(r.logo),a.documentTitle(r)},summary:function(r){var a=this;if(a.$introduce=l(".module[data-type=introduce]"),a.$introduce.length<1)return!1;for(var n=0,e=a.$introduce.length;n<e;n++){var t=a.$introduce.eq(n);t.find(".box").html(r)}},QRcode:function(r){var a=this;if(a.$qrcode=l(".module[data-type=qrcode]"),a.$qrcode.length<1)return!1;for(var n=0,e=a.$qrcode.length;n<e;n++){var t=a.$qrcode.eq(n);t.find("img").attr("src",r)}},logo:function(r){var a=this;if(a.$logo=l(".module[data-type=logo]"),a.$logo.length<1)return!1;for(var n=0,e=a.$logo.length;n<e;n++){var t=a.$logo.eq(n);t.find("img").attr("src",r)}},documentTitle:function(r){var a=this,n=l("title");if(!n)return!1;var e;window.location.pathname.indexOf("/pages/getcoupons.html")<0&&(r.subhead?window.location.pathname=="/"?e=r.schoolName+"-"+r.subhead:e=n.text()+"-"+r.subhead:e=r.schoolName),n.html(e),a.title=e},canousel:function(){var r=this;r.$carousel=l(".module[data-type=carousel]");for(var a=0,n=r.$carousel.length;a<n;a++){var e=r.$carousel.eq(a);r.renderCanousel(e)}},renderCanousel:function(r){var a=this,n=r[0],e=r.attr("data-mid");r.html('<div class="img_ul"></div><div class="barbox"></div>');var t=r.find(".img_ul"),i=r.attr("data-canousel");if(!i)return!1;var s=l.parseJSON(i),o=s.list,v=r.find(".barbox");s.nav&&a.renderCanouselBarbox(v,o);var p=o.length,c=parseFloat(r[0].style.width)||10,b=s.playTime*1e3,u=s.changeTime,d=s.adapt,m=0,v=r.find(".barbox"),w="";if(p==1){var y=o[0];w+='<div class="img_li" style="width: '+c+'rem;height:100%;left: 0rem;"><a '+(y.href?'href="'+y.href+'"':"")+'><div class="'+d+'" style="background-image: url('+y.path+');width:100%;height:100%;"></div></a></div>',v.hide()}else if(p==2)for(var k=0;k<4;k++){var y=o[k%2];k==3?w+='<div class="img_li" style="width: '+c+"rem;height:100%;left:"+-c+'rem;"><a '+(y.href?'href="'+y.href+'"':"")+'><div class="'+d+'" style="background-image: url('+y.path+');width:100%;height:100%;"></div></a></div>':w+='<div class="img_li" style="width: '+c+"rem;height:100%;left:"+c*k+'rem;"><a '+(y.href?'href="'+y.href+'"':"")+'><div class="'+d+'" style="background-image: url('+y.path+');width:100%;height:100%;"></div></a></div>'}else for(var k=0;k<p;k++){var y=o[k];k==p-1?w+='<div class="img_li" style="width: '+c+"rem;height:100%;left:"+-c+'rem;"><a '+(y.href?'href="'+y.href+'"':"")+'><div class="'+d+'" style="background-image: url('+y.path+');width:100%;height:100%;"></div></a></div>':w+='<div class="img_li" style="width: '+c+"rem;height:100%;left:"+c*k+'rem;"><a '+(y.href?'href="'+y.href+'"':"")+'><div class="'+d+'" style="background-image: url('+y.path+');width:100%;height:100%;"></div></a></div>'}t.html(w);var N=r.find(".img_li"),S=N.length,I=v.find("li");I.eq(m).addClass("on"),s.nav&&a.animatesCanoousel(v,m);function T(){s.nav&&a.animatesCanoousel(v,m%p),clearTimeout(a["carInter"+e]),a["carInter"+e]=setTimeout(function(){m++,t.css({transform:"translateX("+-m*c+"rem)","-webkit-transform":"translateX("+-m*c+"rem)","transition-duration":u+"s","-webkit-transition-duration":u+"s"}),I.removeClass("on"),p==2?I.eq(m%2).addClass("on"):I.eq(m%S).addClass("on"),L(m+1),T()},b)}function L(C){var j=C%S;N.eq(j).css("left",C*c+"rem")}var P=parseFloat(l("html").css("fontSize"));if(p>=2){T();var q=0,x=0;n.addEventListener("touchstart",function(C){var j=C.targetTouches[0];q=j.pageX,clearInterval(a["carInter"+e])}),n.addEventListener("touchmove",function(C){var j=C.targetTouches[0];x=(j.pageX-q)/P,t.css({transform:"translateX("+(x-m*c)+"rem)","-webkit-transform":"translateX("+(x-m*c)+"rem)","transition-duration":"0s","-webkit-transition-duration":"0s"}),x>.5&&C.preventDefault()}),n.addEventListener("touchend",function(C){clearTimeout(a["carTimeout"+e]),x*x>9&&(x<-.5?(m++,L(m+1)):x>.5&&(m--,L(m-1))),t.css({transform:"translateX("+-m*c+"rem)","-webkit-transform":"translateX("+-m*c+"rem)","transition-duration":u/2+"s","-webkit-transition-duration":u/2+"s"}),I.removeClass("on"),p==2?I.eq(m%2).addClass("on"):I.eq(m%S).addClass("on"),a["carTimeout"+e]=setTimeout(function(){T()},u*1e3/2)})}},renderCanouselBarbox:function(r,a){for(var n=this,e="",t=0,i=a.length;t<i;t++)e+='<span class="li"></span>';r.html(e)},animatesCanoousel:function(r,a){var n=r.find(".li");r.find(".on").removeClass("on"),n.eq(a).addClass("on")},footerNav:function(){var r=this;r.$footerNav=l(".module[data-type=footerNav]");for(var a=0,n=r.$footerNav.length;a<n;a++){var e=r.$footerNav.eq(a);r.renderFooterNav(e)}},isOnHref:function(r){var a=!1;return r&&(g.location.href==g.location.origin+r||g.location.pathname==r&&g.location.href.indexOf("mainClassify")<0||g.location.href.indexOf(r)>-1&&r.indexOf("mainClassify")>-1||r=="/comment/#"&&g.location.href.indexOf("/comment/#")>-1)&&(a=!0),a},renderFooterNav:function(r){var a=this,n=r.find("li"),e=r.attr("data-footernav");e&&(e=JSON.parse(e)),n.removeClass("on");for(var t=0,i=n.length;t<i;t++){var s=n.eq(t);s.find("span").removeAttr("style");var o=s.find("a"),v=o.attr("href");a.isOnHref(v)&&(s.addClass("on"),e&&e.color&&s.find("span").css("color",e.color))}},setAnimation:function(){var r=this;r.animArr=[];for(var a=l(".module"),n=0,e=a.length;n<e;n++){var t=a.eq(n),i=t.css("animationName");i!="none"&&(t.css("animationIterationCount")!="infinite"&&(t.attr("data-kui-anim",i),t.css("animationName","")),r.animArr.push(t))}},aHrefClick:function(){for(var r=l("a[href]"),a=[],n=0,e=r.length;n<e;n++){var t=r.eq(n);(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"),v=function(c){c=="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+"#/":"/#/"},p=function(){window.player.mobileVideoShow(!1),s.loginLayer(function(c){c.success&&s.isLogin(function(b){b.success&&v(b.data.userTypeExact)})})};getCookie("token")||getCookie("stoken")?s.isLogin(function(c){c.success?v(c.data.userTypeExact):p()}):p()})},headerNav:function(){for(var r=this,a=l(".module[data-type=headerNav]"),n=0,e=a.length;n<e;n++)r.renderHeaderNav(a.eq(n))},renderHeaderNav:function(r){var a=this;if(!r.attr("data-headernav"))return!1;for(var n=JSON.parse(r.attr("data-headernav")),e="drawer-"+r.attr("data-mid"),t='<div id="'+e+'" class="drawer drawer-'+n.openStyle+'"><style>#'+e+" .drawer-content *{color:"+n.textColor+";}#"+e+" .drawer-content a{color:"+n.textColor+";}#"+e+" .drawer-content {background-color:"+n.moduleColor+";}#"+e+" .drawer-title, #"+e+" li{ height: "+unit(n.linesHeight)+";line-height: "+unit(n.linesHeight)+';}</style><div class="drawer-mask"></div><div class="drawer-content" ><div class="drawer-title"><img src="" /><span>'+a.title+'</span></div><ul class="drawer-menu"><div class="menuheight">',i=0,s=n.list.length;i<s;i++){var o=n.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 v=l("#"+e),p=v.find(".drawer-menu"),c=p.find(".menuheight").height()-p.height(),b=!1,u,d,m;v.on("touchstart",function(w){d=w.originalEvent.targetTouches[0].pageY,c>0&&(u=setInterval(function(){b=!1,d<m?p.scrollTop()==0&&(b=!0):p.scrollTop()>=c&&(b=!0)},20))}),v.on("touchend",function(w){clearInterval(u)}),v.on("touchmove",function(w){c<0?w.preventDefault():b?(m=w.originalEvent.targetTouches[0].pageY,w.preventDefault()):(m=w.originalEvent.targetTouches[0].pageY,window.event.returnValue=!0)}),v.on("click",".drawer-mask",function(w){v.removeClass("drawer-open"),window.player&&window.player.mobileVideoShow(!0)}),v.on("click","a[data-handle]",function(w){v.removeClass("drawer-open")}),r.on("click",function(w){v.addClass("drawer-open"),v.find(".drawer-title span").text(a.title),a.roominfo&&v.find(".drawer-title img").attr("src",(window.cdnPath||"")+a.roominfo.logo),window.player&&window.player.mobileVideoShow(!1)})}};if(window.secondShareHtml)var f=setInterval(function(){window.secondShareHtmlSuccess&&(clearInterval(f),h.init())},20);else h.init();g.getWapRoom=h})(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,g){if(g.player)return!1;g.player={init:function(){var h=this;h.getVideoDatas()},getVideoDatas:function(){var h=this;h.playElement=l(".module[data-type=player]"),h.playerdatas=[];for(var f=0,r=h.playElement.length;f<r;f++){var a=h.playElement.eq(f),n=l.parseJSON(a.attr("data-player"));h.getCreateVideoConfig(a,n)}},getCreateVideoConfig:function(h,f){var r=this,r=this,a="player"+h.attr("data-mid");h.find(".box").attr("id",a);var n=parseInt(h.css("width")),e=parseInt(h.css("height"));r.playParams={playerId:a,playMenus:f.list,designId:f.designId,autoPlay:f.play,playIndex:0,width:n,height:e},r.getVedioUrl(),h.find("li").on("click",function(){r.playParams.playIndex=l(this).index(),r.getVedioUrl()})},getVedioUrl:function(){var h=this,f=h.playParams,r=f.playIndex,a=f.playMenus[r].videoid,n=f.playMenus[r].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&&h.carryVideo(f,e.data[0],n)}})},carryVideo:function(h,f,r){var a=this,n="";if(h.designId)n="/api/common/mu/getDesignFreeM3u8.m3u8?courseWareId="+f.courseWareId+"&designId="+h.designId+(r?"&sourceId="+r:"");else if(n=f.videoM3u8FileAddress,!n)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="'+f.cover+'" width="'+h.width+'" height="'+h.height+'" x5-playsinline="" playsinline="true" webkit-playsinline="true" tabindex="-1" autoplay="true" oncontextmenu="return false" src="'+n+'"></video>',t=l("#"+h.playerId);t.html(e);var i=t.find("video").eq(0),s=!1;t.on("click",function(){var o=i[0].paused,v=i[0].ended;s&&!v&&!o?(i.css({display:"none"}),i[0].pause()):(i.css({display:"block"}),i[0].play()),s=!0})},mobileVideoShow:function(h){for(var f=l(document).find("video"),r=0,a=f.length;r<a;r++){var n=f.eq(r);h?n[0].prePause&&(n[0].play(),n.css({display:"block"}),n[0].prePause=!1):(n[0].pause(),n[0].prePause=!0,n.css({display:"none"}))}}},g.player.init()}(jQuery,window);function getCookie(l){for(var g=document.cookie,h=g.split("; "),f=0;f<h.length;f++){var r=h[f].split("=");if(r[0]==l)return r[1]}return""}function designUploadPoint(l,g){try{var h=l.data("mid")||"",f=l.data("type")||"",r=l.text()||"",a=l.data("handle")||"",n=l.find("a"),e=n.attr("href")||"",t=window.location.hostname,i=window.location.pathname,s={id:h,type:f,text:r,handle:a,pageTo:e,hostname:t}}catch(o){console.log("designUploadPoint:",o)}}