filesbox/web/dist/design/designstatic/newJS/course/wap/elective.js
2024-07-26 14:10:54 +08:00

2 lines
31 KiB
JavaScript

"use strict";var PAGE_SIZE=48,courseCurrentPage=1,isLoadWare=!0,jsUrlArr=["/design/designstatic/chatroom/js/xgplayer/xgplayer.js","/design/designstatic/common/live/xgplayer-flv.js","/design/designstatic/common/live/xgplayer-hls.js","/design/designstatic/chatroom/video/playerreview.js"],mapwaretypes=["\u89C6\u9891\u97F3\u9891","\u6559\u5B66\u76F4\u64AD","\u5C0F\u73ED\u8BFE\u76F4\u64AD","\u624B\u673A\u76F4\u64AD","\u8BBE\u5907\u76F4\u64AD","\u7C7B\u6559\u5B66\u76F4\u64AD","","","","\u6587\u6863\u8BFE","\u56FE\u6587\u8BFE","\u53CC\u5E08\u8BFE\u5802","",""];let mapwaretypeicon=["/design/designstatic/aroom/img/courseware/coursewaretype/5.png","/design/designstatic/aroom/img/courseware/coursewaretype/1.png","/design/designstatic/aroom/img/courseware/coursewaretype/9.png","/design/designstatic/aroom/img/courseware/coursewaretype/6.png","/design/designstatic/aroom/img/courseware/coursewaretype/4.png","/design/designstatic/aroom/img/courseware/coursewaretype/3.png","","","","/design/designstatic/aroom/img/courseware/coursewaretype/8.png","","/design/designstatic/aroom/img/courseware/coursewaretype/7.png","",""];var wapurl=window.location.origin+"/pages/elective.html"+window.location.search,iniframe=/Android|webOS|iPhone|iPod|iPad|BlackBerry/i.test(navigator.userAgent)&&window.frames.length!=parent.frames.length;!/Android|webOS|iPhone|iPod|iPad|BlackBerry/i.test(navigator.userAgent)&&getPar("hideFooter")!=1&&(window.location.href=wapurl);function getCookie(u){var a=document.cookie.match(new RegExp("(^| )"+u+"=([^;]*)(;|$)"));return a?unescape(a[2]):""}function getPar(u){var a=decodeURI(decodeURI(window.location.search)),s=a.indexOf(u+"=");if(s===-1)return"";var e=a.slice(u.length+s+1),t=e.indexOf("&");return t!==-1&&(e=e.slice(0,t)),e}function resetImgSrc(u){var a=u.replace(/([^.]*).([^.]*)$/g,"$1!large.$2");return a}function coverError(u){var a=event.target;parseInt(a.dataset.errorcount)==0?(a.setAttribute("data-errorcount",1),a.src=u):parseInt(a.dataset.errorcount)==1&&(a.setAttribute("data-errorcount",2),a.src="/design/designstatic/common/image/course/defult.jpg")}function addreviewscript(u){var a=this;addJsFun(u)}function addJsFun(u){var a=this,s=jsUrlArr.length;s?addJs(jsUrlArr[0],function(){jsUrlArr.shift(),addJsFun.call(a,u)}):u.call(a)}function addJs(u,a){var s=document.getElementsByTagName("head")[0],e=document.createElement("script");e.type="text/javascript",e.src=u+"?v="+new Date().valueOf(),typeof a=="function"&&(e.onload=e.onreadystatechange=function(){(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")&&(a(),e.onload=e.onreadystatechange=null)}),s.appendChild(e)}(function(){var u={init:function(){var a=this;a.sortType=1,a.sortord=7,a.mainClassify=getPar("mainClassify")||"",a.childClassify=getPar("childClassify")||"",a.condition=getPar("keyword")||"",a.hideFooter=getPar("hideFooter")||"",a.designUrl=getPar("designUrl")?decodeURIComponent(getPar("designUrl")):"",a.regionList=[],a.regionShopList=[],a.isformsocialcard=getPar("isformsocialcard")||"",a.currentPage=1,a.pageSize=48,a.isLoadWare=!0,a.getClassifysData=[],a.classifyData=[],a.classifyData2=[],a.classifyData3=[],a.classifyData4=[],a.classifyData5=[],a.classifyData6=[],a.isApp(),a.getList(),a.getClassifys(),a.changeSort(),a.bindEvent(),a.getGlobalDesignConfig()},isApp:function(){var a=this;a.isSimplify=localStorage.appAdapt==="true"||a.hideFooter=="1",a.isSimplify?($("head").append("<style>.content>.foot{display: none; }</style>"),a.hideFooter=="1"&&$("html").css({"font-size":"39.9px"}),a.isformsocialcard&&$("body").removeClass("formsocialcard").addClass("formsocialcard")):(document.write('<script type="text/javascript" charset="utf-8" src="/design/designstatic/home/js/getPage.js"></script>'),document.write('<script type="text/javascript" charset="utf-8" src="/design/designstatic/home/waphome/js/module.js"></script>'))},getdesignUrl:function(){var a=this;!a.designUrl||$.ajax({headers:{token:getCookie("token")},type:"GET",url:a.designUrl,data:{targetServerNameForOverride:getPar("targetServerNameForOverride")||void 0},dataType:"json",async:!1,success:function(s){var e=s.regionList||[];a.regionList=e,a.renderList.length&&a.initregionList()}})},getclassifySequence:function(a,s){var e="";function t(r,i){for(var n=0;n<r.length;n++){var o=r[n];o.courseClassifyId==i?e=o.classifySequence:o.children&&t(o.children,i)}}return t(a,s),e},getParents:function(a,s){var e=this;if(a.length>2)for(var t=0,r=s.length;t<r;t++){var i=s[t],n=i.classifySequence.length;i.classifySequence==a.substring(0,n)&&(e.parentKeys.push(i.courseClassifyId),a.length>n&&e.getParents(a,i.children))}},initregionList:function(){var a=this,s="",e=[],t=[];a.regionList.forEach(function(r,i){if(r.type==1){var n="",o=r.bannerList||[],c="mySwiperx"+i,d="swiper-paginationx"+i;e.push(c),t.push(d),o.length&&(n+='<div class="swiperBanner">',n+='<div class="swiper mySwiper '+c+'">',n+='<div class="swiper-wrapper">'),o.forEach(function(f,p){var g=f.type,v=f.screenType||0,m=g=="courseClassify"?"":a.getgospaic(f);g=="courseClassify"&&(a.parentKeys=[],a.getParents(a.getclassifySequence(a.getClassifysData,f.id),a.getClassifysData),m=location.origin+"/pages/wap/elective.html?mainClassify="+(a.parentKeys.length?a.parentKeys[0]:f.id)+(a.parentKeys.length?"&childClassify="+f.id:"")+(getPar("shareId")?"&shareId="+getPar("shareId"):"")+(getPar("hideFooter")?"&hideFooter="+getPar("hideFooter"):"")+(getPar("isformsocialcard")?"&isformsocialcard="+getPar("isformsocialcard"):"")+(getPar("designUrl")?"&designUrl="+getPar("designUrl"):"")),n+='<div class="swiper-slide"><a '+(m?'href="'+m+'"':"")+(iniframe?"":'target="_blank"')+' class="swiperBannerli'+(v==2?" swiperlibig":v==3?" swiperlifull":"")+'" title="" ><img src=" '+(f.image.indexOf("http")>-1?f.image:(window.cdnPath||"")+f.image)+' " /></a></div>'}),o.length&&(n+="</div>",n+='<div class="'+d+'"></div>',n+="</div>",n+="</div>"),s+=n}else if(r.type==2){var l="",o=r.bannerList||[],h=r.columnNum||5;o.length&&(l+='<div class="swiperGrid '+("columnNum"+h)+'">'),o.forEach(function(p){var g=p.type,v=g=="courseClassify"?"":a.getgospaic(p);g=="courseClassify"&&(a.parentKeys=[],a.getParents(a.getclassifySequence(a.getClassifysData,p.id),a.getClassifysData),v=location.origin+"/pages/wap/elective.html?mainClassify="+(a.parentKeys.length?a.parentKeys[0]:p.id)+(a.parentKeys.length?"&childClassify="+p.id:"")+(getPar("shareId")?"&childClassify="+getPar("shareId"):"")+(getPar("hideFooter")?"&hideFooter="+getPar("hideFooter"):"")+(getPar("isformsocialcard")?"&isformsocialcard="+getPar("isformsocialcard"):"")+(getPar("designUrl")?"&designUrl="+getPar("designUrl"):"")),l+="<a "+(v?'href="'+v+'"':"")+(iniframe?"":'target="_blank"')+' class="gridLi"><div class="cover"> <img src=" '+(p.image.indexOf("http")>-1?p.image:(window.cdnPath||"")+p.image)+'" /> </div> <div class="name">'+p.title+"</div> </a>"}),o.length&&(l+='<div class="clearboth"></div>',l+="</div>"),s+=l}}),$(".designUrlbox").html(s),e.forEach(function(r,i){new Swiper("."+e[i],{loop:!0,pagination:{el:"."+t[i]}})})},getgospaic:function(a){var s=a.type||"info",e="";switch(s){case"info":e=location.origin+"/information/"+a.id+".shtml";break;case"transshipment":e=location.origin+"/information/"+a.id+".shtml";break;case"video":e=location.origin+"/information/"+a.id+".shtml";break;case"recruit":e=location.origin+"/information/"+a.id+".shtml";break;case"goods":e=location.origin+"/shop/item.html?itemid="+a.id;break;case"course":e=location.origin+"/pages/wap/info.html?cid="+a.id;break;case"product":e=location.origin+"/information/"+a.id+".shtml";break;case"example":e=location.origin+"/information/"+a.id+".shtml";break;case"form":e=location.origin+"/portal/form.html?formId="+a.id;break;case"live":e=location.origin+"/views/wap/livecourse_wap.html?cwid="+a.id+"&courseId=0";break;case"vip":e=location.origin+"/shop/vipItem.html?itemid="+a.id;break;case"coupon":e=location.origin+"/vscard/coupon.html";break;case"seckill":e=location.origin+"/shop/seckillList.html";break;case"group":e=location.origin+"/shop/groupList.html";break;case"bargain":e=location.origin+"/shop/bargainList.html";break;case"shoppingCart":e=location.origin+"/shop/shoppingCart.html";break;case"newsClassify":e=location.origin+"/pages/wap/listrmation.html?busType=0,1&searchinfotypeId="+(a.url||a.id);break;case"transhipmentClassify":e=location.origin+"/pages/wap/listrmation.html?busType=0,1&transport=1&searchinfotypeId="+(a.url||a.id);break;case"videoClassify":e=location.origin+"/pages/wap/listrmation.html?busType=1&searchinfotypeId="+(a.url||a.id);break;case"productClassify":e=location.origin+"/pages/wap/listrmation.html?busType=6&searchinfotypeId="+(a.url||a.id);break;case"recruitClassify":e=location.origin+"/pages/wap/listrmation.html?busType=2&searchinfotypeId="+(a.url||a.id);break;case"worksClassify":e=location.origin+"/pages/wap/listrmation.html?busType=7&searchinfotypeId="+(a.url||a.id);break;case"shopClassify":e=location.origin+"/shop/shopClassifyList.html?parentClassifyId="+(a.url||a.id);break;case"courseClassify":e=location.origin+"/pages/wap/elective.html?mainClassify="+(a.url||a.id);break;case"vipCard":e=location.origin+"/shop/vipItem.html?itemid="+a.id;break;case"link":e=a.url||location.origin+"/information/"+a.id+".shtml";break;case"coupons":e=location.origin+"/vscard/coupon.html";break;case"membership":e=location.origin+"/shop/vipList.html";break;case"integral":e=location.origin+"/shop/integralList.html";break;case"sign":e=location.origin+"/shop/my/signin.html";break;case"courseSelection":e=location.origin+"/pages/wap/elective.html";break;case"testPaper":e=location.origin+"/myroom/#/mypapers/papers";break;case"task":e=location.origin+"/myroom/#/mypapers/homeworklis";break;case"qa":e=location.origin+"/myroom/#/Answer/List";break;case"record":e=location.origin+"/myroom/#/learn/record";break;case"report":e=location.origin+"/myroom/#/learn/report";break;case"certificate":e=location.origin+"/myroom/#/certificate";break;case"credit":e=location.origin+"/myroom/#/personal/credits";break;case"vipList":e=location.origin+"/shop/vipList.html";break;case"couponList":e=location.origin+"/vscard/coupon.html";break;case"lookClassify":e=location.origin+"/vscard/lookpicList.html?lookClassify="+(a.url||a.id);break}return e},getList:function(){var a=this;if(a.ajaxSend)return!1;a.ajaxSend=!0;var s=a.mainClassify||a.childClassify||a.condition,e=a.condition?1:0;a.isSearch=e;var t=s?"/api/course/getSelectionCourseList":"/api/course/getAllSelectionCourseList";$.ajax({headers:{token:getCookie("token"),resolution:window.screen.width+"*"+window.screen.height},type:"GET",url:t,data:{condition:a.condition,sortType:a.sortType,sortord:a.sortord,mainClassify:a.mainClassify,childClassify:a.childClassify,currentPage:a.currentPage,pageSize:a.pageSize},dataType:"json",async:!0,success:function(r){var i=r.data,n=i.list||[],o=i.total;a.searchTotal=n.length,a.setIntervalNumber=r.timeStamp,a.renderList(n,s),i.hasNextPage?a.isLoadWare=!e:a.isLoadWare=!1,a.ajaxSend=!1,$(".searchCouseWareUl").remove(),e&&a.getSearchList()}})},renderList:function(a,s){var e=this,t="";s?a.forEach(function(i){t+=e.renderItem(i)}):a.forEach(function(i){var n=i.courseClassifyId,o=".js_classifyid_"+n,c=i.courseList;$(o).length<1&&(t+='<div class="pdtit js_classifyid_'+n+'">'+i.classifyName+"</div>"),c.forEach(function(d){t+=e.renderItem(d)})});var r=a.length==0&&e.currentPage==1?e.isSearch?"":"<div class='nodata'></div>":t;$(".coursemain ul").append(r)},getshareurl:function(a){var s=this,e="";return e=window.location.origin+(s.isLive(a.courseWareType)?a.courseWareType=="2"?`/views/common/smallclass.html?cwid=${a.courseWareId}&courseId=${a.courseId}`:a.courseWareType==="11"?`/views/common/doubleTeacher.html?cwid=${a.courseWareId}&courseId=${a.courseId}`:`/liveclass/wap/livecourse.html?cwid=${a.courseWareId}&courseId=${a.courseId}`:`/views/wap/course_wap.html?cwid=${a.courseWareId}&courseId=${a.courseId}`),a.isAllAudio&&(e=window.location.origin+`/liveclass/songsheet.html?cwid=${a.courseWareId}&courseId=${a.courseId}`),e},getSearchList:function(){var a=this;$.ajax({headers:{token:getCookie("token"),resolution:window.screen.width+"*"+window.screen.height},type:"GET",url:"/api/course/getCourseWareListSearch",data:{pageSize:30,condition:a.condition},dataType:"json",async:!0,success:function(s){var e=s.data||[],t=[];e.forEach(function(i){var n=i.courseWares||[];n.forEach(function(o){t.push(o)})}),a.searchTotal=a.searchTotal+t.length;var r="";t.forEach(function(i){var n=(window.cdnPath||"")+i.cover,o=i.courseWareName||"",c=i.courseName||"",d=a.stateLive(i.gmtCourseStart,i.liveLength,i.playLength,i.isTranscoding,i.allowBackView,i.commonSourceId),l=a.getshareurl(i),h=d=="\u56DE\u770B"?'<img class="tag" src="/design/designstatic/aroom/img/courseware/coursewaretype/2.png" />':mapwaretypeicon[parseInt(i.courseWareType)]?'<img class="tag" src="'+a.getCoverType(i.courseWareType,i.liveType)+'" />':"",f=i.courseWareType==0||i.courseWareType==8?'<img class="vico" src="/design/designstatic/common/image/course/videoico.png" />':"",p='<a target="'+(iniframe?"_parent":"_blank")+'" href="'+l+'" ><div class="searchCouseWareLi"><div class="cover"><img src="'+n+'" /> '+h+f+' </div><div class="contentbox"><div class="cousewarename">'+o+'</div><div class="cousewareintro">'+c+"</div></div></div><a>";r+=p}),$(".coursemain").append("<div class='searchCouseWareUl'>"+(a.searchTotal?r:"<div class='nodata'></div>")+"</div>")}})},getCoverType:function(a,s){var e="",t=["/design/designstatic/aroom/img/courseware/coursewaretype/15.png","/design/designstatic/aroom/img/courseware/coursewaretype/12.png","/design/designstatic/aroom/img/courseware/coursewaretype/19.png","/design/designstatic/aroom/img/courseware/coursewaretype/17.png","/design/designstatic/aroom/img/courseware/coursewaretype/14.png","/design/designstatic/aroom/img/courseware/coursewaretype/13.png","","","","/design/designstatic/aroom/img/courseware/coursewaretype/18.png","","/design/designstatic/aroom/img/courseware/coursewaretype/16.png","",""];return e=s=="4"?(window.cdnPath||"")+"/design/designstatic/aroom/img/courseware/coursewaretype/11.png":t[parseInt(a)],e},isLive:function(a){switch(a){case"1":return!0;case"2":return!0;case"3":return!0;case"4":return!0;case"5":return!0;case"11":return!0;default:return!1}},_live:function(a){var s={a:!1,b:!1,c:!1,d:!1,f:!1,g:!1,end:!1};return(a==="1"||a==="2"||a==="3"||a==="4"||a==="5"||a==="11")&&(s.a=1),(a==="0"||a==="1"||a==="2"||a==="3"||a==="4"||a==="5"||a==="11")&&(s.c=3),(a==="0"||a==="1"||a==="2"||a==="3"||a==="4"||a==="5"||a==="11")&&(s.g=!0,s.d=!0),s},stateLive:function(a,s,e,t,r,i){var n=this,o=n.setIntervalNumber,c=s||e;if(o<a)return"\u76F4\u64AD\u672A\u5F00\u59CB";if(o>=a&&o<=a+c*1e3)return"\u76F4\u64AD\u4E2D";if(o>=a+c*1e3)return i&&t===1||!i?r?n._compareTime(r,a+c*1e3)==="wait"?"\u56DE\u770B\u672A\u5F00\u59CB":n._compareTime(r,a+c*1e3)?"\u56DE\u770B":"\u56DE\u770B\u7ED3\u675F":"\u76F4\u64AD\u7ED3\u675F":"\u8F6C\u7801\u4E2D"},timestampToTime:function(a){var s=new Date(a*1e3),e=s.getFullYear()+"-",t=(s.getMonth()+1<10?"0"+(s.getMonth()+1):s.getMonth()+1)+"-",r=(s.getDate()<10?"0"+s.getDate():s.getDate())+" ",i=(s.getHours()<10?"0"+s.getHours():s.getHours())+":",n=s.getMinutes()<10?"0"+s.getMinutes():s.getMinutes();return e+t+r+i+n},_compareTime:function(a,s){var e=this,t=e.setIntervalNumber,r=a&&a!='""'&&JSON.parse(a)[0]!=""?e.timestampToTime(JSON.parse(a)[0]):"",i=a&&a!='""'&&JSON.parse(a)[1]!=""?e.timestampToTime(JSON.parse(a)[1]):"",n=o=>{var c=new Date(o);return Date.parse(c)};return r&&i?t>n(r)&&t<n(i)?!0:t<n(r)?"wait":!1:r?t>n(r)?!0:"wait":i?t<n(i):!!(t>s&&a&&JSON.parse(a)[0]==="")},renderItem:function(a){var s=this,e="",t=a.isPay===void 0?!1:a.isPay,r=+a.courseType,i=void 0,n=getPar("att")?"&att="+decodeURIComponent(getPar("att")):"",o=getPar("vcardId")?"&vcardId="+decodeURIComponent(getPar("vcardId")):"",c=getPar("shareId")?"&shareId="+decodeURIComponent(getPar("shareId")):"";t?i="/myroom/#/learn/detail/"+a.courseId:r===2||r===4?i="/pages/wap/bundle.html?cid="+a.courseId+n+o+c:i="/pages/wap/info.html?cid="+a.courseId+n+o+c,a.isAllAudio&&(i="/liveclass/songsheet.html?courseId="+a.courseId+n+o+c);var d='<div class="course-cover"><a class="course-link" href="'+i+'" target="'+(iniframe?"_parent":"_blank")+'">',l='<a class="li-btn" href="'+i+'" target="'+(iniframe?"_parent":"_blank")+'"><a class="item-name" target="'+(iniframe?"_parent":"_blank")+'" href="'+i+'" title="'+a.courseName+'">'+a.courseName+'</a><p class="item-realname" title="'+a.mainTeacher+'">'+a.mainTeacher+"</p>"+d,h="<img src="+((window.cdnPath||"")+a.cover)+">";return a.originalCover&&(h="<img src="+((window.cdnPath||"")+resetImgSrc(a.cover))+' data-errorcount="0" onerror="coverError(&quot'+((window.cdnPath||"")+a.cover)+'&quot)" >'),e+="<li>"+l+h+"<div><p>"+a.introduce+"</p></div></a></div>",e+='<a class="course-info" href="javascript:void(0);">',e+=s.renderitemInfo(a),e+="</a>",e+="</li>",e},renderitemInfo:function(a){var s='<span class="price">'+(a.showPrice==1?a.price=="0"?'<span style="color: #43bc60;">\u514D\u8D39</span>':'<span style="color: #fa5353;">\uFFE5'+(a.price/100).toFixed(2)+"</span>":"")+"</span>",e=parseInt(a.orderCount)?'<span class="buynum">'+a.orderCount+"\u4EBA\u8D2D\u4E70</span>":"",t=parseInt(a.popularityCount)?'<span class="viewnum">'+a.popularityCount+"\u4EBA\u89C2\u770B</span>":"",r='<div class="course-info"><p>'+s+e+t+"</p></div>";return r},infocoverUrl:function(a){return(a||"").replace(/(^\s*)/g,"").indexOf("http")!=0&&(a||"").indexOf(cdnPath)<0&&(a||"").indexOf("data:image")!==0?(window.cdnPath||"")+a:a},getChannel:function(){var a=navigator.userAgent.toLowerCase();if(window.__wxjs_environment==="miniprogram")return 4;if(a.match(/MicroMessenger/i)=="micromessenger"){var s={win:!1,mac:!1},e=navigator.platform;return s.win=e.indexOf("Win")==0,s.mac=e.indexOf("Mac")==0,s.win||s.mac?9:1}else return window.localStorage.appAdapt==="true"||window.localStorage.appAdapt===!0?5:getPar("channel")?getPar("channel"):/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)?2:3},initvcardheader:function(){var a=this,s=getPar("att")?decodeURIComponent(getPar("att")):"";s&&($(".shareUserBox").remove(),$.ajax({headers:{token:getCookie("token")},type:"GET",url:"/api/common/getHpsAttInfo",data:{att:s},dataType:"json",async:!1,success:function(e){if(e.code==200){var t=e.data||{},r=t.mobile||"",i=t.position||"",n=t.schoolName||"",o=t.wcQrImg||"",c=t.wxAccount||"",d=t.headPortrait||"",l=t.realName||t.nickname||t.loginName||"",h=t.vcardId||"",f="";$.ajax({headers:{token:getCookie("token")},type:"GET",url:"/api/welink/miniApp/getForApp",data:{},dataType:"json",async:!1,success:function(v){var m=v.data||{},y=m.appUserName||"";f='<wx-open-launch-weapp style="cursor: pointer;width:24px;display: block;height: 24px;margin-right: 25px;background: url('+(window.cdnPath||"")+'/appstatic/images/sharemeassge.png) 50% center / 24px no-repeat;" id="launch-img-btn" username="'+(y||(cdnPath=="//static.wxbig.cn"?"gh_9703393594ca":"gh_ccc75aff795b"))+'" path="'+("/pages/cardDetail/cardDetail?cardIdStr="+encodeURIComponent(h))+'" ><script type="text/wxtag-template"> <div style="cursor: pointer;width:24px;display: block;height: 24px;"></div> </script></wx-open-launch-weapp>'}});var p='<div class="shareUserBox"><div class="cover"><img src="'+a.infocoverUrl(d)+'" /></div><div class="userdetail"><div class="username">'+l+"<span>"+i+'</span></div><div class="usergs">'+n+"</div> </div>"+(h&&(a.getChannel()=="1"||a.getChannel()=="9")&&(location.hostname.indexOf("xx.cn")>-1||location.hostname.indexOf("1x.cn")>-1||location.hostname.indexOf("xx.vip")>-1)?f:"")+(c||o?'<div class="userwx"><a></a></div>':"")+(r?'<div class="userphone"><a href="tel:'+r+'"></a></div>':"")+"</div>";if($("body").prepend(p),$(".shareUserBox .userwx a").on("click",function(){var v=$("body").width(),m=v>=414?351:v<=320?288:319,y=layer.open({title:"",className:"layui-layer-antd layui-layer-initeantd ",skin:"nohasbtn",anim:"scale",scrollbar:!1,end:function(){$("html, body").css({overflow:"visible",height:"auto"})},success:function(w){},content:"<div style='padding:24px;box-sizing:border-box; text-align: left;width:"+m+"px;'> <div style='display:flex;align-items:center;'> <div style='width:60px;height:60px;border-radius:50%;overflow:hidden;position: relative;margin-right: 16px;'><img style='width: 100%; height: 100%; position: absolute;top: 0px; left: 0px;' src='"+a.infocoverUrl(d)+"' /></div><div style='flex: 1; overflow: hidden;'><div style='font-size: 18px;color: #333333;margin-bottom: 14px;white-space: nowrap; overflow: hidden; text-overflow: ellipsis;'>"+l+"<span style='font-size:16px;color:#666666;margin-left:13px;'>"+i+"</span></div><div style='font-size:16px;color:#666666;white-space: nowrap; overflow: hidden; text-overflow: ellipsis;'>"+n+"</div></div></div>"+(o?"<div style='font-size:16px;color:#333333;margin-top:30px;'> <div style='width:180px;height:180px;margin:0px auto;position: relative;'><img style='width: 100%; height: 100%; position: absolute;top: 0px; left: 0px;' src='"+a.infocoverUrl(o)+"' /></div> </div>":"")+(c?"<div style='font-size:16px;color:#333333;margin-top:30px; text-align: center;'>\u5FAE\u4FE1\u53F7\uFF1A<span style='font-size:18px;color:#333333;'>"+c+"</span></div>":"")+"<div style='font-size:16px;color:#333333;margin-top:30px; text-align: center;'>\u957F\u6309\u4FDD\u5B58\u5FAE\u4FE1\u4E8C\u7EF4\u7801</div></div>"})}),h){var g=getPar("shareId")?"&shareId="+decodeURIComponent(getPar("shareId")):"";$(".shareUserBox .cover,.shareUserBox .userdetail").on("click",function(){window.location.href=window.location.origin+"/vscard/views.html?vcardId="+h+"&att="+s+g})}}}}))},clearList:function(){var a=this;a.isLoadWare=!0,a.currentPage=1,$(".coursemain ul").html("")},getClassifys:function(){var a=this;$.ajax({type:"GET",url:"/api/course/getClassifys?projectid=12",contentType:"application/json",dataType:"json",data:{needShare:!0,needOther:!1},async:!0,success:function(s){s.success&&(a.getClassifysData=s.data,a.classifyData=s.data||[],a.getdesignUrl(),a.rendernewMainClassify())}})},rendernewMainClassify:function(){var a=this,s="";if(a.classifyData.forEach(function(r){s+='<a class="cid" tabs="'+r.courseClassifyId+'" href="javascript:void(0);">'+r.classifyName+"</a>",r.courseClassifyId===a.mainClassify&&(a.classifyData2=r.children||[])}),$(".mb-plate-nav").append(s),a.classifyData2.length){$(".mb-plate-nav a").removeClass("curs"),$(".mb-plate-nav a[tabs="+a.mainClassify+"]").addClass("curs");var e='<a class="cid curs" zindex="1" tabs="" href="javascript:void(0);">\u5168\u90E8 </a>';a.classifyData2.forEach(function(r){e+='<a class="cid" zindex="1" tabs="'+r.courseClassifyId+'" href="javascript:void(0);">'+r.classifyName+"</a>",r.courseClassifyId===a.childClassify&&(a.classifyData3=r.children||[])}),$(".mb-plate-nav2").html(e),$(".mb-plate-nav2").show(),a.childClassify&&($(".mb-plate-nav2 a").removeClass("curs"),$(".mb-plate-nav2 a[tabs="+a.childClassify+"]").addClass("curs"))}if(a.classifyData3.length){var t='<a class="cid curs" zindex="2" tabs="" href="javascript:void(0);">\u5168\u90E8 </a>';a.classifyData3.forEach(function(r){t+='<a class="cid" zindex="2" tabs="'+r.courseClassifyId+'" href="javascript:void(0);">'+r.classifyName+"</a>"}),$(".mb-plate-nav3").html(t),$(".mb-plate-nav3").show()}$(".coursetit-an-menu").on("click","a",function(){var r=$(this);if(r.text()==="\u5168\u90E8")$(".mb-plate-nav2,.mb-plate-nav3,.mb-plate-nav4,.mb-plate-nav5,.mb-plate-nav6").hide(),$(".coursetit-an-menu a").removeClass("curs"),a.mainClassify="",a.childClassify="",$(this).addClass("curs");else if(r.hasClass("cid")){var i=r.attr("zindex")||0;if(i==5)a.childClassify=r.attr("tabs"),$(".mb-plate-nav6 a").removeClass("curs"),$(this).addClass("curs");else if(i==4){a.childClassify=r.attr("tabs"),$(".mb-plate-nav5 a").removeClass("curs"),$(".mb-plate-nav6").hide(),$(this).addClass("curs");var n=a.classifyData5.filter(function(c){return c.courseClassifyId==a.childClassify});if(a.classifyData6=(n[0]||{}).children||[],a.classifyData6.length){var o='<a class="cid curs" zindex="5" tabs="" href="javascript:void(0);">\u5168\u90E8 </a>';a.classifyData6.forEach(function(c){o+='<a class="cid" zindex="5" tabs="'+c.courseClassifyId+'" href="javascript:void(0);">'+c.classifyName+"</a>"}),$(".mb-plate-nav6").html(o),$(".mb-plate-nav6").show()}}else if(i==3){a.childClassify=r.attr("tabs"),$(".mb-plate-nav4 a").removeClass("curs"),$(".mb-plate-nav5,.mb-plate-nav6").hide(),$(this).addClass("curs");var n=a.classifyData4.filter(function(d){return d.courseClassifyId==a.childClassify});if(a.classifyData5=(n[0]||{}).children||[],a.classifyData5.length){var o='<a class="cid curs" zindex="4" tabs="" href="javascript:void(0);">\u5168\u90E8 </a>';a.classifyData5.forEach(function(l){o+='<a class="cid" zindex="4" tabs="'+l.courseClassifyId+'" href="javascript:void(0);">'+l.classifyName+"</a>"}),$(".mb-plate-nav5").html(o),$(".mb-plate-nav5").show()}}else if(i==2){a.childClassify=r.attr("tabs"),$(".mb-plate-nav3 a").removeClass("curs"),$(".mb-plate-nav4,.mb-plate-nav5,.mb-plate-nav6").hide(),$(this).addClass("curs");var n=a.classifyData3.filter(function(d){return d.courseClassifyId==a.childClassify});if(a.classifyData4=(n[0]||{}).children||[],a.classifyData4.length){var o='<a class="cid curs" zindex="3" tabs="" href="javascript:void(0);">\u5168\u90E8 </a>';a.classifyData4.forEach(function(l){o+='<a class="cid" zindex="3" tabs="'+l.courseClassifyId+'" href="javascript:void(0);">'+l.classifyName+"</a>"}),$(".mb-plate-nav4").html(o),$(".mb-plate-nav4").show()}}else if(i==1){a.childClassify=r.attr("tabs"),$(".mb-plate-nav2 a").removeClass("curs"),$(".mb-plate-nav3,.mb-plate-nav4,.mb-plate-nav5,.mb-plate-nav6").hide(),$(this).addClass("curs");var n=a.classifyData2.filter(function(d){return d.courseClassifyId==a.childClassify});if(a.classifyData3=(n[0]||{}).children||[],a.classifyData3.length){var o='<a class="cid curs" zindex="2" tabs="" href="javascript:void(0);">\u5168\u90E8 </a>';a.classifyData3.forEach(function(l){o+='<a class="cid" zindex="2" tabs="'+l.courseClassifyId+'" href="javascript:void(0);">'+l.classifyName+"</a>"}),$(".mb-plate-nav3").html(o),$(".mb-plate-nav3").show()}}else{a.mainClassify=r.attr("tabs"),$(".mb-plate-nav a").removeClass("curs"),$(".mb-plate-nav2,.mb-plate-nav3,.mb-plate-nav4,.mb-plate-nav5,.mb-plate-nav6").hide(),$(this).addClass("curs");var n=a.classifyData.filter(function(d){return d.courseClassifyId==a.mainClassify});if(a.classifyData2=n[0].children||[],a.classifyData2.length){var o='<a class="cid curs" zindex="1" tabs="" href="javascript:void(0);">\u5168\u90E8 </a>';a.classifyData2.forEach(function(l){o+='<a class="cid" zindex="1" tabs="'+l.courseClassifyId+'" href="javascript:void(0);">'+l.classifyName+"</a>"}),$(".mb-plate-nav2").html(o),$(".mb-plate-nav2").show()}}}a.clearList(),a.getList()})},renderMainClassify:function(){var a=this,s=$(".coursetit-an-menu"),e=s.find(".an-menu-left"),t="",r=0,i=!0;a.first=!0,a.getClassifysData.forEach(function(o,c){parseInt(a.mainClassify)==o.courseClassifyId&&(r=c,i=!1),t+='<div class="an-menu-li" mainid="'+o.courseClassifyId+'">'+o.classifyName+"</div>"}),e.html(t),a.renderChildClassify(r,i);var n=e.find(".an-menu-li");n.on("click",function(){$(this).hasClass("on")?a.renderChildClassify($(this).index(),!0):a.renderChildClassify($(this).index())})},renderChildClassify:function(a,s){var e=this,t=e.getClassifysData[a],r=t.children||[],i=$(".coursetit-an-menu"),n=i.find(".an-menu-left"),o=n.find(".an-menu-li").eq(a);n.find(".on").removeClass("on"),s?e.mainClassify="":(e.mainClassify=o.attr("mainid"),o.addClass("on")),e.first||(e.childClassify="",e.clearList(),e.getList());var c=i.find(".an-menu-right"),d="";r.forEach(function(f){e.first&&parseInt(f.courseClassifyId)==e.childClassify?d+='<div class="an-menu-li on" childid="'+f.courseClassifyId+'">'+f.classifyName+"<i></i></div>":d+='<div class="an-menu-li" childid="'+f.courseClassifyId+'">'+f.classifyName+"<i></i></div>"});var l=r.length<1?"<div class='nodata' style='background-size: 525px auto;min-height: 100%;'></div>":d;c.html(l);var h=c.find(".an-menu-li");h.on("click",function(){c.find(".on").removeClass("on"),$(this).addClass("on"),e.childClassify=$(this).attr("childid"),e.clearList(),e.getList()}),e.first=!1},getGlobalDesignConfig:function(){var a=setInterval(function(){if(window.roominfo){clearInterval(a);var s=window.roominfo.schoolId;$.getScript((window.cdnPath||"")+"/uploads/common/designConfig/"+s+".js",function(){if(window.DesignConfig){var e=(window.DesignConfig.viewNum?"viewNumShow ":"")+(window.DesignConfig.buyNum?"buyNumShow ":"")+(window.DesignConfig.price?"priceShow ":"");$(".coursemain ul").addClass(e)}})}},200)},bindEvent:function(){var a=this;$(window).scroll(function(){var e=$(this).scrollTop(),t=$(document).height(),r=$(this).height(),i=e+r;i+700>=t&&a.isLoadWare&&(a.isLoadWare=!1,a.currentPage=a.currentPage+1,a.getList())});var s=$(".search_input");$(".c-header-search .ch-search-okBtn").on("click",function(){a.condition=s.val(),a.clearList(),a.getList()}),$(".c-header-search .chs-input-close").on("click",function(){a.condition&&(a.condition="",a.clearList(),a.getList())}),a.changeTap(),a.changeClassify()},changeTap:function(){var a=this,s=$(".coursetit li");s.on("click",function(){var e=$(this);a.clearList(),s.removeClass("curs"),e.addClass("curs");var t=parseInt(e.attr("tabs"));a.sortType==t?e.hasClass("drop")?(e.removeClass("drop"),a.sortord=7):(e.addClass("drop"),a.sortord=8):($(".drop").removeClass("drop"),a.sortord=7),a.sortType=t,a.getList()})},changeSort:function(){var a=this,s=$(".mask_filter"),e=$(".coursetit");$(".sortbtn").on("click",function(){a.hideMaskFilter(!1),e.hasClass("sortFilter")?a.hidesortMaskFilter(!1):a.hidesortMaskFilter(!0)}),$(".coursesort-an-menu .an-menu-li").on("click",function(){var t=$(this).attr("sorttype");a.clearList(),t=="0"?(a.sortType=1,a.sortord=7):t=="1"?(a.sortType=2,a.sortord=7):t=="2"?(a.sortType=9,a.sortord=8):t=="3"?(a.sortType=9,a.sortord=7):(a.sortType=1,a.sortord=7),$(".coursesort-an-menu .an-menu-li").removeClass("on"),$(this).addClass("on"),a.getList()}),s.on("click",function(){a.hidesortMaskFilter(!1)}),$(".c-header-menu").on("click",function(){a.hidesortMaskFilter(!1,!0)})},changeClassify:function(){var a=this,s=$(".mask_filter"),e=$(".coursetit");$(".saitan").on("click",function(){a.hidesortMaskFilter(!1),e.hasClass("topFilter")?a.hideMaskFilter(!1):a.hideMaskFilter(!0)}),s.on("click",function(){a.hideMaskFilter(!1)}),$(".c-header-menu").on("click",function(){a.hideMaskFilter(!1,!0)})},hideMaskFilter:function(a,s){var e=$(".common-header"),t=$(".mask_filter"),r=$(".coursetit"),i=$("html, body");a?(t.show(),e.addClass("topFilter"),r.addClass("topFilter"),i.css({height:"100%",overflow:"hidden"})):(t.hide(),e.removeClass("topFilter"),r.removeClass("topFilter"),s||i.css({height:"auto",overflow:"visible"}))},hidesortMaskFilter:function(a,s){var e=$(".common-header"),t=$(".mask_filter"),r=$(".coursetit"),i=$("html, body");a?(t.show(),e.addClass("sortFilter"),r.addClass("sortFilter"),i.css({height:"100%",overflow:"hidden"})):(t.hide(),e.removeClass("sortFilter"),r.removeClass("sortFilter"),s||i.css({height:"auto",overflow:"visible"}))}};u.init()})();