2 lines
1.8 KiB
JavaScript
2 lines
1.8 KiB
JavaScript
import{d as e,c as t,o as a,e as s,w as l,f as o,g as p,t as n,T as u,h as r,J as c,j as d,r as i,b as f}from"./index-d0750414.js";import{_ as m}from"./u-button.2adf8624.js";import{_ as x}from"./u-popup.508f1b55.js";import{_}from"./_plugin-vue_export-helper.1b428a4d.js";const b=_(e({__name:"modal-popup",props:{show:{type:Boolean},title:null,content:null,closeable:{type:Boolean}},emits:["update:show","update","refresh","close","cancel","confirm"],setup(e,{emit:_}){const b=e,h=t({get:()=>b.show,set(e){_("update:show",e)}}),y=()=>{h.value=!1,_("cancel")},g=async()=>{if(h.value=!1,_("confirm"),"定位权限未授权"===b.title){(await uni.openSetting()).authSetting["scope.userLocation"]&&_("refresh")}};return(t,b)=>{const w=d,v=i(f("u-button"),m),j=i(f("u-popup"),x);return a(),s(j,{modelValue:r(h),"onUpdate:modelValue":b[0]||(b[0]=e=>c(h)?h.value=e:null),mode:"center","mask-close-able":!1,customStyle:{background:"none"},closeable:e.closeable,onClose:b[1]||(b[1]=e=>_("close"))},{default:l(()=>[o(w,{style:{width:"600rpx","border-radius":"20rpx"},class:"modal-popup p-[40rpx] text-center"},{default:l(()=>[o(w,{class:"py-2 font-medium text-2xl text-black relative z-10"},{default:l(()=>[p(n(e.title),1)]),_:1}),o(w,{class:"py-[16px] text-base text-content relative z-10",style:{width:"500rpx",margin:"0 auto"}},{default:l(()=>[u(t.$slots,"content",{},()=>[p(n(e.content),1)],!0)]),_:3}),u(t.$slots,"footer",{},()=>[o(w,{class:"flex gap-[20rpx] mt-[40rpx]"},{default:l(()=>[o(w,{class:"flex-1"},{default:l(()=>[o(v,{onClick:y},{default:l(()=>[p(" 取消 ")]),_:1})]),_:1}),o(w,{class:"flex-1"},{default:l(()=>[o(v,{type:"primary",onClick:g},{default:l(()=>[p(" 确定 ")]),_:1})]),_:1})]),_:1})],!0)]),_:3})]),_:3},8,["modelValue","closeable"])}}}),[["__scopeId","data-v-e1b1f69f"]]);export{b as _};
|