index-legacy.13476074.js 7.4 KB

1
  1. !function(){function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function t(t){for(var a=1;a<arguments.length;a++){var s=null!=arguments[a]?arguments[a]:{};a%2?e(Object(s),!0).forEach((function(e){n(t,e,s[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(s)):e(Object(s)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(s,e))}))}return t}function n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t,n,a,s,r,i){try{var o=e[r](i),u=o.value}catch(c){return void n(c)}o.done?t(u):Promise.resolve(u).then(a,s)}function s(e){return function(){var t=this,n=arguments;return new Promise((function(s,r){var i=e.apply(t,n);function o(e){a(i,s,r,o,u,"next",e)}function u(e){a(i,s,r,o,u,"throw",e)}o(void 0)}))}}var r=document.createElement("style");r.innerHTML="._videoClass_1udm0_1 .van-list__loading,._videoClass_1udm0_1 .van-list__finished-text,._videoClass_1udm0_1 .van-list__error-text{width:100%}._videoClass_1udm0_1 .van-sticky--fixed{box-shadow:.26667rem .26667rem .26667rem var(--box-shadow-color)}._videoClass_1udm0_1 ._label_1udm0_9{margin-right:.21333rem;font-size:.37333rem}._videoClass_1udm0_1 ._label_1udm0_9 .van-list__loading,._videoClass_1udm0_1 ._label_1udm0_9 .van-list__finished-text,._videoClass_1udm0_1 ._label_1udm0_9 .van-list__error-text{width:100%}._videoClass_1udm0_1 ._label_1udm0_9 .iconfont-down{margin-left:.10667rem}._videoClass_1udm0_1 ._classHeader_1udm0_21{background:linear-gradient(#59e5d5,30%,#ffffff)}._videoClass_1udm0_1 ._banner_1udm0_24{background:#fff;padding:.32rem .37333rem}._videoClass_1udm0_1 ._videoList_1udm0_28{display:flex;justify-content:space-between;flex-wrap:wrap;padding:.37333rem}\n",document.head.appendChild(r),System.register(["./index-legacy.78c8492b.js","./index-legacy.e8dcdcc8.js","./index-legacy.f8641610.js","./index-legacy.4ddb0119.js","./index-legacy.13f535d5.js","./video-item-legacy.ff7b3898.js","./organ-search-legacy.3d1eeb1b.js","./hooks-legacy.1d4168e3.js","./index-legacy.90f7f902.js","./use-height-legacy.be763bb2.js","./index-legacy.fc510843.js","./index-legacy.8a3dede6.js","./use-id-legacy.30c2e9af.js","./use-tab-status-legacy.5d29085f.js","./index-legacy.c8b60294.js","./index-legacy.28050159.js"],(function(e){"use strict";var n,a,r,i,o,u,c,l,d,f,p,m,b,h,_,g,j;return{setters:[function(e){n=e.C},function(e){a=e.C},function(e){r=e.d,i=e.s,o=e.e,u=e.i,c=e.N,l=e.C,d=e.aT,f=e.$},function(e){p=e.S},function(e){m=e.L},function(e){b=e.V},function(e){h=e.O},function(e){_=e.a,g=e.u,j=e.S},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){var v="_videoClass_1udm0_1",S="_label_1udm0_9",y="_classHeader_1udm0_21",x="_videoList_1udm0_28";e("default",r({name:"VideoClass",data:function(){return{apiSuffix:"STUDENT"===i.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 s(regeneratorRuntime.mark((function t(){var n,a,s,r,u,c,l;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,o.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"===i.platformType?(a=i.user.data).defaultSubject&&(e.params.lessonSubject=a.defaultSubject,e.params.subjectName=a.defaultSubjectName):(s=_(j.VIDEO)).id?(e.params.lessonSubject=Number(s.id),e.params.subjectName=s.name):(u=e.subjectList,c=(null===(r=i.user.data)||void 0===r?void 0:r.subjectId)||"",l=c?Number(c.split(",")[0]):null,u.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(),g("视频课");case 13:case"end":return t.stop()}}),t,null,[[0,7]])})))()},methods:{getList:function(){var e=this;return s(regeneratorRuntime.mark((function n(){var a,s,r,u;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,a=t({},e.params),i.version&&(a.version=i.version||"",a.platform="STUDENT"===i.platformType?"ios-student":"ios-teacher"),s="STUDENT"===i.platformType?"/api-student/videoLesson/selectGroup":"/api-teacher/videoLessonGroup/page",a.myself=!1,n.next=10,o.post(s,{data:t({},a)});case 10:if(r=n.sent,e.loading=!1,u=r.data||{},!(e.list.length>0&&1===u.pageNo)){n.next=15;break}return n.abrupt("return");case 15:e.list=e.list.concat(u.rows||[]),e.finished=u.pageNo>=u.totalPage,e.params.page=u.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 s(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,o.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"===i.platformType?this.setDefaultSubject(this.params.lessonSubject):this.params.lessonSubject&&_(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"===i.platformType&&(t.share=1),this.$router.push({path:"/videoDetail",query:t})}},render:function(){var e,t,s=this;return u("div",{class:v},[u(p,{offsetTop:0,position:"top"},{default:function(){return[u(n,{class:y,border:!1,isFixed:!1,background:"transparent"},null),u(a,{placeholder:"请输入老师名称/课程名称",onSearch:s.onSearch},{left:function(){return u("div",{class:S,onClick:function(){s.searchStatus=!s.searchStatus,s.openStatus=!s.openStatus}},[s.params.subjectName,u(c,{classPrefix:"iconfont",name:"down",size:12,color:"#333"},null)])}})]}}),u("div",null,[this.dataShow?u(m,{class:x,loading:this.loading,"onUpdate:loading":function(e){return s.loading=e},finished:this.finished,finishedText:"没有更多了",onLoad:this.getList,immediateCheck:!1},(t=e=this.list.map((function(e){return u(b,{item:e,onClick:s.onDetail},null)})),"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!f(t)?e:{default:function(){return[e]}})):u(l,{btnStatus:!1,tips:"暂无视频课"},null)]),u(d,{show:this.searchStatus,position:"bottom",round:!0,closeable:!0,"safe-area-inset-bottom":!0,onClose:function(){return s.searchStatus=!1},onClosed:function(){return s.openStatus=!1}},{default:function(){return[s.openStatus&&u(h,{subjectList:s.subjectList,onSort:s.onSort,modelValue:s.params.lessonSubject,"onUpdate:modelValue":function(e){return s.params.lessonSubject=e},subjectName:s.params.subjectName,"onUpdate:subjectName":function(e){return s.params.subjectName=e}},null)]}})])}}))}}}))}();