index-e489a8c8.js 9.9 KB

1
  1. import{d as a,f as e,u as t,g as o,r as s,o as l,l as i,h as n,j as c,k as d,a as r,O as u,m as A,n as g,F as p,B as w,s as h,b as m,P as C,i as f,e as v,p as D,q as N}from"./index-81a4e71e.js";import{h as T,g as y,s as B,a as E}from"./useFee-640dbce7.js";import{O as Q}from"./index-74ca1941.js";import{O as k}from"./index-a43b7d41.js";import{C as _}from"./index-e5d3adb9.js";import{C as x}from"./index-fe596b4d.js";import"./index-4b58cac2.js";const M="_baseBtn_154le_120",O="_disabled_154le_134",K=a({name:"courseList",setup(){const a=e(),K=t(),L=o(),S=s({titleOpacity:0,catchStatus:!1,catchItem:{},loading:!0,detail:{cover:"",name:"",des:""},list:[],isDownloading:!1}),q=(a=[])=>{const e=[];return a.forEach((a=>{a.materialList&&a.materialList.length>0&&e.push(...a.materialList||[]),a.children&&a.children.length>0&&e.push(...q(a.children||[]))})),e};l((()=>{(async()=>{const e=await v.get("".concat(h.platformApi,"/lessonCourseware/getLessonCoursewareDetail/").concat(a.query.id));(null==e?void 0:e.data)&&(S.detail.cover=e.data.coverImg,S.detail.name=e.data.name,S.detail.des=e.data.lessonTargetDesc)})(),(async()=>{S.loading=!0;try{const e=await v.get(h.platformApi+"/lessonCourseware/getLessonCoursewareCourseList/"+a.query.id);if(Array.isArray(null==e?void 0:e.data)){S.list=e.data,e.data.forEach((a=>{const{knowledgePointList:e,...t}=a;(e||[]).forEach((a=>{a.materialList=[...a.materialList||[],...q(a.children||[])],a.children=null}))}));const a=await P(e.data);S.list=L.isApp?e.data.map((e=>{const t=a.find((a=>a.lessonCoursewareDetailId==e.lessonCoursewareDetailId)),o={...e};return t&&(o.hasCache=t.hasCache),o})):e.data}}catch(e){}S.loading=!1})(),i("downloadCoursewareToCache",U)})),n((()=>{c("downloadCoursewareToCache",U)}));const G=a=>{S.catchStatus=!1,o().isApp?D({api:"openWebView",content:{url:"".concat(location.origin).concat(location.pathname,"#/coursewarePlay?id=").concat(a.coursewareDetailId,"&source=my-course"),orientation:0,isHideTitle:!0,statusBarTextColor:!1,isOpenLight:!0,showLoadingAnim:!0}}):K.push({path:"/coursewarePlay",query:{id:a.coursewareDetailId,source:"my-course"}})},P=a=>o().isApp?new Promise((e=>{D({api:"checkCoursewareCache",content:{data:a}},(a=>{var t;if(!(null==(t=null==a?void 0:a.content)?void 0:t.data))return[];e(a.content.data)}))})):Promise.resolve(a),R=async a=>!L.isApp||(S.catchStatus=!1,S.isDownloading=!0,await D({api:"downloadCoursewareToCache",content:{data:a}})),U=a=>{var e;if(S.isDownloading&&(null==(e=null==a?void 0:a.content)?void 0:e.lessonCoursewareDetailId)){const{lessonCoursewareDetailId:e,downloadStatus:t,progress:o}=a.content,s=S.list.find((a=>a.lessonCoursewareDetailId==e));s&&(s.downloadStatus=t,s.progress=o,2==t&&(s.hasCache=1,s.progress=100,S.isDownloading=!1))}};return d("scroll",(()=>{const a=window.scrollY||window.pageYOffset||document.documentElement.scrollTop;S.titleOpacity=a>100?1:a/100})),()=>{let a;return r("div",{"class":"_courseList_154le_1"},[r(u,{border:!1,background:"rgba(255,255,255, ".concat(S.titleOpacity,")"),title:"教材详情"},null),r("div",{"class":"_periodContent_154le_8"},[r("div",{"class":"_cover_154le_12"},[r("img",{src:S.detail.cover,onLoad:a=>{a.target&&(a.target.style.opacity=1)}},null)]),r("div",null,[r("div",{"class":"_contentTitle_154le_49"},[S.detail.name]),r("div",{"class":"_contentLabel_154le_56"},[A("教学目标:"),S.detail.des])])]),r(g,{name:"van-fade"},{"default":()=>{return[!S.loading&&r(p,null,[r("div",{key:"periodTitle","class":"_periodTitle_154le_62"},[r("img",{"class":"_pIcon_154le_67",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAAAapJREFUWEftl7FKA0EQhv9NhAjhBHvLQBoj3L2DnaV2NhYWajqfwNo6PoGVptXCRxDcPVy1utIuTTAgEZSRExNi9Mxs5u488NJm5ua7b2d3bxQK/lMF50MJKF2h0uD/MdhsNr1avX4Yv/EzUScypufy9o1Go7boedsgWnHJ+xar1ONwMDiNougl/m/cgy3fvwKw/pnQQ6VyYG9uzrnFWr4fx25y42fEda0xW9OArwCqU4ndBWDfMGy2guAJRF4qgEoNrNZL04CU8HCWzTwMJgGOuH+1mUcPzgKMQXukVPtO67NUlpLxkMlNwgEc26wS7YZh2GfUEIXMCwgodWG13hBVZyTPDwj0rTHLjBqikPkBiTo2DNui6oxkZ0AChgo4ssYcA3hj1BCFOAEScE3Azr0xD6KqDsksQI61PzsHudbyuEmGAGoj+xxrkyuV+V286vsnCtiLi3KtfQHM+msm/vRaC4KPg/dW60vXHZp5DzpsrFxDy6FJqrs0WBqUGpDmj3swtXNMTJQ8F6c510oxf5iL05xrpXgJc3GxDRa+B6WrklV+eZNIzRbe4DtiDOop5126YAAAAABJRU5ErkJggg=="},null),r("div",{"class":"_pTitle_154le_72"},[A("课程列表")]),r("div",{"class":"_pNum_154le_78"},[A("共"),S.list.length,A("课")])]),r("div",{key:"list","class":"_periodList_154le_83"},[r(_,{inset:!0},(e=a=S.list.map((a=>r(x,{border:!0,center:!0,title:a.coursewareDetailName,onClick:()=>(async a=>a.knowledgePointList?E()?a.hasCache?void G(a):1==a.downloadStatus?(D({api:"cancelDownloadCourseware"}),setTimeout((()=>{D({api:"cancelDownloadCourseware"}),a.downloadStatus=0,S.isDownloading=!1}),1e3),void N({message:"取消中...",forbidClick:!1,loadingType:"spinner",duration:1e3})):3==a.downloadStatus?void R(a):(S.catchStatus=!0,void(S.catchItem=a)):void 0:void B({message:"该课件暂无知识点"}))(a)},{icon:()=>r("div",{"class":"_periodItem_154le_150"},[r("div",{"class":"_periodItemModel_154le_173"},[r("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABQCAMAAACNtsODAAABrVBMVEUAAADU9+jT9ujV+dz+///T9+nT9unS9ujT9+jT9ujT9unT+OrT9+nV9+rU9+nX8uSe5sid5ced5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BJ3Wlrq7uTyIvdNlZs6wnlMkAYztxG6o7kxfq0B29ZulQIeFgzQ3ckfPE4/EoFeKMmoczcp5UChwqpGqGcdQ8wHAHmGiYCKGD86h64uBQoSTeCt05lkoJJlxPhcQ8wDQ3z801yJq5A1B9PRVqxZpfMtb/NcYdnKc+cpUGYc0hvsKeTKqagbkWiVAhreaE+M3LYZwHnCYq1KJqTshl+XpDzAMDNTUdoUGJrLoVAMmMTYp6bIcKqXkyGYTYaNR2miLgHCVCMI/NgBPToEQUHBgHHCqEu1mDOifkuY6SIVEPX4YKujPMHT5PYyMR4o647FvQ43n+uaTTeJ0G8Zr5ZRfQg4kwMJpznAiBI2/FE/hxfIN/Ll4PBBwqBPXIZbg+Pj4cDuPnAgack0RILA21fIDh50KHCmlOeOuWAqM5aSIkl2FUzoPnOg5OOk2FcPk4HTEOQOduESFcPqpm5aTBoULgbNWjbgXOA0x7OxHCerSacZ52MoRL1VmPcro49CgvtL1mMQ5AwHCn69fvzc1PLC+knIj+XyidLsgNBiFA9rFwHqcD0PnzNIiti8+F9WDNwNAhWGJRYHI6nCFDkMSD/rt3nr149Xpian72+9paYzrdjs6PRE6IlM5RIX+empmductyQT5WlPgMf3Egv2EWBzKNQHGggBEsDhQ0KosDVRrFKckUTxruUy4eWVynxCOefVynQj5EuUwZPo25Smk1Pta5KqiK8HxImaeK8KBJ6afaxRMrpqTCxaMvxiz36AL9GRrj85uBYKWh5S+x1Npkdb5CXQAAAABJRU5ErkJggg=="},null),a.hasCache?r("img",{"class":"_iconCachePoint_154le_176",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAAAXNSR0IArs4c6QAAA9BJREFUSEuFll9oXFUQxn+zXUxUEuxWLVofLBbJUwKuLYoUGi2+VLSwhtDVJPRVFFS0MQohyUObVElsm+yDUFQQfJDUSlsapNuN1CdN0UTUgtKKYqLEpgi22aTJGTn33Lt79+7d7YUL5/45852Zb76ZEW5xaa67FaMZDDtB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0GDcqqMT53EeTfRa4itF555qznVlD59tBclgdCdqB0hNOc2ZJZRLiF5AdVIOTtUdIP8HJHIsqCQbQc0AAAAASUVORK5CYII="},null):"",1===a.downloadStatus&&r("div",{"class":"_downloading_154le_193"},["".concat(a.progress||0,"%")])])]),value:()=>r(p,null,[a.knowledgePointList?r(p,null,[a.hasCache?r(w,{"class":[M,"_look_154le_137","STUDENT"!==h.platformType||T()?"":O]},{"default":()=>[A("查看")]}):r(w,{"class":[M,"_down_154le_140","STUDENT"!==h.platformType||T()?"":O,1==a.downloadStatus?"_downing_154le_143":""]},{"default":()=>[1===a.downloadStatus?"取消下载":"查看"]})]):""])}))),"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!f(e)?a:{"default":()=>[a]}))])])];var e}}),S.loading&&r(Q,null,null),!S.loading&&!S.list.length&&r(m,{tips:"暂无内容"},null),"STUDENT"===h.platformType&&!T()&&r(k,{position:"bottom"},{"default":()=>[r("div",{"class":"_btnGroup_154le_207"},[r(w,{round:!0,block:!0,type:"primary",onClick:y},{"default":()=>[A("开通会员即可查看所有课件")]})])]}),r(C,{show:S.catchStatus,"onUpdate:show":a=>S.catchStatus=a,round:!0,"class":"_courseDialog_154le_162"},{"default":()=>[r("i",{"class":"_iconClose_154le_215",onClick:()=>S.catchStatus=!1},null),r("div",{"class":"_title_154le_225"},[A("下载提醒")]),r("div",{"class":"_content_154le_49"},[A("您尚未下载课件内容,为了更加流畅的学习体验,推荐您下载后观看课件。")]),r("div",{"class":"_popupBtnGroup_154le_239"},[r(w,{round:!0,onClick:()=>G(S.catchItem)},{"default":()=>[A("直接观看")]}),r(w,{round:!0,type:"primary",onClick:()=>R(S.catchItem)},{"default":()=>[A("下载课件")]})])]})])}}});export{K as default};