import{_ as e,o as t,p as o,w as s,aq as d,B as l,e as r,F as c,y as a,v as i,a4 as n,f as u,k as b,t as y,i as m,C as p,b as f,d as x,J as g,I as k}from"./index-2PZN6pGH.js";import{_ as h}from"./uni-section.BISPxi99.js";const _=e({name:"UniSwiperDot",emits:["clickItem"],props:{info:{type:Array,default:()=>[]},current:{type:Number,default:0},dotsStyles:{type:Object,default:()=>({})},mode:{type:String,default:"default"},field:{type:String,default:""}},data:()=>({dots:{width:6,height:6,bottom:10,color:"#fff",backgroundColor:"rgba(0, 0, 0, .3)",border:"1px rgba(0, 0, 0, .3) solid",selectedBackgroundColor:"#333",selectedBorder:"1px rgba(0, 0, 0, .9) solid"}}),watch:{dotsStyles(e){this.dots=Object.assign(this.dots,this.dotsStyles)},mode(e){"indexes"===e?(this.dots.width=14,this.dots.height=14):(this.dots.width=6,this.dots.height=6)}},created(){"indexes"===this.mode&&(this.dots.width=12,this.dots.height=12),this.dots=Object.assign(this.dots,this.dotsStyles)},methods:{clickItem(e){this.$emit("clickItem",e)}}},[["render",function(e,f,x,g,k,h){const _=m,C=p;return t(),o(_,{class:"uni-swiper__warp"},{default:s((()=>[d(e.$slots,"default",{},void 0,!0),"default"===x.mode?(t(),o(_,{style:l({bottom:k.dots.bottom+"px"}),class:"uni-swiper__dots-box",key:"default"},{default:s((()=>[(t(!0),r(c,null,a(x.info,((e,s)=>(t(),o(_,{onClick:e=>h.clickItem(s),style:l({width:(s===x.current?2*k.dots.width:k.dots.width)+"px",height:k.dots.width/2+"px","background-color":s!==x.current?k.dots.backgroundColor:k.dots.selectedBackgroundColor,"border-radius":"0px"}),key:s,class:"uni-swiper__dots-item uni-swiper__dots-bar"},null,8,["onClick","style"])))),128))])),_:1},8,["style"])):i("",!0),"dot"===x.mode?(t(),o(_,{style:l({bottom:k.dots.bottom+"px"}),class:"uni-swiper__dots-box",key:"dot"},{default:s((()=>[(t(!0),r(c,null,a(x.info,((e,s)=>(t(),o(_,{onClick:e=>h.clickItem(s),style:l({width:k.dots.width+"px",height:k.dots.height+"px","background-color":s!==x.current?k.dots.backgroundColor:k.dots.selectedBackgroundColor,border:s!==x.current?k.dots.border:k.dots.selectedBorder}),key:s,class:"uni-swiper__dots-item"},null,8,["onClick","style"])))),128))])),_:1},8,["style"])):i("",!0),"round"===x.mode?(t(),o(_,{style:l({bottom:k.dots.bottom+"px"}),class:"uni-swiper__dots-box",key:"round"},{default:s((()=>[(t(!0),r(c,null,a(x.info,((e,s)=>(t(),o(_,{onClick:e=>h.clickItem(s),class:n([[s===x.current&&"uni-swiper__dots-long"],"uni-swiper__dots-item"]),style:l({width:(s===x.current?3*k.dots.width:k.dots.width)+"px",height:k.dots.height+"px","background-color":s!==x.current?k.dots.backgroundColor:k.dots.selectedBackgroundColor,border:s!==x.current?k.dots.border:k.dots.selectedBorder}),key:s},null,8,["onClick","class","style"])))),128))])),_:1},8,["style"])):i("",!0),"nav"===x.mode?(t(),o(_,{key:"nav",style:l({"background-color":x.dotsStyles.backgroundColor,bottom:"0"}),class:"uni-swiper__dots-box uni-swiper__dots-nav"},{default:s((()=>[u(C,{style:l({color:x.dotsStyles.color}),class:"uni-swiper__dots-nav-item"},{default:s((()=>[b(y(x.current+1+"/"+x.info.length+" "+x.info[x.current][x.field]),1)])),_:1},8,["style"])])),_:1},8,["style"])):i("",!0),"indexes"===x.mode?(t(),o(_,{key:"indexes",style:l({bottom:k.dots.bottom+"px"}),class:"uni-swiper__dots-box"},{default:s((()=>[(t(!0),r(c,null,a(x.info,((e,d)=>(t(),o(_,{onClick:e=>h.clickItem(d),style:l({width:k.dots.width+"px",height:k.dots.height+"px",color:d===x.current?k.dots.selectedColor:k.dots.color,"background-color":d!==x.current?k.dots.backgroundColor:k.dots.selectedBackgroundColor,border:d!==x.current?k.dots.border:k.dots.selectedBorder}),key:d,class:"uni-swiper__dots-item uni-swiper__dots-indexes"},{default:s((()=>[u(C,{class:"uni-swiper__dots-indexes-text"},{default:s((()=>[b(y(d+1),1)])),_:2},1024)])),_:2},1032,["onClick","style"])))),128))])),_:1},8,["style"])):i("",!0)])),_:3})}],["__scopeId","data-v-60e24dc5"]]);const C=e({components:{},data:()=>({info:[{colorClass:"uni-bg-red",url:"https://web-assets.dcloud.net.cn/unidoc/zh/shuijiao.jpg",content:"内容 A"},{colorClass:"uni-bg-green",url:"https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/094a9dc0-50c0-11eb-b680-7980c8a877b8.jpg",content:"内容 B"},{colorClass:"uni-bg-blue",url:"https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/094a9dc0-50c0-11eb-b680-7980c8a877b8.jpg",content:"内容 C"}],dotStyle:[{backgroundColor:"rgba(0, 0, 0, .3)",border:"1px rgba(0, 0, 0, .3) solid",color:"#fff",selectedBackgroundColor:"rgba(0, 0, 0, .9)",selectedBorder:"1px rgba(0, 0, 0, .9) solid"},{backgroundColor:"rgba(255, 90, 95,0.3)",border:"1px rgba(255, 90, 95,0.3) solid",color:"#fff",selectedBackgroundColor:"rgba(255, 90, 95,0.9)",selectedBorder:"1px rgba(255, 90, 95,0.9) solid"},{backgroundColor:"rgba(83, 200, 249,0.3)",border:"1px rgba(83, 200, 249,0.3) solid",color:"#fff",selectedBackgroundColor:"rgba(83, 200, 249,0.9)",selectedBorder:"1px rgba(83, 200, 249,0.9) solid"}],modeIndex:-1,styleIndex:-1,current:0,mode:"default",dotsStyles:{},swiperDotIndex:0}),onLoad(){},methods:{change(e){this.current=e.detail.current},selectStyle(e){this.dotsStyles=this.dotStyle[e],this.styleIndex=e},selectMode(e,t){this.mode=e,this.modeIndex=t,this.styleIndex=-1,this.dotsStyles=this.dotStyle[0]},clickItem(e){this.swiperDotIndex=e},onBanner(e){console.log(22222,e)}}},[["render",function(e,d,C,w,I,v){const B=p,S=m,j=k,M=g,U=f(x("uni-swiper-dot"),_),D=f(x("uni-section"),h);return t(),o(S,{class:"content"},{default:s((()=>[u(U,{class:"uni-swiper-dot-box",onClickItem:v.clickItem,info:I.info,current:I.current,mode:I.mode,"dots-styles":I.dotsStyles,field:"content"},{default:s((()=>[u(M,{class:"swiper-box",onChange:v.change,current:I.swiperDotIndex},{default:s((()=>[(t(),r(c,null,a(3,((e,t)=>u(j,{key:t},{default:s((()=>[u(S,{class:n(["swiper-item","swiper-item"+t])},{default:s((()=>[u(B,{style:{color:"#fff","font-size":"32px"}},{default:s((()=>[b(y(t+1),1)])),_:2},1024)])),_:2},1032,["class"])])),_:2},1024))),64))])),_:1},8,["onChange","current"])])),_:1},8,["onClickItem","info","current","mode","dots-styles"]),u(D,{title:"模式选择",type:"line"},{default:s((()=>[u(S,{class:"example-body"},{default:s((()=>[u(S,{class:n([{active:0===I.modeIndex},"example-body-item"]),onClick:d[0]||(d[0]=e=>v.selectMode("default",0))},{default:s((()=>[u(B,{class:"example-body-item-text"},{default:s((()=>[b("default")])),_:1})])),_:1},8,["class"]),u(S,{class:n([{active:1===I.modeIndex},"example-body-item"]),onClick:d[1]||(d[1]=e=>v.selectMode("dot",1))},{default:s((()=>[u(B,{class:"example-body-item-text"},{default:s((()=>[b("dot")])),_:1})])),_:1},8,["class"]),u(S,{class:n([{active:2===I.modeIndex},"example-body-item"]),onClick:d[2]||(d[2]=e=>v.selectMode("round",2))},{default:s((()=>[u(B,{class:"example-body-item-text"},{default:s((()=>[b("round")])),_:1})])),_:1},8,["class"]),u(S,{class:n([{active:3===I.modeIndex},"example-body-item"]),onClick:d[3]||(d[3]=e=>v.selectMode("nav",3))},{default:s((()=>[u(B,{class:"example-body-item-text"},{default:s((()=>[b("nav")])),_:1})])),_:1},8,["class"]),u(S,{class:n([{active:4===I.modeIndex},"example-body-item"]),onClick:d[4]||(d[4]=e=>v.selectMode("indexes",4))},{default:s((()=>[u(B,{class:"example-body-item-text"},{default:s((()=>[b("indexes")])),_:1})])),_:1},8,["class"])])),_:1})])),_:1}),u(D,{title:"颜色样式选择",type:"line"},{default:s((()=>[u(S,{class:"example-body"},{default:s((()=>["nav"!==I.mode?(t(!0),r(c,{key:0},a(I.dotStyle,((e,d)=>(t(),o(S,{class:n([{active:I.styleIndex===d},"example-body-item"]),key:d,onClick:e=>v.selectStyle(d)},{default:s((()=>[u(S,{style:l({"background-color":e.selectedBackgroundColor,border:e.selectedBorder}),class:"example-body-dots"},null,8,["style"]),u(S,{style:l({"background-color":e.backgroundColor,border:e.border}),class:"example-body-dots"},null,8,["style"]),u(S,{style:l({"background-color":e.backgroundColor,border:e.border}),class:"example-body-dots"},null,8,["style"])])),_:2},1032,["class","onClick"])))),128)):i("",!0),"nav"===I.mode?(t(!0),r(c,{key:1},a(I.dotStyle,((e,d)=>(t(),o(S,{class:n([{active:I.styleIndex===d},"example-body-item"]),key:d,style:l({"background-color":e.selectedBackgroundColor}),onClick:e=>v.selectStyle(d)},{default:s((()=>[u(B,{class:"example-body-item-text",style:l({color:e.color})},{default:s((()=>[b("内容")])),_:2},1032,["style"])])),_:2},1032,["class","style","onClick"])))),128)):i("",!0)])),_:1})])),_:1})])),_:1})}],["__scopeId","data-v-216e41a9"]]);export{C as default};