index-legacy.e5768ed0.js 7.0 KB

1
  1. !function(){function e(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function t(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?e(Object(r),!0).forEach((function(e){a(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function a(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function n(e,t,a,n,r,s,i){try{var o=e[s](i),c=o.value}catch(u){return void a(u)}o.done?t(c):Promise.resolve(c).then(n,r)}function r(e){return function(){var t=this,a=arguments;return new Promise((function(r,s){var i=e.apply(t,a);function o(e){n(i,r,s,o,c,"next",e)}function c(e){n(i,r,s,o,c,"throw",e)}o(void 0)}))}}var s=document.createElement("style");s.innerHTML="._classHeader_y0jt7_1{background:linear-gradient(#59e5d5,30%,#ffffff)}._banner_y0jt7_4{background:#fff;padding:.32rem .37333rem}._label_y0jt7_8{margin-right:.21333rem;font-size:.37333rem}._label_y0jt7_8 .van-list__loading,._label_y0jt7_8 .van-list__finished-text,._label_y0jt7_8 .van-list__error-text{width:100%}._label_y0jt7_8 .iconfont-down{margin-left:.10667rem}._liveClass_y0jt7_20 .van-sticky--fixed{box-shadow:.26667rem .26667rem .26667rem var(--box-shadow-color)}\n",document.head.appendChild(s),System.register(["./ResizeObserver.es-legacy.9ef5ac8c.js","./index-legacy.402479d8.js","./index-legacy.46228add.js","./index-legacy.49dc34f1.js","./index-legacy.63f64e9b.js","./live-item-legacy.3828afa2.js","./organ-search-legacy.93684ce2.js","./hooks-legacy.b4b15558.js","./index-legacy.e9381954.js","./index-legacy.b5b73462.js","./use-id-legacy.4538a8e2.js","./use-tab-status-legacy.257600f9.js","./icon_teacher-legacy.42ba77b1.js","./index-legacy.31c9aada.js"],(function(e){"use strict";var a,n,s,i,o,c,u,l,f,d,p,b,m,h,j,g,y;return{setters:[function(e){a=e.d,n=e.g,s=e.y,i=e.j,o=e.N,c=e.C,u=e.aS,l=e.$},function(e){f=e.C},function(e){d=e.S},function(e){p=e.S},function(e){b=e.L},function(e){m=e.L},function(e){h=e.O},function(e){j=e.a,g=e.S,y=e.u},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){var v={classHeader:"_classHeader_y0jt7_1",banner:"_banner_y0jt7_4",label:"_label_y0jt7_8",liveClass:"_liveClass_y0jt7_20"};e("default",a({name:"liveClass",data:function(){return{apiSuffix:"STUDENT"===n.platformType?"/api-student":"/api-teacher",list:[],dataShow:!0,loading:!1,finished:!1,searchStatus:!1,openStatus:!1,subjectList:[],lockLoading:!1,params:{search:"",subjectId:null,subjectName:"全部声部",groupStatus:"APPLY",page:1,rows:20}}},mounted:function(){var e=this;return r(regeneratorRuntime.mark((function t(){var a,r,i,o,c,u,l;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,s.get("".concat(e.apiSuffix,"/subject/subjectSelect?type=LIVE"));case 3:a=t.sent,e.subjectList=a.data||[],t.next=9;break;case 7:t.prev=7,t.t0=t.catch(0);case 9:"TEACHER"===n.platformType?(r=n.user.data).defaultSubject&&(e.params.subjectId=r.defaultSubject,e.params.subjectName=r.defaultSubjectName):(i=j(g.LIVE)).id?(e.params.subjectId=Number(i.id),e.params.subjectName=i.name):(c=e.subjectList,u=(null===(o=n.user.data)||void 0===o?void 0:o.subjectId)||"",l=u?Number(u.split(",")[0]):null,c.forEach((function(t){(t.subjects||[]).forEach((function(t){t.id===Number(l)&&(e.params.subjectId=t.id,e.params.subjectName=t.name)}))}))),e.getList(),y("直播课");case 12:case"end":return t.stop()}}),t,null,[[0,7]])})))()},methods:{setDefaultSubject:function(e){return r(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,s.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"===n.platformType?this.setDefaultSubject(this.params.subjectId):this.params.subjectId&&j(g.LIVE,JSON.stringify({id:this.params.subjectId,name:this.params.subjectName}),"set"),this.getList()},onSearch:function(e){this.params.search=e,this.onSort()},getList:function(){var e=this;return r(regeneratorRuntime.mark((function a(){var r,i,o,c;return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(a.prev=0,!e.lockLoading){a.next=3;break}return a.abrupt("return");case 3:return e.lockLoading=!0,r=t({},e.params),n.version&&(r.version=n.version||"",r.platform="STUDENT"===n.platformType?"ios-student":"ios-teacher"),i="STUDENT"===n.platformType?"/api-student/courseGroup/queryPageCourseGroup":"/api-teacher/courseGroup/queryPageCourseGroup",r.myself=!1,a.next=10,s.post(i,{data:t({},r)});case 10:if(o=a.sent,e.lockLoading=!1,e.loading=!1,c=o.data||{},!(e.list.length>0&&1===c.pageNo)){a.next=16;break}return a.abrupt("return");case 16:e.list=e.list.concat(c.rows||[]),e.finished=c.pageNo>=c.totalPage,e.params.page=c.pageNo+1,e.dataShow=e.list.length>0,a.next=27;break;case 22:a.prev=22,a.t0=a.catch(0),e.dataShow=!1,e.finished=!0,e.lockLoading=!1;case 27:case"end":return a.stop()}}),a,null,[[0,22]])})))()},onDetail:function(e){var t={groupId:e.courseGroupId};"TEACHER"===n.platformType&&(t.share=1),this.$router.push({path:"/liveDetail",query:t})}},render:function(){var e,t,a=this;return i("div",{class:v.liveClass},[i(p,{offsetTop:0,position:"top"},{default:function(){return[i(f,{class:v.classHeader,border:!1,isFixed:!1,background:"transparent"},null),i(d,{placeholder:"请输入老师名称/课程名称",onSearch:a.onSearch},{left:function(){return i("div",{class:v.label,onClick:function(){a.searchStatus=!a.searchStatus,a.openStatus=!a.openStatus}},[a.params.subjectName,i(o,{classPrefix:"iconfont",name:"down",size:12,color:"#333"},null)])}})]}}),this.dataShow?i(b,{loading:this.loading,"onUpdate:loading":function(e){return a.loading=e},finished:this.finished,finishedText:" ",class:[v.liveList],onLoad:this.getList,immediateCheck:!1},(t=e=this.list.map((function(e){return i(m,{onClick:a.onDetail,liveInfo:e},null)})),"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!l(t)?e:{default:function(){return[e]}})):i(c,{btnStatus:!1,classImgSize:"SMALL",tips:"暂无直播课"},null),i(u,{show:this.searchStatus,position:"bottom",round:!0,closeable:!0,"safe-area-inset-bottom":!0,onClose:function(){return a.searchStatus=!1},onClosed:function(){return a.openStatus=!1}},{default:function(){return[a.openStatus&&i(h,{subjectList:a.subjectList,onSort:a.onSort,modelValue:a.params.subjectId,"onUpdate:modelValue":function(e){return a.params.subjectId=e},subjectName:a.params.subjectName,"onUpdate:subjectName":function(e){return a.params.subjectName=e}},null)]}})])}}))}}}))}();