Files
anmo/server/public/shop/assets/modal-popup.a932f194.js
2025-08-19 14:16:51 +08:00

2 lines
1.8 KiB
JavaScript
Executable File

import{g as e,y as t,o as a,c as s,w as o,b as l,d as p,t as r,e as u,j as n,aY as c,i as d,r as i,a as m}from"./index-b1ac9181.js";import{_ as f}from"./u-button.69f9d71a.js";import{_ as x}from"./u-popup.9c712d62.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,y=t({get:()=>b.show,set(e){_("update:show",e)}}),h=()=>{y.value=!1,_("cancel")},g=async()=>{if(y.value=!1,_("confirm"),"定位权限未授权"===b.title){(await uni.openSetting()).authSetting["scope.userLocation"]&&_("refresh")}};return(t,b)=>{const w=d,v=i(m("u-button"),f),j=i(m("u-popup"),x);return a(),s(j,{modelValue:n(y),"onUpdate:modelValue":b[0]||(b[0]=e=>c(y)?y.value=e:null),mode:"center","mask-close-able":!1,customStyle:{background:"none"},closeable:e.closeable,onClose:b[1]||(b[1]=e=>_("close")),"border-radius":20},{default:o((()=>[l(w,{style:{width:"600rpx","border-radius":"20rpx"},class:"modal-popup p-[40rpx] text-center"},{default:o((()=>[l(w,{class:"py-2 font-medium text-3xl text-black relative z-10"},{default:o((()=>[p(r(e.title),1)])),_:1}),l(w,{class:"py-[16px] text-base text-content relative z-10",style:{width:"500rpx",margin:"0 auto"}},{default:o((()=>[u(t.$slots,"content",{},(()=>[p(r(e.content),1)]),!0)])),_:3}),u(t.$slots,"footer",{},(()=>[l(w,{class:"flex gap-[20rpx] mt-[40rpx]"},{default:o((()=>[l(w,{class:"flex-1"},{default:o((()=>[l(v,{onClick:h},{default:o((()=>[p(" 取消 ")])),_:1})])),_:1}),l(w,{class:"flex-1"},{default:o((()=>[l(v,{type:"primary",onClick:g},{default:o((()=>[p(" 确定 ")])),_:1})])),_:1})])),_:1})]),!0)])),_:3})])),_:3},8,["modelValue","closeable"])}}}),[["__scopeId","data-v-9ae571f2"]]);export{b as M};