index.cdea85b0.js 10 KB

1
  1. import{d as j,ah as v,ag as k,f as T,r as H,$ as U,bG as E,b3 as V,bI as B,a0 as F,c as o,aj as q,q as d,bF as Q,F as A,g as p,B as g,ak as K,a$ as _,a5 as M,al as z,m as h,b9 as Y,e as w}from"./index.332c7f08.js";import{h as x}from"./useFee.d82410e2.js";import{i as P}from"./icon-list.12309bf1.js";import{O as R}from"./index.064bc263.js";import{C as W}from"./index.324108a5.js";import{C as X}from"./index.91135ff9.js";const G="_courseList_1twh5_1",N="_periodContent_1twh5_8",Z="_cover_1twh5_12",J="_contentTitle_1twh5_48",$="_contentLabel_1twh5_55",ee="_periodTitle_1twh5_61",te="_pIcon_1twh5_66",oe="_pTitle_1twh5_71",ae="_pNum_1twh5_77",se="_periodList_1twh5_82",ne="_baseBtn_1twh5_119",re="_look_1twh5_133",le="_down_1twh5_136",ce="_disable_1twh5_139",ie="_periodItem_1twh5_143",de="_courseDialog_1twh5_154",ue="_iconCross_1twh5_154",pe="_periodItemModel_1twh5_162",he="_periodTip_1twh5_165";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:de,iconCross:ue,periodItemModel:pe,periodTip:he},we="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//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jOW+IUGE/5X4sdFxGOCQI03Pj84V37yc2lo5Xd/Z/xBLdXqdHLwnRylryxtLS8c7OPCsRHmrUS+MxS70gHvzUq8ajqHp1eDhWrx6P6+pV4AWCcjV4paFeA16yKBdoxmsf5RrtiyjFat2rMaWqmgiXdYQClYTrQ0JVlYQLTUK1TQpXrG6BRoVLX7eahuZihX4NjaWD1XX10jX0P9pfrYs3oaUYAAAAAElFTkSuQmCC",Ae="./assets/iconTip.b920d616.png";function ge(r){return typeof r=="function"||Object.prototype.toString.call(r)==="[object Object]"&&!z(r)}var Se=j({name:"courseList",setup(){const r=v();k();const y=T(),s=H({titleOpacity:0,catchStatus:!1,catchItem:{},loading:!0,detail:{cover:"",name:"",des:""},list:[]}),b=async()=>{const e=await h.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)},S=async()=>{if(s.loading=!0,r.query.courseScheduleId)try{const e=await h.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 h.post(p.platformApi+"/courseSchedule/myCoursewareDetail/"+r.query.id);if(Array.isArray(e==null?void 0:e.data)){e.data.forEach(a=>{const{knowledgePointList:l,...u}=a;(l||[]).forEach(i=>{i.materialList=[...i.materialList||[],...C(i.children||[])],i.children=null})});const t=await I(e.data);s.list=y.isApp?e.data.map(a=>{const l=t.find(c=>c.lessonCoursewareDetailId==a.lessonCoursewareDetailId),u={...a};return l&&(u.hasCache=l.hasCache),u}):e.data}}catch{}s.loading=!1},C=(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(...C(a.children||[]))}),t};U(()=>{b(),S(),E("downloadCoursewareToCache",L)}),V(()=>{B("downloadCoursewareToCache",L)});const D=async e=>{if(!e.knowledgePointList){Y({message:"\u8BE5\u8BFE\u4EF6\u6682\u65E0\u77E5\u8BC6\u70B9"});return}if(r.query.code==="select"){console.log("\u9009\u62E9\u8BFE\u65F6"),O(e);return}if(!e.hasCache){if(!(String(e.accessScope)==="0")&&!x()||e.downloadStatus==1)return;if(e.downloadStatus==3){m(e);return}s.catchStatus=!0,s.catchItem=e;return}f(e)},f=e=>{w({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=>T().isApp?new Promise(t=>{w({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=>y.isApp?await w({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:u}=e.content,c=s.list.find(i=>i.lessonCoursewareDetailId==a);c&&(c.downloadStatus=l,c.progress=u,l==2&&(c.hasCache=1,c.progress=100))}},O=async e=>{try{(await h.post(p.platformApi+"/courseSchedule/setCoursewareDetail",{params:{courseScheduleId:r.query.courseScheduleId,coursewareDetailId:e.lessonCoursewareDetailId}})).code===200&&w({api:"back"})}catch{}};return F("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(q,{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},[d("\u6559\u5B66\u76EE\u6807\uFF1A"),s.detail.des])])]),o(Q,{name:"van-fade"},{default:()=>[!s.loading&&o(A,null,[o("div",{key:"periodTitle",class:n.periodTitle},[o("img",{class:n.pIcon,src:P},null),o("div",{class:n.pTitle},[d("\u8BFE\u7A0B\u5217\u8868")]),o("div",{class:n.pNum},[d("\u5171"),s.list.length,d("\u8BFE")])]),o("div",{key:"list",class:n.periodList},[o(W,{inset:!0},ge(e=s.list.map(t=>{let a=t.lockFlag||(r.query.code=="select"||p.platformType=="STUDENT")&&!t.unlock;const l=r.query.code==="select";return o(X,{border:!0,center:!0,title:t.coursewareDetailName,label:y.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:we},null),!a&&String(t.accessScope)==="0"&&o("img",{class:n.periodTip,src:Ae},null)])]),value:()=>o(A,null,[l?o(g,{disabled:a,class:[n.baseBtn,a?n.disable:n.look]},{default:()=>[d("\u9009\u62E9")]}):t.knowledgePointList?o(A,null,[t.hasCache?o(g,{disabled:a,class:[n.baseBtn,a?n.disable:n.look]},{default:()=>[d("\u67E5\u770B")]}):o(g,{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(K,{tips:"\u6682\u65E0\u5185\u5BB9"},null),o(_,{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:()=>{f(s.catchItem)}},{title:()=>o(M,{name:"cross",class:n.iconCross,onClick:()=>s.catchStatus=!1},null)})])}}});export{Se as default};