1 |
- import{d as O,ah as j,ag as z,f as b,r as k,$ as E,bJ as H,b7 as U,bL as B,a0 as V,c as o,aj as F,q as u,bI as q,F as h,g as p,B as w,ak as Q,b3 as K,a5 as M,al as Y,m as y,bd as x,e as A}from"./index.5f7ffb46.js";import{h as P}from"./useFee.8505982e.js";import{i as _}from"./icon-list.12309bf1.js";import{O as R}from"./index.05515b24.js";import{C as W}from"./index.052b3caa.js";import{C as X}from"./index.abd668f7.js";const G="_courseList_10zvf_1",N="_periodContent_10zvf_8",Z="_cover_10zvf_12",J="_contentTitle_10zvf_48",$="_contentLabel_10zvf_55",ee="_periodTitle_10zvf_61",te="_pIcon_10zvf_66",oe="_pTitle_10zvf_71",ae="_pNum_10zvf_77",se="_periodList_10zvf_82",ne="_baseBtn_10zvf_119",re="_look_10zvf_133",le="_down_10zvf_136",ce="_disable_10zvf_139",ie="_periodItem_10zvf_143",ue="_courseDialog_10zvf_154",de="_iconCross_10zvf_154";var n={courseList:G,periodContent:N,cover:Z,contentTitle:J,contentLabel:$,periodTitle:ee,pIcon:te,pTitle:oe,pNum:ae,periodList:se,baseBtn:ne,look:re,down:le,disable:ce,periodItem:ie,courseDialog:ue,iconCross:de},pe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABQCAMAAACNtsODAAABjFBMVEUAAAD/58j/58j/5cT/5sb/47//58j/5sj/5sj/5sj/5sn/58n/6Mn/5sj/5Mn/3LH/3LL/////3LH/27H/3LH/3LH/3rL/167/6cz/4r7/3LH/5sj/3LHqVxr/klD/kE//5Mb/plf/olb/p1j/hUv/m1P/qln/n1X/lFH/////jE7/i03/l1L/rlr/nVT/iUz/r1v/jk77zKn/s1z/gkr/gUn/t17/qVj/oVX/pFb/fUj/llH/nlT/h0v/6Mz/tV3/e0f/rFn/uV7/mVL/vGD/eEbtXiD/4b3/tF3/sVv/f0jtYCL//Pj/48L/v2L/7dj/3bn/2rb/1bT/oGH/dUX/8uL/0q3/zqf/0J//unr/9uz/4MD/v4//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PCsRHmrUS+MxS70gHvzUq8ajqHp1eDhWrx6P6+pV4AWCcjV4paFeA16yKBdoxmsf5RrtiyjFat2rMaWqmgiXdYQClYTrQ0JVlYQLTUK1TQpXrG6BRoVLX7eahuZihX4NjaWD1XX10jX0P9pfrYs3oaUYAAAAAElFTkSuQmCC";function Ae(r){return typeof r=="function"||Object.prototype.toString.call(r)==="[object Object]"&&!Y(r)}var Le=O({name:"courseList",setup(){const r=j();z();const f=b(),s=k({titleOpacity:0,catchStatus:!1,catchItem:{},loading:!0,detail:{cover:"",name:"",des:""},list:[]}),v=async()=>{const e=await y.get(`${p.platformApi}/lessonCourseware/detail/${r.query.id}`);e!=null&&e.data&&(s.detail.cover=e.data.coverImg,s.detail.name=e.data.name,s.detail.des=e.data.lessonTargetDesc)},T=async()=>{if(s.loading=!0,r.query.courseScheduleId)try{const e=await y.post(p.platformApi+"/courseSchedule/getCoursewareDetail",{params:{courseScheduleId:r.query.courseScheduleId,coursewareId:r.query.id}});Array.isArray(e==null?void 0:e.data)&&(s.list=e.data)}catch{}else try{const e=await y.post(p.platformApi+"/courseSchedule/myCoursewareDetail/"+r.query.id);if(Array.isArray(e==null?void 0:e.data)){e.data.forEach(a=>{const{knowledgePointList:l,...d}=a;(l||[]).forEach(i=>{i.materialList=[...i.materialList||[],...g(i.children||[])],i.children=null})});const t=await I(e.data);s.list=f.isApp?e.data.map(a=>{const l=t.find(c=>c.lessonCoursewareDetailId==a.lessonCoursewareDetailId),d={...a};return l&&(d.hasCache=l.hasCache),d}):e.data}}catch{}s.loading=!1},g=(e=[])=>{const t=[];return e.forEach(a=>{a.materialList&&a.materialList.length>0&&t.push(...a.materialList||[]),a.children&&a.children.length>0&&t.push(...g(a.children||[]))}),t};E(()=>{v(),T(),H("downloadCoursewareToCache",L)}),U(()=>{B("downloadCoursewareToCache",L)});const D=async e=>{if(!e.knowledgePointList){x({message:"\u8BE5\u8BFE\u4EF6\u6682\u65E0\u77E5\u8BC6\u70B9"});return}if(r.query.code==="select"){console.log("\u9009\u62E9\u8BFE\u65F6"),S(e);return}if(!e.hasCache){if(!P()||e.downloadStatus==1)return;if(e.downloadStatus==3){m(e);return}s.catchStatus=!0,s.catchItem=e;return}C(e)},C=e=>{A({api:"openWebView",content:{url:`${location.origin}${location.pathname}#/coursewarePlay?id=${e.lessonCoursewareDetailId}&source=my-course`,orientation:0,isHideTitle:!0,statusBarTextColor:!1,isOpenLight:!0,showLoadingAnim:!0}})},I=e=>b().isApp?new Promise(t=>{A({api:"checkCoursewareCache",content:{data:e}},a=>{var l;if((l=a==null?void 0:a.content)!=null&&l.data){t(a.content.data);return}return[]})}):Promise.resolve(e),m=async e=>f.isApp?await A({api:"downloadCoursewareToCache",content:{data:e}}):!0,L=e=>{var t;if((t=e==null?void 0:e.content)!=null&&t.lessonCoursewareDetailId){const{lessonCoursewareDetailId:a,downloadStatus:l,progress:d}=e.content,c=s.list.find(i=>i.lessonCoursewareDetailId==a);c&&(c.downloadStatus=l,c.progress=d,l==2&&(c.hasCache=1,c.progress=100))}},S=async e=>{try{(await y.post(p.platformApi+"/courseSchedule/setCoursewareDetail",{params:{courseScheduleId:r.query.courseScheduleId,coursewareDetailId:e.lessonCoursewareDetailId}})).code===200&&A({api:"back"})}catch{}};return V("scroll",e=>{const t=window.scrollY||window.pageYOffset||document.documentElement.scrollTop;s.titleOpacity=t>100?1:t/100}),()=>{let e;return o("div",{class:n.courseList},[o(F,{border:!1,background:`rgba(255,255,255, ${s.titleOpacity})`,color:"rgba(124, 61, 18, 1)",title:"\u6559\u6750\u8BE6\u60C5"},null),o("div",{class:n.periodContent},[o("div",{class:n.cover},[o("img",{src:s.detail.cover,onLoad:t=>{t.target&&(t.target.style.opacity=1)}},null)]),o("div",null,[o("div",{class:n.contentTitle},[s.detail.name]),o("div",{class:n.contentLabel},[u("\u6559\u5B66\u76EE\u6807\uFF1A"),s.detail.des])])]),o(q,{name:"van-fade"},{default:()=>[!s.loading&&o(h,null,[o("div",{key:"periodTitle",class:n.periodTitle},[o("img",{class:n.pIcon,src:_},null),o("div",{class:n.pTitle},[u("\u8BFE\u7A0B\u5217\u8868")]),o("div",{class:n.pNum},[u("\u5171"),s.list.length,u("\u8BFE")])]),o("div",{key:"list",class:n.periodList},[o(W,{inset:!0},Ae(e=s.list.map(t=>{const a=t.lockFlag||(r.query.code=="select"||p.platformType=="STUDENT")&&!t.unlock,l=r.query.code==="select";return o(X,{border:!0,center:!0,title:t.coursewareDetailName,label:f.isStudent?"":`\u5DF2\u4F7F\u7528${t.useNum||0}\u6B21`,onClick:()=>!a&&D(t)},{icon:()=>o("div",{class:n.periodItem},[o("div",{class:n.periodItemModel},[o("img",{src:a?ye:pe},null)])]),value:()=>o(h,null,[l?o(w,{disabled:a,class:[n.baseBtn,a?n.disable:n.look]},{default:()=>[u("\u9009\u62E9")]}):t.knowledgePointList?o(h,null,[t.hasCache?o(w,{disabled:a,class:[n.baseBtn,a?n.disable:n.look]},{default:()=>[u("\u67E5\u770B")]}):o(w,{disabled:a,class:[n.baseBtn,a?n.disable:n.down,t.downloadStatus?n.downing:""]},{default:()=>[t.downloadStatus===1?`${t.progress||0}%`:t.downloadStatus===2?"\u6210\u529F":t.downloadStatus===3?"\u91CD\u8BD5":"\u4E0B\u8F7D"]})]):""])})}))?e:{default:()=>[e]})])])]}),s.loading&&o(R,null,null),!s.loading&&!s.list.length&&o(Q,{tips:"\u6682\u65E0\u5185\u5BB9"},null),o(K,{show:s.catchStatus,"onUpdate:show":t=>s.catchStatus=t,showCancelButton:!0,message:"\u5F53\u524D\u8BFE\u7A0B\u6CA1\u6709\u7F13\u5B58,\u662F\u5426\u7F13\u5B58?",closeOnClickOverlay:!0,class:n.courseDialog,onConfirm:()=>{m(s.catchItem)},onCancel:()=>{C(s.catchItem)}},{title:()=>o(M,{name:"cross",class:n.iconCross,onClick:()=>s.catchStatus=!1},null)})])}}});export{Le as default};
|