2 lines
24 KiB
JavaScript
2 lines
24 KiB
JavaScript
var comFun={};(function(s,m){var i={init:function(){var t=this;t.getValue("token")&&(t.setCookie("token",t.getValue("token")),t.setCookie("openid",t.getValue("openid"))),m.location.href.indexOf("/mp/index.shtml")>-1||m.location.href.indexOf("/pages/routine/")>-1?(t.miniprogram=!0,localStorage.miniprogram=!0):(t.miniprogram=!1,localStorage.miniprogram=!1)},getValue:function(t){var e=e||window.location.href,n=e.split("?");if(n.length==1)return null;for(var a=n[1].split("&"),r={},l=0;l<a.length;l++){var d=a[l].split("=");r[d[0]]=d[1]}return r[t]?r[t]:!1},setCookie:function(t,e){var n=t+"="+e+";path=/";document.cookie=n}};i.init(),comFun=i})(jQuery,window),document.write('<link rel="stylesheet" href="/design/designstatic/common/css/userMobile.css">'),document.write('<script type="text/javascript" charset="utf-8" src="/design/designstatic/home/waphome/js/layerMobile/layer.js"></script>'),window.wx||document.write('<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>');var scriptUrl="/design/designstatic/common/js/userMobile.js";loadScriptmin(scriptUrl,function(){var s=window.user,m={init:function(){var i=this;i.getLoginUser(),i.handleBtn(),$(document).scrollTop(0)},getLoginUser:function(i){var t=this;getCookie("token")&&s.isLogin(function(e){e.success&&(t.login(e.data,e.timeStamp),i&&(e.data.userTypeExact=="STUDENT",window.location.href=window.basePath?"/"+window.basePath+"#/":"/#/"))})},login:function(i,t){for(var e=this,n=$(".module[data-type=registerLogin]"),a=(i==null?void 0:i.user)||{},r=0,l=n.length;r<l;r++){var d=n.eq(r),u='<a href="'+(window.basePath?"/"+window.basePath+"#/":"/#/")+'" style="margin-right: 5px;overflow: hidden;text-overflow:ellipsis;white-space: nowrap;width: 55%;text-align: right;">'+(a.nickname||a.name||"")+'</a> | <span style="margin-left: 5px;white-space: nowrap;" class="quitBtn">\u9000\u51FA</span>';d.find(".box").html(u)}$(".quitBtn").on("click",function(){s.loginout(function(c){c.success&&(window.location.href="/")})})},handleBtn:function(){for(var i=this,t=$(".module[data-handle=login]"),e=0,n=t.length;e<n;e++){var a=t.eq(e);i.bindLoginBtnEvent(a)}for(var r=$(".module[data-type=registerLogin] .loginEvent"),e=0,n=r.length;e<n;e++){var a=r.eq(e);i.bindLoginBtnEvent(a)}for(var l=$(".module[data-handle=register]"),e=0,n=l.length;e<n;e++){var a=l.eq(e);i.bindRegisterEvent(a)}for(var d=$(".module[data-type=registerLogin] .registerEvent"),e=0,n=d.length;e<n;e++){var a=d.eq(e);i.bindRegisterEvent(a)}for(var u=$(".module[data-handle=registerSchool]"),e=0,n=u.length;e<n;e++){var a=u.eq(e);i.bindRegisterSchoolEvent(a)}for(var c=$(".module[data-handle=QQlogin]"),e=0,n=c.length;e<n;e++){var a=c.eq(e);i.bindQQloginEvent(a)}for(var p=$(".module[data-handle=wechatLogin]"),e=0,n=p.length;e<n;e++){var a=p.eq(e);i.bindWechatLoginEvent(a)}for(var o=$(".module[data-handle=enwechatLogin]"),e=0,n=o.length;e<n;e++){var a=o.eq(e);i.bindenWechatLoginEvent(a)}for(var f=$(".module[data-handle=dingdingLogin]"),e=0,n=f.length;e<n;e++){var a=f.eq(e);i.binddingdingLoginEvent(a)}for(var h=$(".module[data-handle=appLogin]"),e=0,n=h.length;e<n;e++){var a=h.eq(e);i.bindappLoginEvent(a)}for(var I=$(".module[data-handle=dialogBtn]"),e=0,n=I.length;e<n;e++){var a=I.eq(e);i.binddialogEvent(a)}for(var w=$(".module[data-handle=weiboLogin]"),e=0,n=w.length;e<n;e++){var a=w.eq(e);i.bindWeiboLoginEvent(a)}for(var v=$(".module[data-handle=alipayLogin]"),e=0,n=v.length;e<n;e++){var a=v.eq(e);i.bindAlipayLoginEvent(a)}for(var g=$(".module[data-handle=getPasswod]"),e=0,n=g.length;e<n;e++){var a=g.eq(e);i.bindGetPasswodEvent(a)}for(var j=$(".module[data-handle=getUsername]"),e=0,n=j.length;e<n;e++){var a=j.eq(e);i.bindGetUsernameEvent(a)}for(var x=$(".module[data-handle=exchangeCoupon]"),e=0,n=x.length;e<n;e++){var a=x.eq(e);i.bindGetExchangecouponEvent(a)}},bindLoginBtnEvent:function(i){var t=this;i.on("click",function(){window.location=location.origin+(window.basePath?"/"+window.basePath+"#/":"/#/")+"login"})},bindRegisterEvent:function(i){var t=this;i.on("click",function(){s.registerLayer()})},bindRegisterSchoolEvent:function(i){var t=this;i.on("click",function(){s.registerSchoolLayer()})},bindQQloginEvent:function(i){var t=this;i.on("click",function(){s.loginQQ()})},bindWechatLoginEvent:function(i){var t=this;i.on("click",function(e){s.qrcodeloginWeChat()})},bindenWechatLoginEvent:function(i){var t=this;i.on("click",function(e){s.qrcodeloginenWeChat()})},binddingdingLoginEvent:function(i){var t=this;i.on("click",function(e){s.qrcodelogindingding()})},bindappLoginEvent:function(i){var t=this;i.on("click",function(e){s.qrcodeloginapp()})},binddialogEvent:function(i){var t=this;i.on("click",function(e){var n=i.attr("data-href")?JSON.parse(i.attr("data-href")):{};s.dialogBtnx(n)})},bindWeiboLoginEvent:function(i){var t=this;i.on("click",function(){s.loginWeiBo()})},bindAlipayLoginEvent:function(i){var t=this;i.on("click",function(){s.loginAlipay()})},bindGetPasswodEvent:function(i){var t=this;i.on("click",function(){s.getPasswordLayer()})},bindGetUsernameEvent:function(i){var t=this;i.on("click",function(){s.getUsernameLayer()})},bindGetExchangecouponEvent:function(i){var t=this;i.on("click",function(){s.getExchangecoupon()})}};window.mainHome=m,m.init()});function loadScriptmin(s,m,i){var t=this,e=document.createElement("script");e.type="text/javascript",e.readyState?e.onreadystatechange=function(){(e.readyState=="loaded"||e.readyState=="complete")&&(e.onreadystatechange=null,m.bind(t)(i))}:e.onload=function(){m.bind(t)(i)},e.src=s,document.body.appendChild(e)}function unit(s){return s/37.5+"rem"}(function(s,m){var i={init:function(){var t=this;s(document).ready(function(){setTimeout(function(){t.fixed()},100)}),t.serach(),t.course(),t.courseWare(),t.information(),t.getAjaxRoomInfo(),t.canousel(),t.footerNav(),t.setAnimation(),t.navigateTo()},fixed:function(){for(var t=this,e=s(".module[data-fixed]"),n=0,a=e.length;n<a;n++){var r=e.eq(n),l=parseInt(r.css("left")),d=r.parent().width(),u=l-d/2;r.attr("data-fixed")=="fixedTop"?r.css({position:"fixed",top:unit(r.attr("data-fixedvalue")),left:"50%",marginLeft:unit(u),zIndex:999}):r.attr("data-fixed")=="fixedBottom"&&r.css({position:"fixed",top:"auto",bottom:unit(r.attr("data-fixedvalue")),left:"50%",marginLeft:unit(u),zIndex:999})}},serach:function(){var t=this;if(t.$search=s(".module[data-type=search]"),t.$search.length<1)return!1;var e="/pages/wap/elective.html";t.miniprogram&&(e="/pages/routine/elective.html");for(var n=0,a=t.$search.length;n<a;n++){var r=t.$search.eq(n);(function(l){var d=l.find(".searchBtn"),u=l.find("input");d.on("click",function(){u.val()?m.location.href=e+"?keyword="+u.val():m.location.href=e})})(r)}},course:function(){var t=this;t.$course=s(".module[data-type=course]");for(var e=0,n=t.$course.length;e<n;e++){var a=t.$course.eq(e);t.getAjaxCourse(a)}},getAjaxCourse:function(t){var e=this,n=t.attr("data-course");if(!n)return!1;var a=JSON.parse(n);a.item=t,s.ajax({type:"get",url:"/api/course/getDressCourseInfoByIds?projectid=12",data:{courseIds:a.courseIds?a.courseIds.join(","):a.courseIds,mainClassify:a.classify[0],childClassify:a.classify[1],beginNum:a.startNum,endNum:a.endNum},contentType:"application/json;charset=utf-8",dataType:"json",success:function(r){r.success&&e.renderCourse(a,r.data)},error:function(r){console.log("\u63A5\u53E3\u8BF7\u6C42\u5931\u8D25")}})},renderCourse:function(t,e){var n="",a,r=this,l="/pages/wap";switch(r.miniprogram&&(l="/pages/routine"),t.styleType){case"wzlb":n='<ul class="wzlb">',a=function(o){var f="";return parseInt(o.courseType)==2?f=l+"/bundle.html?cid="+o.courseId:f=l+"/info.html?cid="+o.courseId,'<li><a href="'+f+'"><span class="title">'+o.courseName+'</span></a><span class="introduce">'+o.introduce+"</span></li>"};break;case"xtwlb":n='<ul class="xtwlb">',a=function(o){var f="";return parseInt(o.courseType)==2?f=l+"/bundle.html?cid="+o.courseId:f=l+"/info.html?cid="+o.courseId,'<li><a href="'+f+'"><img src="'+(window.cdnPath||"")+o.cover+'"/><span class="title">'+o.courseName+'</span></a><span class="introduce">'+o.introduce+"</span></li>"};break;case"twlb":n='<ul class="twlb">',a=function(o){var f="";return parseInt(o.courseType)==2?f=l+"/bundle.html?cid="+o.courseId:f=l+"/info.html?cid="+o.courseId,'<li><img src="'+(window.cdnPath||"")+o.cover+'"/><a href="'+f+'"><span class="title">'+o.courseName+'</span><span class="teacher">'+o.mainTeacher+'</span><span class="introduce">'+o.introduce+"</span></a></li>"};break;case"ttlb":var d="";parseInt(e[0].courseType)==2?d=l+"/bundle.html?cid="+e[0].courseId:d=l+"/info.html?cid="+e[0].courseId,n='<ul class="ttlb">',n+='<li><img src="'+(window.cdnPath||"")+e[0].cover+'"/><a href="'+d+'" style="padding-left: 170px;height: 110px;"><span class="title">'+e[0].courseName+'</span><span class="teacher">'+e[0].mainTeacher+'</span><span class="introduce" style="display:block;">'+e[0].introduce+"</span></a></li>",a=function(o){var f="";return parseInt(o.courseType)==2?f=l+"/bundle.html?cid="+o.courseId:f=l+"/info.html?cid="+o.courseId,'<li><a href="'+f+'"><span class="title">'+o.courseName+'</span><span class="introduce">'+o.introduce+"</span></a></li>"};break;case"btrqlb":n='<ul class="btrqlb">',a=function(o){var f="";return parseInt(o.courseType)==2?f=l+"/bundle.html?cid="+o.courseId:f=l+"/info.html?cid="+o.courseId,'<li><a href="'+f+'"><span class="title">'+o.courseName+'</span><span class="teacher">'+o.mainTeacher+'</span><span class="introduce">'+o.introduce+"</span></a></li>"};break}for(var u=0,c=e.length;u<c;u++)if(!(t.styleType=="ttlb"&&u==0)){var p=e[u];n+=a(p)}n+="</ul>",t.item.html(n)},courseWare:function(){var t=this;t.$courseware=s(".module[data-type=courseware]");for(var e=0,n=t.$courseware.length;e<n;e++){var a=t.$courseware.eq(e);t.getAjaxCourseware(a)}},getAjaxCourseware:function(t){var e=this,n=t.attr("data-courseware");if(!n)return!1;var a=JSON.parse(n);a.item=t,s.ajax({type:"get",url:"/api/course/getCourseWareInfoByIds?projectid=12",data:{courseWareIds:a.courseWareIds?a.courseWareIds.join(","):a.courseWareIds,beginNum:a.startNum,endNum:a.endNum,isIndex:1},contentType:"application/json",dataType:"json",success:function(r){r.success&&e.renderCourseware(a,r.data)},error:function(r){console.log("\u63A5\u53E3\u8BF7\u6C42\u5931\u8D25")}})},isLiveUrl:function(t){var e=t.courseWareType+"",n=t.courseWareId,a="",r=!1;switch(e){case"1":r=!0;break;case"2":r=!0;break;case"3":r=!0;break;case"4":r=!0;break;case"5":r=!0;break;default:r=!1}return a=r?`/views/wap/livecourse_wap.html?cwid=${n}`:`/views/wap/course_wap.html?cwid=${n}`,a},renderCourseware:function(t,e){var n=this,a="",r;switch(t.styleType){case"wzlb":a='<ul class="wzlb">',r=function(c){return'<li><a href="'+n.isLiveUrl(c)+'"><span class="title">'+c.courseWareName+'</span></a><span class="introduce">'+c.introduce+"</span></li>"};break;case"xtwlb":a='<ul class="xtwlb">',r=function(c){return'<li><a href="'+n.isLiveUrl(c)+'"><img src="'+(window.cdnPath||"")+c.cover+'"/><span class="title">'+c.courseWareName+'</span></a><span class="introduce">'+c.introduce+"</span></li>"};break;case"twlb":a='<ul class="twlb">',r=function(c){return'<li><img src="'+(window.cdnPath||"")+c.cover+'"/><a href="'+n.isLiveUrl(c)+'"><span class="title">'+c.courseWareName+'</span><span class="teacher">'+c.realName+'</span><span class="introduce">'+c.introduce+"</span></a></li>"};break;case"ttlb":a='<ul class="ttlb">',a+='<li><img src="'+(window.cdnPath||"")+e[0].cover+'"/><a href="'+n.isLiveUrl(e[0])+'" style="padding-left: 170px;height: 110px;"><span class="title">'+e[0].courseWareName+'</span><span class="teacher">'+e[0].realName+'</span><span class="introduce" style="display:block;">'+e[0].introduce+"</span></a></li>",r=function(c){return'<li><a href="'+n.isLiveUrl(c)+'"><span class="title">'+c.courseWareName+'</span><span class="introduce">'+c.introduce+"</span></a></li>"};break;case"btrqlb":a='<ul class="btrqlb">',r=function(c){return'<li><a href="'+n.isLiveUrl(c)+'"><span class="title">'+c.courseWareName+'</span><span class="teacher">'+c.realName+'</span><span class="introduce">'+c.introduce+"</span></a></li>"};break;default:}for(var l=0,d=e.length;l<d;l++)if(!(t.styleType=="ttlb"&&l==0)){var u=e[l];a+=r(u)}a+="</ul>",t.item.html(a)},information:function(t){var e=this;e.$article=s(".module[data-type=article]");for(var n=0,a=e.$article.length;n<a;n++){var r=e.$article.eq(n);e.getAjaxArticle(r)}},getAjaxArticle:function(t){var e=this,n=t.attr("data-article");if(!n)return!1;var a=JSON.parse(n);a.item=t,s.ajax({type:"get",url:"/api/disk/firstHomepageDetail?projectid=12",data:{InfoTypeId:a.classify[a.classify.length-1],beginNum:a.startNum,endNum:a.endNum},contentType:"application/json",dataType:"json",success:function(r){r.success&&e.renderArticle(a,r.data)},error:function(r){console.log("\u63A5\u53E3\u8BF7\u6C42\u5931\u8D25")}})},renderArticle:function(t,e){var n=this,a="",r,l="/pages/wap/information.html";switch(n.miniprogram&&(l="/pages/routine/information.html"),t.styleType){case"wzlb":a='<ul class="wzlb">',r=function(o){return'<li><a href="'+l+"?aid="+o.infoID+'"><span class="title">'+o.title+'</span></a><span class="introduce">'+o.detail+"</span></li>"};break;case"xtwlb":a='<ul class="xtwlb">',r=function(o){return'<li><a href="'+l+"?aid="+o.infoID+'"><img src="'+(window.cdnPath||"")+o.computerPicPath+'"/><span class="title">'+o.title+'</span></a><span class="introduce">'+o.detail+"</span></li>"};break;case"twlb":a='<ul class="twlb">',r=function(o){return'<li><img src="'+(window.cdnPath||"")+o.computerPicPath+'"/><a href="'+l+"?aid="+o.infoID+'"><span class="title">'+o.title+'</span><span class="introduce">'+o.detail+"</span></a></li>"};break;case"ttlb":a='<ul class="ttlb">',r=function(o,f){return f==0?'<li class="one"><img src="'+(window.cdnPath||"")+o.computerPicPath+'"/><a href="'+l+"?aid="+o.infoID+'"><span class="title">'+o.title+'</span><span class="introduce" style="display:block;">'+o.detail+"</span></a></li>":'<li><a href="'+l+"?aid="+o.infoID+'"><span class="title">'+o.title+'</span><span class="introduce">'+o.detail+"</span></a></li>"};break;case"btrqlb":a='<ul class="btrqlb">',r=function(o){return'<li><a href="'+l+"?aid="+o.infoID+'"><span class="title">'+o.title+'</span><span class="introduce">'+o.detail+"</span></a></li>"};break;default:}for(var d=document.createElement("div"),u=0,c=e.length;u<c;u++){var p=e[u];p.computerPicPath=p.computerPicPath?JSON.parse(p.computerPicPath)[0].sourcePath:"/design/designstatic/common/image/information/defult.jpg",d.innerHTML=p.detail,p.detail=d.innerText,a+=r(p,u)}a+="</ul>",t.item.html(a)},getAjaxRoomInfo:function(){var t=this;s.ajax({type:"get",url:"/api/disk/home?projectid=12",dataType:"json",success:function(e){e.success&&(window.roominfo=e.data,t.Render(e.data))}})},Render:function(t){var e=this;e.summary(t.introduction),e.QRcode(t.wechatQRCode),e.logo(t.logo),e.documentTitle(t)},summary:function(t){var e=this;if(e.$introduce=s(".module[data-type=introduce]"),e.$introduce.length<1)return!1;for(var n=0,a=e.$introduce.length;n<a;n++){var r=e.$introduce.eq(n);r.find(".box").html(t)}},QRcode:function(t){var e=this;if(e.$qrcode=s(".module[data-type=qrcode]"),e.$qrcode.length<1)return!1;for(var n=0,a=e.$qrcode.length;n<a;n++){var r=e.$qrcode.eq(n);r.find("img").attr("src",t)}},logo:function(t){var e=this;if(e.$logo=s(".module[data-type=logo]"),e.$logo.length<1)return!1;for(var n=0,a=e.$logo.length;n<a;n++){var r=e.$logo.eq(n);r.find("img").attr("src",t)}},documentTitle:function(t){t.subhead?s("title").html(t.schoolName+"-"+t.subhead):s("title").html(t.schoolName)},canousel:function(){var t=this;t.$carousel=s(".module[data-type=carousel]");for(var e=0,n=t.$carousel.length;e<n;e++){var a=t.$carousel.eq(e);t.renderCanousel(a)}},renderCanousel:function(t){var e=this,n=t[0],a=t.attr("data-mid");t.html('<div class="img_ul"></div><div class="barbox"></div>');var r=t.find(".img_ul"),l=t.attr("data-canousel");if(!l)return!1;var d=s.parseJSON(l),u=d.list,c=u.length,p=d.playTime*1e3,o=d.changeTime,f=d.adapt,h=0,I=t.find(".barbox"),w="";if(c==1){var v=u[0];w+='<div class="img_li" style="width: 10rem;height:100%;left: 0rem;"><a '+(v.href?"href="+v.href:"")+'><div class="'+f+'" style="background-image: url('+v.path+');width:100%;height:100%;"></div></a></div>',I.hide()}else if(c==2)for(var g=0;g<4;g++){var v=u[g%2];g==3?w+='<div class="img_li" style="width: 10rem;height:100%;left:'+-10+'rem;"><a '+(v.href?"href="+v.href:"")+'><div class="'+f+'" style="background-image: url('+v.path+');width:100%;height:100%;"></div></a></div>':w+='<div class="img_li" style="width: 10rem;height:100%;left:'+10*g+'rem;"><a '+(v.href?"href="+v.href:"")+'><div class="'+f+'" style="background-image: url('+v.path+');width:100%;height:100%;"></div></a></div>'}else for(var g=0;g<c;g++){var v=u[g];g==c-1?w+='<div class="img_li" style="width: 10rem;height:100%;left:'+-10+'rem;"><a '+(v.href?"href="+v.href:"")+'><div class="'+f+'" style="background-image: url('+v.path+');width:100%;height:100%;"></div></a></div>':w+='<div class="img_li" style="width: 10rem;height:100%;left:'+10*g+'rem;"><a '+(v.href?"href="+v.href:"")+'><div class="'+f+'" style="background-image: url('+v.path+');width:100%;height:100%;"></div></a></div>'}r.html(w);var j=t.find(".img_li"),x=j.length,b=I.find("li");b.eq(h).addClass("on");function L(){clearTimeout(e["carInter"+a]),e["carInter"+a]=setTimeout(function(){h++,r.css({transform:"translateX("+-h*10+"rem)","-webkit-transform":"translateX("+-h*10+"rem)","transition-duration":o+"s","-webkit-transition-duration":o+"s"}),b.removeClass("on"),c==2?b.eq(h%2).addClass("on"):b.eq(h%x).addClass("on"),T(h+1),L()},p)}function T(y){var q=y%x;j.eq(q).css("left",y*10+"rem")}if(c>=2){L();var N=0,k=0;n.addEventListener("touchstart",function(y){var q=y.targetTouches[0];N=q.pageX,clearInterval(e["carInter"+a])}),n.addEventListener("touchmove",function(y){var q=y.targetTouches[0];k=(q.pageX-N)/e.remSize,r.css({transform:"translateX("+(k-h*10)+"rem)","-webkit-transform":"translateX("+(k-h*10)+"rem)","transition-duration":"0s","-webkit-transition-duration":"0s"}),y.preventDefault()}),n.addEventListener("touchend",function(y){clearTimeout(e["carTimeout"+a]),k*k>9&&(k<0?(h++,T(h+1)):(h--,T(h-1))),r.css({transform:"translateX("+-h*10+"rem)","-webkit-transform":"translateX("+-h*10+"rem)","transition-duration":o/2+"s","-webkit-transition-duration":o/2+"s"}),b.removeClass("on"),c==2?b.eq(h%2).addClass("on"):b.eq(h%x).addClass("on"),e["carTimeout"+a]=setTimeout(function(){L()},o*1e3/2)})}},footerNav:function(){var t=this;t.$footerNav=s(".module[data-type=footerNav]");for(var e=0,n=t.$footerNav.length;e<n;e++){var a=t.$footerNav.eq(e);t.renderFooterNav(a)}},getHtml:function(t){switch(t){case"home":s(".content").html(localStorage.home),s(".content").removeAttr("style"),window.mainHome&&window.mainHome.init();break;case"elective":n();break;default:e(t)}function e(a){s.ajax({type:"get",url:"/api/disk/getDesignDetailMP?projectid=12",contentType:"application/json",dataType:"json",data:{designId:a},success:function(r){r.success&&r.data&&(s(".content").css("height",unit(parseInt(r.data.size.split("|")[1]))),s(".content").html(r.data.body),window.mainHome&&window.mainHome.init())}})}function n(){s.ajax({url:"/pages/routine/elective.html",type:"GET",dataType:"html",success:function(a){var r=/[\s\S]*<\/body>/g,l=r.exec(a)[0],d=s(l).filter(".content");s(".content").html(d.find(".curriculum").html()),s("head").append('<link rel="stylesheet" href="/design/designstatic/front/routine/css/course.css"><link rel="stylesheet" href="/design/designstatic/front/routine/css/jquery.pagination.css">'),s(".content").css("height","auto"),s(".course").css("overflow","hidden"),s(".content").append('<script type="text/javascript" charset="utf-8" src="/design/designstatic/front/routine/js/elective.js"></script>'),s(".content").append('<script type="text/javascript" charset="utf-8" src="/design/designstatic/front/routine/js/jquery.pagination.min.js"></script>'),window.mainHome&&window.mainHome.init()}})}},renderFooterNav:function(t){var e=this,n=t.find("li"),a=t.attr("data-footernav");a&&(a=JSON.parse(a)),localStorage.home=s(".content").html(),comFun.getValue("designId")?e.designIdFooter(t,comFun.getValue("designId")):(n.eq(0).addClass("on"),a&&a.color&&(t.attr("data-color",a.color),n.eq(0).find("span").css("color",a.color)));var r=a.list;e.footDataList=r,n.on("click",function(){n.removeClass("on"),n.find("span").removeAttr("style");var l=s(this);l.addClass("on"),a&&a.color&&l.find("span").css("color",a.color);var d=l.index(),u=r[d].href,c=JSON.parse(u.data).data;if(c.designId)window.history.replaceState("/mp/index.shtml?designId="+c.designId,"","/mp/index.shtml?designId="+c.designId),e.getHtml(c.designId);else{var p=escape(window.location.origin+u.url);wx.miniProgram.navigateTo({url:"../innerview/innerview?relayurl="+p})}})},designIdFooter:function(t,e){var n=this;if(n.dfooter)return!1;n.dfooter=!0;var a=t.find("li");n.getHtml(e);var r=t.attr("data-footernav");r&&(r=JSON.parse(r));for(var l=r.list,d=0,u=l.length;d<u;d++){var c=JSON.parse(l[d].href.data);if(c.data.designId==e){var p=a.eq(d);return p.addClass("on"),r&&r.color&&p.find("span").css("color",r.color),!1}}},reloadFooter:function(){var t=this,e=t.$footerNav.find("a[mhref]"),n=t.$footerNav.find("a[href]");t.$footerNav.find("li").removeClass("on"),t.$footerNav.find("li").find("span").removeAttr("style");for(var a=0,r=e.length;a<r;a++){var l=e.eq(a);l.attr("mhref")==t.loactHref&&(l.parent().addClass("on"),l.find("span").css("color",l.parent().parent().attr("data-color")))}for(var d=0,u=n.length;a<u;d++){var l=e.eq(d);l.attr("href")==t.loactHref&&(l.parent().addClass("on"),l.find("span").css("color",l.parent().parent().attr("data-color")))}},navigateTo:function(){var t=this;s("body").on("click","a[href]",function(){var e=s(this);if(e.attr("href")&&(e.attr("mhref",s(this).attr("href")),e.removeAttr("href")),e.parents(".module[data-type=footerNav]").length>0)return!1;if(e.parent().attr("data-href")){var n=JSON.parse(e.parent().attr("data-href")),a=n.data;if(a.designId)t.getHtml(a.designId),t.loactHref=e.attr("mhref");else{var r=escape(window.location.origin+e.attr("mhref"));wx.miniProgram.navigateTo({url:"../innerview/innerview?relayurl="+r})}}else{var r=escape(window.location.origin+e.attr("mhref"));wx.miniProgram.navigateTo({url:"../innerview/innerview?relayurl="+r})}})},setAnimation:function(){}};i.init()})(jQuery,window),window.getPage||document.write('<script type="text/javascript" charset="utf-8" src="/design/designstatic/home/waphome/js/setPage.js"></script>'),function(s,m){if(m.player)return!1;m.player={init:function(){var i=this;i.getVideoDatas()},getVideoDatas:function(){var i=this;i.playElement=s(".module[data-type=player]"),i.playerdatas=[];for(var t=0,e=i.playElement.length;t<e;t++){var n=i.playElement.eq(t),a=s.parseJSON(n.attr("data-player"));i.getCreateVideoConfig(n,a)}},getCreateVideoConfig:function(i,t){var e=this,e=this,n="player"+i.attr("data-mid");i.find(".box").attr("id",n);var a=parseInt(i.css("width")),r=parseInt(i.css("height"));e.playParams={playerId:n,playMenus:t.list,autoPlay:t.play,playIndex:0,width:a,height:r},e.getVedioUrl(),i.find("li").on("click",function(){e.playParams.playIndex=s(this).index(),e.getVedioUrl()})},getVedioUrl:function(){var i=this,t=i.playParams,e=t.playIndex,n=t.playMenus[e].videoid;s.ajax({type:"get",url:"/api/course/getCourseWareInfoByIds?projectid=12",data:{courseWareIds:n,isIndex:1},contentType:"application/json",dataType:"json",success:function(a){a.success&&i.carryVideo(t,a.data[0].videoM3u8FileAddress)}})},carryVideo:function(i,t){var e=this;if(!t)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 n='<video id="moduleVideoID" class="video-js vjs-default-skin" poster="'+i.playMenus[i.playIndex].thumb+'" controls width="'+i.width+'" height="'+i.height+'" style="background-color:#333;" playsinline webkit-playsinline controls preload="auto" x-webkit-airplay="true" controlsList="nodownload" oncontextmenu="return false" ><source src="'+(window.cdnPath||"")+t+'" type="application/x-mpegURL"></video>';s("#"+i.playerId).html(n)}},m.player.init()}(jQuery,window);function getCookie(s){for(var m=document.cookie,i=m.split("; "),t=0;t<i.length;t++){var e=i[t].split("=");if(e[0]==s)return e[1]}return""}
|