import{d as _,D as x,r as v,G as k,H as w,c as C,a as s,w as o,a$ as h,b as a,t as E,J as V,K as B,bh as N,x as i,i as I,h as S,B as $,C as m,o as j}from"./index-DqVhJ65C.js";/* empty css                *//* empty css                        */const z={class:"p-6"},D={class:"p-6"},F={class:"flex items-center mb-8"},R={class:"text-3xl font-bold text-blue-600"},U={class:"grid grid-cols-2 gap-4 w-full"},K=_({__name:"Recharge",setup(A){const p=x(),l=v(!1),c=k(()=>p.info),t=w({amount:10,type:"alipay"}),u=async()=>{l.value=!0;try{const r=await $.post("/payment/recharge",t);r.code===0&&r.data.url?window.location.href=r.data.url:m.error(r.message||"获取支付链接失败")}catch(r){m.error(r.message||"系统错误")}finally{l.value=!1}};return(r,e)=>{const g=N,d=B,f=I,y=V,b=h;return j(),C("div",z,[s(b,{class:"max-w-3xl mx-auto dark:bg-gray-800 dark:border-gray-700"},{header:o(()=>[...e[3]||(e[3]=[a("span",{class:"text-lg font-medium dark:text-gray-100"},"余额充值",-1)])]),default:o(()=>[a("div",D,[a("div",F,[e[4]||(e[4]=a("div",{class:"text-gray-500 mr-4"},"当前余额",-1)),a("div",R,"¥"+E(c.value.balance||"0.00"),1)]),s(y,{model:t,"label-position":"top",size:"large"},{default:o(()=>[s(d,{label:"充值金额"},{default:o(()=>[s(g,{modelValue:t.amount,"onUpdate:modelValue":e[0]||(e[0]=n=>t.amount=n),min:1,max:1e4,precision:2,class:"w-full !w-full"},null,8,["modelValue"])]),_:1}),s(d,{label:"支付方式"},{default:o(()=>[a("div",U,[a("div",{class:i(["border rounded-lg p-4 cursor-pointer flex items-center justify-center transition-all",t.type==="alipay"?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"border-gray-200 dark:border-gray-600 hover:border-gray-300"]),onClick:e[1]||(e[1]=n=>t.type="alipay")},[...e[5]||(e[5]=[a("img",{src:"https://cdn-icons-png.flaticon.com/128/174/174836.png",class:"w-8 h-8 mr-2",alt:"Alipay"},null,-1),a("span",{class:"dark:text-gray-200"},"支付宝",-1)])],2),a("div",{class:i(["border rounded-lg p-4 cursor-pointer flex items-center justify-center transition-all",t.type==="wxpay"?"border-green-500 bg-green-50 dark:bg-green-900/20":"border-gray-200 dark:border-gray-600 hover:border-gray-300"]),onClick:e[2]||(e[2]=n=>t.type="wxpay")},[...e[6]||(e[6]=[a("img",{src:"https://cdn-icons-png.flaticon.com/128/3917/3917178.png",class:"w-8 h-8 mr-2",alt:"WeChat"},null,-1),a("span",{class:"dark:text-gray-200"},"微信支付",-1)])],2)])]),_:1}),s(f,{type:"primary",class:"w-full mt-6",loading:l.value,onClick:u},{default:o(()=>[...e[7]||(e[7]=[S(" 立即支付 ",-1)])]),_:1},8,["loading"])]),_:1},8,["model"])])]),_:1})])}}});export{K as default};
