index-legacy-cea07676.js 7.9 KB

1
  1. !function(){function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function t(t){for(var n=1;n<arguments.length;n++){var a=null!=arguments[n]?arguments[n]:{};n%2?e(Object(a),!0).forEach((function(e){r(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):e(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}function r(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(r!==undefined){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function n(e,t,r,n,a,i,o){try{var s=e[i](o),c=s.value}catch(u){return void r(u)}s.done?t(c):Promise.resolve(c).then(n,a)}function a(e){return function(){var t=this,r=arguments;return new Promise((function(a,i){var o=e.apply(t,r);function s(e){n(o,a,i,s,c,"next",e)}function c(e){n(o,a,i,s,c,"throw",e)}s(undefined)}))}}System.register(["./index-legacy-835c2a22.js","./index-legacy-2e328223.js","./index-legacy-84210917.js","./index-legacy-6fdf098d.js","./index-legacy-41b86618.js","./index-legacy-218b3714.js","./index-legacy-8aae7957.js","./use-tab-status-legacy-485fedbe.js","./index-legacy-c29fefdd.js"],(function(e,r){"use strict";var n,i,o,s,c,u,l,d,m,_,p,g,y,b,f,v,h,x,w,j,O,C;return{setters:[e=>{n=e.d,i=e.f,o=e.u,s=e.r,c=e.k,u=e.o,l=e.c,d=e.a,m=e.O,_=e.T,p=e.b,g=e.F,y=e.i,b=e.e,f=e.s,v=e.p},e=>{h=e.O},e=>{x=e.C},e=>{w=e.O},e=>{j=e.T,O=e.a},e=>{C=e.I},null,null,null],execute:function(){var L=document.createElement("style");L.textContent="._choiseHomework_uxrta_1{min-height:100vh;background:url("+new URL("banner-bg-446e3c29.png",r.meta.url).href+") no-repeat top center #C8ECF4;background-size:contain;box-sizing:border-box}._choiseHomework_uxrta_1 .van-sticky--fixed{background:url("+new URL("banner-bg-446e3c29.png",r.meta.url).href+") no-repeat top center;background-size:cover}._choiseHomework_uxrta_1 .van-tabs__nav{background:transparent}._topTabs_uxrta_14{background-color:#fff;margin:.32rem .32rem 0;border-radius:.32rem .32rem 0 0}._topTabs_uxrta_14 .van-tab{font-weight:600;font-size:.42667rem;color:#333;line-height:.58667rem}._topTabs_uxrta_14 .van-tabs__nav--line{padding:0}._topTabs_uxrta_14 .van-tabs__line{width:.69333rem;height:.08rem;background:#01C1B5;border-radius:.05333rem;bottom:.10667rem}._classroomTab_uxrta_35{margin:0 .32rem}._classroomTab_uxrta_35 .van-tab{font-size:.37333rem;color:rgba(0,0,0,.55)}._classroomTab_uxrta_35 .van-tab--active{font-weight:500;font-size:.42667rem;color:#00b2a7}._classroomTab_uxrta_35 .van-tabs__line{display:none}._container_uxrta_50{min-height:calc(100vh - var(--header-height));background-color:#fff;margin:0 .32rem;padding:.26667rem .37333rem 0}._container_uxrta_50._containerClass_uxrta_56{padding-left:.18667rem;padding-right:.18667rem;padding-top:.10667rem}._container_uxrta_50._containerClass_uxrta_56>div{padding:0}._container_uxrta_50._containerClass_uxrta_56>div>div{margin-bottom:0}._container_uxrta_50._containerClass_uxrta_56 .courseItem{margin-top:0;margin-bottom:.53333rem}._container_uxrta_50._containerClassOnly_uxrta_71{min-height:calc(100vh - var(--header-height) - .32rem);border-radius:.32rem .32rem 0 0;padding-top:.37333rem;margin-top:.32rem}._items_uxrta_77{display:flex;align-items:center;flex-wrap:wrap}._items_uxrta_77>div{margin-bottom:.32rem;width:100%;text-align:center}._items_uxrta_77>div ._inner_uxrta_87{width:100%;margin:0 auto}._items_uxrta_77>div ._img_uxrta_91{margin-top:0}._items_uxrta_77>div .van-image,._items_uxrta_77>div .van-image__error,._items_uxrta_77>div .van-image__loading{width:100%;min-height:3.41333rem}\n",document.head.appendChild(L);e("default",n({name:"courseList",setup(){const e=i(),r=o(),n=e.query.type;let L="music";"onlymusic"!==n&&(L=n);const k=s({topKey:L||"music",list:[],show:!0,actionKey:0,loading:!0,subjectList:[],classList:[],titleOpacity:0}),T=function(){var t=a((function*(){try{const e=yield b.get(f.platformApi+"/sysMusicScoreCategories/queryTree");k.list=e.data||[],k.show=k.list.length>0}catch(e){}}));return function(){return t.apply(this,arguments)}}(),K=function(){var r=a((function*(){k.loading=!0;try{const e=(yield b.post(f.platformApi+"/lessonCourseware/queryLessonCourseware",{data:{subjectId:k.actionKey?k.actionKey:null,page:1,rows:999}})).data.rows.map((e=>t(t({},e),{},{coverImg:e.cover,name:e.name,id:e.id,courseNum:e.courseNum})));k.classList=e}catch(e){}k.loading=!1}));return function(){return r.apply(this,arguments)}}(),S=function(){var t=a((function*(){try{yield a((function*(){try{const e=yield b.get(f.platformApi+"/lessonCourseware/getLessonCoursewareSubjectList");k.subjectList=e.data||[]}catch(e){}}))();const e="TEACHER"===f.platformType?f.user.data.subjectId:f.user.data.student.subjectIdList,t=e?e.split(",")[0]:0;k.subjectList.forEach((e=>{Number(t)===e.id&&(k.actionKey=Number(t))})),yield K()}catch(e){}k.loading=!1,v({api:"getCoursewareSelectResult"},(e=>{if(null!=e&&e.content)return f.max=e.content.max,void(f.vIds=e.content.coursewareIds||[])}))}));return function(){return t.apply(this,arguments)}}();c("scroll",(()=>{const e=window.scrollY||window.pageYOffset||document.documentElement.scrollTop;k.titleOpacity=e>100?1:e/100})),u(a((function*(){"music"===k.topKey?T():S()})));const I=l((()=>{const e=k.subjectList.map((e=>({id:e.id,name:e.name,text:e.name,value:e.id})));return e.unshift({id:"",name:"课程类型",text:"全部",value:0}),e}));return()=>{let a;return d("div",{"class":"_choiseHomework_uxrta_1"},[d(h,{position:"top"},{"default":()=>{return[d(m,{border:!1,background:"transparent",color:"#131415"},null),"onlymusic"!==n&&d("div",{"class":"_topTabs_uxrta_14"},[d(j,{border:!1,active:k.topKey,"onUpdate:active":e=>k.topKey=e,onClickTab:e=>{k.topKey=e.name,"music"===k.topKey?k.list.length<=0&&T():"courseware"===k.topKey&&(k.subjectList.length<=0||k.classList.length<=0)&&S()}},{"default":()=>[d(O,{title:"云练习",name:"music"},null),d(O,{title:"云课堂",name:"courseware"},null)]}),"courseware"===k.topKey&&d(j,{"class":"_classroomTab_uxrta_35",active:k.actionKey,"onUpdate:active":e=>k.actionKey=e,shrink:!0,onClickTab:e=>{k.actionKey=e.name,K()}},(e=a=I.value.map((e=>d(O,{title:e.text,name:e.value},null))),"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!y(e)?a:{"default":()=>[a]}))])];var e}}),d("div",{"class":["_container_uxrta_50","courseware"===k.topKey?"_containerClass_uxrta_56":"","onlymusic"===n?"_containerClassOnly_uxrta_71":""]},["music"===k.topKey?d(_,{name:"van-fade"},{"default":()=>[d("div",{"class":"_items_uxrta_77"},[k.show?k.list.map((n=>d("div",{key:n.id,onClick:()=>((n,a)=>{const i=n.sysMusicScoreCategoriesList?n.sysMusicScoreCategoriesList.length:0;sessionStorage.setItem("musicScoreList",JSON.stringify(n.sysMusicScoreCategoriesList)),i>1?r.push({path:"/classify",query:t({parentId:n.id},e.query)}):r.push({path:"/music-list/"+(1==i?null===(a=n.sysMusicScoreCategoriesList[0])||void 0===a?void 0:a.id:n.id),query:t({},e.query)})})(n)},[d("div",{"class":"_inner_uxrta_87"},[d(C,{src:n.coverImg,"class":"_img_uxrta_91"},null)])]))):d(p,{tips:"暂无数据"},null)])]}):d(g,null,[d(_,{name:"van-fade"},{"default":()=>[!k.loading&&Object.values(k.classList).length>0&&d(x,{list:k.classList,onItemClick:e=>{return t=e,void r.push({path:"/classroom-detail",query:{id:t.lessonCoursewareId}});var t}},null)]}),k.loading&&d(w,null,null),!k.loading&&!Object.values(k.classList).length&&d("div",{style:{minHeight:"calc(100vh - var(--header-height))",display:"flex",alignItems:"center"}},[d(p,{tips:"暂无课件"},null)])])])])}}}))}}}))}();