!function(){function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var r=1;r0&&r(s,null,[r("i",null,[a("¥")]),null==t?void 0:t.lessonPrice]),(null==t?void 0:t.lessonPrice)<=0&&0!==t.auditVersion&&r(s,null,[r("i",null,[a("¥")]),a("0")]),(null==t?void 0:t.lessonPrice)<=0&&0===t.auditVersion&&r("span",{style:{color:"#20BEA0"}},[a("免费")])])]),r("span",{class:E},[a("/"),null==t?void 0:t.lessonCount,a("课时")])]),r("div",{class:L},[null==t?void 0:t.countStudent,a("人学习")])])])}});e("default",n({name:"VideoClass",data:function(){return{apiSuffix:"STUDENT"===o.platformType?"/api-student":"/api-teacher",search:"",list:[],dataShow:!0,loading:!1,finished:!1,listLoading:!0,params:{search:"",lessonSubject:null,subjectName:"全部声部",page:1,rows:20},searchStatus:!1,openStatus:!1,subjectList:[]}},mounted:function(){var e=this;return i(regeneratorRuntime.mark((function t(){var n,r,i,a,s,c,l;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,u.get("".concat(e.apiSuffix,"/subject/subjectSelect?type=VIDEO"));case 3:n=t.sent,e.subjectList=n.data||[],t.next=9;break;case 7:t.prev=7,t.t0=t.catch(0);case 9:"TEACHER"===o.platformType?(r=o.user.data).defaultSubject&&(e.params.lessonSubject=r.defaultSubject,e.params.subjectName=r.defaultSubjectName):(i=h(j.VIDEO)).id?(e.params.lessonSubject=Number(i.id),e.params.subjectName=i.name):(s=e.subjectList,c=(null===(a=o.user.data)||void 0===a?void 0:a.subjectId)||"",l=c?Number(c.split(",")[0]):null,s.forEach((function(t){(t.subjects||[]).forEach((function(t){t.id===Number(l)&&(e.params.lessonSubject=t.id,e.params.subjectName=t.name)}))}))),e.listLoading=!1,e.getList(),S("视频课");case 13:case"end":return t.stop()}}),t,null,[[0,7]])})))()},methods:{getList:function(){var e=this;return i(regeneratorRuntime.mark((function n(){var r,i,a,s;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(n.prev=0,!e.listLoading){n.next=3;break}return n.abrupt("return");case 3:return e.listLoading=!0,r=t({},e.params),o.version&&(r.version=o.version||"",r.platform="STUDENT"===o.platformType?"ios-student":"ios-teacher"),i="STUDENT"===o.platformType?"/api-student/videoLesson/selectGroup":"/api-teacher/videoLessonGroup/page",r.myself=!1,n.next=10,u.post(i,{data:t({},r)});case 10:if(a=n.sent,e.loading=!1,s=a.data||{},!(e.list.length>0&&1===s.pageNo)){n.next=15;break}return n.abrupt("return");case 15:e.list=e.list.concat(s.rows||[]),e.finished=s.pageNo>=s.totalPage,e.params.page=s.pageNo+1,e.dataShow=e.list.length>0,n.next=25;break;case 21:n.prev=21,n.t0=n.catch(0),e.dataShow=!1,e.finished=!0;case 25:return n.prev=25,e.listLoading=!1,n.finish(25);case 28:case"end":return n.stop()}}),n,null,[[0,21,25,28]])})))()},setDefaultSubject:function(e){return i(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,u.post("/api-teacher/teacher/defaultSubject",{params:{subjectId:e}});case 3:t.next=7;break;case 5:t.prev=5,t.t0=t.catch(0);case 7:case"end":return t.stop()}}),t,null,[[0,5]])})))()},onSort:function(){this.params.page=1,this.list=[],this.dataShow=!0,this.loading=!1,this.finished=!1,this.searchStatus=!1,"TEACHER"===o.platformType?this.setDefaultSubject(this.params.lessonSubject):this.params.lessonSubject&&h(j.VIDEO,JSON.stringify({id:this.params.lessonSubject,name:this.params.subjectName}),"set"),this.getList()},onSearch:function(e){this.params.search=e,this.onSort()},onDetail:function(e){var t={groupId:e.id};"TEACHER"===o.platformType&&(t.share=1),this.$router.push({path:"/videoDetail",query:t})}},render:function(){var e,t,n=this;return r("div",{class:y},[r(p,{offsetTop:0,position:"top"},{default:function(){return[r(m,{class:x,border:!1,isFixed:!1,background:"transparent"},null),r(f,{placeholder:"请输入老师名称/课程名称",onSearch:n.onSearch},{left:function(){return r("div",{class:w,onClick:function(){n.searchStatus=!n.searchStatus,n.openStatus=!n.openStatus}},[n.params.subjectName,r(c,{classPrefix:"iconfont",name:"down",size:12,color:"#333"},null)])}})]}}),r("div",null,[this.dataShow?r(g,{class:C,loading:this.loading,"onUpdate:loading":function(e){return n.loading=e},finished:this.finished,finishedText:"没有更多了",onLoad:this.getList,immediateCheck:!1},(t=e=this.list.map((function(e){return r(R,{item:e,onClick:n.onDetail},null)})),"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!_(t)?e:{default:function(){return[e]}})):r(l,{btnStatus:!1,tips:"暂无视频课"},null)]),r(d,{show:this.searchStatus,position:"bottom",round:!0,closeable:!0,"safe-area-inset-bottom":!0,onClose:function(){return n.searchStatus=!1},onClosed:function(){return n.openStatus=!1}},{default:function(){return[n.openStatus&&r(b,{subjectList:n.subjectList,onSort:n.onSort,modelValue:n.params.lessonSubject,"onUpdate:modelValue":function(e){return n.params.lessonSubject=e},subjectName:n.params.subjectName,"onUpdate:subjectName":function(e){return n.params.subjectName=e}},null)]}})])}}))}}}))}();