1 |
- import{e,f as t,w as a,j as l,B as n,i as o,A as r,t as c,u as i,g as s,C as u,E as d,N as p,y as f,c as m,l as _,m as v,k as y,F as h,r as x,v as g,br as C,bs as b}from"./index-b48a414d.js";import{_ as k}from"./_plugin-vue_export-helper.1b428a4d.js";import{_ as w}from"./phone-international-input.feef99c7.js";const S={name:"UiSwitch"},T=k(Object.assign(S,{props:{modelValue:{type:[Boolean,Number],default:!1},ui:{type:String,default:""},bg:{type:String,default:"ui-BG-Main"},text:{type:String,default:""},size:{type:String,default:"sm"},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(r,{emit:c}){const i=r,s=c,u=()=>{s("update:modelValue",!i.modelValue)};return(r,c)=>{const s=o;return e(),t(s,{class:n(["ui-switch",[{disabled:i.disabled},i.ui]])},{default:a((()=>[l(s,{class:"ui-switch-wrapper",onClick:u},{default:a((()=>[l(s,{class:n(["ui-switch-input",[{"ui-switch-input-checked":i.modelValue},i.modelValue?i.bg:"",i.text,i.size]])},null,8,["class"])])),_:1})])),_:1},8,["class"])}}}),[["__scopeId","data-v-77d22f9f"]]);const I=k({name:"SuToolbar",props:{show:{type:Boolean,default:!0},cancelText:{type:String,default:"取消"},confirmText:{type:String,default:"确认"},cancelColor:{type:String,default:"#909193"},confirmColor:{type:String,default:"#3c9cff"},title:{type:String,default:""}},methods:{cancel(){this.$emit("cancel")},confirm(){this.$emit("confirm")},preventEvent(e){e&&"function"==typeof e.stopPropagation&&e.stopPropagation()},noop(e){this.preventEvent(e)}}},[["render",function(n,p,f,m,_,v){const y=d,h=o;return f.show?(e(),t(h,{key:0,class:"u-toolbar",onTouchmove:u(v.noop,["stop","prevent"])},{default:a((()=>[l(h,{class:"u-toolbar__cancel__wrapper","hover-class":"u-hover-class"},{default:a((()=>[l(y,{class:"u-toolbar__wrapper__cancel",onClick:v.cancel,style:r({color:f.cancelColor})},{default:a((()=>[c(i(f.cancelText),1)])),_:1},8,["onClick","style"])])),_:1}),f.title?(e(),t(y,{key:0,class:"u-toolbar__title u-line-1"},{default:a((()=>[c(i(f.title),1)])),_:1})):s("",!0),l(h,{class:"u-toolbar__confirm__wrapper","hover-class":"u-hover-class"},{default:a((()=>[l(y,{class:"u-toolbar__wrapper__confirm",onClick:v.confirm,style:r({color:f.confirmColor})},{default:a((()=>[c(i(f.confirmText),1)])),_:1},8,["onClick","style"])])),_:1})])),_:1},8,["onTouchmove"])):s("",!0)}],["__scopeId","data-v-7128d250"]]),B=k({__name:"su-region-picker",props:{show:{type:Boolean,default:!1},cancelColor:{type:String,default:"#6666"},confirmColor:{type:String,default:"var(--ui-BG-Main)"},cancelText:{type:String,default:"取消"},confirmText:{type:String,default:"确认"}},emits:["confirm","cancel","change"],setup(n,{emit:s}){const u=p("areaData"),d=e=>{let t=e.length;return t<=7?"":t<9?"font-size:28rpx":"font-size: 24rpx"},k=f({currentIndex:[0,0,0],moving:!1}),S=s,T=u,B=m((()=>u[k.currentIndex[0]].children)),V=m((()=>{var e;return null==(e=B.value[k.currentIndex[1]])?void 0:e.children})),j=()=>{},z=()=>{},P=()=>{S("cancel")},E=e=>{k.currentIndex[0]!==e.detail.value[0]||k.currentIndex[1]!==e.detail.value[1]?(k.currentIndex[0]!==e.detail.value[0]&&(e.detail.value[1]=0),e.detail.value[2]=0,k.currentIndex=e.detail.value,S("change",k.currentIndex)):k.currentIndex[2]=e.detail.value[2]};return(s,u)=>{const p=_(v("su-toolbar"),I),f=o,m=C,G=b,M=_(v("su-popup"),w);return e(),t(M,{show:n.show,onClose:P,round:"20"},{default:a((()=>[l(f,{class:"ui-region-picker"},{default:a((()=>[l(p,{cancelColor:n.cancelColor,confirmColor:n.confirmColor,cancelText:n.cancelText,confirmText:n.confirmText,title:"选择区域",onCancel:P,onConfirm:u[0]||(u[0]=e=>((e=null)=>{let t=k.currentIndex,a=T[t[0]],l=B.value[t[1]],n=V.value[t[2]],o={province_name:a.name,province_id:a.id,city_name:l.name,city_id:l.id,district_name:n.name,district_id:n.id};e&&S(e,o)})("confirm"))},null,8,["cancelColor","confirmColor","cancelText","confirmText"]),l(f,{class:"ui-picker-body"},{default:a((()=>[l(G,{value:k.currentIndex,onChange:E,class:"ui-picker-view",onPickstart:j,onPickend:z},{default:a((()=>[l(m,null,{default:a((()=>[(e(!0),y(h,null,x(g(T),(n=>(e(),t(f,{class:"ui-column-item",key:n.id},{default:a((()=>[l(f,{style:r(d(n.name))},{default:a((()=>[c(i(n.name),1)])),_:2},1032,["style"])])),_:2},1024)))),128))])),_:1}),l(m,null,{default:a((()=>[(e(!0),y(h,null,x(B.value,(n=>(e(),t(f,{class:"ui-column-item",key:n.id},{default:a((()=>[l(f,{style:r(d(n.name))},{default:a((()=>[c(i(n.name),1)])),_:2},1032,["style"])])),_:2},1024)))),128))])),_:1}),l(m,null,{default:a((()=>[(e(!0),y(h,null,x(V.value,(n=>(e(),t(f,{class:"ui-column-item",key:n.id},{default:a((()=>[l(f,{style:r(d(n.name))},{default:a((()=>[c(i(n.name),1)])),_:2},1032,["style"])])),_:2},1024)))),128))])),_:1})])),_:1},8,["value"])])),_:1})])),_:1})])),_:1},8,["show"])}}},[["__scopeId","data-v-43e09180"]]);export{T as _,B as a};
|