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