1 |
- import{d as I,ah as S,ag as H,f as v,r as U,$ as k,bF as V,b3 as E,bI as B,a0 as F,c as t,aj as q,q as c,bE as Q,F as A,g as d,B as g,ak as z,al as K,m as p,b9 as m,e as y}from"./index.1c621181.js";import{h as Y}from"./useFee.c07e8de4.js";import{i as x}from"./icon-list.12309bf1.js";import{O as M}from"./index.35327acc.js";import{C as P}from"./index.2db9d877.js";import{C as R}from"./index.fd5ae97b.js";const _="_courseList_1p9w9_1",W="_periodContent_1p9w9_8",X="_cover_1p9w9_12",G="_contentTitle_1p9w9_48",N="_contentLabel_1p9w9_55",Z="_periodTitle_1p9w9_61",J="_pIcon_1p9w9_66",$="_pTitle_1p9w9_71",ee="_pNum_1p9w9_77",oe="_periodList_1p9w9_82",te="_baseBtn_1p9w9_119",ae="_look_1p9w9_133",se="_down_1p9w9_136",ne="_disable_1p9w9_139",re="_downing_1p9w9_143",le="_periodItem_1p9w9_146";var a={courseList:_,periodContent:W,cover:X,contentTitle:G,contentLabel:N,periodTitle:Z,pIcon:J,pTitle:$,pNum:ee,periodList:oe,baseBtn:te,look:ae,down:se,disable:ne,downing:re,periodItem:le},ie="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//sIb/o3j/x3b1nW//tm7/rmn/m1n/dk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hWrx6P6+pV4AWCcjV4paFeA16yKBdoxmsf5RrtiyjFat2rMaWqmgiXdYQClYTrQ0JVlYQLTUK1TQpXrG6BRoVLX7eahuZihX4NjaWD1XX10jX0P9pfrYs3oaUYAAAAAElFTkSuQmCC";function de(r){return typeof r=="function"||Object.prototype.toString.call(r)==="[object Object]"&&!K(r)}var Ce=I({name:"courseList",setup(){const r=S();H();const w=v(),s=U({titleOpacity:0,loading:!0,detail:{cover:"",name:"",des:""},list:[]}),b=async()=>{const e=await p.get(`${d.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)},L=async()=>{if(s.loading=!0,r.query.courseScheduleId)try{const e=await p.post(d.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 p.post(d.platformApi+"/courseSchedule/myCoursewareDetail/"+r.query.id);if(Array.isArray(e==null?void 0:e.data)){const o=await D(e.data);s.list=w.isApp?e.data.map(n=>{const l=o.find(i=>i.lessonCoursewareDetailId==n.lessonCoursewareDetailId),u={...n};return l&&(u.hasCache=l.hasCache),u}):e.data}}catch{}s.loading=!1};k(()=>{b(),L(),V("downloadCoursewareToCache",f)}),E(()=>{B("downloadCoursewareToCache",f)});const T=async e=>{if(!e.knowledgePointList){m({message:"\u8BE5\u8BFE\u4EF6\u6682\u65E0\u77E5\u8BC6\u70B9"});return}if(r.query.code==="select"){console.log("\u9009\u62E9\u8BFE\u65F6"),j(e);return}if(!e.hasCache){if(!Y()||e.downloadStatus==1)return;if(e.downloadStatus==3){h(e);return}try{await m({message:"\u5F53\u524D\u8BFE\u7A0B\u6CA1\u6709\u7F13\u5B58,\u662F\u5426\u7F13\u5B58?"})}catch{C(e);return}h(e);return}C(e)},C=e=>{y({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}})},D=e=>new Promise(o=>{y({api:"checkCoursewareCache",content:{data:e}},n=>{var l;if((l=n==null?void 0:n.content)!=null&&l.data){o(n.content.data);return}return[]})}),h=async e=>w.isApp?await y({api:"downloadCoursewareToCache",content:{data:e}}):!0,f=e=>{var o;if((o=e==null?void 0:e.content)!=null&&o.lessonCoursewareDetailId){const{lessonCoursewareDetailId:n,downloadStatus:l,progress:u}=e.content,i=s.list.find(O=>O.lessonCoursewareDetailId==n);i&&(i.downloadStatus=l,i.progress=u,l==2&&(i.hasCache=1,i.progress=100))}},j=async e=>{try{(await p.post(d.platformApi+"/courseSchedule/setCoursewareDetail",{params:{courseScheduleId:r.query.courseScheduleId,coursewareDetailId:e.lessonCoursewareDetailId}})).code===200&&y({api:"back"})}catch{}};return F("scroll",e=>{const o=window.scrollY||window.pageYOffset||document.documentElement.scrollTop;s.titleOpacity=o>100?1:o/100}),()=>{let e;return t("div",{class:a.courseList},[t(q,{border:!1,background:`rgba(255,255,255, ${s.titleOpacity})`,color:"rgba(124, 61, 18, 1)",title:"\u6559\u6750\u8BE6\u60C5"},null),t("div",{class:a.periodContent},[t("div",{class:a.cover},[t("img",{src:s.detail.cover,onLoad:o=>{o.target&&(o.target.style.opacity=1)}},null)]),t("div",null,[t("div",{class:a.contentTitle},[s.detail.name]),t("div",{class:a.contentLabel},[c("\u6559\u5B66\u76EE\u6807\uFF1A"),s.detail.des])])]),t(Q,{name:"van-fade"},{default:()=>[!s.loading&&t(A,null,[t("div",{key:"periodTitle",class:a.periodTitle},[t("img",{class:a.pIcon,src:x},null),t("div",{class:a.pTitle},[c("\u8BFE\u7A0B\u5217\u8868")]),t("div",{class:a.pNum},[c("\u5171"),s.list.length,c("\u8BFE")])]),t("div",{key:"list",class:a.periodList},[t(P,{inset:!0},de(e=s.list.map(o=>{const n=o.lockFlag||(r.query.code=="select"||d.platformType=="STUDENT")&&!o.unlock,l=r.query.code==="select";return t(R,{border:!0,center:!0,title:o.coursewareDetailName,label:w.isStudent?"":`\u5DF2\u4F7F\u7528${o.useNum||0}\u6B21`,onClick:()=>!n&&T(o)},{icon:()=>t("div",{class:a.periodItem},[t("div",{class:a.periodItemModel},[t("img",{src:n?ce:ie},null)])]),value:()=>t(A,null,[l?t(g,{disabled:n,class:[a.baseBtn,n?a.disable:a.look]},{default:()=>[c("\u9009\u62E9")]}):o.knowledgePointList?t(A,null,[o.hasCache?t(g,{disabled:n,class:[a.baseBtn,n?a.disable:a.look]},{default:()=>[c("\u67E5\u770B")]}):t(g,{disabled:n,class:[a.baseBtn,n?a.disable:a.down,o.downloadStatus?a.downing:""]},{default:()=>[o.downloadStatus===1?`\u4E0B\u8F7D\u4E2D ${o.progress||0}%`:o.downloadStatus===2?"\u4E0B\u8F7D\u6210\u529F":o.downloadStatus===3?"\u91CD\u65B0\u4E0B\u8F7D":"\u4E0B\u8F7D"]})]):""])})}))?e:{default:()=>[e]})])])]}),s.loading&&t(M,null,null),!s.loading&&!s.list.length&&t(z,{tips:"\u6682\u65E0\u5185\u5BB9"},null)])}}});export{Ce as default};
|