2 lines
5.6 KiB
JavaScript
2 lines
5.6 KiB
JavaScript
|
function list(s,l,t,r,c){$.ajax({headers:{token:getCookie("token"),resolution:window.screen.width+"*"+window.screen.height},type:"GET",url:"/api/course/getSelectionCourseList?projectid=12",data:{sortType:s,currentPage:c,sortord:7,mainClassify:l,condition:r,childClassify:t},dataType:"json",async:!0,success:function(o){var n=o.data,e="",f="";console.log(n);for(var d=0,u=n.list.length;d<u;d++){var a=n.list[d],v=a.courseId;e+="<li>",a.isAllAudio?(e+='<a style="width:100%;height:100%;display:block;" href="/liveclass/songsheet.html?courseId='+a.courseId+'" target="_blank">',e+='<a class="item-name" href="/liveclass/songsheet.html?courseId='+a.courseId+'" target="_blank" title='+a.courseName+">"+a.courseName+"</a>",e+='<div class="course-cover">',e+='<a class="course-link" href="/liveclass/songsheet.html?courseId='+a.courseId+'" target="_blank">'):a.isPay==!0?(e+='<a style="width:100%;height:100%;display:block;" href="/myroom/#/learn/center" target="_blank"></a>',e+='<a class="item-name" href="/myroom/#/learn/center" target="_blank" title='+a.courseName+">"+a.courseName+"</a>",e+='<div class="course-cover">',e+='<a class="course-link" href="/myroom/#/learn/center" target="_blank">'):a.courseType==2?(e+='<a style="width:100%;height:100%;display:block;" href="/pages/routine/bundle.html?cid='+a.courseId+'" target="_blank">',e+='<a class="item-name" href="/pages/routine/bundle.html?cid='+a.courseId+'" target="_blank" title='+a.courseName+">"+a.courseName+"</a>",e+='<div class="course-cover">',e+='<a class="course-link" href="/pages/routine/bundle.html?cid='+a.courseId+'" target="_blank">'):(e+='<a style="width:100%;height:100%;display:block;" href="/pages/routine/info.html?cid='+a.courseId+'" target="_blank">',e+='<a class="item-name" href="/pages/routine/info.html?cid='+a.courseId+'" target="_blank" title='+a.courseName+">"+a.courseName+"</a>",e+='<div class="course-cover">',e+='<a class="course-link" href="/pages/routine/info.html?cid='+a.courseId+'" target="_blank">'),e+="<img src="+((window.cdnPath||"")+a.cover)+">",e+="<div><p>"+a.introduce+"</p></div>",e+="</a>",a.isPay==!0?e+='<a class="course-oper study" href="/myroom/#/learn/center" target="_blank">\u7ACB\u5373\u5B66\u4E60</a>':a.type==1?e+='<a class="course-oper secondkill" href="/pages/routine/info.html?cid='+a.courseId+'" target="_blank">\u9650\u65F6\u79D2\u6740</a>':a.type==2?e+='<a class="course-oper collage" href="/pages/routine/info.html?cid='+a.courseId+'" target="_blank">\u62FC\u56E2\u5546\u54C1</a>':a.type==3?e+='<a class="course-oper redprice" href="/pages/routine/info.html?cid='+a.courseId+'" target="_blank">\u780D\u4EF7\u5546\u54C1</a>':a.courseType==2?e+='<a class="course-oper coursepack" href="/pages/routine/bundle.html?cid='+a.courseId+'" target="_blank">\u8BFE\u7A0B\u5305</a>':e+='<a class="course-oper" href="/pages/routine/info.html?cid='+a.courseId+'" target="_blank">\u7ACB\u5373\u62A5\u540D</a>',e+="</div>",e+='<a class="course-info" href="javascript:void(0);">',e+='<span class="speaker" title='+a.mainTeacher+">"+a.mainTeacher+"</span> ",e+="</a>",e+="</a>",e+="</li>"}$("#pagination1").pagination({currentPage:c,totalPage:Math.ceil(n.total/20),count:20,callback:function(h){list(tab,l,t,r,h)}}),n.list.length==0?$(".coursemain ul").html("<div class='nodata'></div>"):$(".coursemain ul").html(e)}})}var keyWord=getPar("keyword");list(1,pid,cid,keyWord,1);var classifyData=[],tab="",pid="",cid="",keyWord="";$(".saitan").on("click",function(){$.ajax({type:"GET",url:"/api/course/getClassifys?projectid=12",contentType:"application/json",dataType:"json",data:{needOther:!1},async:!0,success:function(s){classifyData=s.data;var l=s.data,t="";for(i=0,len=l.length;i<len;i++){var r=l[i];t+='<a class="pid" tabs="'+r.courseClassifyId+'" href="javascript:void(0);">'+r.classifyName+"</a>"}$(".plate-nav").append(t)}}),layer.open({type:1,content:'<div class="filter"><div class="filterrig"><div class="plate-nav"><a class="pid curs" href="javascript:void(0);">\u5168\u90E8</a></div><div class="plate-nav2" style="display: none;"></div></div></div>',anim:"up",style:"position:fixed
|