1 |
- !function(){function e(e,t,r,n,a,o,i){try{var s=e[o](i),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,o){var i=t.apply(r,n);function s(t){e(i,a,o,s,u,"next",t)}function u(t){e(i,a,o,s,u,"throw",t)}s(void 0)}))}}var r=document.createElement("style");r.innerHTML="._grid_1xkdg_1 .van-grid-item .van-grid-item__content{padding:0;background:transparent}._grid_1xkdg_1 .van-grid-item .van-grid-item__content:after{display:none}._grid_1xkdg_1 ._gridItem_1xkdg_8{position:relative;width:100%;height:2.85333rem;border-radius:.26667rem;overflow:hidden}._grid_1xkdg_1 ._gridItem_1xkdg_8 ._cover_1xkdg_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_1xkdg_1 ._gridItem_1xkdg_8 ._title_1xkdg_27{text-align:center;padding:.37333rem;color:#742c00;font-size:.42667rem}._grid_1xkdg_1 ._gridItem_1xkdg_8 ._subtitle_1xkdg_33{font-size:.32rem}._grid_1xkdg_1 ._gridItem_1xkdg_8 ._num_1xkdg_36{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_1xkdg_1 ._gridItem_1xkdg_8 ._look_1xkdg_51{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.a9944503.js","./icon-course-legacy.12964838.js","./useFee-legacy.df0f7bec.js","./index-legacy.2605abd7.js"],(function(e){"use strict";var r,n,a,o,i,s,u,c,d,l,f,g,p,_,m,v,x,k,h,b,w,y,C;return{setters:[function(e){r=e.d,n=e.aU,a=e.ag,o=e.e,i=e.r,s=e.$,u=e.bD,c=e.aZ,d=e.bE,l=e.c,f=e.q,g=e.F,p=e.a5,_=e.f,m=e.ai,v=e.aj,x=e.m,k=e.b5,h=e.k},function(e){b=e.i},function(e){w=e.h},function(e){y=e.G,C=e.a}],execute:function(){var I="_grid_1xkdg_1",S="_gridItem_1xkdg_8",j="_cover_1xkdg_15",D="_title_1xkdg_27",q="_subtitle_1xkdg_33",A="_num_1xkdg_36",R="_look_1xkdg_51";e("default",r({name:"lessonCourseware",setup:function(){var e=n(),r=a(),T=o(),P=i({loading:!0,list:[]}),z=function(){var r=t(regeneratorRuntime.mark((function t(){var r,n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(P.loading=!0,!e.query.courseScheduleId){t.next=13;break}return t.prev=2,t.next=5,x.post(_.platformApi+"/courseSchedule/getCoursewareDetail",{params:{courseScheduleId:e.query.courseScheduleId,coursewareId:e.query.id}});case 5:r=t.sent,Array.isArray(null==r?void 0:r.data)&&(P.list=r.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,x.post(_.platformApi+"/courseSchedule/myCoursewareDetail/"+e.query.id);case 16:if(n=t.sent,!Array.isArray(null==n?void 0:n.data)){t.next=26;break}if(!T.isApp){t.next=24;break}return t.next=21,L(n.data);case 21:t.t1=t.sent,t.next=25;break;case 24:t.t1=n.data;case 25:P.list=t.t1;case 26:t.next=30;break;case 28:t.prev=28,t.t2=t.catch(13);case 30:P.loading=!1;case 31:case"end":return t.stop()}}),t,null,[[2,9],[13,28]])})));return function(){return r.apply(this,arguments)}}();s((function(){z(),u("downloadCoursewareToCache",O)})),c((function(){d("downloadCoursewareToCache",O)}));var N=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 k({message:"该课件暂无知识点"}),t.abrupt("return");case 3:if("select"!==e.query.code){t.next=7;break}return console.log("选择课时"),U(r),t.abrupt("return");case 7:if(r.hasCache){t.next=23;break}if(!T.isStudent&&!e.query.isdev){t.next=21;break}if(w()){t.next=12;break}return t.abrupt("return");case 12:return t.prev=12,t.next=15,k({message:"当前课程没有缓存,是否缓存?"});case 15:t.next=21;break;case 17:return t.prev=17,t.t0=t.catch(12),E(r),t.abrupt("return");case 21:return F(r),t.abrupt("return");case 23:E(r);case 24:case"end":return t.stop()}}),t,null,[[12,17]])})));return function(e){return r.apply(this,arguments)}}(),E=function(e){r.push({path:"/coursewarePlay",query:{id:e.lessonCoursewareDetailId,source:"my-course"}})},L=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 r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!T.isApp){e.next=5;break}return e.next=3,h({api:"downloadCoursewareToCache",content:{data:t}});case 3:return r=e.sent,e.abrupt("return",r);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,o=r.progress,i=P.list.find((function(e){return e.lessonCoursewareDetailId==n}));i&&(i.downloadStatus=a,i.progress=o,2==a&&(i.hasCache=1,i.progress=100))}},U=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,x.post(_.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,r;return l("div",{style:{paddingTop:"14px"}},[l(y,{gutter:14,columnNum:3,class:I},(r=t=P.list.map((function(t){return l(C,null,{default:function(){return[l("div",{class:S,onClick:function(){return N(t)}},[l("img",{src:b,class:j},null),l("div",{class:D},[l("div",{class:"van-multi-ellipsis--l2"},[t.coursewareDetailName]),!T.isStudent&&l("div",{class:q},[f("已使用 "),t.useNum,f(" 次")])]),"select"!==e.query.code?l(g,null,[!!t.knowledgePointList&&l(g,null,[t.hasCache?l("div",{class:A},[f("查看"),l(p,{name:"play-circle-o"},null)]):l(g,null,[1===t.downloadStatus?l("div",{class:A},[f("下载中 "),t.progress||0,f("%")]):2===t.downloadStatus?l("div",{class:A},[f("下载成功")]):3===t.downloadStatus?l("div",{class:A},[f("重新下载")]):l("div",{class:A},[f("下载")])])])]):l("div",{class:A},[f("选择")]),("select"==e.query.code||"STUDENT"==_.platformType)&&!t.unlock&&l("div",{class:R,onClick:function(e){return e.stopPropagation()}},[l(p,{name:"./assets/look.aaa3d432.svg"},null),f(" 未解锁")])])]}})})),"function"==typeof r||"[object Object]"===Object.prototype.toString.call(r)&&!v(r)?t:{default:function(){return[t]}})),!P.loading&&!P.list.length&&l(m,{tips:"暂无内容"},null)])}}}))}}}))}();
|