import{d as c,q as l,U as u,x as f,y as g,a as e,S as p,A as m,a0 as w,D as s,E as k}from"./index-5a763f46.js";import{M as I}from"./index-cb91d786.js";import{s as t}from"./index.module-f5d891ba.js";import{u as y,a as b}from"./index-689e945e.js";const h=""+new URL("icon-exam-question-ebdee0f1.png",import.meta.url).href,E=c({name:"unit-detail",setup(){const n=l(),i=u(),o=f({detailId:i.query.detailId,loading:!1,background:"transparent",color:"#fff",dataInfo:{}}),r=async()=>{o.loading=!0;try{const{data:a}=await s.get("/edu-app/lessonCoursewareKnowledgeDetail/detail/"+o.detailId);o.dataInfo=a}catch(a){}o.loading=!1},d=async()=>{try{const{data:a}=await s.get("/edu-app/studentUnitExamination/checkKnowledgePointIds",{params:{knowledgePointIds:o.dataInfo.knowledgePointIds}});if(a)n.push({path:"/practice-mode",query:{knowledgePointIds:o.dataInfo.knowledgePointIds}});else{setTimeout(()=>{k("暂无题目")},100);return}}catch(a){}};return g(()=>{y(document,"scroll",()=>{const{y:a}=b();a.value>52?(o.background="#fff",o.color="#323333"):(o.background="transparent",o.color="#fff")}),r()}),()=>e("div",{class:t.knowledgeLibrary},[e(I,{position:"top"},{default:()=>[e(p,{border:!1,background:o.background,color:o.color},{right:()=>e("div",{class:t.wroingBtn,onClick:()=>n.push("/wroing-book")},[e("i",{class:t.iconWroing},null),m("错题本")])})]}),e("div",{class:[t.containerSection,t.woringSection]},[o.dataInfo.desc&&e("div",{class:t.woringContent,innerHTML:o.dataInfo.desc},null),!o.dataInfo.desc&&!o.loading&&e("div",{class:t.woringContent},[e(w,{description:"暂无内容",style:{paddingTop:"40px"}},null)])]),e("img",{src:h,class:t.iconExamQuestion,onClick:d},null)])}});export{E as default};
