1 |
- !function(){function e(e,t,r,n,a,i,o){try{var s=e[i](o),u=s.value}catch(c){return void r(c)}s.done?t(u):Promise.resolve(u).then(n,a)}function t(t){return function(){var r=this,n=arguments;return new Promise((function(a,i){var o=t.apply(r,n);function s(t){e(o,a,i,s,u,"next",t)}function u(t){e(o,a,i,s,u,"throw",t)}s(void 0)}))}}var r=document.createElement("style");r.innerHTML="._grid_ijbys_1 .van-grid-item .van-grid-item__content{padding:0;background:transparent}._grid_ijbys_1 .van-grid-item .van-grid-item__content:after{display:none}._grid_ijbys_1 ._gridItem_ijbys_8{position:relative;width:100%;height:2.85333rem;border-radius:.26667rem;overflow:hidden}._grid_ijbys_1 ._gridItem_ijbys_8 ._cover_ijbys_15{position:absolute;left:0;right:0;top:0;bottom:0;z-index:-1;display:block;width:100%;height:100%;-o-object-fit:cover;object-fit:cover}._grid_ijbys_1 ._gridItem_ijbys_8 ._title_ijbys_27{text-align:center;padding:.26667rem;color:#742c00;font-size:.4rem}._grid_ijbys_1 ._gridItem_ijbys_8 ._subtitle_ijbys_33{font-size:.29333rem;margin-top:.05333rem}._grid_ijbys_1 ._gridItem_ijbys_8 ._num_ijbys_37{position:absolute;left:50%;bottom:.32rem;transform:translate(-50%);display:flex;align-items:center;justify-content:center;font-size:.32rem;width:70%;height:.53333rem;border-radius:.53333rem;background:linear-gradient(180deg,#ff9c7c 0%,#ff5757 100%);color:#fff}._grid_ijbys_1 ._gridItem_ijbys_8 ._look_ijbys_52{position:absolute;left:0;right:0;top:0;bottom:0;background-color:rgba(0,0,0,.6);z-index:10;display:flex;align-items:center;justify-content:center;color:#fff}\n",document.head.appendChild(r),System.register(["./index-legacy.07e66d56.js","./icon-course-legacy.12964838.js","./useFee-legacy.5e71f043.js","./index-legacy.2a2ce189.js"],(function(e){"use strict";var r,n,a,i,o,s,u,c,l,d,f,p,_,b,g,m,v,y,h,w,j,x,k;return{setters:[function(e){r=e.d,n=e.aV,a=e.ag,i=e.e,o=e.r,s=e.$,u=e.bF,c=e.a_,l=e.bG,d=e.c,f=e.q,p=e.F,_=e.a5,b=e.f,g=e.ai,m=e.ak,v=e.m,y=e.b6,h=e.k},function(e){w=e.i},function(e){j=e.h},function(e){x=e.G,k=e.a}],execute:function(){var C="_grid_ijbys_1",I="_gridItem_ijbys_8",S="_cover_ijbys_15",D="_title_ijbys_27",A="_subtitle_ijbys_33",T="_num_ijbys_37",q="_look_ijbys_52";e("default",r({name:"lessonCourseware",setup:function(){var e=n();a();var r=i(),R=o({loading:!0,list:[]}),P=function(){var n=t(regeneratorRuntime.mark((function t(){var n,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(R.loading=!0,!e.query.courseScheduleId){t.next=13;break}return t.prev=2,t.next=5,v.post(b.platformApi+"/courseSchedule/getCoursewareDetail",{params:{courseScheduleId:e.query.courseScheduleId,coursewareId:e.query.id}});case 5:n=t.sent,Array.isArray(null==n?void 0:n.data)&&(R.list=n.data),t.next=11;break;case 9:t.prev=9,t.t0=t.catch(2);case 11:t.next=30;break;case 13:return t.prev=13,t.next=16,v.post(b.platformApi+"/courseSchedule/myCoursewareDetail/"+e.query.id);case 16:if(a=t.sent,!Array.isArray(null==a?void 0:a.data)){t.next=26;break}if(!r.isApp){t.next=24;break}return t.next=21,N(a.data);case 21:t.t1=t.sent,t.next=25;break;case 24:t.t1=a.data;case 25:R.list=t.t1;case 26:t.next=30;break;case 28:t.prev=28,t.t2=t.catch(13);case 30:R.loading=!1;case 31:case"end":return t.stop()}}),t,null,[[2,9],[13,28]])})));return function(){return n.apply(this,arguments)}}();s((function(){P(),u("downloadCoursewareToCache",O)})),c((function(){l("downloadCoursewareToCache",O)}));var z=function(){var r=t(regeneratorRuntime.mark((function t(r){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r.knowledgePointList){t.next=3;break}return y({message:"该课件暂无知识点"}),t.abrupt("return");case 3:if("select"!==e.query.code){t.next=7;break}return console.log("选择课时"),E(r),t.abrupt("return");case 7:if(r.hasCache){t.next=27;break}if(j()){t.next=11;break}return t.abrupt("return");case 11:if(1!=r.downloadStatus){t.next=13;break}return t.abrupt("return");case 13:if(3!=r.downloadStatus){t.next=16;break}return F(r),t.abrupt("return");case 16:return t.prev=16,t.next=19,y({message:"当前课程没有缓存,是否缓存?"});case 19:t.next=25;break;case 21:return t.prev=21,t.t0=t.catch(16),L(r),t.abrupt("return");case 25:return F(r),t.abrupt("return");case 27:L(r);case 28:case"end":return t.stop()}}),t,null,[[16,21]])})));return function(e){return r.apply(this,arguments)}}(),L=function(e){h({api:"openWebView",content:{url:"".concat(location.origin).concat(location.pathname,"/#/coursewarePlay?id=").concat(e.lessonCoursewareDetailId),orientation:0,isHideTitle:!0,statusBarTextColor:!1,isOpenLight:!0,showLoadingAnim:!0}})},N=function(e){return new Promise((function(t){h({api:"checkCoursewareCache",content:{data:e}},(function(e){var r;if(null==e||null===(r=e.content)||void 0===r||!r.data)return[];t(e.content.data)}))}))},F=function(){var e=t(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!r.isApp){e.next=5;break}return e.next=3,h({api:"downloadCoursewareToCache",content:{data:t}});case 3:return n=e.sent,e.abrupt("return",n);case 5:return e.abrupt("return",!0);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),O=function(e){var t;if(null!=e&&null!==(t=e.content)&&void 0!==t&&t.lessonCoursewareDetailId){var r=e.content,n=r.lessonCoursewareDetailId,a=r.downloadStatus,i=r.progress,o=R.list.find((function(e){return e.lessonCoursewareDetailId==n}));o&&(o.downloadStatus=a,o.progress=i,2==a&&(o.hasCache=1,o.progress=100))}},E=function(){var r=t(regeneratorRuntime.mark((function t(r){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,v.post(b.platformApi+"/courseSchedule/setCoursewareDetail",{params:{courseScheduleId:e.query.courseScheduleId,coursewareDetailId:r.lessonCoursewareDetailId}});case 3:200===t.sent.code&&h({api:"back"}),t.next=9;break;case 7:t.prev=7,t.t0=t.catch(0);case 9:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(e){return r.apply(this,arguments)}}();return function(){var t,n;return d("div",{style:{paddingTop:"14px"}},[d(x,{gutter:14,columnNum:3,class:C},(n=t=R.list.map((function(t){return d(k,null,{default:function(){return[d("div",{class:I,onClick:function(){return z(t)}},[d("img",{src:w,class:S},null),d("div",{class:D},[d("div",{class:"van-multi-ellipsis--l2"},[t.coursewareDetailName]),!r.isStudent&&d("div",{class:A},[f("已使用 "),t.useNum,f(" 次")])]),"select"!==e.query.code?d(p,null,[!!t.knowledgePointList&&d(p,null,[t.hasCache?d("div",{class:T},[f("查看"),d(_,{name:"play-circle-o"},null)]):d(p,null,[1===t.downloadStatus?d("div",{class:T},[f("下载中 "),t.progress||0,f("%")]):2===t.downloadStatus?d("div",{class:T},[f("下载成功")]):3===t.downloadStatus?d("div",{class:T},[f("重新下载")]):d("div",{class:T},[f("下载")])])])]):d("div",{class:T},[f("选择")]),("select"==e.query.code||"STUDENT"==b.platformType)&&!t.unlock&&d("div",{class:q,onClick:function(e){return e.stopPropagation()}},[d(_,{name:"./assets/look.aaa3d432.svg"},null),f(" 未解锁")])])]}})})),"function"==typeof n||"[object Object]"===Object.prototype.toString.call(n)&&!m(n)?t:{default:function(){return[t]}})),!R.loading&&!R.list.length&&d(g,{tips:"暂无内容"},null)])}}}))}}}))}();
|