You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
10 KiB
1 lines
10 KiB
import{r as e,_ as a,$ as l,a0 as s,a1 as t,b as u,c as o,w as n,i as c,o as i,d as r,k as f,e as d,t as v,m as p,f as y,g as _,F as m,u as w,C as k,a2 as x,a3 as g,a4 as h,a5 as I,j as T,v as b,a6 as C,a7 as j}from"./index-IX2tYR8R.js";import{_ as A}from"./u-navbar.BTvKBpLV.js";import{o as q,r as z}from"./uni-app.es.Bc5t55A8.js";import{_ as L}from"./u-icon.sW6sruaF.js";import{_ as B}from"./u-popup.CPuol-R0.js";import{_ as N,a as S,b as U,c as V,d as $,e as D}from"./sc.fc7k8zE2.js";import{c as F}from"./car.C_k88K1b.js";import{q as Q}from"./wrongQuestionBook.Beoh-3Vq.js";import{_ as E}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./u-status-bar.weuqoXTS.js";import"./u-loading-icon.pEvsKDSP.js";const H=E({__name:"brushQuestions",setup(E){const H=e("1"),M=e(["单选题","多选题","判断题"]),R=e(0),G=e(0);let J=F(),K=Q();function O(e){console.log(window),H.value!=e&&(H.value=e)}const P=e(!1);function W(){P.value=!1}function X(){l({title:"正在加载"}),P.value=!0,setTimeout((()=>{t()}),1800)}let Y=e(!1),Z=e("");function ee(){Y.value=!1,Z.value=""}async function ae(){if(!Z.value)return uni.$u.toast("请输入内容");let e={content:Z.value,questionId:le.value.id};0==(await x(e)).errorcode&&(uni.$u.toast("提交成功,感谢您的反馈"),Y.value=!1)}q((e=>{e.wrong?async function(e){let l={carType:J.carInfo.carType,chapter:J.carInfo.chapter,isHigh:"",stepType:J.carInfo.stepType,type:e};await a(l)}(e.wrong):async function(){try{l({title:"正在加载..."});let e={carType:J.carInfo.carType,stepType:J.carInfo.stepType,volume:J.carInfo.volume,types:J.carInfo.types,sift:J.carInfo.sift,contentType:J.carInfo.contentType,knowType:J.carInfo.knowType,chapter:J.carInfo.chapter,city:J.carInfo.city};const{data:a}=await s(e);t(),le.value=a.questionBank,ue(),se.value=a.quesIdList,te.value=se.value.findIndex((e=>e==le.value.id))}catch(e){t()}}()}));const le=e({});let se=e([]),te=e(0);function ue(){le.value.optionArr=[];["a","b","c","d","e","f"].forEach(((e,a)=>{let l="option"+e;if(le.value[l]){let s={key:e.toLocaleUpperCase(),text:le.value[l],index:a+1};le.value.optionArr.push(s)}})),3==le.value.types&&(le.value.optionArr[0].key="true",le.value.optionArr[1].key="false")}async function oe(e){if(2==le.value.types&&ce.value.ans&&(ce.value.answer||(ce.value.answer=ce.value.ans,await ie()),le.value.answer!=ce.value.ans&&"next"!=ce.value.isNext))return ce.value.isNext="next",!1;ce.value={},te.value=te.value+e,le.value.optionArr=[],ne()}async function ne(){console.log(te.value);let e=se.value[te.value],a={carType:J.carInfo.carType,questionId:e,sort:te.value,stepType:J.carInfo.stepType,tempId:le.value.questionDoTemp.id};const{data:l}=await g(a);le.value=l,ce.value.isNext="",ue()}const ce=e({});async function ie(){let e={answer:ce.value.answer,carType:J.carInfo.carType,questionId:le.value.id,result:ce.value.answer==le.value.answer?"0":"1",stepType:J.carInfo.stepType,tempId:le.value.questionDoTemp.id};await h(e),ce.value.answer==le.value.answer?(console.log("答对了"),ce.value={},le.value.optionArr=[],R.value++,K.lookList(le.value.id),console.log(K.wrongList),oe(1)):(G.value++,K.setList(le.value.id),console.log(K.wrongList))}async function re(){let e=1==le.value.isCollect?"0":"1";const a={carType:J.carInfo.carType,isAdd:e,questionId:le.value.id,stepType:J.carInfo.stepType};await I(a),le.value.isCollect=e,console.log(le.value.isCollect)}return(e,a)=>{const l=c,s=z(u("up-navbar"),A),t=T,x=b,g=z(u("up-icon"),L),h=C,I=z(u("up-popup"),B),q=z(u("up-textarea"),N),F=z(u("up-button"),S);return i(),o(l,{class:"content"},{default:n((()=>[r(s,{leftText:" ",title:"",safeAreaInsetTop:!1,autoBack:!0},{center:n((()=>[r(l,{class:"u-nav-slot flex"},{default:n((()=>[r(l,{class:f(["btn",{active:1==H.value}]),onClick:a[0]||(a[0]=e=>O(1))},{default:n((()=>[d("答题模式")])),_:1},8,["class"]),r(l,{class:f(["btn",{active:2==H.value}]),onClick:a[1]||(a[1]=e=>O(2))},{default:n((()=>[d("背题模式")])),_:1},8,["class"])])),_:1})])),_:1}),r(l,{class:"con padding"},{default:n((()=>[r(l,{class:"h1_row"},{default:n((()=>[r(t,{class:f(["tag",{red:2==le.value.types,blue:3==le.value.types}])},{default:n((()=>[d(v(M.value[le.value.types-1]),1)])),_:1},8,["class"]),r(t,{class:"h1",onClick:a[2]||(a[2]=e=>function(e){const a=new SpeechSynthesisUtterance(e);window.speechSynthesis.speak(a)}(le.value.title))},{default:n((()=>[d(v(le.value.title),1)])),_:1})])),_:1}),le.value.img?(i(),o(l,{key:0,class:"imgBox",style:{width:"100%",padding:"0 0 30rpx 0"}},{default:n((()=>[r(x,{src:le.value.img,mode:"widthFix"},null,8,["src"])])),_:1})):p("",!0),r(l,{class:"option"},{default:n((()=>[(i(!0),y(m,null,_(le.value.optionArr,((e,a)=>(i(),o(l,{onClick:a=>async function(e){if(!ce.value.answer)if(2!=le.value.types)e.answer=e.key,ce.value=e,ie();else if(2==le.value.types){if(ce.value.ans||(ce.value.ans=""),ce.value.ans.includes(e.key))return void(ce.value.ans=ce.value.ans.replace(e.key,""));ce.value.ans=(ce.value.ans+e.key).split("").sort().join("")}}(e)},{default:n((()=>[2!=le.value.types||ce.value.answer&&ce.value.answer!=le.value.answer?(i(),o(l,{key:1,class:"optionItem flex"},{default:n((()=>[ce.value.key||2==le.value.types?le.value.answer.includes(e.key)?(i(),o(g,{key:1,name:"checkmark-circle-fill",color:"#55ff7f",size:"20"})):(i(),o(g,{key:2,name:"close-circle-fill",color:"#ff0000",size:"20"})):(i(),o(l,{key:0,class:"icon"})),r(l,{class:"text"},{default:n((()=>[3!=le.value.types?(i(),o(t,{key:0},{default:n((()=>[d(v(e.key),1)])),_:2},1024)):p("",!0),d(" "+v(e.text),1)])),_:2},1024)])),_:2},1024)):(i(),o(l,{key:0,class:"optionItem flex"},{default:n((()=>{var a;return[(null==(a=ce.value.ans)?void 0:a.includes(e.key))?(i(),o(g,{key:0,name:"checkmark-circle-fill",color:"#55ff7f",size:"20"})):(i(),o(l,{key:1,class:"icon"})),r(l,{class:"text"},{default:n((()=>[r(t,null,{default:n((()=>[d(v(e.key),1)])),_:2},1024),d(" "+v(e.text),1)])),_:2},1024)]})),_:2},1024))])),_:2},1032,["onClick"])))),256))])),_:1}),ce.value.answer&&le.value.answer!=ce.value.answer?(i(),o(l,{key:1,class:"answerCss flex"},{default:n((()=>[r(l,{class:"ans"},{default:n((()=>[d("正确答案是 "),3==le.value.types?(i(),o(t,{key:0},{default:n((()=>[d(v("false"==le.value.answer?"错误":"正确"),1)])),_:1})):(i(),o(t,{key:1},{default:n((()=>[d(v(le.value.answer),1)])),_:1}))])),_:1}),r(l,{class:"ans"},{default:n((()=>[d("您的答案是 "),3==le.value.types?(i(),o(t,{key:0,class:"red"},{default:n((()=>[d(v("false"==ce.value.answer?"错误":"正确"),1)])),_:1})):(i(),o(t,{key:1,class:"red"},{default:n((()=>[d(v(ce.value.answer),1)])),_:1}))])),_:1})])),_:1})):p("",!0),r(l,{class:"btn_row flex-b"},{default:n((()=>[r(h,{class:f(["btn border",{disable:0==w(te)}]),onClick:a[3]||(a[3]=e=>w(j)(oe(-1),500)),disabled:0==w(te)},{default:n((()=>[d("上一题")])),_:1},8,["class","disabled"]),r(h,{class:f(["btn bg",{disable:w(te)>=w(se).length-1}]),onClick:a[4]||(a[4]=e=>w(j)(oe(1),500)),disabled:w(te)>=w(se).length-1},{default:n((()=>[d("下一题")])),_:1},8,["class","disabled"])])),_:1}),2==H.value||ce.value.answer&&ce.value.answer!=le.value.answer?(i(),o(l,{key:2,class:"analysis"},{default:n((()=>[r(l,{class:"tit"},{default:n((()=>[d("题目解析")])),_:1}),r(l,{class:"txt"},{default:n((()=>[d(v(le.value.resolving),1)])),_:1})])),_:1})):p("",!0)])),_:1}),r(l,{class:"bottomBar"},{default:n((()=>[r(l,{class:"ul"},{default:n((()=>[r(l,{class:"li"},{default:n((()=>[r(l,{class:"icon",style:{color:"#55ff7f"}},{default:n((()=>[d(v(R.value),1)])),_:1}),r(l,{class:"text"},{default:n((()=>[d("答对")])),_:1})])),_:1}),r(l,{class:"li"},{default:n((()=>[r(l,{class:"icon",style:{color:"#ff0000"}},{default:n((()=>[d(v(G.value),1)])),_:1}),r(l,{class:"text"},{default:n((()=>[d("答错")])),_:1})])),_:1}),r(l,{class:"li"},{default:n((()=>[r(l,{class:"icon"},{default:n((()=>[d(v(w(te)+1)+"/",1),r(t,{style:{color:"#999","font-size":"24rpx"}},{default:n((()=>[d(v(w(se).length),1)])),_:1})])),_:1}),r(l,{class:"text"},{default:n((()=>[d("题目")])),_:1})])),_:1}),r(l,{class:"li",onClick:a[5]||(a[5]=e=>k(Y)?Y.value=!0:Y=!0)},{default:n((()=>[r(l,{class:"icon"},{default:n((()=>[r(x,{src:U,mode:""})])),_:1}),r(l,{class:"text"},{default:n((()=>[d("反馈")])),_:1})])),_:1}),r(l,{class:"li",onClick:X},{default:n((()=>[r(l,{class:"icon"},{default:n((()=>[r(x,{src:V,mode:""})])),_:1}),r(l,{class:"text"},{default:n((()=>[d("答题卡")])),_:1})])),_:1}),r(l,{class:"li",onClick:re},{default:n((()=>[r(l,{class:"icon"},{default:n((()=>["1"==le.value.isCollect?(i(),o(x,{key:0,src:$,mode:""})):(i(),o(x,{key:1,src:D,mode:""}))])),_:1}),r(l,{class:"text"},{default:n((()=>[d("收藏")])),_:1})])),_:1})])),_:1})])),_:1}),r(I,{show:P.value,onClose:W,mode:"bottom",round:"20",closeable:""},{default:n((()=>[r(l,{class:"popupCon"},{default:n((()=>[r(l,{class:"h3"},{default:n((()=>[d("答题卡")])),_:1}),r(l,{class:"ulRow"},{default:n((()=>[r(l,{class:"ul"},{default:n((()=>[r(l,{class:"li"},{default:n((()=>[r(l,{class:"icon",style:{color:"#55ff7f"}},{default:n((()=>[d(v(R.value),1)])),_:1}),r(l,{class:"text"},{default:n((()=>[d("答对")])),_:1})])),_:1}),r(l,{class:"li"},{default:n((()=>[r(l,{class:"icon",style:{color:"#ff0000"}},{default:n((()=>[d(v(G.value),1)])),_:1}),r(l,{class:"text"},{default:n((()=>[d("答错")])),_:1})])),_:1}),r(l,{class:"li",style:{"margin-left":"auto"}},{default:n((()=>[r(l,{class:"icon"},{default:n((()=>[d(v(w(te)+1)+"/",1),r(t,{style:{color:"#999","font-size":"24rpx"}},{default:n((()=>[d(v(w(se).length),1)])),_:1})])),_:1}),r(l,{class:"text"},{default:n((()=>[d("题目")])),_:1})])),_:1})])),_:1})])),_:1}),r(l,{class:"ul2"},{default:n((()=>[(i(!0),y(m,null,_(w(se),((e,a)=>(i(),o(l,{class:"li2",key:a,onClick:e=>async function(e,a){ce.value={},te.value=a,le.value.optionArr=[],ne(),P.value=!1}(0,a)},{default:n((()=>[r(l,{class:f(["num",{active:a==w(te)}])},{default:n((()=>[d(v(a+1),1)])),_:2},1032,["class"])])),_:2},1032,["onClick"])))),128))])),_:1})])),_:1})])),_:1},8,["show"]),r(I,{show:w(Y),onClose:ee,mode:"bottom",round:"20rpx",closeable:""},{default:n((()=>[r(l,{class:"commtCon",style:{padding:"30rpx"}},{default:n((()=>[r(q,{modelValue:w(Z),"onUpdate:modelValue":a[6]||(a[6]=e=>k(Z)?Z.value=e:Z=e),modelModifiers:{trim:!0},placeholder:"请输入反馈内容",style:{"margin-top":"50rpx"},maxlength:"300"},null,8,["modelValue"]),r(F,{text:"提 交",style:{"margin-top":"20rpx"},type:"primary",onClick:ae})])),_:1})])),_:1},8,["show"])])),_:1})}}},[["__scopeId","data-v-13c56a7d"]]);export{H as default};
|