import{H as e,J as t,K as a,L as l,M as i,O as s,b as o,o as r,c as n,w as c,d as u,P as d,k as h,i as p,aw as f,N as m,ab as b,ao as C,R as g,e as y,t as v,j as S,r as _,ax as D,ay as z,az as k,u as w,C as B,m as V,f as x,g as I,F as N,aA as T,aB as A,n as G}from"./index-IX2tYR8R.js";import{_ as $}from"./u-navbar.BTvKBpLV.js";import{r as H,b as j}from"./uni-app.es.Bc5t55A8.js";import{_ as P}from"./u-icon.sW6sruaF.js";import{_ as L}from"./u-loading-icon.pEvsKDSP.js";import{_ as Q}from"./_plugin-vue_export-helper.BCo6x5W8.js";import{c as q}from"./car.C_k88K1b.js";import{q as R}from"./wrongQuestionBook.Beoh-3Vq.js";import"./u-status-bar.weuqoXTS.js";const E=Q({name:"u-switch",mixins:[a,l,e({props:{loading:{type:Boolean,default:()=>t.switch.loading},disabled:{type:Boolean,default:()=>t.switch.disabled},size:{type:[String,Number],default:()=>t.switch.size},activeColor:{type:String,default:()=>t.switch.activeColor},inactiveColor:{type:String,default:()=>t.switch.inactiveColor},modelValue:{type:[Boolean,String,Number],default:()=>t.switch.value},activeValue:{type:[String,Number,Boolean],default:()=>t.switch.activeValue},inactiveValue:{type:[String,Number,Boolean],default:()=>t.switch.inactiveValue},asyncChange:{type:Boolean,default:()=>t.switch.asyncChange},space:{type:[String,Number],default:()=>t.switch.space}}})],watch:{modelValue:{immediate:!0,handler(e){e!==this.inactiveValue&&this.activeValue}}},data:()=>({bgColor:"#ffffff"}),computed:{isActive(){return this.modelValue===this.activeValue},switchStyle(){let e={};return e.width=i(2*this.size+2),e.height=i(Number(this.size)+2),this.customInactiveColor&&(e.borderColor="rgba(0, 0, 0, 0)"),e.backgroundColor=this.isActive?this.activeColor:this.inactiveColor,e},nodeStyle(){let e={};e.width=i(this.size-this.space),e.height=i(this.size-this.space);const t=this.isActive?i(this.space):i(this.size);return e.transform=`translateX(-${t})`,e},bgStyle(){let e={};return e.width=i(2*Number(this.size)-this.size/2),e.height=i(this.size),e.backgroundColor=this.inactiveColor,e.transform=`scale(${this.isActive?0:1})`,e},customInactiveColor(){return"#fff"!==this.inactiveColor&&"#ffffff"!==this.inactiveColor}},emits:["update:modelValue","change"],methods:{addStyle:s,clickHandler(){if(!this.disabled&&!this.loading){const e=this.isActive?this.inactiveValue:this.activeValue;this.asyncChange||this.$emit("update:modelValue",e),this.$nextTick((()=>{this.$emit("change",e)}))}}}},[["render",function(e,t,a,l,i,s){const f=p,m=H(o("u-loading-icon"),L);return r(),n(f,{class:h(["u-switch cursor-pointer",[e.disabled&&"u-switch--disabled"]]),style:d([s.switchStyle,s.addStyle(e.customStyle)]),onClick:s.clickHandler},{default:c((()=>[u(f,{class:"u-switch__bg",style:d([s.bgStyle])},null,8,["style"]),u(f,{class:h(["u-switch__node",[e.modelValue&&"u-switch__node--on"]]),style:d([s.nodeStyle]),ref:"u-switch__node"},{default:c((()=>[u(m,{show:e.loading,mode:"circle",timingFunction:"linear",color:e.modelValue?e.activeColor:"#AAABAD",size:.6*e.size},null,8,["show","color","size"])])),_:1},8,["class","style"])])),_:1},8,["class","style","onClick"])}],["__scopeId","data-v-82b7622f"]]);const F=Q({name:"u-radio",mixins:[a,l,e({props:{name:{type:[String,Number,Boolean],default:()=>t.radio.name},shape:{type:String,default:()=>t.radio.shape},disabled:{type:[String,Boolean],default:()=>t.radio.disabled},labelDisabled:{type:[String,Boolean],default:()=>t.radio.labelDisabled},activeColor:{type:String,default:()=>t.radio.activeColor},inactiveColor:{type:String,default:()=>t.radio.inactiveColor},iconSize:{type:[String,Number],default:()=>t.radio.iconSize},labelSize:{type:[String,Number],default:()=>t.radio.labelSize},label:{type:[String,Number],default:()=>t.radio.label},size:{type:[String,Number],default:()=>t.radio.size},color:{type:String,default:()=>t.radio.color},labelColor:{type:String,default:()=>t.radio.labelColor},iconColor:{type:String,default:()=>t.radio.iconColor}}})],data:()=>({checked:!1,parentData:{iconSize:12,labelDisabled:null,disabled:null,shape:null,activeColor:null,inactiveColor:null,size:18,value:null,modelValue:null,iconColor:null,placement:"row",borderBottom:!1,iconPlacement:"left"}}),computed:{elDisabled(){return""!==this.disabled?this.disabled:null!==this.parentData.disabled&&this.parentData.disabled},elLabelDisabled(){return""!==this.labelDisabled?this.labelDisabled:null!==this.parentData.labelDisabled&&this.parentData.labelDisabled},elSize(){return this.size?this.size:this.parentData.size?this.parentData.size:21},elIconSize(){return this.iconSize?this.iconSize:this.parentData.iconSize?this.parentData.iconSize:12},elActiveColor(){return this.activeColor?this.activeColor:this.parentData.activeColor?this.parentData.activeColor:"#2979ff"},elInactiveColor(){return this.inactiveColor?this.inactiveColor:this.parentData.inactiveColor?this.parentData.inactiveColor:"#c8c9cc"},elLabelColor(){return this.labelColor?this.labelColor:this.parentData.labelColor?this.parentData.labelColor:"#606266"},elShape(){return this.shape?this.shape:this.parentData.shape?this.parentData.shape:"circle"},elLabelSize(){return i(this.labelSize?this.labelSize:this.parentData.labelSize?this.parentData.labelSize:"15")},elIconColor(){const e=this.iconColor?this.iconColor:this.parentData.iconColor?this.parentData.iconColor:"#ffffff";return this.elDisabled?this.checked?this.elInactiveColor:"transparent":this.checked?e:"transparent"},iconClasses(){let e=[];return e.push("u-radio__icon-wrap--"+this.elShape),this.elDisabled&&e.push("u-radio__icon-wrap--disabled"),this.checked&&this.elDisabled&&e.push("u-radio__icon-wrap--disabled--checked"),e},iconWrapStyle(){const e={};return e.backgroundColor=this.checked&&!this.elDisabled?this.elActiveColor:"#ffffff",e.borderColor=this.checked&&!this.elDisabled?this.elActiveColor:this.elInactiveColor,e.width=i(this.elSize),e.height=i(this.elSize),"right"===this.parentData.iconPlacement&&(e.marginRight=0),e},radioStyle(){const e={};return this.parentData.borderBottom&&this.parentData.placement,this.parentData.borderBottom&&"column"===this.parentData.placement&&(e.paddingBottom="ios"===f()?"12px":"8px"),m(e,s(this.customStyle))}},mounted(){this.init()},emits:["change"],methods:{init(){this.updateParentData(),this.parent,this.checked=this.name===this.parentData.modelValue},updateParentData(){this.getParentData("u-radio-group")},iconClickHandler(e){this.preventEvent(e),this.elDisabled||this.setRadioCheckedStatus()},wrapperClickHandler(e){"right"===this.parentData.iconPlacement&&this.iconClickHandler(e)},labelClickHandler(e){this.preventEvent(e),this.elLabelDisabled||this.elDisabled||this.setRadioCheckedStatus()},emitEvent(){this.checked||(this.$emit("change",this.name),this.$nextTick((()=>{b(this,"change")})))},setRadioCheckedStatus(){this.emitEvent(),this.checked=!0,"function"==typeof this.parent.unCheckedOther&&this.parent.unCheckedOther(this)}}},[["render",function(e,t,a,l,i,s){const f=H(o("u-icon"),P),m=p,b=S;return r(),n(m,{class:h(["u-radio cursor-pointer",[`u-radio-label--${i.parentData.iconPlacement}`,i.parentData.borderBottom&&"column"===i.parentData.placement&&"u-border-bottom"]]),onClick:C(s.wrapperClickHandler,["stop"]),style:d([s.radioStyle])},{default:c((()=>[u(m,{class:h(["u-radio__icon-wrap cursor-pointer",s.iconClasses]),onClick:C(s.iconClickHandler,["stop"]),style:d([s.iconWrapStyle])},{default:c((()=>[g(e.$slots,"icon",{},(()=>[u(f,{class:"u-radio__icon-wrap__icon",name:"checkbox-mark",size:s.elIconSize,color:s.elIconColor},null,8,["size","color"])]),!0)])),_:3},8,["onClick","class","style"]),u(b,{class:"u-radio__text",onClick:C(s.labelClickHandler,["stop"]),style:d({color:s.elDisabled?s.elInactiveColor:s.elLabelColor,fontSize:s.elLabelSize,lineHeight:s.elLabelSize})},{default:c((()=>[y(v(e.label),1)])),_:1},8,["onClick","style"])])),_:3},8,["onClick","style","class"])}],["__scopeId","data-v-3a9475e5"]]);const O=Q({name:"u-radio-group",mixins:[a,l,e({props:{modelValue:{type:[String,Number,Boolean],default:()=>t.radioGroup.value},disabled:{type:Boolean,default:()=>t.radioGroup.disabled},shape:{type:String,default:()=>t.radioGroup.shape},activeColor:{type:String,default:()=>t.radioGroup.activeColor},inactiveColor:{type:String,default:()=>t.radioGroup.inactiveColor},name:{type:String,default:()=>t.radioGroup.name},size:{type:[String,Number],default:()=>t.radioGroup.size},placement:{type:String,default:()=>t.radioGroup.placement},label:{type:[String],default:()=>t.radioGroup.label},labelColor:{type:[String],default:()=>t.radioGroup.labelColor},labelSize:{type:[String,Number],default:()=>t.radioGroup.labelSize},labelDisabled:{type:Boolean,default:()=>t.radioGroup.labelDisabled},iconColor:{type:String,default:()=>t.radioGroup.iconColor},iconSize:{type:[String,Number],default:()=>t.radioGroup.iconSize},borderBottom:{type:Boolean,default:()=>t.radioGroup.borderBottom},iconPlacement:{type:String,default:()=>t.radio.iconPlacement}}})],computed:{parentData(){return[this.modelValue,this.disabled,this.inactiveColor,this.activeColor,this.size,this.labelDisabled,this.shape,this.iconSize,this.borderBottom,this.placement]},bemClass(){return this.bem("radio-group",["placement"])}},watch:{parentData(){this.children.length&&this.children.map((e=>{"function"==typeof e.init&&e.init()}))}},data:()=>({}),created(){this.children=[]},emits:["update:modelValue","change"],methods:{unCheckedOther(e){this.children.map((t=>{e!==t&&(t.checked=!1)}));const{name:t}=e;this.$emit("update:modelValue",t),this.$emit("change",t)}}},[["render",function(e,t,a,l,i,s){const o=p;return r(),n(o,{class:h(["u-radio-group",s.bemClass])},{default:c((()=>[g(e.$slots,"default",{},void 0,!0)])),_:3},8,["class"])}],["__scopeId","data-v-28f54ca8"]]),W=Q({__name:"wrongQuestion",setup(e){let t=q(),a=R();_(!1);const l=_(1);function i(e){l.value=e,s.value={},f.value=[],d(),m()}_([]);let s=_({});async function d(){const{data:e}=await z({stepType:t.carInfo.stepType,carType:t.carInfo.carType,city:t.carInfo.city,type:l.value});s.value=e,console.log(e)}const f=_([]);async function m(){const{data:e}=await k({stepType:t.carInfo.stepType,carType:t.carInfo.carType,type:l.value});f.value=e,console.log(e)}function b(e){console.log(e)}j((()=>{d(),m()}));let C=D({get:()=>!!a.frequency,set(e){let t=e?1:0;a.setFrequency(t)}}),g=D({get:()=>a.frequency,set(e){a.setFrequency(e)}});function S(){T({title:"确定要全部移除吗?",async success(){let e={carType:t.carInfo.carType,questionId:"",stepType:t.carInfo.stepType,type:l.value};await A(e),d(),m()}})}function L(e,t){if(!t)return uni.$u.toast("暂无题目");G({url:e})}return(e,a)=>{const d=p,m=H(o("up-navbar"),$),_=H(o("u-icon"),P),D=H(o("u-switch"),E),z=H(o("up-radio"),F),k=H(o("up-radio-group"),O);return r(),n(d,{class:"content"},{default:c((()=>[u(m,{leftText:" ",leftIconColor:"#fff",safeAreaInsetTop:!0,autoBack:!0,bgColor:"transparent"},{center:c((()=>[u(d,{class:"u-nav-slot flex"},{default:c((()=>[u(d,{class:h(["btn",{active:1==l.value}]),onClick:a[0]||(a[0]=e=>i(1))},{default:c((()=>[y("错题本")])),_:1},8,["class"]),u(d,{class:h(["btn",{active:2==l.value}]),onClick:a[1]||(a[1]=e=>i(2))},{default:c((()=>[y("收藏夹")])),_:1},8,["class"])])),_:1})])),_:1}),u(d,{class:"card"},{default:c((()=>[u(d,{class:"h7"},{default:c((()=>[y("我的"+v(2==l.value?"收藏":"错题"),1)])),_:1}),u(d,{class:"flex-b"},{default:c((()=>[u(d,{class:"cardBg"},{default:c((()=>[u(d,{class:"flex",onClick:a[2]||(a[2]=e=>L("/pages/exercises/brushQuestions/wrongQuestions?wrong="+l.value,w(s).allCount))},{default:c((()=>[u(d,{class:"label"},{default:c((()=>[y("全部"+v(2==l.value?"收藏":"错题"),1)])),_:1}),u(_,{name:"arrow-right",color:"#fff",size:"14"})])),_:1}),u(d,{class:"num"},{default:c((()=>[y(v(w(s).allCount),1)])),_:1})])),_:1}),u(d,{class:h(["cardBg",{green:2==l.value}])},{default:c((()=>[u(d,{class:"flex",onClick:a[3]||(a[3]=e=>L("/pages/exercises/brushQuestions/wrongQuestions?wrong="+l.value+"&isHigh=1",w(s).highCount))},{default:c((()=>[u(d,{class:"label"},{default:c((()=>[y(v(2==l.value?"今日收藏":"高频错题"),1)])),_:1}),u(_,{name:"arrow-right",color:"#fff",size:"14"})])),_:1}),u(d,{class:"num"},{default:c((()=>[y(v(w(s).highCount),1)])),_:1})])),_:1},8,["class"])])),_:1}),1==l.value?(r(),n(d,{key:0,class:"flex-b"},{default:c((()=>[u(d,{class:"h8"},{default:c((()=>[y("答对题后自动移除错题")])),_:1}),u(D,{modelValue:w(C),"onUpdate:modelValue":a[4]||(a[4]=e=>B(C)?C.value=e:C=e),onChange:b},null,8,["modelValue"])])),_:1})):V("",!0)])),_:1}),f.value.length?(r(),n(d,{key:0,class:"card"},{default:c((()=>[u(d,{class:"flex-b"},{default:c((()=>[u(d,{class:"h7"},{default:c((()=>[y("章节练习")])),_:1}),u(d,{class:"rightall",onClick:S},{default:c((()=>[u(_,{name:"trash",color:"#ccc",size:"14"}),u(d,{class:"txt"},{default:c((()=>[y("全部移除")])),_:1})])),_:1})])),_:1}),w(C)&&1==l.value?(r(),n(d,{key:0,class:"radioWrap"},{default:c((()=>[u(k,{modelValue:w(g),"onUpdate:modelValue":a[5]||(a[5]=e=>B(g)?g.value=e:g=e)},{default:c((()=>[u(z,{label:"答对1次就移除",name:1,class:"mr"}),u(z,{label:"答对3次就移除",name:3,class:"mr"})])),_:1},8,["modelValue"])])),_:1})):V("",!0),u(d,{class:"ul"},{default:c((()=>[(r(!0),x(N,null,I(f.value,((e,a)=>(r(),n(d,{class:"li",key:a,onClick:a=>function(e){if(!e.total)return uni.$u.toast("暂无题目");t.setCar("chapter",e.param),G({url:"/pages/exercises/brushQuestions/wrongQuestions?wrong="+l.value})}(e)},{default:c((()=>[u(d,{class:"num"},{default:c((()=>[y(v(a+1),1)])),_:2},1024),u(d,{class:"txt"},{default:c((()=>[y(v(e.name),1)])),_:2},1024),u(d,{class:"rightBox"},{default:c((()=>[u(d,{class:"p"},{default:c((()=>[y("错"+v(e.total)+"题",1)])),_:2},1024),u(_,{name:"arrow-right",color:"#D9D9D9",size:"14"})])),_:2},1024)])),_:2},1032,["onClick"])))),128))])),_:1})])),_:1})):V("",!0)])),_:1})}}},[["__scopeId","data-v-f61fe94a"]]);export{W as default};