import{d as B,x as I,r as f,y as R,a7 as L,a as e,V as P,A as c,F as q,C as w,q as A,S as H,R as T,a5 as $,h,D as z,E as D}from"./index-f1aa8576.js";import{M as N}from"./index-c95dcdb9.js";import{g as p,s,a as U,b as G}from"./api-700afc28.js";import{I as y}from"./index-289931be.js";import"./index-b94ac003.js";const M="_woringBook_uv0qg_1",O="_woringHeader_uv0qg_6",V="_leftArrow_uv0qg_11",W="_title_uv0qg_14",F="_woringSecgtion_uv0qg_37",J="_woringImg_uv0qg_44",r={woringBook:M,woringHeader:O,leftArrow:V,title:W,woringSecgtion:F,woringImg:J},j=""+new URL("ai-exam-ac155650.png",import.meta.url).href,K=""+new URL("woring-practice-5f4735ad.png",import.meta.url).href,Q=""+new URL("woring-stat-fe2f9a06.png",import.meta.url).href,X=B({name:"woring",emits:["close"],setup(g,{emit:v}){const o=I({box:{height:""},show:!1,steps:[{ele:"",eleRect:{},img:p("woring1.png"),handStyle:{left:"4.5rem"},imgStyle:{width:"8.19rem",height:"3.9rem",top:"0.6rem",left:"0.8rem"},btnsStyle:{top:"5.2rem",left:"3.5rem"},type:"bottom"},{ele:"",eleRect:{},img:p("woring2.png"),handStyle:{left:"4.5rem"},imgStyle:{width:"8.19rem",height:"3.9rem",top:"0.6rem",left:"0.8rem"},btnsStyle:{top:"5.2rem",left:"3.5rem"},type:"bottom"},{ele:"",img:p("woring3.png"),handStyle:{top:"-1.39rem",left:"4.5rem",transform:"rotate(180deg)"},imgStyle:{width:"8.19rem",height:"3.9rem",top:"-7.4rem",left:"0.8rem"},btnsStyle:{top:"-2.6rem",left:"2.11rem"}}],step:0}),i=f(!1),b=f(!0),a=f({}),C=async()=>{var t;try{const n=await U({guideTag:"guideInfo"});n.data?a.value=JSON.parse((t=n.data)==null?void 0:t.guideValue)||null:a.value={},a.value&&a.value.woring?i.value=!1:i.value=!0}catch(n){console.log(n)}},u=()=>{var n;const t=document.getElementById(`woring-${o.step}`);if(t){const l=t.getBoundingClientRect();o.box={left:l.x+"px",top:l.y+"px",width:l.width+"px",height:l.height+"px"},console.log((n=o.box)==null?void 0:n.height)}else d()};R(()=>{setTimeout(()=>{var t=document.documentElement,n=t.clientWidth;n>750?(console.log("PAD"),b.value=!0):(b.value=!1,console.log("PHONE")),u(),C()},500),window.addEventListener("resize",S)});const S=()=>{u()};L(()=>{window.removeEventListener("resize",S)});const d=()=>{if(o.step>=3){m();return}o.step=o.step+1,u()},m=async()=>{a.value?a.value.woring=!0:a.value={woring:!0};try{const t=await G({guideTag:"guideInfo",guideValue:JSON.stringify(a.value)})}catch(t){console.log(t)}i.value=!1};return()=>e(P,{teleport:"body",overlay:!1,closeOnClickOverlay:!1,class:["popup-custom",s.guidePopup],show:i.value,"onUpdate:show":t=>i.value=t},{default:()=>[e("div",{class:s.content,onClick:()=>d()},[o.step!=o.steps.length-1&&e("div",{class:[s.backBtn,s.right],onClick:t=>{t.stopPropagation(),m()}},[c("跳过")]),e("div",{class:[s.box,s.noscalc],style:{...o.box},id:`modeType-${o.step}`},[o.steps.map((t,n)=>{var l,x,_,k;return e("div",{onClick:E=>E.stopPropagation(),class:s.item,style:t.type=="bottom"?{display:n===o.step?"":"none",left:`${(l=t.eleRect)==null?void 0:l.left}px`,top:`${(x=o.box)==null?void 0:x.height}`}:{display:n===o.step?"":"none",left:`${(_=t.eleRect)==null?void 0:_.left}px`,top:`${(k=t.eleRect)==null?void 0:k.top}px`}},[e("img",{class:s.img,style:t.imgStyle,src:t.img},null),e("img",{class:s.iconHead,style:t.handStyle,src:p("indexDot.png")},null),e("div",{class:s.btns,style:t.btnsStyle},[o.step+1==o.steps.length?e(q,null,[e(w,{class:[s.btn,s.sacleBtn],round:!0,color:"transparent",style:{"border-color":"#fff"},type:"primary",onClick:()=>{o.step=0,u()}},{default:()=>[c("再看一遍")]}),e(w,{class:[s.btn,s.endBtn,s.sacleBtn],round:!0,type:"primary",onClick:()=>m()},{default:()=>[c("完成")]})]):e(w,{class:[s.btn,s.sacleBtn],round:!0,type:"primary",onClick:()=>d()},{default:()=>[c("下一步 ("),o.step+1,c("/"),o.steps.length,c(")")]})])])})])])]})}}),se=B({name:"wroing-book",setup(){const g=A(),v=async()=>{try{const{data:o}=await z.post("/edu-app/studentUnitExamination/errorEdition",{hideLoading:!1,data:{page:1,rows:50}});(o||{}).total>0?g.push({path:"/error-question-mode"}):setTimeout(()=>{D("暂无错题")},100)}catch(o){}};return()=>e("div",{class:r.woringBook},[e(N,{position:"top"},{default:()=>[e(H,{border:!1,background:"transparent"},{content:()=>e("div",{class:r.woringHeader},[e("i",{onClick:()=>{T().isApp?$({api:"goBack"}):g.back()},class:["van-badge__wrapper van-icon van-icon-arrow-left van-nav-bar__arrow",r.leftArrow]},null),e("span",{class:r.title},[e("i",null,null)])])})]}),e("div",{class:r.woringSecgtion},[e(y,h({id:"woring-0"},{lazyLoad:!0,src:Q,class:r.woringImg,onClick:()=>g.push("wroing-stat")}),null),e(y,h({id:"woring-1"},{lazyLoad:!0,src:K,class:r.woringImg,onClick:v}),null),e(y,h({id:"woring-2"},{lazyLoad:!0,src:j,class:r.woringImg,onClick:()=>g.push("ai-exam")}),null)]),e(X,null,null)])}});export{se as default};
